react-threat-map 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,202 @@
1
+ import { __privateAdd, __privateGet, __privateMethod } from './chunk-PM2OVFS5.js';
2
+
3
+ // src/geo/data/regions.json
4
+ var regions_default = [{ id: "ID", n: "Indonesia", k: "country", c: "ID", a3: "IDN", lat: -0.1916, lng: 114.0183 }, { id: "MY", n: "Malaysia", k: "country", c: "MY", a3: "MYS", lat: 3.6146, lng: 114.7143 }, { id: "CL", n: "Chile", k: "country", c: "CL", a3: "CHL", lat: -34.0985, lng: -70.9021 }, { id: "BO", n: "Bolivia", k: "country", c: "BO", a3: "BOL", lat: -16.6806, lng: -64.6979 }, { id: "PE", n: "Peru", k: "country", c: "PE", a3: "PER", lat: -9.1087, lng: -74.4162 }, { id: "AR", n: "Argentina", k: "country", c: "AR", a3: "ARG", lat: -34.5402, lng: -64.7468 }, { id: "CY", n: "Cyprus", k: "country", c: "CY", a3: "CYP", lat: 34.9118, lng: 32.954 }, { id: "IN", n: "India", k: "country", c: "IN", a3: "IND", lat: 22.8042, lng: 79.5341 }, { id: "CN", n: "China", k: "country", c: "CN", a3: "CHN", lat: 36.7574, lng: 103.3541 }, { id: "IL", n: "Israel", k: "country", c: "IL", a3: "ISR", lat: 31.4347, lng: 34.9919 }, { id: "PS", n: "Palestine", k: "country", c: "PS", a3: "PSE", lat: 31.9442, lng: 35.2447 }, { id: "LB", n: "Lebanon", k: "country", c: "LB", a3: "LBN", lat: 33.919, lng: 35.8776 }, { id: "ET", n: "Ethiopia", k: "country", c: "ET", a3: "ETH", lat: 8.6146, lng: 39.6094 }, { id: "SS", n: "S. Sudan", k: "country", c: "SS", a3: "SSD", lat: 7.2836, lng: 30.305 }, { id: "SO", n: "Somalia", k: "country", c: "SO", a3: "SOM", lat: 4.7374, lng: 45.6784 }, { id: "KE", n: "Kenya", k: "country", c: "KE", a3: "KEN", lat: 0.5514, lng: 37.822 }, { id: "PK", n: "Pakistan", k: "country", c: "PK", a3: "PAK", lat: 29.8829, lng: 69.1702 }, { id: "MW", n: "Malawi", k: "country", c: "MW", a3: "MWI", lat: -13.2055, lng: 34.2828 }, { id: "TZ", n: "Tanzania", k: "country", c: "TZ", a3: "TZA", lat: -6.2681, lng: 34.7872 }, { id: "SY", n: "Syria", k: "country", c: "SY", a3: "SYR", lat: 35.0164, lng: 38.4843 }, { id: "XS", n: "Somaliland", k: "country", c: "XS", a3: "XSO", lat: 9.7333, lng: 46.2565 }, { id: "FR", n: "France", k: "country", c: "FR", a3: "FRA", lat: 46.5728, lng: 2.4608 }, { id: "SR", n: "Suriname", k: "country", c: "SR", a3: "SUR", lat: 4.1304, lng: -55.9112 }, { id: "GY", n: "Guyana", k: "country", c: "GY", a3: "GUY", lat: 4.7888, lng: -58.9782 }, { id: "KR", n: "South Korea", k: "country", c: "KR", a3: "KOR", lat: 36.4497, lng: 127.8648 }, { id: "KP", n: "North Korea", k: "country", c: "KP", a3: "PRK", lat: 40.1387, lng: 127.1534 }, { id: "MA", n: "Morocco", k: "country", c: "MA", a3: "MAR", lat: 29.773, lng: -8.6638 }, { id: "EH", n: "W. Sahara", k: "country", c: "EH", a3: "ESH", lat: 24.2147, lng: -12.2669 }, { id: "CR", n: "Costa Rica", k: "country", c: "CR", a3: "CRI", lat: 9.9746, lng: -84.1898 }, { id: "NI", n: "Nicaragua", k: "country", c: "NI", a3: "NIC", lat: 12.8428, lng: -85.0356 }, { id: "CG", n: "Congo", k: "country", c: "CG", a3: "COG", lat: -0.838, lng: 15.2199 }, { id: "CD", n: "Dem. Rep. Congo", k: "country", c: "CD", a3: "COD", lat: -2.8677, lng: 23.6394 }, { id: "BT", n: "Bhutan", k: "country", c: "BT", a3: "BTN", lat: 27.4228, lng: 90.4046 }, { id: "UA", n: "Ukraine", k: "country", c: "UA", a3: "UKR", lat: 49.1979, lng: 31.3178 }, { id: "BY", n: "Belarus", k: "country", c: "BY", a3: "BLR", lat: 53.52, lng: 28.0164 }, { id: "NA", n: "Namibia", k: "country", c: "NA", a3: "NAM", lat: -22.0683, lng: 17.1965 }, { id: "ZA", n: "South Africa", k: "country", c: "ZA", a3: "ZAF", lat: -28.9698, lng: 25.1937 }, { id: "MF", n: "St-Martin", k: "country", c: "MF", a3: "MAF", lat: 18.0777, lng: -63.0543 }, { id: "SX", n: "Sint Maarten", k: "country", c: "SX", a3: "SXM", lat: 18.0406, lng: -63.0694 }, { id: "OM", n: "Oman", k: "country", c: "OM", a3: "OMN", lat: 20.5544, lng: 56.0563 }, { id: "UZ", n: "Uzbekistan", k: "country", c: "UZ", a3: "UZB", lat: 41.7776, lng: 63.2947 }, { id: "KZ", n: "Kazakhstan", k: "country", c: "KZ", a3: "KAZ", lat: 48.3667, lng: 67.2535 }, { id: "TJ", n: "Tajikistan", k: "country", c: "TJ", a3: "TJK", lat: 38.5344, lng: 71.0295 }, { id: "LT", n: "Lithuania", k: "country", c: "LT", a3: "LTU", lat: 55.3243, lng: 23.904 }, { id: "BR", n: "Brazil", k: "country", c: "BR", a3: "BRA", lat: -10.6914, lng: -53.2343 }, { id: "UY", n: "Uruguay", k: "country", c: "UY", a3: "URY", lat: -32.79, lng: -56.0242 }, { id: "MN", n: "Mongolia", k: "country", c: "MN", a3: "MNG", lat: 46.9552, lng: 103.127 }, { id: "RU", n: "Russia", k: "country", c: "RU", a3: "RUS", lat: 55.75, lng: 37.62 }, { id: "CZ", n: "Czechia", k: "country", c: "CZ", a3: "CZE", lat: 49.737, lng: 15.3211 }, { id: "DE", n: "Germany", k: "country", c: "DE", a3: "DEU", lat: 51.0317, lng: 10.3514 }, { id: "EE", n: "Estonia", k: "country", c: "EE", a3: "EST", lat: 58.6816, lng: 25.8367 }, { id: "LV", n: "Latvia", k: "country", c: "LV", a3: "LVA", lat: 56.8605, lng: 24.9168 }, { id: "NO", n: "Norway", k: "country", c: "NO", a3: "NOR", lat: 59.91, lng: 10.75 }, { id: "SE", n: "Sweden", k: "country", c: "SE", a3: "SWE", lat: 62.4388, lng: 16.2573 }, { id: "FI", n: "Finland", k: "country", c: "FI", a3: "FIN", lat: 64.2666, lng: 26.2118 }, { id: "VN", n: "Vietnam", k: "country", c: "VN", a3: "VNM", lat: 16.5561, lng: 106.3482 }, { id: "KH", n: "Cambodia", k: "country", c: "KH", a3: "KHM", lat: 12.7175, lng: 104.9035 }, { id: "LU", n: "Luxembourg", k: "country", c: "LU", a3: "LUX", lat: 49.7665, lng: 6.0723 }, { id: "AE", n: "United Arab Emirates", k: "country", c: "AE", a3: "ARE", lat: 23.9018, lng: 54.2998 }, { id: "BE", n: "Belgium", k: "country", c: "BE", a3: "BEL", lat: 50.6367, lng: 4.6474 }, { id: "GE", n: "Georgia", k: "country", c: "GE", a3: "GEO", lat: 42.1733, lng: 43.5239 }, { id: "MK", n: "Macedonia", k: "country", c: "MK", a3: "MKD", lat: 41.5949, lng: 21.6822 }, { id: "AL", n: "Albania", k: "country", c: "AL", a3: "ALB", lat: 41.135, lng: 20.0559 }, { id: "AZ", n: "Azerbaijan", k: "country", c: "AZ", a3: "AZE", lat: 40.3436, lng: 47.6659 }, { id: "XK", n: "Kosovo", k: "country", c: "XK", a3: "XKX", lat: 42.5722, lng: 20.8737 }, { id: "TR", n: "Turkey", k: "country", c: "TR", a3: "TUR", lat: 39.0612, lng: 35.4114 }, { id: "ES", n: "Spain", k: "country", c: "ES", a3: "ESP", lat: 40.3617, lng: -3.5726 }, { id: "LA", n: "Laos", k: "country", c: "LA", a3: "LAO", lat: 18.4875, lng: 103.7751 }, { id: "KG", n: "Kyrgyzstan", k: "country", c: "KG", a3: "KGZ", lat: 41.474, lng: 74.5092 }, { id: "AM", n: "Armenia", k: "country", c: "AM", a3: "ARM", lat: 40.2855, lng: 44.94 }, { id: "DK", n: "Denmark", k: "country", c: "DK", a3: "DNK", lat: 56.217, lng: 9.3663 }, { id: "LY", n: "Libya", k: "country", c: "LY", a3: "LBY", lat: 27.0158, lng: 18.0682 }, { id: "TN", n: "Tunisia", k: "country", c: "TN", a3: "TUN", lat: 34.089, lng: 9.5519 }, { id: "RO", n: "Romania", k: "country", c: "RO", a3: "ROU", lat: 45.8494, lng: 24.9831 }, { id: "HU", n: "Hungary", k: "country", c: "HU", a3: "HUN", lat: 47.1664, lng: 19.3804 }, { id: "SK", n: "Slovakia", k: "country", c: "SK", a3: "SVK", lat: 48.7108, lng: 19.4704 }, { id: "PL", n: "Poland", k: "country", c: "PL", a3: "POL", lat: 52.109, lng: 19.4236 }, { id: "IE", n: "Ireland", k: "country", c: "IE", a3: "IRL", lat: 53.1637, lng: -8.146 }, { id: "GB", n: "United Kingdom", k: "country", c: "GB", a3: "GBR", lat: 53.8353, lng: -2.4224 }, { id: "GR", n: "Greece", k: "country", c: "GR", a3: "GRC", lat: 39.4571, lng: 22.5631 }, { id: "ZM", n: "Zambia", k: "country", c: "ZM", a3: "ZMB", lat: -13.4575, lng: 27.8078 }, { id: "SL", n: "Sierra Leone", k: "country", c: "SL", a3: "SLE", lat: 8.5711, lng: -11.7873 }, { id: "GN", n: "Guinea", k: "country", c: "GN", a3: "GIN", lat: 10.4357, lng: -10.9366 }, { id: "LR", n: "Liberia", k: "country", c: "LR", a3: "LBR", lat: 6.4514, lng: -9.3176 }, { id: "CF", n: "Central African Rep.", k: "country", c: "CF", a3: "CAF", lat: 6.5704, lng: 20.4583 }, { id: "SD", n: "Sudan", k: "country", c: "SD", a3: "SDN", lat: 15.9644, lng: 29.9066 }, { id: "DJ", n: "Djibouti", k: "country", c: "DJ", a3: "DJI", lat: 11.7496, lng: 42.5659 }, { id: "ER", n: "Eritrea", k: "country", c: "ER", a3: "ERI", lat: 15.3542, lng: 38.8562 }, { id: "AT", n: "Austria", k: "country", c: "AT", a3: "AUT", lat: 47.5924, lng: 14.1148 }, { id: "IQ", n: "Iraq", k: "country", c: "IQ", a3: "IRQ", lat: 33.0097, lng: 43.7752 }, { id: "IT", n: "Italy", k: "country", c: "IT", a3: "ITA", lat: 43.4796, lng: 12.3073 }, { id: "CH", n: "Switzerland", k: "country", c: "CH", a3: "CHE", lat: 46.8, lng: 8.2129 }, { id: "IR", n: "Iran", k: "country", c: "IR", a3: "IRN", lat: 32.5291, lng: 54.4426 }, { id: "NL", n: "Netherlands", k: "country", c: "NL", a3: "NLD", lat: 52.2766, lng: 5.6297 }, { id: "LI", n: "Liechtenstein", k: "country", c: "LI", a3: "LIE", lat: 47.1379, lng: 9.5415 }, { id: "CI", n: "C\xF4te d'Ivoire", k: "country", c: "CI", a3: "CIV", lat: 7.626, lng: -5.5694 }, { id: "RS", n: "Serbia", k: "country", c: "RS", a3: "SRB", lat: 44.2111, lng: 20.8075 }, { id: "ML", n: "Mali", k: "country", c: "ML", a3: "MLI", lat: 17.3135, lng: -3.587 }, { id: "SN", n: "Senegal", k: "country", c: "SN", a3: "SEN", lat: 14.3662, lng: -14.4674 }, { id: "NG", n: "Nigeria", k: "country", c: "NG", a3: "NGA", lat: 9.5939, lng: 8.0816 }, { id: "BJ", n: "Benin", k: "country", c: "BJ", a3: "BEN", lat: 9.6351, lng: 2.3276 }, { id: "AO", n: "Angola", k: "country", c: "AO", a3: "AGO", lat: -12.3081, lng: 17.5598 }, { id: "HR", n: "Croatia", k: "country", c: "HR", a3: "HRV", lat: 45.1532, lng: 16.4172 }, { id: "SI", n: "Slovenia", k: "country", c: "SI", a3: "SVN", lat: 46.1162, lng: 14.804 }, { id: "QA", n: "Qatar", k: "country", c: "QA", a3: "QAT", lat: 25.3117, lng: 51.1866 }, { id: "SA", n: "Saudi Arabia", k: "country", c: "SA", a3: "SAU", lat: 24.0882, lng: 44.665 }, { id: "BW", n: "Botswana", k: "country", c: "BW", a3: "BWA", lat: -22.167, lng: 23.8091 }, { id: "ZW", n: "Zimbabwe", k: "country", c: "ZW", a3: "ZWE", lat: -18.9954, lng: 29.8515 }, { id: "BG", n: "Bulgaria", k: "country", c: "BG", a3: "BGR", lat: 42.7708, lng: 25.2111 }, { id: "TH", n: "Thailand", k: "country", c: "TH", a3: "THA", lat: 15.1022, lng: 101.0068 }, { id: "SM", n: "San Marino", k: "country", c: "SM", a3: "SMR", lat: 43.9366, lng: 12.4429 }, { id: "HT", n: "Haiti", k: "country", c: "HT", a3: "HTI", lat: 18.9346, lng: -72.679 }, { id: "DO", n: "Dominican Rep.", k: "country", c: "DO", a3: "DOM", lat: 18.9001, lng: -70.4999 }, { id: "TD", n: "Chad", k: "country", c: "TD", a3: "TCD", lat: 15.275, lng: 18.6364 }, { id: "KW", n: "Kuwait", k: "country", c: "KW", a3: "KWT", lat: 29.3191, lng: 47.5659 }, { id: "SV", n: "El Salvador", k: "country", c: "SV", a3: "SLV", lat: 13.737, lng: -88.8718 }, { id: "GT", n: "Guatemala", k: "country", c: "GT", a3: "GTM", lat: 15.6921, lng: -90.3628 }, { id: "TL", n: "Timor-Leste", k: "country", c: "TL", a3: "TLS", lat: -8.8042, lng: 125.9367 }, { id: "BN", n: "Brunei", k: "country", c: "BN", a3: "BRN", lat: 4.4931, lng: 114.5978 }, { id: "MC", n: "Monaco", k: "country", c: "MC", a3: "MCO", lat: 43.7399, lng: 7.3984 }, { id: "DZ", n: "Algeria", k: "country", c: "DZ", a3: "DZA", lat: 28.0444, lng: 2.6659 }, { id: "MZ", n: "Mozambique", k: "country", c: "MZ", a3: "MOZ", lat: -17.1912, lng: 35.6065 }, { id: "SZ", n: "eSwatini", k: "country", c: "SZ", a3: "SWZ", lat: -26.5608, lng: 31.4799 }, { id: "BI", n: "Burundi", k: "country", c: "BI", a3: "BDI", lat: -3.3573, lng: 29.875 }, { id: "RW", n: "Rwanda", k: "country", c: "RW", a3: "RWA", lat: -1.9927, lng: 29.9192 }, { id: "MM", n: "Myanmar", k: "country", c: "MM", a3: "MMR", lat: 21.142, lng: 96.4947 }, { id: "BD", n: "Bangladesh", k: "country", c: "BD", a3: "BGD", lat: 23.875, lng: 90.2362 }, { id: "AD", n: "Andorra", k: "country", c: "AD", a3: "AND", lat: 42.5413, lng: 1.5611 }, { id: "AF", n: "Afghanistan", k: "country", c: "AF", a3: "AFG", lat: 33.8198, lng: 65.9295 }, { id: "ME", n: "Montenegro", k: "country", c: "ME", a3: "MNE", lat: 42.7849, lng: 19.2383 }, { id: "BA", n: "Bosnia and Herz.", k: "country", c: "BA", a3: "BIH", lat: 44.1686, lng: 17.7794 }, { id: "UG", n: "Uganda", k: "country", c: "UG", a3: "UGA", lat: 1.2751, lng: 32.3666 }, { id: "CU", n: "Cuba", k: "country", c: "CU", a3: "CUB", lat: 21.6286, lng: -78.9285 }, { id: "HN", n: "Honduras", k: "country", c: "HN", a3: "HND", lat: 14.8206, lng: -86.6278 }, { id: "EC", n: "Ecuador", k: "country", c: "EC", a3: "ECU", lat: -1.448, lng: -78.3865 }, { id: "CO", n: "Colombia", k: "country", c: "CO", a3: "COL", lat: 3.899, lng: -73.0772 }, { id: "PY", n: "Paraguay", k: "country", c: "PY", a3: "PRY", lat: -23.2082, lng: -58.4417 }, { id: "PT", n: "Portugal", k: "country", c: "PT", a3: "PRT", lat: 39.6549, lng: -7.9822 }, { id: "MD", n: "Moldova", k: "country", c: "MD", a3: "MDA", lat: 47.1873, lng: 28.4701 }, { id: "TM", n: "Turkmenistan", k: "country", c: "TM", a3: "TKM", lat: 39.1258, lng: 59.4531 }, { id: "JO", n: "Jordan", k: "country", c: "JO", a3: "JOR", lat: 31.2383, lng: 36.7571 }, { id: "NP", n: "Nepal", k: "country", c: "NP", a3: "NPL", lat: 28.257, lng: 83.9474 }, { id: "LS", n: "Lesotho", k: "country", c: "LS", a3: "LSO", lat: -29.5787, lng: 28.2304 }, { id: "CM", n: "Cameroon", k: "country", c: "CM", a3: "CMR", lat: 5.6831, lng: 12.7312 }, { id: "GA", n: "Gabon", k: "country", c: "GA", a3: "GAB", lat: -0.5913, lng: 11.7909 }, { id: "NE", n: "Niger", k: "country", c: "NE", a3: "NER", lat: 17.4113, lng: 9.3322 }, { id: "BF", n: "Burkina Faso", k: "country", c: "BF", a3: "BFA", lat: 12.2707, lng: -1.7621 }, { id: "TG", n: "Togo", k: "country", c: "TG", a3: "TGO", lat: 8.5225, lng: 0.9639 }, { id: "GH", n: "Ghana", k: "country", c: "GH", a3: "GHA", lat: 7.9482, lng: -1.2167 }, { id: "GW", n: "Guinea-Bissau", k: "country", c: "GW", a3: "GNB", lat: 12.0571, lng: -14.9291 }, { id: "GI", n: "Gibraltar", k: "country", c: "GI", a3: "GIB", lat: 36.1297, lng: -5.3471 }, { id: "US", n: "United States of America", k: "country", c: "US", a3: "USA", lat: 39.8887, lng: -98.8219 }, { id: "CA", n: "Canada", k: "country", c: "CA", a3: "CAN", lat: 58.5939, lng: -98.9884 }, { id: "MX", n: "Mexico", k: "country", c: "MX", a3: "MEX", lat: 23.9181, lng: -102.1592 }, { id: "BZ", n: "Belize", k: "country", c: "BZ", a3: "BLZ", lat: 17.1994, lng: -88.7049 }, { id: "PA", n: "Panama", k: "country", c: "PA", a3: "PAN", lat: 8.5252, lng: -80.1067 }, { id: "VE", n: "Venezuela", k: "country", c: "VE", a3: "VEN", lat: 7.1155, lng: -66.1724 }, { id: "PG", n: "Papua New Guinea", k: "country", c: "PG", a3: "PNG", lat: -6.611, lng: 144.2394 }, { id: "EG", n: "Egypt", k: "country", c: "EG", a3: "EGY", lat: 26.4565, lng: 29.8773 }, { id: "YE", n: "Yemen", k: "country", c: "YE", a3: "YEM", lat: 15.9428, lng: 47.5215 }, { id: "MR", n: "Mauritania", k: "country", c: "MR", a3: "MRT", lat: 20.2196, lng: -10.3642 }, { id: "GQ", n: "Eq. Guinea", k: "country", c: "GQ", a3: "GNQ", lat: 1.5651, lng: 10.4674 }, { id: "GM", n: "Gambia", k: "country", c: "GM", a3: "GMB", lat: 13.4512, lng: -15.3975 }, { id: "HK", n: "Hong Kong", k: "country", c: "HK", a3: "HKG", lat: 22.4246, lng: 114.1606 }, { id: "VA", n: "Vatican", k: "country", c: "VA", a3: "VAT", lat: 41.9034, lng: 12.4543 }, { id: "XN", n: "Northern Cyprus", k: "country", c: "XN", a3: "XNC", lat: 35.2769, lng: 33.5974 }, { id: "AQ", n: "Antarctica", k: "country", c: "AQ", a3: "ATA", lat: -84.6755, lng: 83.0407 }, { id: "AU", n: "Australia", k: "country", c: "AU", a3: "AUS", lat: -25.6326, lng: 134.2061 }, { id: "GL", n: "Greenland", k: "country", c: "GL", a3: "GRL", lat: 73.1471, lng: -41.838 }, { id: "FJ", n: "Fiji", k: "country", c: "FJ", a3: "FJI", lat: -17.8241, lng: 177.9754 }, { id: "NZ", n: "New Zealand", k: "country", c: "NZ", a3: "NZL", lat: -43.9598, lng: 170.602 }, { id: "NC", n: "New Caledonia", k: "country", c: "NC", a3: "NCL", lat: -21.3252, lng: 165.4817 }, { id: "MG", n: "Madagascar", k: "country", c: "MG", a3: "MDG", lat: -19.3212, lng: 46.7422 }, { id: "PH", n: "Philippines", k: "country", c: "PH", a3: "PHL", lat: 15.9436, lng: 121.4228 }, { id: "LK", n: "Sri Lanka", k: "country", c: "LK", a3: "LKA", lat: 7.6077, lng: 80.7057 }, { id: "CW", n: "Cura\xE7ao", k: "country", c: "CW", a3: "CUW", lat: 12.1939, lng: -68.9716 }, { id: "AW", n: "Aruba", k: "country", c: "AW", a3: "ABW", lat: 12.5172, lng: -69.9738 }, { id: "BS", n: "Bahamas", k: "country", c: "BS", a3: "BHS", lat: 24.7031, lng: -78.04 }, { id: "TC", n: "Turks and Caicos Is.", k: "country", c: "TC", a3: "TCA", lat: 21.8098, lng: -71.7427 }, { id: "TW", n: "Taiwan", k: "country", c: "TW", a3: "TWN", lat: 23.7491, lng: 120.9614 }, { id: "JP", n: "Japan", k: "country", c: "JP", a3: "JPN", lat: 36.6341, lng: 137.8696 }, { id: "PM", n: "St. Pierre and Miquelon", k: "country", c: "PM", a3: "SPM", lat: 46.9516, lng: -56.3243 }, { id: "IS", n: "Iceland", k: "country", c: "IS", a3: "ISL", lat: 65.0006, lng: -18.6017 }, { id: "PN", n: "Pitcairn Is.", k: "country", c: "PN", a3: "PCN", lat: -24.3667, lng: -128.3167 }, { id: "PF", n: "Fr. Polynesia", k: "country", c: "PF", a3: "PYF", lat: -17.6641, lng: -149.4205 }, { id: "TF", n: "Fr. S. Antarctic Lands", k: "country", c: "TF", a3: "ATF", lat: -49.3112, lng: 69.5008 }, { id: "SC", n: "Seychelles", k: "country", c: "SC", a3: "SYC", lat: -4.6764, lng: 55.4672 }, { id: "KI", n: "Kiribati", k: "country", c: "KI", a3: "KIR", lat: 1.8497, lng: -157.3706 }, { id: "MH", n: "Marshall Is.", k: "country", c: "MH", a3: "MHL", lat: 7.0995, lng: 171.2024 }, { id: "TT", n: "Trinidad and Tobago", k: "country", c: "TT", a3: "TTO", lat: 10.4218, lng: -61.2941 }, { id: "GD", n: "Grenada", k: "country", c: "GD", a3: "GRD", lat: 12.1173, lng: -61.6788 }, { id: "VC", n: "St. Vin. and Gren.", k: "country", c: "VC", a3: "VCT", lat: 13.2565, lng: -61.1936 }, { id: "BB", n: "Barbados", k: "country", c: "BB", a3: "BRB", lat: 13.1814, lng: -59.5616 }, { id: "LC", n: "Saint Lucia", k: "country", c: "LC", a3: "LCA", lat: 13.9029, lng: -60.9702 }, { id: "DM", n: "Dominica", k: "country", c: "DM", a3: "DMA", lat: 15.4366, lng: -61.3569 }, { id: "UM", n: "U.S. Minor Outlying Is.", k: "country", c: "UM", a3: "UMI", lat: 5.8811, lng: -162.0765 }, { id: "MS", n: "Montserrat", k: "country", c: "MS", a3: "MSR", lat: 16.7378, lng: -62.187 }, { id: "AG", n: "Antigua and Barb.", k: "country", c: "AG", a3: "ATG", lat: 17.0746, lng: -61.7891 }, { id: "KN", n: "St. Kitts and Nevis", k: "country", c: "KN", a3: "KNA", lat: 17.3321, lng: -62.7584 }, { id: "VI", n: "U.S. Virgin Is.", k: "country", c: "VI", a3: "VIR", lat: 17.7392, lng: -64.7628 }, { id: "BL", n: "St-Barth\xE9lemy", k: "country", c: "BL", a3: "BLM", lat: 17.9053, lng: -62.8321 }, { id: "PR", n: "Puerto Rico", k: "country", c: "PR", a3: "PRI", lat: 18.2264, lng: -66.4811 }, { id: "AI", n: "Anguilla", k: "country", c: "AI", a3: "AIA", lat: 18.2244, lng: -63.0578 }, { id: "VG", n: "British Virgin Is.", k: "country", c: "VG", a3: "VGB", lat: 18.4239, lng: -64.6221 }, { id: "JM", n: "Jamaica", k: "country", c: "JM", a3: "JAM", lat: 18.1559, lng: -77.3189 }, { id: "KY", n: "Cayman Is.", k: "country", c: "KY", a3: "CYM", lat: 19.3183, lng: -81.2519 }, { id: "BM", n: "Bermuda", k: "country", c: "BM", a3: "BMU", lat: 32.3116, lng: -64.7604 }, { id: "HM", n: "Heard I. and McDonald Is.", k: "country", c: "HM", a3: "HMD", lat: -53.0888, lng: 73.5049 }, { id: "SH", n: "Saint Helena", k: "country", c: "SH", a3: "SHN", lat: -15.9594, lng: -5.7171 }, { id: "MU", n: "Mauritius", k: "country", c: "MU", a3: "MUS", lat: -20.2796, lng: 57.5696 }, { id: "KM", n: "Comoros", k: "country", c: "KM", a3: "COM", lat: -11.6547, lng: 43.3397 }, { id: "ST", n: "S\xE3o Tom\xE9 and Principe", k: "country", c: "ST", a3: "STP", lat: 0.236, lng: 6.6075 }, { id: "CV", n: "Cabo Verde", k: "country", c: "CV", a3: "CPV", lat: 15.0816, lng: -23.6368 }, { id: "MT", n: "Malta", k: "country", c: "MT", a3: "MLT", lat: 35.8904, lng: 14.4415 }, { id: "JE", n: "Jersey", k: "country", c: "JE", a3: "JEY", lat: 49.2211, lng: -2.127 }, { id: "GG", n: "Guernsey", k: "country", c: "GG", a3: "GGY", lat: 49.4629, lng: -2.5774 }, { id: "IM", n: "Isle of Man", k: "country", c: "IM", a3: "IMN", lat: 54.2292, lng: -4.5339 }, { id: "AX", n: "\xC5land", k: "country", c: "AX", a3: "ALA", lat: 60.2289, lng: 19.9431 }, { id: "FO", n: "Faeroe Is.", k: "country", c: "FO", a3: "FRO", lat: 62.1368, lng: -6.986 }, { id: "IO", n: "Br. Indian Ocean Ter.", k: "country", c: "IO", a3: "IOT", lat: -7.3514, lng: 72.4292 }, { id: "SG", n: "Singapore", k: "country", c: "SG", a3: "SGP", lat: 1.3588, lng: 103.8131 }, { id: "NF", n: "Norfolk Island", k: "country", c: "NF", a3: "NFK", lat: -29.0347, lng: 167.9551 }, { id: "CK", n: "Cook Is.", k: "country", c: "CK", a3: "COK", lat: -21.2193, lng: -159.7864 }, { id: "TO", n: "Tonga", k: "country", c: "TO", a3: "TON", lat: -21.1723, lng: -175.2041 }, { id: "WF", n: "Wallis and Futuna Is.", k: "country", c: "WF", a3: "WLF", lat: -13.2823, lng: -176.1622 }, { id: "WS", n: "Samoa", k: "country", c: "WS", a3: "WSM", lat: -13.6305, lng: -172.4386 }, { id: "SB", n: "Solomon Is.", k: "country", c: "SB", a3: "SLB", lat: -9.6228, lng: 160.1698 }, { id: "TV", n: "Tuvalu", k: "country", c: "TV", a3: "TUV", lat: -8.502, lng: 179.2051 }, { id: "MV", n: "Maldives", k: "country", c: "MV", a3: "MDV", lat: 6.2213, lng: 73.0321 }, { id: "NR", n: "Nauru", k: "country", c: "NR", a3: "NRU", lat: -0.5207, lng: 166.9331 }, { id: "FM", n: "Micronesia", k: "country", c: "FM", a3: "FSM", lat: 6.8828, lng: 158.2341 }, { id: "GS", n: "S. Geo. and the Is.", k: "country", c: "GS", a3: "SGS", lat: -54.3674, lng: -36.6888 }, { id: "FK", n: "Falkland Is.", k: "country", c: "FK", a3: "FLK", lat: -51.7347, lng: -58.7512 }, { id: "VU", n: "Vanuatu", k: "country", c: "VU", a3: "VUT", lat: -15.2314, lng: 166.8539 }, { id: "NU", n: "Niue", k: "country", c: "NU", a3: "NIU", lat: -19.049, lng: -169.8692 }, { id: "AS", n: "American Samoa", k: "country", c: "AS", a3: "ASM", lat: -14.3048, lng: -170.7154 }, { id: "PW", n: "Palau", k: "country", c: "PW", a3: "PLW", lat: 7.5146, lng: 134.5804 }, { id: "GU", n: "Guam", k: "country", c: "GU", a3: "GUM", lat: 13.4445, lng: 144.7725 }, { id: "MP", n: "N. Mariana Is.", k: "country", c: "MP", a3: "MNP", lat: 15.1835, lng: 145.7409 }, { id: "BH", n: "Bahrain", k: "country", c: "BH", a3: "BHR", lat: 26.0525, lng: 50.5466 }, { id: "MO", n: "Macao", k: "country", c: "MO", a3: "MAC", lat: 22.1378, lng: 113.5571 }, { id: "BQ", n: "Bonaire, Sint Eustatius and Saba", k: "country", c: "BQ", a3: "BES", lat: 12.1784, lng: -68.2385 }, { id: "BV", n: "Bouvet Island", k: "country", c: "BV", a3: "BVT", lat: -54.4208, lng: 3.3464 }, { id: "CC", n: "Cocos (Keeling) Islands", k: "country", c: "CC", a3: "CCK", lat: -12.1642, lng: 96.871 }, { id: "CX", n: "Christmas Island", k: "country", c: "CX", a3: "CXR", lat: -10.4475, lng: 105.6904 }, { id: "GF", n: "French Guiana", k: "country", c: "GF", a3: "GUF", lat: 3.9339, lng: -53.1258 }, { id: "GP", n: "Guadeloupe", k: "country", c: "GP", a3: "GLP", lat: 16.265, lng: -61.551 }, { id: "MQ", n: "Martinique", k: "country", c: "MQ", a3: "MTQ", lat: 14.6415, lng: -61.0242 }, { id: "RE", n: "R\xE9union", k: "country", c: "RE", a3: "REU", lat: -21.1151, lng: 55.5364 }, { id: "SJ", n: "Svalbard and Jan Mayen", k: "country", c: "SJ", a3: "SJM", lat: 77.875, lng: 20.9752 }, { id: "TK", n: "Tokelau", k: "country", c: "TK", a3: "TKL", lat: -9.2002, lng: -171.8484 }, { id: "YT", n: "Mayotte", k: "country", c: "YT", a3: "MYT", lat: -12.8275, lng: 45.1662 }, { id: "US-AL", n: "Alabama", k: "state", c: "US", a3: null, lat: 32.7769, lng: -86.8296 }, { id: "US-AK", n: "Alaska", k: "state", c: "US", a3: null, lat: 64.2338, lng: -152.5469 }, { id: "US-AZ", n: "Arizona", k: "state", c: "US", a3: null, lat: 34.2748, lng: -111.6605 }, { id: "US-CO", n: "Colorado", k: "state", c: "US", a3: null, lat: 38.9973, lng: -105.548 }, { id: "US-FL", n: "Florida", k: "state", c: "US", a3: null, lat: 28.6329, lng: -82.461 }, { id: "US-GA", n: "Georgia", k: "state", c: "US", a3: null, lat: 32.6378, lng: -83.4359 }, { id: "US-IN", n: "Indiana", k: "state", c: "US", a3: null, lat: 39.8946, lng: -86.2816 }, { id: "US-KS", n: "Kansas", k: "state", c: "US", a3: null, lat: 38.4937, lng: -98.3787 }, { id: "US-ME", n: "Maine", k: "state", c: "US", a3: null, lat: 45.3516, lng: -69.2372 }, { id: "US-MA", n: "Massachusetts", k: "state", c: "US", a3: null, lat: 42.2721, lng: -71.8201 }, { id: "US-MN", n: "Minnesota", k: "state", c: "US", a3: null, lat: 46.2806, lng: -94.3053 }, { id: "US-NJ", n: "New Jersey", k: "state", c: "US", a3: null, lat: 40.1786, lng: -74.6636 }, { id: "US-NC", n: "North Carolina", k: "state", c: "US", a3: null, lat: 35.5523, lng: -79.3633 }, { id: "US-ND", n: "North Dakota", k: "state", c: "US", a3: null, lat: 47.4505, lng: -100.4662 }, { id: "US-OK", n: "Oklahoma", k: "state", c: "US", a3: null, lat: 35.5883, lng: -97.4932 }, { id: "US-PA", n: "Pennsylvania", k: "state", c: "US", a3: null, lat: 40.8783, lng: -77.8001 }, { id: "US-SD", n: "South Dakota", k: "state", c: "US", a3: null, lat: 44.4445, lng: -100.2275 }, { id: "US-TX", n: "Texas", k: "state", c: "US", a3: null, lat: 31.4628, lng: -99.3205 }, { id: "US-WY", n: "Wyoming", k: "state", c: "US", a3: null, lat: 42.9957, lng: -107.5514 }, { id: "US-CT", n: "Connecticut", k: "state", c: "US", a3: null, lat: 41.6205, lng: -72.7271 }, { id: "US-MO", n: "Missouri", k: "state", c: "US", a3: null, lat: 38.3565, lng: -92.4579 }, { id: "US-WV", n: "West Virginia", k: "state", c: "US", a3: null, lat: 38.6398, lng: -80.6251 }, { id: "US-IL", n: "Illinois", k: "state", c: "US", a3: null, lat: 40.0421, lng: -89.1969 }, { id: "US-NM", n: "New Mexico", k: "state", c: "US", a3: null, lat: 34.4073, lng: -106.1124 }, { id: "US-AR", n: "Arkansas", k: "state", c: "US", a3: null, lat: 34.8942, lng: -92.4431 }, { id: "US-CA", n: "California", k: "state", c: "US", a3: null, lat: 37.1919, lng: -119.4732 }, { id: "US-DE", n: "Delaware", k: "state", c: "US", a3: null, lat: 38.9905, lng: -75.5002 }, { id: "US-DC", n: "District of Columbia", k: "state", c: "US", a3: null, lat: 38.9038, lng: -77.0153 }, { id: "US-HI", n: "Hawaii", k: "state", c: "US", a3: null, lat: 19.6012, lng: -155.521 }, { id: "US-IA", n: "Iowa", k: "state", c: "US", a3: null, lat: 42.0751, lng: -93.4957 }, { id: "US-KY", n: "Kentucky", k: "state", c: "US", a3: null, lat: 37.5356, lng: -85.2994 }, { id: "US-MD", n: "Maryland", k: "state", c: "US", a3: null, lat: 39.0361, lng: -76.762 }, { id: "US-MI", n: "Michigan", k: "state", c: "US", a3: null, lat: 43.4697, lng: -84.6219 }, { id: "US-MS", n: "Mississippi", k: "state", c: "US", a3: null, lat: 32.7362, lng: -89.6677 }, { id: "US-MT", n: "Montana", k: "state", c: "US", a3: null, lat: 47.0525, lng: -109.633 }, { id: "US-NH", n: "New Hampshire", k: "state", c: "US", a3: null, lat: 43.6791, lng: -71.5804 }, { id: "US-NY", n: "New York", k: "state", c: "US", a3: null, lat: 42.9399, lng: -75.51 }, { id: "US-OH", n: "Ohio", k: "state", c: "US", a3: null, lat: 40.2885, lng: -82.7944 }, { id: "US-OR", n: "Oregon", k: "state", c: "US", a3: null, lat: 43.9347, lng: -120.562 }, { id: "US-TN", n: "Tennessee", k: "state", c: "US", a3: null, lat: 35.858, lng: -86.351 }, { id: "US-UT", n: "Utah", k: "state", c: "US", a3: null, lat: 39.3056, lng: -111.6701 }, { id: "US-VA", n: "Virginia", k: "state", c: "US", a3: null, lat: 37.5183, lng: -78.8915 }, { id: "US-WA", n: "Washington", k: "state", c: "US", a3: null, lat: 47.3768, lng: -120.4394 }, { id: "US-WI", n: "Wisconsin", k: "state", c: "US", a3: null, lat: 44.6212, lng: -89.994 }, { id: "US-AS", n: "American Samoa", k: "state", c: "US", a3: null, lat: -14.2941, lng: -170.7045 }, { id: "US-GU", n: "Guam", k: "state", c: "US", a3: null, lat: 13.4437, lng: 144.7745 }, { id: "US-MP", n: "Commonwealth of the Northern Mariana Islands", k: "state", c: "US", a3: null, lat: 15.1904, lng: 145.7504 }, { id: "US-NE", n: "Nebraska", k: "state", c: "US", a3: null, lat: 41.538, lng: -99.7945 }, { id: "US-SC", n: "South Carolina", k: "state", c: "US", a3: null, lat: 33.9057, lng: -80.8897 }, { id: "US-PR", n: "Puerto Rico", k: "state", c: "US", a3: null, lat: 18.2248, lng: -66.4752 }, { id: "US-VI", n: "United States Virgin Islands", k: "state", c: "US", a3: null, lat: 17.7317, lng: -64.7683 }, { id: "US-ID", n: "Idaho", k: "state", c: "US", a3: null, lat: 44.3502, lng: -114.6127 }, { id: "US-NV", n: "Nevada", k: "state", c: "US", a3: null, lat: 39.3291, lng: -116.6314 }, { id: "US-VT", n: "Vermont", k: "state", c: "US", a3: null, lat: 44.0689, lng: -72.6666 }, { id: "US-LA", n: "Louisiana", k: "state", c: "US", a3: null, lat: 31.0472, lng: -91.9652 }, { id: "US-RI", n: "Rhode Island", k: "state", c: "US", a3: null, lat: 41.6937, lng: -71.589 }];
5
+
6
+ // src/geo/regions.ts
7
+ var rows = regions_default;
8
+ function toEntry(r) {
9
+ return {
10
+ id: r.id,
11
+ name: r.n,
12
+ kind: r.k,
13
+ countryCode: r.c,
14
+ alpha3: r.a3,
15
+ anchor: { lat: r.lat, lng: r.lng }
16
+ };
17
+ }
18
+ var byId = /* @__PURE__ */ new Map();
19
+ var countriesByAlpha2 = /* @__PURE__ */ new Map();
20
+ var countriesByAlpha3 = /* @__PURE__ */ new Map();
21
+ var statesByUsps = /* @__PURE__ */ new Map();
22
+ for (const row of rows) {
23
+ const entry = toEntry(row);
24
+ byId.set(entry.id, entry);
25
+ if (entry.kind === "country") {
26
+ countriesByAlpha2.set(entry.id, entry);
27
+ if (entry.alpha3) countriesByAlpha3.set(entry.alpha3, entry);
28
+ } else {
29
+ const usps = entry.id.slice(3);
30
+ statesByUsps.set(usps, entry);
31
+ }
32
+ }
33
+ var UNKNOWN_REGION = Object.freeze({
34
+ id: "??",
35
+ name: "Unknown",
36
+ kind: "unknown",
37
+ countryCode: "??"
38
+ });
39
+ function getRegionById(id) {
40
+ return byId.get(id);
41
+ }
42
+ function lookupRegionCode(code) {
43
+ const normalized = code.trim().toUpperCase();
44
+ if (normalized.length === 0) return void 0;
45
+ if (normalized.includes("-")) {
46
+ return byId.get(normalized);
47
+ }
48
+ if (normalized.length === 2) {
49
+ return countriesByAlpha2.get(normalized) ?? statesByUsps.get(normalized);
50
+ }
51
+ if (normalized.length === 3) {
52
+ return countriesByAlpha3.get(normalized);
53
+ }
54
+ return void 0;
55
+ }
56
+ function listRegions() {
57
+ return [...byId.values()];
58
+ }
59
+
60
+ // src/geo/lookup.ts
61
+ var _countries, _states, _cache, _MAX_CACHE, _RegionIndex_instances, resolveUncached_fn;
62
+ var _RegionIndex = class _RegionIndex {
63
+ constructor(geo) {
64
+ __privateAdd(this, _RegionIndex_instances);
65
+ __privateAdd(this, _countries, []);
66
+ __privateAdd(this, _states, []);
67
+ __privateAdd(this, _cache, /* @__PURE__ */ new Map());
68
+ for (const f of geo.countries.features) {
69
+ __privateGet(this, _countries).push(indexFeature(f));
70
+ }
71
+ for (const f of geo.states?.features ?? []) {
72
+ __privateGet(this, _states).push(indexFeature(f));
73
+ }
74
+ }
75
+ /** Whether US state geometry is present, and so whether state resolution can succeed. */
76
+ get hasStates() {
77
+ return __privateGet(this, _states).length > 0;
78
+ }
79
+ /**
80
+ * Find the region containing a point.
81
+ *
82
+ * @param point - Coordinates in degrees.
83
+ * @param preferStates - When `true`, return the US state if the point is in one.
84
+ * When `false`, always return the country. Maps to aggregation granularity.
85
+ * @returns The containing region, or {@link UNKNOWN_REGION} for points in the
86
+ * ocean or outside all known boundaries.
87
+ */
88
+ resolve(point, preferStates) {
89
+ const key = cacheKey(point, preferStates);
90
+ const cached = __privateGet(this, _cache).get(key);
91
+ if (cached) return cached;
92
+ const result = __privateMethod(this, _RegionIndex_instances, resolveUncached_fn).call(this, point, preferStates);
93
+ if (__privateGet(this, _cache).size >= __privateGet(_RegionIndex, _MAX_CACHE)) __privateGet(this, _cache).clear();
94
+ __privateGet(this, _cache).set(key, result);
95
+ return result;
96
+ }
97
+ };
98
+ _countries = new WeakMap();
99
+ _states = new WeakMap();
100
+ _cache = new WeakMap();
101
+ _MAX_CACHE = new WeakMap();
102
+ _RegionIndex_instances = new WeakSet();
103
+ resolveUncached_fn = function(point, preferStates) {
104
+ if (preferStates) {
105
+ const state = search(__privateGet(this, _states), point);
106
+ if (state) return state;
107
+ }
108
+ return search(__privateGet(this, _countries), point) ?? UNKNOWN_REGION;
109
+ };
110
+ /** Cache entries beyond this are dropped, bounding memory on unbounded feeds. */
111
+ __privateAdd(_RegionIndex, _MAX_CACHE, 2e4);
112
+ var RegionIndex = _RegionIndex;
113
+ function search(features, point) {
114
+ for (const entry of features) {
115
+ if (!inBBox(entry.bbox, point)) continue;
116
+ if (featureContains(entry.feature, point)) return entry.region;
117
+ }
118
+ return null;
119
+ }
120
+ function cacheKey(point, preferStates) {
121
+ const lat = Math.round(point.lat * 100);
122
+ const lng = Math.round(point.lng * 100);
123
+ return `${lat},${lng},${preferStates ? 1 : 0}`;
124
+ }
125
+ function indexFeature(feature) {
126
+ return {
127
+ bbox: computeBBox(feature),
128
+ feature,
129
+ region: {
130
+ id: feature.id,
131
+ name: feature.properties.name,
132
+ kind: feature.properties.kind,
133
+ countryCode: feature.properties.countryCode
134
+ }
135
+ };
136
+ }
137
+ function forEachRing(feature, visit) {
138
+ const { geometry } = feature;
139
+ if (geometry.type === "Polygon") {
140
+ for (const ring of geometry.coordinates) visit(ring);
141
+ return;
142
+ }
143
+ for (const polygon of geometry.coordinates) {
144
+ for (const ring of polygon) visit(ring);
145
+ }
146
+ }
147
+ function computeBBox(feature) {
148
+ let minLng = Infinity;
149
+ let minLat = Infinity;
150
+ let maxLng = -Infinity;
151
+ let maxLat = -Infinity;
152
+ forEachRing(feature, (ring) => {
153
+ for (const position of ring) {
154
+ const lng = position[0];
155
+ const lat = position[1];
156
+ if (lng < minLng) minLng = lng;
157
+ if (lng > maxLng) maxLng = lng;
158
+ if (lat < minLat) minLat = lat;
159
+ if (lat > maxLat) maxLat = lat;
160
+ }
161
+ });
162
+ return [minLng, minLat, maxLng, maxLat];
163
+ }
164
+ function inBBox(bbox, point) {
165
+ return point.lng >= bbox[0] && point.lng <= bbox[2] && point.lat >= bbox[1] && point.lat <= bbox[3];
166
+ }
167
+ function featureContains(feature, point) {
168
+ const { geometry } = feature;
169
+ if (geometry.type === "Polygon") {
170
+ return polygonContains(geometry.coordinates, point);
171
+ }
172
+ for (const polygon of geometry.coordinates) {
173
+ if (polygonContains(polygon, point)) return true;
174
+ }
175
+ return false;
176
+ }
177
+ function polygonContains(rings, point) {
178
+ let inside = false;
179
+ for (const ring of rings) {
180
+ if (ringCrossings(ring, point)) inside = !inside;
181
+ }
182
+ return inside;
183
+ }
184
+ function ringCrossings(ring, point) {
185
+ const { lat, lng } = point;
186
+ let inside = false;
187
+ for (let i = 0, j = ring.length - 1; i < ring.length; j = i++) {
188
+ const a = ring[i];
189
+ const b = ring[j];
190
+ const aLng = a[0];
191
+ const aLat = a[1];
192
+ const bLng = b[0];
193
+ const bLat = b[1];
194
+ if (aLat > lat !== bLat > lat) {
195
+ const t = (lat - aLat) / (bLat - aLat);
196
+ if (lng < aLng + t * (bLng - aLng)) inside = !inside;
197
+ }
198
+ }
199
+ return inside;
200
+ }
201
+
202
+ export { RegionIndex, UNKNOWN_REGION, getRegionById, listRegions, lookupRegionCode };
@@ -0,0 +1,9 @@
1
+ var __typeError = (msg) => {
2
+ throw TypeError(msg);
3
+ };
4
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
5
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
6
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
7
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
8
+
9
+ export { __privateAdd, __privateGet, __privateMethod };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var __typeError = (msg) => {
4
+ throw TypeError(msg);
5
+ };
6
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
7
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
8
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
9
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
10
+
11
+ exports.__privateAdd = __privateAdd;
12
+ exports.__privateGet = __privateGet;
13
+ exports.__privateMethod = __privateMethod;
@@ -0,0 +1,208 @@
1
+ 'use strict';
2
+
3
+ var chunkS6KRDFNO_cjs = require('./chunk-S6KRDFNO.cjs');
4
+
5
+ // src/geo/data/regions.json
6
+ var regions_default = [{ id: "ID", n: "Indonesia", k: "country", c: "ID", a3: "IDN", lat: -0.1916, lng: 114.0183 }, { id: "MY", n: "Malaysia", k: "country", c: "MY", a3: "MYS", lat: 3.6146, lng: 114.7143 }, { id: "CL", n: "Chile", k: "country", c: "CL", a3: "CHL", lat: -34.0985, lng: -70.9021 }, { id: "BO", n: "Bolivia", k: "country", c: "BO", a3: "BOL", lat: -16.6806, lng: -64.6979 }, { id: "PE", n: "Peru", k: "country", c: "PE", a3: "PER", lat: -9.1087, lng: -74.4162 }, { id: "AR", n: "Argentina", k: "country", c: "AR", a3: "ARG", lat: -34.5402, lng: -64.7468 }, { id: "CY", n: "Cyprus", k: "country", c: "CY", a3: "CYP", lat: 34.9118, lng: 32.954 }, { id: "IN", n: "India", k: "country", c: "IN", a3: "IND", lat: 22.8042, lng: 79.5341 }, { id: "CN", n: "China", k: "country", c: "CN", a3: "CHN", lat: 36.7574, lng: 103.3541 }, { id: "IL", n: "Israel", k: "country", c: "IL", a3: "ISR", lat: 31.4347, lng: 34.9919 }, { id: "PS", n: "Palestine", k: "country", c: "PS", a3: "PSE", lat: 31.9442, lng: 35.2447 }, { id: "LB", n: "Lebanon", k: "country", c: "LB", a3: "LBN", lat: 33.919, lng: 35.8776 }, { id: "ET", n: "Ethiopia", k: "country", c: "ET", a3: "ETH", lat: 8.6146, lng: 39.6094 }, { id: "SS", n: "S. Sudan", k: "country", c: "SS", a3: "SSD", lat: 7.2836, lng: 30.305 }, { id: "SO", n: "Somalia", k: "country", c: "SO", a3: "SOM", lat: 4.7374, lng: 45.6784 }, { id: "KE", n: "Kenya", k: "country", c: "KE", a3: "KEN", lat: 0.5514, lng: 37.822 }, { id: "PK", n: "Pakistan", k: "country", c: "PK", a3: "PAK", lat: 29.8829, lng: 69.1702 }, { id: "MW", n: "Malawi", k: "country", c: "MW", a3: "MWI", lat: -13.2055, lng: 34.2828 }, { id: "TZ", n: "Tanzania", k: "country", c: "TZ", a3: "TZA", lat: -6.2681, lng: 34.7872 }, { id: "SY", n: "Syria", k: "country", c: "SY", a3: "SYR", lat: 35.0164, lng: 38.4843 }, { id: "XS", n: "Somaliland", k: "country", c: "XS", a3: "XSO", lat: 9.7333, lng: 46.2565 }, { id: "FR", n: "France", k: "country", c: "FR", a3: "FRA", lat: 46.5728, lng: 2.4608 }, { id: "SR", n: "Suriname", k: "country", c: "SR", a3: "SUR", lat: 4.1304, lng: -55.9112 }, { id: "GY", n: "Guyana", k: "country", c: "GY", a3: "GUY", lat: 4.7888, lng: -58.9782 }, { id: "KR", n: "South Korea", k: "country", c: "KR", a3: "KOR", lat: 36.4497, lng: 127.8648 }, { id: "KP", n: "North Korea", k: "country", c: "KP", a3: "PRK", lat: 40.1387, lng: 127.1534 }, { id: "MA", n: "Morocco", k: "country", c: "MA", a3: "MAR", lat: 29.773, lng: -8.6638 }, { id: "EH", n: "W. Sahara", k: "country", c: "EH", a3: "ESH", lat: 24.2147, lng: -12.2669 }, { id: "CR", n: "Costa Rica", k: "country", c: "CR", a3: "CRI", lat: 9.9746, lng: -84.1898 }, { id: "NI", n: "Nicaragua", k: "country", c: "NI", a3: "NIC", lat: 12.8428, lng: -85.0356 }, { id: "CG", n: "Congo", k: "country", c: "CG", a3: "COG", lat: -0.838, lng: 15.2199 }, { id: "CD", n: "Dem. Rep. Congo", k: "country", c: "CD", a3: "COD", lat: -2.8677, lng: 23.6394 }, { id: "BT", n: "Bhutan", k: "country", c: "BT", a3: "BTN", lat: 27.4228, lng: 90.4046 }, { id: "UA", n: "Ukraine", k: "country", c: "UA", a3: "UKR", lat: 49.1979, lng: 31.3178 }, { id: "BY", n: "Belarus", k: "country", c: "BY", a3: "BLR", lat: 53.52, lng: 28.0164 }, { id: "NA", n: "Namibia", k: "country", c: "NA", a3: "NAM", lat: -22.0683, lng: 17.1965 }, { id: "ZA", n: "South Africa", k: "country", c: "ZA", a3: "ZAF", lat: -28.9698, lng: 25.1937 }, { id: "MF", n: "St-Martin", k: "country", c: "MF", a3: "MAF", lat: 18.0777, lng: -63.0543 }, { id: "SX", n: "Sint Maarten", k: "country", c: "SX", a3: "SXM", lat: 18.0406, lng: -63.0694 }, { id: "OM", n: "Oman", k: "country", c: "OM", a3: "OMN", lat: 20.5544, lng: 56.0563 }, { id: "UZ", n: "Uzbekistan", k: "country", c: "UZ", a3: "UZB", lat: 41.7776, lng: 63.2947 }, { id: "KZ", n: "Kazakhstan", k: "country", c: "KZ", a3: "KAZ", lat: 48.3667, lng: 67.2535 }, { id: "TJ", n: "Tajikistan", k: "country", c: "TJ", a3: "TJK", lat: 38.5344, lng: 71.0295 }, { id: "LT", n: "Lithuania", k: "country", c: "LT", a3: "LTU", lat: 55.3243, lng: 23.904 }, { id: "BR", n: "Brazil", k: "country", c: "BR", a3: "BRA", lat: -10.6914, lng: -53.2343 }, { id: "UY", n: "Uruguay", k: "country", c: "UY", a3: "URY", lat: -32.79, lng: -56.0242 }, { id: "MN", n: "Mongolia", k: "country", c: "MN", a3: "MNG", lat: 46.9552, lng: 103.127 }, { id: "RU", n: "Russia", k: "country", c: "RU", a3: "RUS", lat: 55.75, lng: 37.62 }, { id: "CZ", n: "Czechia", k: "country", c: "CZ", a3: "CZE", lat: 49.737, lng: 15.3211 }, { id: "DE", n: "Germany", k: "country", c: "DE", a3: "DEU", lat: 51.0317, lng: 10.3514 }, { id: "EE", n: "Estonia", k: "country", c: "EE", a3: "EST", lat: 58.6816, lng: 25.8367 }, { id: "LV", n: "Latvia", k: "country", c: "LV", a3: "LVA", lat: 56.8605, lng: 24.9168 }, { id: "NO", n: "Norway", k: "country", c: "NO", a3: "NOR", lat: 59.91, lng: 10.75 }, { id: "SE", n: "Sweden", k: "country", c: "SE", a3: "SWE", lat: 62.4388, lng: 16.2573 }, { id: "FI", n: "Finland", k: "country", c: "FI", a3: "FIN", lat: 64.2666, lng: 26.2118 }, { id: "VN", n: "Vietnam", k: "country", c: "VN", a3: "VNM", lat: 16.5561, lng: 106.3482 }, { id: "KH", n: "Cambodia", k: "country", c: "KH", a3: "KHM", lat: 12.7175, lng: 104.9035 }, { id: "LU", n: "Luxembourg", k: "country", c: "LU", a3: "LUX", lat: 49.7665, lng: 6.0723 }, { id: "AE", n: "United Arab Emirates", k: "country", c: "AE", a3: "ARE", lat: 23.9018, lng: 54.2998 }, { id: "BE", n: "Belgium", k: "country", c: "BE", a3: "BEL", lat: 50.6367, lng: 4.6474 }, { id: "GE", n: "Georgia", k: "country", c: "GE", a3: "GEO", lat: 42.1733, lng: 43.5239 }, { id: "MK", n: "Macedonia", k: "country", c: "MK", a3: "MKD", lat: 41.5949, lng: 21.6822 }, { id: "AL", n: "Albania", k: "country", c: "AL", a3: "ALB", lat: 41.135, lng: 20.0559 }, { id: "AZ", n: "Azerbaijan", k: "country", c: "AZ", a3: "AZE", lat: 40.3436, lng: 47.6659 }, { id: "XK", n: "Kosovo", k: "country", c: "XK", a3: "XKX", lat: 42.5722, lng: 20.8737 }, { id: "TR", n: "Turkey", k: "country", c: "TR", a3: "TUR", lat: 39.0612, lng: 35.4114 }, { id: "ES", n: "Spain", k: "country", c: "ES", a3: "ESP", lat: 40.3617, lng: -3.5726 }, { id: "LA", n: "Laos", k: "country", c: "LA", a3: "LAO", lat: 18.4875, lng: 103.7751 }, { id: "KG", n: "Kyrgyzstan", k: "country", c: "KG", a3: "KGZ", lat: 41.474, lng: 74.5092 }, { id: "AM", n: "Armenia", k: "country", c: "AM", a3: "ARM", lat: 40.2855, lng: 44.94 }, { id: "DK", n: "Denmark", k: "country", c: "DK", a3: "DNK", lat: 56.217, lng: 9.3663 }, { id: "LY", n: "Libya", k: "country", c: "LY", a3: "LBY", lat: 27.0158, lng: 18.0682 }, { id: "TN", n: "Tunisia", k: "country", c: "TN", a3: "TUN", lat: 34.089, lng: 9.5519 }, { id: "RO", n: "Romania", k: "country", c: "RO", a3: "ROU", lat: 45.8494, lng: 24.9831 }, { id: "HU", n: "Hungary", k: "country", c: "HU", a3: "HUN", lat: 47.1664, lng: 19.3804 }, { id: "SK", n: "Slovakia", k: "country", c: "SK", a3: "SVK", lat: 48.7108, lng: 19.4704 }, { id: "PL", n: "Poland", k: "country", c: "PL", a3: "POL", lat: 52.109, lng: 19.4236 }, { id: "IE", n: "Ireland", k: "country", c: "IE", a3: "IRL", lat: 53.1637, lng: -8.146 }, { id: "GB", n: "United Kingdom", k: "country", c: "GB", a3: "GBR", lat: 53.8353, lng: -2.4224 }, { id: "GR", n: "Greece", k: "country", c: "GR", a3: "GRC", lat: 39.4571, lng: 22.5631 }, { id: "ZM", n: "Zambia", k: "country", c: "ZM", a3: "ZMB", lat: -13.4575, lng: 27.8078 }, { id: "SL", n: "Sierra Leone", k: "country", c: "SL", a3: "SLE", lat: 8.5711, lng: -11.7873 }, { id: "GN", n: "Guinea", k: "country", c: "GN", a3: "GIN", lat: 10.4357, lng: -10.9366 }, { id: "LR", n: "Liberia", k: "country", c: "LR", a3: "LBR", lat: 6.4514, lng: -9.3176 }, { id: "CF", n: "Central African Rep.", k: "country", c: "CF", a3: "CAF", lat: 6.5704, lng: 20.4583 }, { id: "SD", n: "Sudan", k: "country", c: "SD", a3: "SDN", lat: 15.9644, lng: 29.9066 }, { id: "DJ", n: "Djibouti", k: "country", c: "DJ", a3: "DJI", lat: 11.7496, lng: 42.5659 }, { id: "ER", n: "Eritrea", k: "country", c: "ER", a3: "ERI", lat: 15.3542, lng: 38.8562 }, { id: "AT", n: "Austria", k: "country", c: "AT", a3: "AUT", lat: 47.5924, lng: 14.1148 }, { id: "IQ", n: "Iraq", k: "country", c: "IQ", a3: "IRQ", lat: 33.0097, lng: 43.7752 }, { id: "IT", n: "Italy", k: "country", c: "IT", a3: "ITA", lat: 43.4796, lng: 12.3073 }, { id: "CH", n: "Switzerland", k: "country", c: "CH", a3: "CHE", lat: 46.8, lng: 8.2129 }, { id: "IR", n: "Iran", k: "country", c: "IR", a3: "IRN", lat: 32.5291, lng: 54.4426 }, { id: "NL", n: "Netherlands", k: "country", c: "NL", a3: "NLD", lat: 52.2766, lng: 5.6297 }, { id: "LI", n: "Liechtenstein", k: "country", c: "LI", a3: "LIE", lat: 47.1379, lng: 9.5415 }, { id: "CI", n: "C\xF4te d'Ivoire", k: "country", c: "CI", a3: "CIV", lat: 7.626, lng: -5.5694 }, { id: "RS", n: "Serbia", k: "country", c: "RS", a3: "SRB", lat: 44.2111, lng: 20.8075 }, { id: "ML", n: "Mali", k: "country", c: "ML", a3: "MLI", lat: 17.3135, lng: -3.587 }, { id: "SN", n: "Senegal", k: "country", c: "SN", a3: "SEN", lat: 14.3662, lng: -14.4674 }, { id: "NG", n: "Nigeria", k: "country", c: "NG", a3: "NGA", lat: 9.5939, lng: 8.0816 }, { id: "BJ", n: "Benin", k: "country", c: "BJ", a3: "BEN", lat: 9.6351, lng: 2.3276 }, { id: "AO", n: "Angola", k: "country", c: "AO", a3: "AGO", lat: -12.3081, lng: 17.5598 }, { id: "HR", n: "Croatia", k: "country", c: "HR", a3: "HRV", lat: 45.1532, lng: 16.4172 }, { id: "SI", n: "Slovenia", k: "country", c: "SI", a3: "SVN", lat: 46.1162, lng: 14.804 }, { id: "QA", n: "Qatar", k: "country", c: "QA", a3: "QAT", lat: 25.3117, lng: 51.1866 }, { id: "SA", n: "Saudi Arabia", k: "country", c: "SA", a3: "SAU", lat: 24.0882, lng: 44.665 }, { id: "BW", n: "Botswana", k: "country", c: "BW", a3: "BWA", lat: -22.167, lng: 23.8091 }, { id: "ZW", n: "Zimbabwe", k: "country", c: "ZW", a3: "ZWE", lat: -18.9954, lng: 29.8515 }, { id: "BG", n: "Bulgaria", k: "country", c: "BG", a3: "BGR", lat: 42.7708, lng: 25.2111 }, { id: "TH", n: "Thailand", k: "country", c: "TH", a3: "THA", lat: 15.1022, lng: 101.0068 }, { id: "SM", n: "San Marino", k: "country", c: "SM", a3: "SMR", lat: 43.9366, lng: 12.4429 }, { id: "HT", n: "Haiti", k: "country", c: "HT", a3: "HTI", lat: 18.9346, lng: -72.679 }, { id: "DO", n: "Dominican Rep.", k: "country", c: "DO", a3: "DOM", lat: 18.9001, lng: -70.4999 }, { id: "TD", n: "Chad", k: "country", c: "TD", a3: "TCD", lat: 15.275, lng: 18.6364 }, { id: "KW", n: "Kuwait", k: "country", c: "KW", a3: "KWT", lat: 29.3191, lng: 47.5659 }, { id: "SV", n: "El Salvador", k: "country", c: "SV", a3: "SLV", lat: 13.737, lng: -88.8718 }, { id: "GT", n: "Guatemala", k: "country", c: "GT", a3: "GTM", lat: 15.6921, lng: -90.3628 }, { id: "TL", n: "Timor-Leste", k: "country", c: "TL", a3: "TLS", lat: -8.8042, lng: 125.9367 }, { id: "BN", n: "Brunei", k: "country", c: "BN", a3: "BRN", lat: 4.4931, lng: 114.5978 }, { id: "MC", n: "Monaco", k: "country", c: "MC", a3: "MCO", lat: 43.7399, lng: 7.3984 }, { id: "DZ", n: "Algeria", k: "country", c: "DZ", a3: "DZA", lat: 28.0444, lng: 2.6659 }, { id: "MZ", n: "Mozambique", k: "country", c: "MZ", a3: "MOZ", lat: -17.1912, lng: 35.6065 }, { id: "SZ", n: "eSwatini", k: "country", c: "SZ", a3: "SWZ", lat: -26.5608, lng: 31.4799 }, { id: "BI", n: "Burundi", k: "country", c: "BI", a3: "BDI", lat: -3.3573, lng: 29.875 }, { id: "RW", n: "Rwanda", k: "country", c: "RW", a3: "RWA", lat: -1.9927, lng: 29.9192 }, { id: "MM", n: "Myanmar", k: "country", c: "MM", a3: "MMR", lat: 21.142, lng: 96.4947 }, { id: "BD", n: "Bangladesh", k: "country", c: "BD", a3: "BGD", lat: 23.875, lng: 90.2362 }, { id: "AD", n: "Andorra", k: "country", c: "AD", a3: "AND", lat: 42.5413, lng: 1.5611 }, { id: "AF", n: "Afghanistan", k: "country", c: "AF", a3: "AFG", lat: 33.8198, lng: 65.9295 }, { id: "ME", n: "Montenegro", k: "country", c: "ME", a3: "MNE", lat: 42.7849, lng: 19.2383 }, { id: "BA", n: "Bosnia and Herz.", k: "country", c: "BA", a3: "BIH", lat: 44.1686, lng: 17.7794 }, { id: "UG", n: "Uganda", k: "country", c: "UG", a3: "UGA", lat: 1.2751, lng: 32.3666 }, { id: "CU", n: "Cuba", k: "country", c: "CU", a3: "CUB", lat: 21.6286, lng: -78.9285 }, { id: "HN", n: "Honduras", k: "country", c: "HN", a3: "HND", lat: 14.8206, lng: -86.6278 }, { id: "EC", n: "Ecuador", k: "country", c: "EC", a3: "ECU", lat: -1.448, lng: -78.3865 }, { id: "CO", n: "Colombia", k: "country", c: "CO", a3: "COL", lat: 3.899, lng: -73.0772 }, { id: "PY", n: "Paraguay", k: "country", c: "PY", a3: "PRY", lat: -23.2082, lng: -58.4417 }, { id: "PT", n: "Portugal", k: "country", c: "PT", a3: "PRT", lat: 39.6549, lng: -7.9822 }, { id: "MD", n: "Moldova", k: "country", c: "MD", a3: "MDA", lat: 47.1873, lng: 28.4701 }, { id: "TM", n: "Turkmenistan", k: "country", c: "TM", a3: "TKM", lat: 39.1258, lng: 59.4531 }, { id: "JO", n: "Jordan", k: "country", c: "JO", a3: "JOR", lat: 31.2383, lng: 36.7571 }, { id: "NP", n: "Nepal", k: "country", c: "NP", a3: "NPL", lat: 28.257, lng: 83.9474 }, { id: "LS", n: "Lesotho", k: "country", c: "LS", a3: "LSO", lat: -29.5787, lng: 28.2304 }, { id: "CM", n: "Cameroon", k: "country", c: "CM", a3: "CMR", lat: 5.6831, lng: 12.7312 }, { id: "GA", n: "Gabon", k: "country", c: "GA", a3: "GAB", lat: -0.5913, lng: 11.7909 }, { id: "NE", n: "Niger", k: "country", c: "NE", a3: "NER", lat: 17.4113, lng: 9.3322 }, { id: "BF", n: "Burkina Faso", k: "country", c: "BF", a3: "BFA", lat: 12.2707, lng: -1.7621 }, { id: "TG", n: "Togo", k: "country", c: "TG", a3: "TGO", lat: 8.5225, lng: 0.9639 }, { id: "GH", n: "Ghana", k: "country", c: "GH", a3: "GHA", lat: 7.9482, lng: -1.2167 }, { id: "GW", n: "Guinea-Bissau", k: "country", c: "GW", a3: "GNB", lat: 12.0571, lng: -14.9291 }, { id: "GI", n: "Gibraltar", k: "country", c: "GI", a3: "GIB", lat: 36.1297, lng: -5.3471 }, { id: "US", n: "United States of America", k: "country", c: "US", a3: "USA", lat: 39.8887, lng: -98.8219 }, { id: "CA", n: "Canada", k: "country", c: "CA", a3: "CAN", lat: 58.5939, lng: -98.9884 }, { id: "MX", n: "Mexico", k: "country", c: "MX", a3: "MEX", lat: 23.9181, lng: -102.1592 }, { id: "BZ", n: "Belize", k: "country", c: "BZ", a3: "BLZ", lat: 17.1994, lng: -88.7049 }, { id: "PA", n: "Panama", k: "country", c: "PA", a3: "PAN", lat: 8.5252, lng: -80.1067 }, { id: "VE", n: "Venezuela", k: "country", c: "VE", a3: "VEN", lat: 7.1155, lng: -66.1724 }, { id: "PG", n: "Papua New Guinea", k: "country", c: "PG", a3: "PNG", lat: -6.611, lng: 144.2394 }, { id: "EG", n: "Egypt", k: "country", c: "EG", a3: "EGY", lat: 26.4565, lng: 29.8773 }, { id: "YE", n: "Yemen", k: "country", c: "YE", a3: "YEM", lat: 15.9428, lng: 47.5215 }, { id: "MR", n: "Mauritania", k: "country", c: "MR", a3: "MRT", lat: 20.2196, lng: -10.3642 }, { id: "GQ", n: "Eq. Guinea", k: "country", c: "GQ", a3: "GNQ", lat: 1.5651, lng: 10.4674 }, { id: "GM", n: "Gambia", k: "country", c: "GM", a3: "GMB", lat: 13.4512, lng: -15.3975 }, { id: "HK", n: "Hong Kong", k: "country", c: "HK", a3: "HKG", lat: 22.4246, lng: 114.1606 }, { id: "VA", n: "Vatican", k: "country", c: "VA", a3: "VAT", lat: 41.9034, lng: 12.4543 }, { id: "XN", n: "Northern Cyprus", k: "country", c: "XN", a3: "XNC", lat: 35.2769, lng: 33.5974 }, { id: "AQ", n: "Antarctica", k: "country", c: "AQ", a3: "ATA", lat: -84.6755, lng: 83.0407 }, { id: "AU", n: "Australia", k: "country", c: "AU", a3: "AUS", lat: -25.6326, lng: 134.2061 }, { id: "GL", n: "Greenland", k: "country", c: "GL", a3: "GRL", lat: 73.1471, lng: -41.838 }, { id: "FJ", n: "Fiji", k: "country", c: "FJ", a3: "FJI", lat: -17.8241, lng: 177.9754 }, { id: "NZ", n: "New Zealand", k: "country", c: "NZ", a3: "NZL", lat: -43.9598, lng: 170.602 }, { id: "NC", n: "New Caledonia", k: "country", c: "NC", a3: "NCL", lat: -21.3252, lng: 165.4817 }, { id: "MG", n: "Madagascar", k: "country", c: "MG", a3: "MDG", lat: -19.3212, lng: 46.7422 }, { id: "PH", n: "Philippines", k: "country", c: "PH", a3: "PHL", lat: 15.9436, lng: 121.4228 }, { id: "LK", n: "Sri Lanka", k: "country", c: "LK", a3: "LKA", lat: 7.6077, lng: 80.7057 }, { id: "CW", n: "Cura\xE7ao", k: "country", c: "CW", a3: "CUW", lat: 12.1939, lng: -68.9716 }, { id: "AW", n: "Aruba", k: "country", c: "AW", a3: "ABW", lat: 12.5172, lng: -69.9738 }, { id: "BS", n: "Bahamas", k: "country", c: "BS", a3: "BHS", lat: 24.7031, lng: -78.04 }, { id: "TC", n: "Turks and Caicos Is.", k: "country", c: "TC", a3: "TCA", lat: 21.8098, lng: -71.7427 }, { id: "TW", n: "Taiwan", k: "country", c: "TW", a3: "TWN", lat: 23.7491, lng: 120.9614 }, { id: "JP", n: "Japan", k: "country", c: "JP", a3: "JPN", lat: 36.6341, lng: 137.8696 }, { id: "PM", n: "St. Pierre and Miquelon", k: "country", c: "PM", a3: "SPM", lat: 46.9516, lng: -56.3243 }, { id: "IS", n: "Iceland", k: "country", c: "IS", a3: "ISL", lat: 65.0006, lng: -18.6017 }, { id: "PN", n: "Pitcairn Is.", k: "country", c: "PN", a3: "PCN", lat: -24.3667, lng: -128.3167 }, { id: "PF", n: "Fr. Polynesia", k: "country", c: "PF", a3: "PYF", lat: -17.6641, lng: -149.4205 }, { id: "TF", n: "Fr. S. Antarctic Lands", k: "country", c: "TF", a3: "ATF", lat: -49.3112, lng: 69.5008 }, { id: "SC", n: "Seychelles", k: "country", c: "SC", a3: "SYC", lat: -4.6764, lng: 55.4672 }, { id: "KI", n: "Kiribati", k: "country", c: "KI", a3: "KIR", lat: 1.8497, lng: -157.3706 }, { id: "MH", n: "Marshall Is.", k: "country", c: "MH", a3: "MHL", lat: 7.0995, lng: 171.2024 }, { id: "TT", n: "Trinidad and Tobago", k: "country", c: "TT", a3: "TTO", lat: 10.4218, lng: -61.2941 }, { id: "GD", n: "Grenada", k: "country", c: "GD", a3: "GRD", lat: 12.1173, lng: -61.6788 }, { id: "VC", n: "St. Vin. and Gren.", k: "country", c: "VC", a3: "VCT", lat: 13.2565, lng: -61.1936 }, { id: "BB", n: "Barbados", k: "country", c: "BB", a3: "BRB", lat: 13.1814, lng: -59.5616 }, { id: "LC", n: "Saint Lucia", k: "country", c: "LC", a3: "LCA", lat: 13.9029, lng: -60.9702 }, { id: "DM", n: "Dominica", k: "country", c: "DM", a3: "DMA", lat: 15.4366, lng: -61.3569 }, { id: "UM", n: "U.S. Minor Outlying Is.", k: "country", c: "UM", a3: "UMI", lat: 5.8811, lng: -162.0765 }, { id: "MS", n: "Montserrat", k: "country", c: "MS", a3: "MSR", lat: 16.7378, lng: -62.187 }, { id: "AG", n: "Antigua and Barb.", k: "country", c: "AG", a3: "ATG", lat: 17.0746, lng: -61.7891 }, { id: "KN", n: "St. Kitts and Nevis", k: "country", c: "KN", a3: "KNA", lat: 17.3321, lng: -62.7584 }, { id: "VI", n: "U.S. Virgin Is.", k: "country", c: "VI", a3: "VIR", lat: 17.7392, lng: -64.7628 }, { id: "BL", n: "St-Barth\xE9lemy", k: "country", c: "BL", a3: "BLM", lat: 17.9053, lng: -62.8321 }, { id: "PR", n: "Puerto Rico", k: "country", c: "PR", a3: "PRI", lat: 18.2264, lng: -66.4811 }, { id: "AI", n: "Anguilla", k: "country", c: "AI", a3: "AIA", lat: 18.2244, lng: -63.0578 }, { id: "VG", n: "British Virgin Is.", k: "country", c: "VG", a3: "VGB", lat: 18.4239, lng: -64.6221 }, { id: "JM", n: "Jamaica", k: "country", c: "JM", a3: "JAM", lat: 18.1559, lng: -77.3189 }, { id: "KY", n: "Cayman Is.", k: "country", c: "KY", a3: "CYM", lat: 19.3183, lng: -81.2519 }, { id: "BM", n: "Bermuda", k: "country", c: "BM", a3: "BMU", lat: 32.3116, lng: -64.7604 }, { id: "HM", n: "Heard I. and McDonald Is.", k: "country", c: "HM", a3: "HMD", lat: -53.0888, lng: 73.5049 }, { id: "SH", n: "Saint Helena", k: "country", c: "SH", a3: "SHN", lat: -15.9594, lng: -5.7171 }, { id: "MU", n: "Mauritius", k: "country", c: "MU", a3: "MUS", lat: -20.2796, lng: 57.5696 }, { id: "KM", n: "Comoros", k: "country", c: "KM", a3: "COM", lat: -11.6547, lng: 43.3397 }, { id: "ST", n: "S\xE3o Tom\xE9 and Principe", k: "country", c: "ST", a3: "STP", lat: 0.236, lng: 6.6075 }, { id: "CV", n: "Cabo Verde", k: "country", c: "CV", a3: "CPV", lat: 15.0816, lng: -23.6368 }, { id: "MT", n: "Malta", k: "country", c: "MT", a3: "MLT", lat: 35.8904, lng: 14.4415 }, { id: "JE", n: "Jersey", k: "country", c: "JE", a3: "JEY", lat: 49.2211, lng: -2.127 }, { id: "GG", n: "Guernsey", k: "country", c: "GG", a3: "GGY", lat: 49.4629, lng: -2.5774 }, { id: "IM", n: "Isle of Man", k: "country", c: "IM", a3: "IMN", lat: 54.2292, lng: -4.5339 }, { id: "AX", n: "\xC5land", k: "country", c: "AX", a3: "ALA", lat: 60.2289, lng: 19.9431 }, { id: "FO", n: "Faeroe Is.", k: "country", c: "FO", a3: "FRO", lat: 62.1368, lng: -6.986 }, { id: "IO", n: "Br. Indian Ocean Ter.", k: "country", c: "IO", a3: "IOT", lat: -7.3514, lng: 72.4292 }, { id: "SG", n: "Singapore", k: "country", c: "SG", a3: "SGP", lat: 1.3588, lng: 103.8131 }, { id: "NF", n: "Norfolk Island", k: "country", c: "NF", a3: "NFK", lat: -29.0347, lng: 167.9551 }, { id: "CK", n: "Cook Is.", k: "country", c: "CK", a3: "COK", lat: -21.2193, lng: -159.7864 }, { id: "TO", n: "Tonga", k: "country", c: "TO", a3: "TON", lat: -21.1723, lng: -175.2041 }, { id: "WF", n: "Wallis and Futuna Is.", k: "country", c: "WF", a3: "WLF", lat: -13.2823, lng: -176.1622 }, { id: "WS", n: "Samoa", k: "country", c: "WS", a3: "WSM", lat: -13.6305, lng: -172.4386 }, { id: "SB", n: "Solomon Is.", k: "country", c: "SB", a3: "SLB", lat: -9.6228, lng: 160.1698 }, { id: "TV", n: "Tuvalu", k: "country", c: "TV", a3: "TUV", lat: -8.502, lng: 179.2051 }, { id: "MV", n: "Maldives", k: "country", c: "MV", a3: "MDV", lat: 6.2213, lng: 73.0321 }, { id: "NR", n: "Nauru", k: "country", c: "NR", a3: "NRU", lat: -0.5207, lng: 166.9331 }, { id: "FM", n: "Micronesia", k: "country", c: "FM", a3: "FSM", lat: 6.8828, lng: 158.2341 }, { id: "GS", n: "S. Geo. and the Is.", k: "country", c: "GS", a3: "SGS", lat: -54.3674, lng: -36.6888 }, { id: "FK", n: "Falkland Is.", k: "country", c: "FK", a3: "FLK", lat: -51.7347, lng: -58.7512 }, { id: "VU", n: "Vanuatu", k: "country", c: "VU", a3: "VUT", lat: -15.2314, lng: 166.8539 }, { id: "NU", n: "Niue", k: "country", c: "NU", a3: "NIU", lat: -19.049, lng: -169.8692 }, { id: "AS", n: "American Samoa", k: "country", c: "AS", a3: "ASM", lat: -14.3048, lng: -170.7154 }, { id: "PW", n: "Palau", k: "country", c: "PW", a3: "PLW", lat: 7.5146, lng: 134.5804 }, { id: "GU", n: "Guam", k: "country", c: "GU", a3: "GUM", lat: 13.4445, lng: 144.7725 }, { id: "MP", n: "N. Mariana Is.", k: "country", c: "MP", a3: "MNP", lat: 15.1835, lng: 145.7409 }, { id: "BH", n: "Bahrain", k: "country", c: "BH", a3: "BHR", lat: 26.0525, lng: 50.5466 }, { id: "MO", n: "Macao", k: "country", c: "MO", a3: "MAC", lat: 22.1378, lng: 113.5571 }, { id: "BQ", n: "Bonaire, Sint Eustatius and Saba", k: "country", c: "BQ", a3: "BES", lat: 12.1784, lng: -68.2385 }, { id: "BV", n: "Bouvet Island", k: "country", c: "BV", a3: "BVT", lat: -54.4208, lng: 3.3464 }, { id: "CC", n: "Cocos (Keeling) Islands", k: "country", c: "CC", a3: "CCK", lat: -12.1642, lng: 96.871 }, { id: "CX", n: "Christmas Island", k: "country", c: "CX", a3: "CXR", lat: -10.4475, lng: 105.6904 }, { id: "GF", n: "French Guiana", k: "country", c: "GF", a3: "GUF", lat: 3.9339, lng: -53.1258 }, { id: "GP", n: "Guadeloupe", k: "country", c: "GP", a3: "GLP", lat: 16.265, lng: -61.551 }, { id: "MQ", n: "Martinique", k: "country", c: "MQ", a3: "MTQ", lat: 14.6415, lng: -61.0242 }, { id: "RE", n: "R\xE9union", k: "country", c: "RE", a3: "REU", lat: -21.1151, lng: 55.5364 }, { id: "SJ", n: "Svalbard and Jan Mayen", k: "country", c: "SJ", a3: "SJM", lat: 77.875, lng: 20.9752 }, { id: "TK", n: "Tokelau", k: "country", c: "TK", a3: "TKL", lat: -9.2002, lng: -171.8484 }, { id: "YT", n: "Mayotte", k: "country", c: "YT", a3: "MYT", lat: -12.8275, lng: 45.1662 }, { id: "US-AL", n: "Alabama", k: "state", c: "US", a3: null, lat: 32.7769, lng: -86.8296 }, { id: "US-AK", n: "Alaska", k: "state", c: "US", a3: null, lat: 64.2338, lng: -152.5469 }, { id: "US-AZ", n: "Arizona", k: "state", c: "US", a3: null, lat: 34.2748, lng: -111.6605 }, { id: "US-CO", n: "Colorado", k: "state", c: "US", a3: null, lat: 38.9973, lng: -105.548 }, { id: "US-FL", n: "Florida", k: "state", c: "US", a3: null, lat: 28.6329, lng: -82.461 }, { id: "US-GA", n: "Georgia", k: "state", c: "US", a3: null, lat: 32.6378, lng: -83.4359 }, { id: "US-IN", n: "Indiana", k: "state", c: "US", a3: null, lat: 39.8946, lng: -86.2816 }, { id: "US-KS", n: "Kansas", k: "state", c: "US", a3: null, lat: 38.4937, lng: -98.3787 }, { id: "US-ME", n: "Maine", k: "state", c: "US", a3: null, lat: 45.3516, lng: -69.2372 }, { id: "US-MA", n: "Massachusetts", k: "state", c: "US", a3: null, lat: 42.2721, lng: -71.8201 }, { id: "US-MN", n: "Minnesota", k: "state", c: "US", a3: null, lat: 46.2806, lng: -94.3053 }, { id: "US-NJ", n: "New Jersey", k: "state", c: "US", a3: null, lat: 40.1786, lng: -74.6636 }, { id: "US-NC", n: "North Carolina", k: "state", c: "US", a3: null, lat: 35.5523, lng: -79.3633 }, { id: "US-ND", n: "North Dakota", k: "state", c: "US", a3: null, lat: 47.4505, lng: -100.4662 }, { id: "US-OK", n: "Oklahoma", k: "state", c: "US", a3: null, lat: 35.5883, lng: -97.4932 }, { id: "US-PA", n: "Pennsylvania", k: "state", c: "US", a3: null, lat: 40.8783, lng: -77.8001 }, { id: "US-SD", n: "South Dakota", k: "state", c: "US", a3: null, lat: 44.4445, lng: -100.2275 }, { id: "US-TX", n: "Texas", k: "state", c: "US", a3: null, lat: 31.4628, lng: -99.3205 }, { id: "US-WY", n: "Wyoming", k: "state", c: "US", a3: null, lat: 42.9957, lng: -107.5514 }, { id: "US-CT", n: "Connecticut", k: "state", c: "US", a3: null, lat: 41.6205, lng: -72.7271 }, { id: "US-MO", n: "Missouri", k: "state", c: "US", a3: null, lat: 38.3565, lng: -92.4579 }, { id: "US-WV", n: "West Virginia", k: "state", c: "US", a3: null, lat: 38.6398, lng: -80.6251 }, { id: "US-IL", n: "Illinois", k: "state", c: "US", a3: null, lat: 40.0421, lng: -89.1969 }, { id: "US-NM", n: "New Mexico", k: "state", c: "US", a3: null, lat: 34.4073, lng: -106.1124 }, { id: "US-AR", n: "Arkansas", k: "state", c: "US", a3: null, lat: 34.8942, lng: -92.4431 }, { id: "US-CA", n: "California", k: "state", c: "US", a3: null, lat: 37.1919, lng: -119.4732 }, { id: "US-DE", n: "Delaware", k: "state", c: "US", a3: null, lat: 38.9905, lng: -75.5002 }, { id: "US-DC", n: "District of Columbia", k: "state", c: "US", a3: null, lat: 38.9038, lng: -77.0153 }, { id: "US-HI", n: "Hawaii", k: "state", c: "US", a3: null, lat: 19.6012, lng: -155.521 }, { id: "US-IA", n: "Iowa", k: "state", c: "US", a3: null, lat: 42.0751, lng: -93.4957 }, { id: "US-KY", n: "Kentucky", k: "state", c: "US", a3: null, lat: 37.5356, lng: -85.2994 }, { id: "US-MD", n: "Maryland", k: "state", c: "US", a3: null, lat: 39.0361, lng: -76.762 }, { id: "US-MI", n: "Michigan", k: "state", c: "US", a3: null, lat: 43.4697, lng: -84.6219 }, { id: "US-MS", n: "Mississippi", k: "state", c: "US", a3: null, lat: 32.7362, lng: -89.6677 }, { id: "US-MT", n: "Montana", k: "state", c: "US", a3: null, lat: 47.0525, lng: -109.633 }, { id: "US-NH", n: "New Hampshire", k: "state", c: "US", a3: null, lat: 43.6791, lng: -71.5804 }, { id: "US-NY", n: "New York", k: "state", c: "US", a3: null, lat: 42.9399, lng: -75.51 }, { id: "US-OH", n: "Ohio", k: "state", c: "US", a3: null, lat: 40.2885, lng: -82.7944 }, { id: "US-OR", n: "Oregon", k: "state", c: "US", a3: null, lat: 43.9347, lng: -120.562 }, { id: "US-TN", n: "Tennessee", k: "state", c: "US", a3: null, lat: 35.858, lng: -86.351 }, { id: "US-UT", n: "Utah", k: "state", c: "US", a3: null, lat: 39.3056, lng: -111.6701 }, { id: "US-VA", n: "Virginia", k: "state", c: "US", a3: null, lat: 37.5183, lng: -78.8915 }, { id: "US-WA", n: "Washington", k: "state", c: "US", a3: null, lat: 47.3768, lng: -120.4394 }, { id: "US-WI", n: "Wisconsin", k: "state", c: "US", a3: null, lat: 44.6212, lng: -89.994 }, { id: "US-AS", n: "American Samoa", k: "state", c: "US", a3: null, lat: -14.2941, lng: -170.7045 }, { id: "US-GU", n: "Guam", k: "state", c: "US", a3: null, lat: 13.4437, lng: 144.7745 }, { id: "US-MP", n: "Commonwealth of the Northern Mariana Islands", k: "state", c: "US", a3: null, lat: 15.1904, lng: 145.7504 }, { id: "US-NE", n: "Nebraska", k: "state", c: "US", a3: null, lat: 41.538, lng: -99.7945 }, { id: "US-SC", n: "South Carolina", k: "state", c: "US", a3: null, lat: 33.9057, lng: -80.8897 }, { id: "US-PR", n: "Puerto Rico", k: "state", c: "US", a3: null, lat: 18.2248, lng: -66.4752 }, { id: "US-VI", n: "United States Virgin Islands", k: "state", c: "US", a3: null, lat: 17.7317, lng: -64.7683 }, { id: "US-ID", n: "Idaho", k: "state", c: "US", a3: null, lat: 44.3502, lng: -114.6127 }, { id: "US-NV", n: "Nevada", k: "state", c: "US", a3: null, lat: 39.3291, lng: -116.6314 }, { id: "US-VT", n: "Vermont", k: "state", c: "US", a3: null, lat: 44.0689, lng: -72.6666 }, { id: "US-LA", n: "Louisiana", k: "state", c: "US", a3: null, lat: 31.0472, lng: -91.9652 }, { id: "US-RI", n: "Rhode Island", k: "state", c: "US", a3: null, lat: 41.6937, lng: -71.589 }];
7
+
8
+ // src/geo/regions.ts
9
+ var rows = regions_default;
10
+ function toEntry(r) {
11
+ return {
12
+ id: r.id,
13
+ name: r.n,
14
+ kind: r.k,
15
+ countryCode: r.c,
16
+ alpha3: r.a3,
17
+ anchor: { lat: r.lat, lng: r.lng }
18
+ };
19
+ }
20
+ var byId = /* @__PURE__ */ new Map();
21
+ var countriesByAlpha2 = /* @__PURE__ */ new Map();
22
+ var countriesByAlpha3 = /* @__PURE__ */ new Map();
23
+ var statesByUsps = /* @__PURE__ */ new Map();
24
+ for (const row of rows) {
25
+ const entry = toEntry(row);
26
+ byId.set(entry.id, entry);
27
+ if (entry.kind === "country") {
28
+ countriesByAlpha2.set(entry.id, entry);
29
+ if (entry.alpha3) countriesByAlpha3.set(entry.alpha3, entry);
30
+ } else {
31
+ const usps = entry.id.slice(3);
32
+ statesByUsps.set(usps, entry);
33
+ }
34
+ }
35
+ var UNKNOWN_REGION = Object.freeze({
36
+ id: "??",
37
+ name: "Unknown",
38
+ kind: "unknown",
39
+ countryCode: "??"
40
+ });
41
+ function getRegionById(id) {
42
+ return byId.get(id);
43
+ }
44
+ function lookupRegionCode(code) {
45
+ const normalized = code.trim().toUpperCase();
46
+ if (normalized.length === 0) return void 0;
47
+ if (normalized.includes("-")) {
48
+ return byId.get(normalized);
49
+ }
50
+ if (normalized.length === 2) {
51
+ return countriesByAlpha2.get(normalized) ?? statesByUsps.get(normalized);
52
+ }
53
+ if (normalized.length === 3) {
54
+ return countriesByAlpha3.get(normalized);
55
+ }
56
+ return void 0;
57
+ }
58
+ function listRegions() {
59
+ return [...byId.values()];
60
+ }
61
+
62
+ // src/geo/lookup.ts
63
+ var _countries, _states, _cache, _MAX_CACHE, _RegionIndex_instances, resolveUncached_fn;
64
+ var _RegionIndex = class _RegionIndex {
65
+ constructor(geo) {
66
+ chunkS6KRDFNO_cjs.__privateAdd(this, _RegionIndex_instances);
67
+ chunkS6KRDFNO_cjs.__privateAdd(this, _countries, []);
68
+ chunkS6KRDFNO_cjs.__privateAdd(this, _states, []);
69
+ chunkS6KRDFNO_cjs.__privateAdd(this, _cache, /* @__PURE__ */ new Map());
70
+ for (const f of geo.countries.features) {
71
+ chunkS6KRDFNO_cjs.__privateGet(this, _countries).push(indexFeature(f));
72
+ }
73
+ for (const f of geo.states?.features ?? []) {
74
+ chunkS6KRDFNO_cjs.__privateGet(this, _states).push(indexFeature(f));
75
+ }
76
+ }
77
+ /** Whether US state geometry is present, and so whether state resolution can succeed. */
78
+ get hasStates() {
79
+ return chunkS6KRDFNO_cjs.__privateGet(this, _states).length > 0;
80
+ }
81
+ /**
82
+ * Find the region containing a point.
83
+ *
84
+ * @param point - Coordinates in degrees.
85
+ * @param preferStates - When `true`, return the US state if the point is in one.
86
+ * When `false`, always return the country. Maps to aggregation granularity.
87
+ * @returns The containing region, or {@link UNKNOWN_REGION} for points in the
88
+ * ocean or outside all known boundaries.
89
+ */
90
+ resolve(point, preferStates) {
91
+ const key = cacheKey(point, preferStates);
92
+ const cached = chunkS6KRDFNO_cjs.__privateGet(this, _cache).get(key);
93
+ if (cached) return cached;
94
+ const result = chunkS6KRDFNO_cjs.__privateMethod(this, _RegionIndex_instances, resolveUncached_fn).call(this, point, preferStates);
95
+ if (chunkS6KRDFNO_cjs.__privateGet(this, _cache).size >= chunkS6KRDFNO_cjs.__privateGet(_RegionIndex, _MAX_CACHE)) chunkS6KRDFNO_cjs.__privateGet(this, _cache).clear();
96
+ chunkS6KRDFNO_cjs.__privateGet(this, _cache).set(key, result);
97
+ return result;
98
+ }
99
+ };
100
+ _countries = new WeakMap();
101
+ _states = new WeakMap();
102
+ _cache = new WeakMap();
103
+ _MAX_CACHE = new WeakMap();
104
+ _RegionIndex_instances = new WeakSet();
105
+ resolveUncached_fn = function(point, preferStates) {
106
+ if (preferStates) {
107
+ const state = search(chunkS6KRDFNO_cjs.__privateGet(this, _states), point);
108
+ if (state) return state;
109
+ }
110
+ return search(chunkS6KRDFNO_cjs.__privateGet(this, _countries), point) ?? UNKNOWN_REGION;
111
+ };
112
+ /** Cache entries beyond this are dropped, bounding memory on unbounded feeds. */
113
+ chunkS6KRDFNO_cjs.__privateAdd(_RegionIndex, _MAX_CACHE, 2e4);
114
+ var RegionIndex = _RegionIndex;
115
+ function search(features, point) {
116
+ for (const entry of features) {
117
+ if (!inBBox(entry.bbox, point)) continue;
118
+ if (featureContains(entry.feature, point)) return entry.region;
119
+ }
120
+ return null;
121
+ }
122
+ function cacheKey(point, preferStates) {
123
+ const lat = Math.round(point.lat * 100);
124
+ const lng = Math.round(point.lng * 100);
125
+ return `${lat},${lng},${preferStates ? 1 : 0}`;
126
+ }
127
+ function indexFeature(feature) {
128
+ return {
129
+ bbox: computeBBox(feature),
130
+ feature,
131
+ region: {
132
+ id: feature.id,
133
+ name: feature.properties.name,
134
+ kind: feature.properties.kind,
135
+ countryCode: feature.properties.countryCode
136
+ }
137
+ };
138
+ }
139
+ function forEachRing(feature, visit) {
140
+ const { geometry } = feature;
141
+ if (geometry.type === "Polygon") {
142
+ for (const ring of geometry.coordinates) visit(ring);
143
+ return;
144
+ }
145
+ for (const polygon of geometry.coordinates) {
146
+ for (const ring of polygon) visit(ring);
147
+ }
148
+ }
149
+ function computeBBox(feature) {
150
+ let minLng = Infinity;
151
+ let minLat = Infinity;
152
+ let maxLng = -Infinity;
153
+ let maxLat = -Infinity;
154
+ forEachRing(feature, (ring) => {
155
+ for (const position of ring) {
156
+ const lng = position[0];
157
+ const lat = position[1];
158
+ if (lng < minLng) minLng = lng;
159
+ if (lng > maxLng) maxLng = lng;
160
+ if (lat < minLat) minLat = lat;
161
+ if (lat > maxLat) maxLat = lat;
162
+ }
163
+ });
164
+ return [minLng, minLat, maxLng, maxLat];
165
+ }
166
+ function inBBox(bbox, point) {
167
+ return point.lng >= bbox[0] && point.lng <= bbox[2] && point.lat >= bbox[1] && point.lat <= bbox[3];
168
+ }
169
+ function featureContains(feature, point) {
170
+ const { geometry } = feature;
171
+ if (geometry.type === "Polygon") {
172
+ return polygonContains(geometry.coordinates, point);
173
+ }
174
+ for (const polygon of geometry.coordinates) {
175
+ if (polygonContains(polygon, point)) return true;
176
+ }
177
+ return false;
178
+ }
179
+ function polygonContains(rings, point) {
180
+ let inside = false;
181
+ for (const ring of rings) {
182
+ if (ringCrossings(ring, point)) inside = !inside;
183
+ }
184
+ return inside;
185
+ }
186
+ function ringCrossings(ring, point) {
187
+ const { lat, lng } = point;
188
+ let inside = false;
189
+ for (let i = 0, j = ring.length - 1; i < ring.length; j = i++) {
190
+ const a = ring[i];
191
+ const b = ring[j];
192
+ const aLng = a[0];
193
+ const aLat = a[1];
194
+ const bLng = b[0];
195
+ const bLat = b[1];
196
+ if (aLat > lat !== bLat > lat) {
197
+ const t = (lat - aLat) / (bLat - aLat);
198
+ if (lng < aLng + t * (bLng - aLng)) inside = !inside;
199
+ }
200
+ }
201
+ return inside;
202
+ }
203
+
204
+ exports.RegionIndex = RegionIndex;
205
+ exports.UNKNOWN_REGION = UNKNOWN_REGION;
206
+ exports.getRegionById = getRegionById;
207
+ exports.listRegions = listRegions;
208
+ exports.lookupRegionCode = lookupRegionCode;