@maptiler/client 3.0.2 → 3.1.0-rc.2

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.
@@ -1,4 +1,4 @@
1
- import { BBox, Position, Feature, Geometry, FeatureCollection, LineString, MultiLineString, GeoJsonObject } from 'geojson';
1
+ import { BBox, Position, Feature, Geometry, MultiPoint, MultiPolygon, FeatureCollection, LineString, MultiLineString, GeoJsonObject } from 'geojson';
2
2
  export { BBox, LineString, MultiLineString, Position } from 'geojson';
3
3
  import QuickLRU from 'quick-lru';
4
4
 
@@ -1190,6 +1190,223 @@ declare const geolocation: {
1190
1190
  info: typeof info;
1191
1191
  };
1192
1192
 
1193
+ /** Routing profile — determines the costing model. */
1194
+ type RoutingProfile = "car" | "truck" | "bicycle" | "pedestrian";
1195
+ /** Unit of length to use */
1196
+ type RoutingDistanceUnit = "km" | "mi";
1197
+ /** Language of navigation instructions */
1198
+ type RoutingInstructionsLanguage = "bg" | "ca" | "cs" | "da" | "de" | "el" | "en" | "es" | "et" | "fi" | "fr" | "hi" | "hu" | "it" | "ja" | "nb" | "nl" | "pl" | "pt" | "ro" | "ru" | "sk" | "sl" | "sv" | "tr" | "uk";
1199
+ /** A single routing location */
1200
+ interface RoutingLocation {
1201
+ /** Longitude of the point */
1202
+ lon: number;
1203
+ /** Latitude of the point */
1204
+ lat: number;
1205
+ /** Preferred direction of travel starting from this location. */
1206
+ heading?: number;
1207
+ /**
1208
+ * Whether this location is a waypoint (default: true).
1209
+ * If false, the router may pass through without splitting legs.
1210
+ */
1211
+ waypoint?: boolean;
1212
+ }
1213
+ /** Avoidance flags. */
1214
+ interface RoutingAvoidances {
1215
+ /** Avoid toll roads */
1216
+ tolls?: boolean;
1217
+ /** Avoid ferries */
1218
+ ferry?: boolean;
1219
+ /** Avoid highways */
1220
+ highway?: boolean;
1221
+ }
1222
+ /** Car-specific routing options. */
1223
+ interface RoutingCarOptions {
1224
+ /** Car routing mode: fastest, shortest or balanced */
1225
+ mode?: "fastest" | "shortest" | "balanced";
1226
+ /** Maximal speed of the car */
1227
+ topSpeed?: number;
1228
+ /** Avoidance flags */
1229
+ avoidances?: RoutingAvoidances;
1230
+ }
1231
+ /** Truck-specific routing options. */
1232
+ interface RoutingTruckOptions {
1233
+ /** Weight of the truck */
1234
+ weight?: number;
1235
+ /** Height of the truck */
1236
+ height?: number;
1237
+ /** Length of the truck */
1238
+ length?: number;
1239
+ /** Axle load of the truck */
1240
+ axleLoad?: number;
1241
+ /** Whether the truck carries hazardous materials */
1242
+ hazmat?: boolean;
1243
+ /** Maximal speed of the truck */
1244
+ topSpeed?: number;
1245
+ /** Avoidance flags */
1246
+ avoidances?: RoutingAvoidances;
1247
+ }
1248
+ /** Bicycle-specific routing options. */
1249
+ interface RoutingBicycleOptions {
1250
+ /** Bicycle type: road, gravel, mountain, city */
1251
+ type?: "road" | "gravel" | "mountain" | "city";
1252
+ /** Average speed along flat, smooth road. Used to calculate ETA. */
1253
+ cyclingSpeed?: number;
1254
+ }
1255
+ /** Pedestrian-specific routing options. */
1256
+ interface RoutingPedestrianOptions {
1257
+ /** Average walking speed along flat, smooth road. Used to calculate ETA. */
1258
+ walkingSpeed?: number;
1259
+ }
1260
+ /** All profile-specific options. */
1261
+ type RoutingProfileOptions = RoutingCarOptions | RoutingTruckOptions | RoutingBicycleOptions | RoutingPedestrianOptions;
1262
+ /** Full routing request body for POST /routing/directions. */
1263
+ interface RoutingRequest {
1264
+ /** Pass-through identifier returned in response */
1265
+ id?: string;
1266
+ /** List of route locations (min 2) */
1267
+ locations: RoutingLocation[];
1268
+ /** Routing profile */
1269
+ profile: RoutingProfile;
1270
+ /** Response formatting options */
1271
+ response?: {
1272
+ /** Units for distance */
1273
+ units?: RoutingDistanceUnit;
1274
+ /** Language of navigation instructions */
1275
+ language?: RoutingInstructionsLanguage;
1276
+ /** Number of alternate routes to generate */
1277
+ alternates?: number;
1278
+ /**
1279
+ * Whether geometry should be encoded as polyline.
1280
+ * Default: true
1281
+ */
1282
+ encodePoints?: boolean;
1283
+ /** Additional data returned with the route */
1284
+ additionalData?: {
1285
+ /**
1286
+ * Level of detail: legs, steps or instructions
1287
+ */
1288
+ detailLevel?: "legs" | "steps" | "instructions";
1289
+ };
1290
+ };
1291
+ /**
1292
+ * Time of departure.
1293
+ * Format: YYYY-MM-DDTHH:MM
1294
+ */
1295
+ departureTime?: string;
1296
+ /**
1297
+ * Desired arrival time.
1298
+ * Format: YYYY-MM-DDTHH:MM
1299
+ */
1300
+ arrivalTime?: string;
1301
+ /** Locations or polygons to avoid. */
1302
+ avoidLocations?: MultiPoint | MultiPolygon;
1303
+ /** Profile-specific routing options. */
1304
+ profileOptions?: RoutingProfileOptions;
1305
+ }
1306
+ /** Routing response */
1307
+ interface RoutingResponse {
1308
+ /** Pass-through identifier */
1309
+ id?: string;
1310
+ /** Main route */
1311
+ route: RoutingRoute;
1312
+ /** Alternate routes */
1313
+ alternates?: RoutingRoute[];
1314
+ /** Attribution text */
1315
+ attribution?: string;
1316
+ /** Units used in response */
1317
+ units?: RoutingDistanceUnit;
1318
+ /** Language used in response */
1319
+ language?: RoutingInstructionsLanguage;
1320
+ }
1321
+ interface RoutingRoute {
1322
+ /** Summary of this route */
1323
+ summary: RoutingSummary;
1324
+ /** Route legs between waypoints */
1325
+ legs: RoutingRouteLeg[];
1326
+ }
1327
+ /** Summary of a route or a leg */
1328
+ interface RoutingSummary {
1329
+ /** Cost calculated by the costing model */
1330
+ cost: number;
1331
+ /** Total travel time in seconds */
1332
+ totalTime: number;
1333
+ /** Total travel distance in chosen units */
1334
+ totalLength: number;
1335
+ /** Bounding box of the route */
1336
+ bbox: BBox;
1337
+ /** Whether route contains tolls */
1338
+ toll?: boolean;
1339
+ /** Whether route contains highways */
1340
+ highway?: boolean;
1341
+ /** Whether route contains ferries */
1342
+ ferry?: boolean;
1343
+ }
1344
+ /** Single leg of a route */
1345
+ interface RoutingRouteLeg {
1346
+ /** Summary of the leg */
1347
+ summary: RoutingSummary;
1348
+ /**
1349
+ * Geometry of the leg as a list of coordinates
1350
+ */
1351
+ geometry: Position[];
1352
+ /** Turn-by-turn steps */
1353
+ steps: RoutingRouteStep[];
1354
+ }
1355
+ /** Details of a single turn-by-turn step */
1356
+ interface RoutingRouteStep {
1357
+ /** Time in seconds */
1358
+ time: number;
1359
+ /** Distance in chosen units */
1360
+ length: number;
1361
+ /** Street name */
1362
+ streetName?: string;
1363
+ /** Maneuver details */
1364
+ maneuver?: RoutingRouteManeuver;
1365
+ /** Index of step start in geometry array */
1366
+ beginIndex?: number;
1367
+ /** Index of step end in geometry array */
1368
+ endIndex?: number;
1369
+ /** Step-level flags */
1370
+ details?: {
1371
+ toll?: boolean;
1372
+ highway?: boolean;
1373
+ rough?: boolean;
1374
+ ferry?: boolean;
1375
+ };
1376
+ }
1377
+ /** Details of a single turn-by-turn step maneuver */
1378
+ interface RoutingRouteManeuver {
1379
+ /** Human-readable instruction */
1380
+ instruction?: string;
1381
+ /** Roundabout exit number */
1382
+ exitNumber?: number;
1383
+ /** Turn sharpness */
1384
+ turnAngle?: number;
1385
+ /** Maneuver type */
1386
+ type: "none" | "continue" | "slightLeftTurn" | "slightRightTurn" | "leftTurn" | "rightTurn" | "leftSharpTurn" | "rightSharpTurn" | "leftUTurn" | "rightUTurn" | "roundaboutEnter" | "roundaboutExit" | "start" | "destination";
1387
+ }
1388
+ /**
1389
+ * Get directions using POST request
1390
+ */
1391
+ declare function directionsPost(body: RoutingRequest): Promise<RoutingResponse>;
1392
+ /**
1393
+ * Get directions using GET request
1394
+ */
1395
+ declare function directionsGet(req: RoutingRequest): Promise<RoutingResponse>;
1396
+ /**
1397
+ * API client module for MapTiler Routing API
1398
+ */
1399
+ declare const routing: {
1400
+ /**
1401
+ * Get directions using POST request
1402
+ */
1403
+ directionsPost: typeof directionsPost;
1404
+ /**
1405
+ * Get directions using GET request
1406
+ */
1407
+ directionsGet: typeof directionsGet;
1408
+ };
1409
+
1193
1410
  type CoordinatesSearchOptions = {
1194
1411
  /**
1195
1412
  * Custom MapTiler Cloud API key to use instead of the one in global `config`
@@ -2675,4 +2892,4 @@ declare const misc: {
2675
2892
  simplify: typeof simplify;
2676
2893
  };
2677
2894
 
2678
- export { type AutomaticStaticMapOptions, type BaseGeocodingOptions, type BoundedStaticMapOptions, type BufferToPixelDataFunction, type ByIdGeocodingOptions, type CenteredStaticMapOptions, ClientConfig, type CommonForwardAndReverseGeocodingOptions, type CoordinateExport, type CoordinateGrid, type CoordinateId, type CoordinateSearch, type CoordinateSearchResult, type CoordinateTransformResult, type CoordinateTransformation, type Coordinates, type CoordinatesSearchOptions, type CoordinatesTransformOptions, type DefaultTransformation, type ElevationAtOptions, type ElevationBatchOptions, type FeatureHierarchy, type FetchFunction, type GeocodingFeature, type GeocodingOptions, type GeocodingPlaceType, type GeocodingSearchResult, type GeolocationInfoOptions, type GeolocationResult, type GetDataOptions, ISOLanguage, Language, type LanguageGeocodingOptions, type LanguageInfo, MapStyle, type MapStylePreset, type MapStyleType, MapStyleVariant, NonISOLanguage, type PixelData, ReferenceMapStyle, type ReverseGeocodingOptions, ServiceError, type StaticMapBaseOptions, type StaticMapMarker, type TileJSON, type XYZ, areSameLanguages, bufferToPixelDataBrowser, canParsePixelData, circumferenceAtLatitude, config, coordinates, data, defaultReferenceStyleMap, elevation, expandMapStyle, geocoding, geolocation, getAutoLanguage, getBufferToPixelDataParser, getLanguageInfoFromCode, getLanguageInfoFromFlag, getLanguageInfoFromKey, getTileCache, isLanguageInfo, mapStylePresetList, math, misc, staticMaps, styleToStyle, toLanguageInfo };
2895
+ export { type AutomaticStaticMapOptions, type BaseGeocodingOptions, type BoundedStaticMapOptions, type BufferToPixelDataFunction, type ByIdGeocodingOptions, type CenteredStaticMapOptions, ClientConfig, type CommonForwardAndReverseGeocodingOptions, type CoordinateExport, type CoordinateGrid, type CoordinateId, type CoordinateSearch, type CoordinateSearchResult, type CoordinateTransformResult, type CoordinateTransformation, type Coordinates, type CoordinatesSearchOptions, type CoordinatesTransformOptions, type DefaultTransformation, type ElevationAtOptions, type ElevationBatchOptions, type FeatureHierarchy, type FetchFunction, type GeocodingFeature, type GeocodingOptions, type GeocodingPlaceType, type GeocodingSearchResult, type GeolocationInfoOptions, type GeolocationResult, type GetDataOptions, ISOLanguage, Language, type LanguageGeocodingOptions, type LanguageInfo, MapStyle, type MapStylePreset, type MapStyleType, MapStyleVariant, NonISOLanguage, type PixelData, ReferenceMapStyle, type ReverseGeocodingOptions, type RoutingAvoidances, type RoutingBicycleOptions, type RoutingCarOptions, type RoutingDistanceUnit, type RoutingInstructionsLanguage, type RoutingLocation, type RoutingPedestrianOptions, type RoutingProfile, type RoutingProfileOptions, type RoutingRequest, type RoutingResponse, type RoutingRoute, type RoutingRouteLeg, type RoutingRouteManeuver, type RoutingRouteStep, type RoutingSummary, type RoutingTruckOptions, ServiceError, type StaticMapBaseOptions, type StaticMapMarker, type TileJSON, type XYZ, areSameLanguages, bufferToPixelDataBrowser, canParsePixelData, circumferenceAtLatitude, config, coordinates, data, defaultReferenceStyleMap, elevation, expandMapStyle, geocoding, geolocation, getAutoLanguage, getBufferToPixelDataParser, getLanguageInfoFromCode, getLanguageInfoFromFlag, getLanguageInfoFromKey, getTileCache, isLanguageInfo, mapStylePresetList, math, misc, routing, staticMaps, styleToStyle, toLanguageInfo };
@@ -1 +1 @@
1
- import ke from"quick-lru";function we(){return typeof self<"u"?fetch.bind(self):typeof global<"u"&&global.fetch?global.fetch:null}class Z{constructor(){this._apiKey="",this._fetch=we(),this.tileCacheSize=200}set apiKey(a){this._apiKey=a}get apiKey(){return this._apiKey}set fetch(a){this._fetch=a}get fetch(){return this._fetch}}const p=new Z,X={AUTO:{code:null,flag:"auto",name:"Auto",latin:!1,isMode:!0,geocoding:!0},LATIN:{code:"latin",flag:"name:latin",name:"Latin",latin:!0,isMode:!1,geocoding:!1},NON_LATIN:{code:"nonlatin",flag:"name:nonlatin",name:"Non Latin",latin:!1,isMode:!1,geocoding:!1},LOCAL:{code:null,flag:"name",name:"Local",latin:!0,isMode:!1,geocoding:!1}},ee={ALBANIAN:{code:"sq",flag:"name:sq",name:"Albanian",latin:!0,isMode:!1,geocoding:!0},AMHARIC:{code:"am",flag:"name:am",name:"Amharic",latin:!1,isMode:!1,geocoding:!0},ARABIC:{code:"ar",flag:"name:ar",name:"Arabic",latin:!1,isMode:!1,geocoding:!0},ARMENIAN:{code:"hy",flag:"name:hy",name:"Armenian",latin:!1,isMode:!1,geocoding:!0},AZERBAIJANI:{code:"az",flag:"name:az",name:"Azerbaijani",latin:!0,isMode:!1,geocoding:!0},BASQUE:{code:"eu",flag:"name:eu",name:"Basque",latin:!0,isMode:!1,geocoding:!0},BELARUSIAN:{code:"be",flag:"name:be",name:"Belarusian",latin:!1,isMode:!1,geocoding:!0},BENGALI:{code:"bn",flag:"name:bn",name:"Bengali",latin:!0,isMode:!1,geocoding:!0},BOSNIAN:{code:"bs",flag:"name:bs",name:"Bosnian",latin:!0,isMode:!1,geocoding:!0},BRETON:{code:"br",flag:"name:br",name:"Breton",latin:!0,isMode:!1,geocoding:!0},BULGARIAN:{code:"bg",flag:"bg",name:"Bulgarian",latin:!1,isMode:!1,geocoding:!0},CATALAN:{code:"ca",flag:"name:ca",name:"Catalan",latin:!0,isMode:!1,geocoding:!0},CHINESE:{code:"zh",flag:"name:zh",name:"Chinese",latin:!1,isMode:!1,geocoding:!0},TRADITIONAL_CHINESE:{code:"zh-Hant",flag:"name:zh-Hant",name:"Chinese (traditional)",latin:!1,isMode:!1,geocoding:!1},SIMPLIFIED_CHINESE:{code:"zh-Hans",flag:"name:zh-Hans",name:"Chinese (simplified)",latin:!1,isMode:!1,geocoding:!1},CORSICAN:{code:"co",flag:"name:co",name:"Corsican",latin:!0,isMode:!1,geocoding:!0},CROATIAN:{code:"hr",flag:"name:hr",name:"Croatian",latin:!0,isMode:!1,geocoding:!0},CZECH:{code:"cs",flag:"name:cs",name:"Czech",latin:!0,isMode:!1,geocoding:!0},DANISH:{code:"da",flag:"name:da",name:"Danish",latin:!0,isMode:!1,geocoding:!0},DUTCH:{code:"nl",flag:"name:nl",name:"Dutch",latin:!0,isMode:!1,geocoding:!0},GERMAN:{code:"de",flag:"name:de",name:"German",latin:!0,isMode:!1,geocoding:!0},GREEK:{code:"el",flag:"name:el",name:"Greek",latin:!1,isMode:!1,geocoding:!0},ENGLISH:{code:"en",flag:"name:en",name:"English",latin:!0,isMode:!1,geocoding:!0},ESPERANTO:{code:"eo",flag:"name:eo",name:"Esperanto",latin:!0,isMode:!1,geocoding:!0},ESTONIAN:{code:"et",flag:"name:et",name:"Estonian",latin:!0,isMode:!1,geocoding:!0},FINNISH:{code:"fi",flag:"name:fi",name:"Finnish",latin:!0,isMode:!1,geocoding:!0},FRENCH:{code:"fr",flag:"name:fr",name:"French",latin:!0,isMode:!1,geocoding:!0},FRISIAN:{code:"fy",flag:"name:fy",name:"Frisian (West)",latin:!0,isMode:!1,geocoding:!0},GEORGIAN:{code:"ka",flag:"name:ka",name:"Georgian",latin:!1,isMode:!1,geocoding:!0},HEBREW:{code:"he",flag:"name:he",name:"Hebrew",latin:!1,isMode:!1,geocoding:!0},HINDI:{code:"hi",flag:"name:hi",name:"Hindi",latin:!1,isMode:!1,geocoding:!0},HUNGARIAN:{code:"hu",flag:"name:hu",name:"Hungarian",latin:!0,isMode:!1,geocoding:!0},ICELANDIC:{code:"is",flag:"name:is",name:"Icelandic",latin:!0,isMode:!1,geocoding:!0},INDONESIAN:{code:"id",flag:"name:id",name:"Indonesian",latin:!0,isMode:!1,geocoding:!0},IRISH:{code:"ga",flag:"name:ga",name:"Irish",latin:!0,isMode:!1,geocoding:!0},ITALIAN:{code:"it",flag:"name:it",name:"Italian",latin:!0,isMode:!1,geocoding:!0},JAPANESE:{code:"ja",flag:"name:ja",name:"Japanese",latin:!1,isMode:!1,geocoding:!0},JAPANESE_HIRAGANA:{code:"ja-Hira",flag:"name:ja-Hira",name:"Japanese Hiragana form",latin:!1,isMode:!1,geocoding:!1},JAPANESE_2018:{code:"ja-Latn",flag:"name:ja-Latn",name:"Japanese (Latin 2018)",latin:!0,isMode:!1,geocoding:!1},JAPANESE_KANA:{code:"ja_kana",flag:"name:ja_kana",name:"Japanese (Kana)",latin:!1,isMode:!1,geocoding:!1},JAPANESE_LATIN:{code:"ja_rm",flag:"name:ja_rm",name:"Japanese (Latin script)",latin:!0,isMode:!1,geocoding:!1},KANNADA:{code:"kn",flag:"name:kn",name:"Kannada",latin:!0,isMode:!1,geocoding:!0},KAZAKH:{code:"kk",flag:"name:kk",name:"Kazakh",latin:!1,isMode:!1,geocoding:!0},KOREAN:{code:"ko",flag:"name:ko",name:"Korean",latin:!1,isMode:!1,geocoding:!0},KOREAN_LATIN:{code:"ko-Latn",flag:"name:ko-Latn",name:"Korean (Latin script)",latin:!0,isMode:!1,geocoding:!1},KURDISH:{code:"ku",flag:"name:ku",name:"Kurdish",latin:!0,isMode:!1,geocoding:!0},CLASSICAL_LATIN:{code:"la",flag:"name:la",name:"Latin",latin:!0,isMode:!1,geocoding:!0},LATVIAN:{code:"lv",flag:"name:lv",name:"Latvian",latin:!0,isMode:!1,geocoding:!0},LITHUANIAN:{code:"lt",flag:"name:lt",name:"Lithuanian",latin:!0,isMode:!1,geocoding:!0},LUXEMBOURGISH:{code:"lb",flag:"name:lb",name:"Luxembourgish",latin:!0,isMode:!1,geocoding:!0},MACEDONIAN:{code:"mk",flag:"name:mk",name:"Macedonian",latin:!1,isMode:!1,geocoding:!0},MALAYALAM:{code:"ml",flag:"name:ml",name:"Malayalam",latin:!1,isMode:!1,geocoding:!0},MALTESE:{code:"mt",flag:"name:mt",name:"Maltese",latin:!0,isMode:!1,geocoding:!0},NORWEGIAN:{code:"no",flag:"name:no",name:"Norwegian",latin:!0,isMode:!1,geocoding:!0},OCCITAN:{code:"oc",flag:"name:oc",name:"Occitan",latin:!0,isMode:!1,geocoding:!0},PERSIAN:{code:"fa",flag:"name:fa",name:"Persian",latin:!1,isMode:!1,geocoding:!0},POLISH:{code:"pl",flag:"name:pl",name:"Polish",latin:!0,isMode:!1,geocoding:!0},PORTUGUESE:{code:"pt",flag:"name:pt",name:"Portuguese",latin:!0,isMode:!1,geocoding:!0},PUNJABI:{code:"pa",flag:"name:pa",name:"Punjabi",latin:!1,isMode:!1,geocoding:!0},WESTERN_PUNJABI:{code:"pnb",flag:"name:pnb",name:"Western Punjabi",latin:!1,isMode:!1,geocoding:!1},ROMANIAN:{code:"ro",flag:"name:ro",name:"Romanian",latin:!0,isMode:!1,geocoding:!0},ROMANSH:{code:"rm",flag:"name:rm",name:"Romansh",latin:!0,isMode:!1,geocoding:!0},RUSSIAN:{code:"ru",flag:"name:ru",name:"Russian",latin:!1,isMode:!1,geocoding:!0},SERBIAN_CYRILLIC:{code:"sr",flag:"name:sr",name:"Serbian (Cyrillic script)",latin:!1,isMode:!1,geocoding:!0},SERBIAN_LATIN:{code:"sr-Latn",flag:"name:sr-Latn",name:"Serbian (Latin script)",latin:!0,isMode:!1,geocoding:!1},SCOTTISH_GAELIC:{code:"gd",flag:"name:gd",name:"Scottish Gaelic",latin:!0,isMode:!1,geocoding:!0},SLOVAK:{code:"sk",flag:"name:sk",name:"Slovak",latin:!0,isMode:!1,geocoding:!0},SLOVENE:{code:"sl",flag:"name:sl",name:"Slovene",latin:!0,isMode:!1,geocoding:!0},SPANISH:{code:"es",flag:"name:es",name:"Spanish",latin:!0,isMode:!1,geocoding:!0},SWEDISH:{code:"sv",flag:"name:sv",name:"Swedish",latin:!0,isMode:!1,geocoding:!0},TAMIL:{code:"ta",flag:"name:ta",name:"Tamil",latin:!1,isMode:!1,geocoding:!0},TELUGU:{code:"te",flag:"name:te",name:"Telugu",latin:!1,isMode:!1,geocoding:!0},THAI:{code:"th",flag:"name:th",name:"Thai",latin:!1,isMode:!1,geocoding:!0},TURKISH:{code:"tr",flag:"name:tr",name:"Turkish",latin:!0,isMode:!1,geocoding:!0},UKRAINIAN:{code:"uk",flag:"name:uk",name:"Ukrainian",latin:!1,isMode:!1,geocoding:!0},VIETNAMESE:{code:"vi",flag:"name:vi",name:"Vietnamese (Latin script)",latin:!0,isMode:!1,geocoding:!0},WELSH:{code:"cy",flag:"name:cy",name:"Welsh",latin:!0,isMode:!1,geocoding:!0}},y={...X,...ee};function ae(e,a=y){return e in a?a[e]:null}function S(e,a=y){for(const t of Object.values(a))if(t.code===e)return t;return null}function U(e,a=y){for(const t of Object.values(a))if(t.flag===e)return t;return null}function _(){if(typeof navigator>"u"){const e=Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0];return S(e)??y.ENGLISH}return Array.from(new Set(navigator.languages.map(e=>e.split("-")[0]))).map(e=>S(e)).filter(e=>e)[0]??y.ENGLISH}function K(e){return e!==null&&typeof e=="object"&&"code"in e&&"flag"in e&&"name"in e&&"latin"in e&&"isMode"in e&&"geocoding"in e&&(typeof e.code=="string"||e.code===null)&&typeof e.flag=="string"&&typeof e.name=="string"&&typeof e.latin=="boolean"&&typeof e.isMode=="boolean"&&typeof e.geocoding=="boolean"}function j(e,a=y){return K(e)?U(e.flag,a):typeof e!="string"?null:ae(e,a)||S(e,a)||U(e,a)||null}function Pe(e,a,t=y){const n=j(e,t),i=j(a,t);return n!==null&&i!==null&&n.flag===i.flag}async function u(e,a={}){if(p.fetch===null)throw new Error("The fetch function was not found. If on NodeJS < 18 please specify the fetch function with config.fetch");if(new URL(e).searchParams.get("key").trim()==="")throw new Error("The MapTiler Cloud API key is missing. Set it in `config.apiKey` or get one for free at https://maptiler.com");return p.fetch(e,a)}const m={maptilerApiURL:"https://api.maptiler.com/",mapStyle:"streets-v2"};Object.freeze(m);class f extends Error{constructor(a,t=""){super(`Call to enpoint ${a.url} failed with the status code ${a.status}. ${t}`),this.res=a}}const k={400:"Query too long / Invalid parameters",403:"Key is missing, invalid or restricted"};function w(e,a){const{adjustSearchParams:t,apiKey:n}=a;typeof t=="function"&&t(e),e.set("key",n??p.apiKey)}function P(e,a){const{language:t}=a;if(t===void 0)return;const n=(Array.isArray(t)?t:[t]).map(r=>be(r)).filter(r=>r),i=Array.from(new Set(n)).join(",");e.set("language",i)}function be(e){const a=e===y.AUTO.flag?_():typeof e=="string"?S(e):K(e)?e.flag===y.AUTO.flag?_():U(e.flag):null;return a?.geocoding?a.code:null}function H(e,a){const{limit:t,types:n,excludeTypes:i}=a;t!==void 0&&e.set("limit",String(t)),n!==void 0&&e.set("types",n.join(",")),i!==void 0&&e.set("excludeTypes",String(i))}function te(e,a){const{bbox:t,proximity:n,country:i,fuzzyMatch:r,autocomplete:o}=a;t!==void 0&&e.set("bbox",t.join(",")),n!==void 0&&e.set("proximity",n==="ip"?n:n.join(",")),i!==void 0&&e.set("country",i.join(",")),r!==void 0&&e.set("fuzzyMatch",r?"true":"false"),o!==void 0&&e.set("autocomplete",o?"true":"false")}async function Ne(e,a={}){if(typeof e!="string"||e.trim().length===0)throw new Error("The query must be a non-empty string");const t=new URL(`geocoding/${encodeURIComponent(e)}.json`,m.maptilerApiURL);w(t.searchParams,a),P(t.searchParams,a),H(t.searchParams,a),te(t.searchParams,a);const n=await u(t.toString());if(!n.ok)throw new f(n,k[n.status]??"");return await n.json()}async function $e(e,a={}){if(!Array.isArray(e)||e.length<2)throw new Error("The position must be an array of form [lng, lat].");const t=new URL(`geocoding/${e[0]},${e[1]}.json`,m.maptilerApiURL);w(t.searchParams,a),P(t.searchParams,a),H(t.searchParams,a);const n=await u(t.toString());if(!n.ok)throw new f(n,k[n.status]??"");return await n.json()}async function Ve(e,a={}){const t=new URL(`geocoding/${e}.json`,m.maptilerApiURL);w(t.searchParams,a),P(t.searchParams,a);const n=await u(t.toString());if(!n.ok)throw new f(n,k[n.status]??"");return await n.json()}async function Oe(e,a={}){if(!e.length)return[];const t=e.map(o=>encodeURIComponent(o)).join(";"),n=new URL(`geocoding/${t}.json`,m.maptilerApiURL);w(n.searchParams,a),P(n.searchParams,a),H(n.searchParams,a),te(n.searchParams,a);const i=await u(n.toString());if(!i.ok)throw new f(i,k[i.status]??"");const r=await i.json();return e.length===1?[r]:r}const Ce={forward:Ne,reverse:$e,byId:Ve,batch:Oe},ne={403:"Key is missing, invalid or restricted"};async function _e(e={}){const a=new URL("geolocation/ip.json",m.maptilerApiURL);a.searchParams.set("key",e.apiKey??p.apiKey),"elevation"in e&&a.searchParams.set("elevation",e.elevation?"true":"false");const t=a.toString(),n=await u(t);if(!n.ok)throw new f(n,n.status in ne?ne[n.status]:"");return await n.json()}const Ke={info:_e},b={403:"Key is missing, invalid or restricted"};async function je(e,a={}){if(typeof e!="string"||e.trim().length===0)throw new Error("The query must be a non-empty string");const t=new URL(`coordinates/search/${e}.json`,m.maptilerApiURL);t.searchParams.set("key",a.apiKey??p.apiKey),"limit"in a&&t.searchParams.set("limit",a.limit.toString()),"transformations"in a&&t.searchParams.set("transformations",a.transformations.toString()),"exports"in a&&t.searchParams.set("exports",a.exports.toString());const n=t.toString(),i=await u(n);if(!i.ok)throw new f(i,i.status in b?b[i.status]:"");return await i.json()}async function He(e,a={}){const t=(Array.isArray(e[0])?e:[e]).map(o=>`${o[0]},${o[1]}`).join(";"),n=new URL(`coordinates/transform/${t}.json`,m.maptilerApiURL);n.searchParams.set("key",a.apiKey??p.apiKey),"sourceCrs"in a&&n.searchParams.set("s_srs",a.sourceCrs.toString()),"targetCrs"in a&&n.searchParams.set("t_srs",a.targetCrs.toString()),"operations"in a&&n.searchParams.set("ops",(Array.isArray(a.operations)?a.operations:[a.operations]).join("|"));const i=n.toString(),r=await u(i);if(!r.ok)throw new f(r,r.status in b?b[r.status]:"");return await r.json()}const Fe={search:je,transform:He},ie={403:"Key is missing, invalid or restricted"};async function Be(e,a={}){if(typeof e!="string"||e.trim().length===0)throw new Error("The data ID must be a non-empty string");const t=new URL(`data/${encodeURIComponent(e)}/features.json`,m.maptilerApiURL);t.searchParams.set("key",a.apiKey??p.apiKey);const n=t.toString(),i=await u(n);if(!i.ok)throw new f(i,i.status in ie?ie[i.status]:"");return await i.json()}const xe={get:Be};function re(e){const a=/^maptiler:\/\/(.*)/;let t;const n=e.trim();let i;return n.startsWith("http://")||n.startsWith("https://")?i=n:(t=a.exec(n))!==null?i=`https://api.maptiler.com/maps/${t[1]}/style.json`:i=`https://api.maptiler.com/maps/${n}/style.json`,i}class F{constructor(a,t,n,i,r,o,s=!1,d){this.name=a,this.variantType=t,this.id=n,this.referenceStyle=i,this.description=r,this.imageURL=o,this.deprecated=s,this.deprecationMessage=d}getName(){return this.name}getFullName(){return`${this.referenceStyle.getName()} ${this.name}`}getType(){return this.variantType}getId(){return this.id}getDescription(){return this.description}getReferenceStyle(){return this.referenceStyle}hasVariant(a){return this.referenceStyle.hasVariant(a)}getVariant(a){const t=this.referenceStyle.getVariant(a);return this.warnIfDeprecated(t),t}getVariants(){return this.referenceStyle.getVariants().filter(a=>a!==this).map(a=>(this.warnIfDeprecated(a),a))}getImageURL(){return this.imageURL}getExpandedStyleURL(){return re(this.getId())}warnIfDeprecated(a=this){if(!a.deprecated)return a;if(a.deprecationMessage)console.warn(a.deprecationMessage);else{const t=a.getFullName();console.warn(`Style "${t}" is deprecated and will be removed in a future version.`)}return a}}class B{constructor(a,t){this.name=a,this.id=t,this.variants={},this.orderedVariants=[]}getName(){return this.name}getId(){return this.id}addVariant(a){this.variants[a.getType()]=a,this.orderedVariants.push(a)}hasVariant(a){return a in this.variants}getVariant(a){return a in this.variants?this.variants[a]:this.orderedVariants[0]}getVariants(){return Object.values(this.variants)}getDefaultVariant(){return this.orderedVariants[0].warnIfDeprecated()}}const Ge=[{referenceStyleID:"STREETS_V2",name:"Streets",description:"",variants:[{id:"streets-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2" is deprecated, use "streets-v4" instead'},{id:"streets-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2-dark" is deprecated, use "streets-v4-dark" instead'},{id:"streets-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2-light" is deprecated, use "streets-v4-light" instead'},{id:"streets-v2-night",name:"Night",variantType:"NIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2-night" is deprecated, use "streets-v4-night" instead'},{id:"streets-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2-pastel" is deprecated, use "streets-v4-pastel" instead'}]},{referenceStyleID:"STREETS_V4",name:"Streets",description:"",variants:[{id:"streets-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"streets-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"streets-v4-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"BASE_V4",name:"Base",description:"",variants:[{id:"base-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"base-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"base-v4-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"base-v4-ai",name:"AI",variantType:"AI",description:"",imageURL:""}]},{referenceStyleID:"OUTDOOR_V2",name:"Outdoor",description:"",variants:[{id:"outdoor-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"outdoor-v2" is deprecated, use "outdoor-v4" instead'},{id:"outdoor-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"outdoor-v2-dark" is deprecated, use "outdoor-v4-dark" instead'}]},{referenceStyleID:"WINTER_V2",name:"Winter",description:"",variants:[{id:"winter-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"winter-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"WINTER_V4",name:"Winter",description:"",variants:[{id:"winter-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"winter-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"SATELLITE_V2",name:"Satellite",description:"",variants:[{id:"satellite",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"satellite" is deprecated, use "satellite-v4" instead'}]},{referenceStyleID:"HYBRID_V2",name:"Hybrid",description:"",variants:[{id:"hybrid",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"HYBRID_V4",name:"Hybrid",description:"",variants:[{id:"hybrid-v4",name:"Default",variantType:"DEFAULT",imageURL:""},{id:"hybrid-v4-dark",name:"Dark",variantType:"DARK",imageURL:""}]},{referenceStyleID:"BASIC_V2",name:"Basic",description:"",variants:[{id:"basic-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"basic-v2" is deprecated, use "base-v4" instead'},{id:"basic-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecationMessage:'"basic-v2" is deprecated, use "base-v4" instead'},{id:"basic-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"basic-v2" is deprecated, use "base-v4" instead'}]},{referenceStyleID:"BRIGHT",name:"Bright",description:"",variants:[{id:"bright-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"bright-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"bright-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"bright-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"OPENSTREETMAP_V2",name:"OpenStreetMap",description:"",variants:[{id:"openstreetmap",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"openstreetmap-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"TOPO_V2",name:"Topo",description:"",variants:[{id:"topo-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"topo-v2" is deprecated, use "topo-v4" instead'},{id:"topo-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"topo-v2-dark" is deprecated, use "topo-v4-dark" instead'},{id:"topo-v2-shiny",name:"Shiny",variantType:"SHINY",description:"",imageURL:"",deprecated:!0},{id:"topo-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"topo-v2-pastel" is deprecated, use "topo-v4-pastel" instead'},{id:"topo-v2-topographique",name:"Topographique",variantType:"TOPOGRAPHIQUE",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"topo-v2-topographique" is deprecated, use "topo-v4-topographique" instead'}]},{referenceStyleID:"VOYAGER_V2",name:"Voyager",description:"",variants:[{id:"voyager-v2",name:"Default",deprecated:!0,variantType:"DEFAULT",description:"",imageURL:""},{id:"voyager-v2-darkmatter",name:"Darkmatter",deprecated:!0,variantType:"DARK",description:"",imageURL:""},{id:"voyager-v2-positron",name:"Positron",deprecated:!0,variantType:"LIGHT",description:"",imageURL:""},{id:"voyager-v2-vintage",name:"Vintage",deprecated:!0,variantType:"VINTAGE",description:"",imageURL:""}]},{referenceStyleID:"TONER_V2",name:"Toner",description:"",deprecated:!0,deprecationMessage:'"toner-v2" is deprecated, and will be no longer be a default style in the future',variants:[{id:"toner-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"toner-v2" is deprecated, and may be removed in future versions.'},{id:"toner-v2-background",name:"Background",variantType:"BACKGROUND",deprecated:!0,description:"",imageURL:"",deprecationMessage:'"toner-v2-background" is deprecated, and may be removed in future versions.'},{id:"toner-v2-lite",name:"Lite",variantType:"LITE",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"toner-v2-lite" is deprecated, and may be removed in future versions.'},{id:"toner-v2-lines",name:"Lines",variantType:"LINES",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"toner-v2-lines" is deprecated, and may be removed in future versions.'}]},{referenceStyleID:"DATAVIZ_V2",name:"Dataviz",description:"",variants:[{id:"dataviz",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"dataviz" is deprecated, use "dataviz-v4" instead'},{id:"dataviz-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"dataviz-dark" is deprecated, use "dataviz-v4-dark" instead'},{id:"dataviz-light",name:"Light",variantType:"LIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"dataviz-light" is deprecated, use "dataviz-v4-light" instead'}]},{referenceStyleID:"BACKDROP_V2",name:"Backdrop",description:"",variants:[{id:"backdrop",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"backdrop" is deprecated, use "backdrop-v4" instead'},{id:"backdrop-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"backdrop-dark" is deprecated, use "backdrop-v4-dark" instead'},{id:"backdrop-light",name:"Light",variantType:"LIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"backdrop-light" is deprecated, use "backdrop-v4-light" instead'}]},{referenceStyleID:"OCEAN_V2",name:"Ocean",description:"",variants:[{id:"ocean",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"ocean" is deprecated, use "ocean-v4" instead'}]},{referenceStyleID:"AQUARELLE_V2",name:"Aquarelle",description:"Watercolor map for creative use",variants:[{id:"aquarelle",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"aquarelle" is deprecated, use "aquarelle-v4" instead'},{id:"aquarelle-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"aquarelle-dark" is deprecated, use "aquarelle-v4-dark" instead'},{id:"aquarelle-vivid",name:"Vivid",variantType:"VIVID",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"aquarelle-vivid" is deprecated, use "aquarelle-v4-vivid" instead'}]},{referenceStyleID:"LANDSCAPE_V2",name:"Landscape",description:"Terrain map for data overlays and visualisations",variants:[{id:"landscape",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"landscape" is deprecated, use "landscape-v4" instead'},{id:"landscape-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"landscape-dark" is deprecated, use "landscape-v4-dark" instead'},{id:"landscape-vivid",name:"Vivid",variantType:"VIVID",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"landscape-vivid" is deprecated, use "landscape-v4-vivid" instead'}]},{referenceStyleID:"LANDSCAPE_V4",name:"Landscape",description:"Terrain map for data overlays and visualisations",variants:[{id:"landscape-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"landscape-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"landscape-v4-vivid",name:"Vivid",variantType:"VIVID",description:"",imageURL:""}]},{referenceStyleID:"SATELLITE_V4",name:"Satellite",description:"",variants:[{id:"satellite-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"satellite-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"DATAVIZ_V4",name:"Dataviz",description:"",variants:[{id:"dataviz-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"dataviz-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"dataviz-v4-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"OUTDOOR_V4",name:"Outdoor",description:"",variants:[{id:"outdoor-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"outdoor-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"BACKDROP_V4",name:"Backdrop",description:"",variants:[{id:"backdrop-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"backdrop-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"backdrop-v4-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"AQUARELLE_V4",name:"Aquarelle",description:"Watercolor map for creative use",variants:[{id:"aquarelle-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"aquarelle-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"aquarelle-v4-vivid",name:"Vivid",variantType:"VIVID",description:"",imageURL:""}]},{referenceStyleID:"OCEAN_V4",name:"Ocean",description:"",variants:[{id:"ocean-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"ocean-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"TOPO_V4",name:"Topo",description:"",variants:[{id:"topo-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"topo-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"topo-v4-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""},{id:"topo-v4-topographique",name:"Topographique",variantType:"TOPOGRAPHIQUE",description:"",imageURL:""}]}],oe={STREETS:"STREETS_V4",BASIC:"BASIC_V2",BASE:"BASE_V4",LANDSCAPE:"LANDSCAPE_V4",AQUARELLE:"AQUARELLE_V4",SATELLITE:"SATELLITE_V4",WINTER:"WINTER_V4",HYBRID:"HYBRID_V4",OCEAN:"OCEAN_V4",OUTDOOR:"OUTDOOR_V4",TONER:"TONER_V2",TOPO:"TOPO_V4",OPENSTREETMAP:"OPENSTREETMAP_V2",DATAVIZ:"DATAVIZ_V4",BACKDROP:"BACKDROP_V4",VOYAGER:"VOYAGER_V2"},T=[...Ge];function ze(e,a){T.find(i=>i.referenceStyleID===e)&&console.warn(`Default reference style ${e} already exists, it will be overwritten...`);const t=T.find(i=>i.referenceStyleID===a);if(!t)throw new Error(`Versioned map style not found for reference style: ${a}`);const n={...t,referenceStyleID:e};T.push(n)}Object.entries(oe).forEach(([e,a])=>{ze(e,a)});function We(e){return new Proxy(e,{get(a,t,n){return a.hasVariant(t)?a.getVariant(t):t.toString().toUpperCase()===t?e.getDefaultVariant():Reflect.get(a,t,n)}})}function qe(){const e={};for(let a=0;a<T.length;a+=1){const t=T[a],n=We(new B(t.name,t.referenceStyleID));for(let i=0;i<t.variants.length;i+=1){const r=t.variants[i],o=new F(r.name,r.variantType,r.id,n,r.description,r.imageURL,r.deprecated);n.addVariant(o)}e[t.referenceStyleID]=n}return e}function N(e){if(!e)return se[T[0].referenceStyleID].getDefaultVariant().getId();if(typeof e=="string"||e instanceof String)return e.trim().toLowerCase();if(e instanceof F)return e.getId();if(e instanceof B)return e.getDefaultVariant().getId()}const se=qe();function Je(e){const a=[];function t(r){(r.type==="LineString"||r.type==="MultiLineString")&&a.push(r)}function n(r){r.geometry&&t(r.geometry)}function i(r){for(const o of r.features)o.type==="Feature"?n(o):o.type==="FeatureCollection"&&i(o)}return e.type==="Feature"?n(e):e.type==="FeatureCollection"?i(e):t(e),a}function Ye(e,a,t){let n=a[0],i=a[1],r=t[0]-n,o=t[1]-i;if(r!==0||o!==0){const s=((e[0]-n)*r+(e[1]-i)*o)/(r*r+o*o);s>1?(n=t[0],i=t[1]):s>0&&(n+=r*s,i+=o*s)}return r=e[0]-n,o=e[1]-i,r*r+o*o}function x(e,a,t,n,i){let r=n,o;for(let s=a+1;s<t;s++){const d=Ye(e[s],e[a],e[t]);d>r&&(o=s,r=d)}r>n&&(o-a>1&&x(e,a,o,n,i),i.push(e[o]),t-o>1&&x(e,o,t,n,i))}function Qe(e,a){const t=e.length-1,n=[e[0]];return x(e,0,t,a,n),n.push(e[t]),n}function Ze(e,a){if(e.length<=2)return e;const t=a!==void 0?a*a:1;return Qe(e,t)}const de={extractLineStrings:Je,simplify:Ze};function G(e,a=!0){let t=`${e[0]},${e[1]}`;return e.length===3&&a&&(t+=`,${e[2]}`),t}function z(e,a=3e3){let t=e.map(r=>r.join(",")).join("|"),n=5e-6;const i=1e-5;for(;t.length>a;)t=de.simplify(e,n).map(r=>`${r[0]},${r[1]}`).join("|"),n+=i;return t}function Xe(e,a,t={}){const n=N(t.style),i=t.hiDPI?"@2x":"",r=t.format??"png";let o=~~(t.width??1024),s=~~(t.height??1024);t.hiDPI&&(o=~~(o/2),s=~~(s/2));const d=new URL(`maps/${encodeURIComponent(n)}/static/${e[0]},${e[1]},${a}/${o}x${s}${i}.${r}`,m.maptilerApiURL);if("attribution"in t&&d.searchParams.set("attribution",t.attribution.toString()),"markers"in t){let l="";const g="markerIcon"in t;g&&(l+=`icon:${t.markerIcon}|`),g&&"markerAnchor"in t&&(l+=`anchor:${t.markerAnchor}|`),g&&t.hiDPI&&(l+="scale:2|");const h=Array.isArray(t.markers[0])?t.markers:[t.markers];l+=h.map(A=>G(A,!g)).join("|"),d.searchParams.set("markers",l)}if("path"in t){let l="";if(l+=`fill:${t.pathFillColor??"none"}|`,"pathStrokeColor"in t&&(l+=`stroke:${t.pathStrokeColor}|`),"pathWidth"in t){const g=t.pathWidth/(t.hiDPI?2:1);l+=`width:${g.toString()}|`}l+=z(t.path),d.searchParams.set("path",l)}return d.searchParams.set("key",t.apiKey??p.apiKey),d.toString()}function ea(e,a={}){const t=N(a.style),n=a.hiDPI?"@2x":"",i=a.format??"png";let r=~~(a.width??1024),o=~~(a.height??1024);a.hiDPI&&(r=~~(r/2),o=~~(o/2));const s=new URL(`maps/${encodeURIComponent(t)}/static/${e[0]},${e[1]},${e[2]},${e[3]}/${r}x${o}${n}.${i}`,m.maptilerApiURL);if("attribution"in a&&s.searchParams.set("attribution",a.attribution.toString()),"padding"in a&&s.searchParams.set("padding",a.padding.toString()),"markers"in a){let d="";const l="markerIcon"in a;l&&(d+=`icon:${a.markerIcon}|`),l&&"markerAnchor"in a&&(d+=`anchor:${a.markerAnchor}|`),l&&a.hiDPI&&(d+="scale:2|");const g=Array.isArray(a.markers[0])?a.markers:[a.markers];d+=g.map(h=>G(h,!l)).join("|"),s.searchParams.set("markers",d)}if("path"in a){let d="";if(d+=`fill:${a.pathFillColor??"none"}|`,"pathStrokeColor"in a&&(d+=`stroke:${a.pathStrokeColor}|`),"pathWidth"in a){const l=a.pathWidth/(a.hiDPI?2:1);d+=`width:${l.toString()}|`}d+=z(a.path),s.searchParams.set("path",d)}return s.searchParams.set("key",a.apiKey??p.apiKey),s.toString()}function aa(e={}){if(!("markers"in e)&&!("path"in e))throw new Error("Automatic static maps require markers and/or path to be created.");const a=N(e.style),t=e.hiDPI?"@2x":"",n=e.format??"png";let i=~~(e.width??1024),r=~~(e.height??1024);e.hiDPI&&(i=~~(i/2),r=~~(r/2));const o=new URL(`maps/${encodeURIComponent(a)}/static/auto/${i}x${r}${t}.${n}`,m.maptilerApiURL);if("attribution"in e&&o.searchParams.set("attribution",e.attribution.toString()),"padding"in e&&o.searchParams.set("padding",e.padding.toString()),"markers"in e){let s="";const d="markerIcon"in e;d&&(s+=`icon:${e.markerIcon}|`),d&&"markerAnchor"in e&&(s+=`anchor:${e.markerAnchor}|`),d&&e.hiDPI&&(s+="scale:2|");const l=Array.isArray(e.markers[0])?e.markers:[e.markers];s+=l.map(g=>G(g,!d)).join("|"),o.searchParams.set("markers",s)}if("path"in e){let s="";if(s+=`fill:${e.pathFillColor??"none"}|`,"pathStrokeColor"in e&&(s+=`stroke:${e.pathStrokeColor}|`),"pathWidth"in e){const d=e.pathWidth/(e.hiDPI?2:1);s+=`width:${d.toString()}|`}s+=z(e.path),o.searchParams.set("path",s)}return o.searchParams.set("key",e.apiKey??p.apiKey),o.toString()}const ta={centered:Xe,bounded:ea,automatic:aa},$=63710088e-1,ce=2*Math.PI*$,le=85.0511287;function ge(e){return(180+e)/360}function pe(e){return e=Math.max(Math.min(e,le),-le),(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function me(e){const a=he(e);return[ge(a[0]),pe(a[1])]}function ue(e){return e*360-180}function fe(e){const a=180-e*360;return 360/Math.PI*Math.atan(Math.exp(a*Math.PI/180))-90}function na(e){return[ue(e[0]),fe(e[1])]}function W(e,a){const t=Math.PI/180,n=e[1]*t,i=a[1]*t,r=Math.sin(n)*Math.sin(i)+Math.cos(n)*Math.cos(i)*Math.cos((a[0]-e[0])*t);return $*Math.acos(Math.min(r,1))}function ia(e){const a=Array(e.length);a[0]=0;const t=a.length;for(let n=1;n<t;n++)a[n]=W(e[n-1],e[n])+a[n-1];return a}function he(e){const a=e[0],t=e[1],n=360,i=((a+180)%n+n)%n-180;return[i===-180?180:i,t]}function ve(e){return ce*Math.cos(e*Math.PI/180)}function ye(e,a,t=!0){const n=2**a,i=[e[0]*n,e[1]*n];return t?[~~i[0],~~i[1]]:i}function ra(e,a,t=!0){const n=me(e);return ye(n,a,t)}function D(e){return e*Math.PI/180}function q(e){return e*180/Math.PI}function oa(e,a,t){const n=W(e,a),i=D(e[0]),r=D(e[1]),o=D(a[0]),s=D(a[1]),d=n/$,l=Math.sin((1-t)*d)/Math.sin(d),g=Math.sin(t*d)/Math.sin(d),h=l*Math.cos(r)*Math.cos(i)+g*Math.cos(s)*Math.cos(o),A=l*Math.cos(r)*Math.sin(i)+g*Math.cos(s)*Math.sin(o),R=l*Math.sin(r)+g*Math.sin(s),M=Math.atan2(R,Math.sqrt(h*h+A*A)),c=Math.atan2(A,h);return[q(c),q(M)]}const Ae={EARTH_RADIUS:$,EARTH_CIRCUMFERENCE:ce,longitudeToMercatorX:ge,latitudeToMercatorY:pe,wgs84ToMercator:me,mercatorXToLongitude:ue,mercatorYToLatitude:fe,mercatorToWgs84:na,haversineDistanceWgs84:W,wrapWgs84:he,circumferenceAtLatitude:ve,mercatorToTileIndex:ye,wgs84ToTileIndex:ra,toRadians:D,toDegrees:q,haversineIntermediateWgs84:oa,haversineCumulatedDistanceWgs84:ia};let J=null;function Le(){return J||(J=new ke({maxSize:p.tileCacheSize})),J}async function Te(e){const a=new Blob([e]),t=await createImageBitmap(a),n=document.createElement("canvas"),i=n.getContext("2d");n.width=t.width,n.height=t.height,i.drawImage(t,0,0);const r=i.getImageData(0,0,n.width,n.height);return{pixels:r.data,width:n.width,height:n.height,components:r.data.length/(n.width*n.height)}}function Ie(){if(p.bufferToPixelData)return p.bufferToPixelData;if(typeof window<"u")return Te;throw new Error("An image file buffer to pixel data parser is necessary. Specify it in `config.bufferToPixelData`")}function Y(){return!!p.bufferToPixelData||typeof window<"u"}const sa="terrain-rgb-v2",Q=50,da=1e3;let V=null;const Re={403:"Key is missing, invalid or restricted"};async function ca(e,a){e.length>da&&console.warn("Computing elevation for complex geometries is discouraged - simplify the geometry before proceeding");const t=Math.ceil(e.length/Q),n=Array.from({length:t},()=>null).map((r,o)=>{const s=o*Q,d=e.slice(s,s+Q).map(g=>g.join(",")).join(";"),l=new URL(`elevation/${d}.json`,m.maptilerApiURL);return l.searchParams.set("key",a),u(l.toString())}),i=await Promise.allSettled(n);return(await Promise.all(i.map(async r=>{if(r.status==="rejected")throw new Error(`Some segments could not be fetched, error: ${r.reason}`);if(!r.value.ok)throw new Error(`Some segments could not be fetched, response: ${r.value.status} ${await r.value.text()}, url: ${r.value.url}`);return r.value.json()}))).flat()}async function la(e,a,t){if(!V){const c=new URL(`tiles/${sa}/tiles.json`,m.maptilerApiURL);c.searchParams.set("key",a);const I=c.toString(),v=await u(I);if(v.ok)V=await v.json();else throw new f(v,Re[v.status]??"")}const n=Ie(),i=V.tiles[0],r=Le(),o=V.maxzoom;let s=~~(t??o);(s>o||s<0)&&(s=o);const d=e.map(c=>Ae.wgs84ToTileIndex(c,s,!1)),l=d.map(c=>[~~c[0],~~c[1]]).map(c=>`terrain_${s.toString()}_${c[0].toString()}_${c[1].toString()}`),g=Array.from(new Set(l.filter(c=>!r.has(c)))).map(c=>c.split("_").slice(1)),h=g.map(c=>i.replace("{x}",c[1].toString()).replace("{y}",c[2].toString()).replace("{z}",c[0].toString())).map(c=>u(c)),A=(await Promise.allSettled(h)).map(c=>c.status==="fulfilled"?c.value:null).filter(c=>c),R=A.filter(c=>!c.ok);if(A.length!==h.length)throw new Error("Some tiles could not be fetched.");if(R.length)throw new f(R[0],Re[R[0].status]??"");const M=await Promise.all(A.map(c=>c.arrayBuffer()));if(!M.every(c=>c.byteLength>0))throw new Error("Some tiles are not available.");return(await Promise.all(M.map(c=>n(c)))).forEach((c,I)=>{const v=g[I],E=`terrain_${v[0].toString()}_${v[1].toString()}_${v[2].toString()}`;r.set(E,c)}),e.map((c,I)=>{const v=l[I],E=d[I],L=r.get(v),Se=Math.min(Math.round(L.width*(E[0]%1)),L.width-1),C=(Math.min(Math.round(L.height*(E[1]%1)),L.height-1)*L.width+Se)*L.components,De=L.pixels[C],Me=L.pixels[C+1],Ee=L.pixels[C+2],Ue=-1e4+(De*256*256+Me*256+Ee)*.1;return[c[0],c[1],~~(Ue*1e3)/1e3]})}async function ga(e,a={}){return(await O([e],a))[0]}async function O(e,a={}){if(e.length===0)return[];const t=a.apiKey??p.apiKey,n=a.computeOn==="client"?await la(e,t,a.zoom):await ca(e,t);if(a.smoothingKernelSize){const i=~~(a.smoothingKernelSize/2)*2+1,r=n.map(s=>s[2]),o=~~(i/2);for(let s=o;s<r.length-o;s+=1){let d=0;for(let l=0;l<i;l+=1){const g=r[s-o+l];d+=g}d/=i,n[s][2]=d}}return n}async function pa(e,a={}){if(e.type!=="LineString")throw new Error("The provided object is not a GeoJSON LineString");a.computeOn??(a.computeOn=Y()?"client":"server");const t=structuredClone(e),n=await O(t.coordinates,a);return t.coordinates=n,t}async function ma(e,a={}){if(e.type!=="MultiLineString")throw new Error("The provided object is not a GeoJSON MultiLineString");a.computeOn??(a.computeOn=Y()?"client":"server");const t=structuredClone(e),n=t.coordinates.map(d=>d.length),i=t.coordinates.flat(),r=await O(i,a),o=[];let s=0;for(const d of n)o.push(r.slice(s,s+d)),s+=d;return t.coordinates=o,t}const ua={at:ga,batch:O,fromLineString:pa,fromMultiLineString:ma};export{Z as ClientConfig,ee as ISOLanguage,y as Language,se as MapStyle,F as MapStyleVariant,X as NonISOLanguage,B as ReferenceMapStyle,f as ServiceError,Pe as areSameLanguages,Te as bufferToPixelDataBrowser,Y as canParsePixelData,ve as circumferenceAtLatitude,p as config,Fe as coordinates,xe as data,oe as defaultReferenceStyleMap,ua as elevation,re as expandMapStyle,Ce as geocoding,Ke as geolocation,_ as getAutoLanguage,Ie as getBufferToPixelDataParser,S as getLanguageInfoFromCode,U as getLanguageInfoFromFlag,ae as getLanguageInfoFromKey,Le as getTileCache,K as isLanguageInfo,T as mapStylePresetList,Ae as math,de as misc,ta as staticMaps,N as styleToStyle,j as toLanguageInfo};
1
+ import{decode as we}from"@googlemaps/polyline-codec";import Pe from"quick-lru";function be(){return typeof self<"u"?fetch.bind(self):typeof global<"u"&&global.fetch?global.fetch:null}class Z{constructor(){this._apiKey="",this._fetch=be(),this.tileCacheSize=200}set apiKey(a){this._apiKey=a}get apiKey(){return this._apiKey}set fetch(a){this._fetch=a}get fetch(){return this._fetch}}const p=new Z,X={AUTO:{code:null,flag:"auto",name:"Auto",latin:!1,isMode:!0,geocoding:!0},LATIN:{code:"latin",flag:"name:latin",name:"Latin",latin:!0,isMode:!1,geocoding:!1},NON_LATIN:{code:"nonlatin",flag:"name:nonlatin",name:"Non Latin",latin:!1,isMode:!1,geocoding:!1},LOCAL:{code:null,flag:"name",name:"Local",latin:!0,isMode:!1,geocoding:!1}},ee={ALBANIAN:{code:"sq",flag:"name:sq",name:"Albanian",latin:!0,isMode:!1,geocoding:!0},AMHARIC:{code:"am",flag:"name:am",name:"Amharic",latin:!1,isMode:!1,geocoding:!0},ARABIC:{code:"ar",flag:"name:ar",name:"Arabic",latin:!1,isMode:!1,geocoding:!0},ARMENIAN:{code:"hy",flag:"name:hy",name:"Armenian",latin:!1,isMode:!1,geocoding:!0},AZERBAIJANI:{code:"az",flag:"name:az",name:"Azerbaijani",latin:!0,isMode:!1,geocoding:!0},BASQUE:{code:"eu",flag:"name:eu",name:"Basque",latin:!0,isMode:!1,geocoding:!0},BELARUSIAN:{code:"be",flag:"name:be",name:"Belarusian",latin:!1,isMode:!1,geocoding:!0},BENGALI:{code:"bn",flag:"name:bn",name:"Bengali",latin:!0,isMode:!1,geocoding:!0},BOSNIAN:{code:"bs",flag:"name:bs",name:"Bosnian",latin:!0,isMode:!1,geocoding:!0},BRETON:{code:"br",flag:"name:br",name:"Breton",latin:!0,isMode:!1,geocoding:!0},BULGARIAN:{code:"bg",flag:"bg",name:"Bulgarian",latin:!1,isMode:!1,geocoding:!0},CATALAN:{code:"ca",flag:"name:ca",name:"Catalan",latin:!0,isMode:!1,geocoding:!0},CHINESE:{code:"zh",flag:"name:zh",name:"Chinese",latin:!1,isMode:!1,geocoding:!0},TRADITIONAL_CHINESE:{code:"zh-Hant",flag:"name:zh-Hant",name:"Chinese (traditional)",latin:!1,isMode:!1,geocoding:!1},SIMPLIFIED_CHINESE:{code:"zh-Hans",flag:"name:zh-Hans",name:"Chinese (simplified)",latin:!1,isMode:!1,geocoding:!1},CORSICAN:{code:"co",flag:"name:co",name:"Corsican",latin:!0,isMode:!1,geocoding:!0},CROATIAN:{code:"hr",flag:"name:hr",name:"Croatian",latin:!0,isMode:!1,geocoding:!0},CZECH:{code:"cs",flag:"name:cs",name:"Czech",latin:!0,isMode:!1,geocoding:!0},DANISH:{code:"da",flag:"name:da",name:"Danish",latin:!0,isMode:!1,geocoding:!0},DUTCH:{code:"nl",flag:"name:nl",name:"Dutch",latin:!0,isMode:!1,geocoding:!0},GERMAN:{code:"de",flag:"name:de",name:"German",latin:!0,isMode:!1,geocoding:!0},GREEK:{code:"el",flag:"name:el",name:"Greek",latin:!1,isMode:!1,geocoding:!0},ENGLISH:{code:"en",flag:"name:en",name:"English",latin:!0,isMode:!1,geocoding:!0},ESPERANTO:{code:"eo",flag:"name:eo",name:"Esperanto",latin:!0,isMode:!1,geocoding:!0},ESTONIAN:{code:"et",flag:"name:et",name:"Estonian",latin:!0,isMode:!1,geocoding:!0},FINNISH:{code:"fi",flag:"name:fi",name:"Finnish",latin:!0,isMode:!1,geocoding:!0},FRENCH:{code:"fr",flag:"name:fr",name:"French",latin:!0,isMode:!1,geocoding:!0},FRISIAN:{code:"fy",flag:"name:fy",name:"Frisian (West)",latin:!0,isMode:!1,geocoding:!0},GEORGIAN:{code:"ka",flag:"name:ka",name:"Georgian",latin:!1,isMode:!1,geocoding:!0},HEBREW:{code:"he",flag:"name:he",name:"Hebrew",latin:!1,isMode:!1,geocoding:!0},HINDI:{code:"hi",flag:"name:hi",name:"Hindi",latin:!1,isMode:!1,geocoding:!0},HUNGARIAN:{code:"hu",flag:"name:hu",name:"Hungarian",latin:!0,isMode:!1,geocoding:!0},ICELANDIC:{code:"is",flag:"name:is",name:"Icelandic",latin:!0,isMode:!1,geocoding:!0},INDONESIAN:{code:"id",flag:"name:id",name:"Indonesian",latin:!0,isMode:!1,geocoding:!0},IRISH:{code:"ga",flag:"name:ga",name:"Irish",latin:!0,isMode:!1,geocoding:!0},ITALIAN:{code:"it",flag:"name:it",name:"Italian",latin:!0,isMode:!1,geocoding:!0},JAPANESE:{code:"ja",flag:"name:ja",name:"Japanese",latin:!1,isMode:!1,geocoding:!0},JAPANESE_HIRAGANA:{code:"ja-Hira",flag:"name:ja-Hira",name:"Japanese Hiragana form",latin:!1,isMode:!1,geocoding:!1},JAPANESE_2018:{code:"ja-Latn",flag:"name:ja-Latn",name:"Japanese (Latin 2018)",latin:!0,isMode:!1,geocoding:!1},JAPANESE_KANA:{code:"ja_kana",flag:"name:ja_kana",name:"Japanese (Kana)",latin:!1,isMode:!1,geocoding:!1},JAPANESE_LATIN:{code:"ja_rm",flag:"name:ja_rm",name:"Japanese (Latin script)",latin:!0,isMode:!1,geocoding:!1},KANNADA:{code:"kn",flag:"name:kn",name:"Kannada",latin:!0,isMode:!1,geocoding:!0},KAZAKH:{code:"kk",flag:"name:kk",name:"Kazakh",latin:!1,isMode:!1,geocoding:!0},KOREAN:{code:"ko",flag:"name:ko",name:"Korean",latin:!1,isMode:!1,geocoding:!0},KOREAN_LATIN:{code:"ko-Latn",flag:"name:ko-Latn",name:"Korean (Latin script)",latin:!0,isMode:!1,geocoding:!1},KURDISH:{code:"ku",flag:"name:ku",name:"Kurdish",latin:!0,isMode:!1,geocoding:!0},CLASSICAL_LATIN:{code:"la",flag:"name:la",name:"Latin",latin:!0,isMode:!1,geocoding:!0},LATVIAN:{code:"lv",flag:"name:lv",name:"Latvian",latin:!0,isMode:!1,geocoding:!0},LITHUANIAN:{code:"lt",flag:"name:lt",name:"Lithuanian",latin:!0,isMode:!1,geocoding:!0},LUXEMBOURGISH:{code:"lb",flag:"name:lb",name:"Luxembourgish",latin:!0,isMode:!1,geocoding:!0},MACEDONIAN:{code:"mk",flag:"name:mk",name:"Macedonian",latin:!1,isMode:!1,geocoding:!0},MALAYALAM:{code:"ml",flag:"name:ml",name:"Malayalam",latin:!1,isMode:!1,geocoding:!0},MALTESE:{code:"mt",flag:"name:mt",name:"Maltese",latin:!0,isMode:!1,geocoding:!0},NORWEGIAN:{code:"no",flag:"name:no",name:"Norwegian",latin:!0,isMode:!1,geocoding:!0},OCCITAN:{code:"oc",flag:"name:oc",name:"Occitan",latin:!0,isMode:!1,geocoding:!0},PERSIAN:{code:"fa",flag:"name:fa",name:"Persian",latin:!1,isMode:!1,geocoding:!0},POLISH:{code:"pl",flag:"name:pl",name:"Polish",latin:!0,isMode:!1,geocoding:!0},PORTUGUESE:{code:"pt",flag:"name:pt",name:"Portuguese",latin:!0,isMode:!1,geocoding:!0},PUNJABI:{code:"pa",flag:"name:pa",name:"Punjabi",latin:!1,isMode:!1,geocoding:!0},WESTERN_PUNJABI:{code:"pnb",flag:"name:pnb",name:"Western Punjabi",latin:!1,isMode:!1,geocoding:!1},ROMANIAN:{code:"ro",flag:"name:ro",name:"Romanian",latin:!0,isMode:!1,geocoding:!0},ROMANSH:{code:"rm",flag:"name:rm",name:"Romansh",latin:!0,isMode:!1,geocoding:!0},RUSSIAN:{code:"ru",flag:"name:ru",name:"Russian",latin:!1,isMode:!1,geocoding:!0},SERBIAN_CYRILLIC:{code:"sr",flag:"name:sr",name:"Serbian (Cyrillic script)",latin:!1,isMode:!1,geocoding:!0},SERBIAN_LATIN:{code:"sr-Latn",flag:"name:sr-Latn",name:"Serbian (Latin script)",latin:!0,isMode:!1,geocoding:!1},SCOTTISH_GAELIC:{code:"gd",flag:"name:gd",name:"Scottish Gaelic",latin:!0,isMode:!1,geocoding:!0},SLOVAK:{code:"sk",flag:"name:sk",name:"Slovak",latin:!0,isMode:!1,geocoding:!0},SLOVENE:{code:"sl",flag:"name:sl",name:"Slovene",latin:!0,isMode:!1,geocoding:!0},SPANISH:{code:"es",flag:"name:es",name:"Spanish",latin:!0,isMode:!1,geocoding:!0},SWEDISH:{code:"sv",flag:"name:sv",name:"Swedish",latin:!0,isMode:!1,geocoding:!0},TAMIL:{code:"ta",flag:"name:ta",name:"Tamil",latin:!1,isMode:!1,geocoding:!0},TELUGU:{code:"te",flag:"name:te",name:"Telugu",latin:!1,isMode:!1,geocoding:!0},THAI:{code:"th",flag:"name:th",name:"Thai",latin:!1,isMode:!1,geocoding:!0},TURKISH:{code:"tr",flag:"name:tr",name:"Turkish",latin:!0,isMode:!1,geocoding:!0},UKRAINIAN:{code:"uk",flag:"name:uk",name:"Ukrainian",latin:!1,isMode:!1,geocoding:!0},VIETNAMESE:{code:"vi",flag:"name:vi",name:"Vietnamese (Latin script)",latin:!0,isMode:!1,geocoding:!0},WELSH:{code:"cy",flag:"name:cy",name:"Welsh",latin:!0,isMode:!1,geocoding:!0}},y={...X,...ee};function ae(e,a=y){return e in a?a[e]:null}function I(e,a=y){for(const t of Object.values(a))if(t.code===e)return t;return null}function E(e,a=y){for(const t of Object.values(a))if(t.flag===e)return t;return null}function K(){if(typeof navigator>"u"){const e=Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0];return I(e)??y.ENGLISH}return Array.from(new Set(navigator.languages.map(e=>e.split("-")[0]))).map(e=>I(e)).filter(e=>e)[0]??y.ENGLISH}function _(e){return e!==null&&typeof e=="object"&&"code"in e&&"flag"in e&&"name"in e&&"latin"in e&&"isMode"in e&&"geocoding"in e&&(typeof e.code=="string"||e.code===null)&&typeof e.flag=="string"&&typeof e.name=="string"&&typeof e.latin=="boolean"&&typeof e.isMode=="boolean"&&typeof e.geocoding=="boolean"}function j(e,a=y){return _(e)?E(e.flag,a):typeof e!="string"?null:ae(e,a)||I(e,a)||E(e,a)||null}function Ne(e,a,t=y){const n=j(e,t),i=j(a,t);return n!==null&&i!==null&&n.flag===i.flag}async function u(e,a={}){if(p.fetch===null)throw new Error("The fetch function was not found. If on NodeJS < 18 please specify the fetch function with config.fetch");if(new URL(e).searchParams.get("key").trim()==="")throw new Error("The MapTiler Cloud API key is missing. Set it in `config.apiKey` or get one for free at https://maptiler.com");return p.fetch(e,a)}const m={maptilerApiURL:"https://api.maptiler.com/",mapStyle:"streets-v2"};Object.freeze(m);class f extends Error{constructor(a,t=""){super(`Call to enpoint ${a.url} failed with the status code ${a.status}. ${t}`),this.res=a}}const k={400:"Query too long / Invalid parameters",403:"Key is missing, invalid or restricted"};function w(e,a){const{adjustSearchParams:t,apiKey:n}=a;typeof t=="function"&&t(e),e.set("key",n??p.apiKey)}function P(e,a){const{language:t}=a;if(t===void 0)return;const n=(Array.isArray(t)?t:[t]).map(r=>$e(r)).filter(r=>r),i=Array.from(new Set(n)).join(",");e.set("language",i)}function $e(e){const a=e===y.AUTO.flag?K():typeof e=="string"?I(e):_(e)?e.flag===y.AUTO.flag?K():E(e.flag):null;return a?.geocoding?a.code:null}function H(e,a){const{limit:t,types:n,excludeTypes:i}=a;t!==void 0&&e.set("limit",String(t)),n!==void 0&&e.set("types",n.join(",")),i!==void 0&&e.set("excludeTypes",String(i))}function te(e,a){const{bbox:t,proximity:n,country:i,fuzzyMatch:r,autocomplete:o}=a;t!==void 0&&e.set("bbox",t.join(",")),n!==void 0&&e.set("proximity",n==="ip"?n:n.join(",")),i!==void 0&&e.set("country",i.join(",")),r!==void 0&&e.set("fuzzyMatch",r?"true":"false"),o!==void 0&&e.set("autocomplete",o?"true":"false")}async function Oe(e,a={}){if(typeof e!="string"||e.trim().length===0)throw new Error("The query must be a non-empty string");const t=new URL(`geocoding/${encodeURIComponent(e)}.json`,m.maptilerApiURL);w(t.searchParams,a),P(t.searchParams,a),H(t.searchParams,a),te(t.searchParams,a);const n=await u(t.toString());if(!n.ok)throw new f(n,k[n.status]??"");return await n.json()}async function Ve(e,a={}){if(!Array.isArray(e)||e.length<2)throw new Error("The position must be an array of form [lng, lat].");const t=new URL(`geocoding/${e[0]},${e[1]}.json`,m.maptilerApiURL);w(t.searchParams,a),P(t.searchParams,a),H(t.searchParams,a);const n=await u(t.toString());if(!n.ok)throw new f(n,k[n.status]??"");return await n.json()}async function Ce(e,a={}){const t=new URL(`geocoding/${e}.json`,m.maptilerApiURL);w(t.searchParams,a),P(t.searchParams,a);const n=await u(t.toString());if(!n.ok)throw new f(n,k[n.status]??"");return await n.json()}async function Ke(e,a={}){if(!e.length)return[];const t=e.map(o=>encodeURIComponent(o)).join(";"),n=new URL(`geocoding/${t}.json`,m.maptilerApiURL);w(n.searchParams,a),P(n.searchParams,a),H(n.searchParams,a),te(n.searchParams,a);const i=await u(n.toString());if(!i.ok)throw new f(i,k[i.status]??"");const r=await i.json();return e.length===1?[r]:r}const _e={forward:Oe,reverse:Ve,byId:Ce,batch:Ke},ne={403:"Key is missing, invalid or restricted"};async function je(e={}){const a=new URL("geolocation/ip.json",m.maptilerApiURL);a.searchParams.set("key",e.apiKey??p.apiKey),"elevation"in e&&a.searchParams.set("elevation",e.elevation?"true":"false");const t=a.toString(),n=await u(t);if(!n.ok)throw new f(n,n.status in ne?ne[n.status]:"");return await n.json()}const He={info:je};function Fe(e,a){for(const t of a)e.append("location",`${t.lon},${t.lat}`)}function xe(e,a){a&&(a.units&&e.set("response.units",a.units),a.language&&e.set("response.language",a.language),a.alternates!==void 0&&e.set("alternates",String(a.alternates)),a.additionalData?.detailLevel&&e.set("response.additionalData.detailLevel",a.additionalData.detailLevel))}function Be(e,a,t){if(t){if(a==="car"){const n=t;n.mode&&e.set("car.mode",n.mode),n.topSpeed&&e.set("topSpeed",String(n.topSpeed)),n.avoidances?.tolls!==void 0&&e.set("avoidances.tolls",String(n.avoidances.tolls)),n.avoidances?.ferry!==void 0&&e.set("avoidances.ferry",String(n.avoidances.ferry)),n.avoidances?.highway!==void 0&&e.set("avoidances.highway",String(n.avoidances.highway))}if(a==="truck"){const n=t;n.height&&e.set("truck.height",String(n.height)),n.weight&&e.set("truck.weight",String(n.weight)),n.axleLoad&&e.set("truck.axleLoad",String(n.axleLoad)),n.hazmat!==void 0&&e.set("truck.hazmat",String(n.hazmat)),n.topSpeed&&e.set("topSpeed",String(n.topSpeed)),n.avoidances?.tolls!==void 0&&e.set("avoidances.tolls",String(n.avoidances.tolls))}if(a==="bicycle"){const n=t;n.type&&e.set("bicycle.type",n.type),n.cyclingSpeed&&e.set("bicycle.cyclingSpeed",String(n.cyclingSpeed))}if(a==="pedestrian"){const n=t;n.walkingSpeed&&e.set("pedestrian.walkingSpeed",String(n.walkingSpeed))}}}async function ie(e){if(!e.ok)throw new f(e);const a=await e.json();for(const t of a.route.legs)typeof t.geometry=="string"&&(t.geometry=we(t.geometry,6).map(([n,i])=>[i,n]));return a}async function ze(e){const a=new URL("routing/v1/directions",m.maptilerApiURL);a.searchParams.set("key",p.apiKey);const t=await u(a.toString(),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});return await ie(t)}async function Ge(e){const a=new URL("routing/v1/directions",m.maptilerApiURL),t=a.searchParams;t.set("key",p.apiKey),t.set("profile",e.profile),e.id&&t.set("id",e.id),e.departureTime&&t.set("departureTime",e.departureTime),e.arrivalTime&&t.set("arrivalTime",e.arrivalTime),Fe(t,e.locations),xe(t,e.response),Be(t,e.profile,e.profileOptions);const n=await u(a.toString());return await ie(n)}const We={directionsPost:ze,directionsGet:Ge},b={403:"Key is missing, invalid or restricted"};async function qe(e,a={}){if(typeof e!="string"||e.trim().length===0)throw new Error("The query must be a non-empty string");const t=new URL(`coordinates/search/${e}.json`,m.maptilerApiURL);t.searchParams.set("key",a.apiKey??p.apiKey),"limit"in a&&t.searchParams.set("limit",a.limit.toString()),"transformations"in a&&t.searchParams.set("transformations",a.transformations.toString()),"exports"in a&&t.searchParams.set("exports",a.exports.toString());const n=t.toString(),i=await u(n);if(!i.ok)throw new f(i,i.status in b?b[i.status]:"");return await i.json()}async function Je(e,a={}){const t=(Array.isArray(e[0])?e:[e]).map(o=>`${o[0]},${o[1]}`).join(";"),n=new URL(`coordinates/transform/${t}.json`,m.maptilerApiURL);n.searchParams.set("key",a.apiKey??p.apiKey),"sourceCrs"in a&&n.searchParams.set("s_srs",a.sourceCrs.toString()),"targetCrs"in a&&n.searchParams.set("t_srs",a.targetCrs.toString()),"operations"in a&&n.searchParams.set("ops",(Array.isArray(a.operations)?a.operations:[a.operations]).join("|"));const i=n.toString(),r=await u(i);if(!r.ok)throw new f(r,r.status in b?b[r.status]:"");return await r.json()}const Ye={search:qe,transform:Je},re={403:"Key is missing, invalid or restricted"};async function Qe(e,a={}){if(typeof e!="string"||e.trim().length===0)throw new Error("The data ID must be a non-empty string");const t=new URL(`data/${encodeURIComponent(e)}/features.json`,m.maptilerApiURL);t.searchParams.set("key",a.apiKey??p.apiKey);const n=t.toString(),i=await u(n);if(!i.ok)throw new f(i,i.status in re?re[i.status]:"");return await i.json()}const Ze={get:Qe};function oe(e){const a=/^maptiler:\/\/(.*)/;let t;const n=e.trim();let i;return n.startsWith("http://")||n.startsWith("https://")?i=n:(t=a.exec(n))!==null?i=`https://api.maptiler.com/maps/${t[1]}/style.json`:i=`https://api.maptiler.com/maps/${n}/style.json`,i}class F{constructor(a,t,n,i,r,o,s=!1,d){this.name=a,this.variantType=t,this.id=n,this.referenceStyle=i,this.description=r,this.imageURL=o,this.deprecated=s,this.deprecationMessage=d}getName(){return this.name}getFullName(){return`${this.referenceStyle.getName()} ${this.name}`}getType(){return this.variantType}getId(){return this.id}getDescription(){return this.description}getReferenceStyle(){return this.referenceStyle}hasVariant(a){return this.referenceStyle.hasVariant(a)}getVariant(a){const t=this.referenceStyle.getVariant(a);return this.warnIfDeprecated(t),t}getVariants(){return this.referenceStyle.getVariants().filter(a=>a!==this).map(a=>(this.warnIfDeprecated(a),a))}getImageURL(){return this.imageURL}getExpandedStyleURL(){return oe(this.getId())}warnIfDeprecated(a=this){if(!a.deprecated)return a;if(a.deprecationMessage)console.warn(a.deprecationMessage);else{const t=a.getFullName();console.warn(`Style "${t}" is deprecated and will be removed in a future version.`)}return a}}class x{constructor(a,t){this.name=a,this.id=t,this.variants={},this.orderedVariants=[]}getName(){return this.name}getId(){return this.id}addVariant(a){this.variants[a.getType()]=a,this.orderedVariants.push(a)}hasVariant(a){return a in this.variants}getVariant(a){return a in this.variants?this.variants[a]:this.orderedVariants[0]}getVariants(){return Object.values(this.variants)}getDefaultVariant(){return this.orderedVariants[0].warnIfDeprecated()}}const Xe=[{referenceStyleID:"STREETS_V2",name:"Streets",description:"",variants:[{id:"streets-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2" is deprecated, use "streets-v4" instead'},{id:"streets-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2-dark" is deprecated, use "streets-v4-dark" instead'},{id:"streets-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2-light" is deprecated, use "streets-v4-light" instead'},{id:"streets-v2-night",name:"Night",variantType:"NIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2-night" is deprecated, use "streets-v4-night" instead'},{id:"streets-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"streets-v2-pastel" is deprecated, use "streets-v4-pastel" instead'}]},{referenceStyleID:"STREETS_V4",name:"Streets",description:"",variants:[{id:"streets-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"streets-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"streets-v4-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"BASE_V4",name:"Base",description:"",variants:[{id:"base-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"base-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"base-v4-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"base-v4-ai",name:"AI",variantType:"AI",description:"",imageURL:""}]},{referenceStyleID:"OUTDOOR_V2",name:"Outdoor",description:"",variants:[{id:"outdoor-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"outdoor-v2" is deprecated, use "outdoor-v4" instead'},{id:"outdoor-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"outdoor-v2-dark" is deprecated, use "outdoor-v4-dark" instead'}]},{referenceStyleID:"WINTER_V2",name:"Winter",description:"",variants:[{id:"winter-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"winter-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"WINTER_V4",name:"Winter",description:"",variants:[{id:"winter-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"winter-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"SATELLITE_V2",name:"Satellite",description:"",variants:[{id:"satellite",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"satellite" is deprecated, use "satellite-v4" instead'}]},{referenceStyleID:"HYBRID_V2",name:"Hybrid",description:"",variants:[{id:"hybrid",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"HYBRID_V4",name:"Hybrid",description:"",variants:[{id:"hybrid-v4",name:"Default",variantType:"DEFAULT",imageURL:""},{id:"hybrid-v4-dark",name:"Dark",variantType:"DARK",imageURL:""}]},{referenceStyleID:"BASIC_V2",name:"Basic",description:"",variants:[{id:"basic-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"basic-v2" is deprecated, use "base-v4" instead'},{id:"basic-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecationMessage:'"basic-v2" is deprecated, use "base-v4" instead'},{id:"basic-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"basic-v2" is deprecated, use "base-v4" instead'}]},{referenceStyleID:"BRIGHT",name:"Bright",description:"",variants:[{id:"bright-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"bright-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"bright-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"bright-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"OPENSTREETMAP_V2",name:"OpenStreetMap",description:"",variants:[{id:"openstreetmap",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"openstreetmap-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"TOPO_V2",name:"Topo",description:"",variants:[{id:"topo-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"topo-v2" is deprecated, use "topo-v4" instead'},{id:"topo-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"topo-v2-dark" is deprecated, use "topo-v4-dark" instead'},{id:"topo-v2-shiny",name:"Shiny",variantType:"SHINY",description:"",imageURL:"",deprecated:!0},{id:"topo-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"topo-v2-pastel" is deprecated, use "topo-v4-pastel" instead'},{id:"topo-v2-topographique",name:"Topographique",variantType:"TOPOGRAPHIQUE",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"topo-v2-topographique" is deprecated, use "topo-v4-topographique" instead'}]},{referenceStyleID:"VOYAGER_V2",name:"Voyager",description:"",variants:[{id:"voyager-v2",name:"Default",deprecated:!0,variantType:"DEFAULT",description:"",imageURL:""},{id:"voyager-v2-darkmatter",name:"Darkmatter",deprecated:!0,variantType:"DARK",description:"",imageURL:""},{id:"voyager-v2-positron",name:"Positron",deprecated:!0,variantType:"LIGHT",description:"",imageURL:""},{id:"voyager-v2-vintage",name:"Vintage",deprecated:!0,variantType:"VINTAGE",description:"",imageURL:""}]},{referenceStyleID:"TONER_V2",name:"Toner",description:"",deprecated:!0,deprecationMessage:'"toner-v2" is deprecated, and will be no longer be a default style in the future',variants:[{id:"toner-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"toner-v2" is deprecated, and may be removed in future versions.'},{id:"toner-v2-background",name:"Background",variantType:"BACKGROUND",deprecated:!0,description:"",imageURL:"",deprecationMessage:'"toner-v2-background" is deprecated, and may be removed in future versions.'},{id:"toner-v2-lite",name:"Lite",variantType:"LITE",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"toner-v2-lite" is deprecated, and may be removed in future versions.'},{id:"toner-v2-lines",name:"Lines",variantType:"LINES",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"toner-v2-lines" is deprecated, and may be removed in future versions.'}]},{referenceStyleID:"DATAVIZ_V2",name:"Dataviz",description:"",variants:[{id:"dataviz",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"dataviz" is deprecated, use "dataviz-v4" instead'},{id:"dataviz-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"dataviz-dark" is deprecated, use "dataviz-v4-dark" instead'},{id:"dataviz-light",name:"Light",variantType:"LIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"dataviz-light" is deprecated, use "dataviz-v4-light" instead'}]},{referenceStyleID:"BACKDROP_V2",name:"Backdrop",description:"",variants:[{id:"backdrop",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"backdrop" is deprecated, use "backdrop-v4" instead'},{id:"backdrop-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"backdrop-dark" is deprecated, use "backdrop-v4-dark" instead'},{id:"backdrop-light",name:"Light",variantType:"LIGHT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"backdrop-light" is deprecated, use "backdrop-v4-light" instead'}]},{referenceStyleID:"OCEAN_V2",name:"Ocean",description:"",variants:[{id:"ocean",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"ocean" is deprecated, use "ocean-v4" instead'}]},{referenceStyleID:"AQUARELLE_V2",name:"Aquarelle",description:"Watercolor map for creative use",variants:[{id:"aquarelle",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"aquarelle" is deprecated, use "aquarelle-v4" instead'},{id:"aquarelle-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"aquarelle-dark" is deprecated, use "aquarelle-v4-dark" instead'},{id:"aquarelle-vivid",name:"Vivid",variantType:"VIVID",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"aquarelle-vivid" is deprecated, use "aquarelle-v4-vivid" instead'}]},{referenceStyleID:"LANDSCAPE_V2",name:"Landscape",description:"Terrain map for data overlays and visualisations",variants:[{id:"landscape",name:"Default",variantType:"DEFAULT",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"landscape" is deprecated, use "landscape-v4" instead'},{id:"landscape-dark",name:"Dark",variantType:"DARK",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"landscape-dark" is deprecated, use "landscape-v4-dark" instead'},{id:"landscape-vivid",name:"Vivid",variantType:"VIVID",description:"",imageURL:"",deprecated:!0,deprecationMessage:'"landscape-vivid" is deprecated, use "landscape-v4-vivid" instead'}]},{referenceStyleID:"LANDSCAPE_V4",name:"Landscape",description:"Terrain map for data overlays and visualisations",variants:[{id:"landscape-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"landscape-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"landscape-v4-vivid",name:"Vivid",variantType:"VIVID",description:"",imageURL:""}]},{referenceStyleID:"SATELLITE_V4",name:"Satellite",description:"",variants:[{id:"satellite-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"satellite-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"DATAVIZ_V4",name:"Dataviz",description:"",variants:[{id:"dataviz-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"dataviz-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"dataviz-v4-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"OUTDOOR_V4",name:"Outdoor",description:"",variants:[{id:"outdoor-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"outdoor-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"BACKDROP_V4",name:"Backdrop",description:"",variants:[{id:"backdrop-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"backdrop-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"backdrop-v4-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"AQUARELLE_V4",name:"Aquarelle",description:"Watercolor map for creative use",variants:[{id:"aquarelle-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"aquarelle-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"aquarelle-v4-vivid",name:"Vivid",variantType:"VIVID",description:"",imageURL:""}]},{referenceStyleID:"OCEAN_V4",name:"Ocean",description:"",variants:[{id:"ocean-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"ocean-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"TOPO_V4",name:"Topo",description:"",variants:[{id:"topo-v4",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"topo-v4-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"topo-v4-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""},{id:"topo-v4-topographique",name:"Topographique",variantType:"TOPOGRAPHIQUE",description:"",imageURL:""}]}],se={STREETS:"STREETS_V4",BASIC:"BASIC_V2",BASE:"BASE_V4",LANDSCAPE:"LANDSCAPE_V4",AQUARELLE:"AQUARELLE_V4",SATELLITE:"SATELLITE_V4",WINTER:"WINTER_V4",HYBRID:"HYBRID_V4",OCEAN:"OCEAN_V4",OUTDOOR:"OUTDOOR_V4",TONER:"TONER_V2",TOPO:"TOPO_V4",OPENSTREETMAP:"OPENSTREETMAP_V2",DATAVIZ:"DATAVIZ_V4",BACKDROP:"BACKDROP_V4",VOYAGER:"VOYAGER_V2"},T=[...Xe];function ea(e,a){T.find(i=>i.referenceStyleID===e)&&console.warn(`Default reference style ${e} already exists, it will be overwritten...`);const t=T.find(i=>i.referenceStyleID===a);if(!t)throw new Error(`Versioned map style not found for reference style: ${a}`);const n={...t,referenceStyleID:e};T.push(n)}Object.entries(se).forEach(([e,a])=>{ea(e,a)});function aa(e){return new Proxy(e,{get(a,t,n){return a.hasVariant(t)?a.getVariant(t):t.toString().toUpperCase()===t?e.getDefaultVariant():Reflect.get(a,t,n)}})}function ta(){const e={};for(let a=0;a<T.length;a+=1){const t=T[a],n=aa(new x(t.name,t.referenceStyleID));for(let i=0;i<t.variants.length;i+=1){const r=t.variants[i],o=new F(r.name,r.variantType,r.id,n,r.description,r.imageURL,r.deprecated);n.addVariant(o)}e[t.referenceStyleID]=n}return e}function N(e){if(!e)return de[T[0].referenceStyleID].getDefaultVariant().getId();if(typeof e=="string"||e instanceof String)return e.trim().toLowerCase();if(e instanceof F)return e.getId();if(e instanceof x)return e.getDefaultVariant().getId()}const de=ta();function na(e){const a=[];function t(r){(r.type==="LineString"||r.type==="MultiLineString")&&a.push(r)}function n(r){r.geometry&&t(r.geometry)}function i(r){for(const o of r.features)o.type==="Feature"?n(o):o.type==="FeatureCollection"&&i(o)}return e.type==="Feature"?n(e):e.type==="FeatureCollection"?i(e):t(e),a}function ia(e,a,t){let n=a[0],i=a[1],r=t[0]-n,o=t[1]-i;if(r!==0||o!==0){const s=((e[0]-n)*r+(e[1]-i)*o)/(r*r+o*o);s>1?(n=t[0],i=t[1]):s>0&&(n+=r*s,i+=o*s)}return r=e[0]-n,o=e[1]-i,r*r+o*o}function B(e,a,t,n,i){let r=n,o;for(let s=a+1;s<t;s++){const d=ia(e[s],e[a],e[t]);d>r&&(o=s,r=d)}r>n&&(o-a>1&&B(e,a,o,n,i),i.push(e[o]),t-o>1&&B(e,o,t,n,i))}function ra(e,a){const t=e.length-1,n=[e[0]];return B(e,0,t,a,n),n.push(e[t]),n}function oa(e,a){if(e.length<=2)return e;const t=a!==void 0?a*a:1;return ra(e,t)}const ce={extractLineStrings:na,simplify:oa};function z(e,a=!0){let t=`${e[0]},${e[1]}`;return e.length===3&&a&&(t+=`,${e[2]}`),t}function G(e,a=3e3){let t=e.map(r=>r.join(",")).join("|"),n=5e-6;const i=1e-5;for(;t.length>a;)t=ce.simplify(e,n).map(r=>`${r[0]},${r[1]}`).join("|"),n+=i;return t}function sa(e,a,t={}){const n=N(t.style),i=t.hiDPI?"@2x":"",r=t.format??"png";let o=~~(t.width??1024),s=~~(t.height??1024);t.hiDPI&&(o=~~(o/2),s=~~(s/2));const d=new URL(`maps/${encodeURIComponent(n)}/static/${e[0]},${e[1]},${a}/${o}x${s}${i}.${r}`,m.maptilerApiURL);if("attribution"in t&&d.searchParams.set("attribution",t.attribution.toString()),"markers"in t){let l="";const g="markerIcon"in t;g&&(l+=`icon:${t.markerIcon}|`),g&&"markerAnchor"in t&&(l+=`anchor:${t.markerAnchor}|`),g&&t.hiDPI&&(l+="scale:2|");const h=Array.isArray(t.markers[0])?t.markers:[t.markers];l+=h.map(L=>z(L,!g)).join("|"),d.searchParams.set("markers",l)}if("path"in t){let l="";if(l+=`fill:${t.pathFillColor??"none"}|`,"pathStrokeColor"in t&&(l+=`stroke:${t.pathStrokeColor}|`),"pathWidth"in t){const g=t.pathWidth/(t.hiDPI?2:1);l+=`width:${g.toString()}|`}l+=G(t.path),d.searchParams.set("path",l)}return d.searchParams.set("key",t.apiKey??p.apiKey),d.toString()}function da(e,a={}){const t=N(a.style),n=a.hiDPI?"@2x":"",i=a.format??"png";let r=~~(a.width??1024),o=~~(a.height??1024);a.hiDPI&&(r=~~(r/2),o=~~(o/2));const s=new URL(`maps/${encodeURIComponent(t)}/static/${e[0]},${e[1]},${e[2]},${e[3]}/${r}x${o}${n}.${i}`,m.maptilerApiURL);if("attribution"in a&&s.searchParams.set("attribution",a.attribution.toString()),"padding"in a&&s.searchParams.set("padding",a.padding.toString()),"markers"in a){let d="";const l="markerIcon"in a;l&&(d+=`icon:${a.markerIcon}|`),l&&"markerAnchor"in a&&(d+=`anchor:${a.markerAnchor}|`),l&&a.hiDPI&&(d+="scale:2|");const g=Array.isArray(a.markers[0])?a.markers:[a.markers];d+=g.map(h=>z(h,!l)).join("|"),s.searchParams.set("markers",d)}if("path"in a){let d="";if(d+=`fill:${a.pathFillColor??"none"}|`,"pathStrokeColor"in a&&(d+=`stroke:${a.pathStrokeColor}|`),"pathWidth"in a){const l=a.pathWidth/(a.hiDPI?2:1);d+=`width:${l.toString()}|`}d+=G(a.path),s.searchParams.set("path",d)}return s.searchParams.set("key",a.apiKey??p.apiKey),s.toString()}function ca(e={}){if(!("markers"in e)&&!("path"in e))throw new Error("Automatic static maps require markers and/or path to be created.");const a=N(e.style),t=e.hiDPI?"@2x":"",n=e.format??"png";let i=~~(e.width??1024),r=~~(e.height??1024);e.hiDPI&&(i=~~(i/2),r=~~(r/2));const o=new URL(`maps/${encodeURIComponent(a)}/static/auto/${i}x${r}${t}.${n}`,m.maptilerApiURL);if("attribution"in e&&o.searchParams.set("attribution",e.attribution.toString()),"padding"in e&&o.searchParams.set("padding",e.padding.toString()),"markers"in e){let s="";const d="markerIcon"in e;d&&(s+=`icon:${e.markerIcon}|`),d&&"markerAnchor"in e&&(s+=`anchor:${e.markerAnchor}|`),d&&e.hiDPI&&(s+="scale:2|");const l=Array.isArray(e.markers[0])?e.markers:[e.markers];s+=l.map(g=>z(g,!d)).join("|"),o.searchParams.set("markers",s)}if("path"in e){let s="";if(s+=`fill:${e.pathFillColor??"none"}|`,"pathStrokeColor"in e&&(s+=`stroke:${e.pathStrokeColor}|`),"pathWidth"in e){const d=e.pathWidth/(e.hiDPI?2:1);s+=`width:${d.toString()}|`}s+=G(e.path),o.searchParams.set("path",s)}return o.searchParams.set("key",e.apiKey??p.apiKey),o.toString()}const la={centered:sa,bounded:da,automatic:ca},$=63710088e-1,le=2*Math.PI*$,ge=85.0511287;function pe(e){return(180+e)/360}function me(e){return e=Math.max(Math.min(e,ge),-ge),(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function ue(e){const a=ve(e);return[pe(a[0]),me(a[1])]}function fe(e){return e*360-180}function he(e){const a=180-e*360;return 360/Math.PI*Math.atan(Math.exp(a*Math.PI/180))-90}function ga(e){return[fe(e[0]),he(e[1])]}function W(e,a){const t=Math.PI/180,n=e[1]*t,i=a[1]*t,r=Math.sin(n)*Math.sin(i)+Math.cos(n)*Math.cos(i)*Math.cos((a[0]-e[0])*t);return $*Math.acos(Math.min(r,1))}function pa(e){const a=Array(e.length);a[0]=0;const t=a.length;for(let n=1;n<t;n++)a[n]=W(e[n-1],e[n])+a[n-1];return a}function ve(e){const a=e[0],t=e[1],n=360,i=((a+180)%n+n)%n-180;return[i===-180?180:i,t]}function ye(e){return le*Math.cos(e*Math.PI/180)}function Le(e,a,t=!0){const n=2**a,i=[e[0]*n,e[1]*n];return t?[~~i[0],~~i[1]]:i}function ma(e,a,t=!0){const n=ue(e);return Le(n,a,t)}function D(e){return e*Math.PI/180}function q(e){return e*180/Math.PI}function ua(e,a,t){const n=W(e,a),i=D(e[0]),r=D(e[1]),o=D(a[0]),s=D(a[1]),d=n/$,l=Math.sin((1-t)*d)/Math.sin(d),g=Math.sin(t*d)/Math.sin(d),h=l*Math.cos(r)*Math.cos(i)+g*Math.cos(s)*Math.cos(o),L=l*Math.cos(r)*Math.sin(i)+g*Math.cos(s)*Math.sin(o),R=l*Math.sin(r)+g*Math.sin(s),M=Math.atan2(R,Math.sqrt(h*h+L*L)),c=Math.atan2(L,h);return[q(c),q(M)]}const Ae={EARTH_RADIUS:$,EARTH_CIRCUMFERENCE:le,longitudeToMercatorX:pe,latitudeToMercatorY:me,wgs84ToMercator:ue,mercatorXToLongitude:fe,mercatorYToLatitude:he,mercatorToWgs84:ga,haversineDistanceWgs84:W,wrapWgs84:ve,circumferenceAtLatitude:ye,mercatorToTileIndex:Le,wgs84ToTileIndex:ma,toRadians:D,toDegrees:q,haversineIntermediateWgs84:ua,haversineCumulatedDistanceWgs84:pa};let J=null;function Te(){return J||(J=new Pe({maxSize:p.tileCacheSize})),J}async function Se(e){const a=new Blob([e]),t=await createImageBitmap(a),n=document.createElement("canvas"),i=n.getContext("2d");n.width=t.width,n.height=t.height,i.drawImage(t,0,0);const r=i.getImageData(0,0,n.width,n.height);return{pixels:r.data,width:n.width,height:n.height,components:r.data.length/(n.width*n.height)}}function Re(){if(p.bufferToPixelData)return p.bufferToPixelData;if(typeof window<"u")return Se;throw new Error("An image file buffer to pixel data parser is necessary. Specify it in `config.bufferToPixelData`")}function Y(){return!!p.bufferToPixelData||typeof window<"u"}const fa="terrain-rgb-v2",Q=50,ha=1e3;let O=null;const Ie={403:"Key is missing, invalid or restricted"};async function va(e,a){e.length>ha&&console.warn("Computing elevation for complex geometries is discouraged - simplify the geometry before proceeding");const t=Math.ceil(e.length/Q),n=Array.from({length:t},()=>null).map((r,o)=>{const s=o*Q,d=e.slice(s,s+Q).map(g=>g.join(",")).join(";"),l=new URL(`elevation/${d}.json`,m.maptilerApiURL);return l.searchParams.set("key",a),u(l.toString())}),i=await Promise.allSettled(n);return(await Promise.all(i.map(async r=>{if(r.status==="rejected")throw new Error(`Some segments could not be fetched, error: ${r.reason}`);if(!r.value.ok)throw new Error(`Some segments could not be fetched, response: ${r.value.status} ${await r.value.text()}, url: ${r.value.url}`);return r.value.json()}))).flat()}async function ya(e,a,t){if(!O){const c=new URL(`tiles/${fa}/tiles.json`,m.maptilerApiURL);c.searchParams.set("key",a);const S=c.toString(),v=await u(S);if(v.ok)O=await v.json();else throw new f(v,Ie[v.status]??"")}const n=Re(),i=O.tiles[0],r=Te(),o=O.maxzoom;let s=~~(t??o);(s>o||s<0)&&(s=o);const d=e.map(c=>Ae.wgs84ToTileIndex(c,s,!1)),l=d.map(c=>[~~c[0],~~c[1]]).map(c=>`terrain_${s.toString()}_${c[0].toString()}_${c[1].toString()}`),g=Array.from(new Set(l.filter(c=>!r.has(c)))).map(c=>c.split("_").slice(1)),h=g.map(c=>i.replace("{x}",c[1].toString()).replace("{y}",c[2].toString()).replace("{z}",c[0].toString())).map(c=>u(c)),L=(await Promise.allSettled(h)).map(c=>c.status==="fulfilled"?c.value:null).filter(c=>c),R=L.filter(c=>!c.ok);if(L.length!==h.length)throw new Error("Some tiles could not be fetched.");if(R.length)throw new f(R[0],Ie[R[0].status]??"");const M=await Promise.all(L.map(c=>c.arrayBuffer()));if(!M.every(c=>c.byteLength>0))throw new Error("Some tiles are not available.");return(await Promise.all(M.map(c=>n(c)))).forEach((c,S)=>{const v=g[S],U=`terrain_${v[0].toString()}_${v[1].toString()}_${v[2].toString()}`;r.set(U,c)}),e.map((c,S)=>{const v=l[S],U=d[S],A=r.get(v),De=Math.min(Math.round(A.width*(U[0]%1)),A.width-1),C=(Math.min(Math.round(A.height*(U[1]%1)),A.height-1)*A.width+De)*A.components,Me=A.pixels[C],Ue=A.pixels[C+1],Ee=A.pixels[C+2],ke=-1e4+(Me*256*256+Ue*256+Ee)*.1;return[c[0],c[1],~~(ke*1e3)/1e3]})}async function La(e,a={}){return(await V([e],a))[0]}async function V(e,a={}){if(e.length===0)return[];const t=a.apiKey??p.apiKey,n=a.computeOn==="client"?await ya(e,t,a.zoom):await va(e,t);if(a.smoothingKernelSize){const i=~~(a.smoothingKernelSize/2)*2+1,r=n.map(s=>s[2]),o=~~(i/2);for(let s=o;s<r.length-o;s+=1){let d=0;for(let l=0;l<i;l+=1){const g=r[s-o+l];d+=g}d/=i,n[s][2]=d}}return n}async function Aa(e,a={}){if(e.type!=="LineString")throw new Error("The provided object is not a GeoJSON LineString");a.computeOn??(a.computeOn=Y()?"client":"server");const t=structuredClone(e),n=await V(t.coordinates,a);return t.coordinates=n,t}async function Ta(e,a={}){if(e.type!=="MultiLineString")throw new Error("The provided object is not a GeoJSON MultiLineString");a.computeOn??(a.computeOn=Y()?"client":"server");const t=structuredClone(e),n=t.coordinates.map(d=>d.length),i=t.coordinates.flat(),r=await V(i,a),o=[];let s=0;for(const d of n)o.push(r.slice(s,s+d)),s+=d;return t.coordinates=o,t}const Sa={at:La,batch:V,fromLineString:Aa,fromMultiLineString:Ta};export{Z as ClientConfig,ee as ISOLanguage,y as Language,de as MapStyle,F as MapStyleVariant,X as NonISOLanguage,x as ReferenceMapStyle,f as ServiceError,Ne as areSameLanguages,Se as bufferToPixelDataBrowser,Y as canParsePixelData,ye as circumferenceAtLatitude,p as config,Ye as coordinates,Ze as data,se as defaultReferenceStyleMap,Sa as elevation,oe as expandMapStyle,_e as geocoding,He as geolocation,K as getAutoLanguage,Re as getBufferToPixelDataParser,I as getLanguageInfoFromCode,E as getLanguageInfoFromFlag,ae as getLanguageInfoFromKey,Te as getTileCache,_ as isLanguageInfo,T as mapStylePresetList,Ae as math,ce as misc,We as routing,la as staticMaps,N as styleToStyle,j as toLanguageInfo};
@@ -1,3 +1,4 @@
1
+ import { decode } from '@googlemaps/polyline-codec';
1
2
  import QuickLRU from 'quick-lru';
2
3
 
3
4
  function tryGettingFetch() {
@@ -1189,6 +1190,105 @@ const geolocation = {
1189
1190
  info
1190
1191
  };
1191
1192
 
1193
+ function addLocations(search, locations) {
1194
+ for (const loc of locations) {
1195
+ search.append("location", `${loc.lon},${loc.lat}`);
1196
+ }
1197
+ }
1198
+ function addResponseOptions(search, response) {
1199
+ if (!response) return;
1200
+ if (response.units) search.set("response.units", response.units);
1201
+ if (response.language) search.set("response.language", response.language);
1202
+ if (response.alternates !== void 0)
1203
+ search.set("alternates", String(response.alternates));
1204
+ if (response.additionalData?.detailLevel)
1205
+ search.set(
1206
+ "response.additionalData.detailLevel",
1207
+ response.additionalData.detailLevel
1208
+ );
1209
+ }
1210
+ function addProfileOptions(search, profile, opts) {
1211
+ if (!opts) return;
1212
+ if (profile === "car") {
1213
+ const o = opts;
1214
+ if (o.mode) search.set("car.mode", o.mode);
1215
+ if (o.topSpeed) search.set("topSpeed", String(o.topSpeed));
1216
+ if (o.avoidances?.tolls !== void 0)
1217
+ search.set("avoidances.tolls", String(o.avoidances.tolls));
1218
+ if (o.avoidances?.ferry !== void 0)
1219
+ search.set("avoidances.ferry", String(o.avoidances.ferry));
1220
+ if (o.avoidances?.highway !== void 0)
1221
+ search.set("avoidances.highway", String(o.avoidances.highway));
1222
+ }
1223
+ if (profile === "truck") {
1224
+ const o = opts;
1225
+ if (o.height) search.set("truck.height", String(o.height));
1226
+ if (o.weight) search.set("truck.weight", String(o.weight));
1227
+ if (o.axleLoad) search.set("truck.axleLoad", String(o.axleLoad));
1228
+ if (o.hazmat !== void 0) search.set("truck.hazmat", String(o.hazmat));
1229
+ if (o.topSpeed) search.set("topSpeed", String(o.topSpeed));
1230
+ if (o.avoidances?.tolls !== void 0)
1231
+ search.set("avoidances.tolls", String(o.avoidances.tolls));
1232
+ }
1233
+ if (profile === "bicycle") {
1234
+ const o = opts;
1235
+ if (o.type) search.set("bicycle.type", o.type);
1236
+ if (o.cyclingSpeed)
1237
+ search.set("bicycle.cyclingSpeed", String(o.cyclingSpeed));
1238
+ }
1239
+ if (profile === "pedestrian") {
1240
+ const o = opts;
1241
+ if (o.walkingSpeed)
1242
+ search.set("pedestrian.walkingSpeed", String(o.walkingSpeed));
1243
+ }
1244
+ }
1245
+ async function processDirectionsResponse(res) {
1246
+ if (!res.ok) {
1247
+ throw new ServiceError(res);
1248
+ }
1249
+ const response = await res.json();
1250
+ for (const leg of response.route.legs) {
1251
+ if (typeof leg.geometry === "string") {
1252
+ leg.geometry = decode(leg.geometry, 6).map(([lat, lon]) => [lon, lat]);
1253
+ }
1254
+ }
1255
+ return response;
1256
+ }
1257
+ async function directionsPost(body) {
1258
+ const url = new URL("routing/v1/directions", defaults.maptilerApiURL);
1259
+ url.searchParams.set("key", config.apiKey);
1260
+ const res = await callFetch(url.toString(), {
1261
+ method: "POST",
1262
+ headers: { "content-type": "application/json" },
1263
+ body: JSON.stringify(body)
1264
+ });
1265
+ return await processDirectionsResponse(res);
1266
+ }
1267
+ async function directionsGet(req) {
1268
+ const url = new URL("routing/v1/directions", defaults.maptilerApiURL);
1269
+ const search = url.searchParams;
1270
+ search.set("key", config.apiKey);
1271
+ search.set("profile", req.profile);
1272
+ if (req.id) search.set("id", req.id);
1273
+ if (req.departureTime) search.set("departureTime", req.departureTime);
1274
+ if (req.arrivalTime) search.set("arrivalTime", req.arrivalTime);
1275
+ addLocations(search, req.locations);
1276
+ addResponseOptions(search, req.response);
1277
+ addProfileOptions(search, req.profile, req.profileOptions);
1278
+ const res = await callFetch(url.toString());
1279
+ return await processDirectionsResponse(res);
1280
+ }
1281
+ const routing = {
1282
+ /**
1283
+ * Get directions using POST request
1284
+ */
1285
+ directionsPost,
1286
+ /**
1287
+ * Get directions using GET request
1288
+ */
1289
+ directionsGet
1290
+ };
1291
+
1192
1292
  const customMessages$2 = {
1193
1293
  403: "Key is missing, invalid or restricted"
1194
1294
  };
