root = Card([header, zoneSelector, severitySummary, rescuedCasualties, incidentsTable, resourcesTable, sheltersTable, routesTable, weatherTable, volunteersTable, donationsTable, aidRequestsTable, commsTable, roadsTable, hospitalsTable, tasksTable, resourceRequestForm, broadcastForm, sitrepForm])
header = CardHeader("Emergency Response Coordination Center", "Real-time situation dashboard — all zones")
zoneSelector = Select("focus_zone", zoneOptions, "Select zone to focus", null, null, "medium")
zoneOptions = [zoneAll, zoneNorth, zoneSouth, zoneEast, zoneWest, zoneCentral]
zoneAll = SelectItem("all", "All Zones")
zoneNorth = SelectItem("north", "North Zone")
zoneSouth = SelectItem("south", "South Zone")
zoneEast = SelectItem("east", "East Zone")
zoneWest = SelectItem("west", "West Zone")
zoneCentral = SelectItem("central", "Central Zone")
severitySummary = Card([severityHeading, severityChart], "sunk")
severityHeading = Heading("Overall Severity Summary", "h3")
severityChart = PieChart(severityLabels, severityValues, "donut", "circular")
severityLabels = ["Critical", "High", "Medium", "Low"]
severityValues = [3, 7, 12, 8]
rescuedCasualties = Card([rescuedCard, casualtiesCard], "card", "row", "m")
rescuedCard = Card([rescuedLabel, rescuedValue], "card", "column", "xs", "center")
rescuedLabel = TextContent("People Rescued", "small-heavy")
rescuedValue = TextContent("1,247", "large-heavy")
casualtiesCard = Card([casualtiesLabel, casualtiesValue], "card", "column", "xs", "center")
casualtiesLabel = TextContent("Casualties", "small-heavy")
casualtiesValue = TextContent("89", "large-heavy")
incidentsTable = Card([incidentsHeading, incidentsTableComp], "sunk")
incidentsHeading = Heading("Active Incidents by Zone", "h3")
incidentsTableComp = Table([incZoneCol, incTypeCol, incSeverityCol, incStatusCol, incSinceCol])
incZoneCol = Col("Zone", ["North", "North", "South", "East", "West", "Central", "Central", "East"])
incTypeCol = Col("Type", ["Flood", "Fire", "Landslide", "Flood", "Building Collapse", "Chemical Spill", "Fire", "Gas Leak"])
incSeverityCol = Col("Severity", ["Critical", "High", "High", "Critical", "Critical", "High", "Medium", "Medium"])
incStatusCol = Col("Status", ["Active", "Contained", "Active", "Active", "Active", "Contained", "Active", "Active"])
incSinceCol = Col("Since", ["02:15", "04:30", "01:45", "03:20", "05:10", "06:00", "07:30", "08:15"])
resourcesTable = Card([resourcesHeading, resourcesTableComp], "sunk")
resourcesHeading = Heading("Available Resources", "h3")
resourcesTableComp = Table([resTypeCol, resAvailableCol, resDeployedCol, resTotalCol])
resTypeCol = Col("Resource", ["Fire Engines", "Ambulances", "Helicopters", "Boats", "Personnel (FF)", "Personnel (Medic)", "Personnel (SAR)", "Water Tankers", "Generators", "Food Pallets", "Medical Kits", "Tents"])
resAvailableCol = Col("Available", [12, 8, 3, 6, 45, 32, 28, 4, 15, 120, 200, 80])
resDeployedCol = Col("Deployed", [18, 15, 2, 4, 78, 41, 22, 6, 10, 80, 150, 45])
resTotalCol = Col("Total", [30, 23, 5, 10, 123, 73, 50, 10, 25, 200, 350, 125])
sheltersTable = Card([sheltersHeading, sheltersTableComp], "sunk")
sheltersHeading = Heading("Shelters — Capacity & Occupancy", "h3")
sheltersTableComp = Table([shNameCol, shZoneCol, shCapacityCol, shOccupancyCol, shAvailableCol, shStatusCol])
shNameCol = Col("Shelter", ["North High School", "South Community Center", "East Arena", "West Church", "Central Stadium", "North Library", "South Gym", "East College"])
shZoneCol = Col("Zone", ["North", "South", "East", "West", "Central", "North", "South", "East"])
shCapacityCol = Col("Capacity", [500, 300, 800, 200, 1200, 150, 250, 600])
shOccupancyCol = Col("Occupancy", [420, 280, 650, 180, 950, 120, 200, 400])
shAvailableCol = Col("Available", [80, 20, 150, 20, 250, 30, 50, 200])
shStatusCol = Col("Status", ["Near Full", "Full", "Moderate", "Full", "Moderate", "Open", "Open", "Open"])
routesTable = Card([routesHeading, routesTableComp], "sunk")
routesHeading = Heading("Evacuation Routes Status", "h3")
routesTableComp = Table([rtNameCol, rtZoneCol, rtStatusCol, rtNotesCol])
rtNameCol = Col("Route", ["North Hwy 101", "South I-5", "East Route 99", "West Coastal Rd", "Central Blvd", "North Bridge Rd", "South Valley Dr"])
rtZoneCol = Col("Zone", ["North", "South", "East", "West", "Central", "North", "South"])
rtStatusCol = Col("Status", ["Open", "Closed", "Open", "Partial", "Open", "Closed", "Open"])
rtNotesCol = Col("Notes", ["Clear", "Flooded", "Clear", "Debris", "Clear", "Structural damage", "Clear"])
weatherTable = Card([weatherHeading, weatherTableComp], "sunk")
weatherHeading = Heading("Weather Forecast — Next 48 Hours", "h3")
weatherTableComp = Table([wxTimeCol, wxConditionCol, wxTempCol, wxWindCol, wxPrecipCol, wxAlertCol])
wxTimeCol = Col("Time", ["Now", "+6h", "+12h", "+18h", "+24h", "+30h", "+36h", "+42h", "+48h"])
wxConditionCol = Col("Condition", ["Heavy Rain", "Heavy Rain", "Thunderstorms", "Rain", "Cloudy", "Partly Cloudy", "Clear", "Clear", "Sunny"])
wxTempCol = Col("Temp (°C)", [18, 17, 16, 15, 14, 15, 17, 19, 21])
wxWindCol = Col("Wind (km/h)", [45, 50, 55, 40, 30, 25, 20, 15, 10])
wxPrecipCol = Col("Precip (%)", [90, 95, 80, 60, 30, 10, 0, 0, 0])
wxAlertCol = Col("Alert", ["Flash Flood", "Flash Flood", "Severe Storm", "Flood Watch", "None", "None", "None", "None", "None"])
volunteersTable = Card([volunteersHeading, volunteersTableComp], "sunk")
volunteersHeading = Heading("Volunteers On Duty", "h3")
volunteersTableComp = Table([volNameCol, volZoneCol, volRoleCol, volAssignmentCol, volSinceCol])
volNameCol = Col("Volunteer", ["A. Martinez", "J. Chen", "R. Patel", "S. Williams", "M. Garcia", "K. Johnson", "L. Kim", "D. Brown", "P. Singh", "N. Taylor"])
volZoneCol = Col("Zone", ["North", "South", "East", "West", "Central", "North", "South", "East", "West", "Central"])
volRoleCol = Col("Role", ["Medical", "Logistics", "SAR", "Comms", "Shelter", "Medical", "Logistics", "SAR", "Comms", "Shelter"])
volAssignmentCol = Col("Assignment", ["North High Shelter", "South Supply Depot", "East Search Grid 4", "West Comms Relay", "Central Triage", "North Field Hospital", "South Evac Assist", "East Rescue Ops", "West Info Desk", "Central Family Reunion"])
volSinceCol = Col("On Duty Since", ["06:00", "06:00", "06:00", "06:00", "06:00", "12:00", "12:00", "12:00", "12:00", "12:00"])
donationsTable = Card([donationsHeading, donationsTableComp], "sunk")
donationsHeading = Heading("Donations Received", "h3")
donationsTableComp = Table([donTypeCol, donQtyCol, donValueCol, donSourceCol, donStatusCol])
donTypeCol = Col("Type", ["Water", "Food", "Medical Supplies", "Clothing", "Blankets", "Hygiene Kits", "Baby Supplies", "Pet Food"])
donQtyCol = Col("Quantity", [5000, 3000, 1200, 800, 1500, 600, 200, 300])
donValueCol = Col("Est. Value", ["$15,000", "$45,000", "$120,000", "$16,000", "$30,000", "$18,000", "$8,000", "$4,500"])
donSourceCol = Col("Source", ["Red Cross", "Local Business", "Hospital Network", "Community Drive", "NGO Partner", "Corporate Donor", "Church Group", "Pet Store Chain"])
donStatusCol = Col("Status", ["Received", "Received", "Received", "Received", "In Transit", "Received", "Received", "In Transit"])
aidRequestsTable = Card([aidHeading, aidTableComp], "sunk")
aidHeading = Heading("Aid Requests Awaiting Action", "h3")
aidTableComp = Table([aidIdCol, aidZoneCol, aidTypeCol, aidUrgencyCol, aidDetailsCol, aidSinceCol])
aidIdCol = Col("ID", ["REQ-001", "REQ-002", "REQ-003", "REQ-004", "REQ-005", "REQ-006", "REQ-007"])
aidZoneCol = Col("Zone", ["North", "South", "East", "West", "Central", "North", "South"])
aidTypeCol = Col("Type", ["Medical Evac", "Food/Water", "Shelter", "Rescue", "Medical Supplies", "Comms Restore", "Pet Rescue"])
aidUrgencyCol = Col("Urgency", ["Critical", "High", "High", "Critical", "Medium", "High", "Medium"])
aidDetailsCol = Col("Details", ["5 critical patients", "200 families isolated", "Shelter at capacity", "3 trapped in building", "Field hospital low", "Tower down", "15 animals stranded"])
aidSinceCol = Col("Since", ["04:20", "05:15", "06:30", "07:00", "07:45", "08:10", "08:30"])
commsTable = Card([commsHeading, commsTableComp], "sunk")
commsHeading = Heading("Communication Channels Status", "h3")
commsTableComp = Table([comChannelCol, comTypeCol, comZoneCol, comStatusCol, comLastCheckCol])
comChannelCol = Col("Channel", ["Primary Radio", "Backup Radio", "Cell Network", "Satellite Phone", "Mesh Network", "Internet", "Emergency Alert", "Ham Radio"])
comTypeCol = Col("Type", ["VHF", "UHF", "4G/5G", "Iridium", "LoRa", "Fiber/DSL", "EAS", "HF"])
comZoneCol = Col("Coverage", ["All", "All", "All", "All", "North/South", "Central/East", "All", "All"])
comStatusCol = Col("Status", ["Operational", "Operational", "Degraded", "Operational", "Operational", "Down", "Operational", "Operational"])
comLastCheckCol = Col("Last Check", ["08:45", "08:45", "08:40", "08:45", "08:45", "08:30", "08:45", "08:45"])
roadsTable = Card([roadsHeading, roadsList], "sunk")
roadsHeading = Heading("Roads Closed", "h3")
roadsList = ListBlock(roadItems, "number")
roadItems = [road1, road2, road3, road4, road5, road6, road7]
road1 = ListItem("Hwy 101 — Mile 12-18 (North)", "Flooded — impassable", null, null)
road2 = ListItem("I-5 South — Exit 45-52 (South)", "Landslide — both directions", null, null)
road3 = ListItem("Route 99 — Bridge at km 33 (East)", "Structural damage — closed", null, null)
road4 = ListItem("Coastal Rd — Segment 7-11 (West)", "Debris & erosion — partial", null, null)
road5 = ListItem("Central Blvd — 3rd to 8th Ave (Central)", "Gas leak — evacuation zone", null, null)
road6 = ListItem("Bridge Rd — Old Town Bridge (North)", "Collapse risk — closed", null, null)
road7 = ListItem("Valley Dr — Creek crossing (South)", "Washed out — impassable", null, null)
hospitalsTable = Card([hospitalsHeading, hospitalsTableComp], "sunk")
hospitalsHeading = Heading("Nearby Hospitals — Free Beds", "h3")
hospitalsTableComp = Table([hospNameCol, hospZoneCol, hospTotalCol, hospFreeCol, hospICUFreeCol, hospStatusCol])
hospNameCol = Col("Hospital", ["North General", "South Regional", "East Medical Center", "West County", "Central University", "North Clinic", "South Trauma"])
hospZoneCol = Col("Zone", ["North", "South", "East", "West", "Central", "North", "South"])
hospTotalCol = Col("Total Beds", [350, 420, 280, 200, 600, 80, 150])
hospFreeCol = Col("Free Beds", [45, 62, 38, 25, 120, 12, 30])
hospICUFreeCol = Col("Free ICU", [3, 5, 2, 1, 8, 0, 2])
hospStatusCol = Col("Status", ["Accepting", "Accepting", "Accepting", "Diverting", "Accepting", "Full", "Accepting"])
tasksTable = Card([tasksHeading, tasksTableComp], "sunk")
tasksHeading = Heading("Open Tasks", "h3")
tasksTableComp = Table([taskIdCol, taskDescCol, taskAssigneeCol, taskZoneCol, taskPriorityCol, taskDueCol])
taskIdCol = Col("ID", ["TASK-001", "TASK-002", "TASK-003", "TASK-004", "TASK-005", "TASK-006", "TASK-007", "TASK-008"])
taskDescCol = Col("Description", ["Establish comms at North Shelter", "Deliver water to South Zone", "Evacuate East Zone Sector 4", "Set up field hospital Central", "Repair West Zone generator", "Coordinate volunteer transport", "Restock medical kits North", "Clear debris Route 99"])
taskAssigneeCol = Col("Assignee", ["J. Chen", "R. Patel", "S. Williams", "M. Garcia", "K. Johnson", "L. Kim", "D. Brown", "P. Singh"])
taskZoneCol = Col("Zone", ["North", "South", "East", "Central", "West", "All", "North", "East"])
taskPriorityCol = Col("Priority", ["High", "Critical", "Critical", "High", "High", "Medium", "Medium", "High"])
taskDueCol = Col("Due", ["10:00", "09:30", "10:00", "11:00", "10:30", "12:00", "11:30", "10:00"])
resourceRequestForm = Card([resourceFormHeading, resourceForm], "card")
resourceFormHeading = Heading("Request Additional Resources", "h3")
resourceForm = Form("resource-request", resourceFormButtons, [resTypeField, resQtyField, resZoneField, resJustificationField])
resTypeField = FormControl("Resource Type", resTypeSelect, "Select the type of resource needed")
resTypeSelect = Select("resource_type", resTypeOptions, "Choose resource type")
resTypeOptions = [resType1, resType2, resType3, resType4, resType5, resType6, resType7, resType8]
resType1 = SelectItem("fire_engine", "Fire Engine")
resType2 = SelectItem("ambulance", "Ambulance")
resType3 = SelectItem("helicopter", "Helicopter")
resType4 = SelectItem("boat", "Rescue Boat")
resType5 = SelectItem("personnel_ff", "Firefighter Personnel")
resType6 = SelectItem("personnel_medic", "Medical Personnel")
resType7 = SelectItem("personnel_sar", "SAR Personnel")
resType8 = SelectItem("supplies", "Supplies (Water/Food/Medical)")
resQtyField = FormControl("Quantity", resQtyInput, "Number of units requested")
resQtyInput = Input("quantity", "1", "number")
resZoneField = FormControl("Target Zone", resZoneSelect, "Zone where resources will be deployed")
resZoneSelect = Select("target_zone", resZoneOptions, "Select zone")
resZoneOptions = [resZone1, resZone2, resZone3, resZone4, resZone5, resZone6]
resZone1 = SelectItem("north", "North Zone")
resZone2 = SelectItem("south", "South Zone")
resZone3 = SelectItem("east", "East Zone")
resZone4 = SelectItem("west", "West Zone")
resZone5 = SelectItem("central", "Central Zone")
resZone6 = SelectItem("all", "All Zones")
resJustificationField = FormControl("Justification", resJustificationInput, "Brief reason for request")
resJustificationInput = TextArea("justification", "Explain operational need...", 3)
resourceFormButtons = Buttons([resourceSubmitBtn, resourceCancelBtn])
resourceSubmitBtn = Button("Submit Request", null, "primary")
resourceCancelBtn = Button("Cancel", null, "tertiary")
broadcastForm = Card([broadcastHeading, broadcastFormComp], "card")
broadcastHeading = Heading("Broadcast Emergency Update", "h3")
broadcastFormComp = Form("broadcast-update", broadcastButtons, [broadcastZoneField, broadcastMsgField, broadcastSeverityField])
broadcastZoneField = FormControl("Target Zone(s)", broadcastZoneSelect, "Select zones to receive broadcast")
broadcastZoneSelect = Select("broadcast_zone", broadcastZoneOptions, "Choose zone(s)")
broadcastZoneOptions = [bcastZone1, bcastZone2, bcastZone3, bcastZone4, bcastZone5, bcastZone6, bcastZoneAll]
bcastZone1 = SelectItem("north", "North Zone")
bcastZone2 = SelectItem("south", "South Zone")
bcastZone3 = SelectItem("east", "East Zone")
bcastZone4 = SelectItem("west", "West Zone")
bcastZone5 = SelectItem("central", "Central Zone")
bcastZone6 = SelectItem("responders", "All Responders")
bcastZoneAll = SelectItem("all", "All Channels")
broadcastMsgField = FormControl("Message", broadcastMsgInput, "Message will be sent via all active channels")
broadcastMsgInput = TextArea("message", "Enter broadcast message...", 4)
broadcastSeverityField = FormControl("Severity", broadcastSeveritySelect, "Urgency level of this broadcast")
broadcastSeveritySelect = Select("severity", broadcastSeverityOptions, "Select severity")
broadcastSeverityOptions = [bcastSev1, bcastSev2, bcastSev3, bcastSev4]
bcastSev1 = SelectItem("info", "Informational")
bcastSev2 = SelectItem("warning", "Warning")
bcastSev3 = SelectItem("urgent", "Urgent")
bcastSev4 = SelectItem("emergency", "Emergency")
broadcastButtons = Buttons([broadcastSendBtn, broadcastCancelBtn])
broadcastSendBtn = Button("Send Broadcast", null, "primary")
broadcastCancelBtn = Button("Cancel", null, "tertiary")
sitrepForm = Card([sitrepHeading, sitrepFormComp], "card")
sitrepHeading = Heading("File Situation Report (SITREP)", "h3")
sitrepFormComp = Form("situation-report", sitrepButtons, [sitrepZoneField, sitrepPeriodField, sitrepSummaryField, sitrepActionsField, sitrepNeedsField])
sitrepZoneField = FormControl("Reporting Zone", sitrepZoneSelect, "Zone this report covers")
sitrepZoneSelect = Select("sitrep_zone", sitrepZoneOptions, "Select zone")
sitrepZoneOptions = [sitrepZ1, sitrepZ2, sitrepZ3, sitrepZ4, sitrepZ5, sitrepZ6]
sitrepZ1 = SelectItem("north", "North Zone")
sitrepZ2 = SelectItem("south", "South Zone")
sitrepZ3 = SelectItem("east", "East Zone")
sitrepZ4 = SelectItem("west", "West Zone")
sitrepZ5 = SelectItem("central", "Central Zone")
sitrepZ6 = SelectItem("all", "All Zones / HQ")
sitrepPeriodField = FormControl("Reporting Period", sitrepPeriodInput, "Date/time range covered")
sitrepPeriodInput = Input("period", "2024-01-15 06:00 - 18:00")
sitrepSummaryField = FormControl("Situation Summary", sitrepSummaryInput, "Current conditions, incidents, impacts")
sitrepSummaryInput = TextArea("summary", "Describe current situation...", 4)
sitrepActionsField = FormControl("Actions Taken", sitrepActionsInput, "Response actions completed this period")
sitrepActionsInput = TextArea("actions", "List actions taken...", 3)
sitrepNeedsField = FormControl("Critical Needs", sitrepNeedsInput, "Urgent resource or support requirements")
sitrepNeedsInput = TextArea("needs", "List critical needs...", 3)
sitrepButtons = Buttons([sitrepSubmitBtn, sitrepSaveBtn])
sitrepSubmitBtn = Button("Submit SITREP", null, "primary")
sitrepSaveBtn = Button("Save Draft", null, "secondary")