using System.Text.Json; namespace Flypaper.Web.Components.Pages.Dashboard; internal sealed record WorldMapData( double Width, double Height, IReadOnlyList Countries, IReadOnlyList Markers) { private static readonly JsonSerializerOptions JsonOptions = new(JsonSerializerDefaults.Web); public static WorldMapData Instance { get; } = Load(); private static WorldMapData Load() { using var stream = typeof(WorldMapData).Assembly.GetManifestResourceStream("Flypaper.Web.world-map.json") ?? throw new InvalidOperationException("Embedded world map is missing."); return JsonSerializer.Deserialize(stream, JsonOptions) ?? throw new InvalidOperationException("Embedded world map is empty."); } } internal sealed record WorldMapCountry(string? Code, string Name, string Path); internal sealed record WorldMapMarker(string Code, string Name, double X, double Y);