"use client"; import { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { AlertTriangle, Clock, ChevronDown, ChevronUp } from 'lucide-react'; import React, { useEffect, useRef, useCallback } from 'react'; import Hls from 'hls.js'; import WikiImage from '@/components/WikiImage'; import type { DashboardData, SelectedEntity, RegionDossier } from "@/types/dashboard"; // HLS video player — uses hls.js on Chrome/Firefox, native on Safari function HlsVideo({ url, className }: { url: string; className?: string }) { const videoRef = useRef(null); useEffect(() => { const video = videoRef.current; if (!video || !url) return; let hls: Hls | null = null; if (Hls.isSupported()) { hls = new Hls({ enableWorker: false, lowLatencyMode: true }); hls.loadSource(url); hls.attachMedia(video); } else if (video.canPlayType('application/vnd.apple.mpegurl')) { // Safari native HLS video.src = url; } return () => { hls?.destroy(); }; }, [url]); return (