@@ -3012,5 +3112,5 @@ const elevation = {
3012
3112
  fromMultiLineString
3013
3113
  };
3014
3114
 
3015
- export { ClientConfig, ISOLanguage, Language, MapStyle, MapStyleVariant, NonISOLanguage, ReferenceMapStyle, ServiceError, areSameLanguages, bufferToPixelDataBrowser, canParsePixelData, circumferenceAtLatitude, config, coordinates, data, defaultReferenceStyleMap, elevation, expandMapStyle, geocoding, geolocation, getAutoLanguage, getBufferToPixelDataParser, getLanguageInfoFromCode, getLanguageInfoFromFlag, getLanguageInfoFromKey, getTileCache, isLanguageInfo, mapStylePresetList, math, misc, staticMaps, styleToStyle, toLanguageInfo };
3115
+ export { ClientConfig, ISOLanguage, Language, MapStyle, MapStyleVariant, NonISOLanguage, ReferenceMapStyle, ServiceError, areSameLanguages, bufferToPixelDataBrowser, canParsePixelData, circumferenceAtLatitude, config, coordinates, data, defaultReferenceStyleMap, elevation, expandMapStyle, geocoding, geolocation, getAutoLanguage, getBufferToPixelDataParser, getLanguageInfoFromCode, getLanguageInfoFromFlag, getLanguageInfoFromKey, getTileCache, isLanguageInfo, mapStylePresetList, math, misc, routing, staticMaps, styleToStyle, toLanguageInfo };
3016
3116
  //# sourceMappingURL=maptiler-client.mjs.map