{/* ── SPLASH ── */}
{showSplash && (
{/* ── Scanline CRT overlay ── */}
{/* ── V4.2 badge — top-left ── */}
V4.2
{/* ── Geometric tactical logo ── */}
{/* Outer ring — slow clockwise */}
{/* Middle ring — faster counter-clockwise */}
{/* Inner ring — fastest clockwise */}
{/* Core circle + crosshair */}
{/* Crosshair lines */}
{/* Faint pulsing radar sweep */}
{/* ── OSIRIS title — letter-by-letter stagger ── */}
{'OSIRIS'.split('').map((letter, i) => (
{letter}
))}
{/* ── Subtitle — typewriter reveal ── */}
GLOBAL INTELLIGENCE PLATFORM
{/* ── Multi-stage progress bar ── */}
{/* Thin progress track */}
{/* Status messages — cycling */}
{[
{ text: 'ESTABLISHING SECURE CONNECTION...', delay: 0.5 },
{ text: 'INITIALIZING FEEDS...', delay: 1.1 },
{ text: 'CALIBRATING SENSORS...', delay: 1.7 },
{ text: 'SYSTEM READY', delay: 2.2 },
].map((stage, i) => (
{stage.text}
))}
{/* ── Decorative grid lines ── */}
{/* ── Corner frame accents ── */}
{[
{ t: '10px', l: '10px', bw: '2px 0 0 2px' },
{ t: '10px', r: '10px', bw: '2px 2px 0 0' },
{ b: '10px', l: '10px', bw: '0 0 2px 2px' },
{ b: '10px', r: '10px', bw: '0 2px 2px 0' },
].map((pos, i) => (
))}
{/* ── Inline keyframe for scanline drift ── */}
)}
{/* ── MAP ── */}
setMapRetry(retry => retry + 1)}
data={data}
activeLayers={activeLayers}
projection={mapProjection === 'mercator' ? 'mercator' : 'globe'}
terrainEnabled={activeLayers.terrain_elevation && mapProjection === 'globe'}
terrainFocus={terrainFocus}
terrainRetry={terrainRetry}
onTerrainStatusChange={setTerrainStatus}
mapStyle={mapStyle === 'satellite' ? 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}' : 'dark'}
onEntityClick={handleEntityClick}
onMouseCoords={handleMouseCoords}
onRightClick={handleRightClick}
onViewStateChange={setMapView}
flyToLocation={flyToLocation}
sweepData={sweepData}
scanTargets={scanTargets}
demoMode={demoMode}
theme={osirisTheme}
arcgisLayers={arcgisLayers.filter(l => l.visible).map(l => ({ id: l.id, title: l.title, geojson: l.geojson, color: l.color, opacity: l.opacity }))}
onMapCenter={setMapCenter}
route={activeRoute}
userLocation={
navSession && navProgress
? { lat: navProgress.snapped[1], lng: navProgress.snapped[0], accuracy: liveLocation?.accuracy, heading: liveLocation?.heading }
: liveLocation
}
followUser={followUser}
onFollowInterrupt={() => setFollowUser(false)}
navigating={Boolean(navSession)}
drawMode={drawMode}
onDrawProgress={setDrawProgress}
drawCommand={drawCommand}
onDrawCancel={() => { setDrawMode(null); setDrawProgress(null); }}
onDrawComplete={handleDrawComplete}
drawnPolygons={drawnPolygons}
aircraftAirports={aircraftAirports}
/>
{/* ── DIRECTIONS — opens beside the right-hand tool rail ── */}
{navSession ? (
setFollowUser(true)}
onExit={() => { setNavSession(null); setNavProgress(null); setFollowUser(false); }}
onReroute={async (fromPt) => {
// Re-plan from where the driver actually is, to the same destination.
const dest = navSession.route.geometry.coordinates.at(-1)!;
try {
const res = await fetch(
`/api/directions?from=${fromPt.lat},${fromPt.lng}&to=${dest[1]},${dest[0]}&mode=auto`,
);
const data = await res.json();
if (res.ok && !data.error) {
setNavSession((n) => (n ? { ...n, route: data, key: Date.now() } : n));
setActiveRoute({ ...data, from: fromPt, to: { lat: dest[1], lng: dest[0] } });
}
} catch { /* keep the old route rather than dropping guidance */ }
}}
/>
) : null}
{/* The planner stays mounted underneath a running session: unmounting it
would discard the route you are driving, so ending guidance would
drop you into an empty form instead of back onto your route. */}
{showDirections && (
setActiveRoute(r)}
onLiveLocation={setLiveLocation}
onFollowChange={setFollowUser}
onActiveSegment={(seg) => setActiveRoute((r) => (r ? { ...r, activeSegment: seg } : r))}
onStartNavigation={(r, label) => {
setNavSession({ route: r, label, key: Date.now() });
setFollowUser(true);
}}
onLocate={(lat, lng, zoom) => setFlyToLocation({ lat, lng, zoom, ts: Date.now() })}
onClose={() => { setShowDirections(false); setActiveRoute(null); }}
/>
)}
{/* ── FLIGHT WATCH ── */}
{watchedFlights.length > 0 && (
setFlyToLocation({ lat, lng, zoom: 8, ts: Date.now() })}
onDetail={handleAircraftDetail}
/>
)}
{/* ── MAP VIEW CONTROLS ── */}
{/* Unified Control Strip */}
setMapProjection('globe')} title="3D Globe" icon={Globe} label="3D" />
setMapStyle('dark')} title="Night Mode" icon={Moon} label="MAP" />
setMapStyle('satellite')} title="Satellite View" icon={Satellite} label="SAT" />
{/* Scale Bar */}
{!isMobile && (
)}
{/* ── HEADER ── */}
OSIRIS
OPEN SOURCE INTELLIGENCE
REAL-TIME GLOBAL MONITORING · FLIGHTS · MARITIME · SATELLITES · CCTV · WEATHER · CYBER THREATS
{/* ── TOP-RIGHT STATUS (desktop) ── */}
STATUS: {backendStatus === 'connected' ? 'LIVE' : backendStatus.toUpperCase()}
{Object.values(activeLayers).filter(Boolean).length}
LAYERS
ENTITIES
{spaceWeather && SOLAR: Kp{spaceWeather.kp_index}}
V.4.1
SUPPORT
{/* ── MOBILE: Compact top status ── */}
{/* The route planner claims the top of a phone screen; leaving this in
place would put the support badge underneath the destination field. */}
{isMobile && !showDirections && !navSession && (
SUPPORT
)}
{/* ── NEW SIDEBAR (Root Level) ── */}
{showLayers && !isMobile && }
{/* ── RIGHT TOOL STRIP (desktop only — mobile uses bottom nav) ── */}
{!isMobile &&
RECON
{showIntel && (
{
setScanTargets(prev => {
const existing = prev.filter(t => t.id !== target);
return [{ id: target, timestamp: Date.now(), ...data }, ...existing].slice(0, 10);
});
setFlyToLocation({ lat: data.lat, lng: data.lng, ts: Date.now() });
}} />
)}
SPACE
{showSpaceCam && (
)}
MARKETS
{showMarkets && (
)}
ALERTS
{showAlerts && (
setFlyToLocation({ lat, lng, ts: Date.now() })} onWatchFeed={(url, name) => { setLiveFeedUrl(url); setLiveFeedName(name); }} />
)}
DRAW
ROUTE
SEARCH
{showDesktopSearch && (
{ setFlyToLocation({ lat, lng, zoom, ts: Date.now() }); setShowDesktopSearch(false); }} />
)}
{/* Separator */}
{/* ── ARCGIS INTEL ── */}
ARCGIS
{showArcGIS && (
setArcgisLayers(prev => [...prev.filter(l => l.id !== layer.id), { ...layer, color: layer.color || '#D4AF37', visible: true, opacity: layer.opacity ?? 0.8 }])}
onRemoveLayer={(id) => setArcgisLayers(prev => prev.filter(l => l.id !== id))}
onUpdateLayer={(id, updates) => setArcgisLayers(prev => prev.map(l => l.id === id ? { ...l, ...updates } : l))}
importedLayers={arcgisLayers}
mapBounds={mapCenter?.bounds || null}
/>
)}
{/* Separator */}
{/* ── WORLD REMOTE ── */}
REMOTE
{showRemote && (
setShowRemote(false)} onPlaceOnMap={(devs) => {
setScanTargets(prev => {
const ids = new Set(prev.map((t: any) => t.id));
const next = [...prev];
devs.forEach(d => { if (!ids.has(d.id)) next.unshift({ id: d.id, name: d.name, lat: d.lat, lng: d.lng, type: d.type, color: d.color, timestamp: Date.now(), source: 'BLE' }); });
return next.slice(0, 20);
});
if (devs.length > 0) setFlyToLocation({ lat: devs[0].lat, lng: devs[0].lng, ts: Date.now() });
}} />
)}
}
{/* ── LIVE FEED VIEWER OVERLAY ── */}
{liveFeedUrl && (
setLiveFeedUrl(null)}
>
e.stopPropagation()}
>
{/* Header */}
{liveFeedName}
LIVE STREAM
{!liveFeedEmbedAllowed && (
EXTERNAL ONLY
)}
Open in YouTube
{/* Body — iframe or external card */}
{liveFeedEmbedAllowed ? (
) : (
EMBED RESTRICTED
{liveFeedName} does not allow third-party embedding. Click below to open the live stream directly.
OPEN LIVE STREAM
)}
{/* Footer — only show for embeddable feeds */}
{liveFeedEmbedAllowed && (
If you see “Video unavailable”, use Open in YouTube above.
)}
)}
{/* ═══ MOBILE UI ═══ */}
{isMobile && (
<>
{/* Mobile Bottom Navigation */}
{[
{ id: 'layers' as const, icon: Layers, label: 'LAYERS' },
{ id: 'markets' as const, icon: BarChart3, label: 'MARKETS' },
{ id: 'intel' as const, icon: Newspaper, label: 'INTEL' },
{ id: 'recon' as const, icon: Radar, label: 'RECON' },
{ id: 'search' as const, icon: Search, label: 'SEARCH' },
// Routing was reachable only from the desktop tool rail, so a
// phone could not open it at all. It sits next to SEARCH
// because both answer "take me somewhere".
{ id: 'route' as const, icon: Route, label: 'ROUTE' },
{ id: 'remote' as const, icon: Bluetooth, label: 'REMOTE' },
].map(tab => {
// Routing opens the planner at the top of the screen rather than
// the bottom drawer — it needs the room above the keyboard, and
// guidance has to stay readable while you drive.
const isRoute = tab.id === 'route';
const active = isRoute ? showDirections || Boolean(navSession) : mobilePanel === tab.id;
return (
);
})}
{/* Mobile Drawer */}
{mobilePanel && (
{mobilePanel === 'layers' ? 'LAYERS & STATS' : mobilePanel === 'markets' ? 'MARKETS & INTEL' : mobilePanel === 'intel' ? 'INTEL FEED' : mobilePanel === 'recon' ? 'OSIRIS RECON' : mobilePanel === 'remote' ? 'WORLD REMOTE' : 'SEARCH'}
{mobilePanel === 'layers' && (
<>
AIR
{totalFlights.toLocaleString()}
SAT
{(data.satellites?.length||0)}
CAM
{(data.cameras?.length||0)}
WX
{(data.weather_events?.length||0)}
NUC
{(data.infrastructure?.length||0)}
{ setFlyToLocation({ lat, lng, zoom, ts: Date.now() }); setMobilePanel(null); }} />
>
)}
{mobilePanel === 'markets' &&
}
{mobilePanel === 'intel' &&
{ setFlyToLocation({ lat, lng, ts: Date.now() }); setMobilePanel(null); }} />}
{mobilePanel === 'search' && (
{ setFlyToLocation({ lat, lng, zoom, ts: Date.now() }); setMobilePanel(null); }} />
)}
{mobilePanel === 'recon' && (
setMobilePanel(null)} isMobile={true} onSweepVisualize={setSweepData} />
)}
{mobilePanel === 'remote' && (
setMobilePanel(null)} onPlaceOnMap={(devs) => {
setScanTargets(prev => {
const ids = new Set(prev.map((t: any) => t.id));
const next = [...prev];
devs.forEach(d => { if (!ids.has(d.id)) next.unshift({ id: d.id, name: d.name, lat: d.lat, lng: d.lng, type: d.type, color: d.color, timestamp: Date.now(), source: 'BLE' }); });
return next.slice(0, 20);
});
if (devs.length > 0) setFlyToLocation({ lat: devs[0].lat, lng: devs[0].lng, ts: Date.now() });
}} />
)}
)}
>
)}
{/* ── BOTTOM CURSOR INFO (desktop) ── */}
{!isMobile && (
CURSOR
—
LOCATION
{locationLabel || 'HOVER MAP'}
ZOOM
{mapView.zoom.toFixed(1)}
)}
{/* Scale bar is now integrated into the map controls section above */}
{/* ── Region Dossier ── */}
{(regionDossier || dossierLoading) && (
REGION DOSSIER
{dossierLoading ? (
) : regionDossier && (
LOCATION
{regionDossier.location?.display_name}
{regionDossier.country && (
COUNTRY
{regionDossier.country.flag} {regionDossier.country.name}
CAPITAL
{regionDossier.country.capital}
POPULATION
{regionDossier.country.population?.toLocaleString()}
REGION
{regionDossier.country.subregion || regionDossier.country.region}
LANGUAGES
{regionDossier.country.languages?.join(', ')}
AREA
{regionDossier.country.area?.toLocaleString()} km²
)}
{regionDossier.head_of_state && (
HEAD OF STATE
{regionDossier.head_of_state.name}
{regionDossier.head_of_state.position}
)}
{regionDossier.wikipedia && (
INTELLIGENCE BRIEF
{regionDossier.wikipedia.thumbnail &&

}
{regionDossier.wikipedia.extract}
)}
)}
)}
{/* ── Camera Viewer ── */}
setActiveCamera(null)}
onLocate={(lat, lng) => setFlyToLocation({ lat, lng, ts: Date.now() })}
/>
{/* ── Entity Graph Panel ── */}
{/* Guidance belongs over the map, where the clicking happens. */}
{drawMode && (
sendDraw('undo')}
onFinish={() => sendDraw('finish')}
onCancel={() => { sendDraw('cancel'); setDrawMode(null); setDrawProgress(null); }}
/>
)}
{showDrawing && (
setDrawnPolygons(p => p.filter(x => x.id !== id))}
onClearAll={() => { setDrawnPolygons([]); setSelectedPolygon(null); }}
onExportGeoJSON={handleExportGeoJSON}
selectedPolygon={selectedPolygon}
onSelectPolygon={setSelectedPolygon}
onRenamePolygon={(id, name) => setDrawnPolygons(p => p.map(x => x.id === id ? { ...x, name } : x))}
data={data}
onLocateEntity={(lat, lng) => setFlyToLocation({ lat, lng, zoom: 12, ts: Date.now() })}
watched={watched}
onToggleWatch={toggleWatch}
watchEvents={watchEvents}
/>
)}
{/* ── OVERLAYS ── */}
{/* Corner frames — using explicit classes for Tailwind JIT compatibility */}
{[
{ pos: 'top-0 left-0', vAnchor: 'top-0', hAnchor: 'left-0', hGrad: 'bg-gradient-to-r', vGrad: 'bg-gradient-to-b' },
{ pos: 'top-0 right-0', vAnchor: 'top-0', hAnchor: 'right-0', hGrad: 'bg-gradient-to-l', vGrad: 'bg-gradient-to-b' },
{ pos: 'bottom-0 left-0', vAnchor: 'bottom-0', hAnchor: 'left-0', hGrad: 'bg-gradient-to-r', vGrad: 'bg-gradient-to-t' },
{ pos: 'bottom-0 right-0', vAnchor: 'bottom-0', hAnchor: 'right-0', hGrad: 'bg-gradient-to-l', vGrad: 'bg-gradient-to-t' },
].map((c, i) => (
))}
{/* Keyboard Shortcuts Overlay */}
{/* ── GLOBAL STATUS TICKER (bottom) ── */}
{/* Shortcut hint — more visible */}
Press ? for shortcuts · F fullscreen · R reset view
);
}