Skip to content

Instantly share code, notes, and snippets.

@yuvipanda
Created February 15, 2024 18:53
Show Gist options
  • Save yuvipanda/cdb767623fb54e44c1889f954bdd083c to your computer and use it in GitHub Desktop.
Save yuvipanda/cdb767623fb54e44c1889f954bdd083c to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"id": "0f09e1c5",
"metadata": {},
"source": [
"# Speedtest Data (`ScatterplotLayer`)\n",
"\n",
"This example will use data collected from Ookla's Speed Test application and [shared publicly in the AWS Open Data Registry](https://registry.opendata.aws/speedtest-global-performance/). From the AWS page:\n",
"\n",
"> Global fixed broadband and mobile (cellular) network performance, allocated to zoom level 16 web mercator tiles (approximately 610.8 meters by 610.8 meters at the equator). Data is provided in both Shapefile format as well as Apache Parquet with geometries represented in Well Known Text (WKT) projected in EPSG:4326. Download speed, upload speed, and latency are collected via the Speedtest by Ookla applications for Android and iOS and averaged for each tile."
]
},
{
"cell_type": "markdown",
"id": "7dd1dfef-3756-49d9-9480-9a4cdba22345",
"metadata": {},
"source": [
"## Imports"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "d1678764",
"metadata": {},
"outputs": [],
"source": [
"from pathlib import Path\n",
"\n",
"import geopandas as gpd\n",
"import numpy as np\n",
"import pandas as pd\n",
"import shapely\n",
"from palettable.colorbrewer.diverging import BrBG_10\n",
"\n",
"from lonboard import Map, ScatterplotLayer\n",
"from lonboard.colormap import apply_continuous_cmap"
]
},
{
"cell_type": "markdown",
"id": "d51ca576",
"metadata": {},
"source": [
"## Fetch data\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "c747d8b9-94b9-421a-967a-8350bf72de9a",
"metadata": {},
"source": [
"The URL for a single data file for mobile network speeds in the first quarter of 2019:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "34ac8eae",
"metadata": {},
"outputs": [],
"source": [
"url = \"https://ookla-open-data.s3.us-west-2.amazonaws.com/parquet/performance/type=mobile/year=2019/quarter=1/2019-01-01_performance_mobile_tiles.parquet\""
]
},
{
"cell_type": "markdown",
"id": "5991ef2c-5db0-4110-b6a1-b33fcbddad0d",
"metadata": {},
"source": [
"The data used in this example is relatively large. In the cell below, we cache the downloading and preparation of the dataset so that it's faster to run this notebook the second time.\n",
"\n",
"We fetch two columns — `avg_d_kbps` and `tile` — from this data file directly from AWS. The `pd.read_parquet` command will perform a network request for these columns from the data file, so it may take a while on a slow network connection. `avg_d_kbps` is the average download speed for that data point in kilobits per second. `tile` is the WKT string representing a given zoom-16 Web Mercator tile.\n",
"\n",
"The `tile` column contains _strings_ representing WKT-formatted geometries. We need to parse those strings into geometries. Then for simplicity we'll convert into their centroids."
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "7c20cb4c-9746-486f-aef7-95dd2dedd6a5",
"metadata": {},
"outputs": [],
"source": [
"local_path = Path(\"internet-speeds.parquet\")\n",
"if local_path.exists():\n",
" gdf = gpd.read_parquet(local_path)\n",
"else:\n",
" columns = [\"avg_d_kbps\", \"tile\"]\n",
" df = pd.read_parquet(url, columns=columns)\n",
"\n",
" tile_geometries = shapely.from_wkt(df[\"tile\"])\n",
" tile_centroids = shapely.centroid(tile_geometries)\n",
" gdf = gpd.GeoDataFrame(df[[\"avg_d_kbps\"]], geometry=tile_centroids)\n",
" gdf.to_parquet(local_path)"
]
},
{
"cell_type": "markdown",
"id": "5852aa94-2d18-4a1b-b379-be19682d57eb",
"metadata": {},
"source": [
"We can take a quick look at this data:"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "4b27e9a4",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>avg_d_kbps</th>\n",
" <th>geometry</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>5983</td>\n",
" <td>POINT (-160.01862 70.63722)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>3748</td>\n",
" <td>POINT (-160.04059 70.63357)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3364</td>\n",
" <td>POINT (-160.04059 70.63175)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>2381</td>\n",
" <td>POINT (-160.03510 70.63357)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>3047</td>\n",
" <td>POINT (-160.03510 70.63175)</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" avg_d_kbps geometry\n",
"0 5983 POINT (-160.01862 70.63722)\n",
"1 3748 POINT (-160.04059 70.63357)\n",
"2 3364 POINT (-160.04059 70.63175)\n",
"3 2381 POINT (-160.03510 70.63357)\n",
"4 3047 POINT (-160.03510 70.63175)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gdf.head()"
]
},
{
"cell_type": "markdown",
"id": "65436a4a-c498-4f40-ba79-1082062376bf",
"metadata": {},
"source": [
"To ensure that this demo is snappy on most computers, we'll filter to a bounding box over Europe."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "80326895-70ba-4f4b-a7b3-106b4bbd36d9",
"metadata": {},
"outputs": [],
"source": [
"gdf = gdf.cx[-11.83:25.5, 34.9:59]"
]
},
{
"cell_type": "markdown",
"id": "3cc2215e-7706-4ab3-b674-3de4ca41899c",
"metadata": {},
"source": [
"Even this filtered data frame still has 800,000 rows, so it's still a lot of data to explore:"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "a34a6a27-0259-4da9-94c4-923466da05fb",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>avg_d_kbps</th>\n",
" <th>geometry</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>383429</th>\n",
" <td>13570</td>\n",
" <td>POINT (-2.94159 58.99673)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>383430</th>\n",
" <td>18108</td>\n",
" <td>POINT (-3.29865 58.96276)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>383431</th>\n",
" <td>5569</td>\n",
" <td>POINT (-3.29315 58.97125)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>383432</th>\n",
" <td>9349</td>\n",
" <td>POINT (-3.29315 58.96842)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>383433</th>\n",
" <td>11216</td>\n",
" <td>POINT (-3.23273 58.98541)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1840929</th>\n",
" <td>104723</td>\n",
" <td>POINT (25.38666 35.09519)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1840930</th>\n",
" <td>62540</td>\n",
" <td>POINT (25.44708 35.04124)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1840931</th>\n",
" <td>88068</td>\n",
" <td>POINT (25.47455 35.04124)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1840938</th>\n",
" <td>38255</td>\n",
" <td>POINT (25.38116 35.00075)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1840939</th>\n",
" <td>91750</td>\n",
" <td>POINT (25.45807 34.99175)</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>807221 rows × 2 columns</p>\n",
"</div>"
],
"text/plain": [
" avg_d_kbps geometry\n",
"383429 13570 POINT (-2.94159 58.99673)\n",
"383430 18108 POINT (-3.29865 58.96276)\n",
"383431 5569 POINT (-3.29315 58.97125)\n",
"383432 9349 POINT (-3.29315 58.96842)\n",
"383433 11216 POINT (-3.23273 58.98541)\n",
"... ... ...\n",
"1840929 104723 POINT (25.38666 35.09519)\n",
"1840930 62540 POINT (25.44708 35.04124)\n",
"1840931 88068 POINT (25.47455 35.04124)\n",
"1840938 38255 POINT (25.38116 35.00075)\n",
"1840939 91750 POINT (25.45807 34.99175)\n",
"\n",
"[807221 rows x 2 columns]"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"gdf"
]
},
{
"cell_type": "markdown",
"id": "81a61ec4-2a09-40c0-aa92-7dca570bbd49",
"metadata": {},
"source": [
"To render point data, first create a `ScatterplotLayer` and then add it to a `Map` object:"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "570ab332-3767-4246-8d83-df4625b2ae48",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "f6b03302ad634c6d912f972288b35c09",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(layers=[ScatterplotLayer(table=pyarrow.Table\n",
"avg_d_kbps: uint32\n",
"__index_level_0__: int64\n",
"geometry: fixed_s…"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"layer = ScatterplotLayer.from_geopandas(gdf)\n",
"m = Map(layer)\n",
"m"
]
},
{
"cell_type": "markdown",
"id": "6f4d89c3-282a-4beb-9f35-68eb9645e8c0",
"metadata": {},
"source": [
"We can look at the [documentation for `ScatterplotLayer`](https://developmentseed.org/lonboard/latest/api/layers/scatterplot-layer/) to see what other rendering options it allows. Let's set the fill color to something other than black:"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "3912b241-577f-4ac3-b78f-2702e89d6010",
"metadata": {},
"outputs": [],
"source": [
"layer.get_fill_color = [0, 0, 200, 200]"
]
},
{
"cell_type": "markdown",
"id": "b66a73b6-69c1-4661-a7ad-2dd3941c8753",
"metadata": {},
"source": [
"Blue is pretty, but the map would be more informative if we colored each point by a relevant characteristic. In this case, we have the download speed associated with each location, so let's use that!"
]
},
{
"cell_type": "markdown",
"id": "ce630455-3e19-47f1-bb69-81fdcd99b126",
"metadata": {},
"source": [
"Here we compute a linear statistic for the download speed. Given a minimum bound of `5000` and a maximum bound of `50,000` the normalized speed is linearly scaled to between 0 and 1."
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "179071b3",
"metadata": {},
"outputs": [],
"source": [
"min_bound = 5000\n",
"max_bound = 50000\n",
"download_speed = gdf['avg_d_kbps']\n",
"normalized_download_speed = (download_speed - min_bound) / (max_bound - min_bound)"
]
},
{
"cell_type": "markdown",
"id": "7f678b8e-ad23-4ebd-842c-c5158e1ec741",
"metadata": {},
"source": [
"`normalized_download_speed` is now linearly scaled based on the bounds provided above. Keep in mind that the **input range of the colormap is 0-1**. So any values that are below 0 will receive the left-most color in the colormap, while any values above 1 will receive the right-most color in the colormap."
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "a8df3963-2bc2-4f89-8a38-20e232a13932",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"383429 0.190444\n",
"383430 0.291289\n",
"383431 0.012644\n",
"383432 0.096644\n",
"383433 0.138133\n",
" ... \n",
"1840929 2.216067\n",
"1840930 1.278667\n",
"1840931 1.845956\n",
"1840938 0.739000\n",
"1840939 1.927778\n",
"Name: avg_d_kbps, Length: 807221, dtype: float64"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"normalized_download_speed"
]
},
{
"cell_type": "markdown",
"id": "dc0e388f-eeed-4339-bd54-0491f79f45aa",
"metadata": {},
"source": [
"We can use any colormap provided by the [`palettable`](https://github.com/jiffyclub/palettable) package. Let's inspect the `BrBG_10` diverging colormap below:"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "9d5347e2-84c7-40bc-af45-c8638188709e",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAgAAAABACAYAAABsv8+/AAAAE3RFWHRUaXRsZQBCckJHIGNvbG9ybWFwMTXIUAAAABl0RVh0RGVzY3JpcHRpb24AQnJCRyBjb2xvcm1hcLqHWMgAAAAwdEVYdEF1dGhvcgBNYXRwbG90bGliIHYzLjcuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZ3SZIrgAAAAydEVYdFNvZnR3YXJlAE1hdHBsb3RsaWIgdjMuNy40LCBodHRwczovL21hdHBsb3RsaWIub3JnWj+9nwAAAilJREFUeJzt1k1u2zAURlGSQffTxXT/O7GYgSUHejahBPGgwHfOROWPKCYBitv//f0zW2ut99Zaa21cPu//GOPd+/t5/O7949h/39iP8WP+GI/TfO9l3yj79vXn88bL9/riO/Ueva4v7tHLd/rHx/7+6+d4rI/z+uq9sn8s18u5i/PG4tyrexz3bsffr5f3HvP7vnEer/a3Xu6x2N/K+V/7X8+3i++u7jn3v/Ns9+fWxv6s8+f15/lvnvPj7/32fne3Oe/j/XmbWxkf69ti/2/XV9970/q2nZ5bGd+2uZg/9pdzZj1nlv3fO/9p3/zhPco5x88763xZr/NzMb967+n8i/eX56/us1hv+++97b+Hr/GxPi/G/+n7+779fysAIIkAAIBAAgAAAgkAAAgkAAAgkAAAgEACAAACCQAACCQAACCQAACAQAIAAAIJAAAIJAAAIJAAAIBAAgAAAgkAAAgkAAAgkAAAgEACAAACCQAACCQAACCQAACAQAIAAAIJAAAIJAAAIJAAAIBAAgAAAgkAAAgkAAAgkAAAgEACAAACCQAACCQAACCQAACAQAIAAAIJAAAIJAAAIJAAAIBAAgAAAgkAAAgkAAAgkAAAgEACAAACCQAACCQAACCQAACAQAIAAAIJAAAIJAAAIJAAAIBAAgAAAgkAAAgkAAAgkAAAgEACAAACCQAACCQAACCQAACAQAIAAAIJAAAIJAAAIJAAAIBAAgAAAn0CyK5V+uT9Ti4AAAAASUVORK5CYII=",
"text/html": [
"<div style=\"vertical-align: middle;\"><strong>BrBG</strong> </div><div class=\"cmap\"><img alt=\"BrBG colormap\" title=\"BrBG\" style=\"border: 1px solid #555;\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAABACAYAAABsv8+/AAAAE3RFWHRUaXRsZQBCckJHIGNvbG9ybWFwMTXIUAAAABl0RVh0RGVzY3JpcHRpb24AQnJCRyBjb2xvcm1hcLqHWMgAAAAwdEVYdEF1dGhvcgBNYXRwbG90bGliIHYzLjcuNCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZ3SZIrgAAAAydEVYdFNvZnR3YXJlAE1hdHBsb3RsaWIgdjMuNy40LCBodHRwczovL21hdHBsb3RsaWIub3JnWj+9nwAAAilJREFUeJzt1k1u2zAURlGSQffTxXT/O7GYgSUHejahBPGgwHfOROWPKCYBitv//f0zW2ut99Zaa21cPu//GOPd+/t5/O7949h/39iP8WP+GI/TfO9l3yj79vXn88bL9/riO/Ueva4v7tHLd/rHx/7+6+d4rI/z+uq9sn8s18u5i/PG4tyrexz3bsffr5f3HvP7vnEer/a3Xu6x2N/K+V/7X8+3i++u7jn3v/Ns9+fWxv6s8+f15/lvnvPj7/32fne3Oe/j/XmbWxkf69ti/2/XV9970/q2nZ5bGd+2uZg/9pdzZj1nlv3fO/9p3/zhPco5x88763xZr/NzMb967+n8i/eX56/us1hv+++97b+Hr/GxPi/G/+n7+779fysAIIkAAIBAAgAAAgkAAAgkAAAgkAAAgEACAAACCQAACCQAACCQAACAQAIAAAIJAAAIJAAAIJAAAIBAAgAAAgkAAAgkAAAgkAAAgEACAAACCQAACCQAACCQAACAQAIAAAIJAAAIJAAAIJAAAIBAAgAAAgkAAAgkAAAgkAAAgEACAAACCQAACCQAACCQAACAQAIAAAIJAAAIJAAAIJAAAIBAAgAAAgkAAAgkAAAgkAAAgEACAAACCQAACCQAACCQAACAQAIAAAIJAAAIJAAAIJAAAIBAAgAAAgkAAAgkAAAgkAAAgEACAAACCQAACCQAACCQAACAQAIAAAIJAAAIJAAAIJAAAIBAAgAAAn0CyK5V+uT9Ti4AAAAASUVORK5CYII=\"></div><div style=\"vertical-align: middle; max-width: 514px; display: flex; justify-content: space-between;\"><div style=\"float: left;\"><div title=\"#543005ff\" style=\"display: inline-block; width: 1em; height: 1em; margin: 0; vertical-align: middle; border: 1px solid #555; background-color: #543005ff;\"></div> under</div><div style=\"margin: 0 auto; display: inline-block;\">bad <div title=\"#00000000\" style=\"display: inline-block; width: 1em; height: 1em; margin: 0; vertical-align: middle; border: 1px solid #555; background-color: #00000000;\"></div></div><div style=\"float: right;\">over <div title=\"#003c30ff\" style=\"display: inline-block; width: 1em; height: 1em; margin: 0; vertical-align: middle; border: 1px solid #555; background-color: #003c30ff;\"></div></div>"
],
"text/plain": [
"<matplotlib.colors.LinearSegmentedColormap at 0x1291b1810>"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"BrBG_10.mpl_colormap"
]
},
{
"cell_type": "markdown",
"id": "8eb59fd6-3b7d-4db9-ad9b-a66e4e58152f",
"metadata": {},
"source": [
"Now let's apply the colormap on `normalized_download_speed` using a helper provided by `lonboard`. We can set it on `layer.get_fill_color` to update the existing colors."
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "5a77f728-9cbe-4372-9bfd-d6dee4b93a01",
"metadata": {},
"outputs": [],
"source": [
"layer.get_fill_color = apply_continuous_cmap(normalized_download_speed, BrBG_10)"
]
},
{
"cell_type": "markdown",
"id": "44611c75-f9e6-4f53-af7d-c640d641dc15",
"metadata": {},
"source": [
"After running the above cell, you should see the map above update with a different color per point!"
]
},
{
"cell_type": "markdown",
"id": "0bd168fe-53a1-4313-9c11-720edbfa5c6c",
"metadata": {},
"source": [
"We can pass an array into any of the \"accessors\" supported by the layer (this is any attribute that starts with `get_*`).\n",
"\n",
"For demonstration purposes, let's also set `get_radius` to `normalized_download_speed`."
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "579233ef-e077-4c8f-a111-f33d44f30a0d",
"metadata": {},
"outputs": [],
"source": [
"layer.get_radius = normalized_download_speed * 200\n",
"layer.radius_units = \"meters\"\n",
"layer.radius_min_pixels = 0.5"
]
},
{
"cell_type": "markdown",
"id": "06e2338e-8461-49f7-9884-475fffc64789",
"metadata": {},
"source": [
"After running the above cell, you should see the map updated to have a different radius per point!"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "lonboard",
"language": "python",
"name": "lonboard"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {
"93bb8eb822cb45a3bd45230e38cb36fd": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "2.0.0",
"model_name": "WidgetModel",
"state": {
"_layer_type": "scatterplot",
"_view_module": null,
"_view_module_version": "",
"antialiasing": null,
"auto_highlight": false,
"billboard": null,
"extensions": [],
"filled": null,
"get_fill_color": [
0,
0,
200,
200
],
"get_line_color": null,
"get_line_width": null,
"get_radius": null,
"line_width_max_pixels": null,
"line_width_min_pixels": null,
"line_width_scale": null,
"line_width_units": null,
"opacity": 1,
"pickable": true,
"radius_max_pixels": null,
"radius_min_pixels": null,
"radius_scale": null,
"radius_units": null,
"selected_index": null,
"stroked": null,
"table": [
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{}
],
"visible": true
}
},
"a6b8fd292f24409988b4f6b7715d87bf": {
"model_module": "anywidget",
"model_module_version": "0.9.0",
"model_name": "AnyModel",
"state": {
"_anywidget_id": "lonboard._map.Map",
"_css": ".lonboard-tooltip{font-family:var(--jp-ui-font-family);font-size:var(--jp-ui-font-size1)}.lonboard-tooltip table{border-collapse:collapse}.lonboard-tooltip table tr:nth-child(odd){background-color:#fff}.lonboard-tooltip table tr:nth-child(2n){background-color:#f1f1f1}.lonboard-tooltip td{border:1px solid rgb(204,204,204);padding:5px}.lonboard-tooltip td:first-child{font-weight:450}\n",
"_esm": "var wK=Object.create;var TC=Object.defineProperty;var SK=Object.getOwnPropertyDescriptor;var TK=Object.getOwnPropertyNames;var MK=Object.getPrototypeOf,EK=Object.prototype.hasOwnProperty;var zr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),AA=(e,t)=>{for(var r in t)TC(e,r,{get:t[r],enumerable:!0})},PK=(e,t,r,i)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let n of TK(t))!EK.call(e,n)&&n!==r&&TC(e,n,{get:()=>t[n],enumerable:!(i=SK(t,n))||i.enumerable});return e};var xi=(e,t,r)=>(r=e!=null?wK(MK(e)):{},PK(t||!e||!e.__esModule?TC(r,\"default\",{value:e,enumerable:!0}):r,e));var qF=zr(bi=>{\"use strict\";var Vx=Symbol.for(\"react.element\"),IK=Symbol.for(\"react.portal\"),CK=Symbol.for(\"react.fragment\"),LK=Symbol.for(\"react.strict_mode\"),kK=Symbol.for(\"react.profiler\"),RK=Symbol.for(\"react.provider\"),DK=Symbol.for(\"react.context\"),OK=Symbol.for(\"react.forward_ref\"),BK=Symbol.for(\"react.suspense\"),FK=Symbol.for(\"react.memo\"),zK=Symbol.for(\"react.lazy\"),BF=Symbol.iterator;function NK(e){return e===null||typeof e!=\"object\"?null:(e=BF&&e[BF]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var NF={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},UF=Object.assign,VF={};function __(e,t,r){this.props=e,this.context=t,this.refs=VF,this.updater=r||NF}__.prototype.isReactComponent={};__.prototype.setState=function(e,t){if(typeof e!=\"object\"&&typeof e!=\"function\"&&e!=null)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,e,t,\"setState\")};__.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,\"forceUpdate\")};function jF(){}jF.prototype=__.prototype;function EC(e,t,r){this.props=e,this.context=t,this.refs=VF,this.updater=r||NF}var PC=EC.prototype=new jF;PC.constructor=EC;UF(PC,__.prototype);PC.isPureReactComponent=!0;var FF=Array.isArray,GF=Object.prototype.hasOwnProperty,IC={current:null},WF={key:!0,ref:!0,__self:!0,__source:!0};function HF(e,t,r){var i,n={},s=null,o=null;if(t!=null)for(i in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=\"\"+t.key),t)GF.call(t,i)&&!WF.hasOwnProperty(i)&&(n[i]=t[i]);var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){for(var d=Array(c),_=0;_<c;_++)d[_]=arguments[_+2];n.children=d}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)n[i]===void 0&&(n[i]=c[i]);return{$$typeof:Vx,type:e,key:s,ref:o,props:n,_owner:IC.current}}function UK(e,t){return{$$typeof:Vx,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function CC(e){return typeof e==\"object\"&&e!==null&&e.$$typeof===Vx}function VK(e){var t={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+e.replace(/[=:]/g,function(r){return t[r]})}var zF=/\\/+/g;function MC(e,t){return typeof e==\"object\"&&e!==null&&e.key!=null?VK(\"\"+e.key):t.toString(36)}function KS(e,t,r,i,n){var s=typeof e;(s===\"undefined\"||s===\"boolean\")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case\"string\":case\"number\":o=!0;break;case\"object\":switch(e.$$typeof){case Vx:case IK:o=!0}}if(o)return o=e,n=n(o),e=i===\"\"?\".\"+MC(o,0):i,FF(n)?(r=\"\",e!=null&&(r=e.replace(zF,\"$&/\")+\"/\"),KS(n,t,r,\"\",function(_){return _})):n!=null&&(CC(n)&&(n=UK(n,r+(!n.key||o&&o.key===n.key?\"\":(\"\"+n.key).replace(zF,\"$&/\")+\"/\")+e)),t.push(n)),1;if(o=0,i=i===\"\"?\".\":i+\":\",FF(e))for(var c=0;c<e.length;c++){s=e[c];var d=i+MC(s,c);o+=KS(s,t,r,d,n)}else if(d=NK(e),typeof d==\"function\")for(e=d.call(e),c=0;!(s=e.next()).done;)s=s.value,d=i+MC(s,c++),o+=KS(s,t,r,d,n);else if(s===\"object\")throw t=String(e),Error(\"Objects are not valid as a React child (found: \"+(t===\"[object Object]\"?\"object with keys {\"+Object.keys(e).join(\", \")+\"}\":t)+\"). If you meant to render a collection of children, use an array instead.\");return o}function XS(e,t,r){if(e==null)return e;var i=[],n=0;return KS(e,i,\"\",\"\",function(s){return t.call(r,s,n++)}),i}function jK(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var gl={current:null},JS={transition:null},GK={ReactCurrentDispatcher:gl,ReactCurrentBatchConfig:JS,ReactCurrentOwner:IC};bi.Children={map:XS,forEach:function(e,t,r){XS(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return XS(e,function(){t++}),t},toArray:function(e){return XS(e,function(t){return t})||[]},only:function(e){if(!CC(e))throw Error(\"React.Children.only expected to receive a single React element child.\");return e}};bi.Component=__;bi.Fragment=CK;bi.Profiler=kK;bi.PureComponent=EC;bi.StrictMode=LK;bi.Suspense=BK;bi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=GK;bi.cloneElement=function(e,t,r){if(e==null)throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+e+\".\");var i=UF({},e.props),n=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=IC.current),t.key!==void 0&&(n=\"\"+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(d in t)GF.call(t,d)&&!WF.hasOwnProperty(d)&&(i[d]=t[d]===void 0&&c!==void 0?c[d]:t[d])}var d=arguments.length-2;if(d===1)i.children=r;else if(1<d){c=Array(d);for(var _=0;_<d;_++)c[_]=arguments[_+2];i.children=c}return{$$typeof:Vx,type:e.type,key:n,ref:s,props:i,_owner:o}};bi.createContext=function(e){return e={$$typeof:DK,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:RK,_context:e},e.Consumer=e};bi.createElement=HF;bi.createFactory=function(e){var t=HF.bind(null,e);return t.type=e,t};bi.createRef=function(){return{current:null}};bi.forwardRef=function(e){return{$$typeof:OK,render:e}};bi.isValidElement=CC;bi.lazy=function(e){return{$$typeof:zK,_payload:{_status:-1,_result:e},_init:jK}};bi.memo=function(e,t){return{$$typeof:FK,type:e,compare:t===void 0?null:t}};bi.startTransition=function(e){var t=JS.transition;JS.transition={};try{e()}finally{JS.transition=t}};bi.unstable_act=function(){throw Error(\"act(...) is not supported in production builds of React.\")};bi.useCallback=function(e,t){return gl.current.useCallback(e,t)};bi.useContext=function(e){return gl.current.useContext(e)};bi.useDebugValue=function(){};bi.useDeferredValue=function(e){return gl.current.useDeferredValue(e)};bi.useEffect=function(e,t){return gl.current.useEffect(e,t)};bi.useId=function(){return gl.current.useId()};bi.useImperativeHandle=function(e,t,r){return gl.current.useImperativeHandle(e,t,r)};bi.useInsertionEffect=function(e,t){return gl.current.useInsertionEffect(e,t)};bi.useLayoutEffect=function(e,t){return gl.current.useLayoutEffect(e,t)};bi.useMemo=function(e,t){return gl.current.useMemo(e,t)};bi.useReducer=function(e,t,r){return gl.current.useReducer(e,t,r)};bi.useRef=function(e){return gl.current.useRef(e)};bi.useState=function(e){return gl.current.useState(e)};bi.useSyncExternalStore=function(e,t,r){return gl.current.useSyncExternalStore(e,t,r)};bi.useTransition=function(){return gl.current.useTransition()};bi.version=\"18.2.0\"});var Zi=zr((Fxt,ZF)=>{\"use strict\";ZF.exports=qF()});var i5=zr(Fn=>{\"use strict\";function DC(e,t){var r=e.length;e.push(t);t:for(;0<r;){var i=r-1>>>1,n=e[i];if(0<tT(n,t))e[i]=t,e[r]=n,r=i;else break t}}function yh(e){return e.length===0?null:e[0]}function rT(e){if(e.length===0)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;t:for(var i=0,n=e.length,s=n>>>1;i<s;){var o=2*(i+1)-1,c=e[o],d=o+1,_=e[d];if(0>tT(c,r))d<n&&0>tT(_,c)?(e[i]=_,e[d]=r,i=d):(e[i]=c,e[o]=r,i=o);else if(d<n&&0>tT(_,r))e[i]=_,e[d]=r,i=d;else break t}}return t}function tT(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}typeof performance==\"object\"&&typeof performance.now==\"function\"?(YF=performance,Fn.unstable_now=function(){return YF.now()}):(LC=Date,$F=LC.now(),Fn.unstable_now=function(){return LC.now()-$F});var YF,LC,$F,Of=[],mA=[],WK=1,Mu=null,Ha=3,iT=!1,h0=!1,Gx=!1,KF=typeof setTimeout==\"function\"?setTimeout:null,JF=typeof clearTimeout==\"function\"?clearTimeout:null,QF=typeof setImmediate<\"u\"?setImmediate:null;typeof navigator<\"u\"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function OC(e){for(var t=yh(mA);t!==null;){if(t.callback===null)rT(mA);else if(t.startTime<=e)rT(mA),t.sortIndex=t.expirationTime,DC(Of,t);else break;t=yh(mA)}}function BC(e){if(Gx=!1,OC(e),!h0)if(yh(Of)!==null)h0=!0,zC(FC);else{var t=yh(mA);t!==null&&NC(BC,t.startTime-e)}}function FC(e,t){h0=!1,Gx&&(Gx=!1,JF(Wx),Wx=-1),iT=!0;var r=Ha;try{for(OC(t),Mu=yh(Of);Mu!==null&&(!(Mu.expirationTime>t)||e&&!r5());){var i=Mu.callback;if(typeof i==\"function\"){Mu.callback=null,Ha=Mu.priorityLevel;var n=i(Mu.expirationTime<=t);t=Fn.unstable_now(),typeof n==\"function\"?Mu.callback=n:Mu===yh(Of)&&rT(Of),OC(t)}else rT(Of);Mu=yh(Of)}if(Mu!==null)var s=!0;else{var o=yh(mA);o!==null&&NC(BC,o.startTime-t),s=!1}return s}finally{Mu=null,Ha=r,iT=!1}}var nT=!1,eT=null,Wx=-1,t5=5,e5=-1;function r5(){return!(Fn.unstable_now()-e5<t5)}function kC(){if(eT!==null){var e=Fn.unstable_now();e5=e;var t=!0;try{t=eT(!0,e)}finally{t?jx():(nT=!1,eT=null)}}else nT=!1}var jx;typeof QF==\"function\"?jx=function(){QF(kC)}:typeof MessageChannel<\"u\"?(RC=new MessageChannel,XF=RC.port2,RC.port1.onmessage=kC,jx=function(){XF.postMessage(null)}):jx=function(){KF(kC,0)};var RC,XF;function zC(e){eT=e,nT||(nT=!0,jx())}function NC(e,t){Wx=KF(function(){e(Fn.unstable_now())},t)}Fn.unstable_IdlePriority=5;Fn.unstable_ImmediatePriority=1;Fn.unstable_LowPriority=4;Fn.unstable_NormalPriority=3;Fn.unstable_Profiling=null;Fn.unstable_UserBlockingPriority=2;Fn.unstable_cancelCallback=function(e){e.callback=null};Fn.unstable_continueExecution=function(){h0||iT||(h0=!0,zC(FC))};Fn.unstable_forceFrameRate=function(e){0>e||125<e?console.error(\"forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported\"):t5=0<e?Math.floor(1e3/e):5};Fn.unstable_getCurrentPriorityLevel=function(){return Ha};Fn.unstable_getFirstCallbackNode=function(){return yh(Of)};Fn.unstable_next=function(e){switch(Ha){case 1:case 2:case 3:var t=3;break;default:t=Ha}var r=Ha;Ha=t;try{return e()}finally{Ha=r}};Fn.unstable_pauseExecution=function(){};Fn.unstable_requestPaint=function(){};Fn.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=Ha;Ha=e;try{return t()}finally{Ha=r}};Fn.unstable_scheduleCallback=function(e,t,r){var i=Fn.unstable_now();switch(typeof r==\"object\"&&r!==null?(r=r.delay,r=typeof r==\"number\"&&0<r?i+r:i):r=i,e){case 1:var n=-1;break;case 2:n=250;break;case 5:n=1073741823;break;case 4:n=1e4;break;default:n=5e3}return n=r+n,e={id:WK++,callback:t,priorityLevel:e,startTime:r,expirationTime:n,sortIndex:-1},r>i?(e.sortIndex=r,DC(mA,e),yh(Of)===null&&e===yh(mA)&&(Gx?(JF(Wx),Wx=-1):Gx=!0,NC(BC,r-i))):(e.sortIndex=n,DC(Of,e),h0||iT||(h0=!0,zC(FC))),e};Fn.unstable_shouldYield=r5;Fn.unstable_wrapCallback=function(e){var t=Ha;return function(){var r=Ha;Ha=t;try{return e.apply(this,arguments)}finally{Ha=r}}}});var s5=zr((Nxt,n5)=>{\"use strict\";n5.exports=i5()});var h8=zr(Hc=>{\"use strict\";var fz=Zi(),Gc=s5();function Te(e){for(var t=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+e,r=1;r<arguments.length;r++)t+=\"&args[]=\"+encodeURIComponent(arguments[r]);return\"Minified React error #\"+e+\"; visit \"+t+\" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"}var dz=new Set,f1={};function S0(e,t){N_(e,t),N_(e+\"Capture\",t)}function N_(e,t){for(f1[e]=t,e=0;e<t.length;e++)dz.add(t[e])}var Hd=!(typeof window>\"u\"||typeof window.document>\"u\"||typeof window.document.createElement>\"u\"),lL=Object.prototype.hasOwnProperty,HK=/^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$/,o5={},a5={};function qK(e){return lL.call(a5,e)?!0:lL.call(o5,e)?!1:HK.test(e)?a5[e]=!0:(o5[e]=!0,!1)}function ZK(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case\"function\":case\"symbol\":return!0;case\"boolean\":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!==\"data-\"&&e!==\"aria-\");default:return!1}}function YK(e,t,r,i){if(t===null||typeof t>\"u\"||ZK(e,t,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function vl(e,t,r,i,n,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var ya={};\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(e){ya[e]=new vl(e,0,!1,e,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(e){var t=e[0];ya[t]=new vl(t,1,!1,e[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(e){ya[e]=new vl(e,2,!1,e.toLowerCase(),null,!1,!1)});[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(e){ya[e]=new vl(e,2,!1,e,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(e){ya[e]=new vl(e,3,!1,e.toLowerCase(),null,!1,!1)});[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(e){ya[e]=new vl(e,3,!0,e,null,!1,!1)});[\"capture\",\"download\"].forEach(function(e){ya[e]=new vl(e,4,!1,e,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(e){ya[e]=new vl(e,6,!1,e,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(e){ya[e]=new vl(e,5,!1,e.toLowerCase(),null,!1,!1)});var tk=/[\\-:]([a-z])/g;function ek(e){return e[1].toUpperCase()}\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(e){var t=e.replace(tk,ek);ya[t]=new vl(t,1,!1,e,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(e){var t=e.replace(tk,ek);ya[t]=new vl(t,1,!1,e,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(e){var t=e.replace(tk,ek);ya[t]=new vl(t,1,!1,e,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(e){ya[e]=new vl(e,1,!1,e.toLowerCase(),null,!1,!1)});ya.xlinkHref=new vl(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(e){ya[e]=new vl(e,1,!1,e.toLowerCase(),null,!0,!0)});function rk(e,t,r,i){var n=ya.hasOwnProperty(t)?ya[t]:null;(n!==null?n.type!==0:i||!(2<t.length)||t[0]!==\"o\"&&t[0]!==\"O\"||t[1]!==\"n\"&&t[1]!==\"N\")&&(YK(t,r,n,i)&&(r=null),i||n===null?qK(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,\"\"+r)):n.mustUseProperty?e[n.propertyName]=r===null?n.type===3?!1:\"\":r:(t=n.attributeName,i=n.attributeNamespace,r===null?e.removeAttribute(t):(n=n.type,r=n===3||n===4&&r===!0?\"\":\"\"+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var $d=fz.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,sT=Symbol.for(\"react.element\"),x_=Symbol.for(\"react.portal\"),b_=Symbol.for(\"react.fragment\"),ik=Symbol.for(\"react.strict_mode\"),cL=Symbol.for(\"react.profiler\"),pz=Symbol.for(\"react.provider\"),Az=Symbol.for(\"react.context\"),nk=Symbol.for(\"react.forward_ref\"),uL=Symbol.for(\"react.suspense\"),hL=Symbol.for(\"react.suspense_list\"),sk=Symbol.for(\"react.memo\"),_A=Symbol.for(\"react.lazy\");Symbol.for(\"react.scope\");Symbol.for(\"react.debug_trace_mode\");var mz=Symbol.for(\"react.offscreen\");Symbol.for(\"react.legacy_hidden\");Symbol.for(\"react.cache\");Symbol.for(\"react.tracing_marker\");var l5=Symbol.iterator;function Hx(e){return e===null||typeof e!=\"object\"?null:(e=l5&&e[l5]||e[\"@@iterator\"],typeof e==\"function\"?e:null)}var ps=Object.assign,UC;function Jx(e){if(UC===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\\n( *(at )?)/);UC=t&&t[1]||\"\"}return`\n`+UC+e}var VC=!1;function jC(e,t){if(!e||VC)return\"\";VC=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,\"props\",{set:function(){throw Error()}}),typeof Reflect==\"object\"&&Reflect.construct){try{Reflect.construct(t,[])}catch(_){var i=_}Reflect.construct(e,[],t)}else{try{t.call()}catch(_){i=_}e.call(t.prototype)}else{try{throw Error()}catch(_){i=_}e()}}catch(_){if(_&&i&&typeof _.stack==\"string\"){for(var n=_.stack.split(`\n`),s=i.stack.split(`\n`),o=n.length-1,c=s.length-1;1<=o&&0<=c&&n[o]!==s[c];)c--;for(;1<=o&&0<=c;o--,c--)if(n[o]!==s[c]){if(o!==1||c!==1)do if(o--,c--,0>c||n[o]!==s[c]){var d=`\n`+n[o].replace(\" at new \",\" at \");return e.displayName&&d.includes(\"<anonymous>\")&&(d=d.replace(\"<anonymous>\",e.displayName)),d}while(1<=o&&0<=c);break}}}finally{VC=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:\"\")?Jx(e):\"\"}function $K(e){switch(e.tag){case 5:return Jx(e.type);case 16:return Jx(\"Lazy\");case 13:return Jx(\"Suspense\");case 19:return Jx(\"SuspenseList\");case 0:case 2:case 15:return e=jC(e.type,!1),e;case 11:return e=jC(e.type.render,!1),e;case 1:return e=jC(e.type,!0),e;default:return\"\"}}function fL(e){if(e==null)return null;if(typeof e==\"function\")return e.displayName||e.name||null;if(typeof e==\"string\")return e;switch(e){case b_:return\"Fragment\";case x_:return\"Portal\";case cL:return\"Profiler\";case ik:return\"StrictMode\";case uL:return\"Suspense\";case hL:return\"SuspenseList\"}if(typeof e==\"object\")switch(e.$$typeof){case Az:return(e.displayName||\"Context\")+\".Consumer\";case pz:return(e._context.displayName||\"Context\")+\".Provider\";case nk:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||\"\",e=e!==\"\"?\"ForwardRef(\"+e+\")\":\"ForwardRef\"),e;case sk:return t=e.displayName||null,t!==null?t:fL(e.type)||\"Memo\";case _A:t=e._payload,e=e._init;try{return fL(e(t))}catch{}}return null}function QK(e){var t=e.type;switch(e.tag){case 24:return\"Cache\";case 9:return(t.displayName||\"Context\")+\".Consumer\";case 10:return(t._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return e=t.render,e=e.displayName||e.name||\"\",t.displayName||(e!==\"\"?\"ForwardRef(\"+e+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return t;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return fL(t);case 8:return t===ik?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";case 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==\"function\")return t.displayName||t.name||null;if(typeof t==\"string\")return t}return null}function kA(e){switch(typeof e){case\"boolean\":case\"number\":case\"string\":case\"undefined\":return e;case\"object\":return e;default:return\"\"}}function gz(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===\"input\"&&(t===\"checkbox\"||t===\"radio\")}function XK(e){var t=gz(e)?\"checked\":\"value\",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=\"\"+e[t];if(!e.hasOwnProperty(t)&&typeof r<\"u\"&&typeof r.get==\"function\"&&typeof r.set==\"function\"){var n=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(o){i=\"\"+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(o){i=\"\"+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function oT(e){e._valueTracker||(e._valueTracker=XK(e))}function _z(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i=\"\";return e&&(i=gz(e)?e.checked?\"true\":\"false\":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function DT(e){if(e=e||(typeof document<\"u\"?document:void 0),typeof e>\"u\")return null;try{return e.activeElement||e.body}catch{return e.body}}function dL(e,t){var r=t.checked;return ps({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function c5(e,t){var r=t.defaultValue==null?\"\":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=kA(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type===\"checkbox\"||t.type===\"radio\"?t.checked!=null:t.value!=null}}function yz(e,t){t=t.checked,t!=null&&rk(e,\"checked\",t,!1)}function pL(e,t){yz(e,t);var r=kA(t.value),i=t.type;if(r!=null)i===\"number\"?(r===0&&e.value===\"\"||e.value!=r)&&(e.value=\"\"+r):e.value!==\"\"+r&&(e.value=\"\"+r);else if(i===\"submit\"||i===\"reset\"){e.removeAttribute(\"value\");return}t.hasOwnProperty(\"value\")?AL(e,t.type,r):t.hasOwnProperty(\"defaultValue\")&&AL(e,t.type,kA(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function u5(e,t,r){if(t.hasOwnProperty(\"value\")||t.hasOwnProperty(\"defaultValue\")){var i=t.type;if(!(i!==\"submit\"&&i!==\"reset\"||t.value!==void 0&&t.value!==null))return;t=\"\"+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==\"\"&&(e.name=\"\"),e.defaultChecked=!!e._wrapperState.initialChecked,r!==\"\"&&(e.name=r)}function AL(e,t,r){(t!==\"number\"||DT(e.ownerDocument)!==e)&&(r==null?e.defaultValue=\"\"+e._wrapperState.initialValue:e.defaultValue!==\"\"+r&&(e.defaultValue=\"\"+r))}var t1=Array.isArray;function R_(e,t,r,i){if(e=e.options,t){t={};for(var n=0;n<r.length;n++)t[\"$\"+r[n]]=!0;for(r=0;r<e.length;r++)n=t.hasOwnProperty(\"$\"+e[r].value),e[r].selected!==n&&(e[r].selected=n),n&&i&&(e[r].defaultSelected=!0)}else{for(r=\"\"+kA(r),t=null,n=0;n<e.length;n++){if(e[n].value===r){e[n].selected=!0,i&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function mL(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Te(91));return ps({},t,{value:void 0,defaultValue:void 0,children:\"\"+e._wrapperState.initialValue})}function h5(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(Te(92));if(t1(r)){if(1<r.length)throw Error(Te(93));r=r[0]}t=r}t==null&&(t=\"\"),r=t}e._wrapperState={initialValue:kA(r)}}function vz(e,t){var r=kA(t.value),i=kA(t.defaultValue);r!=null&&(r=\"\"+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=\"\"+i)}function f5(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==\"\"&&t!==null&&(e.value=t)}function xz(e){switch(e){case\"svg\":return\"http://www.w3.org/2000/svg\";case\"math\":return\"http://www.w3.org/1998/Math/MathML\";default:return\"http://www.w3.org/1999/xhtml\"}}function gL(e,t){return e==null||e===\"http://www.w3.org/1999/xhtml\"?xz(t):e===\"http://www.w3.org/2000/svg\"&&t===\"foreignObject\"?\"http://www.w3.org/1999/xhtml\":e}var aT,bz=function(e){return typeof MSApp<\"u\"&&MSApp.execUnsafeLocalFunction?function(t,r,i,n){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,n)})}:e}(function(e,t){if(e.namespaceURI!==\"http://www.w3.org/2000/svg\"||\"innerHTML\"in e)e.innerHTML=t;else{for(aT=aT||document.createElement(\"div\"),aT.innerHTML=\"<svg>\"+t.valueOf().toString()+\"</svg>\",t=aT.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function d1(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var i1={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},KK=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(i1).forEach(function(e){KK.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),i1[t]=i1[e]})});function wz(e,t,r){return t==null||typeof t==\"boolean\"||t===\"\"?\"\":r||typeof t!=\"number\"||t===0||i1.hasOwnProperty(e)&&i1[e]?(\"\"+t).trim():t+\"px\"}function Sz(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf(\"--\")===0,n=wz(r,t[r],i);r===\"float\"&&(r=\"cssFloat\"),i?e.setProperty(r,n):e[r]=n}}var JK=ps({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _L(e,t){if(t){if(JK[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Te(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Te(60));if(typeof t.dangerouslySetInnerHTML!=\"object\"||!(\"__html\"in t.dangerouslySetInnerHTML))throw Error(Te(61))}if(t.style!=null&&typeof t.style!=\"object\")throw Error(Te(62))}}function yL(e,t){if(e.indexOf(\"-\")===-1)return typeof t.is==\"string\";switch(e){case\"annotation-xml\":case\"color-profile\":case\"font-face\":case\"font-face-src\":case\"font-face-uri\":case\"font-face-format\":case\"font-face-name\":case\"missing-glyph\":return!1;default:return!0}}var vL=null;function ok(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xL=null,D_=null,O_=null;function d5(e){if(e=L1(e)){if(typeof xL!=\"function\")throw Error(Te(280));var t=e.stateNode;t&&(t=lM(t),xL(e.stateNode,e.type,t))}}function Tz(e){D_?O_?O_.push(e):O_=[e]:D_=e}function Mz(){if(D_){var e=D_,t=O_;if(O_=D_=null,d5(e),t)for(e=0;e<t.length;e++)d5(t[e])}}function Ez(e,t){return e(t)}function Pz(){}var GC=!1;function Iz(e,t,r){if(GC)return e(t,r);GC=!0;try{return Ez(e,t,r)}finally{GC=!1,(D_!==null||O_!==null)&&(Pz(),Mz())}}function p1(e,t){var r=e.stateNode;if(r===null)return null;var i=lM(r);if(i===null)return null;r=i[t];t:switch(t){case\"onClick\":case\"onClickCapture\":case\"onDoubleClick\":case\"onDoubleClickCapture\":case\"onMouseDown\":case\"onMouseDownCapture\":case\"onMouseMove\":case\"onMouseMoveCapture\":case\"onMouseUp\":case\"onMouseUpCapture\":case\"onMouseEnter\":(i=!i.disabled)||(e=e.type,i=!(e===\"button\"||e===\"input\"||e===\"select\"||e===\"textarea\")),e=!i;break t;default:e=!1}if(e)return null;if(r&&typeof r!=\"function\")throw Error(Te(231,t,typeof r));return r}var bL=!1;if(Hd)try{y_={},Object.defineProperty(y_,\"passive\",{get:function(){bL=!0}}),window.addEventListener(\"test\",y_,y_),window.removeEventListener(\"test\",y_,y_)}catch{bL=!1}var y_;function tJ(e,t,r,i,n,s,o,c,d){var _=Array.prototype.slice.call(arguments,3);try{t.apply(r,_)}catch(w){this.onError(w)}}var n1=!1,OT=null,BT=!1,wL=null,eJ={onError:function(e){n1=!0,OT=e}};function rJ(e,t,r,i,n,s,o,c,d){n1=!1,OT=null,tJ.apply(eJ,arguments)}function iJ(e,t,r,i,n,s,o,c,d){if(rJ.apply(this,arguments),n1){if(n1){var _=OT;n1=!1,OT=null}else throw Error(Te(198));BT||(BT=!0,wL=_)}}function T0(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Cz(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p5(e){if(T0(e)!==e)throw Error(Te(188))}function nJ(e){var t=e.alternate;if(!t){if(t=T0(e),t===null)throw Error(Te(188));return t!==e?null:e}for(var r=e,i=t;;){var n=r.return;if(n===null)break;var s=n.alternate;if(s===null){if(i=n.return,i!==null){r=i;continue}break}if(n.child===s.child){for(s=n.child;s;){if(s===r)return p5(n),e;if(s===i)return p5(n),t;s=s.sibling}throw Error(Te(188))}if(r.return!==i.return)r=n,i=s;else{for(var o=!1,c=n.child;c;){if(c===r){o=!0,r=n,i=s;break}if(c===i){o=!0,i=n,r=s;break}c=c.sibling}if(!o){for(c=s.child;c;){if(c===r){o=!0,r=s,i=n;break}if(c===i){o=!0,i=s,r=n;break}c=c.sibling}if(!o)throw Error(Te(189))}}if(r.alternate!==i)throw Error(Te(190))}if(r.tag!==3)throw Error(Te(188));return r.stateNode.current===r?e:t}function Lz(e){return e=nJ(e),e!==null?kz(e):null}function kz(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=kz(e);if(t!==null)return t;e=e.sibling}return null}var Rz=Gc.unstable_scheduleCallback,A5=Gc.unstable_cancelCallback,sJ=Gc.unstable_shouldYield,oJ=Gc.unstable_requestPaint,$s=Gc.unstable_now,aJ=Gc.unstable_getCurrentPriorityLevel,ak=Gc.unstable_ImmediatePriority,Dz=Gc.unstable_UserBlockingPriority,FT=Gc.unstable_NormalPriority,lJ=Gc.unstable_LowPriority,Oz=Gc.unstable_IdlePriority,nM=null,Nf=null;function cJ(e){if(Nf&&typeof Nf.onCommitFiberRoot==\"function\")try{Nf.onCommitFiberRoot(nM,e,void 0,(e.current.flags&128)===128)}catch{}}var Sh=Math.clz32?Math.clz32:fJ,uJ=Math.log,hJ=Math.LN2;function fJ(e){return e>>>=0,e===0?32:31-(uJ(e)/hJ|0)|0}var lT=64,cT=4194304;function e1(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zT(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,n=e.suspendedLanes,s=e.pingedLanes,o=r&268435455;if(o!==0){var c=o&~n;c!==0?i=e1(c):(s&=o,s!==0&&(i=e1(s)))}else o=r&~n,o!==0?i=e1(o):s!==0&&(i=e1(s));if(i===0)return 0;if(t!==0&&t!==i&&!(t&n)&&(n=i&-i,s=t&-t,n>=s||n===16&&(s&4194240)!==0))return t;if(i&4&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-Sh(t),n=1<<r,i|=e[r],t&=~n;return i}function dJ(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pJ(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,n=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Sh(s),c=1<<o,d=n[o];d===-1?(!(c&r)||c&i)&&(n[o]=dJ(c,t)):d<=t&&(e.expiredLanes|=c),s&=~c}}function SL(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Bz(){var e=lT;return lT<<=1,!(lT&4194240)&&(lT=64),e}function WC(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function I1(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Sh(t),e[t]=r}function AJ(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<r;){var n=31-Sh(r),s=1<<n;t[n]=0,i[n]=-1,e[n]=-1,r&=~s}}function lk(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-Sh(r),n=1<<i;n&t|e[i]&t&&(e[i]|=t),r&=~n}}var cn=0;function Fz(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var zz,ck,Nz,Uz,Vz,TL=!1,uT=[],SA=null,TA=null,MA=null,A1=new Map,m1=new Map,vA=[],mJ=\"mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit\".split(\" \");function m5(e,t){switch(e){case\"focusin\":case\"focusout\":SA=null;break;case\"dragenter\":case\"dragleave\":TA=null;break;case\"mouseover\":case\"mouseout\":MA=null;break;case\"pointerover\":case\"pointerout\":A1.delete(t.pointerId);break;case\"gotpointercapture\":case\"lostpointercapture\":m1.delete(t.pointerId)}}function qx(e,t,r,i,n,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:s,targetContainers:[n]},t!==null&&(t=L1(t),t!==null&&ck(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function gJ(e,t,r,i,n){switch(t){case\"focusin\":return SA=qx(SA,e,t,r,i,n),!0;case\"dragenter\":return TA=qx(TA,e,t,r,i,n),!0;case\"mouseover\":return MA=qx(MA,e,t,r,i,n),!0;case\"pointerover\":var s=n.pointerId;return A1.set(s,qx(A1.get(s)||null,e,t,r,i,n)),!0;case\"gotpointercapture\":return s=n.pointerId,m1.set(s,qx(m1.get(s)||null,e,t,r,i,n)),!0}return!1}function jz(e){var t=p0(e.target);if(t!==null){var r=T0(t);if(r!==null){if(t=r.tag,t===13){if(t=Cz(r),t!==null){e.blockedOn=t,Vz(e.priority,function(){Nz(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ST(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=ML(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);vL=i,r.target.dispatchEvent(i),vL=null}else return t=L1(r),t!==null&&ck(t),e.blockedOn=r,!1;t.shift()}return!0}function g5(e,t,r){ST(e)&&r.delete(t)}function _J(){TL=!1,SA!==null&&ST(SA)&&(SA=null),TA!==null&&ST(TA)&&(TA=null),MA!==null&&ST(MA)&&(MA=null),A1.forEach(g5),m1.forEach(g5)}function Zx(e,t){e.blockedOn===t&&(e.blockedOn=null,TL||(TL=!0,Gc.unstable_scheduleCallback(Gc.unstable_NormalPriority,_J)))}function g1(e){function t(n){return Zx(n,e)}if(0<uT.length){Zx(uT[0],e);for(var r=1;r<uT.length;r++){var i=uT[r];i.blockedOn===e&&(i.blockedOn=null)}}for(SA!==null&&Zx(SA,e),TA!==null&&Zx(TA,e),MA!==null&&Zx(MA,e),A1.forEach(t),m1.forEach(t),r=0;r<vA.length;r++)i=vA[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<vA.length&&(r=vA[0],r.blockedOn===null);)jz(r),r.blockedOn===null&&vA.shift()}var B_=$d.ReactCurrentBatchConfig,NT=!0;function yJ(e,t,r,i){var n=cn,s=B_.transition;B_.transition=null;try{cn=1,uk(e,t,r,i)}finally{cn=n,B_.transition=s}}function vJ(e,t,r,i){var n=cn,s=B_.transition;B_.transition=null;try{cn=4,uk(e,t,r,i)}finally{cn=n,B_.transition=s}}function uk(e,t,r,i){if(NT){var n=ML(e,t,r,i);if(n===null)XC(e,t,i,UT,r),m5(e,i);else if(gJ(n,e,t,r,i))i.stopPropagation();else if(m5(e,i),t&4&&-1<mJ.indexOf(e)){for(;n!==null;){var s=L1(n);if(s!==null&&zz(s),s=ML(e,t,r,i),s===null&&XC(e,t,i,UT,r),s===n)break;n=s}n!==null&&i.stopPropagation()}else XC(e,t,i,null,r)}}var UT=null;function ML(e,t,r,i){if(UT=null,e=ok(i),e=p0(e),e!==null)if(t=T0(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Cz(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return UT=e,null}function Gz(e){switch(e){case\"cancel\":case\"click\":case\"close\":case\"contextmenu\":case\"copy\":case\"cut\":case\"auxclick\":case\"dblclick\":case\"dragend\":case\"dragstart\":case\"drop\":case\"focusin\":case\"focusout\":case\"input\":case\"invalid\":case\"keydown\":case\"keypress\":case\"keyup\":case\"mousedown\":case\"mouseup\":case\"paste\":case\"pause\":case\"play\":case\"pointercancel\":case\"pointerdown\":case\"pointerup\":case\"ratechange\":case\"reset\":case\"resize\":case\"seeked\":case\"submit\":case\"touchcancel\":case\"touchend\":case\"touchstart\":case\"volumechange\":case\"change\":case\"selectionchange\":case\"textInput\":case\"compositionstart\":case\"compositionend\":case\"compositionupdate\":case\"beforeblur\":case\"afterblur\":case\"beforeinput\":case\"blur\":case\"fullscreenchange\":case\"focus\":case\"hashchange\":case\"popstate\":case\"select\":case\"selectstart\":return 1;case\"drag\":case\"dragenter\":case\"dragexit\":case\"dragleave\":case\"dragover\":case\"mousemove\":case\"mouseout\":case\"mouseover\":case\"pointermove\":case\"pointerout\":case\"pointerover\":case\"scroll\":case\"toggle\":case\"touchmove\":case\"wheel\":case\"mouseenter\":case\"mouseleave\":case\"pointerenter\":case\"pointerleave\":return 4;case\"message\":switch(aJ()){case ak:return 1;case Dz:return 4;case FT:case lJ:return 16;case Oz:return 536870912;default:return 16}default:return 16}}var bA=null,hk=null,TT=null;function Wz(){if(TT)return TT;var e,t=hk,r=t.length,i,n=\"value\"in bA?bA.value:bA.textContent,s=n.length;for(e=0;e<r&&t[e]===n[e];e++);var o=r-e;for(i=1;i<=o&&t[r-i]===n[s-i];i++);return TT=n.slice(e,1<i?1-i:void 0)}function MT(e){var t=e.keyCode;return\"charCode\"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function hT(){return!0}function _5(){return!1}function Wc(e){function t(r,i,n,s,o){this._reactName=r,this._targetInst=n,this.type=i,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var c in e)e.hasOwnProperty(c)&&(r=e[c],this[c]=r?r(s):s[c]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?hT:_5,this.isPropagationStopped=_5,this}return ps(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!=\"unknown\"&&(r.returnValue=!1),this.isDefaultPrevented=hT)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!=\"unknown\"&&(r.cancelBubble=!0),this.isPropagationStopped=hT)},persist:function(){},isPersistent:hT}),t}var q_={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fk=Wc(q_),C1=ps({},q_,{view:0,detail:0}),xJ=Wc(C1),HC,qC,Yx,sM=ps({},C1,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dk,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return\"movementX\"in e?e.movementX:(e!==Yx&&(Yx&&e.type===\"mousemove\"?(HC=e.screenX-Yx.screenX,qC=e.screenY-Yx.screenY):qC=HC=0,Yx=e),HC)},movementY:function(e){return\"movementY\"in e?e.movementY:qC}}),y5=Wc(sM),bJ=ps({},sM,{dataTransfer:0}),wJ=Wc(bJ),SJ=ps({},C1,{relatedTarget:0}),ZC=Wc(SJ),TJ=ps({},q_,{animationName:0,elapsedTime:0,pseudoElement:0}),MJ=Wc(TJ),EJ=ps({},q_,{clipboardData:function(e){return\"clipboardData\"in e?e.clipboardData:window.clipboardData}}),PJ=Wc(EJ),IJ=ps({},q_,{data:0}),v5=Wc(IJ),CJ={Esc:\"Escape\",Spacebar:\" \",Left:\"ArrowLeft\",Up:\"ArrowUp\",Right:\"ArrowRight\",Down:\"ArrowDown\",Del:\"Delete\",Win:\"OS\",Menu:\"ContextMenu\",Apps:\"ContextMenu\",Scroll:\"ScrollLock\",MozPrintableKey:\"Unidentified\"},LJ={8:\"Backspace\",9:\"Tab\",12:\"Clear\",13:\"Enter\",16:\"Shift\",17:\"Control\",18:\"Alt\",19:\"Pause\",20:\"CapsLock\",27:\"Escape\",32:\" \",33:\"PageUp\",34:\"PageDown\",35:\"End\",36:\"Home\",37:\"ArrowLeft\",38:\"ArrowUp\",39:\"ArrowRight\",40:\"ArrowDown\",45:\"Insert\",46:\"Delete\",112:\"F1\",113:\"F2\",114:\"F3\",115:\"F4\",116:\"F5\",117:\"F6\",118:\"F7\",119:\"F8\",120:\"F9\",121:\"F10\",122:\"F11\",123:\"F12\",144:\"NumLock\",145:\"ScrollLock\",224:\"Meta\"},kJ={Alt:\"altKey\",Control:\"ctrlKey\",Meta:\"metaKey\",Shift:\"shiftKey\"};function RJ(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kJ[e])?!!t[e]:!1}function dk(){return RJ}var DJ=ps({},C1,{key:function(e){if(e.key){var t=CJ[e.key]||e.key;if(t!==\"Unidentified\")return t}return e.type===\"keypress\"?(e=MT(e),e===13?\"Enter\":String.fromCharCode(e)):e.type===\"keydown\"||e.type===\"keyup\"?LJ[e.keyCode]||\"Unidentified\":\"\"},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dk,charCode:function(e){return e.type===\"keypress\"?MT(e):0},keyCode:function(e){return e.type===\"keydown\"||e.type===\"keyup\"?e.keyCode:0},which:function(e){return e.type===\"keypress\"?MT(e):e.type===\"keydown\"||e.type===\"keyup\"?e.keyCode:0}}),OJ=Wc(DJ),BJ=ps({},sM,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),x5=Wc(BJ),FJ=ps({},C1,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dk}),zJ=Wc(FJ),NJ=ps({},q_,{propertyName:0,elapsedTime:0,pseudoElement:0}),UJ=Wc(NJ),VJ=ps({},sM,{deltaX:function(e){return\"deltaX\"in e?e.deltaX:\"wheelDeltaX\"in e?-e.wheelDeltaX:0},deltaY:function(e){return\"deltaY\"in e?e.deltaY:\"wheelDeltaY\"in e?-e.wheelDeltaY:\"wheelDelta\"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),jJ=Wc(VJ),GJ=[9,13,27,32],pk=Hd&&\"CompositionEvent\"in window,s1=null;Hd&&\"documentMode\"in document&&(s1=document.documentMode);var WJ=Hd&&\"TextEvent\"in window&&!s1,Hz=Hd&&(!pk||s1&&8<s1&&11>=s1),b5=\" \",w5=!1;function qz(e,t){switch(e){case\"keyup\":return GJ.indexOf(t.keyCode)!==-1;case\"keydown\":return t.keyCode!==229;case\"keypress\":case\"mousedown\":case\"focusout\":return!0;default:return!1}}function Zz(e){return e=e.detail,typeof e==\"object\"&&\"data\"in e?e.data:null}var w_=!1;function HJ(e,t){switch(e){case\"compositionend\":return Zz(t);case\"keypress\":return t.which!==32?null:(w5=!0,b5);case\"textInput\":return e=t.data,e===b5&&w5?null:e;default:return null}}function qJ(e,t){if(w_)return e===\"compositionend\"||!pk&&qz(e,t)?(e=Wz(),TT=hk=bA=null,w_=!1,e):null;switch(e){case\"paste\":return null;case\"keypress\":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case\"compositionend\":return Hz&&t.locale!==\"ko\"?null:t.data;default:return null}}var ZJ={color:!0,date:!0,datetime:!0,\"datetime-local\":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function S5(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===\"input\"?!!ZJ[e.type]:t===\"textarea\"}function Yz(e,t,r,i){Tz(i),t=VT(t,\"onChange\"),0<t.length&&(r=new fk(\"onChange\",\"change\",null,r,i),e.push({event:r,listeners:t}))}var o1=null,_1=null;function YJ(e){sN(e,0)}function oM(e){var t=M_(e);if(_z(t))return e}function $J(e,t){if(e===\"change\")return t}var $z=!1;Hd&&(Hd?(dT=\"oninput\"in document,dT||(YC=document.createElement(\"div\"),YC.setAttribute(\"oninput\",\"return;\"),dT=typeof YC.oninput==\"function\"),fT=dT):fT=!1,$z=fT&&(!document.documentMode||9<document.documentMode));var fT,dT,YC;function T5(){o1&&(o1.detachEvent(\"onpropertychange\",Qz),_1=o1=null)}function Qz(e){if(e.propertyName===\"value\"&&oM(_1)){var t=[];Yz(t,_1,e,ok(e)),Iz(YJ,t)}}function QJ(e,t,r){e===\"focusin\"?(T5(),o1=t,_1=r,o1.attachEvent(\"onpropertychange\",Qz)):e===\"focusout\"&&T5()}function XJ(e){if(e===\"selectionchange\"||e===\"keyup\"||e===\"keydown\")return oM(_1)}function KJ(e,t){if(e===\"click\")return oM(t)}function JJ(e,t){if(e===\"input\"||e===\"change\")return oM(t)}function ttt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mh=typeof Object.is==\"function\"?Object.is:ttt;function y1(e,t){if(Mh(e,t))return!0;if(typeof e!=\"object\"||e===null||typeof t!=\"object\"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var n=r[i];if(!lL.call(t,n)||!Mh(e[n],t[n]))return!1}return!0}function M5(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function E5(e,t){var r=M5(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}t:{for(;r;){if(r.nextSibling){r=r.nextSibling;break t}r=r.parentNode}r=void 0}r=M5(r)}}function Xz(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xz(e,t.parentNode):\"contains\"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kz(){for(var e=window,t=DT();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href==\"string\"}catch{r=!1}if(r)e=t.contentWindow;else break;t=DT(e.document)}return t}function Ak(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===\"input\"&&(e.type===\"text\"||e.type===\"search\"||e.type===\"tel\"||e.type===\"url\"||e.type===\"password\")||t===\"textarea\"||e.contentEditable===\"true\")}function ett(e){var t=Kz(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Xz(r.ownerDocument.documentElement,r)){if(i!==null&&Ak(r)){if(t=i.start,e=i.end,e===void 0&&(e=t),\"selectionStart\"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var n=r.textContent.length,s=Math.min(i.start,n);i=i.end===void 0?s:Math.min(i.end,n),!e.extend&&s>i&&(n=i,i=s,s=n),n=E5(r,s);var o=E5(r,i);n&&o&&(e.rangeCount!==1||e.anchorNode!==n.node||e.anchorOffset!==n.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(n.node,n.offset),e.removeAllRanges(),s>i?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus==\"function\"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var rtt=Hd&&\"documentMode\"in document&&11>=document.documentMode,S_=null,EL=null,a1=null,PL=!1;function P5(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;PL||S_==null||S_!==DT(i)||(i=S_,\"selectionStart\"in i&&Ak(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),a1&&y1(a1,i)||(a1=i,i=VT(EL,\"onSelect\"),0<i.length&&(t=new fk(\"onSelect\",\"select\",null,t,r),e.push({event:t,listeners:i}),t.target=S_)))}function pT(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r[\"Webkit\"+e]=\"webkit\"+t,r[\"Moz\"+e]=\"moz\"+t,r}var T_={animationend:pT(\"Animation\",\"AnimationEnd\"),animationiteration:pT(\"Animation\",\"AnimationIteration\"),animationstart:pT(\"Animation\",\"AnimationStart\"),transitionend:pT(\"Transition\",\"TransitionEnd\")},$C={},Jz={};Hd&&(Jz=document.createElement(\"div\").style,\"AnimationEvent\"in window||(delete T_.animationend.animation,delete T_.animationiteration.animation,delete T_.animationstart.animation),\"TransitionEvent\"in window||delete T_.transitionend.transition);function aM(e){if($C[e])return $C[e];if(!T_[e])return e;var t=T_[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Jz)return $C[e]=t[r];return e}var tN=aM(\"animationend\"),eN=aM(\"animationiteration\"),rN=aM(\"animationstart\"),iN=aM(\"transitionend\"),nN=new Map,I5=\"abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel\".split(\" \");function DA(e,t){nN.set(e,t),S0(t,[e])}for(AT=0;AT<I5.length;AT++)mT=I5[AT],C5=mT.toLowerCase(),L5=mT[0].toUpperCase()+mT.slice(1),DA(C5,\"on\"+L5);var mT,C5,L5,AT;DA(tN,\"onAnimationEnd\");DA(eN,\"onAnimationIteration\");DA(rN,\"onAnimationStart\");DA(\"dblclick\",\"onDoubleClick\");DA(\"focusin\",\"onFocus\");DA(\"focusout\",\"onBlur\");DA(iN,\"onTransitionEnd\");N_(\"onMouseEnter\",[\"mouseout\",\"mouseover\"]);N_(\"onMouseLeave\",[\"mouseout\",\"mouseover\"]);N_(\"onPointerEnter\",[\"pointerout\",\"pointerover\"]);N_(\"onPointerLeave\",[\"pointerout\",\"pointerover\"]);S0(\"onChange\",\"change click focusin focusout input keydown keyup selectionchange\".split(\" \"));S0(\"onSelect\",\"focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange\".split(\" \"));S0(\"onBeforeInput\",[\"compositionend\",\"keypress\",\"textInput\",\"paste\"]);S0(\"onCompositionEnd\",\"compositionend focusout keydown keypress keyup mousedown\".split(\" \"));S0(\"onCompositionStart\",\"compositionstart focusout keydown keypress keyup mousedown\".split(\" \"));S0(\"onCompositionUpdate\",\"compositionupdate focusout keydown keypress keyup mousedown\".split(\" \"));var r1=\"abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting\".split(\" \"),itt=new Set(\"cancel close invalid load scroll toggle\".split(\" \").concat(r1));function k5(e,t,r){var i=e.type||\"unknown-event\";e.currentTarget=r,iJ(i,t,void 0,e),e.currentTarget=null}function sN(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],n=i.event;i=i.listeners;t:{var s=void 0;if(t)for(var o=i.length-1;0<=o;o--){var c=i[o],d=c.instance,_=c.currentTarget;if(c=c.listener,d!==s&&n.isPropagationStopped())break t;k5(n,c,_),s=d}else for(o=0;o<i.length;o++){if(c=i[o],d=c.instance,_=c.currentTarget,c=c.listener,d!==s&&n.isPropagationStopped())break t;k5(n,c,_),s=d}}}if(BT)throw e=wL,BT=!1,wL=null,e}function Yn(e,t){var r=t[RL];r===void 0&&(r=t[RL]=new Set);var i=e+\"__bubble\";r.has(i)||(oN(t,e,2,!1),r.add(i))}function QC(e,t,r){var i=0;t&&(i|=4),oN(r,e,i,t)}var gT=\"_reactListening\"+Math.random().toString(36).slice(2);function v1(e){if(!e[gT]){e[gT]=!0,dz.forEach(function(r){r!==\"selectionchange\"&&(itt.has(r)||QC(r,!1,e),QC(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[gT]||(t[gT]=!0,QC(\"selectionchange\",!1,t))}}function oN(e,t,r,i){switch(Gz(t)){case 1:var n=yJ;break;case 4:n=vJ;break;default:n=uk}r=n.bind(null,t,r,e),n=void 0,!bL||t!==\"touchstart\"&&t!==\"touchmove\"&&t!==\"wheel\"||(n=!0),i?n!==void 0?e.addEventListener(t,r,{capture:!0,passive:n}):e.addEventListener(t,r,!0):n!==void 0?e.addEventListener(t,r,{passive:n}):e.addEventListener(t,r,!1)}function XC(e,t,r,i,n){var s=i;if(!(t&1)&&!(t&2)&&i!==null)t:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var c=i.stateNode.containerInfo;if(c===n||c.nodeType===8&&c.parentNode===n)break;if(o===4)for(o=i.return;o!==null;){var d=o.tag;if((d===3||d===4)&&(d=o.stateNode.containerInfo,d===n||d.nodeType===8&&d.parentNode===n))return;o=o.return}for(;c!==null;){if(o=p0(c),o===null)return;if(d=o.tag,d===5||d===6){i=s=o;continue t}c=c.parentNode}}i=i.return}Iz(function(){var _=s,w=ok(r),I=[];t:{var R=nN.get(e);if(R!==void 0){var N=fk,j=e;switch(e){case\"keypress\":if(MT(r)===0)break t;case\"keydown\":case\"keyup\":N=OJ;break;case\"focusin\":j=\"focus\",N=ZC;break;case\"focusout\":j=\"blur\",N=ZC;break;case\"beforeblur\":case\"afterblur\":N=ZC;break;case\"click\":if(r.button===2)break t;case\"auxclick\":case\"dblclick\":case\"mousedown\":case\"mousemove\":case\"mouseup\":case\"mouseout\":case\"mouseover\":case\"contextmenu\":N=y5;break;case\"drag\":case\"dragend\":case\"dragenter\":case\"dragexit\":case\"dragleave\":case\"dragover\":case\"dragstart\":case\"drop\":N=wJ;break;case\"touchcancel\":case\"touchend\":case\"touchmove\":case\"touchstart\":N=zJ;break;case tN:case eN:case rN:N=MJ;break;case iN:N=UJ;break;case\"scroll\":N=xJ;break;case\"wheel\":N=jJ;break;case\"copy\":case\"cut\":case\"paste\":N=PJ;break;case\"gotpointercapture\":case\"lostpointercapture\":case\"pointercancel\":case\"pointerdown\":case\"pointermove\":case\"pointerout\":case\"pointerover\":case\"pointerup\":N=x5}var Y=(t&4)!==0,it=!Y&&e===\"scroll\",Z=Y?R!==null?R+\"Capture\":null:R;Y=[];for(var K=_,J;K!==null;){J=K;var ht=J.stateNode;if(J.tag===5&&ht!==null&&(J=ht,Z!==null&&(ht=p1(K,Z),ht!=null&&Y.push(x1(K,ht,J)))),it)break;K=K.return}0<Y.length&&(R=new N(R,j,null,r,w),I.push({event:R,listeners:Y}))}}if(!(t&7)){t:{if(R=e===\"mouseover\"||e===\"pointerover\",N=e===\"mouseout\"||e===\"pointerout\",R&&r!==vL&&(j=r.relatedTarget||r.fromElement)&&(p0(j)||j[qd]))break t;if((N||R)&&(R=w.window===w?w:(R=w.ownerDocument)?R.defaultView||R.parentWindow:window,N?(j=r.relatedTarget||r.toElement,N=_,j=j?p0(j):null,j!==null&&(it=T0(j),j!==it||j.tag!==5&&j.tag!==6)&&(j=null)):(N=null,j=_),N!==j)){if(Y=y5,ht=\"onMouseLeave\",Z=\"onMouseEnter\",K=\"mouse\",(e===\"pointerout\"||e===\"pointerover\")&&(Y=x5,ht=\"onPointerLeave\",Z=\"onPointerEnter\",K=\"pointer\"),it=N==null?R:M_(N),J=j==null?R:M_(j),R=new Y(ht,K+\"leave\",N,r,w),R.target=it,R.relatedTarget=J,ht=null,p0(w)===_&&(Y=new Y(Z,K+\"enter\",j,r,w),Y.target=J,Y.relatedTarget=it,ht=Y),it=ht,N&&j)e:{for(Y=N,Z=j,K=0,J=Y;J;J=v_(J))K++;for(J=0,ht=Z;ht;ht=v_(ht))J++;for(;0<K-J;)Y=v_(Y),K--;for(;0<J-K;)Z=v_(Z),J--;for(;K--;){if(Y===Z||Z!==null&&Y===Z.alternate)break e;Y=v_(Y),Z=v_(Z)}Y=null}else Y=null;N!==null&&R5(I,R,N,Y,!1),j!==null&&it!==null&&R5(I,it,j,Y,!0)}}t:{if(R=_?M_(_):window,N=R.nodeName&&R.nodeName.toLowerCase(),N===\"select\"||N===\"input\"&&R.type===\"file\")var Tt=$J;else if(S5(R))if($z)Tt=JJ;else{Tt=XJ;var Ot=QJ}else(N=R.nodeName)&&N.toLowerCase()===\"input\"&&(R.type===\"checkbox\"||R.type===\"radio\")&&(Tt=KJ);if(Tt&&(Tt=Tt(e,_))){Yz(I,Tt,r,w);break t}Ot&&Ot(e,R,_),e===\"focusout\"&&(Ot=R._wrapperState)&&Ot.controlled&&R.type===\"number\"&&AL(R,\"number\",R.value)}switch(Ot=_?M_(_):window,e){case\"focusin\":(S5(Ot)||Ot.contentEditable===\"true\")&&(S_=Ot,EL=_,a1=null);break;case\"focusout\":a1=EL=S_=null;break;case\"mousedown\":PL=!0;break;case\"contextmenu\":case\"mouseup\":case\"dragend\":PL=!1,P5(I,r,w);break;case\"selectionchange\":if(rtt)break;case\"keydown\":case\"keyup\":P5(I,r,w)}var Yt;if(pk)t:{switch(e){case\"compositionstart\":var te=\"onCompositionStart\";break t;case\"compositionend\":te=\"onCompositionEnd\";break t;case\"compositionupdate\":te=\"onCompositionUpdate\";break t}te=void 0}else w_?qz(e,r)&&(te=\"onCompositionEnd\"):e===\"keydown\"&&r.keyCode===229&&(te=\"onCompositionStart\");te&&(Hz&&r.locale!==\"ko\"&&(w_||te!==\"onCompositionStart\"?te===\"onCompositionEnd\"&&w_&&(Yt=Wz()):(bA=w,hk=\"value\"in bA?bA.value:bA.textContent,w_=!0)),Ot=VT(_,te),0<Ot.length&&(te=new v5(te,e,null,r,w),I.push({event:te,listeners:Ot}),Yt?te.data=Yt:(Yt=Zz(r),Yt!==null&&(te.data=Yt)))),(Yt=WJ?HJ(e,r):qJ(e,r))&&(_=VT(_,\"onBeforeInput\"),0<_.length&&(w=new v5(\"onBeforeInput\",\"beforeinput\",null,r,w),I.push({event:w,listeners:_}),w.data=Yt))}sN(I,t)})}function x1(e,t,r){return{instance:e,listener:t,currentTarget:r}}function VT(e,t){for(var r=t+\"Capture\",i=[];e!==null;){var n=e,s=n.stateNode;n.tag===5&&s!==null&&(n=s,s=p1(e,r),s!=null&&i.unshift(x1(e,s,n)),s=p1(e,t),s!=null&&i.push(x1(e,s,n))),e=e.return}return i}function v_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function R5(e,t,r,i,n){for(var s=t._reactName,o=[];r!==null&&r!==i;){var c=r,d=c.alternate,_=c.stateNode;if(d!==null&&d===i)break;c.tag===5&&_!==null&&(c=_,n?(d=p1(r,s),d!=null&&o.unshift(x1(r,d,c))):n||(d=p1(r,s),d!=null&&o.push(x1(r,d,c)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var ntt=/\\r\\n?/g,stt=/\\u0000|\\uFFFD/g;function D5(e){return(typeof e==\"string\"?e:\"\"+e).replace(ntt,`\n`).replace(stt,\"\")}function _T(e,t,r){if(t=D5(t),D5(e)!==t&&r)throw Error(Te(425))}function jT(){}var IL=null,CL=null;function LL(e,t){return e===\"textarea\"||e===\"noscript\"||typeof t.children==\"string\"||typeof t.children==\"number\"||typeof t.dangerouslySetInnerHTML==\"object\"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var kL=typeof setTimeout==\"function\"?setTimeout:void 0,ott=typeof clearTimeout==\"function\"?clearTimeout:void 0,O5=typeof Promise==\"function\"?Promise:void 0,att=typeof queueMicrotask==\"function\"?queueMicrotask:typeof O5<\"u\"?function(e){return O5.resolve(null).then(e).catch(ltt)}:kL;function ltt(e){setTimeout(function(){throw e})}function KC(e,t){var r=t,i=0;do{var n=r.nextSibling;if(e.removeChild(r),n&&n.nodeType===8)if(r=n.data,r===\"/$\"){if(i===0){e.removeChild(n),g1(t);return}i--}else r!==\"$\"&&r!==\"$?\"&&r!==\"$!\"||i++;r=n}while(r);g1(t)}function EA(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===\"$\"||t===\"$!\"||t===\"$?\")break;if(t===\"/$\")return null}}return e}function B5(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r===\"$\"||r===\"$!\"||r===\"$?\"){if(t===0)return e;t--}else r===\"/$\"&&t++}e=e.previousSibling}return null}var Z_=Math.random().toString(36).slice(2),zf=\"__reactFiber$\"+Z_,b1=\"__reactProps$\"+Z_,qd=\"__reactContainer$\"+Z_,RL=\"__reactEvents$\"+Z_,ctt=\"__reactListeners$\"+Z_,utt=\"__reactHandles$\"+Z_;function p0(e){var t=e[zf];if(t)return t;for(var r=e.parentNode;r;){if(t=r[qd]||r[zf]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=B5(e);e!==null;){if(r=e[zf])return r;e=B5(e)}return t}e=r,r=e.parentNode}return null}function L1(e){return e=e[zf]||e[qd],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function M_(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Te(33))}function lM(e){return e[b1]||null}var DL=[],E_=-1;function OA(e){return{current:e}}function $n(e){0>E_||(e.current=DL[E_],DL[E_]=null,E_--)}function zn(e,t){E_++,DL[E_]=e.current,e.current=t}var RA={},$a=OA(RA),Wl=OA(!1),y0=RA;function U_(e,t){var r=e.type.contextTypes;if(!r)return RA;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var n={},s;for(s in r)n[s]=t[s];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=n),n}function Hl(e){return e=e.childContextTypes,e!=null}function GT(){$n(Wl),$n($a)}function F5(e,t,r){if($a.current!==RA)throw Error(Te(168));zn($a,t),zn(Wl,r)}function aN(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=\"function\")return r;i=i.getChildContext();for(var n in i)if(!(n in t))throw Error(Te(108,QK(e)||\"Unknown\",n));return ps({},r,i)}function WT(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||RA,y0=$a.current,zn($a,e),zn(Wl,Wl.current),!0}function z5(e,t,r){var i=e.stateNode;if(!i)throw Error(Te(169));r?(e=aN(e,t,y0),i.__reactInternalMemoizedMergedChildContext=e,$n(Wl),$n($a),zn($a,e)):$n(Wl),zn(Wl,r)}var Vd=null,cM=!1,JC=!1;function lN(e){Vd===null?Vd=[e]:Vd.push(e)}function htt(e){cM=!0,lN(e)}function BA(){if(!JC&&Vd!==null){JC=!0;var e=0,t=cn;try{var r=Vd;for(cn=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}Vd=null,cM=!1}catch(n){throw Vd!==null&&(Vd=Vd.slice(e+1)),Rz(ak,BA),n}finally{cn=t,JC=!1}}return null}var P_=[],I_=0,HT=null,qT=0,Eu=[],Pu=0,v0=null,jd=1,Gd=\"\";function f0(e,t){P_[I_++]=qT,P_[I_++]=HT,HT=e,qT=t}function cN(e,t,r){Eu[Pu++]=jd,Eu[Pu++]=Gd,Eu[Pu++]=v0,v0=e;var i=jd;e=Gd;var n=32-Sh(i)-1;i&=~(1<<n),r+=1;var s=32-Sh(t)+n;if(30<s){var o=n-n%5;s=(i&(1<<o)-1).toString(32),i>>=o,n-=o,jd=1<<32-Sh(t)+n|r<<n|i,Gd=s+e}else jd=1<<s|r<<n|i,Gd=e}function mk(e){e.return!==null&&(f0(e,1),cN(e,1,0))}function gk(e){for(;e===HT;)HT=P_[--I_],P_[I_]=null,qT=P_[--I_],P_[I_]=null;for(;e===v0;)v0=Eu[--Pu],Eu[Pu]=null,Gd=Eu[--Pu],Eu[Pu]=null,jd=Eu[--Pu],Eu[Pu]=null}var jc=null,Vc=null,ns=!1,wh=null;function uN(e,t){var r=Iu(5,null,null,0);r.elementType=\"DELETED\",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function N5(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,jc=e,Vc=EA(t.firstChild),!0):!1;case 6:return t=e.pendingProps===\"\"||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,jc=e,Vc=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=v0!==null?{id:jd,overflow:Gd}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Iu(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,jc=e,Vc=null,!0):!1;default:return!1}}function OL(e){return(e.mode&1)!==0&&(e.flags&128)===0}function BL(e){if(ns){var t=Vc;if(t){var r=t;if(!N5(e,t)){if(OL(e))throw Error(Te(418));t=EA(r.nextSibling);var i=jc;t&&N5(e,t)?uN(i,r):(e.flags=e.flags&-4097|2,ns=!1,jc=e)}}else{if(OL(e))throw Error(Te(418));e.flags=e.flags&-4097|2,ns=!1,jc=e}}}function U5(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;jc=e}function yT(e){if(e!==jc)return!1;if(!ns)return U5(e),ns=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==\"head\"&&t!==\"body\"&&!LL(e.type,e.memoizedProps)),t&&(t=Vc)){if(OL(e))throw hN(),Error(Te(418));for(;t;)uN(e,t),t=EA(t.nextSibling)}if(U5(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Te(317));t:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r===\"/$\"){if(t===0){Vc=EA(e.nextSibling);break t}t--}else r!==\"$\"&&r!==\"$!\"&&r!==\"$?\"||t++}e=e.nextSibling}Vc=null}}else Vc=jc?EA(e.stateNode.nextSibling):null;return!0}function hN(){for(var e=Vc;e;)e=EA(e.nextSibling)}function V_(){Vc=jc=null,ns=!1}function _k(e){wh===null?wh=[e]:wh.push(e)}var ftt=$d.ReactCurrentBatchConfig;function xh(e,t){if(e&&e.defaultProps){t=ps({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}var ZT=OA(null),YT=null,C_=null,yk=null;function vk(){yk=C_=YT=null}function xk(e){var t=ZT.current;$n(ZT),e._currentValue=t}function FL(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function F_(e,t){YT=e,yk=C_=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Gl=!0),e.firstContext=null)}function Lu(e){var t=e._currentValue;if(yk!==e)if(e={context:e,memoizedValue:t,next:null},C_===null){if(YT===null)throw Error(Te(308));C_=e,YT.dependencies={lanes:0,firstContext:e}}else C_=C_.next=e;return t}var A0=null;function bk(e){A0===null?A0=[e]:A0.push(e)}function fN(e,t,r,i){var n=t.interleaved;return n===null?(r.next=r,bk(t)):(r.next=n.next,n.next=r),t.interleaved=r,Zd(e,i)}function Zd(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var yA=!1;function wk(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function dN(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Wd(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function PA(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,Fi&2){var n=i.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),i.pending=t,Zd(e,r)}return n=i.interleaved,n===null?(t.next=t,bk(i)):(t.next=n.next,n.next=t),i.interleaved=t,Zd(e,r)}function ET(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,lk(e,r)}}function V5(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var n=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?n=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?n=s=t:s=s.next=t}else n=s=t;r={baseState:i.baseState,firstBaseUpdate:n,lastBaseUpdate:s,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function $T(e,t,r,i){var n=e.updateQueue;yA=!1;var s=n.firstBaseUpdate,o=n.lastBaseUpdate,c=n.shared.pending;if(c!==null){n.shared.pending=null;var d=c,_=d.next;d.next=null,o===null?s=_:o.next=_,o=d;var w=e.alternate;w!==null&&(w=w.updateQueue,c=w.lastBaseUpdate,c!==o&&(c===null?w.firstBaseUpdate=_:c.next=_,w.lastBaseUpdate=d))}if(s!==null){var I=n.baseState;o=0,w=_=d=null,c=s;do{var R=c.lane,N=c.eventTime;if((i&R)===R){w!==null&&(w=w.next={eventTime:N,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});t:{var j=e,Y=c;switch(R=t,N=r,Y.tag){case 1:if(j=Y.payload,typeof j==\"function\"){I=j.call(N,I,R);break t}I=j;break t;case 3:j.flags=j.flags&-65537|128;case 0:if(j=Y.payload,R=typeof j==\"function\"?j.call(N,I,R):j,R==null)break t;I=ps({},I,R);break t;case 2:yA=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,R=n.effects,R===null?n.effects=[c]:R.push(c))}else N={eventTime:N,lane:R,tag:c.tag,payload:c.payload,callback:c.callback,next:null},w===null?(_=w=N,d=I):w=w.next=N,o|=R;if(c=c.next,c===null){if(c=n.shared.pending,c===null)break;R=c,c=R.next,R.next=null,n.lastBaseUpdate=R,n.shared.pending=null}}while(!0);if(w===null&&(d=I),n.baseState=d,n.firstBaseUpdate=_,n.lastBaseUpdate=w,t=n.shared.interleaved,t!==null){n=t;do o|=n.lane,n=n.next;while(n!==t)}else s===null&&(n.shared.lanes=0);b0|=o,e.lanes=o,e.memoizedState=I}}function j5(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],n=i.callback;if(n!==null){if(i.callback=null,i=r,typeof n!=\"function\")throw Error(Te(191,n));n.call(i)}}}var pN=new fz.Component().refs;function zL(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:ps({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var uM={isMounted:function(e){return(e=e._reactInternals)?T0(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=yl(),n=CA(e),s=Wd(i,n);s.payload=t,r!=null&&(s.callback=r),t=PA(e,s,n),t!==null&&(Th(t,e,n,i),ET(t,e,n))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=yl(),n=CA(e),s=Wd(i,n);s.tag=1,s.payload=t,r!=null&&(s.callback=r),t=PA(e,s,n),t!==null&&(Th(t,e,n,i),ET(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=yl(),i=CA(e),n=Wd(r,i);n.tag=2,t!=null&&(n.callback=t),t=PA(e,n,i),t!==null&&(Th(t,e,i,r),ET(t,e,i))}};function G5(e,t,r,i,n,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate==\"function\"?e.shouldComponentUpdate(i,s,o):t.prototype&&t.prototype.isPureReactComponent?!y1(r,i)||!y1(n,s):!0}function AN(e,t,r){var i=!1,n=RA,s=t.contextType;return typeof s==\"object\"&&s!==null?s=Lu(s):(n=Hl(t)?y0:$a.current,i=t.contextTypes,s=(i=i!=null)?U_(e,n):RA),t=new t(r,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=uM,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=s),t}function W5(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps==\"function\"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps==\"function\"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&uM.enqueueReplaceState(t,t.state,null)}function NL(e,t,r,i){var n=e.stateNode;n.props=r,n.state=e.memoizedState,n.refs=pN,wk(e);var s=t.contextType;typeof s==\"object\"&&s!==null?n.context=Lu(s):(s=Hl(t)?y0:$a.current,n.context=U_(e,s)),n.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s==\"function\"&&(zL(e,t,s,r),n.state=e.memoizedState),typeof t.getDerivedStateFromProps==\"function\"||typeof n.getSnapshotBeforeUpdate==\"function\"||typeof n.UNSAFE_componentWillMount!=\"function\"&&typeof n.componentWillMount!=\"function\"||(t=n.state,typeof n.componentWillMount==\"function\"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount==\"function\"&&n.UNSAFE_componentWillMount(),t!==n.state&&uM.enqueueReplaceState(n,n.state,null),$T(e,r,n,i),n.state=e.memoizedState),typeof n.componentDidMount==\"function\"&&(e.flags|=4194308)}function $x(e,t,r){if(e=r.ref,e!==null&&typeof e!=\"function\"&&typeof e!=\"object\"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(Te(309));var i=r.stateNode}if(!i)throw Error(Te(147,e));var n=i,s=\"\"+e;return t!==null&&t.ref!==null&&typeof t.ref==\"function\"&&t.ref._stringRef===s?t.ref:(t=function(o){var c=n.refs;c===pN&&(c=n.refs={}),o===null?delete c[s]:c[s]=o},t._stringRef=s,t)}if(typeof e!=\"string\")throw Error(Te(284));if(!r._owner)throw Error(Te(290,e))}return e}function vT(e,t){throw e=Object.prototype.toString.call(t),Error(Te(31,e===\"[object Object]\"?\"object with keys {\"+Object.keys(t).join(\", \")+\"}\":e))}function H5(e){var t=e._init;return t(e._payload)}function mN(e){function t(Z,K){if(e){var J=Z.deletions;J===null?(Z.deletions=[K],Z.flags|=16):J.push(K)}}function r(Z,K){if(!e)return null;for(;K!==null;)t(Z,K),K=K.sibling;return null}function i(Z,K){for(Z=new Map;K!==null;)K.key!==null?Z.set(K.key,K):Z.set(K.index,K),K=K.sibling;return Z}function n(Z,K){return Z=LA(Z,K),Z.index=0,Z.sibling=null,Z}function s(Z,K,J){return Z.index=J,e?(J=Z.alternate,J!==null?(J=J.index,J<K?(Z.flags|=2,K):J):(Z.flags|=2,K)):(Z.flags|=1048576,K)}function o(Z){return e&&Z.alternate===null&&(Z.flags|=2),Z}function c(Z,K,J,ht){return K===null||K.tag!==6?(K=oL(J,Z.mode,ht),K.return=Z,K):(K=n(K,J),K.return=Z,K)}function d(Z,K,J,ht){var Tt=J.type;return Tt===b_?w(Z,K,J.props.children,ht,J.key):K!==null&&(K.elementType===Tt||typeof Tt==\"object\"&&Tt!==null&&Tt.$$typeof===_A&&H5(Tt)===K.type)?(ht=n(K,J.props),ht.ref=$x(Z,K,J),ht.return=Z,ht):(ht=RT(J.type,J.key,J.props,null,Z.mode,ht),ht.ref=$x(Z,K,J),ht.return=Z,ht)}function _(Z,K,J,ht){return K===null||K.tag!==4||K.stateNode.containerInfo!==J.containerInfo||K.stateNode.implementation!==J.implementation?(K=aL(J,Z.mode,ht),K.return=Z,K):(K=n(K,J.children||[]),K.return=Z,K)}function w(Z,K,J,ht,Tt){return K===null||K.tag!==7?(K=_0(J,Z.mode,ht,Tt),K.return=Z,K):(K=n(K,J),K.return=Z,K)}function I(Z,K,J){if(typeof K==\"string\"&&K!==\"\"||typeof K==\"number\")return K=oL(\"\"+K,Z.mode,J),K.return=Z,K;if(typeof K==\"object\"&&K!==null){switch(K.$$typeof){case sT:return J=RT(K.type,K.key,K.props,null,Z.mode,J),J.ref=$x(Z,null,K),J.return=Z,J;case x_:return K=aL(K,Z.mode,J),K.return=Z,K;case _A:var ht=K._init;return I(Z,ht(K._payload),J)}if(t1(K)||Hx(K))return K=_0(K,Z.mode,J,null),K.return=Z,K;vT(Z,K)}return null}function R(Z,K,J,ht){var Tt=K!==null?K.key:null;if(typeof J==\"string\"&&J!==\"\"||typeof J==\"number\")return Tt!==null?null:c(Z,K,\"\"+J,ht);if(typeof J==\"object\"&&J!==null){switch(J.$$typeof){case sT:return J.key===Tt?d(Z,K,J,ht):null;case x_:return J.key===Tt?_(Z,K,J,ht):null;case _A:return Tt=J._init,R(Z,K,Tt(J._payload),ht)}if(t1(J)||Hx(J))return Tt!==null?null:w(Z,K,J,ht,null);vT(Z,J)}return null}function N(Z,K,J,ht,Tt){if(typeof ht==\"string\"&&ht!==\"\"||typeof ht==\"number\")return Z=Z.get(J)||null,c(K,Z,\"\"+ht,Tt);if(typeof ht==\"object\"&&ht!==null){switch(ht.$$typeof){case sT:return Z=Z.get(ht.key===null?J:ht.key)||null,d(K,Z,ht,Tt);case x_:return Z=Z.get(ht.key===null?J:ht.key)||null,_(K,Z,ht,Tt);case _A:var Ot=ht._init;return N(Z,K,J,Ot(ht._payload),Tt)}if(t1(ht)||Hx(ht))return Z=Z.get(J)||null,w(K,Z,ht,Tt,null);vT(K,ht)}return null}function j(Z,K,J,ht){for(var Tt=null,Ot=null,Yt=K,te=K=0,oe=null;Yt!==null&&te<J.length;te++){Yt.index>te?(oe=Yt,Yt=null):oe=Yt.sibling;var ae=R(Z,Yt,J[te],ht);if(ae===null){Yt===null&&(Yt=oe);break}e&&Yt&&ae.alternate===null&&t(Z,Yt),K=s(ae,K,te),Ot===null?Tt=ae:Ot.sibling=ae,Ot=ae,Yt=oe}if(te===J.length)return r(Z,Yt),ns&&f0(Z,te),Tt;if(Yt===null){for(;te<J.length;te++)Yt=I(Z,J[te],ht),Yt!==null&&(K=s(Yt,K,te),Ot===null?Tt=Yt:Ot.sibling=Yt,Ot=Yt);return ns&&f0(Z,te),Tt}for(Yt=i(Z,Yt);te<J.length;te++)oe=N(Yt,Z,te,J[te],ht),oe!==null&&(e&&oe.alternate!==null&&Yt.delete(oe.key===null?te:oe.key),K=s(oe,K,te),Ot===null?Tt=oe:Ot.sibling=oe,Ot=oe);return e&&Yt.forEach(function(Le){return t(Z,Le)}),ns&&f0(Z,te),Tt}function Y(Z,K,J,ht){var Tt=Hx(J);if(typeof Tt!=\"function\")throw Error(Te(150));if(J=Tt.call(J),J==null)throw Error(Te(151));for(var Ot=Tt=null,Yt=K,te=K=0,oe=null,ae=J.next();Yt!==null&&!ae.done;te++,ae=J.next()){Yt.index>te?(oe=Yt,Yt=null):oe=Yt.sibling;var Le=R(Z,Yt,ae.value,ht);if(Le===null){Yt===null&&(Yt=oe);break}e&&Yt&&Le.alternate===null&&t(Z,Yt),K=s(Le,K,te),Ot===null?Tt=Le:Ot.sibling=Le,Ot=Le,Yt=oe}if(ae.done)return r(Z,Yt),ns&&f0(Z,te),Tt;if(Yt===null){for(;!ae.done;te++,ae=J.next())ae=I(Z,ae.value,ht),ae!==null&&(K=s(ae,K,te),Ot===null?Tt=ae:Ot.sibling=ae,Ot=ae);return ns&&f0(Z,te),Tt}for(Yt=i(Z,Yt);!ae.done;te++,ae=J.next())ae=N(Yt,Z,te,ae.value,ht),ae!==null&&(e&&ae.alternate!==null&&Yt.delete(ae.key===null?te:ae.key),K=s(ae,K,te),Ot===null?Tt=ae:Ot.sibling=ae,Ot=ae);return e&&Yt.forEach(function(sr){return t(Z,sr)}),ns&&f0(Z,te),Tt}function it(Z,K,J,ht){if(typeof J==\"object\"&&J!==null&&J.type===b_&&J.key===null&&(J=J.props.children),typeof J==\"object\"&&J!==null){switch(J.$$typeof){case sT:t:{for(var Tt=J.key,Ot=K;Ot!==null;){if(Ot.key===Tt){if(Tt=J.type,Tt===b_){if(Ot.tag===7){r(Z,Ot.sibling),K=n(Ot,J.props.children),K.return=Z,Z=K;break t}}else if(Ot.elementType===Tt||typeof Tt==\"object\"&&Tt!==null&&Tt.$$typeof===_A&&H5(Tt)===Ot.type){r(Z,Ot.sibling),K=n(Ot,J.props),K.ref=$x(Z,Ot,J),K.return=Z,Z=K;break t}r(Z,Ot);break}else t(Z,Ot);Ot=Ot.sibling}J.type===b_?(K=_0(J.props.children,Z.mode,ht,J.key),K.return=Z,Z=K):(ht=RT(J.type,J.key,J.props,null,Z.mode,ht),ht.ref=$x(Z,K,J),ht.return=Z,Z=ht)}return o(Z);case x_:t:{for(Ot=J.key;K!==null;){if(K.key===Ot)if(K.tag===4&&K.stateNode.containerInfo===J.containerInfo&&K.stateNode.implementation===J.implementation){r(Z,K.sibling),K=n(K,J.children||[]),K.return=Z,Z=K;break t}else{r(Z,K);break}else t(Z,K);K=K.sibling}K=aL(J,Z.mode,ht),K.return=Z,Z=K}return o(Z);case _A:return Ot=J._init,it(Z,K,Ot(J._payload),ht)}if(t1(J))return j(Z,K,J,ht);if(Hx(J))return Y(Z,K,J,ht);vT(Z,J)}return typeof J==\"string\"&&J!==\"\"||typeof J==\"number\"?(J=\"\"+J,K!==null&&K.tag===6?(r(Z,K.sibling),K=n(K,J),K.return=Z,Z=K):(r(Z,K),K=oL(J,Z.mode,ht),K.return=Z,Z=K),o(Z)):r(Z,K)}return it}var j_=mN(!0),gN=mN(!1),k1={},Uf=OA(k1),w1=OA(k1),S1=OA(k1);function m0(e){if(e===k1)throw Error(Te(174));return e}function Sk(e,t){switch(zn(S1,t),zn(w1,e),zn(Uf,k1),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:gL(null,\"\");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=gL(t,e)}$n(Uf),zn(Uf,t)}function G_(){$n(Uf),$n(w1),$n(S1)}function _N(e){m0(S1.current);var t=m0(Uf.current),r=gL(t,e.type);t!==r&&(zn(w1,e),zn(Uf,r))}function Tk(e){w1.current===e&&($n(Uf),$n(w1))}var fs=OA(0);function QT(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data===\"$?\"||r.data===\"$!\"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var tL=[];function Mk(){for(var e=0;e<tL.length;e++)tL[e]._workInProgressVersionPrimary=null;tL.length=0}var PT=$d.ReactCurrentDispatcher,eL=$d.ReactCurrentBatchConfig,x0=0,ds=null,Mo=null,Ko=null,XT=!1,l1=!1,T1=0,dtt=0;function qa(){throw Error(Te(321))}function Ek(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Mh(e[r],t[r]))return!1;return!0}function Pk(e,t,r,i,n,s){if(x0=s,ds=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,PT.current=e===null||e.memoizedState===null?gtt:_tt,e=r(i,n),l1){s=0;do{if(l1=!1,T1=0,25<=s)throw Error(Te(301));s+=1,Ko=Mo=null,t.updateQueue=null,PT.current=ytt,e=r(i,n)}while(l1)}if(PT.current=KT,t=Mo!==null&&Mo.next!==null,x0=0,Ko=Mo=ds=null,XT=!1,t)throw Error(Te(300));return e}function Ik(){var e=T1!==0;return T1=0,e}function Ff(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ko===null?ds.memoizedState=Ko=e:Ko=Ko.next=e,Ko}function ku(){if(Mo===null){var e=ds.alternate;e=e!==null?e.memoizedState:null}else e=Mo.next;var t=Ko===null?ds.memoizedState:Ko.next;if(t!==null)Ko=t,Mo=e;else{if(e===null)throw Error(Te(310));Mo=e,e={memoizedState:Mo.memoizedState,baseState:Mo.baseState,baseQueue:Mo.baseQueue,queue:Mo.queue,next:null},Ko===null?ds.memoizedState=Ko=e:Ko=Ko.next=e}return Ko}function M1(e,t){return typeof t==\"function\"?t(e):t}function rL(e){var t=ku(),r=t.queue;if(r===null)throw Error(Te(311));r.lastRenderedReducer=e;var i=Mo,n=i.baseQueue,s=r.pending;if(s!==null){if(n!==null){var o=n.next;n.next=s.next,s.next=o}i.baseQueue=n=s,r.pending=null}if(n!==null){s=n.next,i=i.baseState;var c=o=null,d=null,_=s;do{var w=_.lane;if((x0&w)===w)d!==null&&(d=d.next={lane:0,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null}),i=_.hasEagerState?_.eagerState:e(i,_.action);else{var I={lane:w,action:_.action,hasEagerState:_.hasEagerState,eagerState:_.eagerState,next:null};d===null?(c=d=I,o=i):d=d.next=I,ds.lanes|=w,b0|=w}_=_.next}while(_!==null&&_!==s);d===null?o=i:d.next=c,Mh(i,t.memoizedState)||(Gl=!0),t.memoizedState=i,t.baseState=o,t.baseQueue=d,r.lastRenderedState=i}if(e=r.interleaved,e!==null){n=e;do s=n.lane,ds.lanes|=s,b0|=s,n=n.next;while(n!==e)}else n===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function iL(e){var t=ku(),r=t.queue;if(r===null)throw Error(Te(311));r.lastRenderedReducer=e;var i=r.dispatch,n=r.pending,s=t.memoizedState;if(n!==null){r.pending=null;var o=n=n.next;do s=e(s,o.action),o=o.next;while(o!==n);Mh(s,t.memoizedState)||(Gl=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),r.lastRenderedState=s}return[s,i]}function yN(){}function vN(e,t){var r=ds,i=ku(),n=t(),s=!Mh(i.memoizedState,n);if(s&&(i.memoizedState=n,Gl=!0),i=i.queue,Ck(wN.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||Ko!==null&&Ko.memoizedState.tag&1){if(r.flags|=2048,E1(9,bN.bind(null,r,i,n,t),void 0,null),Jo===null)throw Error(Te(349));x0&30||xN(r,t,n)}return n}function xN(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ds.updateQueue,t===null?(t={lastEffect:null,stores:null},ds.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function bN(e,t,r,i){t.value=r,t.getSnapshot=i,SN(t)&&TN(e)}function wN(e,t,r){return r(function(){SN(t)&&TN(e)})}function SN(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Mh(e,r)}catch{return!0}}function TN(e){var t=Zd(e,1);t!==null&&Th(t,e,1,-1)}function q5(e){var t=Ff();return typeof e==\"function\"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:M1,lastRenderedState:e},t.queue=e,e=e.dispatch=mtt.bind(null,ds,e),[t.memoizedState,e]}function E1(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=ds.updateQueue,t===null?(t={lastEffect:null,stores:null},ds.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function MN(){return ku().memoizedState}function IT(e,t,r,i){var n=Ff();ds.flags|=e,n.memoizedState=E1(1|t,r,void 0,i===void 0?null:i)}function hM(e,t,r,i){var n=ku();i=i===void 0?null:i;var s=void 0;if(Mo!==null){var o=Mo.memoizedState;if(s=o.destroy,i!==null&&Ek(i,o.deps)){n.memoizedState=E1(t,r,s,i);return}}ds.flags|=e,n.memoizedState=E1(1|t,r,s,i)}function Z5(e,t){return IT(8390656,8,e,t)}function Ck(e,t){return hM(2048,8,e,t)}function EN(e,t){return hM(4,2,e,t)}function PN(e,t){return hM(4,4,e,t)}function IN(e,t){if(typeof t==\"function\")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function CN(e,t,r){return r=r!=null?r.concat([e]):null,hM(4,4,IN.bind(null,t,e),r)}function Lk(){}function LN(e,t){var r=ku();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Ek(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function kN(e,t){var r=ku();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Ek(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function RN(e,t,r){return x0&21?(Mh(r,t)||(r=Bz(),ds.lanes|=r,b0|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Gl=!0),e.memoizedState=r)}function ptt(e,t){var r=cn;cn=r!==0&&4>r?r:4,e(!0);var i=eL.transition;eL.transition={};try{e(!1),t()}finally{cn=r,eL.transition=i}}function DN(){return ku().memoizedState}function Att(e,t,r){var i=CA(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},ON(e))BN(t,r);else if(r=fN(e,t,r,i),r!==null){var n=yl();Th(r,e,i,n),FN(r,t,i)}}function mtt(e,t,r){var i=CA(e),n={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(ON(e))BN(t,n);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,c=s(o,r);if(n.hasEagerState=!0,n.eagerState=c,Mh(c,o)){var d=t.interleaved;d===null?(n.next=n,bk(t)):(n.next=d.next,d.next=n),t.interleaved=n;return}}catch{}finally{}r=fN(e,t,n,i),r!==null&&(n=yl(),Th(r,e,i,n),FN(r,t,i))}}function ON(e){var t=e.alternate;return e===ds||t!==null&&t===ds}function BN(e,t){l1=XT=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function FN(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,lk(e,r)}}var KT={readContext:Lu,useCallback:qa,useContext:qa,useEffect:qa,useImperativeHandle:qa,useInsertionEffect:qa,useLayoutEffect:qa,useMemo:qa,useReducer:qa,useRef:qa,useState:qa,useDebugValue:qa,useDeferredValue:qa,useTransition:qa,useMutableSource:qa,useSyncExternalStore:qa,useId:qa,unstable_isNewReconciler:!1},gtt={readContext:Lu,useCallback:function(e,t){return Ff().memoizedState=[e,t===void 0?null:t],e},useContext:Lu,useEffect:Z5,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,IT(4194308,4,IN.bind(null,t,e),r)},useLayoutEffect:function(e,t){return IT(4194308,4,e,t)},useInsertionEffect:function(e,t){return IT(4,2,e,t)},useMemo:function(e,t){var r=Ff();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=Ff();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Att.bind(null,ds,e),[i.memoizedState,e]},useRef:function(e){var t=Ff();return e={current:e},t.memoizedState=e},useState:q5,useDebugValue:Lk,useDeferredValue:function(e){return Ff().memoizedState=e},useTransition:function(){var e=q5(!1),t=e[0];return e=ptt.bind(null,e[1]),Ff().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=ds,n=Ff();if(ns){if(r===void 0)throw Error(Te(407));r=r()}else{if(r=t(),Jo===null)throw Error(Te(349));x0&30||xN(i,t,r)}n.memoizedState=r;var s={value:r,getSnapshot:t};return n.queue=s,Z5(wN.bind(null,i,s,e),[e]),i.flags|=2048,E1(9,bN.bind(null,i,s,r,t),void 0,null),r},useId:function(){var e=Ff(),t=Jo.identifierPrefix;if(ns){var r=Gd,i=jd;r=(i&~(1<<32-Sh(i)-1)).toString(32)+r,t=\":\"+t+\"R\"+r,r=T1++,0<r&&(t+=\"H\"+r.toString(32)),t+=\":\"}else r=dtt++,t=\":\"+t+\"r\"+r.toString(32)+\":\";return e.memoizedState=t},unstable_isNewReconciler:!1},_tt={readContext:Lu,useCallback:LN,useContext:Lu,useEffect:Ck,useImperativeHandle:CN,useInsertionEffect:EN,useLayoutEffect:PN,useMemo:kN,useReducer:rL,useRef:MN,useState:function(){return rL(M1)},useDebugValue:Lk,useDeferredValue:function(e){var t=ku();return RN(t,Mo.memoizedState,e)},useTransition:function(){var e=rL(M1)[0],t=ku().memoizedState;return[e,t]},useMutableSource:yN,useSyncExternalStore:vN,useId:DN,unstable_isNewReconciler:!1},ytt={readContext:Lu,useCallback:LN,useContext:Lu,useEffect:Ck,useImperativeHandle:CN,useInsertionEffect:EN,useLayoutEffect:PN,useMemo:kN,useReducer:iL,useRef:MN,useState:function(){return iL(M1)},useDebugValue:Lk,useDeferredValue:function(e){var t=ku();return Mo===null?t.memoizedState=e:RN(t,Mo.memoizedState,e)},useTransition:function(){var e=iL(M1)[0],t=ku().memoizedState;return[e,t]},useMutableSource:yN,useSyncExternalStore:vN,useId:DN,unstable_isNewReconciler:!1};function W_(e,t){try{var r=\"\",i=t;do r+=$K(i),i=i.return;while(i);var n=r}catch(s){n=`\nError generating stack: `+s.message+`\n`+s.stack}return{value:e,source:t,stack:n,digest:null}}function nL(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function UL(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var vtt=typeof WeakMap==\"function\"?WeakMap:Map;function zN(e,t,r){r=Wd(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){tM||(tM=!0,QL=i),UL(e,t)},r}function NN(e,t,r){r=Wd(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i==\"function\"){var n=t.value;r.payload=function(){return i(n)},r.callback=function(){UL(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch==\"function\"&&(r.callback=function(){UL(e,t),typeof i!=\"function\"&&(IA===null?IA=new Set([this]):IA.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:\"\"})}),r}function Y5(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new vtt;var n=new Set;i.set(t,n)}else n=i.get(t),n===void 0&&(n=new Set,i.set(t,n));n.has(r)||(n.add(r),e=Dtt.bind(null,e,t,r),t.then(e,e))}function $5(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Q5(e,t,r,i,n){return e.mode&1?(e.flags|=65536,e.lanes=n,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Wd(-1,1),t.tag=2,PA(r,t,1))),r.lanes|=1),e)}var xtt=$d.ReactCurrentOwner,Gl=!1;function _l(e,t,r,i){t.child=e===null?gN(t,null,r,i):j_(t,e.child,r,i)}function X5(e,t,r,i,n){r=r.render;var s=t.ref;return F_(t,n),i=Pk(e,t,r,i,s,n),r=Ik(),e!==null&&!Gl?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,Yd(e,t,n)):(ns&&r&&mk(t),t.flags|=1,_l(e,t,i,n),t.child)}function K5(e,t,r,i,n){if(e===null){var s=r.type;return typeof s==\"function\"&&!Nk(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=s,UN(e,t,s,i,n)):(e=RT(r.type,null,i,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&n)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:y1,r(o,i)&&e.ref===t.ref)return Yd(e,t,n)}return t.flags|=1,e=LA(s,i),e.ref=t.ref,e.return=t,t.child=e}function UN(e,t,r,i,n){if(e!==null){var s=e.memoizedProps;if(y1(s,i)&&e.ref===t.ref)if(Gl=!1,t.pendingProps=i=s,(e.lanes&n)!==0)e.flags&131072&&(Gl=!0);else return t.lanes=e.lanes,Yd(e,t,n)}return VL(e,t,r,i,n)}function VN(e,t,r){var i=t.pendingProps,n=i.children,s=e!==null?e.memoizedState:null;if(i.mode===\"hidden\")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},zn(k_,Uc),Uc|=r;else{if(!(r&1073741824))return e=s!==null?s.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,zn(k_,Uc),Uc|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=s!==null?s.baseLanes:r,zn(k_,Uc),Uc|=i}else s!==null?(i=s.baseLanes|r,t.memoizedState=null):i=r,zn(k_,Uc),Uc|=i;return _l(e,t,n,r),t.child}function jN(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function VL(e,t,r,i,n){var s=Hl(r)?y0:$a.current;return s=U_(t,s),F_(t,n),r=Pk(e,t,r,i,s,n),i=Ik(),e!==null&&!Gl?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,Yd(e,t,n)):(ns&&i&&mk(t),t.flags|=1,_l(e,t,r,n),t.child)}function J5(e,t,r,i,n){if(Hl(r)){var s=!0;WT(t)}else s=!1;if(F_(t,n),t.stateNode===null)CT(e,t),AN(t,r,i),NL(t,r,i,n),i=!0;else if(e===null){var o=t.stateNode,c=t.memoizedProps;o.props=c;var d=o.context,_=r.contextType;typeof _==\"object\"&&_!==null?_=Lu(_):(_=Hl(r)?y0:$a.current,_=U_(t,_));var w=r.getDerivedStateFromProps,I=typeof w==\"function\"||typeof o.getSnapshotBeforeUpdate==\"function\";I||typeof o.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof o.componentWillReceiveProps!=\"function\"||(c!==i||d!==_)&&W5(t,o,i,_),yA=!1;var R=t.memoizedState;o.state=R,$T(t,i,o,n),d=t.memoizedState,c!==i||R!==d||Wl.current||yA?(typeof w==\"function\"&&(zL(t,r,w,i),d=t.memoizedState),(c=yA||G5(t,r,c,i,R,d,_))?(I||typeof o.UNSAFE_componentWillMount!=\"function\"&&typeof o.componentWillMount!=\"function\"||(typeof o.componentWillMount==\"function\"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount==\"function\"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount==\"function\"&&(t.flags|=4194308)):(typeof o.componentDidMount==\"function\"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=d),o.props=i,o.state=d,o.context=_,i=c):(typeof o.componentDidMount==\"function\"&&(t.flags|=4194308),i=!1)}else{o=t.stateNode,dN(e,t),c=t.memoizedProps,_=t.type===t.elementType?c:xh(t.type,c),o.props=_,I=t.pendingProps,R=o.context,d=r.contextType,typeof d==\"object\"&&d!==null?d=Lu(d):(d=Hl(r)?y0:$a.current,d=U_(t,d));var N=r.getDerivedStateFromProps;(w=typeof N==\"function\"||typeof o.getSnapshotBeforeUpdate==\"function\")||typeof o.UNSAFE_componentWillReceiveProps!=\"function\"&&typeof o.componentWillReceiveProps!=\"function\"||(c!==I||R!==d)&&W5(t,o,i,d),yA=!1,R=t.memoizedState,o.state=R,$T(t,i,o,n);var j=t.memoizedState;c!==I||R!==j||Wl.current||yA?(typeof N==\"function\"&&(zL(t,r,N,i),j=t.memoizedState),(_=yA||G5(t,r,_,i,R,j,d)||!1)?(w||typeof o.UNSAFE_componentWillUpdate!=\"function\"&&typeof o.componentWillUpdate!=\"function\"||(typeof o.componentWillUpdate==\"function\"&&o.componentWillUpdate(i,j,d),typeof o.UNSAFE_componentWillUpdate==\"function\"&&o.UNSAFE_componentWillUpdate(i,j,d)),typeof o.componentDidUpdate==\"function\"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==\"function\"&&(t.flags|=1024)):(typeof o.componentDidUpdate!=\"function\"||c===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=\"function\"||c===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=j),o.props=i,o.state=j,o.context=d,i=_):(typeof o.componentDidUpdate!=\"function\"||c===e.memoizedProps&&R===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=\"function\"||c===e.memoizedProps&&R===e.memoizedState||(t.flags|=1024),i=!1)}return jL(e,t,r,i,s,n)}function jL(e,t,r,i,n,s){jN(e,t);var o=(t.flags&128)!==0;if(!i&&!o)return n&&z5(t,r,!1),Yd(e,t,s);i=t.stateNode,xtt.current=t;var c=o&&typeof r.getDerivedStateFromError!=\"function\"?null:i.render();return t.flags|=1,e!==null&&o?(t.child=j_(t,e.child,null,s),t.child=j_(t,null,c,s)):_l(e,t,c,s),t.memoizedState=i.state,n&&z5(t,r,!0),t.child}function GN(e){var t=e.stateNode;t.pendingContext?F5(e,t.pendingContext,t.pendingContext!==t.context):t.context&&F5(e,t.context,!1),Sk(e,t.containerInfo)}function tz(e,t,r,i,n){return V_(),_k(n),t.flags|=256,_l(e,t,r,i),t.child}var GL={dehydrated:null,treeContext:null,retryLane:0};function WL(e){return{baseLanes:e,cachePool:null,transitions:null}}function WN(e,t,r){var i=t.pendingProps,n=fs.current,s=!1,o=(t.flags&128)!==0,c;if((c=o)||(c=e!==null&&e.memoizedState===null?!1:(n&2)!==0),c?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(n|=1),zn(fs,n&1),e===null)return BL(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data===\"$!\"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=i.children,e=i.fallback,s?(i=t.mode,s=t.child,o={mode:\"hidden\",children:o},!(i&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=pM(o,i,0,null),e=_0(e,i,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=WL(r),t.memoizedState=GL,e):kk(t,o));if(n=e.memoizedState,n!==null&&(c=n.dehydrated,c!==null))return btt(e,t,o,i,c,n,r);if(s){s=i.fallback,o=t.mode,n=e.child,c=n.sibling;var d={mode:\"hidden\",children:i.children};return!(o&1)&&t.child!==n?(i=t.child,i.childLanes=0,i.pendingProps=d,t.deletions=null):(i=LA(n,d),i.subtreeFlags=n.subtreeFlags&14680064),c!==null?s=LA(c,s):(s=_0(s,o,r,null),s.flags|=2),s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,o=e.child.memoizedState,o=o===null?WL(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~r,t.memoizedState=GL,i}return s=e.child,e=s.sibling,i=LA(s,{mode:\"visible\",children:i.children}),!(t.mode&1)&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function kk(e,t){return t=pM({mode:\"visible\",children:t},e.mode,0,null),t.return=e,e.child=t}function xT(e,t,r,i){return i!==null&&_k(i),j_(t,e.child,null,r),e=kk(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function btt(e,t,r,i,n,s,o){if(r)return t.flags&256?(t.flags&=-257,i=nL(Error(Te(422))),xT(e,t,o,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=i.fallback,n=t.mode,i=pM({mode:\"visible\",children:i.children},n,0,null),s=_0(s,n,o,null),s.flags|=2,i.return=t,s.return=t,i.sibling=s,t.child=i,t.mode&1&&j_(t,e.child,null,o),t.child.memoizedState=WL(o),t.memoizedState=GL,s);if(!(t.mode&1))return xT(e,t,o,null);if(n.data===\"$!\"){if(i=n.nextSibling&&n.nextSibling.dataset,i)var c=i.dgst;return i=c,s=Error(Te(419)),i=nL(s,i,void 0),xT(e,t,o,i)}if(c=(o&e.childLanes)!==0,Gl||c){if(i=Jo,i!==null){switch(o&-o){case 4:n=2;break;case 16:n=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:n=32;break;case 536870912:n=268435456;break;default:n=0}n=n&(i.suspendedLanes|o)?0:n,n!==0&&n!==s.retryLane&&(s.retryLane=n,Zd(e,n),Th(i,e,n,-1))}return zk(),i=nL(Error(Te(421))),xT(e,t,o,i)}return n.data===\"$?\"?(t.flags|=128,t.child=e.child,t=Ott.bind(null,e),n._reactRetry=t,null):(e=s.treeContext,Vc=EA(n.nextSibling),jc=t,ns=!0,wh=null,e!==null&&(Eu[Pu++]=jd,Eu[Pu++]=Gd,Eu[Pu++]=v0,jd=e.id,Gd=e.overflow,v0=t),t=kk(t,i.children),t.flags|=4096,t)}function ez(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),FL(e.return,t,r)}function sL(e,t,r,i,n){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:n}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=r,s.tailMode=n)}function HN(e,t,r){var i=t.pendingProps,n=i.revealOrder,s=i.tail;if(_l(e,t,i.children,r),i=fs.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)t:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ez(e,r,t);else if(e.tag===19)ez(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(zn(fs,i),!(t.mode&1))t.memoizedState=null;else switch(n){case\"forwards\":for(r=t.child,n=null;r!==null;)e=r.alternate,e!==null&&QT(e)===null&&(n=r),r=r.sibling;r=n,r===null?(n=t.child,t.child=null):(n=r.sibling,r.sibling=null),sL(t,!1,n,r,s);break;case\"backwards\":for(r=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&QT(e)===null){t.child=n;break}e=n.sibling,n.sibling=r,r=n,n=e}sL(t,!0,r,null,s);break;case\"together\":sL(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function CT(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Yd(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),b0|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Te(153));if(t.child!==null){for(e=t.child,r=LA(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=LA(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function wtt(e,t,r){switch(t.tag){case 3:GN(t),V_();break;case 5:_N(t);break;case 1:Hl(t.type)&&WT(t);break;case 4:Sk(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,n=t.memoizedProps.value;zn(ZT,i._currentValue),i._currentValue=n;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(zn(fs,fs.current&1),t.flags|=128,null):r&t.child.childLanes?WN(e,t,r):(zn(fs,fs.current&1),e=Yd(e,t,r),e!==null?e.sibling:null);zn(fs,fs.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return HN(e,t,r);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),zn(fs,fs.current),i)break;return null;case 22:case 23:return t.lanes=0,VN(e,t,r)}return Yd(e,t,r)}var qN,HL,ZN,YN;qN=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};HL=function(){};ZN=function(e,t,r,i){var n=e.memoizedProps;if(n!==i){e=t.stateNode,m0(Uf.current);var s=null;switch(r){case\"input\":n=dL(e,n),i=dL(e,i),s=[];break;case\"select\":n=ps({},n,{value:void 0}),i=ps({},i,{value:void 0}),s=[];break;case\"textarea\":n=mL(e,n),i=mL(e,i),s=[];break;default:typeof n.onClick!=\"function\"&&typeof i.onClick==\"function\"&&(e.onclick=jT)}_L(r,i);var o;r=null;for(_ in n)if(!i.hasOwnProperty(_)&&n.hasOwnProperty(_)&&n[_]!=null)if(_===\"style\"){var c=n[_];for(o in c)c.hasOwnProperty(o)&&(r||(r={}),r[o]=\"\")}else _!==\"dangerouslySetInnerHTML\"&&_!==\"children\"&&_!==\"suppressContentEditableWarning\"&&_!==\"suppressHydrationWarning\"&&_!==\"autoFocus\"&&(f1.hasOwnProperty(_)?s||(s=[]):(s=s||[]).push(_,null));for(_ in i){var d=i[_];if(c=n?.[_],i.hasOwnProperty(_)&&d!==c&&(d!=null||c!=null))if(_===\"style\")if(c){for(o in c)!c.hasOwnProperty(o)||d&&d.hasOwnProperty(o)||(r||(r={}),r[o]=\"\");for(o in d)d.hasOwnProperty(o)&&c[o]!==d[o]&&(r||(r={}),r[o]=d[o])}else r||(s||(s=[]),s.push(_,r)),r=d;else _===\"dangerouslySetInnerHTML\"?(d=d?d.__html:void 0,c=c?c.__html:void 0,d!=null&&c!==d&&(s=s||[]).push(_,d)):_===\"children\"?typeof d!=\"string\"&&typeof d!=\"number\"||(s=s||[]).push(_,\"\"+d):_!==\"suppressContentEditableWarning\"&&_!==\"suppressHydrationWarning\"&&(f1.hasOwnProperty(_)?(d!=null&&_===\"onScroll\"&&Yn(\"scroll\",e),s||c===d||(s=[])):(s=s||[]).push(_,d))}r&&(s=s||[]).push(\"style\",r);var _=s;(t.updateQueue=_)&&(t.flags|=4)}};YN=function(e,t,r,i){r!==i&&(t.flags|=4)};function Qx(e,t){if(!ns)switch(e.tailMode){case\"hidden\":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case\"collapsed\":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Za(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags&14680064,i|=n.flags&14680064,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags,i|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function Stt(e,t,r){var i=t.pendingProps;switch(gk(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Za(t),null;case 1:return Hl(t.type)&&GT(),Za(t),null;case 3:return i=t.stateNode,G_(),$n(Wl),$n($a),Mk(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(yT(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,wh!==null&&(JL(wh),wh=null))),HL(e,t),Za(t),null;case 5:Tk(t);var n=m0(S1.current);if(r=t.type,e!==null&&t.stateNode!=null)ZN(e,t,r,i,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(Te(166));return Za(t),null}if(e=m0(Uf.current),yT(t)){i=t.stateNode,r=t.type;var s=t.memoizedProps;switch(i[zf]=t,i[b1]=s,e=(t.mode&1)!==0,r){case\"dialog\":Yn(\"cancel\",i),Yn(\"close\",i);break;case\"iframe\":case\"object\":case\"embed\":Yn(\"load\",i);break;case\"video\":case\"audio\":for(n=0;n<r1.length;n++)Yn(r1[n],i);break;case\"source\":Yn(\"error\",i);break;case\"img\":case\"image\":case\"link\":Yn(\"error\",i),Yn(\"load\",i);break;case\"details\":Yn(\"toggle\",i);break;case\"input\":c5(i,s),Yn(\"invalid\",i);break;case\"select\":i._wrapperState={wasMultiple:!!s.multiple},Yn(\"invalid\",i);break;case\"textarea\":h5(i,s),Yn(\"invalid\",i)}_L(r,s),n=null;for(var o in s)if(s.hasOwnProperty(o)){var c=s[o];o===\"children\"?typeof c==\"string\"?i.textContent!==c&&(s.suppressHydrationWarning!==!0&&_T(i.textContent,c,e),n=[\"children\",c]):typeof c==\"number\"&&i.textContent!==\"\"+c&&(s.suppressHydrationWarning!==!0&&_T(i.textContent,c,e),n=[\"children\",\"\"+c]):f1.hasOwnProperty(o)&&c!=null&&o===\"onScroll\"&&Yn(\"scroll\",i)}switch(r){case\"input\":oT(i),u5(i,s,!0);break;case\"textarea\":oT(i),f5(i);break;case\"select\":case\"option\":break;default:typeof s.onClick==\"function\"&&(i.onclick=jT)}i=n,t.updateQueue=i,i!==null&&(t.flags|=4)}else{o=n.nodeType===9?n:n.ownerDocument,e===\"http://www.w3.org/1999/xhtml\"&&(e=xz(r)),e===\"http://www.w3.org/1999/xhtml\"?r===\"script\"?(e=o.createElement(\"div\"),e.innerHTML=\"<script><\\/script>\",e=e.removeChild(e.firstChild)):typeof i.is==\"string\"?e=o.createElement(r,{is:i.is}):(e=o.createElement(r),r===\"select\"&&(o=e,i.multiple?o.multiple=!0:i.size&&(o.size=i.size))):e=o.createElementNS(e,r),e[zf]=t,e[b1]=i,qN(e,t,!1,!1),t.stateNode=e;t:{switch(o=yL(r,i),r){case\"dialog\":Yn(\"cancel\",e),Yn(\"close\",e),n=i;break;case\"iframe\":case\"object\":case\"embed\":Yn(\"load\",e),n=i;break;case\"video\":case\"audio\":for(n=0;n<r1.length;n++)Yn(r1[n],e);n=i;break;case\"source\":Yn(\"error\",e),n=i;break;case\"img\":case\"image\":case\"link\":Yn(\"error\",e),Yn(\"load\",e),n=i;break;case\"details\":Yn(\"toggle\",e),n=i;break;case\"input\":c5(e,i),n=dL(e,i),Yn(\"invalid\",e);break;case\"option\":n=i;break;case\"select\":e._wrapperState={wasMultiple:!!i.multiple},n=ps({},i,{value:void 0}),Yn(\"invalid\",e);break;case\"textarea\":h5(e,i),n=mL(e,i),Yn(\"invalid\",e);break;default:n=i}_L(r,n),c=n;for(s in c)if(c.hasOwnProperty(s)){var d=c[s];s===\"style\"?Sz(e,d):s===\"dangerouslySetInnerHTML\"?(d=d?d.__html:void 0,d!=null&&bz(e,d)):s===\"children\"?typeof d==\"string\"?(r!==\"textarea\"||d!==\"\")&&d1(e,d):typeof d==\"number\"&&d1(e,\"\"+d):s!==\"suppressContentEditableWarning\"&&s!==\"suppressHydrationWarning\"&&s!==\"autoFocus\"&&(f1.hasOwnProperty(s)?d!=null&&s===\"onScroll\"&&Yn(\"scroll\",e):d!=null&&rk(e,s,d,o))}switch(r){case\"input\":oT(e),u5(e,i,!1);break;case\"textarea\":oT(e),f5(e);break;case\"option\":i.value!=null&&e.setAttribute(\"value\",\"\"+kA(i.value));break;case\"select\":e.multiple=!!i.multiple,s=i.value,s!=null?R_(e,!!i.multiple,s,!1):i.defaultValue!=null&&R_(e,!!i.multiple,i.defaultValue,!0);break;default:typeof n.onClick==\"function\"&&(e.onclick=jT)}switch(r){case\"button\":case\"input\":case\"select\":case\"textarea\":i=!!i.autoFocus;break t;case\"img\":i=!0;break t;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Za(t),null;case 6:if(e&&t.stateNode!=null)YN(e,t,e.memoizedProps,i);else{if(typeof i!=\"string\"&&t.stateNode===null)throw Error(Te(166));if(r=m0(S1.current),m0(Uf.current),yT(t)){if(i=t.stateNode,r=t.memoizedProps,i[zf]=t,(s=i.nodeValue!==r)&&(e=jc,e!==null))switch(e.tag){case 3:_T(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&_T(i.nodeValue,r,(e.mode&1)!==0)}s&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[zf]=t,t.stateNode=i}return Za(t),null;case 13:if($n(fs),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ns&&Vc!==null&&t.mode&1&&!(t.flags&128))hN(),V_(),t.flags|=98560,s=!1;else if(s=yT(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(Te(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Te(317));s[zf]=t}else V_(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Za(t),s=!1}else wh!==null&&(JL(wh),wh=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||fs.current&1?Eo===0&&(Eo=3):zk())),t.updateQueue!==null&&(t.flags|=4),Za(t),null);case 4:return G_(),HL(e,t),e===null&&v1(t.stateNode.containerInfo),Za(t),null;case 10:return xk(t.type._context),Za(t),null;case 17:return Hl(t.type)&&GT(),Za(t),null;case 19:if($n(fs),s=t.memoizedState,s===null)return Za(t),null;if(i=(t.flags&128)!==0,o=s.rendering,o===null)if(i)Qx(s,!1);else{if(Eo!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=QT(e),o!==null){for(t.flags|=128,Qx(s,!1),i=o.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)s=r,e=i,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return zn(fs,fs.current&1|2),t.child}e=e.sibling}s.tail!==null&&$s()>H_&&(t.flags|=128,i=!0,Qx(s,!1),t.lanes=4194304)}else{if(!i)if(e=QT(o),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Qx(s,!0),s.tail===null&&s.tailMode===\"hidden\"&&!o.alternate&&!ns)return Za(t),null}else 2*$s()-s.renderingStartTime>H_&&r!==1073741824&&(t.flags|=128,i=!0,Qx(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(r=s.last,r!==null?r.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=$s(),t.sibling=null,r=fs.current,zn(fs,i?r&1|2:r&1),t):(Za(t),null);case 22:case 23:return Fk(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Uc&1073741824&&(Za(t),t.subtreeFlags&6&&(t.flags|=8192)):Za(t),null;case 24:return null;case 25:return null}throw Error(Te(156,t.tag))}function Ttt(e,t){switch(gk(t),t.tag){case 1:return Hl(t.type)&&GT(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return G_(),$n(Wl),$n($a),Mk(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Tk(t),null;case 13:if($n(fs),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Te(340));V_()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $n(fs),null;case 4:return G_(),null;case 10:return xk(t.type._context),null;case 22:case 23:return Fk(),null;case 24:return null;default:return null}}var bT=!1,Ya=!1,Mtt=typeof WeakSet==\"function\"?WeakSet:Set,or=null;function L_(e,t){var r=e.ref;if(r!==null)if(typeof r==\"function\")try{r(null)}catch(i){ks(e,t,i)}else r.current=null}function qL(e,t,r){try{r()}catch(i){ks(e,t,i)}}var rz=!1;function Ett(e,t){if(IL=NT,e=Kz(),Ak(e)){if(\"selectionStart\"in e)var r={start:e.selectionStart,end:e.selectionEnd};else t:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var n=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break t}var o=0,c=-1,d=-1,_=0,w=0,I=e,R=null;e:for(;;){for(var N;I!==r||n!==0&&I.nodeType!==3||(c=o+n),I!==s||i!==0&&I.nodeType!==3||(d=o+i),I.nodeType===3&&(o+=I.nodeValue.length),(N=I.firstChild)!==null;)R=I,I=N;for(;;){if(I===e)break e;if(R===r&&++_===n&&(c=o),R===s&&++w===i&&(d=o),(N=I.nextSibling)!==null)break;I=R,R=I.parentNode}I=N}r=c===-1||d===-1?null:{start:c,end:d}}else r=null}r=r||{start:0,end:0}}else r=null;for(CL={focusedElem:e,selectionRange:r},NT=!1,or=t;or!==null;)if(t=or,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,or=e;else for(;or!==null;){t=or;try{var j=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(j!==null){var Y=j.memoizedProps,it=j.memoizedState,Z=t.stateNode,K=Z.getSnapshotBeforeUpdate(t.elementType===t.type?Y:xh(t.type,Y),it);Z.__reactInternalSnapshotBeforeUpdate=K}break;case 3:var J=t.stateNode.containerInfo;J.nodeType===1?J.textContent=\"\":J.nodeType===9&&J.documentElement&&J.removeChild(J.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Te(163))}}catch(ht){ks(t,t.return,ht)}if(e=t.sibling,e!==null){e.return=t.return,or=e;break}or=t.return}return j=rz,rz=!1,j}function c1(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var n=i=i.next;do{if((n.tag&e)===e){var s=n.destroy;n.destroy=void 0,s!==void 0&&qL(t,r,s)}n=n.next}while(n!==i)}}function fM(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function ZL(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t==\"function\"?t(e):t.current=e}}function $N(e){var t=e.alternate;t!==null&&(e.alternate=null,$N(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zf],delete t[b1],delete t[RL],delete t[ctt],delete t[utt])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function QN(e){return e.tag===5||e.tag===3||e.tag===4}function iz(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||QN(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function YL(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=jT));else if(i!==4&&(e=e.child,e!==null))for(YL(e,t,r),e=e.sibling;e!==null;)YL(e,t,r),e=e.sibling}function $L(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for($L(e,t,r),e=e.sibling;e!==null;)$L(e,t,r),e=e.sibling}var ga=null,bh=!1;function gA(e,t,r){for(r=r.child;r!==null;)XN(e,t,r),r=r.sibling}function XN(e,t,r){if(Nf&&typeof Nf.onCommitFiberUnmount==\"function\")try{Nf.onCommitFiberUnmount(nM,r)}catch{}switch(r.tag){case 5:Ya||L_(r,t);case 6:var i=ga,n=bh;ga=null,gA(e,t,r),ga=i,bh=n,ga!==null&&(bh?(e=ga,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):ga.removeChild(r.stateNode));break;case 18:ga!==null&&(bh?(e=ga,r=r.stateNode,e.nodeType===8?KC(e.parentNode,r):e.nodeType===1&&KC(e,r),g1(e)):KC(ga,r.stateNode));break;case 4:i=ga,n=bh,ga=r.stateNode.containerInfo,bh=!0,gA(e,t,r),ga=i,bh=n;break;case 0:case 11:case 14:case 15:if(!Ya&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){n=i=i.next;do{var s=n,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&qL(r,t,o),n=n.next}while(n!==i)}gA(e,t,r);break;case 1:if(!Ya&&(L_(r,t),i=r.stateNode,typeof i.componentWillUnmount==\"function\"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(c){ks(r,t,c)}gA(e,t,r);break;case 21:gA(e,t,r);break;case 22:r.mode&1?(Ya=(i=Ya)||r.memoizedState!==null,gA(e,t,r),Ya=i):gA(e,t,r);break;default:gA(e,t,r)}}function nz(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Mtt),t.forEach(function(i){var n=Btt.bind(null,e,i);r.has(i)||(r.add(i),i.then(n,n))})}}function vh(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var n=r[i];try{var s=e,o=t,c=o;t:for(;c!==null;){switch(c.tag){case 5:ga=c.stateNode,bh=!1;break t;case 3:ga=c.stateNode.containerInfo,bh=!0;break t;case 4:ga=c.stateNode.containerInfo,bh=!0;break t}c=c.return}if(ga===null)throw Error(Te(160));XN(s,o,n),ga=null,bh=!1;var d=n.alternate;d!==null&&(d.return=null),n.return=null}catch(_){ks(n,t,_)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)KN(t,e),t=t.sibling}function KN(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(vh(t,e),Bf(e),i&4){try{c1(3,e,e.return),fM(3,e)}catch(Y){ks(e,e.return,Y)}try{c1(5,e,e.return)}catch(Y){ks(e,e.return,Y)}}break;case 1:vh(t,e),Bf(e),i&512&&r!==null&&L_(r,r.return);break;case 5:if(vh(t,e),Bf(e),i&512&&r!==null&&L_(r,r.return),e.flags&32){var n=e.stateNode;try{d1(n,\"\")}catch(Y){ks(e,e.return,Y)}}if(i&4&&(n=e.stateNode,n!=null)){var s=e.memoizedProps,o=r!==null?r.memoizedProps:s,c=e.type,d=e.updateQueue;if(e.updateQueue=null,d!==null)try{c===\"input\"&&s.type===\"radio\"&&s.name!=null&&yz(n,s),yL(c,o);var _=yL(c,s);for(o=0;o<d.length;o+=2){var w=d[o],I=d[o+1];w===\"style\"?Sz(n,I):w===\"dangerouslySetInnerHTML\"?bz(n,I):w===\"children\"?d1(n,I):rk(n,w,I,_)}switch(c){case\"input\":pL(n,s);break;case\"textarea\":vz(n,s);break;case\"select\":var R=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!s.multiple;var N=s.value;N!=null?R_(n,!!s.multiple,N,!1):R!==!!s.multiple&&(s.defaultValue!=null?R_(n,!!s.multiple,s.defaultValue,!0):R_(n,!!s.multiple,s.multiple?[]:\"\",!1))}n[b1]=s}catch(Y){ks(e,e.return,Y)}}break;case 6:if(vh(t,e),Bf(e),i&4){if(e.stateNode===null)throw Error(Te(162));n=e.stateNode,s=e.memoizedProps;try{n.nodeValue=s}catch(Y){ks(e,e.return,Y)}}break;case 3:if(vh(t,e),Bf(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{g1(t.containerInfo)}catch(Y){ks(e,e.return,Y)}break;case 4:vh(t,e),Bf(e);break;case 13:vh(t,e),Bf(e),n=e.child,n.flags&8192&&(s=n.memoizedState!==null,n.stateNode.isHidden=s,!s||n.alternate!==null&&n.alternate.memoizedState!==null||(Ok=$s())),i&4&&nz(e);break;case 22:if(w=r!==null&&r.memoizedState!==null,e.mode&1?(Ya=(_=Ya)||w,vh(t,e),Ya=_):vh(t,e),Bf(e),i&8192){if(_=e.memoizedState!==null,(e.stateNode.isHidden=_)&&!w&&e.mode&1)for(or=e,w=e.child;w!==null;){for(I=or=w;or!==null;){switch(R=or,N=R.child,R.tag){case 0:case 11:case 14:case 15:c1(4,R,R.return);break;case 1:L_(R,R.return);var j=R.stateNode;if(typeof j.componentWillUnmount==\"function\"){i=R,r=R.return;try{t=i,j.props=t.memoizedProps,j.state=t.memoizedState,j.componentWillUnmount()}catch(Y){ks(i,r,Y)}}break;case 5:L_(R,R.return);break;case 22:if(R.memoizedState!==null){oz(I);continue}}N!==null?(N.return=R,or=N):oz(I)}w=w.sibling}t:for(w=null,I=e;;){if(I.tag===5){if(w===null){w=I;try{n=I.stateNode,_?(s=n.style,typeof s.setProperty==\"function\"?s.setProperty(\"display\",\"none\",\"important\"):s.display=\"none\"):(c=I.stateNode,d=I.memoizedProps.style,o=d!=null&&d.hasOwnProperty(\"display\")?d.display:null,c.style.display=wz(\"display\",o))}catch(Y){ks(e,e.return,Y)}}}else if(I.tag===6){if(w===null)try{I.stateNode.nodeValue=_?\"\":I.memoizedProps}catch(Y){ks(e,e.return,Y)}}else if((I.tag!==22&&I.tag!==23||I.memoizedState===null||I===e)&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===e)break t;for(;I.sibling===null;){if(I.return===null||I.return===e)break t;w===I&&(w=null),I=I.return}w===I&&(w=null),I.sibling.return=I.return,I=I.sibling}}break;case 19:vh(t,e),Bf(e),i&4&&nz(e);break;case 21:break;default:vh(t,e),Bf(e)}}function Bf(e){var t=e.flags;if(t&2){try{t:{for(var r=e.return;r!==null;){if(QN(r)){var i=r;break t}r=r.return}throw Error(Te(160))}switch(i.tag){case 5:var n=i.stateNode;i.flags&32&&(d1(n,\"\"),i.flags&=-33);var s=iz(e);$L(e,s,n);break;case 3:case 4:var o=i.stateNode.containerInfo,c=iz(e);YL(e,c,o);break;default:throw Error(Te(161))}}catch(d){ks(e,e.return,d)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ptt(e,t,r){or=e,JN(e,t,r)}function JN(e,t,r){for(var i=(e.mode&1)!==0;or!==null;){var n=or,s=n.child;if(n.tag===22&&i){var o=n.memoizedState!==null||bT;if(!o){var c=n.alternate,d=c!==null&&c.memoizedState!==null||Ya;c=bT;var _=Ya;if(bT=o,(Ya=d)&&!_)for(or=n;or!==null;)o=or,d=o.child,o.tag===22&&o.memoizedState!==null?az(n):d!==null?(d.return=o,or=d):az(n);for(;s!==null;)or=s,JN(s,t,r),s=s.sibling;or=n,bT=c,Ya=_}sz(e,t,r)}else n.subtreeFlags&8772&&s!==null?(s.return=n,or=s):sz(e,t,r)}}function sz(e){for(;or!==null;){var t=or;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ya||fM(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Ya)if(r===null)i.componentDidMount();else{var n=t.elementType===t.type?r.memoizedProps:xh(t.type,r.memoizedProps);i.componentDidUpdate(n,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&j5(t,s,i);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}j5(t,o,r)}break;case 5:var c=t.stateNode;if(r===null&&t.flags&4){r=c;var d=t.memoizedProps;switch(t.type){case\"button\":case\"input\":case\"select\":case\"textarea\":d.autoFocus&&r.focus();break;case\"img\":d.src&&(r.src=d.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var _=t.alternate;if(_!==null){var w=_.memoizedState;if(w!==null){var I=w.dehydrated;I!==null&&g1(I)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Te(163))}Ya||t.flags&512&&ZL(t)}catch(R){ks(t,t.return,R)}}if(t===e){or=null;break}if(r=t.sibling,r!==null){r.return=t.return,or=r;break}or=t.return}}function oz(e){for(;or!==null;){var t=or;if(t===e){or=null;break}var r=t.sibling;if(r!==null){r.return=t.return,or=r;break}or=t.return}}function az(e){for(;or!==null;){var t=or;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{fM(4,t)}catch(d){ks(t,r,d)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount==\"function\"){var n=t.return;try{i.componentDidMount()}catch(d){ks(t,n,d)}}var s=t.return;try{ZL(t)}catch(d){ks(t,s,d)}break;case 5:var o=t.return;try{ZL(t)}catch(d){ks(t,o,d)}}}catch(d){ks(t,t.return,d)}if(t===e){or=null;break}var c=t.sibling;if(c!==null){c.return=t.return,or=c;break}or=t.return}}var Itt=Math.ceil,JT=$d.ReactCurrentDispatcher,Rk=$d.ReactCurrentOwner,Cu=$d.ReactCurrentBatchConfig,Fi=0,Jo=null,co=null,_a=0,Uc=0,k_=OA(0),Eo=0,P1=null,b0=0,dM=0,Dk=0,u1=null,jl=null,Ok=0,H_=1/0,Ud=null,tM=!1,QL=null,IA=null,wT=!1,wA=null,eM=0,h1=0,XL=null,LT=-1,kT=0;function yl(){return Fi&6?$s():LT!==-1?LT:LT=$s()}function CA(e){return e.mode&1?Fi&2&&_a!==0?_a&-_a:ftt.transition!==null?(kT===0&&(kT=Bz()),kT):(e=cn,e!==0||(e=window.event,e=e===void 0?16:Gz(e.type)),e):1}function Th(e,t,r,i){if(50<h1)throw h1=0,XL=null,Error(Te(185));I1(e,r,i),(!(Fi&2)||e!==Jo)&&(e===Jo&&(!(Fi&2)&&(dM|=r),Eo===4&&xA(e,_a)),ql(e,i),r===1&&Fi===0&&!(t.mode&1)&&(H_=$s()+500,cM&&BA()))}function ql(e,t){var r=e.callbackNode;pJ(e,t);var i=zT(e,e===Jo?_a:0);if(i===0)r!==null&&A5(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&A5(r),t===1)e.tag===0?htt(lz.bind(null,e)):lN(lz.bind(null,e)),att(function(){!(Fi&6)&&BA()}),r=null;else{switch(Fz(i)){case 1:r=ak;break;case 4:r=Dz;break;case 16:r=FT;break;case 536870912:r=Oz;break;default:r=FT}r=a8(r,t8.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function t8(e,t){if(LT=-1,kT=0,Fi&6)throw Error(Te(327));var r=e.callbackNode;if(z_()&&e.callbackNode!==r)return null;var i=zT(e,e===Jo?_a:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=rM(e,i);else{t=i;var n=Fi;Fi|=2;var s=r8();(Jo!==e||_a!==t)&&(Ud=null,H_=$s()+500,g0(e,t));do try{ktt();break}catch(c){e8(e,c)}while(!0);vk(),JT.current=s,Fi=n,co!==null?t=0:(Jo=null,_a=0,t=Eo)}if(t!==0){if(t===2&&(n=SL(e),n!==0&&(i=n,t=KL(e,n))),t===1)throw r=P1,g0(e,0),xA(e,i),ql(e,$s()),r;if(t===6)xA(e,i);else{if(n=e.current.alternate,!(i&30)&&!Ctt(n)&&(t=rM(e,i),t===2&&(s=SL(e),s!==0&&(i=s,t=KL(e,s))),t===1))throw r=P1,g0(e,0),xA(e,i),ql(e,$s()),r;switch(e.finishedWork=n,e.finishedLanes=i,t){case 0:case 1:throw Error(Te(345));case 2:d0(e,jl,Ud);break;case 3:if(xA(e,i),(i&130023424)===i&&(t=Ok+500-$s(),10<t)){if(zT(e,0)!==0)break;if(n=e.suspendedLanes,(n&i)!==i){yl(),e.pingedLanes|=e.suspendedLanes&n;break}e.timeoutHandle=kL(d0.bind(null,e,jl,Ud),t);break}d0(e,jl,Ud);break;case 4:if(xA(e,i),(i&4194240)===i)break;for(t=e.eventTimes,n=-1;0<i;){var o=31-Sh(i);s=1<<o,o=t[o],o>n&&(n=o),i&=~s}if(i=n,i=$s()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Itt(i/1960))-i,10<i){e.timeoutHandle=kL(d0.bind(null,e,jl,Ud),i);break}d0(e,jl,Ud);break;case 5:d0(e,jl,Ud);break;default:throw Error(Te(329))}}}return ql(e,$s()),e.callbackNode===r?t8.bind(null,e):null}function KL(e,t){var r=u1;return e.current.memoizedState.isDehydrated&&(g0(e,t).flags|=256),e=rM(e,t),e!==2&&(t=jl,jl=r,t!==null&&JL(t)),e}function JL(e){jl===null?jl=e:jl.push.apply(jl,e)}function Ctt(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var n=r[i],s=n.getSnapshot;n=n.value;try{if(!Mh(s(),n))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xA(e,t){for(t&=~Dk,t&=~dM,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Sh(t),i=1<<r;e[r]=-1,t&=~i}}function lz(e){if(Fi&6)throw Error(Te(327));z_();var t=zT(e,0);if(!(t&1))return ql(e,$s()),null;var r=rM(e,t);if(e.tag!==0&&r===2){var i=SL(e);i!==0&&(t=i,r=KL(e,i))}if(r===1)throw r=P1,g0(e,0),xA(e,t),ql(e,$s()),r;if(r===6)throw Error(Te(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,d0(e,jl,Ud),ql(e,$s()),null}function Bk(e,t){var r=Fi;Fi|=1;try{return e(t)}finally{Fi=r,Fi===0&&(H_=$s()+500,cM&&BA())}}function w0(e){wA!==null&&wA.tag===0&&!(Fi&6)&&z_();var t=Fi;Fi|=1;var r=Cu.transition,i=cn;try{if(Cu.transition=null,cn=1,e)return e()}finally{cn=i,Cu.transition=r,Fi=t,!(Fi&6)&&BA()}}function Fk(){Uc=k_.current,$n(k_)}function g0(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,ott(r)),co!==null)for(r=co.return;r!==null;){var i=r;switch(gk(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&GT();break;case 3:G_(),$n(Wl),$n($a),Mk();break;case 5:Tk(i);break;case 4:G_();break;case 13:$n(fs);break;case 19:$n(fs);break;case 10:xk(i.type._context);break;case 22:case 23:Fk()}r=r.return}if(Jo=e,co=e=LA(e.current,null),_a=Uc=t,Eo=0,P1=null,Dk=dM=b0=0,jl=u1=null,A0!==null){for(t=0;t<A0.length;t++)if(r=A0[t],i=r.interleaved,i!==null){r.interleaved=null;var n=i.next,s=r.pending;if(s!==null){var o=s.next;s.next=n,i.next=o}r.pending=i}A0=null}return e}function e8(e,t){do{var r=co;try{if(vk(),PT.current=KT,XT){for(var i=ds.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}XT=!1}if(x0=0,Ko=Mo=ds=null,l1=!1,T1=0,Rk.current=null,r===null||r.return===null){Eo=1,P1=t,co=null;break}t:{var s=e,o=r.return,c=r,d=t;if(t=_a,c.flags|=32768,d!==null&&typeof d==\"object\"&&typeof d.then==\"function\"){var _=d,w=c,I=w.tag;if(!(w.mode&1)&&(I===0||I===11||I===15)){var R=w.alternate;R?(w.updateQueue=R.updateQueue,w.memoizedState=R.memoizedState,w.lanes=R.lanes):(w.updateQueue=null,w.memoizedState=null)}var N=$5(o);if(N!==null){N.flags&=-257,Q5(N,o,c,s,t),N.mode&1&&Y5(s,_,t),t=N,d=_;var j=t.updateQueue;if(j===null){var Y=new Set;Y.add(d),t.updateQueue=Y}else j.add(d);break t}else{if(!(t&1)){Y5(s,_,t),zk();break t}d=Error(Te(426))}}else if(ns&&c.mode&1){var it=$5(o);if(it!==null){!(it.flags&65536)&&(it.flags|=256),Q5(it,o,c,s,t),_k(W_(d,c));break t}}s=d=W_(d,c),Eo!==4&&(Eo=2),u1===null?u1=[s]:u1.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var Z=zN(s,d,t);V5(s,Z);break t;case 1:c=d;var K=s.type,J=s.stateNode;if(!(s.flags&128)&&(typeof K.getDerivedStateFromError==\"function\"||J!==null&&typeof J.componentDidCatch==\"function\"&&(IA===null||!IA.has(J)))){s.flags|=65536,t&=-t,s.lanes|=t;var ht=NN(s,c,t);V5(s,ht);break t}}s=s.return}while(s!==null)}n8(r)}catch(Tt){t=Tt,co===r&&r!==null&&(co=r=r.return);continue}break}while(!0)}function r8(){var e=JT.current;return JT.current=KT,e===null?KT:e}function zk(){(Eo===0||Eo===3||Eo===2)&&(Eo=4),Jo===null||!(b0&268435455)&&!(dM&268435455)||xA(Jo,_a)}function rM(e,t){var r=Fi;Fi|=2;var i=r8();(Jo!==e||_a!==t)&&(Ud=null,g0(e,t));do try{Ltt();break}catch(n){e8(e,n)}while(!0);if(vk(),Fi=r,JT.current=i,co!==null)throw Error(Te(261));return Jo=null,_a=0,Eo}function Ltt(){for(;co!==null;)i8(co)}function ktt(){for(;co!==null&&!sJ();)i8(co)}function i8(e){var t=o8(e.alternate,e,Uc);e.memoizedProps=e.pendingProps,t===null?n8(e):co=t,Rk.current=null}function n8(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Ttt(r,t),r!==null){r.flags&=32767,co=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Eo=6,co=null;return}}else if(r=Stt(r,t,Uc),r!==null){co=r;return}if(t=t.sibling,t!==null){co=t;return}co=t=e}while(t!==null);Eo===0&&(Eo=5)}function d0(e,t,r){var i=cn,n=Cu.transition;try{Cu.transition=null,cn=1,Rtt(e,t,r,i)}finally{Cu.transition=n,cn=i}return null}function Rtt(e,t,r,i){do z_();while(wA!==null);if(Fi&6)throw Error(Te(327));r=e.finishedWork;var n=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(Te(177));e.callbackNode=null,e.callbackPriority=0;var s=r.lanes|r.childLanes;if(AJ(e,s),e===Jo&&(co=Jo=null,_a=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||wT||(wT=!0,a8(FT,function(){return z_(),null})),s=(r.flags&15990)!==0,r.subtreeFlags&15990||s){s=Cu.transition,Cu.transition=null;var o=cn;cn=1;var c=Fi;Fi|=4,Rk.current=null,Ett(e,r),KN(r,e),ett(CL),NT=!!IL,CL=IL=null,e.current=r,Ptt(r,e,n),oJ(),Fi=c,cn=o,Cu.transition=s}else e.current=r;if(wT&&(wT=!1,wA=e,eM=n),s=e.pendingLanes,s===0&&(IA=null),cJ(r.stateNode,i),ql(e,$s()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)n=t[r],i(n.value,{componentStack:n.stack,digest:n.digest});if(tM)throw tM=!1,e=QL,QL=null,e;return eM&1&&e.tag!==0&&z_(),s=e.pendingLanes,s&1?e===XL?h1++:(h1=0,XL=e):h1=0,BA(),null}function z_(){if(wA!==null){var e=Fz(eM),t=Cu.transition,r=cn;try{if(Cu.transition=null,cn=16>e?16:e,wA===null)var i=!1;else{if(e=wA,wA=null,eM=0,Fi&6)throw Error(Te(331));var n=Fi;for(Fi|=4,or=e.current;or!==null;){var s=or,o=s.child;if(or.flags&16){var c=s.deletions;if(c!==null){for(var d=0;d<c.length;d++){var _=c[d];for(or=_;or!==null;){var w=or;switch(w.tag){case 0:case 11:case 15:c1(8,w,s)}var I=w.child;if(I!==null)I.return=w,or=I;else for(;or!==null;){w=or;var R=w.sibling,N=w.return;if($N(w),w===_){or=null;break}if(R!==null){R.return=N,or=R;break}or=N}}}var j=s.alternate;if(j!==null){var Y=j.child;if(Y!==null){j.child=null;do{var it=Y.sibling;Y.sibling=null,Y=it}while(Y!==null)}}or=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,or=o;else t:for(;or!==null;){if(s=or,s.flags&2048)switch(s.tag){case 0:case 11:case 15:c1(9,s,s.return)}var Z=s.sibling;if(Z!==null){Z.return=s.return,or=Z;break t}or=s.return}}var K=e.current;for(or=K;or!==null;){o=or;var J=o.child;if(o.subtreeFlags&2064&&J!==null)J.return=o,or=J;else t:for(o=K;or!==null;){if(c=or,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:fM(9,c)}}catch(Tt){ks(c,c.return,Tt)}if(c===o){or=null;break t}var ht=c.sibling;if(ht!==null){ht.return=c.return,or=ht;break t}or=c.return}}if(Fi=n,BA(),Nf&&typeof Nf.onPostCommitFiberRoot==\"function\")try{Nf.onPostCommitFiberRoot(nM,e)}catch{}i=!0}return i}finally{cn=r,Cu.transition=t}}return!1}function cz(e,t,r){t=W_(r,t),t=zN(e,t,1),e=PA(e,t,1),t=yl(),e!==null&&(I1(e,1,t),ql(e,t))}function ks(e,t,r){if(e.tag===3)cz(e,e,r);else for(;t!==null;){if(t.tag===3){cz(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError==\"function\"||typeof i.componentDidCatch==\"function\"&&(IA===null||!IA.has(i))){e=W_(r,e),e=NN(t,e,1),t=PA(t,e,1),e=yl(),t!==null&&(I1(t,1,e),ql(t,e));break}}t=t.return}}function Dtt(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=yl(),e.pingedLanes|=e.suspendedLanes&r,Jo===e&&(_a&r)===r&&(Eo===4||Eo===3&&(_a&130023424)===_a&&500>$s()-Ok?g0(e,0):Dk|=r),ql(e,t)}function s8(e,t){t===0&&(e.mode&1?(t=cT,cT<<=1,!(cT&130023424)&&(cT=4194304)):t=1);var r=yl();e=Zd(e,t),e!==null&&(I1(e,t,r),ql(e,r))}function Ott(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),s8(e,r)}function Btt(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,n=e.memoizedState;n!==null&&(r=n.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(Te(314))}i!==null&&i.delete(t),s8(e,r)}var o8;o8=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Wl.current)Gl=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Gl=!1,wtt(e,t,r);Gl=!!(e.flags&131072)}else Gl=!1,ns&&t.flags&1048576&&cN(t,qT,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;CT(e,t),e=t.pendingProps;var n=U_(t,$a.current);F_(t,r),n=Pk(null,t,i,e,n,r);var s=Ik();return t.flags|=1,typeof n==\"object\"&&n!==null&&typeof n.render==\"function\"&&n.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Hl(i)?(s=!0,WT(t)):s=!1,t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,wk(t),n.updater=uM,t.stateNode=n,n._reactInternals=t,NL(t,i,e,r),t=jL(null,t,i,!0,s,r)):(t.tag=0,ns&&s&&mk(t),_l(null,t,n,r),t=t.child),t;case 16:i=t.elementType;t:{switch(CT(e,t),e=t.pendingProps,n=i._init,i=n(i._payload),t.type=i,n=t.tag=ztt(i),e=xh(i,e),n){case 0:t=VL(null,t,i,e,r);break t;case 1:t=J5(null,t,i,e,r);break t;case 11:t=X5(null,t,i,e,r);break t;case 14:t=K5(null,t,i,xh(i.type,e),r);break t}throw Error(Te(306,i,\"\"))}return t;case 0:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:xh(i,n),VL(e,t,i,n,r);case 1:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:xh(i,n),J5(e,t,i,n,r);case 3:t:{if(GN(t),e===null)throw Error(Te(387));i=t.pendingProps,s=t.memoizedState,n=s.element,dN(e,t),$T(t,i,null,r);var o=t.memoizedState;if(i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){n=W_(Error(Te(423)),t),t=tz(e,t,i,r,n);break t}else if(i!==n){n=W_(Error(Te(424)),t),t=tz(e,t,i,r,n);break t}else for(Vc=EA(t.stateNode.containerInfo.firstChild),jc=t,ns=!0,wh=null,r=gN(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(V_(),i===n){t=Yd(e,t,r);break t}_l(e,t,i,r)}t=t.child}return t;case 5:return _N(t),e===null&&BL(t),i=t.type,n=t.pendingProps,s=e!==null?e.memoizedProps:null,o=n.children,LL(i,n)?o=null:s!==null&&LL(i,s)&&(t.flags|=32),jN(e,t),_l(e,t,o,r),t.child;case 6:return e===null&&BL(t),null;case 13:return WN(e,t,r);case 4:return Sk(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=j_(t,null,i,r):_l(e,t,i,r),t.child;case 11:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:xh(i,n),X5(e,t,i,n,r);case 7:return _l(e,t,t.pendingProps,r),t.child;case 8:return _l(e,t,t.pendingProps.children,r),t.child;case 12:return _l(e,t,t.pendingProps.children,r),t.child;case 10:t:{if(i=t.type._context,n=t.pendingProps,s=t.memoizedProps,o=n.value,zn(ZT,i._currentValue),i._currentValue=o,s!==null)if(Mh(s.value,o)){if(s.children===n.children&&!Wl.current){t=Yd(e,t,r);break t}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var c=s.dependencies;if(c!==null){o=s.child;for(var d=c.firstContext;d!==null;){if(d.context===i){if(s.tag===1){d=Wd(-1,r&-r),d.tag=2;var _=s.updateQueue;if(_!==null){_=_.shared;var w=_.pending;w===null?d.next=d:(d.next=w.next,w.next=d),_.pending=d}}s.lanes|=r,d=s.alternate,d!==null&&(d.lanes|=r),FL(s.return,r,t),c.lanes|=r;break}d=d.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Te(341));o.lanes|=r,c=o.alternate,c!==null&&(c.lanes|=r),FL(o,r,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}_l(e,t,n.children,r),t=t.child}return t;case 9:return n=t.type,i=t.pendingProps.children,F_(t,r),n=Lu(n),i=i(n),t.flags|=1,_l(e,t,i,r),t.child;case 14:return i=t.type,n=xh(i,t.pendingProps),n=xh(i.type,n),K5(e,t,i,n,r);case 15:return UN(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:xh(i,n),CT(e,t),t.tag=1,Hl(i)?(e=!0,WT(t)):e=!1,F_(t,r),AN(t,i,n),NL(t,i,n,r),jL(null,t,i,!0,e,r);case 19:return HN(e,t,r);case 22:return VN(e,t,r)}throw Error(Te(156,t.tag))};function a8(e,t){return Rz(e,t)}function Ftt(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Iu(e,t,r,i){return new Ftt(e,t,r,i)}function Nk(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ztt(e){if(typeof e==\"function\")return Nk(e)?1:0;if(e!=null){if(e=e.$$typeof,e===nk)return 11;if(e===sk)return 14}return 2}function LA(e,t){var r=e.alternate;return r===null?(r=Iu(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function RT(e,t,r,i,n,s){var o=2;if(i=e,typeof e==\"function\")Nk(e)&&(o=1);else if(typeof e==\"string\")o=5;else t:switch(e){case b_:return _0(r.children,n,s,t);case ik:o=8,n|=8;break;case cL:return e=Iu(12,r,t,n|2),e.elementType=cL,e.lanes=s,e;case uL:return e=Iu(13,r,t,n),e.elementType=uL,e.lanes=s,e;case hL:return e=Iu(19,r,t,n),e.elementType=hL,e.lanes=s,e;case mz:return pM(r,n,s,t);default:if(typeof e==\"object\"&&e!==null)switch(e.$$typeof){case pz:o=10;break t;case Az:o=9;break t;case nk:o=11;break t;case sk:o=14;break t;case _A:o=16,i=null;break t}throw Error(Te(130,e==null?e:typeof e,\"\"))}return t=Iu(o,r,t,n),t.elementType=e,t.type=i,t.lanes=s,t}function _0(e,t,r,i){return e=Iu(7,e,i,t),e.lanes=r,e}function pM(e,t,r,i){return e=Iu(22,e,i,t),e.elementType=mz,e.lanes=r,e.stateNode={isHidden:!1},e}function oL(e,t,r){return e=Iu(6,e,null,t),e.lanes=r,e}function aL(e,t,r){return t=Iu(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ntt(e,t,r,i,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=WC(0),this.expirationTimes=WC(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=WC(0),this.identifierPrefix=i,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function Uk(e,t,r,i,n,s,o,c,d){return e=new Ntt(e,t,r,c,d),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Iu(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},wk(s),e}function Utt(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:x_,key:i==null?null:\"\"+i,children:e,containerInfo:t,implementation:r}}function l8(e){if(!e)return RA;e=e._reactInternals;t:{if(T0(e)!==e||e.tag!==1)throw Error(Te(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break t;case 1:if(Hl(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break t}}t=t.return}while(t!==null);throw Error(Te(171))}if(e.tag===1){var r=e.type;if(Hl(r))return aN(e,r,t)}return t}function c8(e,t,r,i,n,s,o,c,d){return e=Uk(r,i,!0,e,n,s,o,c,d),e.context=l8(null),r=e.current,i=yl(),n=CA(r),s=Wd(i,n),s.callback=t??null,PA(r,s,n),e.current.lanes=n,I1(e,n,i),ql(e,i),e}function AM(e,t,r,i){var n=t.current,s=yl(),o=CA(n);return r=l8(r),t.context===null?t.context=r:t.pendingContext=r,t=Wd(s,o),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=PA(n,t,o),e!==null&&(Th(e,n,o,s),ET(e,n,o)),o}function iM(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function uz(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Vk(e,t){uz(e,t),(e=e.alternate)&&uz(e,t)}function Vtt(){return null}var u8=typeof reportError==\"function\"?reportError:function(e){console.error(e)};function jk(e){this._internalRoot=e}mM.prototype.render=jk.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Te(409));AM(e,t,null,null)};mM.prototype.unmount=jk.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;w0(function(){AM(null,e,null,null)}),t[qd]=null}};function mM(e){this._internalRoot=e}mM.prototype.unstable_scheduleHydration=function(e){if(e){var t=Uz();e={blockedOn:null,target:e,priority:t};for(var r=0;r<vA.length&&t!==0&&t<vA[r].priority;r++);vA.splice(r,0,e),r===0&&jz(e)}};function Gk(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function gM(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==\" react-mount-point-unstable \"))}function hz(){}function jtt(e,t,r,i,n){if(n){if(typeof i==\"function\"){var s=i;i=function(){var _=iM(o);s.call(_)}}var o=c8(t,i,e,0,null,!1,!1,\"\",hz);return e._reactRootContainer=o,e[qd]=o.current,v1(e.nodeType===8?e.parentNode:e),w0(),o}for(;n=e.lastChild;)e.removeChild(n);if(typeof i==\"function\"){var c=i;i=function(){var _=iM(d);c.call(_)}}var d=Uk(e,0,!1,null,null,!1,!1,\"\",hz);return e._reactRootContainer=d,e[qd]=d.current,v1(e.nodeType===8?e.parentNode:e),w0(function(){AM(t,d,r,i)}),d}function _M(e,t,r,i,n){var s=r._reactRootContainer;if(s){var o=s;if(typeof n==\"function\"){var c=n;n=function(){var d=iM(o);c.call(d)}}AM(t,o,e,n)}else o=jtt(r,t,e,n,i);return iM(o)}zz=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=e1(t.pendingLanes);r!==0&&(lk(t,r|1),ql(t,$s()),!(Fi&6)&&(H_=$s()+500,BA()))}break;case 13:w0(function(){var i=Zd(e,1);if(i!==null){var n=yl();Th(i,e,1,n)}}),Vk(e,1)}};ck=function(e){if(e.tag===13){var t=Zd(e,134217728);if(t!==null){var r=yl();Th(t,e,134217728,r)}Vk(e,134217728)}};Nz=function(e){if(e.tag===13){var t=CA(e),r=Zd(e,t);if(r!==null){var i=yl();Th(r,e,t,i)}Vk(e,t)}};Uz=function(){return cn};Vz=function(e,t){var r=cn;try{return cn=e,t()}finally{cn=r}};xL=function(e,t,r){switch(t){case\"input\":if(pL(e,r),t=r.name,r.type===\"radio\"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll(\"input[name=\"+JSON.stringify(\"\"+t)+'][type=\"radio\"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var n=lM(i);if(!n)throw Error(Te(90));_z(i),pL(i,n)}}}break;case\"textarea\":vz(e,r);break;case\"select\":t=r.value,t!=null&&R_(e,!!r.multiple,t,!1)}};Ez=Bk;Pz=w0;var Gtt={usingClientEntryPoint:!1,Events:[L1,M_,lM,Tz,Mz,Bk]},Xx={findFiberByHostInstance:p0,bundleType:0,version:\"18.2.0\",rendererPackageName:\"react-dom\"},Wtt={bundleType:Xx.bundleType,version:Xx.version,rendererPackageName:Xx.rendererPackageName,rendererConfig:Xx.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$d.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Lz(e),e===null?null:e.stateNode},findFiberByHostInstance:Xx.findFiberByHostInstance||Vtt,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:\"18.2.0-next-9e3b772b8-20220608\"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<\"u\"&&(Kx=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Kx.isDisabled&&Kx.supportsFiber))try{nM=Kx.inject(Wtt),Nf=Kx}catch{}var Kx;Hc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Gtt;Hc.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Gk(t))throw Error(Te(200));return Utt(e,t,null,r)};Hc.createRoot=function(e,t){if(!Gk(e))throw Error(Te(299));var r=!1,i=\"\",n=u8;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(n=t.onRecoverableError)),t=Uk(e,1,!1,null,null,r,!1,i,n),e[qd]=t.current,v1(e.nodeType===8?e.parentNode:e),new jk(t)};Hc.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render==\"function\"?Error(Te(188)):(e=Object.keys(e).join(\",\"),Error(Te(268,e)));return e=Lz(t),e=e===null?null:e.stateNode,e};Hc.flushSync=function(e){return w0(e)};Hc.hydrate=function(e,t,r){if(!gM(t))throw Error(Te(200));return _M(null,e,t,!0,r)};Hc.hydrateRoot=function(e,t,r){if(!Gk(e))throw Error(Te(405));var i=r!=null&&r.hydratedSources||null,n=!1,s=\"\",o=u8;if(r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(s=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=c8(t,null,e,1,r??null,n,!1,s,o),e[qd]=t.current,v1(e),i)for(e=0;e<i.length;e++)r=i[e],n=r._getVersion,n=n(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,n]:t.mutableSourceEagerHydrationData.push(r,n);return new mM(t)};Hc.render=function(e,t,r){if(!gM(t))throw Error(Te(200));return _M(null,e,t,!1,r)};Hc.unmountComponentAtNode=function(e){if(!gM(e))throw Error(Te(40));return e._reactRootContainer?(w0(function(){_M(null,null,e,!1,function(){e._reactRootContainer=null,e[qd]=null})}),!0):!1};Hc.unstable_batchedUpdates=Bk;Hc.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!gM(r))throw Error(Te(200));if(e==null||e._reactInternals===void 0)throw Error(Te(38));return _M(e,t,r,!1,i)};Hc.version=\"18.2.0-next-9e3b772b8-20220608\"});var yM=zr((Vxt,d8)=>{\"use strict\";function f8(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>\"u\"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=\"function\"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f8)}catch(e){console.error(e)}}f8(),d8.exports=h8()});var A8=zr(Wk=>{\"use strict\";var p8=yM();Wk.createRoot=p8.createRoot,Wk.hydrateRoot=p8.hydrateRoot;var jxt});var L8=zr((e4,r4)=>{(function(e,t){typeof e4==\"object\"&&typeof r4<\"u\"?r4.exports=t():(e=typeof globalThis<\"u\"?globalThis:e||self,e.maplibregl=t())})(e4,function(){\"use strict\";var e={},t={};function r(n,s,o){if(t[n]=o,n===\"index\"){var c=\"var sharedModule = {}; (\"+t.shared+\")(sharedModule); (\"+t.worker+\")(sharedModule);\",d={};return t.shared(d),t.index(e,d),typeof window<\"u\"&&e.setWorkerUrl(window.URL.createObjectURL(new Blob([c],{type:\"text/javascript\"}))),e}}r(\"shared\",[\"exports\"],function(n){\"use strict\";function s(u,a,h,A){return new(h||(h=Promise))(function(x,E){function P(V){try{B(A.next(V))}catch(q){E(q)}}function D(V){try{B(A.throw(V))}catch(q){E(q)}}function B(V){var q;V.done?x(V.value):(q=V.value,q instanceof h?q:new h(function(Q){Q(q)})).then(P,D)}B((A=A.apply(u,a||[])).next())})}function o(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,\"default\")?u.default:u}typeof SuppressedError==\"function\"&&SuppressedError;var c=d;function d(u,a){this.x=u,this.y=a}d.prototype={clone:function(){return new d(this.x,this.y)},add:function(u){return this.clone()._add(u)},sub:function(u){return this.clone()._sub(u)},multByPoint:function(u){return this.clone()._multByPoint(u)},divByPoint:function(u){return this.clone()._divByPoint(u)},mult:function(u){return this.clone()._mult(u)},div:function(u){return this.clone()._div(u)},rotate:function(u){return this.clone()._rotate(u)},rotateAround:function(u,a){return this.clone()._rotateAround(u,a)},matMult:function(u){return this.clone()._matMult(u)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(u){return this.x===u.x&&this.y===u.y},dist:function(u){return Math.sqrt(this.distSqr(u))},distSqr:function(u){var a=u.x-this.x,h=u.y-this.y;return a*a+h*h},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(u){return Math.atan2(this.y-u.y,this.x-u.x)},angleWith:function(u){return this.angleWithSep(u.x,u.y)},angleWithSep:function(u,a){return Math.atan2(this.x*a-this.y*u,this.x*u+this.y*a)},_matMult:function(u){var a=u[2]*this.x+u[3]*this.y;return this.x=u[0]*this.x+u[1]*this.y,this.y=a,this},_add:function(u){return this.x+=u.x,this.y+=u.y,this},_sub:function(u){return this.x-=u.x,this.y-=u.y,this},_mult:function(u){return this.x*=u,this.y*=u,this},_div:function(u){return this.x/=u,this.y/=u,this},_multByPoint:function(u){return this.x*=u.x,this.y*=u.y,this},_divByPoint:function(u){return this.x/=u.x,this.y/=u.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var u=this.y;return this.y=this.x,this.x=-u,this},_rotate:function(u){var a=Math.cos(u),h=Math.sin(u),A=h*this.x+a*this.y;return this.x=a*this.x-h*this.y,this.y=A,this},_rotateAround:function(u,a){var h=Math.cos(u),A=Math.sin(u),x=a.y+A*(this.x-a.x)+h*(this.y-a.y);return this.x=a.x+h*(this.x-a.x)-A*(this.y-a.y),this.y=x,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},d.convert=function(u){return u instanceof d?u:Array.isArray(u)?new d(u[0],u[1]):u};var _=o(c),w=I;function I(u,a,h,A){this.cx=3*u,this.bx=3*(h-u)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*a,this.by=3*(A-a)-this.cy,this.ay=1-this.cy-this.by,this.p1x=u,this.p1y=a,this.p2x=h,this.p2y=A}I.prototype={sampleCurveX:function(u){return((this.ax*u+this.bx)*u+this.cx)*u},sampleCurveY:function(u){return((this.ay*u+this.by)*u+this.cy)*u},sampleCurveDerivativeX:function(u){return(3*this.ax*u+2*this.bx)*u+this.cx},solveCurveX:function(u,a){if(a===void 0&&(a=1e-6),u<0)return 0;if(u>1)return 1;for(var h=u,A=0;A<8;A++){var x=this.sampleCurveX(h)-u;if(Math.abs(x)<a)return h;var E=this.sampleCurveDerivativeX(h);if(Math.abs(E)<1e-6)break;h-=x/E}var P=0,D=1;for(h=u,A=0;A<20&&(x=this.sampleCurveX(h),!(Math.abs(x-u)<a));A++)u>x?P=h:D=h,h=.5*(D-P)+P;return h},solve:function(u,a){return this.sampleCurveY(this.solveCurveX(u,a))}};var R=o(w);let N,j;function Y(){return N==null&&(N=typeof OffscreenCanvas<\"u\"&&new OffscreenCanvas(1,1).getContext(\"2d\")&&typeof createImageBitmap==\"function\"),N}function it(){if(j==null&&(j=!1,Y())){let a=new OffscreenCanvas(5,5).getContext(\"2d\",{willReadFrequently:!0});if(a){for(let A=0;A<5*5;A++){let x=4*A;a.fillStyle=`rgb(${x},${x+1},${x+2})`,a.fillRect(A%5,Math.floor(A/5),1,1)}let h=a.getImageData(0,0,5,5).data;for(let A=0;A<5*5*4;A++)if(A%4!=3&&h[A]!==A){j=!0;break}}}return j||!1}function Z(u,a,h,A){let x=new R(u,a,h,A);return function(E){return x.solve(E)}}let K=Z(.25,.1,.25,1);function J(u,a,h){return Math.min(h,Math.max(a,u))}function ht(u,a,h){let A=h-a,x=((u-a)%A+A)%A+a;return x===a?h:x}function Tt(u,...a){for(let h of a)for(let A in h)u[A]=h[A];return u}let Ot=1;function Yt(u,a,h){let A={};for(let x in u)A[x]=a.call(h||this,u[x],x,u);return A}function te(u,a,h){let A={};for(let x in u)a.call(h||this,u[x],x,u)&&(A[x]=u[x]);return A}function oe(u){return Array.isArray(u)?u.map(oe):typeof u==\"object\"&&u?Yt(u,oe):u}let ae={};function Le(u){ae[u]||(typeof console<\"u\"&&console.warn(u),ae[u]=!0)}function sr(u,a,h){return(h.y-u.y)*(a.x-u.x)>(a.y-u.y)*(h.x-u.x)}function lr(u){let a=0;for(let h,A,x=0,E=u.length,P=E-1;x<E;P=x++)h=u[x],A=u[P],a+=(A.x-h.x)*(h.y+A.y);return a}function Cr(u){return typeof WorkerGlobalScope<\"u\"&&u!==void 0&&u instanceof WorkerGlobalScope}let un=null;function Fs(u){return typeof ImageBitmap<\"u\"&&u instanceof ImageBitmap}let Sc=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=\";function ws(u,a,h,A,x){return s(this,void 0,void 0,function*(){if(typeof VideoFrame>\"u\")throw new Error(\"VideoFrame not supported\");let E=new VideoFrame(u,{timestamp:0});try{let P=E?.format;if(!P||!P.startsWith(\"BGR\")&&!P.startsWith(\"RGB\"))throw new Error(`Unrecognized format ${P}`);let D=P.startsWith(\"BGR\"),B=new Uint8ClampedArray(A*x*4);if(yield E.copyTo(B,function(V,q,Q,rt,ot){let lt=4*Math.max(-q,0),pt=(Math.max(0,Q)-Q)*rt*4+lt,xt=4*rt,Mt=Math.max(0,q),Vt=Math.max(0,Q);return{rect:{x:Mt,y:Vt,width:Math.min(V.width,q+rt)-Mt,height:Math.min(V.height,Q+ot)-Vt},layout:[{offset:pt,stride:xt}]}}(u,a,h,A,x)),D)for(let V=0;V<B.length;V+=4){let q=B[V];B[V]=B[V+2],B[V+2]=q}return B}finally{E.close()}})}let io,Ss,_o=\"AbortError\";function oa(){return new Error(_o)}let sl={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:\"\"};function Ia(u){return sl.REGISTERED_PROTOCOLS[u.substring(0,u.indexOf(\"://\"))]}let Uo=\"global-dispatcher\";class Ci extends Error{constructor(a,h,A,x){super(`AJAXError: ${h} (${a}): ${A}`),this.status=a,this.statusText=h,this.url=A,this.body=x}}let yo=()=>Cr(self)?self.worker&&self.worker.referrer:(window.location.protocol===\"blob:\"?window.parent:window).location.href,Oi=function(u,a){if(/:\\/\\//.test(u.url)&&!/^https?:|^file:/.test(u.url)){let A=Ia(u.url);if(A)return A(u,a);if(Cr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:\"getResource\",data:u,targetMapId:Uo},a)}if(!(/^file:/.test(h=u.url)||/^file:/.test(yo())&&!/^\\w+:/.test(h))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,\"signal\"))return function(A,x){return s(this,void 0,void 0,function*(){let E=new Request(A.url,{method:A.method||\"GET\",body:A.body,credentials:A.credentials,headers:A.headers,cache:A.cache,referrer:yo(),signal:x.signal});A.type===\"json\"&&E.headers.set(\"Accept\",\"application/json\");let P=yield fetch(E);if(!P.ok){let V=yield P.blob();throw new Ci(P.status,P.statusText,A.url,V)}let D=A.type===\"arrayBuffer\"||A.type===\"image\"?P.arrayBuffer():A.type===\"json\"?P.json():P.text(),B=yield D;if(x.signal.aborted)throw oa();return{data:B,cacheControl:P.headers.get(\"Cache-Control\"),expires:P.headers.get(\"Expires\")}})}(u,a);if(Cr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:\"getResource\",data:u,mustQueue:!0,targetMapId:Uo},a)}var h;return function(A,x){return new Promise((E,P)=>{let D=new XMLHttpRequest;D.open(A.method||\"GET\",A.url,!0),A.type!==\"arrayBuffer\"&&A.type!==\"image\"||(D.responseType=\"arraybuffer\");for(let B in A.headers)D.setRequestHeader(B,A.headers[B]);A.type===\"json\"&&(D.responseType=\"text\",D.setRequestHeader(\"Accept\",\"application/json\")),D.withCredentials=A.credentials===\"include\",D.onerror=()=>{P(new Error(D.statusText))},D.onload=()=>{if(!x.signal.aborted)if((D.status>=200&&D.status<300||D.status===0)&&D.response!==null){let B=D.response;if(A.type===\"json\")try{B=JSON.parse(D.response)}catch(V){return void P(V)}E({data:B,cacheControl:D.getResponseHeader(\"Cache-Control\"),expires:D.getResponseHeader(\"Expires\")})}else{let B=new Blob([D.response],{type:D.getResponseHeader(\"Content-Type\")});P(new Ci(D.status,D.statusText,A.url,B))}},x.signal.addEventListener(\"abort\",()=>{D.abort(),P(oa())}),D.send(A.body)})}(u,a)};function ls(u){if(!u||u.indexOf(\"://\")<=0||u.indexOf(\"data:image/\")===0||u.indexOf(\"blob:\")===0)return!0;let a=new URL(u),h=window.location;return a.protocol===h.protocol&&a.host===h.host}function Vo(u,a,h){h[u]&&h[u].indexOf(a)!==-1||(h[u]=h[u]||[],h[u].push(a))}function jo(u,a,h){if(h&&h[u]){let A=h[u].indexOf(a);A!==-1&&h[u].splice(A,1)}}class Go{constructor(a,h={}){Tt(this,h),this.type=a}}class an extends Go{constructor(a,h={}){super(\"error\",Tt({error:a},h))}}class aa{on(a,h){return this._listeners=this._listeners||{},Vo(a,h,this._listeners),this}off(a,h){return jo(a,h,this._listeners),jo(a,h,this._oneTimeListeners),this}once(a,h){return h?(this._oneTimeListeners=this._oneTimeListeners||{},Vo(a,h,this._oneTimeListeners),this):new Promise(A=>this.once(a,A))}fire(a,h){typeof a==\"string\"&&(a=new Go(a,h||{}));let A=a.type;if(this.listens(A)){a.target=this;let x=this._listeners&&this._listeners[A]?this._listeners[A].slice():[];for(let D of x)D.call(this,a);let E=this._oneTimeListeners&&this._oneTimeListeners[A]?this._oneTimeListeners[A].slice():[];for(let D of E)jo(A,D,this._oneTimeListeners),D.call(this,a);let P=this._eventedParent;P&&(Tt(a,typeof this._eventedParentData==\"function\"?this._eventedParentData():this._eventedParentData),P.fire(a))}else a instanceof an&&console.error(a.error);return this}listens(a){return this._listeners&&this._listeners[a]&&this._listeners[a].length>0||this._oneTimeListeners&&this._oneTimeListeners[a]&&this._oneTimeListeners[a].length>0||this._eventedParent&&this._eventedParent.listens(a)}setEventedParent(a,h){return this._eventedParent=a,this._eventedParentData=h,this}}var Jt={$version:8,$root:{version:{required:!0,type:\"enum\",values:[8]},name:{type:\"string\"},metadata:{type:\"*\"},center:{type:\"array\",value:\"number\"},zoom:{type:\"number\"},bearing:{type:\"number\",default:0,period:360,units:\"degrees\"},pitch:{type:\"number\",default:0,units:\"degrees\"},light:{type:\"light\"},sky:{type:\"sky\"},terrain:{type:\"terrain\"},sources:{required:!0,type:\"sources\"},sprite:{type:\"sprite\"},glyphs:{type:\"string\"},transition:{type:\"transition\"},layers:{required:!0,type:\"array\",value:\"layer\"}},sources:{\"*\":{type:\"source\"}},source:[\"source_vector\",\"source_raster\",\"source_raster_dem\",\"source_geojson\",\"source_video\",\"source_image\"],source_vector:{type:{required:!0,type:\"enum\",values:{vector:{}}},url:{type:\"string\"},tiles:{type:\"array\",value:\"string\"},bounds:{type:\"array\",value:\"number\",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:\"enum\",values:{xyz:{},tms:{}},default:\"xyz\"},minzoom:{type:\"number\",default:0},maxzoom:{type:\"number\",default:22},attribution:{type:\"string\"},promoteId:{type:\"promoteId\"},volatile:{type:\"boolean\",default:!1},\"*\":{type:\"*\"}},source_raster:{type:{required:!0,type:\"enum\",values:{raster:{}}},url:{type:\"string\"},tiles:{type:\"array\",value:\"string\"},bounds:{type:\"array\",value:\"number\",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:\"number\",default:0},maxzoom:{type:\"number\",default:22},tileSize:{type:\"number\",default:512,units:\"pixels\"},scheme:{type:\"enum\",values:{xyz:{},tms:{}},default:\"xyz\"},attribution:{type:\"string\"},volatile:{type:\"boolean\",default:!1},\"*\":{type:\"*\"}},source_raster_dem:{type:{required:!0,type:\"enum\",values:{\"raster-dem\":{}}},url:{type:\"string\"},tiles:{type:\"array\",value:\"string\"},bounds:{type:\"array\",value:\"number\",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:\"number\",default:0},maxzoom:{type:\"number\",default:22},tileSize:{type:\"number\",default:512,units:\"pixels\"},attribution:{type:\"string\"},encoding:{type:\"enum\",values:{terrarium:{},mapbox:{},custom:{}},default:\"mapbox\"},redFactor:{type:\"number\",default:1},blueFactor:{type:\"number\",default:1},greenFactor:{type:\"number\",default:1},baseShift:{type:\"number\",default:0},volatile:{type:\"boolean\",default:!1},\"*\":{type:\"*\"}},source_geojson:{type:{required:!0,type:\"enum\",values:{geojson:{}}},data:{required:!0,type:\"*\"},maxzoom:{type:\"number\",default:18},attribution:{type:\"string\"},buffer:{type:\"number\",default:128,maximum:512,minimum:0},filter:{type:\"*\"},tolerance:{type:\"number\",default:.375},cluster:{type:\"boolean\",default:!1},clusterRadius:{type:\"number\",default:50,minimum:0},clusterMaxZoom:{type:\"number\"},clusterMinPoints:{type:\"number\"},clusterProperties:{type:\"*\"},lineMetrics:{type:\"boolean\",default:!1},generateId:{type:\"boolean\",default:!1},promoteId:{type:\"promoteId\"}},source_video:{type:{required:!0,type:\"enum\",values:{video:{}}},urls:{required:!0,type:\"array\",value:\"string\"},coordinates:{required:!0,type:\"array\",length:4,value:{type:\"array\",length:2,value:\"number\"}}},source_image:{type:{required:!0,type:\"enum\",values:{image:{}}},url:{required:!0,type:\"string\"},coordinates:{required:!0,type:\"array\",length:4,value:{type:\"array\",length:2,value:\"number\"}}},layer:{id:{type:\"string\",required:!0},type:{type:\"enum\",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},\"fill-extrusion\":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:\"*\"},source:{type:\"string\"},\"source-layer\":{type:\"string\"},minzoom:{type:\"number\",minimum:0,maximum:24},maxzoom:{type:\"number\",minimum:0,maximum:24},filter:{type:\"filter\"},layout:{type:\"layout\"},paint:{type:\"paint\"}},layout:[\"layout_fill\",\"layout_line\",\"layout_circle\",\"layout_heatmap\",\"layout_fill-extrusion\",\"layout_symbol\",\"layout_raster\",\"layout_hillshade\",\"layout_background\"],layout_background:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",\"property-type\":\"constant\"}},layout_fill:{\"fill-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",\"property-type\":\"constant\"}},layout_circle:{\"circle-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",\"property-type\":\"constant\"}},layout_heatmap:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",\"property-type\":\"constant\"}},\"layout_fill-extrusion\":{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",\"property-type\":\"constant\"}},layout_line:{\"line-cap\":{type:\"enum\",values:{butt:{},round:{},square:{}},default:\"butt\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-join\":{type:\"enum\",values:{bevel:{},round:{},miter:{}},default:\"miter\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"line-miter-limit\":{type:\"number\",default:2,requires:[{\"line-join\":\"miter\"}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-round-limit\":{type:\"number\",default:1.05,requires:[{\"line-join\":\"round\"}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",\"property-type\":\"constant\"}},layout_symbol:{\"symbol-placement\":{type:\"enum\",values:{point:{},line:{},\"line-center\":{}},default:\"point\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-spacing\":{type:\"number\",default:250,minimum:1,units:\"pixels\",requires:[{\"symbol-placement\":\"line\"}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-avoid-edges\":{type:\"boolean\",default:!1,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"symbol-sort-key\":{type:\"number\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"symbol-z-order\":{type:\"enum\",values:{auto:{},\"viewport-y\":{},source:{}},default:\"auto\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-allow-overlap\":{type:\"boolean\",default:!1,requires:[\"icon-image\",{\"!\":\"icon-overlap\"}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-overlap\":{type:\"enum\",values:{never:{},always:{},cooperative:{}},requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-ignore-placement\":{type:\"boolean\",default:!1,requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-optional\":{type:\"boolean\",default:!1,requires:[\"icon-image\",\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-rotation-alignment\":{type:\"enum\",values:{map:{},viewport:{},auto:{}},default:\"auto\",requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-size\":{type:\"number\",default:1,minimum:0,units:\"factor of the original icon size\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-text-fit\":{type:\"enum\",values:{none:{},width:{},height:{},both:{}},default:\"none\",requires:[\"icon-image\",\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-text-fit-padding\":{type:\"array\",value:\"number\",length:4,default:[0,0,0,0],units:\"pixels\",requires:[\"icon-image\",\"text-field\",{\"icon-text-fit\":[\"both\",\"width\",\"height\"]}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-image\":{type:\"resolvedImage\",tokens:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-rotate\":{type:\"number\",default:0,period:360,units:\"degrees\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-padding\":{type:\"padding\",default:[2],units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-keep-upright\":{type:\"boolean\",default:!1,requires:[\"icon-image\",{\"icon-rotation-alignment\":\"map\"},{\"symbol-placement\":[\"line\",\"line-center\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-offset\":{type:\"array\",value:\"number\",length:2,default:[0,0],requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-anchor\":{type:\"enum\",values:{center:{},left:{},right:{},top:{},bottom:{},\"top-left\":{},\"top-right\":{},\"bottom-left\":{},\"bottom-right\":{}},default:\"center\",requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"icon-pitch-alignment\":{type:\"enum\",values:{map:{},viewport:{},auto:{}},default:\"auto\",requires:[\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-pitch-alignment\":{type:\"enum\",values:{map:{},viewport:{},auto:{}},default:\"auto\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-rotation-alignment\":{type:\"enum\",values:{map:{},viewport:{},\"viewport-glyph\":{},auto:{}},default:\"auto\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-field\":{type:\"formatted\",default:\"\",tokens:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-font\":{type:\"array\",value:\"string\",default:[\"Open Sans Regular\",\"Arial Unicode MS Regular\"],requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-size\":{type:\"number\",default:16,minimum:0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-max-width\":{type:\"number\",default:10,minimum:0,units:\"ems\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-line-height\":{type:\"number\",default:1.2,units:\"ems\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-letter-spacing\":{type:\"number\",default:0,units:\"ems\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-justify\":{type:\"enum\",values:{auto:{},left:{},center:{},right:{}},default:\"center\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-radial-offset\":{type:\"number\",units:\"ems\",default:0,requires:[\"text-field\"],\"property-type\":\"data-driven\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]}},\"text-variable-anchor\":{type:\"array\",value:\"enum\",values:{center:{},left:{},right:{},top:{},bottom:{},\"top-left\":{},\"top-right\":{},\"bottom-left\":{},\"bottom-right\":{}},requires:[\"text-field\",{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-variable-anchor-offset\":{type:\"variableAnchorOffsetCollection\",requires:[\"text-field\",{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-anchor\":{type:\"enum\",values:{center:{},left:{},right:{},top:{},bottom:{},\"top-left\":{},\"top-right\":{},\"bottom-left\":{},\"bottom-right\":{}},default:\"center\",requires:[\"text-field\",{\"!\":\"text-variable-anchor\"}],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-max-angle\":{type:\"number\",default:45,units:\"degrees\",requires:[\"text-field\",{\"symbol-placement\":[\"line\",\"line-center\"]}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-writing-mode\":{type:\"array\",value:\"enum\",values:{horizontal:{},vertical:{}},requires:[\"text-field\",{\"symbol-placement\":[\"point\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-rotate\":{type:\"number\",default:0,period:360,units:\"degrees\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-padding\":{type:\"number\",default:2,minimum:0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-keep-upright\":{type:\"boolean\",default:!0,requires:[\"text-field\",{\"text-rotation-alignment\":\"map\"},{\"symbol-placement\":[\"line\",\"line-center\"]}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-transform\":{type:\"enum\",values:{none:{},uppercase:{},lowercase:{}},default:\"none\",requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-offset\":{type:\"array\",value:\"number\",units:\"ems\",length:2,default:[0,0],requires:[\"text-field\",{\"!\":\"text-radial-offset\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"data-driven\"},\"text-allow-overlap\":{type:\"boolean\",default:!1,requires:[\"text-field\",{\"!\":\"text-overlap\"}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-overlap\":{type:\"enum\",values:{never:{},always:{},cooperative:{}},requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-ignore-placement\":{type:\"boolean\",default:!1,requires:[\"text-field\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-optional\":{type:\"boolean\",default:!1,requires:[\"text-field\",\"icon-image\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",\"property-type\":\"constant\"}},layout_raster:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",\"property-type\":\"constant\"}},layout_hillshade:{visibility:{type:\"enum\",values:{visible:{},none:{}},default:\"visible\",\"property-type\":\"constant\"}},filter:{type:\"array\",value:\"*\"},filter_operator:{type:\"enum\",values:{\"==\":{},\"!=\":{},\">\":{},\">=\":{},\"<\":{},\"<=\":{},in:{},\"!in\":{},all:{},any:{},none:{},has:{},\"!has\":{},within:{}}},geometry_type:{type:\"enum\",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:\"expression\"},stops:{type:\"array\",value:\"function_stop\"},base:{type:\"number\",default:1,minimum:0},property:{type:\"string\",default:\"$zoom\"},type:{type:\"enum\",values:{identity:{},exponential:{},interval:{},categorical:{}},default:\"exponential\"},colorSpace:{type:\"enum\",values:{rgb:{},lab:{},hcl:{}},default:\"rgb\"},default:{type:\"*\",required:!1}},function_stop:{type:\"array\",minimum:0,maximum:24,value:[\"number\",\"color\"],length:2},expression:{type:\"array\",value:\"*\",minimum:1},light:{anchor:{type:\"enum\",default:\"viewport\",values:{map:{},viewport:{}},\"property-type\":\"data-constant\",transition:!1,expression:{interpolated:!1,parameters:[\"zoom\"]}},position:{type:\"array\",default:[1.15,210,30],length:3,value:\"number\",\"property-type\":\"data-constant\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]}},color:{type:\"color\",\"property-type\":\"data-constant\",default:\"#ffffff\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},intensity:{type:\"number\",\"property-type\":\"data-constant\",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0}},sky:{\"sky-color\":{type:\"color\",\"property-type\":\"data-constant\",default:\"#88C6FC\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"fog-color\":{type:\"color\",\"property-type\":\"data-constant\",default:\"#ffffff\",expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"fog-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0},\"horizon-blend\":{type:\"number\",\"property-type\":\"data-constant\",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:[\"zoom\"]},transition:!0}},terrain:{source:{type:\"string\",required:!0},exaggeration:{type:\"number\",minimum:0,default:1}},paint:[\"paint_fill\",\"paint_line\",\"paint_circle\",\"paint_heatmap\",\"paint_fill-extrusion\",\"paint_symbol\",\"paint_raster\",\"paint_hillshade\",\"paint_background\"],paint_fill:{\"fill-antialias\":{type:\"boolean\",default:!0,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"fill-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-outline-color\":{type:\"color\",transition:!0,requires:[{\"!\":\"fill-pattern\"},{\"fill-antialias\":!0}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"fill-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"}},\"paint_fill-extrusion\":{\"fill-extrusion-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"fill-extrusion-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"fill-extrusion-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"fill-extrusion-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"fill-extrusion-height\":{type:\"number\",default:0,minimum:0,units:\"meters\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-base\":{type:\"number\",default:0,minimum:0,units:\"meters\",transition:!0,requires:[\"fill-extrusion-height\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"fill-extrusion-vertical-gradient\":{type:\"boolean\",default:!0,transition:!1,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_line:{\"line-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"line-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"line-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"line-width\":{type:\"number\",default:1,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-gap-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-offset\":{type:\"number\",default:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"line-dasharray\":{type:\"array\",value:\"number\",minimum:0,transition:!0,units:\"line widths\",requires:[{\"!\":\"line-pattern\"}],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"cross-faded\"},\"line-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]},\"property-type\":\"cross-faded-data-driven\"},\"line-gradient\":{type:\"color\",transition:!1,requires:[{\"!\":\"line-dasharray\"},{\"!\":\"line-pattern\"},{source:\"geojson\",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:[\"line-progress\"]},\"property-type\":\"color-ramp\"}},paint_circle:{\"circle-radius\":{type:\"number\",default:5,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-blur\":{type:\"number\",default:0,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"circle-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-pitch-scale\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-pitch-alignment\":{type:\"enum\",values:{map:{},viewport:{}},default:\"viewport\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"circle-stroke-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-stroke-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"circle-stroke-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"}},paint_heatmap:{\"heatmap-radius\":{type:\"number\",default:30,minimum:1,transition:!0,units:\"pixels\",expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"heatmap-weight\":{type:\"number\",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"heatmap-intensity\":{type:\"number\",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"heatmap-color\":{type:\"color\",default:[\"interpolate\",[\"linear\"],[\"heatmap-density\"],0,\"rgba(0, 0, 255, 0)\",.1,\"royalblue\",.3,\"cyan\",.5,\"lime\",.7,\"yellow\",1,\"red\"],transition:!1,expression:{interpolated:!0,parameters:[\"heatmap-density\"]},\"property-type\":\"color-ramp\"},\"heatmap-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_symbol:{\"icon-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-color\":{type:\"color\",default:\"rgba(0, 0, 0, 0)\",transition:!0,requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-halo-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"icon-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",requires:[\"icon-image\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"icon-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"icon-image\",\"icon-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-color\":{type:\"color\",default:\"#000000\",transition:!0,overridable:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-color\":{type:\"color\",default:\"rgba(0, 0, 0, 0)\",transition:!0,requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-width\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-halo-blur\":{type:\"number\",default:0,minimum:0,transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\",\"feature\",\"feature-state\"]},\"property-type\":\"data-driven\"},\"text-translate\":{type:\"array\",value:\"number\",length:2,default:[0,0],transition:!0,units:\"pixels\",requires:[\"text-field\"],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"text-translate-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"map\",requires:[\"text-field\",\"text-translate\"],expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_raster:{\"raster-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-hue-rotate\":{type:\"number\",default:0,period:360,transition:!0,units:\"degrees\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-brightness-min\":{type:\"number\",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-brightness-max\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-saturation\":{type:\"number\",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-contrast\":{type:\"number\",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-resampling\":{type:\"enum\",values:{linear:{},nearest:{}},default:\"linear\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"raster-fade-duration\":{type:\"number\",default:300,minimum:0,transition:!1,units:\"milliseconds\",expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_hillshade:{\"hillshade-illumination-direction\":{type:\"number\",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-illumination-anchor\":{type:\"enum\",values:{map:{},viewport:{}},default:\"viewport\",expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-exaggeration\":{type:\"number\",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-shadow-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-highlight-color\":{type:\"color\",default:\"#FFFFFF\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"hillshade-accent-color\":{type:\"color\",default:\"#000000\",transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},paint_background:{\"background-color\":{type:\"color\",default:\"#000000\",transition:!0,requires:[{\"!\":\"background-pattern\"}],expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"},\"background-pattern\":{type:\"resolvedImage\",transition:!0,expression:{interpolated:!1,parameters:[\"zoom\"]},\"property-type\":\"cross-faded\"},\"background-opacity\":{type:\"number\",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:[\"zoom\"]},\"property-type\":\"data-constant\"}},transition:{duration:{type:\"number\",default:300,minimum:0,units:\"milliseconds\"},delay:{type:\"number\",default:0,minimum:0,units:\"milliseconds\"}},\"property-type\":{\"data-driven\":{type:\"property-type\"},\"cross-faded\":{type:\"property-type\"},\"cross-faded-data-driven\":{type:\"property-type\"},\"color-ramp\":{type:\"property-type\"},\"data-constant\":{type:\"property-type\"},constant:{type:\"property-type\"}},promoteId:{\"*\":{type:\"string\"}}};let vo=[\"type\",\"source\",\"source-layer\",\"minzoom\",\"maxzoom\",\"filter\",\"layout\"];function hu(u,a){let h={};for(let A in u)A!==\"ref\"&&(h[A]=u[A]);return vo.forEach(A=>{A in a&&(h[A]=a[A])}),h}function ti(u,a){if(Array.isArray(u)){if(!Array.isArray(a)||u.length!==a.length)return!1;for(let h=0;h<u.length;h++)if(!ti(u[h],a[h]))return!1;return!0}if(typeof u==\"object\"&&u!==null&&a!==null){if(typeof a!=\"object\"||Object.keys(u).length!==Object.keys(a).length)return!1;for(let h in u)if(!ti(u[h],a[h]))return!1;return!0}return u===a}function In(u,a){u.push(a)}function xn(u,a,h){In(h,{command:\"addSource\",args:[u,a[u]]})}function Wo(u,a,h){In(a,{command:\"removeSource\",args:[u]}),h[u]=!0}function Dl(u,a,h,A){Wo(u,h,A),xn(u,a,h)}function Ca(u,a,h){let A;for(A in u[h])if(Object.prototype.hasOwnProperty.call(u[h],A)&&A!==\"data\"&&!ti(u[h][A],a[h][A]))return!1;for(A in a[h])if(Object.prototype.hasOwnProperty.call(a[h],A)&&A!==\"data\"&&!ti(u[h][A],a[h][A]))return!1;return!0}function Tc(u,a,h,A,x,E){u=u||{},a=a||{};for(let P in u)Object.prototype.hasOwnProperty.call(u,P)&&(ti(u[P],a[P])||h.push({command:E,args:[A,P,a[P],x]}));for(let P in a)Object.prototype.hasOwnProperty.call(a,P)&&!Object.prototype.hasOwnProperty.call(u,P)&&(ti(u[P],a[P])||h.push({command:E,args:[A,P,a[P],x]}))}function hf(u){return u.id}function Ts(u,a){return u[a.id]=a,u}class Ae{constructor(a,h,A,x){this.message=(a?`${a}: `:\"\")+A,x&&(this.identifier=x),h!=null&&h.__line__&&(this.line=h.__line__)}}function Ho(u,...a){for(let h of a)for(let A in h)u[A]=h[A];return u}class Vn extends Error{constructor(a,h){super(h),this.message=h,this.key=a}}class La{constructor(a,h=[]){this.parent=a,this.bindings={};for(let[A,x]of h)this.bindings[A]=x}concat(a){return new La(this,a)}get(a){if(this.bindings[a])return this.bindings[a];if(this.parent)return this.parent.get(a);throw new Error(`${a} not found in scope.`)}has(a){return!!this.bindings[a]||!!this.parent&&this.parent.has(a)}}let ts={kind:\"null\"},be={kind:\"number\"},Lr={kind:\"string\"},wr={kind:\"boolean\"},Cn={kind:\"color\"},ka={kind:\"object\"},mr={kind:\"value\"},Mc={kind:\"collator\"},jn={kind:\"formatted\"},vt={kind:\"padding\"},tt={kind:\"resolvedImage\"},nt={kind:\"variableAnchorOffsetCollection\"};function ct(u,a){return{kind:\"array\",itemType:u,N:a}}function mt(u){if(u.kind===\"array\"){let a=mt(u.itemType);return typeof u.N==\"number\"?`array<${a}, ${u.N}>`:u.itemType.kind===\"value\"?\"array\":`array<${a}>`}return u.kind}let Rt=[ts,be,Lr,wr,Cn,jn,ka,ct(mr),vt,tt,nt];function Dt(u,a){if(a.kind===\"error\")return null;if(u.kind===\"array\"){if(a.kind===\"array\"&&(a.N===0&&a.itemType.kind===\"value\"||!Dt(u.itemType,a.itemType))&&(typeof u.N!=\"number\"||u.N===a.N))return null}else{if(u.kind===a.kind)return null;if(u.kind===\"value\"){for(let h of Rt)if(!Dt(h,a))return null}}return`Expected ${mt(u)} but found ${mt(a)} instead.`}function Ut(u,a){return a.some(h=>h.kind===u.kind)}function ft(u,a){return a.some(h=>h===\"null\"?u===null:h===\"array\"?Array.isArray(u):h===\"object\"?u&&!Array.isArray(u)&&typeof u==\"object\":h===typeof u)}function jt(u,a){return u.kind===\"array\"&&a.kind===\"array\"?u.itemType.kind===a.itemType.kind&&typeof u.N==\"number\":u.kind===a.kind}let le=.96422,ee=.82521,re=4/29,Je=6/29,ir=3*Je*Je,kr=Je*Je*Je,_r=Math.PI/180,ii=180/Math.PI;function Si(u){return(u%=360)<0&&(u+=360),u}function Wi([u,a,h,A]){let x,E,P=Rr((.2225045*(u=bn(u))+.7168786*(a=bn(a))+.0606169*(h=bn(h)))/1);u===a&&a===h?x=E=P:(x=Rr((.4360747*u+.3850649*a+.1430804*h)/le),E=Rr((.0139322*u+.0971045*a+.7141733*h)/ee));let D=116*P-16;return[D<0?0:D,500*(x-P),200*(P-E),A]}function bn(u){return u<=.04045?u/12.92:Math.pow((u+.055)/1.055,2.4)}function Rr(u){return u>kr?Math.pow(u,1/3):u/ir+re}function Ji([u,a,h,A]){let x=(u+16)/116,E=isNaN(a)?x:x+a/500,P=isNaN(h)?x:x-h/200;return x=1*es(x),E=le*es(E),P=ee*es(P),[tn(3.1338561*E-1.6168667*x-.4906146*P),tn(-.9787684*E+1.9161415*x+.033454*P),tn(.0719453*E-.2289914*x+1.4052427*P),A]}function tn(u){return(u=u<=.00304?12.92*u:1.055*Math.pow(u,1/2.4)-.055)<0?0:u>1?1:u}function es(u){return u>Je?u*u*u:ir*(u-re)}function cs(u){return parseInt(u.padEnd(2,u),16)/255}function Ln(u,a){return la(a?u/100:u,0,1)}function la(u,a,h){return Math.min(Math.max(a,u),h)}function Fm(u){return!u.some(Number.isNaN)}let $g={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class mi{constructor(a,h,A,x=1,E=!0){this.r=a,this.g=h,this.b=A,this.a=x,E||(this.r*=x,this.g*=x,this.b*=x,x||this.overwriteGetter(\"rgb\",[a,h,A,x]))}static parse(a){if(a instanceof mi)return a;if(typeof a!=\"string\")return;let h=function(A){if((A=A.toLowerCase().trim())===\"transparent\")return[0,0,0,0];let x=$g[A];if(x){let[P,D,B]=x;return[P/255,D/255,B/255,1]}if(A.startsWith(\"#\")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(A)){let P=A.length<6?1:2,D=1;return[cs(A.slice(D,D+=P)),cs(A.slice(D,D+=P)),cs(A.slice(D,D+=P)),cs(A.slice(D,D+P)||\"ff\")]}if(A.startsWith(\"rgb\")){let P=A.match(/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(P){let[D,B,V,q,Q,rt,ot,lt,pt,xt,Mt,Vt]=P,It=[q||\" \",ot||\" \",xt].join(\"\");if(It===\" \"||It===\" /\"||It===\",,\"||It===\",,,\"){let zt=[V,rt,pt].join(\"\"),ie=zt===\"%%%\"?100:zt===\"\"?255:0;if(ie){let ue=[la(+B/ie,0,1),la(+Q/ie,0,1),la(+lt/ie,0,1),Mt?Ln(+Mt,Vt):1];if(Fm(ue))return ue}}return}}let E=A.match(/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/);if(E){let[P,D,B,V,q,Q,rt,ot,lt]=E,pt=[B||\" \",q||\" \",rt].join(\"\");if(pt===\" \"||pt===\" /\"||pt===\",,\"||pt===\",,,\"){let xt=[+D,la(+V,0,100),la(+Q,0,100),ot?Ln(+ot,lt):1];if(Fm(xt))return function([Mt,Vt,It,zt]){function ie(ue){let Be=(ue+Mt/30)%12,Ke=Vt*Math.min(It,1-It);return It-Ke*Math.max(-1,Math.min(Be-3,9-Be,1))}return Mt=Si(Mt),Vt/=100,It/=100,[ie(0),ie(8),ie(4),zt]}(xt)}}}(a);return h?new mi(...h,!1):void 0}get rgb(){let{r:a,g:h,b:A,a:x}=this,E=x||1/0;return this.overwriteGetter(\"rgb\",[a/E,h/E,A/E,x])}get hcl(){return this.overwriteGetter(\"hcl\",function(a){let[h,A,x,E]=Wi(a),P=Math.sqrt(A*A+x*x);return[Math.round(1e4*P)?Si(Math.atan2(x,A)*ii):NaN,P,h,E]}(this.rgb))}get lab(){return this.overwriteGetter(\"lab\",Wi(this.rgb))}overwriteGetter(a,h){return Object.defineProperty(this,a,{value:h}),h}toString(){let[a,h,A,x]=this.rgb;return`rgba(${[a,h,A].map(E=>Math.round(255*E)).join(\",\")},${x})`}}mi.black=new mi(0,0,0,1),mi.white=new mi(1,1,1,1),mi.transparent=new mi(0,0,0,0),mi.red=new mi(1,0,0,1);class xo{constructor(a,h,A){this.sensitivity=a?h?\"variant\":\"case\":h?\"accent\":\"base\",this.locale=A,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:\"search\"})}compare(a,h){return this.collator.compare(a,h)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ec{constructor(a,h,A,x,E){this.text=a,this.image=h,this.scale=A,this.fontStack=x,this.textColor=E}}class Gn{constructor(a){this.sections=a}static fromString(a){return new Gn([new Ec(a,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(a=>a.text.length!==0||a.image&&a.image.name.length!==0)}static factory(a){return a instanceof Gn?a:Gn.fromString(a)}toString(){return this.sections.length===0?\"\":this.sections.map(a=>a.text).join(\"\")}}class wn{constructor(a){this.values=a.slice()}static parse(a){if(a instanceof wn)return a;if(typeof a==\"number\")return new wn([a,a,a,a]);if(Array.isArray(a)&&!(a.length<1||a.length>4)){for(let h of a)if(typeof h!=\"number\")return;switch(a.length){case 1:a=[a[0],a[0],a[0],a[0]];break;case 2:a=[a[0],a[1],a[0],a[1]];break;case 3:a=[a[0],a[1],a[2],a[1]]}return new wn(a)}}toString(){return JSON.stringify(this.values)}}let Ol=new Set([\"center\",\"left\",\"right\",\"top\",\"bottom\",\"top-left\",\"top-right\",\"bottom-left\",\"bottom-right\"]);class kn{constructor(a){this.values=a.slice()}static parse(a){if(a instanceof kn)return a;if(Array.isArray(a)&&!(a.length<1)&&a.length%2==0){for(let h=0;h<a.length;h+=2){let A=a[h],x=a[h+1];if(typeof A!=\"string\"||!Ol.has(A)||!Array.isArray(x)||x.length!==2||typeof x[0]!=\"number\"||typeof x[1]!=\"number\")return}return new kn(a)}}toString(){return JSON.stringify(this.values)}}class Wn{constructor(a){this.name=a.name,this.available=a.available}toString(){return this.name}static fromString(a){return a?new Wn({name:a,available:!1}):null}}function fu(u,a,h,A){return typeof u==\"number\"&&u>=0&&u<=255&&typeof a==\"number\"&&a>=0&&a<=255&&typeof h==\"number\"&&h>=0&&h<=255?A===void 0||typeof A==\"number\"&&A>=0&&A<=1?null:`Invalid rgba value [${[u,a,h,A].join(\", \")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof A==\"number\"?[u,a,h,A]:[u,a,h]).join(\", \")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ff(u){if(u===null||typeof u==\"string\"||typeof u==\"boolean\"||typeof u==\"number\"||u instanceof mi||u instanceof xo||u instanceof Gn||u instanceof wn||u instanceof kn||u instanceof Wn)return!0;if(Array.isArray(u)){for(let a of u)if(!ff(a))return!1;return!0}if(typeof u==\"object\"){for(let a in u)if(!ff(u[a]))return!1;return!0}return!1}function hn(u){if(u===null)return ts;if(typeof u==\"string\")return Lr;if(typeof u==\"boolean\")return wr;if(typeof u==\"number\")return be;if(u instanceof mi)return Cn;if(u instanceof xo)return Mc;if(u instanceof Gn)return jn;if(u instanceof wn)return vt;if(u instanceof kn)return nt;if(u instanceof Wn)return tt;if(Array.isArray(u)){let a=u.length,h;for(let A of u){let x=hn(A);if(h){if(h===x)continue;h=mr;break}h=x}return ct(h||mr,a)}return ka}function no(u){let a=typeof u;return u===null?\"\":a===\"string\"||a===\"number\"||a===\"boolean\"?String(u):u instanceof mi||u instanceof Gn||u instanceof wn||u instanceof kn||u instanceof Wn?u.toString():JSON.stringify(u)}class Ra{constructor(a,h){this.type=a,this.value=h}static parse(a,h){if(a.length!==2)return h.error(`'literal' expression requires exactly one argument, but found ${a.length-1} instead.`);if(!ff(a[1]))return h.error(\"invalid value\");let A=a[1],x=hn(A),E=h.expectedType;return x.kind!==\"array\"||x.N!==0||!E||E.kind!==\"array\"||typeof E.N==\"number\"&&E.N!==0||(x=E),new Ra(x,A)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Hi{constructor(a){this.name=\"ExpressionEvaluationError\",this.message=a}toJSON(){return this.message}}let lh={string:Lr,number:be,boolean:wr,object:ka};class so{constructor(a,h){this.type=a,this.args=h}static parse(a,h){if(a.length<2)return h.error(\"Expected at least one argument.\");let A,x=1,E=a[0];if(E===\"array\"){let D,B;if(a.length>2){let V=a[1];if(typeof V!=\"string\"||!(V in lh)||V===\"object\")return h.error('The item type argument of \"array\" must be one of string, number, boolean',1);D=lh[V],x++}else D=mr;if(a.length>3){if(a[2]!==null&&(typeof a[2]!=\"number\"||a[2]<0||a[2]!==Math.floor(a[2])))return h.error('The length argument to \"array\" must be a positive integer literal',2);B=a[2],x++}A=ct(D,B)}else{if(!lh[E])throw new Error(`Types doesn't contain name = ${E}`);A=lh[E]}let P=[];for(;x<a.length;x++){let D=h.parse(a[x],x,mr);if(!D)return null;P.push(D)}return new so(A,P)}evaluate(a){for(let h=0;h<this.args.length;h++){let A=this.args[h].evaluate(a);if(!Dt(this.type,hn(A)))return A;if(h===this.args.length-1)throw new Hi(`Expected value to be of type ${mt(this.type)}, but found ${mt(hn(A))} instead.`)}throw new Error}eachChild(a){this.args.forEach(a)}outputDefined(){return this.args.every(a=>a.outputDefined())}}let ch={\"to-boolean\":wr,\"to-color\":Cn,\"to-number\":be,\"to-string\":Lr};class qo{constructor(a,h){this.type=a,this.args=h}static parse(a,h){if(a.length<2)return h.error(\"Expected at least one argument.\");let A=a[0];if(!ch[A])throw new Error(`Can't parse ${A} as it is not part of the known types`);if((A===\"to-boolean\"||A===\"to-string\")&&a.length!==2)return h.error(\"Expected one argument.\");let x=ch[A],E=[];for(let P=1;P<a.length;P++){let D=h.parse(a[P],P,mr);if(!D)return null;E.push(D)}return new qo(x,E)}evaluate(a){switch(this.type.kind){case\"boolean\":return!!this.args[0].evaluate(a);case\"color\":{let h,A;for(let x of this.args){if(h=x.evaluate(a),A=null,h instanceof mi)return h;if(typeof h==\"string\"){let E=a.parseColor(h);if(E)return E}else if(Array.isArray(h)&&(A=h.length<3||h.length>4?`Invalid rbga value ${JSON.stringify(h)}: expected an array containing either three or four numeric values.`:fu(h[0],h[1],h[2],h[3]),!A))return new mi(h[0]/255,h[1]/255,h[2]/255,h[3])}throw new Hi(A||`Could not parse color from value '${typeof h==\"string\"?h:JSON.stringify(h)}'`)}case\"padding\":{let h;for(let A of this.args){h=A.evaluate(a);let x=wn.parse(h);if(x)return x}throw new Hi(`Could not parse padding from value '${typeof h==\"string\"?h:JSON.stringify(h)}'`)}case\"variableAnchorOffsetCollection\":{let h;for(let A of this.args){h=A.evaluate(a);let x=kn.parse(h);if(x)return x}throw new Hi(`Could not parse variableAnchorOffsetCollection from value '${typeof h==\"string\"?h:JSON.stringify(h)}'`)}case\"number\":{let h=null;for(let A of this.args){if(h=A.evaluate(a),h===null)return 0;let x=Number(h);if(!isNaN(x))return x}throw new Hi(`Could not convert ${JSON.stringify(h)} to number.`)}case\"formatted\":return Gn.fromString(no(this.args[0].evaluate(a)));case\"resolvedImage\":return Wn.fromString(no(this.args[0].evaluate(a)));default:return no(this.args[0].evaluate(a))}}eachChild(a){this.args.forEach(a)}outputDefined(){return this.args.every(a=>a.outputDefined())}}let ca=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"];class Ti{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&\"id\"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type==\"number\"?ca[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&\"geometry\"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(a){let h=this._parseColorCache[a];return h||(h=this._parseColorCache[a]=mi.parse(a)),h}}class df{constructor(a,h,A=[],x,E=new La,P=[]){this.registry=a,this.path=A,this.key=A.map(D=>`[${D}]`).join(\"\"),this.scope=E,this.errors=P,this.expectedType=x,this._isConstant=h}parse(a,h,A,x,E={}){return h?this.concat(h,A,x)._parse(a,E):this._parse(a,E)}_parse(a,h){function A(x,E,P){return P===\"assert\"?new so(E,[x]):P===\"coerce\"?new qo(E,[x]):x}if(a!==null&&typeof a!=\"string\"&&typeof a!=\"boolean\"&&typeof a!=\"number\"||(a=[\"literal\",a]),Array.isArray(a)){if(a.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use [\"literal\", []].');let x=a[0];if(typeof x!=\"string\")return this.error(`Expression name must be a string, but found ${typeof x} instead. If you wanted a literal array, use [\"literal\", [...]].`,0),null;let E=this.registry[x];if(E){let P=E.parse(a,this);if(!P)return null;if(this.expectedType){let D=this.expectedType,B=P.type;if(D.kind!==\"string\"&&D.kind!==\"number\"&&D.kind!==\"boolean\"&&D.kind!==\"object\"&&D.kind!==\"array\"||B.kind!==\"value\")if(D.kind!==\"color\"&&D.kind!==\"formatted\"&&D.kind!==\"resolvedImage\"||B.kind!==\"value\"&&B.kind!==\"string\")if(D.kind!==\"padding\"||B.kind!==\"value\"&&B.kind!==\"number\"&&B.kind!==\"array\")if(D.kind!==\"variableAnchorOffsetCollection\"||B.kind!==\"value\"&&B.kind!==\"array\"){if(this.checkSubtype(D,B))return null}else P=A(P,D,h.typeAnnotation||\"coerce\");else P=A(P,D,h.typeAnnotation||\"coerce\");else P=A(P,D,h.typeAnnotation||\"coerce\");else P=A(P,D,h.typeAnnotation||\"assert\")}if(!(P instanceof Ra)&&P.type.kind!==\"resolvedImage\"&&this._isConstant(P)){let D=new Ti;try{P=new Ra(P.type,P.evaluate(D))}catch(B){return this.error(B.message),null}}return P}return this.error(`Unknown expression \"${x}\". If you wanted a literal array, use [\"literal\", [...]].`,0)}return this.error(a===void 0?\"'undefined' value invalid. Use null instead.\":typeof a==\"object\"?'Bare objects invalid. Use [\"literal\", {...}] instead.':`Expected an array, but found ${typeof a} instead.`)}concat(a,h,A){let x=typeof a==\"number\"?this.path.concat(a):this.path,E=A?this.scope.concat(A):this.scope;return new df(this.registry,this._isConstant,x,h||null,E,this.errors)}error(a,...h){let A=`${this.key}${h.map(x=>`[${x}]`).join(\"\")}`;this.errors.push(new Vn(A,a))}checkSubtype(a,h){let A=Dt(a,h);return A&&this.error(A),A}}class Pc{constructor(a,h,A){this.type=Mc,this.locale=A,this.caseSensitive=a,this.diacriticSensitive=h}static parse(a,h){if(a.length!==2)return h.error(\"Expected one argument.\");let A=a[1];if(typeof A!=\"object\"||Array.isArray(A))return h.error(\"Collator options argument must be an object.\");let x=h.parse(A[\"case-sensitive\"]!==void 0&&A[\"case-sensitive\"],1,wr);if(!x)return null;let E=h.parse(A[\"diacritic-sensitive\"]!==void 0&&A[\"diacritic-sensitive\"],1,wr);if(!E)return null;let P=null;return A.locale&&(P=h.parse(A.locale,1,Lr),!P)?null:new Pc(x,E,P)}evaluate(a){return new xo(this.caseSensitive.evaluate(a),this.diacriticSensitive.evaluate(a),this.locale?this.locale.evaluate(a):null)}eachChild(a){a(this.caseSensitive),a(this.diacriticSensitive),this.locale&&a(this.locale)}outputDefined(){return!1}}let Bl=8192;function Sd(u,a){u[0]=Math.min(u[0],a[0]),u[1]=Math.min(u[1],a[1]),u[2]=Math.max(u[2],a[0]),u[3]=Math.max(u[3],a[1])}function pf(u,a){return!(u[0]<=a[0]||u[2]>=a[2]||u[1]<=a[1]||u[3]>=a[3])}function ut(u,a){let h=(180+u[0])/360,A=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+u[1]*Math.PI/360)))/360,x=Math.pow(2,a.z);return[Math.round(h*x*Bl),Math.round(A*x*Bl)]}function dt(u,a,h){let A=u[0]-a[0],x=u[1]-a[1],E=u[0]-h[0],P=u[1]-h[1];return A*P-E*x==0&&A*E<=0&&x*P<=0}function Ct(u,a){let h=!1;for(let P=0,D=a.length;P<D;P++){let B=a[P];for(let V=0,q=B.length;V<q-1;V++){if(dt(u,B[V],B[V+1]))return!1;(x=B[V])[1]>(A=u)[1]!=(E=B[V+1])[1]>A[1]&&A[0]<(E[0]-x[0])*(A[1]-x[1])/(E[1]-x[1])+x[0]&&(h=!h)}}var A,x,E;return h}function $t(u,a){for(let h=0;h<a.length;h++)if(Ct(u,a[h]))return!0;return!1}function me(u,a,h,A){let x=A[0]-h[0],E=A[1]-h[1],P=(u[0]-h[0])*E-x*(u[1]-h[1]),D=(a[0]-h[0])*E-x*(a[1]-h[1]);return P>0&&D<0||P<0&&D>0}function Ze(u,a,h){for(let V of h)for(let q=0;q<V.length-1;++q)if((D=[(P=V[q+1])[0]-(E=V[q])[0],P[1]-E[1]])[0]*(B=[(x=a)[0]-(A=u)[0],x[1]-A[1]])[1]-D[1]*B[0]!=0&&me(A,x,E,P)&&me(E,P,A,x))return!0;var A,x,E,P,D,B;return!1}function ni(u,a){for(let h=0;h<u.length;++h)if(!Ct(u[h],a))return!1;for(let h=0;h<u.length-1;++h)if(Ze(u[h],u[h+1],a))return!1;return!0}function rs(u,a){for(let h=0;h<a.length;h++)if(ni(u,a[h]))return!0;return!1}function Hn(u,a,h){let A=[];for(let x=0;x<u.length;x++){let E=[];for(let P=0;P<u[x].length;P++){let D=ut(u[x][P],h);Sd(a,D),E.push(D)}A.push(E)}return A}function zs(u,a,h){let A=[];for(let x=0;x<u.length;x++){let E=Hn(u[x],a,h);A.push(E)}return A}function Da(u,a,h,A){if(u[0]<h[0]||u[0]>h[2]){let x=.5*A,E=u[0]-h[0]>x?-A:h[0]-u[0]>x?A:0;E===0&&(E=u[0]-h[2]>x?-A:h[2]-u[0]>x?A:0),u[0]+=E}Sd(a,u)}function zm(u,a,h,A){let x=Math.pow(2,A.z)*Bl,E=[A.x*Bl,A.y*Bl],P=[];for(let D of u)for(let B of D){let V=[B.x+E[0],B.y+E[1]];Da(V,a,h,x),P.push(V)}return P}function bx(u,a,h,A){let x=Math.pow(2,A.z)*Bl,E=[A.x*Bl,A.y*Bl],P=[];for(let B of u){let V=[];for(let q of B){let Q=[q.x+E[0],q.y+E[1]];Sd(a,Q),V.push(Q)}P.push(V)}if(a[2]-a[0]<=x/2){(D=a)[0]=D[1]=1/0,D[2]=D[3]=-1/0;for(let B of P)for(let V of B)Da(V,a,h,x)}var D;return P}class Af{constructor(a,h){this.type=wr,this.geojson=a,this.geometries=h}static parse(a,h){if(a.length!==2)return h.error(`'within' expression requires exactly one argument, but found ${a.length-1} instead.`);if(ff(a[1])){let A=a[1];if(A.type===\"FeatureCollection\"){let x=[];for(let E of A.features){let{type:P,coordinates:D}=E.geometry;P===\"Polygon\"&&x.push(D),P===\"MultiPolygon\"&&x.push(...D)}if(x.length)return new Af(A,{type:\"MultiPolygon\",coordinates:x})}else if(A.type===\"Feature\"){let x=A.geometry.type;if(x===\"Polygon\"||x===\"MultiPolygon\")return new Af(A,A.geometry)}else if(A.type===\"Polygon\"||A.type===\"MultiPolygon\")return new Af(A,A)}return h.error(\"'within' expression requires valid geojson object that contains polygon geometry type.\")}evaluate(a){if(a.geometry()!=null&&a.canonicalID()!=null){if(a.geometryType()===\"Point\")return function(h,A){let x=[1/0,1/0,-1/0,-1/0],E=[1/0,1/0,-1/0,-1/0],P=h.canonicalID();if(A.type===\"Polygon\"){let D=Hn(A.coordinates,E,P),B=zm(h.geometry(),x,E,P);if(!pf(x,E))return!1;for(let V of B)if(!Ct(V,D))return!1}if(A.type===\"MultiPolygon\"){let D=zs(A.coordinates,E,P),B=zm(h.geometry(),x,E,P);if(!pf(x,E))return!1;for(let V of B)if(!$t(V,D))return!1}return!0}(a,this.geometries);if(a.geometryType()===\"LineString\")return function(h,A){let x=[1/0,1/0,-1/0,-1/0],E=[1/0,1/0,-1/0,-1/0],P=h.canonicalID();if(A.type===\"Polygon\"){let D=Hn(A.coordinates,E,P),B=bx(h.geometry(),x,E,P);if(!pf(x,E))return!1;for(let V of B)if(!ni(V,D))return!1}if(A.type===\"MultiPolygon\"){let D=zs(A.coordinates,E,P),B=bx(h.geometry(),x,E,P);if(!pf(x,E))return!1;for(let V of B)if(!rs(V,D))return!1}return!0}(a,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class Nm{constructor(a,h){this.type=h.type,this.name=a,this.boundExpression=h}static parse(a,h){if(a.length!==2||typeof a[1]!=\"string\")return h.error(\"'var' expression requires exactly one string literal argument.\");let A=a[1];return h.scope.has(A)?new Nm(A,h.scope.get(A)):h.error(`Unknown variable \"${A}\". Make sure \"${A}\" has been bound in an enclosing \"let\" expression before using it.`,1)}evaluate(a){return this.boundExpression.evaluate(a)}eachChild(){}outputDefined(){return!1}}class Oa{constructor(a,h,A,x){this.name=a,this.type=h,this._evaluate=A,this.args=x}evaluate(a){return this._evaluate(a,this.args)}eachChild(a){this.args.forEach(a)}outputDefined(){return!1}static parse(a,h){let A=a[0],x=Oa.definitions[A];if(!x)return h.error(`Unknown expression \"${A}\". If you wanted a literal array, use [\"literal\", [...]].`,0);let E=Array.isArray(x)?x[0]:x.type,P=Array.isArray(x)?[[x[1],x[2]]]:x.overloads,D=P.filter(([V])=>!Array.isArray(V)||V.length===a.length-1),B=null;for(let[V,q]of D){B=new df(h.registry,Np,h.path,null,h.scope);let Q=[],rt=!1;for(let ot=1;ot<a.length;ot++){let lt=a[ot],pt=Array.isArray(V)?V[ot-1]:V.type,xt=B.parse(lt,1+Q.length,pt);if(!xt){rt=!0;break}Q.push(xt)}if(!rt)if(Array.isArray(V)&&V.length!==Q.length)B.error(`Expected ${V.length} arguments, but found ${Q.length} instead.`);else{for(let ot=0;ot<Q.length;ot++){let lt=Array.isArray(V)?V[ot]:V.type,pt=Q[ot];B.concat(ot+1).checkSubtype(lt,pt.type)}if(B.errors.length===0)return new Oa(A,E,q,Q)}}if(D.length===1)h.errors.push(...B.errors);else{let V=(D.length?D:P).map(([Q])=>{return rt=Q,Array.isArray(rt)?`(${rt.map(mt).join(\", \")})`:`(${mt(rt.type)}...)`;var rt}).join(\" | \"),q=[];for(let Q=1;Q<a.length;Q++){let rt=h.parse(a[Q],1+q.length);if(!rt)return null;q.push(mt(rt.type))}h.error(`Expected arguments of type ${V}, but found (${q.join(\", \")}) instead.`)}return null}static register(a,h){Oa.definitions=h;for(let A in h)a[A]=Oa}}function Np(u){if(u instanceof Nm)return Np(u.boundExpression);if(u instanceof Oa&&u.name===\"error\"||u instanceof Pc||u instanceof Af)return!1;let a=u instanceof qo||u instanceof so,h=!0;return u.eachChild(A=>{h=a?h&&Np(A):h&&A instanceof Ra}),!!h&&Um(u)&&Vp(u,[\"zoom\",\"heatmap-density\",\"line-progress\",\"accumulated\",\"is-supported-script\"])}function Um(u){if(u instanceof Oa&&(u.name===\"get\"&&u.args.length===1||u.name===\"feature-state\"||u.name===\"has\"&&u.args.length===1||u.name===\"properties\"||u.name===\"geometry-type\"||u.name===\"id\"||/^filter-/.test(u.name))||u instanceof Af)return!1;let a=!0;return u.eachChild(h=>{a&&!Um(h)&&(a=!1)}),a}function Up(u){if(u instanceof Oa&&u.name===\"feature-state\")return!1;let a=!0;return u.eachChild(h=>{a&&!Up(h)&&(a=!1)}),a}function Vp(u,a){if(u instanceof Oa&&a.indexOf(u.name)>=0)return!1;let h=!0;return u.eachChild(A=>{h&&!Vp(A,a)&&(h=!1)}),h}function jp(u,a){let h=u.length-1,A,x,E=0,P=h,D=0;for(;E<=P;)if(D=Math.floor((E+P)/2),A=u[D],x=u[D+1],A<=a){if(D===h||a<x)return D;E=D+1}else{if(!(A>a))throw new Hi(\"Input is not a number.\");P=D-1}return 0}class Gp{constructor(a,h,A){this.type=a,this.input=h,this.labels=[],this.outputs=[];for(let[x,E]of A)this.labels.push(x),this.outputs.push(E)}static parse(a,h){if(a.length-1<4)return h.error(`Expected at least 4 arguments, but found only ${a.length-1}.`);if((a.length-1)%2!=0)return h.error(\"Expected an even number of arguments.\");let A=h.parse(a[1],1,be);if(!A)return null;let x=[],E=null;h.expectedType&&h.expectedType.kind!==\"value\"&&(E=h.expectedType);for(let P=1;P<a.length;P+=2){let D=P===1?-1/0:a[P],B=a[P+1],V=P,q=P+1;if(typeof D!=\"number\")return h.error('Input/output pairs for \"step\" expressions must be defined using literal numeric values (not computed expressions) for the input values.',V);if(x.length&&x[x.length-1][0]>=D)return h.error('Input/output pairs for \"step\" expressions must be arranged with input values in strictly ascending order.',V);let Q=h.parse(B,q,E);if(!Q)return null;E=E||Q.type,x.push([D,Q])}return new Gp(E,A,x)}evaluate(a){let h=this.labels,A=this.outputs;if(h.length===1)return A[0].evaluate(a);let x=this.input.evaluate(a);if(x<=h[0])return A[0].evaluate(a);let E=h.length;return x>=h[E-1]?A[E-1].evaluate(a):A[jp(h,x)].evaluate(a)}eachChild(a){a(this.input);for(let h of this.outputs)a(h)}outputDefined(){return this.outputs.every(a=>a.outputDefined())}}function LS(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,\"default\")?u.default:u}var kS=wx;function wx(u,a,h,A){this.cx=3*u,this.bx=3*(h-u)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*a,this.by=3*(A-a)-this.cy,this.ay=1-this.cy-this.by,this.p1x=u,this.p1y=a,this.p2x=h,this.p2y=A}wx.prototype={sampleCurveX:function(u){return((this.ax*u+this.bx)*u+this.cx)*u},sampleCurveY:function(u){return((this.ay*u+this.by)*u+this.cy)*u},sampleCurveDerivativeX:function(u){return(3*this.ax*u+2*this.bx)*u+this.cx},solveCurveX:function(u,a){if(a===void 0&&(a=1e-6),u<0)return 0;if(u>1)return 1;for(var h=u,A=0;A<8;A++){var x=this.sampleCurveX(h)-u;if(Math.abs(x)<a)return h;var E=this.sampleCurveDerivativeX(h);if(Math.abs(E)<1e-6)break;h-=x/E}var P=0,D=1;for(h=u,A=0;A<20&&(x=this.sampleCurveX(h),!(Math.abs(x-u)<a));A++)u>x?P=h:D=h,h=.5*(D-P)+P;return h},solve:function(u,a){return this.sampleCurveY(this.solveCurveX(u,a))}};var RS=LS(kS);function mf(u,a,h){return u+h*(a-u)}function Vm(u,a,h){return u.map((A,x)=>mf(A,a[x],h))}let Zo={number:mf,color:function(u,a,h,A=\"rgb\"){switch(A){case\"rgb\":{let[x,E,P,D]=Vm(u.rgb,a.rgb,h);return new mi(x,E,P,D,!1)}case\"hcl\":{let[x,E,P,D]=u.hcl,[B,V,q,Q]=a.hcl,rt,ot;if(isNaN(x)||isNaN(B))isNaN(x)?isNaN(B)?rt=NaN:(rt=B,P!==1&&P!==0||(ot=V)):(rt=x,q!==1&&q!==0||(ot=E));else{let Vt=B-x;B>x&&Vt>180?Vt-=360:B<x&&x-B>180&&(Vt+=360),rt=x+h*Vt}let[lt,pt,xt,Mt]=function([Vt,It,zt,ie]){return Vt=isNaN(Vt)?0:Vt*_r,Ji([zt,Math.cos(Vt)*It,Math.sin(Vt)*It,ie])}([rt,ot??mf(E,V,h),mf(P,q,h),mf(D,Q,h)]);return new mi(lt,pt,xt,Mt,!1)}case\"lab\":{let[x,E,P,D]=Ji(Vm(u.lab,a.lab,h));return new mi(x,E,P,D,!1)}}},array:Vm,padding:function(u,a,h){return new wn(Vm(u.values,a.values,h))},variableAnchorOffsetCollection:function(u,a,h){let A=u.values,x=a.values;if(A.length!==x.length)throw new Hi(`Cannot interpolate values of different length. from: ${u.toString()}, to: ${a.toString()}`);let E=[];for(let P=0;P<A.length;P+=2){if(A[P]!==x[P])throw new Hi(`Cannot interpolate values containing mismatched anchors. from[${P}]: ${A[P]}, to[${P}]: ${x[P]}`);E.push(A[P]);let[D,B]=A[P+1],[V,q]=x[P+1];E.push([mf(D,V,h),mf(B,q,h)])}return new kn(E)}};class bo{constructor(a,h,A,x,E){this.type=a,this.operator=h,this.interpolation=A,this.input=x,this.labels=[],this.outputs=[];for(let[P,D]of E)this.labels.push(P),this.outputs.push(D)}static interpolationFactor(a,h,A,x){let E=0;if(a.name===\"exponential\")E=_i(h,a.base,A,x);else if(a.name===\"linear\")E=_i(h,1,A,x);else if(a.name===\"cubic-bezier\"){let P=a.controlPoints;E=new RS(P[0],P[1],P[2],P[3]).solve(_i(h,1,A,x))}return E}static parse(a,h){let[A,x,E,...P]=a;if(!Array.isArray(x)||x.length===0)return h.error(\"Expected an interpolation type expression.\",1);if(x[0]===\"linear\")x={name:\"linear\"};else if(x[0]===\"exponential\"){let V=x[1];if(typeof V!=\"number\")return h.error(\"Exponential interpolation requires a numeric base.\",1,1);x={name:\"exponential\",base:V}}else{if(x[0]!==\"cubic-bezier\")return h.error(`Unknown interpolation type ${String(x[0])}`,1,0);{let V=x.slice(1);if(V.length!==4||V.some(q=>typeof q!=\"number\"||q<0||q>1))return h.error(\"Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.\",1);x={name:\"cubic-bezier\",controlPoints:V}}}if(a.length-1<4)return h.error(`Expected at least 4 arguments, but found only ${a.length-1}.`);if((a.length-1)%2!=0)return h.error(\"Expected an even number of arguments.\");if(E=h.parse(E,2,be),!E)return null;let D=[],B=null;A===\"interpolate-hcl\"||A===\"interpolate-lab\"?B=Cn:h.expectedType&&h.expectedType.kind!==\"value\"&&(B=h.expectedType);for(let V=0;V<P.length;V+=2){let q=P[V],Q=P[V+1],rt=V+3,ot=V+4;if(typeof q!=\"number\")return h.error('Input/output pairs for \"interpolate\" expressions must be defined using literal numeric values (not computed expressions) for the input values.',rt);if(D.length&&D[D.length-1][0]>=q)return h.error('Input/output pairs for \"interpolate\" expressions must be arranged with input values in strictly ascending order.',rt);let lt=h.parse(Q,ot,B);if(!lt)return null;B=B||lt.type,D.push([q,lt])}return jt(B,be)||jt(B,Cn)||jt(B,vt)||jt(B,nt)||jt(B,ct(be))?new bo(B,A,x,E,D):h.error(`Type ${mt(B)} is not interpolatable.`)}evaluate(a){let h=this.labels,A=this.outputs;if(h.length===1)return A[0].evaluate(a);let x=this.input.evaluate(a);if(x<=h[0])return A[0].evaluate(a);let E=h.length;if(x>=h[E-1])return A[E-1].evaluate(a);let P=jp(h,x),D=bo.interpolationFactor(this.interpolation,x,h[P],h[P+1]),B=A[P].evaluate(a),V=A[P+1].evaluate(a);switch(this.operator){case\"interpolate\":return Zo[this.type.kind](B,V,D);case\"interpolate-hcl\":return Zo.color(B,V,D,\"hcl\");case\"interpolate-lab\":return Zo.color(B,V,D,\"lab\")}}eachChild(a){a(this.input);for(let h of this.outputs)a(h)}outputDefined(){return this.outputs.every(a=>a.outputDefined())}}function _i(u,a,h,A){let x=A-h,E=u-h;return x===0?0:a===1?E/x:(Math.pow(a,E)-1)/(Math.pow(a,x)-1)}class jm{constructor(a,h){this.type=a,this.args=h}static parse(a,h){if(a.length<2)return h.error(\"Expectected at least one argument.\");let A=null,x=h.expectedType;x&&x.kind!==\"value\"&&(A=x);let E=[];for(let D of a.slice(1)){let B=h.parse(D,1+E.length,A,void 0,{typeAnnotation:\"omit\"});if(!B)return null;A=A||B.type,E.push(B)}if(!A)throw new Error(\"No output type\");let P=x&&E.some(D=>Dt(x,D.type));return new jm(P?mr:A,E)}evaluate(a){let h,A=null,x=0;for(let E of this.args)if(x++,A=E.evaluate(a),A&&A instanceof Wn&&!A.available&&(h||(h=A.name),A=null,x===this.args.length&&(A=h)),A!==null)break;return A}eachChild(a){this.args.forEach(a)}outputDefined(){return this.args.every(a=>a.outputDefined())}}class Td{constructor(a,h){this.type=h.type,this.bindings=[].concat(a),this.result=h}evaluate(a){return this.result.evaluate(a)}eachChild(a){for(let h of this.bindings)a(h[1]);a(this.result)}static parse(a,h){if(a.length<4)return h.error(`Expected at least 3 arguments, but found ${a.length-1} instead.`);let A=[];for(let E=1;E<a.length-1;E+=2){let P=a[E];if(typeof P!=\"string\")return h.error(`Expected string, but found ${typeof P} instead.`,E);if(/[^a-zA-Z0-9_]/.test(P))return h.error(\"Variable names must contain only alphanumeric characters or '_'.\",E);let D=h.parse(a[E+1],E+1);if(!D)return null;A.push([P,D])}let x=h.parse(a[a.length-1],a.length-1,h.expectedType,A);return x?new Td(A,x):null}outputDefined(){return this.result.outputDefined()}}class Gm{constructor(a,h,A){this.type=a,this.index=h,this.input=A}static parse(a,h){if(a.length!==3)return h.error(`Expected 2 arguments, but found ${a.length-1} instead.`);let A=h.parse(a[1],1,be),x=h.parse(a[2],2,ct(h.expectedType||mr));return A&&x?new Gm(x.type.itemType,A,x):null}evaluate(a){let h=this.index.evaluate(a),A=this.input.evaluate(a);if(h<0)throw new Hi(`Array index out of bounds: ${h} < 0.`);if(h>=A.length)throw new Hi(`Array index out of bounds: ${h} > ${A.length-1}.`);if(h!==Math.floor(h))throw new Hi(`Array index must be an integer, but found ${h} instead.`);return A[h]}eachChild(a){a(this.index),a(this.input)}outputDefined(){return!1}}class Wm{constructor(a,h){this.type=wr,this.needle=a,this.haystack=h}static parse(a,h){if(a.length!==3)return h.error(`Expected 2 arguments, but found ${a.length-1} instead.`);let A=h.parse(a[1],1,mr),x=h.parse(a[2],2,mr);return A&&x?Ut(A.type,[wr,Lr,be,ts,mr])?new Wm(A,x):h.error(`Expected first argument to be of type boolean, string, number or null, but found ${mt(A.type)} instead`):null}evaluate(a){let h=this.needle.evaluate(a),A=this.haystack.evaluate(a);if(!A)return!1;if(!ft(h,[\"boolean\",\"string\",\"number\",\"null\"]))throw new Hi(`Expected first argument to be of type boolean, string, number or null, but found ${mt(hn(h))} instead.`);if(!ft(A,[\"string\",\"array\"]))throw new Hi(`Expected second argument to be of type array or string, but found ${mt(hn(A))} instead.`);return A.indexOf(h)>=0}eachChild(a){a(this.needle),a(this.haystack)}outputDefined(){return!0}}class gf{constructor(a,h,A){this.type=be,this.needle=a,this.haystack=h,this.fromIndex=A}static parse(a,h){if(a.length<=2||a.length>=5)return h.error(`Expected 3 or 4 arguments, but found ${a.length-1} instead.`);let A=h.parse(a[1],1,mr),x=h.parse(a[2],2,mr);if(!A||!x)return null;if(!Ut(A.type,[wr,Lr,be,ts,mr]))return h.error(`Expected first argument to be of type boolean, string, number or null, but found ${mt(A.type)} instead`);if(a.length===4){let E=h.parse(a[3],3,be);return E?new gf(A,x,E):null}return new gf(A,x)}evaluate(a){let h=this.needle.evaluate(a),A=this.haystack.evaluate(a);if(!ft(h,[\"boolean\",\"string\",\"number\",\"null\"]))throw new Hi(`Expected first argument to be of type boolean, string, number or null, but found ${mt(hn(h))} instead.`);if(!ft(A,[\"string\",\"array\"]))throw new Hi(`Expected second argument to be of type array or string, but found ${mt(hn(A))} instead.`);if(this.fromIndex){let x=this.fromIndex.evaluate(a);return A.indexOf(h,x)}return A.indexOf(h)}eachChild(a){a(this.needle),a(this.haystack),this.fromIndex&&a(this.fromIndex)}outputDefined(){return!1}}class Wp{constructor(a,h,A,x,E,P){this.inputType=a,this.type=h,this.input=A,this.cases=x,this.outputs=E,this.otherwise=P}static parse(a,h){if(a.length<5)return h.error(`Expected at least 4 arguments, but found only ${a.length-1}.`);if(a.length%2!=1)return h.error(\"Expected an even number of arguments.\");let A,x;h.expectedType&&h.expectedType.kind!==\"value\"&&(x=h.expectedType);let E={},P=[];for(let V=2;V<a.length-1;V+=2){let q=a[V],Q=a[V+1];Array.isArray(q)||(q=[q]);let rt=h.concat(V);if(q.length===0)return rt.error(\"Expected at least one branch label.\");for(let lt of q){if(typeof lt!=\"number\"&&typeof lt!=\"string\")return rt.error(\"Branch labels must be numbers or strings.\");if(typeof lt==\"number\"&&Math.abs(lt)>Number.MAX_SAFE_INTEGER)return rt.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof lt==\"number\"&&Math.floor(lt)!==lt)return rt.error(\"Numeric branch labels must be integer values.\");if(A){if(rt.checkSubtype(A,hn(lt)))return null}else A=hn(lt);if(E[String(lt)]!==void 0)return rt.error(\"Branch labels must be unique.\");E[String(lt)]=P.length}let ot=h.parse(Q,V,x);if(!ot)return null;x=x||ot.type,P.push(ot)}let D=h.parse(a[1],1,mr);if(!D)return null;let B=h.parse(a[a.length-1],a.length-1,x);return B?D.type.kind!==\"value\"&&h.concat(1).checkSubtype(A,D.type)?null:new Wp(A,x,D,E,P,B):null}evaluate(a){let h=this.input.evaluate(a);return(hn(h)===this.inputType&&this.outputs[this.cases[h]]||this.otherwise).evaluate(a)}eachChild(a){a(this.input),this.outputs.forEach(a),a(this.otherwise)}outputDefined(){return this.outputs.every(a=>a.outputDefined())&&this.otherwise.outputDefined()}}class Hp{constructor(a,h,A){this.type=a,this.branches=h,this.otherwise=A}static parse(a,h){if(a.length<4)return h.error(`Expected at least 3 arguments, but found only ${a.length-1}.`);if(a.length%2!=0)return h.error(\"Expected an odd number of arguments.\");let A;h.expectedType&&h.expectedType.kind!==\"value\"&&(A=h.expectedType);let x=[];for(let P=1;P<a.length-1;P+=2){let D=h.parse(a[P],P,wr);if(!D)return null;let B=h.parse(a[P+1],P+1,A);if(!B)return null;x.push([D,B]),A=A||B.type}let E=h.parse(a[a.length-1],a.length-1,A);if(!E)return null;if(!A)throw new Error(\"Can't infer output type\");return new Hp(A,x,E)}evaluate(a){for(let[h,A]of this.branches)if(h.evaluate(a))return A.evaluate(a);return this.otherwise.evaluate(a)}eachChild(a){for(let[h,A]of this.branches)a(h),a(A);a(this.otherwise)}outputDefined(){return this.branches.every(([a,h])=>h.outputDefined())&&this.otherwise.outputDefined()}}class Md{constructor(a,h,A,x){this.type=a,this.input=h,this.beginIndex=A,this.endIndex=x}static parse(a,h){if(a.length<=2||a.length>=5)return h.error(`Expected 3 or 4 arguments, but found ${a.length-1} instead.`);let A=h.parse(a[1],1,mr),x=h.parse(a[2],2,be);if(!A||!x)return null;if(!Ut(A.type,[ct(mr),Lr,mr]))return h.error(`Expected first argument to be of type array or string, but found ${mt(A.type)} instead`);if(a.length===4){let E=h.parse(a[3],3,be);return E?new Md(A.type,A,x,E):null}return new Md(A.type,A,x)}evaluate(a){let h=this.input.evaluate(a),A=this.beginIndex.evaluate(a);if(!ft(h,[\"string\",\"array\"]))throw new Hi(`Expected first argument to be of type array or string, but found ${mt(hn(h))} instead.`);if(this.endIndex){let x=this.endIndex.evaluate(a);return h.slice(A,x)}return h.slice(A)}eachChild(a){a(this.input),a(this.beginIndex),this.endIndex&&a(this.endIndex)}outputDefined(){return!1}}function Ed(u,a){return u===\"==\"||u===\"!=\"?a.kind===\"boolean\"||a.kind===\"string\"||a.kind===\"number\"||a.kind===\"null\"||a.kind===\"value\":a.kind===\"string\"||a.kind===\"number\"||a.kind===\"value\"}function qp(u,a,h,A){return A.compare(a,h)===0}function Ba(u,a,h){let A=u!==\"==\"&&u!==\"!=\";return class C8{constructor(E,P,D){this.type=wr,this.lhs=E,this.rhs=P,this.collator=D,this.hasUntypedArgument=E.type.kind===\"value\"||P.type.kind===\"value\"}static parse(E,P){if(E.length!==3&&E.length!==4)return P.error(\"Expected two or three arguments.\");let D=E[0],B=P.parse(E[1],1,mr);if(!B)return null;if(!Ed(D,B.type))return P.concat(1).error(`\"${D}\" comparisons are not supported for type '${mt(B.type)}'.`);let V=P.parse(E[2],2,mr);if(!V)return null;if(!Ed(D,V.type))return P.concat(2).error(`\"${D}\" comparisons are not supported for type '${mt(V.type)}'.`);if(B.type.kind!==V.type.kind&&B.type.kind!==\"value\"&&V.type.kind!==\"value\")return P.error(`Cannot compare types '${mt(B.type)}' and '${mt(V.type)}'.`);A&&(B.type.kind===\"value\"&&V.type.kind!==\"value\"?B=new so(V.type,[B]):B.type.kind!==\"value\"&&V.type.kind===\"value\"&&(V=new so(B.type,[V])));let q=null;if(E.length===4){if(B.type.kind!==\"string\"&&V.type.kind!==\"string\"&&B.type.kind!==\"value\"&&V.type.kind!==\"value\")return P.error(\"Cannot use collator to compare non-string types.\");if(q=P.parse(E[3],3,Mc),!q)return null}return new C8(B,V,q)}evaluate(E){let P=this.lhs.evaluate(E),D=this.rhs.evaluate(E);if(A&&this.hasUntypedArgument){let B=hn(P),V=hn(D);if(B.kind!==V.kind||B.kind!==\"string\"&&B.kind!==\"number\")throw new Hi(`Expected arguments for \"${u}\" to be (string, string) or (number, number), but found (${B.kind}, ${V.kind}) instead.`)}if(this.collator&&!A&&this.hasUntypedArgument){let B=hn(P),V=hn(D);if(B.kind!==\"string\"||V.kind!==\"string\")return a(E,P,D)}return this.collator?h(E,P,D,this.collator.evaluate(E)):a(E,P,D)}eachChild(E){E(this.lhs),E(this.rhs),this.collator&&E(this.collator)}outputDefined(){return!0}}}let qt=Ba(\"==\",function(u,a,h){return a===h},qp),fe=Ba(\"!=\",function(u,a,h){return a!==h},function(u,a,h,A){return!qp(0,a,h,A)}),ke=Ba(\"<\",function(u,a,h){return a<h},function(u,a,h,A){return A.compare(a,h)<0}),yr=Ba(\">\",function(u,a,h){return a>h},function(u,a,h,A){return A.compare(a,h)>0}),g=Ba(\"<=\",function(u,a,h){return a<=h},function(u,a,h,A){return A.compare(a,h)<=0}),zi=Ba(\">=\",function(u,a,h){return a>=h},function(u,a,h,A){return A.compare(a,h)>=0});class yi{constructor(a,h,A,x,E){this.type=Lr,this.number=a,this.locale=h,this.currency=A,this.minFractionDigits=x,this.maxFractionDigits=E}static parse(a,h){if(a.length!==3)return h.error(\"Expected two arguments.\");let A=h.parse(a[1],1,be);if(!A)return null;let x=a[2];if(typeof x!=\"object\"||Array.isArray(x))return h.error(\"NumberFormat options argument must be an object.\");let E=null;if(x.locale&&(E=h.parse(x.locale,1,Lr),!E))return null;let P=null;if(x.currency&&(P=h.parse(x.currency,1,Lr),!P))return null;let D=null;if(x[\"min-fraction-digits\"]&&(D=h.parse(x[\"min-fraction-digits\"],1,be),!D))return null;let B=null;return x[\"max-fraction-digits\"]&&(B=h.parse(x[\"max-fraction-digits\"],1,be),!B)?null:new yi(A,E,P,D,B)}evaluate(a){return new Intl.NumberFormat(this.locale?this.locale.evaluate(a):[],{style:this.currency?\"currency\":\"decimal\",currency:this.currency?this.currency.evaluate(a):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(a):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(a):void 0}).format(this.number.evaluate(a))}eachChild(a){a(this.number),this.locale&&a(this.locale),this.currency&&a(this.currency),this.minFractionDigits&&a(this.minFractionDigits),this.maxFractionDigits&&a(this.maxFractionDigits)}outputDefined(){return!1}}class bt{constructor(a){this.type=jn,this.sections=a}static parse(a,h){if(a.length<2)return h.error(\"Expected at least one argument.\");let A=a[1];if(!Array.isArray(A)&&typeof A==\"object\")return h.error(\"First argument must be an image or text section.\");let x=[],E=!1;for(let P=1;P<=a.length-1;++P){let D=a[P];if(E&&typeof D==\"object\"&&!Array.isArray(D)){E=!1;let B=null;if(D[\"font-scale\"]&&(B=h.parse(D[\"font-scale\"],1,be),!B))return null;let V=null;if(D[\"text-font\"]&&(V=h.parse(D[\"text-font\"],1,ct(Lr)),!V))return null;let q=null;if(D[\"text-color\"]&&(q=h.parse(D[\"text-color\"],1,Cn),!q))return null;let Q=x[x.length-1];Q.scale=B,Q.font=V,Q.textColor=q}else{let B=h.parse(a[P],1,mr);if(!B)return null;let V=B.type.kind;if(V!==\"string\"&&V!==\"value\"&&V!==\"null\"&&V!==\"resolvedImage\")return h.error(\"Formatted text type must be 'string', 'value', 'image' or 'null'.\");E=!0,x.push({content:B,scale:null,font:null,textColor:null})}}return new bt(x)}evaluate(a){return new Gn(this.sections.map(h=>{let A=h.content.evaluate(a);return hn(A)===tt?new Ec(\"\",A,null,null,null):new Ec(no(A),null,h.scale?h.scale.evaluate(a):null,h.font?h.font.evaluate(a).join(\",\"):null,h.textColor?h.textColor.evaluate(a):null)}))}eachChild(a){for(let h of this.sections)a(h.content),h.scale&&a(h.scale),h.font&&a(h.font),h.textColor&&a(h.textColor)}outputDefined(){return!1}}class Ms{constructor(a){this.type=tt,this.input=a}static parse(a,h){if(a.length!==2)return h.error(\"Expected two arguments.\");let A=h.parse(a[1],1,Lr);return A?new Ms(A):h.error(\"No image name provided.\")}evaluate(a){let h=this.input.evaluate(a),A=Wn.fromString(h);return A&&a.availableImages&&(A.available=a.availableImages.indexOf(h)>-1),A}eachChild(a){a(this.input)}outputDefined(){return!1}}class oo{constructor(a){this.type=be,this.input=a}static parse(a,h){if(a.length!==2)return h.error(`Expected 1 argument, but found ${a.length-1} instead.`);let A=h.parse(a[1],1);return A?A.type.kind!==\"array\"&&A.type.kind!==\"string\"&&A.type.kind!==\"value\"?h.error(`Expected argument of type string or array, but found ${mt(A.type)} instead.`):new oo(A):null}evaluate(a){let h=this.input.evaluate(a);if(typeof h==\"string\"||Array.isArray(h))return h.length;throw new Hi(`Expected value to be of type string or array, but found ${mt(hn(h))} instead.`)}eachChild(a){a(this.input)}outputDefined(){return!1}}let Zr={\"==\":qt,\"!=\":fe,\">\":yr,\"<\":ke,\">=\":zi,\"<=\":g,array:so,at:Gm,boolean:so,case:Hp,coalesce:jm,collator:Pc,format:bt,image:Ms,in:Wm,\"index-of\":gf,interpolate:bo,\"interpolate-hcl\":bo,\"interpolate-lab\":bo,length:oo,let:Td,literal:Ra,match:Wp,number:so,\"number-format\":yi,object:so,slice:Md,step:Gp,string:so,\"to-boolean\":qo,\"to-color\":qo,\"to-number\":qo,\"to-string\":qo,var:Nm,within:Af};function fn(u,[a,h,A,x]){a=a.evaluate(u),h=h.evaluate(u),A=A.evaluate(u);let E=x?x.evaluate(u):1,P=fu(a,h,A,E);if(P)throw new Hi(P);return new mi(a/255,h/255,A/255,E,!1)}function Fl(u,a){return u in a}function Kr(u,a){let h=a[u];return h===void 0?null:h}function Yr(u){return{type:u}}function Ic(u){return{result:\"success\",value:u}}function _f(u){return{result:\"error\",value:u}}function yf(u){return u[\"property-type\"]===\"data-driven\"||u[\"property-type\"]===\"cross-faded-data-driven\"}function Zp(u){return!!u.expression&&u.expression.parameters.indexOf(\"zoom\")>-1}function Yo(u){return!!u.expression&&u.expression.interpolated}function si(u){return u instanceof Number?\"number\":u instanceof String?\"string\":u instanceof Boolean?\"boolean\":Array.isArray(u)?\"array\":u===null?\"null\":typeof u}function Fa(u){return typeof u==\"object\"&&u!==null&&!Array.isArray(u)}function Sx(u){return u}function du(u,a){let h=a.type===\"color\",A=u.stops&&typeof u.stops[0][0]==\"object\",x=A||!(A||u.property!==void 0),E=u.type||(Yo(a)?\"exponential\":\"interval\");if(h||a.type===\"padding\"){let q=h?mi.parse:wn.parse;(u=Ho({},u)).stops&&(u.stops=u.stops.map(Q=>[Q[0],q(Q[1])])),u.default=q(u.default?u.default:a.default)}if(u.colorSpace&&(P=u.colorSpace)!==\"rgb\"&&P!==\"hcl\"&&P!==\"lab\")throw new Error(`Unknown color space: \"${u.colorSpace}\"`);var P;let D,B,V;if(E===\"exponential\")D=oi;else if(E===\"interval\")D=Li;else if(E===\"categorical\"){D=Pt,B=Object.create(null);for(let q of u.stops)B[q[0]]=q[1];V=typeof u.stops[0][0]}else{if(E!==\"identity\")throw new Error(`Unknown function type \"${E}\"`);D=Hm}if(A){let q={},Q=[];for(let lt=0;lt<u.stops.length;lt++){let pt=u.stops[lt],xt=pt[0].zoom;q[xt]===void 0&&(q[xt]={zoom:xt,type:u.type,property:u.property,default:u.default,stops:[]},Q.push(xt)),q[xt].stops.push([pt[0].value,pt[1]])}let rt=[];for(let lt of Q)rt.push([q[lt].zoom,du(q[lt],a)]);let ot={name:\"linear\"};return{kind:\"composite\",interpolationType:ot,interpolationFactor:bo.interpolationFactor.bind(void 0,ot),zoomStops:rt.map(lt=>lt[0]),evaluate:({zoom:lt},pt)=>oi({stops:rt,base:u.base},a,lt).evaluate(lt,pt)}}if(x){let q=E===\"exponential\"?{name:\"exponential\",base:u.base!==void 0?u.base:1}:null;return{kind:\"camera\",interpolationType:q,interpolationFactor:bo.interpolationFactor.bind(void 0,q),zoomStops:u.stops.map(Q=>Q[0]),evaluate:({zoom:Q})=>D(u,a,Q,B,V)}}return{kind:\"source\",evaluate(q,Q){let rt=Q&&Q.properties?Q.properties[u.property]:void 0;return rt===void 0?Sr(u.default,a.default):D(u,a,rt,B,V)}}}function Sr(u,a,h){return u!==void 0?u:a!==void 0?a:h!==void 0?h:void 0}function Pt(u,a,h,A,x){return Sr(typeof h===x?A[h]:void 0,u.default,a.default)}function Li(u,a,h){if(si(h)!==\"number\")return Sr(u.default,a.default);let A=u.stops.length;if(A===1||h<=u.stops[0][0])return u.stops[0][1];if(h>=u.stops[A-1][0])return u.stops[A-1][1];let x=jp(u.stops.map(E=>E[0]),h);return u.stops[x][1]}function oi(u,a,h){let A=u.base!==void 0?u.base:1;if(si(h)!==\"number\")return Sr(u.default,a.default);let x=u.stops.length;if(x===1||h<=u.stops[0][0])return u.stops[0][1];if(h>=u.stops[x-1][0])return u.stops[x-1][1];let E=jp(u.stops.map(q=>q[0]),h),P=function(q,Q,rt,ot){let lt=ot-rt,pt=q-rt;return lt===0?0:Q===1?pt/lt:(Math.pow(Q,pt)-1)/(Math.pow(Q,lt)-1)}(h,A,u.stops[E][0],u.stops[E+1][0]),D=u.stops[E][1],B=u.stops[E+1][1],V=Zo[a.type]||Sx;return typeof D.evaluate==\"function\"?{evaluate(...q){let Q=D.evaluate.apply(void 0,q),rt=B.evaluate.apply(void 0,q);if(Q!==void 0&&rt!==void 0)return V(Q,rt,P,u.colorSpace)}}:V(D,B,P,u.colorSpace)}function Hm(u,a,h){switch(a.type){case\"color\":h=mi.parse(h);break;case\"formatted\":h=Gn.fromString(h.toString());break;case\"resolvedImage\":h=Wn.fromString(h.toString());break;case\"padding\":h=wn.parse(h);break;default:si(h)===a.type||a.type===\"enum\"&&a.values[h]||(h=void 0)}return Sr(h,u.default,a.default)}Oa.register(Zr,{error:[{kind:\"error\"},[Lr],(u,[a])=>{throw new Hi(a.evaluate(u))}],typeof:[Lr,[mr],(u,[a])=>mt(hn(a.evaluate(u)))],\"to-rgba\":[ct(be,4),[Cn],(u,[a])=>{let[h,A,x,E]=a.evaluate(u).rgb;return[255*h,255*A,255*x,E]}],rgb:[Cn,[be,be,be],fn],rgba:[Cn,[be,be,be,be],fn],has:{type:wr,overloads:[[[Lr],(u,[a])=>Fl(a.evaluate(u),u.properties())],[[Lr,ka],(u,[a,h])=>Fl(a.evaluate(u),h.evaluate(u))]]},get:{type:mr,overloads:[[[Lr],(u,[a])=>Kr(a.evaluate(u),u.properties())],[[Lr,ka],(u,[a,h])=>Kr(a.evaluate(u),h.evaluate(u))]]},\"feature-state\":[mr,[Lr],(u,[a])=>Kr(a.evaluate(u),u.featureState||{})],properties:[ka,[],u=>u.properties()],\"geometry-type\":[Lr,[],u=>u.geometryType()],id:[mr,[],u=>u.id()],zoom:[be,[],u=>u.globals.zoom],\"heatmap-density\":[be,[],u=>u.globals.heatmapDensity||0],\"line-progress\":[be,[],u=>u.globals.lineProgress||0],accumulated:[mr,[],u=>u.globals.accumulated===void 0?null:u.globals.accumulated],\"+\":[be,Yr(be),(u,a)=>{let h=0;for(let A of a)h+=A.evaluate(u);return h}],\"*\":[be,Yr(be),(u,a)=>{let h=1;for(let A of a)h*=A.evaluate(u);return h}],\"-\":{type:be,overloads:[[[be,be],(u,[a,h])=>a.evaluate(u)-h.evaluate(u)],[[be],(u,[a])=>-a.evaluate(u)]]},\"/\":[be,[be,be],(u,[a,h])=>a.evaluate(u)/h.evaluate(u)],\"%\":[be,[be,be],(u,[a,h])=>a.evaluate(u)%h.evaluate(u)],ln2:[be,[],()=>Math.LN2],pi:[be,[],()=>Math.PI],e:[be,[],()=>Math.E],\"^\":[be,[be,be],(u,[a,h])=>Math.pow(a.evaluate(u),h.evaluate(u))],sqrt:[be,[be],(u,[a])=>Math.sqrt(a.evaluate(u))],log10:[be,[be],(u,[a])=>Math.log(a.evaluate(u))/Math.LN10],ln:[be,[be],(u,[a])=>Math.log(a.evaluate(u))],log2:[be,[be],(u,[a])=>Math.log(a.evaluate(u))/Math.LN2],sin:[be,[be],(u,[a])=>Math.sin(a.evaluate(u))],cos:[be,[be],(u,[a])=>Math.cos(a.evaluate(u))],tan:[be,[be],(u,[a])=>Math.tan(a.evaluate(u))],asin:[be,[be],(u,[a])=>Math.asin(a.evaluate(u))],acos:[be,[be],(u,[a])=>Math.acos(a.evaluate(u))],atan:[be,[be],(u,[a])=>Math.atan(a.evaluate(u))],min:[be,Yr(be),(u,a)=>Math.min(...a.map(h=>h.evaluate(u)))],max:[be,Yr(be),(u,a)=>Math.max(...a.map(h=>h.evaluate(u)))],abs:[be,[be],(u,[a])=>Math.abs(a.evaluate(u))],round:[be,[be],(u,[a])=>{let h=a.evaluate(u);return h<0?-Math.round(-h):Math.round(h)}],floor:[be,[be],(u,[a])=>Math.floor(a.evaluate(u))],ceil:[be,[be],(u,[a])=>Math.ceil(a.evaluate(u))],\"filter-==\":[wr,[Lr,mr],(u,[a,h])=>u.properties()[a.value]===h.value],\"filter-id-==\":[wr,[mr],(u,[a])=>u.id()===a.value],\"filter-type-==\":[wr,[Lr],(u,[a])=>u.geometryType()===a.value],\"filter-<\":[wr,[Lr,mr],(u,[a,h])=>{let A=u.properties()[a.value],x=h.value;return typeof A==typeof x&&A<x}],\"filter-id-<\":[wr,[mr],(u,[a])=>{let h=u.id(),A=a.value;return typeof h==typeof A&&h<A}],\"filter->\":[wr,[Lr,mr],(u,[a,h])=>{let A=u.properties()[a.value],x=h.value;return typeof A==typeof x&&A>x}],\"filter-id->\":[wr,[mr],(u,[a])=>{let h=u.id(),A=a.value;return typeof h==typeof A&&h>A}],\"filter-<=\":[wr,[Lr,mr],(u,[a,h])=>{let A=u.properties()[a.value],x=h.value;return typeof A==typeof x&&A<=x}],\"filter-id-<=\":[wr,[mr],(u,[a])=>{let h=u.id(),A=a.value;return typeof h==typeof A&&h<=A}],\"filter->=\":[wr,[Lr,mr],(u,[a,h])=>{let A=u.properties()[a.value],x=h.value;return typeof A==typeof x&&A>=x}],\"filter-id->=\":[wr,[mr],(u,[a])=>{let h=u.id(),A=a.value;return typeof h==typeof A&&h>=A}],\"filter-has\":[wr,[mr],(u,[a])=>a.value in u.properties()],\"filter-has-id\":[wr,[],u=>u.id()!==null&&u.id()!==void 0],\"filter-type-in\":[wr,[ct(Lr)],(u,[a])=>a.value.indexOf(u.geometryType())>=0],\"filter-id-in\":[wr,[ct(mr)],(u,[a])=>a.value.indexOf(u.id())>=0],\"filter-in-small\":[wr,[Lr,ct(mr)],(u,[a,h])=>h.value.indexOf(u.properties()[a.value])>=0],\"filter-in-large\":[wr,[Lr,ct(mr)],(u,[a,h])=>function(A,x,E,P){for(;E<=P;){let D=E+P>>1;if(x[D]===A)return!0;x[D]>A?P=D-1:E=D+1}return!1}(u.properties()[a.value],h.value,0,h.value.length-1)],all:{type:wr,overloads:[[[wr,wr],(u,[a,h])=>a.evaluate(u)&&h.evaluate(u)],[Yr(wr),(u,a)=>{for(let h of a)if(!h.evaluate(u))return!1;return!0}]]},any:{type:wr,overloads:[[[wr,wr],(u,[a,h])=>a.evaluate(u)||h.evaluate(u)],[Yr(wr),(u,a)=>{for(let h of a)if(h.evaluate(u))return!0;return!1}]]},\"!\":[wr,[wr],(u,[a])=>!a.evaluate(u)],\"is-supported-script\":[wr,[Lr],(u,[a])=>{let h=u.globals&&u.globals.isSupportedScript;return!h||h(a.evaluate(u))}],upcase:[Lr,[Lr],(u,[a])=>a.evaluate(u).toUpperCase()],downcase:[Lr,[Lr],(u,[a])=>a.evaluate(u).toLowerCase()],concat:[Lr,Yr(mr),(u,a)=>a.map(h=>no(h.evaluate(u))).join(\"\")],\"resolved-locale\":[Lr,[Mc],(u,[a])=>a.evaluate(u).resolvedLocale()]});class en{constructor(a,h){var A;this.expression=a,this._warningHistory={},this._evaluator=new Ti,this._defaultValue=h?(A=h).type===\"color\"&&Fa(A.default)?new mi(0,0,0,0):A.type===\"color\"?mi.parse(A.default)||null:A.type===\"padding\"?wn.parse(A.default)||null:A.type===\"variableAnchorOffsetCollection\"?kn.parse(A.default)||null:A.default===void 0?null:A.default:null,this._enumValues=h&&h.type===\"enum\"?h.values:null}evaluateWithoutErrorHandling(a,h,A,x,E,P){return this._evaluator.globals=a,this._evaluator.feature=h,this._evaluator.featureState=A,this._evaluator.canonical=x,this._evaluator.availableImages=E||null,this._evaluator.formattedSection=P,this.expression.evaluate(this._evaluator)}evaluate(a,h,A,x,E,P){this._evaluator.globals=a,this._evaluator.feature=h||null,this._evaluator.featureState=A||null,this._evaluator.canonical=x,this._evaluator.availableImages=E||null,this._evaluator.formattedSection=P||null;try{let D=this.expression.evaluate(this._evaluator);if(D==null||typeof D==\"number\"&&D!=D)return this._defaultValue;if(this._enumValues&&!(D in this._enumValues))throw new Hi(`Expected value to be one of ${Object.keys(this._enumValues).map(B=>JSON.stringify(B)).join(\", \")}, but found ${JSON.stringify(D)} instead.`);return D}catch(D){return this._warningHistory[D.message]||(this._warningHistory[D.message]=!0,typeof console<\"u\"&&console.warn(D.message)),this._defaultValue}}}function Ni(u){return Array.isArray(u)&&u.length>0&&typeof u[0]==\"string\"&&u[0]in Zr}function uh(u,a){let h=new df(Zr,Np,[],a?function(x){let E={color:Cn,string:Lr,number:be,enum:Lr,boolean:wr,formatted:jn,padding:vt,resolvedImage:tt,variableAnchorOffsetCollection:nt};return x.type===\"array\"?ct(E[x.value]||mr,x.length):E[x.type]}(a):void 0),A=h.parse(u,void 0,void 0,void 0,a&&a.type===\"string\"?{typeAnnotation:\"coerce\"}:void 0);return A?Ic(new en(A,a)):_f(h.errors)}class wt{constructor(a,h){this.kind=a,this._styleExpression=h,this.isStateDependent=a!==\"constant\"&&!Up(h.expression)}evaluateWithoutErrorHandling(a,h,A,x,E,P){return this._styleExpression.evaluateWithoutErrorHandling(a,h,A,x,E,P)}evaluate(a,h,A,x,E,P){return this._styleExpression.evaluate(a,h,A,x,E,P)}}class qm{constructor(a,h,A,x){this.kind=a,this.zoomStops=A,this._styleExpression=h,this.isStateDependent=a!==\"camera\"&&!Up(h.expression),this.interpolationType=x}evaluateWithoutErrorHandling(a,h,A,x,E,P){return this._styleExpression.evaluateWithoutErrorHandling(a,h,A,x,E,P)}evaluate(a,h,A,x,E,P){return this._styleExpression.evaluate(a,h,A,x,E,P)}interpolationFactor(a,h,A){return this.interpolationType?bo.interpolationFactor(this.interpolationType,a,h,A):0}}function Qg(u,a){let h=uh(u,a);if(h.result===\"error\")return h;let A=h.value.expression,x=Um(A);if(!x&&!yf(a))return _f([new Vn(\"\",\"data expressions not supported\")]);let E=Vp(A,[\"zoom\"]);if(!E&&!Zp(a))return _f([new Vn(\"\",\"zoom expressions not supported\")]);let P=$p(A);return P||E?P instanceof Vn?_f([P]):P instanceof bo&&!Yo(a)?_f([new Vn(\"\",'\"interpolate\" expressions cannot be used with this property')]):Ic(P?new qm(x?\"camera\":\"composite\",h.value,P.labels,P instanceof bo?P.interpolation:void 0):new wt(x?\"constant\":\"source\",h.value)):_f([new Vn(\"\",'\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.')])}class Yp{constructor(a,h){this._parameters=a,this._specification=h,Ho(this,du(this._parameters,this._specification))}static deserialize(a){return new Yp(a._parameters,a._specification)}static serialize(a){return{_parameters:a._parameters,_specification:a._specification}}}function $p(u){let a=null;if(u instanceof Td)a=$p(u.result);else if(u instanceof jm){for(let h of u.args)if(a=$p(h),a)break}else(u instanceof Gp||u instanceof bo)&&u.input instanceof Oa&&u.input.name===\"zoom\"&&(a=u);return a instanceof Vn||u.eachChild(h=>{let A=$p(h);A instanceof Vn?a=A:!a&&A?a=new Vn(\"\",'\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.'):a&&A&&a!==A&&(a=new Vn(\"\",'Only one zoom-based \"step\" or \"interpolate\" subexpression may be used in an expression.'))}),a}function Qp(u){if(u===!0||u===!1)return!0;if(!Array.isArray(u)||u.length===0)return!1;switch(u[0]){case\"has\":return u.length>=2&&u[1]!==\"$id\"&&u[1]!==\"$type\";case\"in\":return u.length>=3&&(typeof u[1]!=\"string\"||Array.isArray(u[2]));case\"!in\":case\"!has\":case\"none\":return!1;case\"==\":case\"!=\":case\">\":case\">=\":case\"<\":case\"<=\":return u.length!==3||Array.isArray(u[1])||Array.isArray(u[2]);case\"any\":case\"all\":for(let a of u.slice(1))if(!Qp(a)&&typeof a!=\"boolean\")return!1;return!0;default:return!0}}let Xg={type:\"boolean\",default:!1,transition:!1,\"property-type\":\"data-driven\",expression:{interpolated:!1,parameters:[\"zoom\",\"feature\"]}};function Pd(u){if(u==null)return{filter:()=>!0,needGeometry:!1};Qp(u)||(u=ua(u));let a=uh(u,Xg);if(a.result===\"error\")throw new Error(a.value.map(h=>`${h.key}: ${h.message}`).join(\", \"));return{filter:(h,A,x)=>a.value.evaluate(h,A,{},x),needGeometry:vf(u)}}function Kg(u,a){return u<a?-1:u>a?1:0}function vf(u){if(!Array.isArray(u))return!1;if(u[0]===\"within\")return!0;for(let a=1;a<u.length;a++)if(vf(u[a]))return!0;return!1}function ua(u){if(!u)return!0;let a=u[0];return u.length<=1?a!==\"any\":a===\"==\"?Rn(u[1],u[2],\"==\"):a===\"!=\"?Xp(Rn(u[1],u[2],\"==\")):a===\"<\"||a===\">\"||a===\"<=\"||a===\">=\"?Rn(u[1],u[2],a):a===\"any\"?(h=u.slice(1),[\"any\"].concat(h.map(ua))):a===\"all\"?[\"all\"].concat(u.slice(1).map(ua)):a===\"none\"?[\"all\"].concat(u.slice(1).map(ua).map(Xp)):a===\"in\"?Jg(u[1],u.slice(2)):a===\"!in\"?Xp(Jg(u[1],u.slice(2))):a===\"has\"?t_(u[1]):a===\"!has\"?Xp(t_(u[1])):a!==\"within\"||u;var h}function Rn(u,a,h){switch(u){case\"$type\":return[`filter-type-${h}`,a];case\"$id\":return[`filter-id-${h}`,a];default:return[`filter-${h}`,u,a]}}function Jg(u,a){if(a.length===0)return!1;switch(u){case\"$type\":return[\"filter-type-in\",[\"literal\",a]];case\"$id\":return[\"filter-id-in\",[\"literal\",a]];default:return a.length>200&&!a.some(h=>typeof h!=typeof a[0])?[\"filter-in-large\",u,[\"literal\",a.sort(Kg)]]:[\"filter-in-small\",u,[\"literal\",a]]}}function t_(u){switch(u){case\"$type\":return!0;case\"$id\":return[\"filter-has-id\"];default:return[\"filter-has\",u]}}function Xp(u){return[\"!\",u]}function Zm(u){let a=typeof u;if(a===\"number\"||a===\"boolean\"||a===\"string\"||u==null)return JSON.stringify(u);if(Array.isArray(u)){let x=\"[\";for(let E of u)x+=`${Zm(E)},`;return`${x}]`}let h=Object.keys(u).sort(),A=\"{\";for(let x=0;x<h.length;x++)A+=`${JSON.stringify(h[x])}:${Zm(u[h[x]])},`;return`${A}}`}function e_(u){let a=\"\";for(let h of vo)a+=`/${Zm(u[h])}`;return a}function r_(u){let a=u.value;return a?[new Ae(u.key,a,\"constants have been deprecated as of v8\")]:[]}function Sn(u){return u instanceof Number||u instanceof String||u instanceof Boolean?u.valueOf():u}function Mi(u){if(Array.isArray(u))return u.map(Mi);if(u instanceof Object&&!(u instanceof Number||u instanceof String||u instanceof Boolean)){let a={};for(let h in u)a[h]=Mi(u[h]);return a}return Sn(u)}function Ns(u){let a=u.key,h=u.value,A=u.valueSpec||{},x=u.objectElementValidators||{},E=u.style,P=u.styleSpec,D=u.validateSpec,B=[],V=si(h);if(V!==\"object\")return[new Ae(a,h,`object expected, ${V} found`)];for(let q in h){let Q=q.split(\".\")[0],rt=A[Q]||A[\"*\"],ot;if(x[Q])ot=x[Q];else if(A[Q])ot=D;else if(x[\"*\"])ot=x[\"*\"];else{if(!A[\"*\"]){B.push(new Ae(a,h[q],`unknown property \"${q}\"`));continue}ot=D}B=B.concat(ot({key:(a&&`${a}.`)+q,value:h[q],valueSpec:rt,style:E,styleSpec:P,object:h,objectKey:q,validateSpec:D},h))}for(let q in A)x[q]||A[q].required&&A[q].default===void 0&&h[q]===void 0&&B.push(new Ae(a,h,`missing required property \"${q}\"`));return B}function Kp(u){let a=u.value,h=u.valueSpec,A=u.style,x=u.styleSpec,E=u.key,P=u.arrayElementValidator||u.validateSpec;if(si(a)!==\"array\")return[new Ae(E,a,`array expected, ${si(a)} found`)];if(h.length&&a.length!==h.length)return[new Ae(E,a,`array length ${h.length} expected, length ${a.length} found`)];if(h[\"min-length\"]&&a.length<h[\"min-length\"])return[new Ae(E,a,`array length at least ${h[\"min-length\"]} expected, length ${a.length} found`)];let D={type:h.value,values:h.values};x.$version<7&&(D.function=h.function),si(h.value)===\"object\"&&(D=h.value);let B=[];for(let V=0;V<a.length;V++)B=B.concat(P({array:a,arrayIndex:V,value:a[V],valueSpec:D,validateSpec:u.validateSpec,style:A,styleSpec:x,key:`${E}[${V}]`}));return B}function Jp(u){let a=u.key,h=u.value,A=u.valueSpec,x=si(h);return x===\"number\"&&h!=h&&(x=\"NaN\"),x!==\"number\"?[new Ae(a,h,`number expected, ${x} found`)]:\"minimum\"in A&&h<A.minimum?[new Ae(a,h,`${h} is less than the minimum value ${A.minimum}`)]:\"maximum\"in A&&h>A.maximum?[new Ae(a,h,`${h} is greater than the maximum value ${A.maximum}`)]:[]}function i_(u){let a=u.valueSpec,h=Sn(u.value.type),A,x,E,P={},D=h!==\"categorical\"&&u.value.property===void 0,B=!D,V=si(u.value.stops)===\"array\"&&si(u.value.stops[0])===\"array\"&&si(u.value.stops[0][0])===\"object\",q=Ns({key:u.key,value:u.value,valueSpec:u.styleSpec.function,validateSpec:u.validateSpec,style:u.style,styleSpec:u.styleSpec,objectElementValidators:{stops:function(ot){if(h===\"identity\")return[new Ae(ot.key,ot.value,'identity function may not have a \"stops\" property')];let lt=[],pt=ot.value;return lt=lt.concat(Kp({key:ot.key,value:pt,valueSpec:ot.valueSpec,validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec,arrayElementValidator:Q})),si(pt)===\"array\"&&pt.length===0&&lt.push(new Ae(ot.key,pt,\"array must have at least one stop\")),lt},default:function(ot){return ot.validateSpec({key:ot.key,value:ot.value,valueSpec:a,validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec})}}});return h===\"identity\"&&D&&q.push(new Ae(u.key,u.value,'missing required property \"property\"')),h===\"identity\"||u.value.stops||q.push(new Ae(u.key,u.value,'missing required property \"stops\"')),h===\"exponential\"&&u.valueSpec.expression&&!Yo(u.valueSpec)&&q.push(new Ae(u.key,u.value,\"exponential functions not supported\")),u.styleSpec.$version>=8&&(B&&!yf(u.valueSpec)?q.push(new Ae(u.key,u.value,\"property functions not supported\")):D&&!Zp(u.valueSpec)&&q.push(new Ae(u.key,u.value,\"zoom functions not supported\"))),h!==\"categorical\"&&!V||u.value.property!==void 0||q.push(new Ae(u.key,u.value,'\"property\" property is required')),q;function Q(ot){let lt=[],pt=ot.value,xt=ot.key;if(si(pt)!==\"array\")return[new Ae(xt,pt,`array expected, ${si(pt)} found`)];if(pt.length!==2)return[new Ae(xt,pt,`array length 2 expected, length ${pt.length} found`)];if(V){if(si(pt[0])!==\"object\")return[new Ae(xt,pt,`object expected, ${si(pt[0])} found`)];if(pt[0].zoom===void 0)return[new Ae(xt,pt,\"object stop key must have zoom\")];if(pt[0].value===void 0)return[new Ae(xt,pt,\"object stop key must have value\")];if(E&&E>Sn(pt[0].zoom))return[new Ae(xt,pt[0].zoom,\"stop zoom values must appear in ascending order\")];Sn(pt[0].zoom)!==E&&(E=Sn(pt[0].zoom),x=void 0,P={}),lt=lt.concat(Ns({key:`${xt}[0]`,value:pt[0],valueSpec:{zoom:{}},validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec,objectElementValidators:{zoom:Jp,value:rt}}))}else lt=lt.concat(rt({key:`${xt}[0]`,value:pt[0],valueSpec:{},validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec},pt));return Ni(Mi(pt[1]))?lt.concat([new Ae(`${xt}[1]`,pt[1],\"expressions are not allowed in function stops.\")]):lt.concat(ot.validateSpec({key:`${xt}[1]`,value:pt[1],valueSpec:a,validateSpec:ot.validateSpec,style:ot.style,styleSpec:ot.styleSpec}))}function rt(ot,lt){let pt=si(ot.value),xt=Sn(ot.value),Mt=ot.value!==null?ot.value:lt;if(A){if(pt!==A)return[new Ae(ot.key,Mt,`${pt} stop domain type must match previous stop domain type ${A}`)]}else A=pt;if(pt!==\"number\"&&pt!==\"string\"&&pt!==\"boolean\")return[new Ae(ot.key,Mt,\"stop domain value must be a number, string, or boolean\")];if(pt!==\"number\"&&h!==\"categorical\"){let Vt=`number expected, ${pt} found`;return yf(a)&&h===void 0&&(Vt+='\\nIf you intended to use a categorical function, specify `\"type\": \"categorical\"`.'),[new Ae(ot.key,Mt,Vt)]}return h!==\"categorical\"||pt!==\"number\"||isFinite(xt)&&Math.floor(xt)===xt?h!==\"categorical\"&&pt===\"number\"&&x!==void 0&&xt<x?[new Ae(ot.key,Mt,\"stop domain values must appear in ascending order\")]:(x=xt,h===\"categorical\"&&xt in P?[new Ae(ot.key,Mt,\"stop domain values must be unique\")]:(P[xt]=!0,[])):[new Ae(ot.key,Mt,`integer expected, found ${xt}`)]}}function pu(u){let a=(u.expressionContext===\"property\"?Qg:uh)(Mi(u.value),u.valueSpec);if(a.result===\"error\")return a.value.map(A=>new Ae(`${u.key}${A.key}`,u.value,A.message));let h=a.value.expression||a.value._styleExpression.expression;if(u.expressionContext===\"property\"&&u.propertyKey===\"text-font\"&&!h.outputDefined())return[new Ae(u.key,u.value,`Invalid data expression for \"${u.propertyKey}\". Output values must be contained as literals within the expression.`)];if(u.expressionContext===\"property\"&&u.propertyType===\"layout\"&&!Up(h))return[new Ae(u.key,u.value,'\"feature-state\" data expressions are not supported with layout properties.')];if(u.expressionContext===\"filter\"&&!Up(h))return[new Ae(u.key,u.value,'\"feature-state\" data expressions are not supported with filters.')];if(u.expressionContext&&u.expressionContext.indexOf(\"cluster\")===0){if(!Vp(h,[\"zoom\",\"feature-state\"]))return[new Ae(u.key,u.value,'\"zoom\" and \"feature-state\" expressions are not supported with cluster properties.')];if(u.expressionContext===\"cluster-initial\"&&!Um(h))return[new Ae(u.key,u.value,\"Feature data expressions are not supported with initial expression part of cluster properties.\")]}return[]}function Cc(u){let a=u.key,h=u.value,A=u.valueSpec,x=[];return Array.isArray(A.values)?A.values.indexOf(Sn(h))===-1&&x.push(new Ae(a,h,`expected one of [${A.values.join(\", \")}], ${JSON.stringify(h)} found`)):Object.keys(A.values).indexOf(Sn(h))===-1&&x.push(new Ae(a,h,`expected one of [${Object.keys(A.values).join(\", \")}], ${JSON.stringify(h)} found`)),x}function Au(u){return Qp(Mi(u.value))?pu(Ho({},u,{expressionContext:\"filter\",valueSpec:{value:\"boolean\"}})):xf(u)}function xf(u){let a=u.value,h=u.key;if(si(a)!==\"array\")return[new Ae(h,a,`array expected, ${si(a)} found`)];let A=u.styleSpec,x,E=[];if(a.length<1)return[new Ae(h,a,\"filter array must have at least 1 element\")];switch(E=E.concat(Cc({key:`${h}[0]`,value:a[0],valueSpec:A.filter_operator,style:u.style,styleSpec:u.styleSpec})),Sn(a[0])){case\"<\":case\"<=\":case\">\":case\">=\":a.length>=2&&Sn(a[1])===\"$type\"&&E.push(new Ae(h,a,`\"$type\" cannot be use with operator \"${a[0]}\"`));case\"==\":case\"!=\":a.length!==3&&E.push(new Ae(h,a,`filter array for operator \"${a[0]}\" must have 3 elements`));case\"in\":case\"!in\":a.length>=2&&(x=si(a[1]),x!==\"string\"&&E.push(new Ae(`${h}[1]`,a[1],`string expected, ${x} found`)));for(let P=2;P<a.length;P++)x=si(a[P]),Sn(a[1])===\"$type\"?E=E.concat(Cc({key:`${h}[${P}]`,value:a[P],valueSpec:A.geometry_type,style:u.style,styleSpec:u.styleSpec})):x!==\"string\"&&x!==\"number\"&&x!==\"boolean\"&&E.push(new Ae(`${h}[${P}]`,a[P],`string, number, or boolean expected, ${x} found`));break;case\"any\":case\"all\":case\"none\":for(let P=1;P<a.length;P++)E=E.concat(xf({key:`${h}[${P}]`,value:a[P],style:u.style,styleSpec:u.styleSpec}));break;case\"has\":case\"!has\":x=si(a[1]),a.length!==2?E.push(new Ae(h,a,`filter array for \"${a[0]}\" operator must have 2 elements`)):x!==\"string\"&&E.push(new Ae(`${h}[1]`,a[1],`string expected, ${x} found`));break;case\"within\":x=si(a[1]),a.length!==2?E.push(new Ae(h,a,`filter array for \"${a[0]}\" operator must have 2 elements`)):x!==\"object\"&&E.push(new Ae(`${h}[1]`,a[1],`object expected, ${x} found`))}return E}function Ym(u,a){let h=u.key,A=u.validateSpec,x=u.style,E=u.styleSpec,P=u.value,D=u.objectKey,B=E[`${a}_${u.layerType}`];if(!B)return[];let V=D.match(/^(.*)-transition$/);if(a===\"paint\"&&V&&B[V[1]]&&B[V[1]].transition)return A({key:h,value:P,valueSpec:E.transition,style:x,styleSpec:E});let q=u.valueSpec||B[D];if(!q)return[new Ae(h,P,`unknown property \"${D}\"`)];let Q;if(si(P)===\"string\"&&yf(q)&&!q.tokens&&(Q=/^{([^}]+)}$/.exec(P)))return[new Ae(h,P,`\"${D}\" does not support interpolation syntax\nUse an identity property function instead: \\`{ \"type\": \"identity\", \"property\": ${JSON.stringify(Q[1])} }\\`.`)];let rt=[];return u.layerType===\"symbol\"&&(D===\"text-field\"&&x&&!x.glyphs&&rt.push(new Ae(h,P,'use of \"text-field\" requires a style \"glyphs\" property')),D===\"text-font\"&&Fa(Mi(P))&&Sn(P.type)===\"identity\"&&rt.push(new Ae(h,P,'\"text-font\" does not support identity functions'))),rt.concat(A({key:u.key,value:P,valueSpec:q,style:x,styleSpec:E,expressionContext:\"property\",propertyType:a,propertyKey:D}))}function $m(u){return Ym(u,\"paint\")}function bf(u){return Ym(u,\"layout\")}function Qm(u){let a=[],h=u.value,A=u.key,x=u.style,E=u.styleSpec;h.type||h.ref||a.push(new Ae(A,h,'either \"type\" or \"ref\" is required'));let P=Sn(h.type),D=Sn(h.ref);if(h.id){let B=Sn(h.id);for(let V=0;V<u.arrayIndex;V++){let q=x.layers[V];Sn(q.id)===B&&a.push(new Ae(A,h.id,`duplicate layer id \"${h.id}\", previously used at line ${q.id.__line__}`))}}if(\"ref\"in h){let B;[\"type\",\"source\",\"source-layer\",\"filter\",\"layout\"].forEach(V=>{V in h&&a.push(new Ae(A,h[V],`\"${V}\" is prohibited for ref layers`))}),x.layers.forEach(V=>{Sn(V.id)===D&&(B=V)}),B?B.ref?a.push(new Ae(A,h.ref,\"ref cannot reference another ref layer\")):P=Sn(B.type):a.push(new Ae(A,h.ref,`ref layer \"${D}\" not found`))}else if(P!==\"background\")if(h.source){let B=x.sources&&x.sources[h.source],V=B&&Sn(B.type);B?V===\"vector\"&&P===\"raster\"?a.push(new Ae(A,h.source,`layer \"${h.id}\" requires a raster source`)):V!==\"raster-dem\"&&P===\"hillshade\"?a.push(new Ae(A,h.source,`layer \"${h.id}\" requires a raster-dem source`)):V===\"raster\"&&P!==\"raster\"?a.push(new Ae(A,h.source,`layer \"${h.id}\" requires a vector source`)):V!==\"vector\"||h[\"source-layer\"]?V===\"raster-dem\"&&P!==\"hillshade\"?a.push(new Ae(A,h.source,\"raster-dem source can only be used with layer type 'hillshade'.\")):P!==\"line\"||!h.paint||!h.paint[\"line-gradient\"]||V===\"geojson\"&&B.lineMetrics||a.push(new Ae(A,h,`layer \"${h.id}\" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`)):a.push(new Ae(A,h,`layer \"${h.id}\" must specify a \"source-layer\"`)):a.push(new Ae(A,h.source,`source \"${h.source}\" not found`))}else a.push(new Ae(A,h,'missing required property \"source\"'));return a=a.concat(Ns({key:A,value:h,valueSpec:E.layer,style:u.style,styleSpec:u.styleSpec,validateSpec:u.validateSpec,objectElementValidators:{\"*\":()=>[],type:()=>u.validateSpec({key:`${A}.type`,value:h.type,valueSpec:E.layer.type,style:u.style,styleSpec:u.styleSpec,validateSpec:u.validateSpec,object:h,objectKey:\"type\"}),filter:Au,layout:B=>Ns({layer:h,key:B.key,value:B.value,style:B.style,styleSpec:B.styleSpec,validateSpec:B.validateSpec,objectElementValidators:{\"*\":V=>bf(Ho({layerType:P},V))}}),paint:B=>Ns({layer:h,key:B.key,value:B.value,style:B.style,styleSpec:B.styleSpec,validateSpec:B.validateSpec,objectElementValidators:{\"*\":V=>$m(Ho({layerType:P},V))}})}})),a}function Lc(u){let a=u.value,h=u.key,A=si(a);return A!==\"string\"?[new Ae(h,a,`string expected, ${A} found`)]:[]}let n_={promoteId:function({key:u,value:a}){if(si(a)===\"string\")return Lc({key:u,value:a});{let h=[];for(let A in a)h.push(...Lc({key:`${u}.${A}`,value:a[A]}));return h}}};function s_(u){let a=u.value,h=u.key,A=u.styleSpec,x=u.style,E=u.validateSpec;if(!a.type)return[new Ae(h,a,'\"type\" is required')];let P=Sn(a.type),D;switch(P){case\"vector\":case\"raster\":return D=Ns({key:h,value:a,valueSpec:A[`source_${P.replace(\"-\",\"_\")}`],style:u.style,styleSpec:A,objectElementValidators:n_,validateSpec:E}),D;case\"raster-dem\":return D=function(B){var V;let q=(V=B.sourceName)!==null&&V!==void 0?V:\"\",Q=B.value,rt=B.styleSpec,ot=rt.source_raster_dem,lt=B.style,pt=[],xt=si(Q);if(Q===void 0)return pt;if(xt!==\"object\")return pt.push(new Ae(\"source_raster_dem\",Q,`object expected, ${xt} found`)),pt;let Mt=Sn(Q.encoding)===\"custom\",Vt=[\"redFactor\",\"greenFactor\",\"blueFactor\",\"baseShift\"],It=B.value.encoding?`\"${B.value.encoding}\"`:\"Default\";for(let zt in Q)!Mt&&Vt.includes(zt)?pt.push(new Ae(zt,Q[zt],`In \"${q}\": \"${zt}\" is only valid when \"encoding\" is set to \"custom\". ${It} encoding found`)):ot[zt]?pt=pt.concat(B.validateSpec({key:zt,value:Q[zt],valueSpec:ot[zt],validateSpec:B.validateSpec,style:lt,styleSpec:rt})):pt.push(new Ae(zt,Q[zt],`unknown property \"${zt}\"`));return pt}({sourceName:h,value:a,style:u.style,styleSpec:A,validateSpec:E}),D;case\"geojson\":if(D=Ns({key:h,value:a,valueSpec:A.source_geojson,style:x,styleSpec:A,validateSpec:E,objectElementValidators:n_}),a.cluster)for(let B in a.clusterProperties){let[V,q]=a.clusterProperties[B],Q=typeof V==\"string\"?[V,[\"accumulated\"],[\"get\",B]]:V;D.push(...pu({key:`${h}.${B}.map`,value:q,validateSpec:E,expressionContext:\"cluster-map\"})),D.push(...pu({key:`${h}.${B}.reduce`,value:Q,validateSpec:E,expressionContext:\"cluster-reduce\"}))}return D;case\"video\":return Ns({key:h,value:a,valueSpec:A.source_video,style:x,validateSpec:E,styleSpec:A});case\"image\":return Ns({key:h,value:a,valueSpec:A.source_image,style:x,validateSpec:E,styleSpec:A});case\"canvas\":return[new Ae(h,null,\"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.\",\"source.canvas\")];default:return Cc({key:`${h}.type`,value:a.type,valueSpec:{values:[\"vector\",\"raster\",\"raster-dem\",\"geojson\",\"video\",\"image\"]},style:x,validateSpec:E,styleSpec:A})}}function o_(u){let a=u.value,h=u.styleSpec,A=h.light,x=u.style,E=[],P=si(a);if(a===void 0)return E;if(P!==\"object\")return E=E.concat([new Ae(\"light\",a,`object expected, ${P} found`)]),E;for(let D in a){let B=D.match(/^(.*)-transition$/);E=E.concat(B&&A[B[1]]&&A[B[1]].transition?u.validateSpec({key:D,value:a[D],valueSpec:h.transition,validateSpec:u.validateSpec,style:x,styleSpec:h}):A[D]?u.validateSpec({key:D,value:a[D],valueSpec:A[D],validateSpec:u.validateSpec,style:x,styleSpec:h}):[new Ae(D,a[D],`unknown property \"${D}\"`)])}return E}function is(u){let a=u.value,h=u.styleSpec,A=h.sky,x=u.style,E=si(a);if(a===void 0)return[];if(E!==\"object\")return[new Ae(\"sky\",a,`object expected, ${E} found`)];let P=[];for(let D in a)P=P.concat(A[D]?gu({key:D,value:a[D],valueSpec:A[D],style:x,styleSpec:h}):[new Ae(D,a[D],`unknown property \"${D}\"`)]);return P}function ol(u){let a=u.value,h=u.styleSpec,A=h.terrain,x=u.style,E=[],P=si(a);if(a===void 0)return E;if(P!==\"object\")return E=E.concat([new Ae(\"terrain\",a,`object expected, ${P} found`)]),E;for(let D in a)E=E.concat(A[D]?u.validateSpec({key:D,value:a[D],valueSpec:A[D],validateSpec:u.validateSpec,style:x,styleSpec:h}):[new Ae(D,a[D],`unknown property \"${D}\"`)]);return E}function Ui(u){let a=[],h=u.value,A=u.key;if(Array.isArray(h)){let x=[],E=[];for(let P in h)h[P].id&&x.includes(h[P].id)&&a.push(new Ae(A,h,`all the sprites' ids must be unique, but ${h[P].id} is duplicated`)),x.push(h[P].id),h[P].url&&E.includes(h[P].url)&&a.push(new Ae(A,h,`all the sprites' URLs must be unique, but ${h[P].url} is duplicated`)),E.push(h[P].url),a=a.concat(Ns({key:`${A}[${P}]`,value:h[P],valueSpec:{id:{type:\"string\",required:!0},url:{type:\"string\",required:!0}},validateSpec:u.validateSpec}));return a}return Lc({key:A,value:h})}let mu={\"*\":()=>[],array:Kp,boolean:function(u){let a=u.value,h=u.key,A=si(a);return A!==\"boolean\"?[new Ae(h,a,`boolean expected, ${A} found`)]:[]},number:Jp,color:function(u){let a=u.key,h=u.value,A=si(h);return A!==\"string\"?[new Ae(a,h,`color expected, ${A} found`)]:mi.parse(String(h))?[]:[new Ae(a,h,`color expected, \"${h}\" found`)]},constants:r_,enum:Cc,filter:Au,function:i_,layer:Qm,object:Ns,source:s_,light:o_,sky:is,terrain:ol,string:Lc,formatted:function(u){return Lc(u).length===0?[]:pu(u)},resolvedImage:function(u){return Lc(u).length===0?[]:pu(u)},padding:function(u){let a=u.key,h=u.value;if(si(h)===\"array\"){if(h.length<1||h.length>4)return[new Ae(a,h,`padding requires 1 to 4 values; ${h.length} values found`)];let A={type:\"number\"},x=[];for(let E=0;E<h.length;E++)x=x.concat(u.validateSpec({key:`${a}[${E}]`,value:h[E],validateSpec:u.validateSpec,valueSpec:A}));return x}return Jp({key:a,value:h,valueSpec:{}})},variableAnchorOffsetCollection:function(u){let a=u.key,h=u.value,A=si(h),x=u.styleSpec;if(A!==\"array\"||h.length<1||h.length%2!=0)return[new Ae(a,h,\"variableAnchorOffsetCollection requires a non-empty array of even length\")];let E=[];for(let P=0;P<h.length;P+=2)E=E.concat(Cc({key:`${a}[${P}]`,value:h[P],valueSpec:x.layout_symbol[\"text-anchor\"]})),E=E.concat(Kp({key:`${a}[${P+1}]`,value:h[P+1],valueSpec:{length:2,value:\"number\"},validateSpec:u.validateSpec,style:u.style,styleSpec:x}));return E},sprite:Ui};function gu(u){let a=u.value,h=u.valueSpec,A=u.styleSpec;return u.validateSpec=gu,h.expression&&Fa(Sn(a))?i_(u):h.expression&&Ni(Mi(a))?pu(u):h.type&&mu[h.type]?mu[h.type](u):Ns(Ho({},u,{valueSpec:h.type?A[h.type]:h}))}function Id(u){let a=u.value,h=u.key,A=Lc(u);return A.length||(a.indexOf(\"{fontstack}\")===-1&&A.push(new Ae(h,a,'\"glyphs\" url must include a \"{fontstack}\" token')),a.indexOf(\"{range}\")===-1&&A.push(new Ae(h,a,'\"glyphs\" url must include a \"{range}\" token'))),A}function za(u,a=Jt){let h=[];return h=h.concat(gu({key:\"\",value:u,valueSpec:a.$root,styleSpec:a,style:u,validateSpec:gu,objectElementValidators:{glyphs:Id,\"*\":()=>[]}})),u.constants&&(h=h.concat(r_({key:\"constants\",value:u.constants,style:u,styleSpec:a,validateSpec:gu}))),wf(h)}function ao(u){return function(a){return u({...a,validateSpec:gu})}}function wf(u){return[].concat(u).sort((a,h)=>a.line-h.line)}function Es(u){return function(...a){return wf(u.apply(this,a))}}za.source=Es(ao(s_)),za.sprite=Es(ao(Ui)),za.glyphs=Es(ao(Id)),za.light=Es(ao(o_)),za.sky=Es(ao(is)),za.terrain=Es(ao(ol)),za.layer=Es(ao(Qm)),za.filter=Es(ao(Au)),za.paintProperty=Es(ao($m)),za.layoutProperty=Es(ao(bf));let Sf=za,tA=Sf.light,eA=Sf.paintProperty,al=Sf.layoutProperty;function kc(u,a){let h=!1;if(a&&a.length)for(let A of a)u.fire(new an(new Error(A.message))),h=!0;return h}class _u{constructor(a,h,A){let x=this.cells=[];if(a instanceof ArrayBuffer){this.arrayBuffer=a;let P=new Int32Array(this.arrayBuffer);a=P[0],this.d=(h=P[1])+2*(A=P[2]);for(let B=0;B<this.d*this.d;B++){let V=P[3+B],q=P[3+B+1];x.push(V===q?null:P.subarray(V,q))}let D=P[3+x.length+1];this.keys=P.subarray(P[3+x.length],D),this.bboxes=P.subarray(D),this.insert=this._insertReadonly}else{this.d=h+2*A;for(let P=0;P<this.d*this.d;P++)x.push([]);this.keys=[],this.bboxes=[]}this.n=h,this.extent=a,this.padding=A,this.scale=h/a,this.uid=0;let E=A/h*a;this.min=-E,this.max=a+E}insert(a,h,A,x,E){this._forEachCell(h,A,x,E,this._insertCell,this.uid++,void 0,void 0),this.keys.push(a),this.bboxes.push(h),this.bboxes.push(A),this.bboxes.push(x),this.bboxes.push(E)}_insertReadonly(){throw new Error(\"Cannot insert into a GridIndex created from an ArrayBuffer.\")}_insertCell(a,h,A,x,E,P){this.cells[E].push(P)}query(a,h,A,x,E){let P=this.min,D=this.max;if(a<=P&&h<=P&&D<=A&&D<=x&&!E)return Array.prototype.slice.call(this.keys);{let B=[];return this._forEachCell(a,h,A,x,this._queryCell,B,{},E),B}}_queryCell(a,h,A,x,E,P,D,B){let V=this.cells[E];if(V!==null){let q=this.keys,Q=this.bboxes;for(let rt=0;rt<V.length;rt++){let ot=V[rt];if(D[ot]===void 0){let lt=4*ot;(B?B(Q[lt+0],Q[lt+1],Q[lt+2],Q[lt+3]):a<=Q[lt+2]&&h<=Q[lt+3]&&A>=Q[lt+0]&&x>=Q[lt+1])?(D[ot]=!0,P.push(q[ot])):D[ot]=!1}}}}_forEachCell(a,h,A,x,E,P,D,B){let V=this._convertToCellCoord(a),q=this._convertToCellCoord(h),Q=this._convertToCellCoord(A),rt=this._convertToCellCoord(x);for(let ot=V;ot<=Q;ot++)for(let lt=q;lt<=rt;lt++){let pt=this.d*lt+ot;if((!B||B(this._convertFromCellCoord(ot),this._convertFromCellCoord(lt),this._convertFromCellCoord(ot+1),this._convertFromCellCoord(lt+1)))&&E.call(this,a,h,A,x,pt,P,D,B))return}}_convertFromCellCoord(a){return(a-this.padding)/this.scale}_convertToCellCoord(a){return Math.max(0,Math.min(this.d-1,Math.floor(a*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let a=this.cells,h=3+this.cells.length+1+1,A=0;for(let P=0;P<this.cells.length;P++)A+=this.cells[P].length;let x=new Int32Array(h+A+this.keys.length+this.bboxes.length);x[0]=this.extent,x[1]=this.n,x[2]=this.padding;let E=h;for(let P=0;P<a.length;P++){let D=a[P];x[3+P]=E,x.set(D,E),E+=D.length}return x[3+a.length]=E,x.set(this.keys,E),E+=this.keys.length,x[3+a.length+1]=E,x.set(this.bboxes,E),E+=this.bboxes.length,x.buffer}static serialize(a,h){let A=a.toArrayBuffer();return h&&h.push(A),{buffer:A}}static deserialize(a){return new _u(a.buffer)}}let zl={};function Fe(u,a,h={}){if(zl[u])throw new Error(`${u} is already registered.`);Object.defineProperty(a,\"_classRegistryKey\",{value:u,writeable:!1}),zl[u]={klass:a,omit:h.omit||[],shallow:h.shallow||[]}}Fe(\"Object\",Object),Fe(\"TransferableGridIndex\",_u),Fe(\"Color\",mi),Fe(\"Error\",Error),Fe(\"AJAXError\",Ci),Fe(\"ResolvedImage\",Wn),Fe(\"StylePropertyFunction\",Yp),Fe(\"StyleExpression\",en,{omit:[\"_evaluator\"]}),Fe(\"ZoomDependentExpression\",qm),Fe(\"ZoomConstantExpression\",wt),Fe(\"CompoundExpression\",Oa,{omit:[\"_evaluate\"]});for(let u in Zr)Zr[u]._classRegistryKey||Fe(`Expression_${u}`,Zr[u]);function Xm(u){return u&&typeof ArrayBuffer<\"u\"&&(u instanceof ArrayBuffer||u.constructor&&u.constructor.name===\"ArrayBuffer\")}function Tf(u,a){if(u==null||typeof u==\"boolean\"||typeof u==\"number\"||typeof u==\"string\"||u instanceof Boolean||u instanceof Number||u instanceof String||u instanceof Date||u instanceof RegExp||u instanceof Blob||u instanceof Error)return u;if(Xm(u)||Fs(u))return a&&a.push(u),u;if(ArrayBuffer.isView(u)){let h=u;return a&&a.push(h.buffer),h}if(u instanceof ImageData)return a&&a.push(u.data.buffer),u;if(Array.isArray(u)){let h=[];for(let A of u)h.push(Tf(A,a));return h}if(typeof u==\"object\"){let h=u.constructor,A=h._classRegistryKey;if(!A)throw new Error(`can't serialize object of unregistered class ${h.name}`);if(!zl[A])throw new Error(`${A} is not registered.`);let x=h.serialize?h.serialize(u,a):{};if(h.serialize){if(a&&x===a[a.length-1])throw new Error(\"statically serialized object won't survive transfer of $name property\")}else{for(let E in u){if(!u.hasOwnProperty(E)||zl[A].omit.indexOf(E)>=0)continue;let P=u[E];x[E]=zl[A].shallow.indexOf(E)>=0?P:Tf(P,a)}u instanceof Error&&(x.message=u.message)}if(x.$name)throw new Error(\"$name property is reserved for worker serialization logic.\");return A!==\"Object\"&&(x.$name=A),x}throw new Error(\"can't serialize object of type \"+typeof u)}function Mf(u){if(u==null||typeof u==\"boolean\"||typeof u==\"number\"||typeof u==\"string\"||u instanceof Boolean||u instanceof Number||u instanceof String||u instanceof Date||u instanceof RegExp||u instanceof Blob||u instanceof Error||Xm(u)||Fs(u)||ArrayBuffer.isView(u)||u instanceof ImageData)return u;if(Array.isArray(u))return u.map(Mf);if(typeof u==\"object\"){let a=u.$name||\"Object\";if(!zl[a])throw new Error(`can't deserialize unregistered class ${a}`);let{klass:h}=zl[a];if(!h)throw new Error(`can't deserialize unregistered class ${a}`);if(h.deserialize)return h.deserialize(u);let A=Object.create(h.prototype);for(let x of Object.keys(u)){if(x===\"$name\")continue;let E=u[x];A[x]=zl[a].shallow.indexOf(x)>=0?E:Mf(E)}return A}throw new Error(\"can't deserialize object of type \"+typeof u)}class rA{constructor(){this.first=!0}update(a,h){let A=Math.floor(a);return this.first?(this.first=!1,this.lastIntegerZoom=A,this.lastIntegerZoomTime=0,this.lastZoom=a,this.lastFloorZoom=A,!0):(this.lastFloorZoom>A?(this.lastIntegerZoom=A+1,this.lastIntegerZoomTime=h):this.lastFloorZoom<A&&(this.lastIntegerZoom=A,this.lastIntegerZoomTime=h),a!==this.lastZoom&&(this.lastZoom=a,this.lastFloorZoom=A,!0))}}let Ce={\"Latin-1 Supplement\":u=>u>=128&&u<=255,Arabic:u=>u>=1536&&u<=1791,\"Arabic Supplement\":u=>u>=1872&&u<=1919,\"Arabic Extended-A\":u=>u>=2208&&u<=2303,\"Hangul Jamo\":u=>u>=4352&&u<=4607,\"Unified Canadian Aboriginal Syllabics\":u=>u>=5120&&u<=5759,Khmer:u=>u>=6016&&u<=6143,\"Unified Canadian Aboriginal Syllabics Extended\":u=>u>=6320&&u<=6399,\"General Punctuation\":u=>u>=8192&&u<=8303,\"Letterlike Symbols\":u=>u>=8448&&u<=8527,\"Number Forms\":u=>u>=8528&&u<=8591,\"Miscellaneous Technical\":u=>u>=8960&&u<=9215,\"Control Pictures\":u=>u>=9216&&u<=9279,\"Optical Character Recognition\":u=>u>=9280&&u<=9311,\"Enclosed Alphanumerics\":u=>u>=9312&&u<=9471,\"Geometric Shapes\":u=>u>=9632&&u<=9727,\"Miscellaneous Symbols\":u=>u>=9728&&u<=9983,\"Miscellaneous Symbols and Arrows\":u=>u>=11008&&u<=11263,\"CJK Radicals Supplement\":u=>u>=11904&&u<=12031,\"Kangxi Radicals\":u=>u>=12032&&u<=12255,\"Ideographic Description Characters\":u=>u>=12272&&u<=12287,\"CJK Symbols and Punctuation\":u=>u>=12288&&u<=12351,Hiragana:u=>u>=12352&&u<=12447,Katakana:u=>u>=12448&&u<=12543,Bopomofo:u=>u>=12544&&u<=12591,\"Hangul Compatibility Jamo\":u=>u>=12592&&u<=12687,Kanbun:u=>u>=12688&&u<=12703,\"Bopomofo Extended\":u=>u>=12704&&u<=12735,\"CJK Strokes\":u=>u>=12736&&u<=12783,\"Katakana Phonetic Extensions\":u=>u>=12784&&u<=12799,\"Enclosed CJK Letters and Months\":u=>u>=12800&&u<=13055,\"CJK Compatibility\":u=>u>=13056&&u<=13311,\"CJK Unified Ideographs Extension A\":u=>u>=13312&&u<=19903,\"Yijing Hexagram Symbols\":u=>u>=19904&&u<=19967,\"CJK Unified Ideographs\":u=>u>=19968&&u<=40959,\"Yi Syllables\":u=>u>=40960&&u<=42127,\"Yi Radicals\":u=>u>=42128&&u<=42191,\"Hangul Jamo Extended-A\":u=>u>=43360&&u<=43391,\"Hangul Syllables\":u=>u>=44032&&u<=55215,\"Hangul Jamo Extended-B\":u=>u>=55216&&u<=55295,\"Private Use Area\":u=>u>=57344&&u<=63743,\"CJK Compatibility Ideographs\":u=>u>=63744&&u<=64255,\"Arabic Presentation Forms-A\":u=>u>=64336&&u<=65023,\"Vertical Forms\":u=>u>=65040&&u<=65055,\"CJK Compatibility Forms\":u=>u>=65072&&u<=65103,\"Small Form Variants\":u=>u>=65104&&u<=65135,\"Arabic Presentation Forms-B\":u=>u>=65136&&u<=65279,\"Halfwidth and Fullwidth Forms\":u=>u>=65280&&u<=65519};function iA(u){for(let a of u)if(Cd(a.charCodeAt(0)))return!0;return!1}function Ef(u){for(let a of u)if(!a_(a.charCodeAt(0)))return!1;return!0}function a_(u){return!(Ce.Arabic(u)||Ce[\"Arabic Supplement\"](u)||Ce[\"Arabic Extended-A\"](u)||Ce[\"Arabic Presentation Forms-A\"](u)||Ce[\"Arabic Presentation Forms-B\"](u))}function Cd(u){return!(u!==746&&u!==747&&(u<4352||!(Ce[\"Bopomofo Extended\"](u)||Ce.Bopomofo(u)||Ce[\"CJK Compatibility Forms\"](u)&&!(u>=65097&&u<=65103)||Ce[\"CJK Compatibility Ideographs\"](u)||Ce[\"CJK Compatibility\"](u)||Ce[\"CJK Radicals Supplement\"](u)||Ce[\"CJK Strokes\"](u)||!(!Ce[\"CJK Symbols and Punctuation\"](u)||u>=12296&&u<=12305||u>=12308&&u<=12319||u===12336)||Ce[\"CJK Unified Ideographs Extension A\"](u)||Ce[\"CJK Unified Ideographs\"](u)||Ce[\"Enclosed CJK Letters and Months\"](u)||Ce[\"Hangul Compatibility Jamo\"](u)||Ce[\"Hangul Jamo Extended-A\"](u)||Ce[\"Hangul Jamo Extended-B\"](u)||Ce[\"Hangul Jamo\"](u)||Ce[\"Hangul Syllables\"](u)||Ce.Hiragana(u)||Ce[\"Ideographic Description Characters\"](u)||Ce.Kanbun(u)||Ce[\"Kangxi Radicals\"](u)||Ce[\"Katakana Phonetic Extensions\"](u)||Ce.Katakana(u)&&u!==12540||!(!Ce[\"Halfwidth and Fullwidth Forms\"](u)||u===65288||u===65289||u===65293||u>=65306&&u<=65310||u===65339||u===65341||u===65343||u>=65371&&u<=65503||u===65507||u>=65512&&u<=65519)||!(!Ce[\"Small Form Variants\"](u)||u>=65112&&u<=65118||u>=65123&&u<=65126)||Ce[\"Unified Canadian Aboriginal Syllabics\"](u)||Ce[\"Unified Canadian Aboriginal Syllabics Extended\"](u)||Ce[\"Vertical Forms\"](u)||Ce[\"Yijing Hexagram Symbols\"](u)||Ce[\"Yi Syllables\"](u)||Ce[\"Yi Radicals\"](u))))}function Ld(u){return!(Cd(u)||function(a){return!!(Ce[\"Latin-1 Supplement\"](a)&&(a===167||a===169||a===174||a===177||a===188||a===189||a===190||a===215||a===247)||Ce[\"General Punctuation\"](a)&&(a===8214||a===8224||a===8225||a===8240||a===8241||a===8251||a===8252||a===8258||a===8263||a===8264||a===8265||a===8273)||Ce[\"Letterlike Symbols\"](a)||Ce[\"Number Forms\"](a)||Ce[\"Miscellaneous Technical\"](a)&&(a>=8960&&a<=8967||a>=8972&&a<=8991||a>=8996&&a<=9e3||a===9003||a>=9085&&a<=9114||a>=9150&&a<=9165||a===9167||a>=9169&&a<=9179||a>=9186&&a<=9215)||Ce[\"Control Pictures\"](a)&&a!==9251||Ce[\"Optical Character Recognition\"](a)||Ce[\"Enclosed Alphanumerics\"](a)||Ce[\"Geometric Shapes\"](a)||Ce[\"Miscellaneous Symbols\"](a)&&!(a>=9754&&a<=9759)||Ce[\"Miscellaneous Symbols and Arrows\"](a)&&(a>=11026&&a<=11055||a>=11088&&a<=11097||a>=11192&&a<=11243)||Ce[\"CJK Symbols and Punctuation\"](a)||Ce.Katakana(a)||Ce[\"Private Use Area\"](a)||Ce[\"CJK Compatibility Forms\"](a)||Ce[\"Small Form Variants\"](a)||Ce[\"Halfwidth and Fullwidth Forms\"](a)||a===8734||a===8756||a===8757||a>=9984&&a<=10087||a>=10102&&a<=10131||a===65532||a===65533)}(u))}function yu(u){return u>=1424&&u<=2303||Ce[\"Arabic Presentation Forms-A\"](u)||Ce[\"Arabic Presentation Forms-B\"](u)}function Tx(u,a){return!(!a&&yu(u)||u>=2304&&u<=3583||u>=3840&&u<=4255||Ce.Khmer(u))}function Km(u){for(let a of u)if(yu(a.charCodeAt(0)))return!0;return!1}let vu=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus=\"unavailable\",this.pluginURL=null}setState(u){this.pluginStatus=u.pluginStatus,this.pluginURL=u.pluginURL}setMethods(u){this.applyArabicShaping=u.applyArabicShaping,this.processBidirectionalText=u.processBidirectionalText,this.processStyledBidirectionalText=u.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class ki{constructor(a,h){this.zoom=a,h?(this.now=h.now,this.fadeDuration=h.fadeDuration,this.zoomHistory=h.zoomHistory,this.transition=h.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new rA,this.transition={})}isSupportedScript(a){return function(h,A){for(let x of h)if(!Tx(x.charCodeAt(0),A))return!1;return!0}(a,vu.getRTLTextPluginStatus()===\"loaded\")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let a=this.zoom,h=a-Math.floor(a),A=this.crossFadingFactor();return a>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:h+(1-h)*A}:{fromScale:.5,toScale:1,t:1-(1-A)*h}}}class Nl{constructor(a,h){this.property=a,this.value=h,this.expression=function(A,x){if(Fa(A))return new Yp(A,x);if(Ni(A)){let E=Qg(A,x);if(E.result===\"error\")throw new Error(E.value.map(P=>`${P.key}: ${P.message}`).join(\", \"));return E.value}{let E=A;return x.type===\"color\"&&typeof A==\"string\"?E=mi.parse(A):x.type!==\"padding\"||typeof A!=\"number\"&&!Array.isArray(A)?x.type===\"variableAnchorOffsetCollection\"&&Array.isArray(A)&&(E=kn.parse(A)):E=wn.parse(A),{kind:\"constant\",evaluate:()=>E}}}(h===void 0?a.specification.default:h,a.specification)}isDataDriven(){return this.expression.kind===\"source\"||this.expression.kind===\"composite\"}possiblyEvaluate(a,h,A){return this.property.possiblyEvaluate(this,a,h,A)}}class nA{constructor(a){this.property=a,this.value=new Nl(a,void 0)}transitioned(a,h){return new l_(this.property,this.value,h,Tt({},a.transition,this.transition),a.now)}untransitioned(){return new l_(this.property,this.value,null,{},0)}}class Pf{constructor(a){this._properties=a,this._values=Object.create(a.defaultTransitionablePropertyValues)}getValue(a){return oe(this._values[a].value.value)}setValue(a,h){Object.prototype.hasOwnProperty.call(this._values,a)||(this._values[a]=new nA(this._values[a].property)),this._values[a].value=new Nl(this._values[a].property,h===null?void 0:oe(h))}getTransition(a){return oe(this._values[a].transition)}setTransition(a,h){Object.prototype.hasOwnProperty.call(this._values,a)||(this._values[a]=new nA(this._values[a].property)),this._values[a].transition=oe(h)||void 0}serialize(){let a={};for(let h of Object.keys(this._values)){let A=this.getValue(h);A!==void 0&&(a[h]=A);let x=this.getTransition(h);x!==void 0&&(a[`${h}-transition`]=x)}return a}transitioned(a,h){let A=new Jm(this._properties);for(let x of Object.keys(this._values))A._values[x]=this._values[x].transitioned(a,h._values[x]);return A}untransitioned(){let a=new Jm(this._properties);for(let h of Object.keys(this._values))a._values[h]=this._values[h].untransitioned();return a}}class l_{constructor(a,h,A,x,E){this.property=a,this.value=h,this.begin=E+x.delay||0,this.end=this.begin+x.duration||0,a.specification.transition&&(x.delay||x.duration)&&(this.prior=A)}possiblyEvaluate(a,h,A){let x=a.now||0,E=this.value.possiblyEvaluate(a,h,A),P=this.prior;if(P){if(x>this.end)return this.prior=null,E;if(this.value.isDataDriven())return this.prior=null,E;if(x<this.begin)return P.possiblyEvaluate(a,h,A);{let D=(x-this.begin)/(this.end-this.begin);return this.property.interpolate(P.possiblyEvaluate(a,h,A),E,function(B){if(B<=0)return 0;if(B>=1)return 1;let V=B*B,q=V*B;return 4*(B<.5?q:3*(B-V)+q-.75)}(D))}}return E}}class Jm{constructor(a){this._properties=a,this._values=Object.create(a.defaultTransitioningPropertyValues)}possiblyEvaluate(a,h,A){let x=new kd(this._properties);for(let E of Object.keys(this._values))x._values[E]=this._values[E].possiblyEvaluate(a,h,A);return x}hasTransition(){for(let a of Object.keys(this._values))if(this._values[a].prior)return!0;return!1}}class c_{constructor(a){this._properties=a,this._values=Object.create(a.defaultPropertyValues)}hasValue(a){return this._values[a].value!==void 0}getValue(a){return oe(this._values[a].value)}setValue(a,h){this._values[a]=new Nl(this._values[a].property,h===null?void 0:oe(h))}serialize(){let a={};for(let h of Object.keys(this._values)){let A=this.getValue(h);A!==void 0&&(a[h]=A)}return a}possiblyEvaluate(a,h,A){let x=new kd(this._properties);for(let E of Object.keys(this._values))x._values[E]=this._values[E].possiblyEvaluate(a,h,A);return x}}class ll{constructor(a,h,A){this.property=a,this.value=h,this.parameters=A}isConstant(){return this.value.kind===\"constant\"}constantOr(a){return this.value.kind===\"constant\"?this.value.value:a}evaluate(a,h,A,x){return this.property.evaluate(this.value,this.parameters,a,h,A,x)}}class kd{constructor(a){this._properties=a,this._values=Object.create(a.defaultPossiblyEvaluatedValues)}get(a){return this._values[a]}}class Qe{constructor(a){this.specification=a}possiblyEvaluate(a,h){if(a.isDataDriven())throw new Error(\"Value should not be data driven\");return a.expression.evaluate(h)}interpolate(a,h,A){let x=Zo[this.specification.type];return x?x(a,h,A):a}}class fr{constructor(a,h){this.specification=a,this.overrides=h}possiblyEvaluate(a,h,A,x){return new ll(this,a.expression.kind===\"constant\"||a.expression.kind===\"camera\"?{kind:\"constant\",value:a.expression.evaluate(h,null,{},A,x)}:a.expression,h)}interpolate(a,h,A){if(a.value.kind!==\"constant\"||h.value.kind!==\"constant\")return a;if(a.value.value===void 0||h.value.value===void 0)return new ll(this,{kind:\"constant\",value:void 0},a.parameters);let x=Zo[this.specification.type];if(x){let E=x(a.value.value,h.value.value,A);return new ll(this,{kind:\"constant\",value:E},a.parameters)}return a}evaluate(a,h,A,x,E,P){return a.kind===\"constant\"?a.value:a.evaluate(h,A,x,E,P)}}class If extends fr{possiblyEvaluate(a,h,A,x){if(a.value===void 0)return new ll(this,{kind:\"constant\",value:void 0},h);if(a.expression.kind===\"constant\"){let E=a.expression.evaluate(h,null,{},A,x),P=a.property.specification.type===\"resolvedImage\"&&typeof E!=\"string\"?E.name:E,D=this._calculate(P,P,P,h);return new ll(this,{kind:\"constant\",value:D},h)}if(a.expression.kind===\"camera\"){let E=this._calculate(a.expression.evaluate({zoom:h.zoom-1}),a.expression.evaluate({zoom:h.zoom}),a.expression.evaluate({zoom:h.zoom+1}),h);return new ll(this,{kind:\"constant\",value:E},h)}return new ll(this,a.expression,h)}evaluate(a,h,A,x,E,P){if(a.kind===\"source\"){let D=a.evaluate(h,A,x,E,P);return this._calculate(D,D,D,h)}return a.kind===\"composite\"?this._calculate(a.evaluate({zoom:Math.floor(h.zoom)-1},A,x),a.evaluate({zoom:Math.floor(h.zoom)},A,x),a.evaluate({zoom:Math.floor(h.zoom)+1},A,x),h):a.value}_calculate(a,h,A,x){return x.zoom>x.zoomHistory.lastIntegerZoom?{from:a,to:h}:{from:A,to:h}}interpolate(a){return a}}class xu{constructor(a){this.specification=a}possiblyEvaluate(a,h,A,x){if(a.value!==void 0){if(a.expression.kind===\"constant\"){let E=a.expression.evaluate(h,null,{},A,x);return this._calculate(E,E,E,h)}return this._calculate(a.expression.evaluate(new ki(Math.floor(h.zoom-1),h)),a.expression.evaluate(new ki(Math.floor(h.zoom),h)),a.expression.evaluate(new ki(Math.floor(h.zoom+1),h)),h)}}_calculate(a,h,A,x){return x.zoom>x.zoomHistory.lastIntegerZoom?{from:a,to:h}:{from:A,to:h}}interpolate(a){return a}}class t0{constructor(a){this.specification=a}possiblyEvaluate(a,h,A,x){return!!a.expression.evaluate(h,null,{},A,x)}interpolate(){return!1}}class wo{constructor(a){this.properties=a,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let h in a){let A=a[h];A.specification.overridable&&this.overridableProperties.push(h);let x=this.defaultPropertyValues[h]=new Nl(A,void 0),E=this.defaultTransitionablePropertyValues[h]=new nA(A);this.defaultTransitioningPropertyValues[h]=E.untransitioned(),this.defaultPossiblyEvaluatedValues[h]=x.possiblyEvaluate({})}}}Fe(\"DataDrivenProperty\",fr),Fe(\"DataConstantProperty\",Qe),Fe(\"CrossFadedDataDrivenProperty\",If),Fe(\"CrossFadedProperty\",xu),Fe(\"ColorRampProperty\",t0);let e0=\"-transition\";class cl extends aa{constructor(a,h){if(super(),this.id=a.id,this.type=a.type,this._featureFilter={filter:()=>!0,needGeometry:!1},a.type!==\"custom\"&&(this.metadata=a.metadata,this.minzoom=a.minzoom,this.maxzoom=a.maxzoom,a.type!==\"background\"&&(this.source=a.source,this.sourceLayer=a[\"source-layer\"],this.filter=a.filter),h.layout&&(this._unevaluatedLayout=new c_(h.layout)),h.paint)){this._transitionablePaint=new Pf(h.paint);for(let A in a.paint)this.setPaintProperty(A,a.paint[A],{validate:!1});for(let A in a.layout)this.setLayoutProperty(A,a.layout[A],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new kd(h.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(a){return a===\"visibility\"?this.visibility:this._unevaluatedLayout.getValue(a)}setLayoutProperty(a,h,A={}){h!=null&&this._validate(al,`layers.${this.id}.layout.${a}`,a,h,A)||(a!==\"visibility\"?this._unevaluatedLayout.setValue(a,h):this.visibility=h)}getPaintProperty(a){return a.endsWith(e0)?this._transitionablePaint.getTransition(a.slice(0,-11)):this._transitionablePaint.getValue(a)}setPaintProperty(a,h,A={}){if(h!=null&&this._validate(eA,`layers.${this.id}.paint.${a}`,a,h,A))return!1;if(a.endsWith(e0))return this._transitionablePaint.setTransition(a.slice(0,-11),h||void 0),!1;{let x=this._transitionablePaint._values[a],E=x.property.specification[\"property-type\"]===\"cross-faded-data-driven\",P=x.value.isDataDriven(),D=x.value;this._transitionablePaint.setValue(a,h),this._handleSpecialPaintPropertyUpdate(a);let B=this._transitionablePaint._values[a].value;return B.isDataDriven()||P||E||this._handleOverridablePaintPropertyUpdate(a,D,B)}}_handleSpecialPaintPropertyUpdate(a){}_handleOverridablePaintPropertyUpdate(a,h,A){return!1}isHidden(a){return!!(this.minzoom&&a<this.minzoom)||!!(this.maxzoom&&a>=this.maxzoom)||this.visibility===\"none\"}updateTransitions(a){this._transitioningPaint=this._transitionablePaint.transitioned(a,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(a,h){a.getCrossfadeParameters&&(this._crossfadeParameters=a.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(a,void 0,h)),this.paint=this._transitioningPaint.possiblyEvaluate(a,void 0,h)}serialize(){let a={id:this.id,type:this.type,source:this.source,\"source-layer\":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(a.layout=a.layout||{},a.layout.visibility=this.visibility),te(a,(h,A)=>!(h===void 0||A===\"layout\"&&!Object.keys(h).length||A===\"paint\"&&!Object.keys(h).length))}_validate(a,h,A,x,E={}){return(!E||E.validate!==!1)&&kc(this,a.call(Sf,{key:h,layerType:this.type,objectKey:A,value:x,styleSpec:Jt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let a in this.paint._values){let h=this.paint.get(a);if(h instanceof ll&&yf(h.property.specification)&&(h.value.kind===\"source\"||h.value.kind===\"composite\")&&h.value.isStateDependent)return!0}return!1}}let Mx={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Rd{constructor(a,h){this._structArray=a,this._pos1=h*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Tn{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(a,h){return a._trim(),h&&(a.isTransferred=!0,h.push(a.arrayBuffer)),{length:a.length,arrayBuffer:a.arrayBuffer}}static deserialize(a){let h=Object.create(this.prototype);return h.arrayBuffer=a.arrayBuffer,h.length=a.length,h.capacity=a.arrayBuffer.byteLength/h.bytesPerElement,h._refreshViews(),h}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(a){this.reserve(a),this.length=a}reserve(a){if(a>this.capacity){this.capacity=Math.max(a,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let h=this.uint8;this._refreshViews(),h&&this.uint8.set(h)}}_refreshViews(){throw new Error(\"_refreshViews() must be implemented by each concrete StructArray layout\")}}function Dn(u,a=1){let h=0,A=0;return{members:u.map(x=>{let E=Mx[x.type].BYTES_PER_ELEMENT,P=h=r0(h,Math.max(a,E)),D=x.components||1;return A=Math.max(A,E),h+=E*D,{name:x.name,type:x.type,components:D,offset:P}}),size:r0(h,Math.max(A,a)),alignment:a}}function r0(u,a){return Math.ceil(u/a)*a}class Na extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,h){let A=this.length;return this.resize(A+1),this.emplace(A,a,h)}emplace(a,h,A){let x=2*a;return this.int16[x+0]=h,this.int16[x+1]=A,a}}Na.prototype.bytesPerElement=4,Fe(\"StructArrayLayout2i4\",Na);class sA extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,h,A){let x=this.length;return this.resize(x+1),this.emplace(x,a,h,A)}emplace(a,h,A,x){let E=3*a;return this.int16[E+0]=h,this.int16[E+1]=A,this.int16[E+2]=x,a}}sA.prototype.bytesPerElement=6,Fe(\"StructArrayLayout3i6\",sA);class lo extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,h,A,x){let E=this.length;return this.resize(E+1),this.emplace(E,a,h,A,x)}emplace(a,h,A,x,E){let P=4*a;return this.int16[P+0]=h,this.int16[P+1]=A,this.int16[P+2]=x,this.int16[P+3]=E,a}}lo.prototype.bytesPerElement=8,Fe(\"StructArrayLayout4i8\",lo);class qn extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,h,A,x,E,P){let D=this.length;return this.resize(D+1),this.emplace(D,a,h,A,x,E,P)}emplace(a,h,A,x,E,P,D){let B=6*a;return this.int16[B+0]=h,this.int16[B+1]=A,this.int16[B+2]=x,this.int16[B+3]=E,this.int16[B+4]=P,this.int16[B+5]=D,a}}qn.prototype.bytesPerElement=12,Fe(\"StructArrayLayout2i4i12\",qn);class i0 extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,h,A,x,E,P){let D=this.length;return this.resize(D+1),this.emplace(D,a,h,A,x,E,P)}emplace(a,h,A,x,E,P,D){let B=4*a,V=8*a;return this.int16[B+0]=h,this.int16[B+1]=A,this.uint8[V+4]=x,this.uint8[V+5]=E,this.uint8[V+6]=P,this.uint8[V+7]=D,a}}i0.prototype.bytesPerElement=8,Fe(\"StructArrayLayout2i4ub8\",i0);class Cf extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,h){let A=this.length;return this.resize(A+1),this.emplace(A,a,h)}emplace(a,h,A){let x=2*a;return this.float32[x+0]=h,this.float32[x+1]=A,a}}Cf.prototype.bytesPerElement=8,Fe(\"StructArrayLayout2f8\",Cf);class n0 extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,h,A,x,E,P,D,B,V,q){let Q=this.length;return this.resize(Q+1),this.emplace(Q,a,h,A,x,E,P,D,B,V,q)}emplace(a,h,A,x,E,P,D,B,V,q,Q){let rt=10*a;return this.uint16[rt+0]=h,this.uint16[rt+1]=A,this.uint16[rt+2]=x,this.uint16[rt+3]=E,this.uint16[rt+4]=P,this.uint16[rt+5]=D,this.uint16[rt+6]=B,this.uint16[rt+7]=V,this.uint16[rt+8]=q,this.uint16[rt+9]=Q,a}}n0.prototype.bytesPerElement=20,Fe(\"StructArrayLayout10ui20\",n0);class s0 extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,h,A,x,E,P,D,B,V,q,Q,rt){let ot=this.length;return this.resize(ot+1),this.emplace(ot,a,h,A,x,E,P,D,B,V,q,Q,rt)}emplace(a,h,A,x,E,P,D,B,V,q,Q,rt,ot){let lt=12*a;return this.int16[lt+0]=h,this.int16[lt+1]=A,this.int16[lt+2]=x,this.int16[lt+3]=E,this.uint16[lt+4]=P,this.uint16[lt+5]=D,this.uint16[lt+6]=B,this.uint16[lt+7]=V,this.int16[lt+8]=q,this.int16[lt+9]=Q,this.int16[lt+10]=rt,this.int16[lt+11]=ot,a}}s0.prototype.bytesPerElement=24,Fe(\"StructArrayLayout4i4ui4i24\",s0);class Rc extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,h,A){let x=this.length;return this.resize(x+1),this.emplace(x,a,h,A)}emplace(a,h,A,x){let E=3*a;return this.float32[E+0]=h,this.float32[E+1]=A,this.float32[E+2]=x,a}}Rc.prototype.bytesPerElement=12,Fe(\"StructArrayLayout3f12\",Rc);class Us extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(a){let h=this.length;return this.resize(h+1),this.emplace(h,a)}emplace(a,h){return this.uint32[1*a+0]=h,a}}Us.prototype.bytesPerElement=4,Fe(\"StructArrayLayout1ul4\",Us);class hh extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,h,A,x,E,P,D,B,V){let q=this.length;return this.resize(q+1),this.emplace(q,a,h,A,x,E,P,D,B,V)}emplace(a,h,A,x,E,P,D,B,V,q){let Q=10*a,rt=5*a;return this.int16[Q+0]=h,this.int16[Q+1]=A,this.int16[Q+2]=x,this.int16[Q+3]=E,this.int16[Q+4]=P,this.int16[Q+5]=D,this.uint32[rt+3]=B,this.uint16[Q+8]=V,this.uint16[Q+9]=q,a}}hh.prototype.bytesPerElement=20,Fe(\"StructArrayLayout6i1ul2ui20\",hh);class ul extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,h,A,x,E,P){let D=this.length;return this.resize(D+1),this.emplace(D,a,h,A,x,E,P)}emplace(a,h,A,x,E,P,D){let B=6*a;return this.int16[B+0]=h,this.int16[B+1]=A,this.int16[B+2]=x,this.int16[B+3]=E,this.int16[B+4]=P,this.int16[B+5]=D,a}}ul.prototype.bytesPerElement=12,Fe(\"StructArrayLayout2i2i2i12\",ul);class Dd extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(a,h,A,x,E){let P=this.length;return this.resize(P+1),this.emplace(P,a,h,A,x,E)}emplace(a,h,A,x,E,P){let D=4*a,B=8*a;return this.float32[D+0]=h,this.float32[D+1]=A,this.float32[D+2]=x,this.int16[B+6]=E,this.int16[B+7]=P,a}}Dd.prototype.bytesPerElement=16,Fe(\"StructArrayLayout2f1f2i16\",Dd);class Od extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,h,A,x){let E=this.length;return this.resize(E+1),this.emplace(E,a,h,A,x)}emplace(a,h,A,x,E){let P=12*a,D=3*a;return this.uint8[P+0]=h,this.uint8[P+1]=A,this.float32[D+1]=x,this.float32[D+2]=E,a}}Od.prototype.bytesPerElement=12,Fe(\"StructArrayLayout2ub2f12\",Od);class fh extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,h,A){let x=this.length;return this.resize(x+1),this.emplace(x,a,h,A)}emplace(a,h,A,x){let E=3*a;return this.uint16[E+0]=h,this.uint16[E+1]=A,this.uint16[E+2]=x,a}}fh.prototype.bytesPerElement=6,Fe(\"StructArrayLayout3ui6\",fh);class Ps extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,h,A,x,E,P,D,B,V,q,Q,rt,ot,lt,pt,xt,Mt){let Vt=this.length;return this.resize(Vt+1),this.emplace(Vt,a,h,A,x,E,P,D,B,V,q,Q,rt,ot,lt,pt,xt,Mt)}emplace(a,h,A,x,E,P,D,B,V,q,Q,rt,ot,lt,pt,xt,Mt,Vt){let It=24*a,zt=12*a,ie=48*a;return this.int16[It+0]=h,this.int16[It+1]=A,this.uint16[It+2]=x,this.uint16[It+3]=E,this.uint32[zt+2]=P,this.uint32[zt+3]=D,this.uint32[zt+4]=B,this.uint16[It+10]=V,this.uint16[It+11]=q,this.uint16[It+12]=Q,this.float32[zt+7]=rt,this.float32[zt+8]=ot,this.uint8[ie+36]=lt,this.uint8[ie+37]=pt,this.uint8[ie+38]=xt,this.uint32[zt+10]=Mt,this.int16[It+22]=Vt,a}}Ps.prototype.bytesPerElement=48,Fe(\"StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48\",Ps);class oA extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,h,A,x,E,P,D,B,V,q,Q,rt,ot,lt,pt,xt,Mt,Vt,It,zt,ie,ue,Be,Ke,Re,Ie,we,We){let Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,a,h,A,x,E,P,D,B,V,q,Q,rt,ot,lt,pt,xt,Mt,Vt,It,zt,ie,ue,Be,Ke,Re,Ie,we,We)}emplace(a,h,A,x,E,P,D,B,V,q,Q,rt,ot,lt,pt,xt,Mt,Vt,It,zt,ie,ue,Be,Ke,Re,Ie,we,We,Ee){let pe=32*a,cr=16*a;return this.int16[pe+0]=h,this.int16[pe+1]=A,this.int16[pe+2]=x,this.int16[pe+3]=E,this.int16[pe+4]=P,this.int16[pe+5]=D,this.int16[pe+6]=B,this.int16[pe+7]=V,this.uint16[pe+8]=q,this.uint16[pe+9]=Q,this.uint16[pe+10]=rt,this.uint16[pe+11]=ot,this.uint16[pe+12]=lt,this.uint16[pe+13]=pt,this.uint16[pe+14]=xt,this.uint16[pe+15]=Mt,this.uint16[pe+16]=Vt,this.uint16[pe+17]=It,this.uint16[pe+18]=zt,this.uint16[pe+19]=ie,this.uint16[pe+20]=ue,this.uint16[pe+21]=Be,this.uint16[pe+22]=Ke,this.uint32[cr+12]=Re,this.float32[cr+13]=Ie,this.float32[cr+14]=we,this.uint16[pe+30]=We,this.uint16[pe+31]=Ee,a}}oA.prototype.bytesPerElement=64,Fe(\"StructArrayLayout8i15ui1ul2f2ui64\",oA);class dh extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a){let h=this.length;return this.resize(h+1),this.emplace(h,a)}emplace(a,h){return this.float32[1*a+0]=h,a}}dh.prototype.bytesPerElement=4,Fe(\"StructArrayLayout1f4\",dh);class hl extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,h,A){let x=this.length;return this.resize(x+1),this.emplace(x,a,h,A)}emplace(a,h,A,x){let E=3*a;return this.uint16[6*a+0]=h,this.float32[E+1]=A,this.float32[E+2]=x,a}}hl.prototype.bytesPerElement=12,Fe(\"StructArrayLayout1ui2f12\",hl);class Dc extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,h,A){let x=this.length;return this.resize(x+1),this.emplace(x,a,h,A)}emplace(a,h,A,x){let E=4*a;return this.uint32[2*a+0]=h,this.uint16[E+2]=A,this.uint16[E+3]=x,a}}Dc.prototype.bytesPerElement=8,Fe(\"StructArrayLayout1ul2ui8\",Dc);class Oc extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a,h){let A=this.length;return this.resize(A+1),this.emplace(A,a,h)}emplace(a,h,A){let x=2*a;return this.uint16[x+0]=h,this.uint16[x+1]=A,a}}Oc.prototype.bytesPerElement=4,Fe(\"StructArrayLayout2ui4\",Oc);class aA extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(a){let h=this.length;return this.resize(h+1),this.emplace(h,a)}emplace(a,h){return this.uint16[1*a+0]=h,a}}aA.prototype.bytesPerElement=2,Fe(\"StructArrayLayout1ui2\",aA);class lA extends Tn{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(a,h,A,x){let E=this.length;return this.resize(E+1),this.emplace(E,a,h,A,x)}emplace(a,h,A,x,E){let P=4*a;return this.float32[P+0]=h,this.float32[P+1]=A,this.float32[P+2]=x,this.float32[P+3]=E,a}}lA.prototype.bytesPerElement=16,Fe(\"StructArrayLayout4f16\",lA);class T extends Rd{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new _(this.anchorPointX,this.anchorPointY)}}T.prototype.size=20;class l extends hh{get(a){return new T(this,a)}}Fe(\"CollisionBoxArray\",l);class f extends Rd{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(a){this._structArray.uint8[this._pos1+37]=a}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(a){this._structArray.uint8[this._pos1+38]=a}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(a){this._structArray.uint32[this._pos4+10]=a}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}f.prototype.size=48;class v extends Ps{get(a){return new f(this,a)}}Fe(\"PlacedSymbolArray\",v);class b extends Rd{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(a){this._structArray.uint32[this._pos4+12]=a}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}b.prototype.size=64;class M extends oA{get(a){return new b(this,a)}}Fe(\"SymbolInstanceArray\",M);class O extends dh{getoffsetX(a){return this.float32[1*a+0]}}Fe(\"GlyphOffsetArray\",O);class F extends sA{getx(a){return this.int16[3*a+0]}gety(a){return this.int16[3*a+1]}gettileUnitDistanceFromAnchor(a){return this.int16[3*a+2]}}Fe(\"SymbolLineVertexArray\",F);class U extends Rd{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}U.prototype.size=12;class W extends hl{get(a){return new U(this,a)}}Fe(\"TextAnchorOffsetArray\",W);class $ extends Rd{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}$.prototype.size=8;class X extends Dc{get(a){return new $(this,a)}}Fe(\"FeatureIndexArray\",X);class at extends Na{}class gt extends Na{}class _t extends Na{}class yt extends qn{}class At extends i0{}class kt extends Cf{}class Wt extends n0{}class St extends s0{}class Nt extends Rc{}class Zt extends Us{}class Ht extends ul{}class ne extends Od{}class he extends fh{}class ce extends Oc{}let ge=Dn([{name:\"a_pos\",components:2,type:\"Int16\"}],4),{members:Ue}=ge;class ur{constructor(a=[]){this.segments=a}prepareSegment(a,h,A,x){let E=this.segments[this.segments.length-1];return a>ur.MAX_VERTEX_ARRAY_LENGTH&&Le(`Max vertices per segment is ${ur.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${a}`),(!E||E.vertexLength+a>ur.MAX_VERTEX_ARRAY_LENGTH||E.sortKey!==x)&&(E={vertexOffset:h.length,primitiveOffset:A.length,vertexLength:0,primitiveLength:0},x!==void 0&&(E.sortKey=x),this.segments.push(E)),E}get(){return this.segments}destroy(){for(let a of this.segments)for(let h in a.vaos)a.vaos[h].destroy()}static simpleSegment(a,h,A,x){return new ur([{vertexOffset:a,primitiveOffset:h,vertexLength:A,primitiveLength:x,vaos:{},sortKey:0}])}}function Me(u,a){return 256*(u=J(Math.floor(u),0,255))+J(Math.floor(a),0,255)}ur.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Fe(\"SegmentVector\",ur);let ar=Dn([{name:\"a_pattern_from\",components:4,type:\"Uint16\"},{name:\"a_pattern_to\",components:4,type:\"Uint16\"},{name:\"a_pixel_ratio_from\",components:1,type:\"Uint16\"},{name:\"a_pixel_ratio_to\",components:1,type:\"Uint16\"}]);var He={exports:{}},rn={exports:{}};rn.exports=function(u,a){var h,A,x,E,P,D,B,V;for(A=u.length-(h=3&u.length),x=a,P=3432918353,D=461845907,V=0;V<A;)B=255&u.charCodeAt(V)|(255&u.charCodeAt(++V))<<8|(255&u.charCodeAt(++V))<<16|(255&u.charCodeAt(++V))<<24,++V,x=27492+(65535&(E=5*(65535&(x=(x^=B=(65535&(B=(B=(65535&B)*P+(((B>>>16)*P&65535)<<16)&4294967295)<<15|B>>>17))*D+(((B>>>16)*D&65535)<<16)&4294967295)<<13|x>>>19))+((5*(x>>>16)&65535)<<16)&4294967295))+((58964+(E>>>16)&65535)<<16);switch(B=0,h){case 3:B^=(255&u.charCodeAt(V+2))<<16;case 2:B^=(255&u.charCodeAt(V+1))<<8;case 1:x^=B=(65535&(B=(B=(65535&(B^=255&u.charCodeAt(V)))*P+(((B>>>16)*P&65535)<<16)&4294967295)<<15|B>>>17))*D+(((B>>>16)*D&65535)<<16)&4294967295}return x^=u.length,x=2246822507*(65535&(x^=x>>>16))+((2246822507*(x>>>16)&65535)<<16)&4294967295,x=3266489909*(65535&(x^=x>>>13))+((3266489909*(x>>>16)&65535)<<16)&4294967295,(x^=x>>>16)>>>0};var Jr=rn.exports,Fr={exports:{}};Fr.exports=function(u,a){for(var h,A=u.length,x=a^A,E=0;A>=4;)h=1540483477*(65535&(h=255&u.charCodeAt(E)|(255&u.charCodeAt(++E))<<8|(255&u.charCodeAt(++E))<<16|(255&u.charCodeAt(++E))<<24))+((1540483477*(h>>>16)&65535)<<16),x=1540483477*(65535&x)+((1540483477*(x>>>16)&65535)<<16)^(h=1540483477*(65535&(h^=h>>>24))+((1540483477*(h>>>16)&65535)<<16)),A-=4,++E;switch(A){case 3:x^=(255&u.charCodeAt(E+2))<<16;case 2:x^=(255&u.charCodeAt(E+1))<<8;case 1:x=1540483477*(65535&(x^=255&u.charCodeAt(E)))+((1540483477*(x>>>16)&65535)<<16)}return x=1540483477*(65535&(x^=x>>>13))+((1540483477*(x>>>16)&65535)<<16),(x^=x>>>15)>>>0};var $r=Jr,On=Fr.exports;He.exports=$r,He.exports.murmur3=$r,He.exports.murmur2=On;var Dr=o(He.exports);class So{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(a,h,A,x){this.ids.push(Is(a)),this.positions.push(h,A,x)}getPositions(a){if(!this.indexed)throw new Error(\"Trying to get index, but feature positions are not indexed\");let h=Is(a),A=0,x=this.ids.length-1;for(;A<x;){let P=A+x>>1;this.ids[P]>=h?x=P:A=P+1}let E=[];for(;this.ids[A]===h;)E.push({index:this.positions[3*A],start:this.positions[3*A+1],end:this.positions[3*A+2]}),A++;return E}static serialize(a,h){let A=new Float64Array(a.ids),x=new Uint32Array(a.positions);return Mn(A,x,0,A.length-1),h&&h.push(A.buffer,x.buffer),{ids:A,positions:x}}static deserialize(a){let h=new So;return h.ids=a.ids,h.positions=a.positions,h.indexed=!0,h}}function Is(u){let a=+u;return!isNaN(a)&&a<=Number.MAX_SAFE_INTEGER?a:Dr(String(u))}function Mn(u,a,h,A){for(;h<A;){let x=u[h+A>>1],E=h-1,P=A+1;for(;;){do E++;while(u[E]<x);do P--;while(u[P]>x);if(E>=P)break;Vs(u,E,P),Vs(a,3*E,3*P),Vs(a,3*E+1,3*P+1),Vs(a,3*E+2,3*P+2)}P-h<A-P?(Mn(u,a,h,P),h=P+1):(Mn(u,a,P+1,A),A=P)}}function Vs(u,a,h){let A=u[a];u[a]=u[h],u[h]=A}Fe(\"FeaturePositionMap\",So);class js{constructor(a,h){this.gl=a.gl,this.location=h}}class ha extends js{constructor(a,h){super(a,h),this.current=0}set(a){this.current!==a&&(this.current=a,this.gl.uniform1f(this.location,a))}}class Bc extends js{constructor(a,h){super(a,h),this.current=[0,0,0,0]}set(a){a[0]===this.current[0]&&a[1]===this.current[1]&&a[2]===this.current[2]&&a[3]===this.current[3]||(this.current=a,this.gl.uniform4f(this.location,a[0],a[1],a[2],a[3]))}}class Lf extends js{constructor(a,h){super(a,h),this.current=mi.transparent}set(a){a.r===this.current.r&&a.g===this.current.g&&a.b===this.current.b&&a.a===this.current.a||(this.current=a,this.gl.uniform4f(this.location,a.r,a.g,a.b,a.a))}}let kf=new Float32Array(16);function bu(u){return[Me(255*u.r,255*u.g),Me(255*u.b,255*u.a)]}class us{constructor(a,h,A){this.value=a,this.uniformNames=h.map(x=>`u_${x}`),this.type=A}setUniform(a,h,A){a.set(A.constantOr(this.value))}getBinding(a,h,A){return this.type===\"color\"?new Lf(a,h):new ha(a,h)}}class Zn{constructor(a,h){this.uniformNames=h.map(A=>`u_${A}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(a,h){this.pixelRatioFrom=h.pixelRatio,this.pixelRatioTo=a.pixelRatio,this.patternFrom=h.tlbr,this.patternTo=a.tlbr}setUniform(a,h,A,x){let E=x===\"u_pattern_to\"?this.patternTo:x===\"u_pattern_from\"?this.patternFrom:x===\"u_pixel_ratio_to\"?this.pixelRatioTo:x===\"u_pixel_ratio_from\"?this.pixelRatioFrom:null;E&&a.set(E)}getBinding(a,h,A){return A.substr(0,9)===\"u_pattern\"?new Bc(a,h):new ha(a,h)}}class nn{constructor(a,h,A,x){this.expression=a,this.type=A,this.maxValue=0,this.paintVertexAttributes=h.map(E=>({name:`a_${E}`,type:\"Float32\",components:A===\"color\"?2:1,offset:0})),this.paintVertexArray=new x}populatePaintArray(a,h,A,x,E){let P=this.paintVertexArray.length,D=this.expression.evaluate(new ki(0),h,{},x,[],E);this.paintVertexArray.resize(a),this._setPaintValue(P,a,D)}updatePaintArray(a,h,A,x){let E=this.expression.evaluate({zoom:0},A,x);this._setPaintValue(a,h,E)}_setPaintValue(a,h,A){if(this.type===\"color\"){let x=bu(A);for(let E=a;E<h;E++)this.paintVertexArray.emplace(E,x[0],x[1])}else{for(let x=a;x<h;x++)this.paintVertexArray.emplace(x,A);this.maxValue=Math.max(this.maxValue,Math.abs(A))}}upload(a){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=a.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class dn{constructor(a,h,A,x,E,P){this.expression=a,this.uniformNames=h.map(D=>`u_${D}_t`),this.type=A,this.useIntegerZoom=x,this.zoom=E,this.maxValue=0,this.paintVertexAttributes=h.map(D=>({name:`a_${D}`,type:\"Float32\",components:A===\"color\"?4:2,offset:0})),this.paintVertexArray=new P}populatePaintArray(a,h,A,x,E){let P=this.expression.evaluate(new ki(this.zoom),h,{},x,[],E),D=this.expression.evaluate(new ki(this.zoom+1),h,{},x,[],E),B=this.paintVertexArray.length;this.paintVertexArray.resize(a),this._setPaintValue(B,a,P,D)}updatePaintArray(a,h,A,x){let E=this.expression.evaluate({zoom:this.zoom},A,x),P=this.expression.evaluate({zoom:this.zoom+1},A,x);this._setPaintValue(a,h,E,P)}_setPaintValue(a,h,A,x){if(this.type===\"color\"){let E=bu(A),P=bu(x);for(let D=a;D<h;D++)this.paintVertexArray.emplace(D,E[0],E[1],P[0],P[1])}else{for(let E=a;E<h;E++)this.paintVertexArray.emplace(E,A,x);this.maxValue=Math.max(this.maxValue,Math.abs(A),Math.abs(x))}}upload(a){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=a.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(a,h){let A=this.useIntegerZoom?Math.floor(h.zoom):h.zoom,x=J(this.expression.interpolationFactor(A,this.zoom,this.zoom+1),0,1);a.set(x)}getBinding(a,h,A){return new ha(a,h)}}class Xe{constructor(a,h,A,x,E,P){this.expression=a,this.type=h,this.useIntegerZoom=A,this.zoom=x,this.layerId=P,this.zoomInPaintVertexArray=new E,this.zoomOutPaintVertexArray=new E}populatePaintArray(a,h,A){let x=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(a),this.zoomOutPaintVertexArray.resize(a),this._setPaintValues(x,a,h.patterns&&h.patterns[this.layerId],A)}updatePaintArray(a,h,A,x,E){this._setPaintValues(a,h,A.patterns&&A.patterns[this.layerId],E)}_setPaintValues(a,h,A,x){if(!x||!A)return;let{min:E,mid:P,max:D}=A,B=x[E],V=x[P],q=x[D];if(B&&V&&q)for(let Q=a;Q<h;Q++)this.zoomInPaintVertexArray.emplace(Q,V.tl[0],V.tl[1],V.br[0],V.br[1],B.tl[0],B.tl[1],B.br[0],B.br[1],V.pixelRatio,B.pixelRatio),this.zoomOutPaintVertexArray.emplace(Q,V.tl[0],V.tl[1],V.br[0],V.br[1],q.tl[0],q.tl[1],q.br[0],q.br[1],V.pixelRatio,q.pixelRatio)}upload(a){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=a.createVertexBuffer(this.zoomInPaintVertexArray,ar.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=a.createVertexBuffer(this.zoomOutPaintVertexArray,ar.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Bi{constructor(a,h,A){this.binders={},this._buffers=[];let x=[];for(let E in a.paint._values){if(!A(E))continue;let P=a.paint.get(E);if(!(P instanceof ll&&yf(P.property.specification)))continue;let D=En(E,a.type),B=P.value,V=P.property.specification.type,q=P.property.useIntegerZoom,Q=P.property.specification[\"property-type\"],rt=Q===\"cross-faded\"||Q===\"cross-faded-data-driven\";if(B.kind===\"constant\")this.binders[E]=rt?new Zn(B.value,D):new us(B.value,D,V),x.push(`/u_${E}`);else if(B.kind===\"source\"||rt){let ot=o0(E,V,\"source\");this.binders[E]=rt?new Xe(B,V,q,h,ot,a.id):new nn(B,D,V,ot),x.push(`/a_${E}`)}else{let ot=o0(E,V,\"composite\");this.binders[E]=new dn(B,D,V,q,h,ot),x.push(`/z_${E}`)}}this.cacheKey=x.sort().join(\"\")}getMaxValue(a){let h=this.binders[a];return h instanceof nn||h instanceof dn?h.maxValue:0}populatePaintArrays(a,h,A,x,E){for(let P in this.binders){let D=this.binders[P];(D instanceof nn||D instanceof dn||D instanceof Xe)&&D.populatePaintArray(a,h,A,x,E)}}setConstantPatternPositions(a,h){for(let A in this.binders){let x=this.binders[A];x instanceof Zn&&x.setConstantPatternPositions(a,h)}}updatePaintArrays(a,h,A,x,E){let P=!1;for(let D in a){let B=h.getPositions(D);for(let V of B){let q=A.feature(V.index);for(let Q in this.binders){let rt=this.binders[Q];if((rt instanceof nn||rt instanceof dn||rt instanceof Xe)&&rt.expression.isStateDependent===!0){let ot=x.paint.get(Q);rt.expression=ot.value,rt.updatePaintArray(V.start,V.end,q,a[D],E),P=!0}}}}return P}defines(){let a=[];for(let h in this.binders){let A=this.binders[h];(A instanceof us||A instanceof Zn)&&a.push(...A.uniformNames.map(x=>`#define HAS_UNIFORM_${x}`))}return a}getBinderAttributes(){let a=[];for(let h in this.binders){let A=this.binders[h];if(A instanceof nn||A instanceof dn)for(let x=0;x<A.paintVertexAttributes.length;x++)a.push(A.paintVertexAttributes[x].name);else if(A instanceof Xe)for(let x=0;x<ar.members.length;x++)a.push(ar.members[x].name)}return a}getBinderUniforms(){let a=[];for(let h in this.binders){let A=this.binders[h];if(A instanceof us||A instanceof Zn||A instanceof dn)for(let x of A.uniformNames)a.push(x)}return a}getPaintVertexBuffers(){return this._buffers}getUniforms(a,h){let A=[];for(let x in this.binders){let E=this.binders[x];if(E instanceof us||E instanceof Zn||E instanceof dn){for(let P of E.uniformNames)if(h[P]){let D=E.getBinding(a,h[P],P);A.push({name:P,property:x,binding:D})}}}return A}setUniforms(a,h,A,x){for(let{name:E,property:P,binding:D}of h)this.binders[P].setUniform(D,x,A.get(P),E)}updatePaintBuffers(a){this._buffers=[];for(let h in this.binders){let A=this.binders[h];if(a&&A instanceof Xe){let x=a.fromScale===2?A.zoomInPaintVertexBuffer:A.zoomOutPaintVertexBuffer;x&&this._buffers.push(x)}else(A instanceof nn||A instanceof dn)&&A.paintVertexBuffer&&this._buffers.push(A.paintVertexBuffer)}}upload(a){for(let h in this.binders){let A=this.binders[h];(A instanceof nn||A instanceof dn||A instanceof Xe)&&A.upload(a)}this.updatePaintBuffers()}destroy(){for(let a in this.binders){let h=this.binders[a];(h instanceof nn||h instanceof dn||h instanceof Xe)&&h.destroy()}}}class Cs{constructor(a,h,A=()=>!0){this.programConfigurations={};for(let x of a)this.programConfigurations[x.id]=new Bi(x,h,A);this.needsUpload=!1,this._featureMap=new So,this._bufferOffset=0}populatePaintArrays(a,h,A,x,E,P){for(let D in this.programConfigurations)this.programConfigurations[D].populatePaintArrays(a,h,x,E,P);h.id!==void 0&&this._featureMap.add(h.id,A,this._bufferOffset,a),this._bufferOffset=a,this.needsUpload=!0}updatePaintArrays(a,h,A,x){for(let E of A)this.needsUpload=this.programConfigurations[E.id].updatePaintArrays(a,this._featureMap,h,E,x)||this.needsUpload}get(a){return this.programConfigurations[a]}upload(a){if(this.needsUpload){for(let h in this.programConfigurations)this.programConfigurations[h].upload(a);this.needsUpload=!1}}destroy(){for(let a in this.programConfigurations)this.programConfigurations[a].destroy()}}function En(u,a){return{\"text-opacity\":[\"opacity\"],\"icon-opacity\":[\"opacity\"],\"text-color\":[\"fill_color\"],\"icon-color\":[\"fill_color\"],\"text-halo-color\":[\"halo_color\"],\"icon-halo-color\":[\"halo_color\"],\"text-halo-blur\":[\"halo_blur\"],\"icon-halo-blur\":[\"halo_blur\"],\"text-halo-width\":[\"halo_width\"],\"icon-halo-width\":[\"halo_width\"],\"line-gap-width\":[\"gapwidth\"],\"line-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"],\"fill-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"],\"fill-extrusion-pattern\":[\"pattern_to\",\"pattern_from\",\"pixel_ratio_to\",\"pixel_ratio_from\"]}[u]||[u.replace(`${a}-`,\"\").replace(/-/g,\"_\")]}function o0(u,a,h){let A={color:{source:Cf,composite:lA},number:{source:dh,composite:Cf}},x=function(E){return{\"line-pattern\":{source:Wt,composite:Wt},\"fill-pattern\":{source:Wt,composite:Wt},\"fill-extrusion-pattern\":{source:Wt,composite:Wt}}[E]}(u);return x&&x[h]||A[a][h]}Fe(\"ConstantBinder\",us),Fe(\"CrossFadedConstantBinder\",Zn),Fe(\"SourceExpressionBinder\",nn),Fe(\"CrossFadedCompositeBinder\",Xe),Fe(\"CompositeExpressionBinder\",dn),Fe(\"ProgramConfiguration\",Bi,{omit:[\"_buffers\"]}),Fe(\"ProgramConfigurationSet\",Cs);let Bn=8192,Ul=Math.pow(2,14)-1,ve=-Ul-1;function De(u){let a=Bn/u.extent,h=u.loadGeometry();for(let A=0;A<h.length;A++){let x=h[A];for(let E=0;E<x.length;E++){let P=x[E],D=Math.round(P.x*a),B=Math.round(P.y*a);P.x=J(D,ve,Ul),P.y=J(B,ve,Ul),(D<P.x||D>P.x+1||B<P.y||B>P.y+1)&&Le(\"Geometry exceeds allowed extent, reduce your vector tile buffer size\")}}return h}function wu(u,a){return{type:u.type,id:u.id,properties:u.properties,geometry:a?De(u):[]}}function Ua(u,a,h,A,x){u.emplaceBack(2*a+(A+1)/2,2*h+(x+1)/2)}class ph{constructor(a){this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(h=>h.id),this.index=a.index,this.hasPattern=!1,this.layoutVertexArray=new gt,this.indexArray=new he,this.segments=new ur,this.programConfigurations=new Cs(a.layers,a.zoom),this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(a,h,A){let x=this.layers[0],E=[],P=null,D=!1;x.type===\"circle\"&&(P=x.layout.get(\"circle-sort-key\"),D=!P.isConstant());for(let{feature:B,id:V,index:q,sourceLayerIndex:Q}of a){let rt=this.layers[0]._featureFilter.needGeometry,ot=wu(B,rt);if(!this.layers[0]._featureFilter.filter(new ki(this.zoom),ot,A))continue;let lt=D?P.evaluate(ot,{},A):void 0,pt={id:V,properties:B.properties,type:B.type,sourceLayerIndex:Q,index:q,geometry:rt?ot.geometry:De(B),patterns:{},sortKey:lt};E.push(pt)}D&&E.sort((B,V)=>B.sortKey-V.sortKey);for(let B of E){let{geometry:V,index:q,sourceLayerIndex:Q}=B,rt=a[q].feature;this.addFeature(B,V,q,A),h.featureIndex.insert(rt,V,q,Q,this.index)}}update(a,h,A){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(a,h,this.stateDependentLayers,A)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(a){this.uploaded||(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,Ue),this.indexBuffer=a.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(a),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(a,h,A,x){for(let E of h)for(let P of E){let D=P.x,B=P.y;if(D<0||D>=Bn||B<0||B>=Bn)continue;let V=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,a.sortKey),q=V.vertexLength;Ua(this.layoutVertexArray,D,B,-1,-1),Ua(this.layoutVertexArray,D,B,1,-1),Ua(this.layoutVertexArray,D,B,1,1),Ua(this.layoutVertexArray,D,B,-1,1),this.indexArray.emplaceBack(q,q+1,q+2),this.indexArray.emplaceBack(q,q+3,q+2),V.vertexLength+=4,V.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,A,{},x)}}function fa(u,a){for(let h=0;h<u.length;h++)if(L(a,u[h]))return!0;for(let h=0;h<a.length;h++)if(L(u,a[h]))return!0;return!!m(u,a)}function a0(u,a,h){return!!L(u,a)||!!S(a,u,h)}function fl(u,a){if(u.length===1)return k(a,u[0]);for(let h=0;h<a.length;h++){let A=a[h];for(let x=0;x<A.length;x++)if(L(u,A[x]))return!0}for(let h=0;h<u.length;h++)if(k(a,u[h]))return!0;for(let h=0;h<a.length;h++)if(m(u,a[h]))return!0;return!1}function p(u,a,h){if(u.length>1){if(m(u,a))return!0;for(let A=0;A<a.length;A++)if(S(a[A],u,h))return!0}for(let A=0;A<u.length;A++)if(S(u[A],a,h))return!0;return!1}function m(u,a){if(u.length===0||a.length===0)return!1;for(let h=0;h<u.length-1;h++){let A=u[h],x=u[h+1];for(let E=0;E<a.length-1;E++)if(y(A,x,a[E],a[E+1]))return!0}return!1}function y(u,a,h,A){return sr(u,h,A)!==sr(a,h,A)&&sr(u,a,h)!==sr(u,a,A)}function S(u,a,h){let A=h*h;if(a.length===1)return u.distSqr(a[0])<A;for(let x=1;x<a.length;x++)if(C(u,a[x-1],a[x])<A)return!0;return!1}function C(u,a,h){let A=a.distSqr(h);if(A===0)return u.distSqr(a);let x=((u.x-a.x)*(h.x-a.x)+(u.y-a.y)*(h.y-a.y))/A;return u.distSqr(x<0?a:x>1?h:h.sub(a)._mult(x)._add(a))}function k(u,a){let h,A,x,E=!1;for(let P=0;P<u.length;P++){h=u[P];for(let D=0,B=h.length-1;D<h.length;B=D++)A=h[D],x=h[B],A.y>a.y!=x.y>a.y&&a.x<(x.x-A.x)*(a.y-A.y)/(x.y-A.y)+A.x&&(E=!E)}return E}function L(u,a){let h=!1;for(let A=0,x=u.length-1;A<u.length;x=A++){let E=u[A],P=u[x];E.y>a.y!=P.y>a.y&&a.x<(P.x-E.x)*(a.y-E.y)/(P.y-E.y)+E.x&&(h=!h)}return h}function z(u,a,h){let A=h[0],x=h[2];if(u.x<A.x&&a.x<A.x||u.x>x.x&&a.x>x.x||u.y<A.y&&a.y<A.y||u.y>x.y&&a.y>x.y)return!1;let E=sr(u,a,h[0]);return E!==sr(u,a,h[1])||E!==sr(u,a,h[2])||E!==sr(u,a,h[3])}function H(u,a,h){let A=a.paint.get(u).value;return A.kind===\"constant\"?A.value:h.programConfigurations.get(a.id).getMaxValue(u)}function et(u){return Math.sqrt(u[0]*u[0]+u[1]*u[1])}function st(u,a,h,A,x){if(!a[0]&&!a[1])return u;let E=_.convert(a)._mult(x);h===\"viewport\"&&E._rotate(-A);let P=[];for(let D=0;D<u.length;D++)P.push(u[D].sub(E));return P}let Et,Bt;Fe(\"CircleBucket\",ph,{omit:[\"layers\"]});var Gt={get paint(){return Bt=Bt||new wo({\"circle-radius\":new fr(Jt.paint_circle[\"circle-radius\"]),\"circle-color\":new fr(Jt.paint_circle[\"circle-color\"]),\"circle-blur\":new fr(Jt.paint_circle[\"circle-blur\"]),\"circle-opacity\":new fr(Jt.paint_circle[\"circle-opacity\"]),\"circle-translate\":new Qe(Jt.paint_circle[\"circle-translate\"]),\"circle-translate-anchor\":new Qe(Jt.paint_circle[\"circle-translate-anchor\"]),\"circle-pitch-scale\":new Qe(Jt.paint_circle[\"circle-pitch-scale\"]),\"circle-pitch-alignment\":new Qe(Jt.paint_circle[\"circle-pitch-alignment\"]),\"circle-stroke-width\":new fr(Jt.paint_circle[\"circle-stroke-width\"]),\"circle-stroke-color\":new fr(Jt.paint_circle[\"circle-stroke-color\"]),\"circle-stroke-opacity\":new fr(Jt.paint_circle[\"circle-stroke-opacity\"])})},get layout(){return Et=Et||new wo({\"circle-sort-key\":new fr(Jt.layout_circle[\"circle-sort-key\"])})}},Qt=1e-6,se=typeof Float32Array<\"u\"?Float32Array:Array;function Se(u){return u[0]=1,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,u}function Ge(u,a,h){var A=a[0],x=a[1],E=a[2],P=a[3],D=a[4],B=a[5],V=a[6],q=a[7],Q=a[8],rt=a[9],ot=a[10],lt=a[11],pt=a[12],xt=a[13],Mt=a[14],Vt=a[15],It=h[0],zt=h[1],ie=h[2],ue=h[3];return u[0]=It*A+zt*D+ie*Q+ue*pt,u[1]=It*x+zt*B+ie*rt+ue*xt,u[2]=It*E+zt*V+ie*ot+ue*Mt,u[3]=It*P+zt*q+ie*lt+ue*Vt,u[4]=(It=h[4])*A+(zt=h[5])*D+(ie=h[6])*Q+(ue=h[7])*pt,u[5]=It*x+zt*B+ie*rt+ue*xt,u[6]=It*E+zt*V+ie*ot+ue*Mt,u[7]=It*P+zt*q+ie*lt+ue*Vt,u[8]=(It=h[8])*A+(zt=h[9])*D+(ie=h[10])*Q+(ue=h[11])*pt,u[9]=It*x+zt*B+ie*rt+ue*xt,u[10]=It*E+zt*V+ie*ot+ue*Mt,u[11]=It*P+zt*q+ie*lt+ue*Vt,u[12]=(It=h[12])*A+(zt=h[13])*D+(ie=h[14])*Q+(ue=h[15])*pt,u[13]=It*x+zt*B+ie*rt+ue*xt,u[14]=It*E+zt*V+ie*ot+ue*Mt,u[15]=It*P+zt*q+ie*lt+ue*Vt,u}Math.hypot||(Math.hypot=function(){for(var u=0,a=arguments.length;a--;)u+=arguments[a]*arguments[a];return Math.sqrt(u)});var Kt,ye=Ge;function Ft(u,a,h){var A=a[0],x=a[1],E=a[2],P=a[3];return u[0]=h[0]*A+h[4]*x+h[8]*E+h[12]*P,u[1]=h[1]*A+h[5]*x+h[9]*E+h[13]*P,u[2]=h[2]*A+h[6]*x+h[10]*E+h[14]*P,u[3]=h[3]*A+h[7]*x+h[11]*E+h[15]*P,u}Kt=new se(4),se!=Float32Array&&(Kt[0]=0,Kt[1]=0,Kt[2]=0,Kt[3]=0);class qe extends cl{constructor(a){super(a,Gt)}createBucket(a){return new ph(a)}queryRadius(a){let h=a;return H(\"circle-radius\",this,h)+H(\"circle-stroke-width\",this,h)+et(this.paint.get(\"circle-translate\"))}queryIntersectsFeature(a,h,A,x,E,P,D,B){let V=st(a,this.paint.get(\"circle-translate\"),this.paint.get(\"circle-translate-anchor\"),P.angle,D),q=this.paint.get(\"circle-radius\").evaluate(h,A)+this.paint.get(\"circle-stroke-width\").evaluate(h,A),Q=this.paint.get(\"circle-pitch-alignment\")===\"map\",rt=Q?V:function(lt,pt){return lt.map(xt=>Ye(xt,pt))}(V,B),ot=Q?q*D:q;for(let lt of x)for(let pt of lt){let xt=Q?pt:Ye(pt,B),Mt=ot,Vt=Ft([],[pt.x,pt.y,0,1],B);if(this.paint.get(\"circle-pitch-scale\")===\"viewport\"&&this.paint.get(\"circle-pitch-alignment\")===\"map\"?Mt*=Vt[3]/P.cameraToCenterDistance:this.paint.get(\"circle-pitch-scale\")===\"map\"&&this.paint.get(\"circle-pitch-alignment\")===\"viewport\"&&(Mt*=P.cameraToCenterDistance/Vt[3]),a0(rt,xt,Mt))return!0}return!1}}function Ye(u,a){let h=Ft([],[u.x,u.y,0,1],a);return new _(h[0]/h[3],h[1]/h[3])}class Oe extends ph{}let Ve;Fe(\"HeatmapBucket\",Oe,{omit:[\"layers\"]});var Qr={get paint(){return Ve=Ve||new wo({\"heatmap-radius\":new fr(Jt.paint_heatmap[\"heatmap-radius\"]),\"heatmap-weight\":new fr(Jt.paint_heatmap[\"heatmap-weight\"]),\"heatmap-intensity\":new Qe(Jt.paint_heatmap[\"heatmap-intensity\"]),\"heatmap-color\":new t0(Jt.paint_heatmap[\"heatmap-color\"]),\"heatmap-opacity\":new Qe(Jt.paint_heatmap[\"heatmap-opacity\"])})}};function Ri(u,{width:a,height:h},A,x){if(x){if(x instanceof Uint8ClampedArray)x=new Uint8Array(x.buffer);else if(x.length!==a*h*A)throw new RangeError(`mismatched image size. expected: ${x.length} but got: ${a*h*A}`)}else x=new Uint8Array(a*h*A);return u.width=a,u.height=h,u.data=x,u}function Ei(u,{width:a,height:h},A){if(a===u.width&&h===u.height)return;let x=Ri({},{width:a,height:h},A);Vi(u,x,{x:0,y:0},{x:0,y:0},{width:Math.min(u.width,a),height:Math.min(u.height,h)},A),u.width=a,u.height=h,u.data=x.data}function Vi(u,a,h,A,x,E){if(x.width===0||x.height===0)return a;if(x.width>u.width||x.height>u.height||h.x>u.width-x.width||h.y>u.height-x.height)throw new RangeError(\"out of range source coordinates for image copy\");if(x.width>a.width||x.height>a.height||A.x>a.width-x.width||A.y>a.height-x.height)throw new RangeError(\"out of range destination coordinates for image copy\");let P=u.data,D=a.data;if(P===D)throw new Error(\"srcData equals dstData, so image is already copied\");for(let B=0;B<x.height;B++){let V=((h.y+B)*u.width+h.x)*E,q=((A.y+B)*a.width+A.x)*E;for(let Q=0;Q<x.width*E;Q++)D[q+Q]=P[V+Q]}return a}class pi{constructor(a,h){Ri(this,a,1,h)}resize(a){Ei(this,a,1)}clone(){return new pi({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(a,h,A,x,E){Vi(a,h,A,x,E,1)}}class fi{constructor(a,h){Ri(this,a,4,h)}resize(a){Ei(this,a,4)}replace(a,h){h?this.data.set(a):this.data=a instanceof Uint8ClampedArray?new Uint8Array(a.buffer):a}clone(){return new fi({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(a,h,A,x,E){Vi(a,h,A,x,E,4)}}function ln(u){let a={},h=u.resolution||256,A=u.clips?u.clips.length:1,x=u.image||new fi({width:h,height:A});if(Math.log(h)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${h}`);let E=(P,D,B)=>{a[u.evaluationKey]=B;let V=u.expression.evaluate(a);x.data[P+D+0]=Math.floor(255*V.r/V.a),x.data[P+D+1]=Math.floor(255*V.g/V.a),x.data[P+D+2]=Math.floor(255*V.b/V.a),x.data[P+D+3]=Math.floor(255*V.a)};if(u.clips)for(let P=0,D=0;P<A;++P,D+=4*h)for(let B=0,V=0;B<h;B++,V+=4){let q=B/(h-1),{start:Q,end:rt}=u.clips[P];E(D,V,Q*(1-q)+rt*q)}else for(let P=0,D=0;P<h;P++,D+=4)E(0,D,P/(h-1));return x}Fe(\"AlphaImage\",pi),Fe(\"RGBAImage\",fi);class jr extends cl{createBucket(a){return new Oe(a)}constructor(a){super(a,Qr),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(a){a===\"heatmap-color\"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=ln({expression:this._transitionablePaint._values[\"heatmap-color\"].value.expression,evaluationKey:\"heatmapDensity\",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get(\"heatmap-opacity\")!==0&&this.visibility!==\"none\"}}let g6;var NQ={get paint(){return g6=g6||new wo({\"hillshade-illumination-direction\":new Qe(Jt.paint_hillshade[\"hillshade-illumination-direction\"]),\"hillshade-illumination-anchor\":new Qe(Jt.paint_hillshade[\"hillshade-illumination-anchor\"]),\"hillshade-exaggeration\":new Qe(Jt.paint_hillshade[\"hillshade-exaggeration\"]),\"hillshade-shadow-color\":new Qe(Jt.paint_hillshade[\"hillshade-shadow-color\"]),\"hillshade-highlight-color\":new Qe(Jt.paint_hillshade[\"hillshade-highlight-color\"]),\"hillshade-accent-color\":new Qe(Jt.paint_hillshade[\"hillshade-accent-color\"])})}};class UQ extends cl{constructor(a){super(a,NQ)}hasOffscreenPass(){return this.paint.get(\"hillshade-exaggeration\")!==0&&this.visibility!==\"none\"}}let VQ=Dn([{name:\"a_pos\",components:2,type:\"Int16\"}],4),{members:jQ}=VQ;var GI={exports:{}};function DS(u,a,h){h=h||2;var A,x,E,P,D,B,V,q=a&&a.length,Q=q?a[0]*h:u.length,rt=_6(u,0,Q,h,!0),ot=[];if(!rt||rt.next===rt.prev)return ot;if(q&&(rt=function(pt,xt,Mt,Vt){var It,zt,ie,ue=[];for(It=0,zt=xt.length;It<zt;It++)(ie=_6(pt,xt[It]*Vt,It<zt-1?xt[It+1]*Vt:pt.length,Vt,!1))===ie.next&&(ie.steiner=!0),ue.push(QQ(ie));for(ue.sort(ZQ),It=0;It<ue.length;It++)Mt=YQ(ue[It],Mt);return Mt}(u,a,rt,h)),u.length>80*h){A=E=u[0],x=P=u[1];for(var lt=h;lt<Q;lt+=h)(D=u[lt])<A&&(A=D),(B=u[lt+1])<x&&(x=B),D>E&&(E=D),B>P&&(P=B);V=(V=Math.max(E-A,P-x))!==0?32767/V:0}return Ex(rt,ot,h,A,x,V,0),ot}function _6(u,a,h,A,x){var E,P;if(x===qI(u,a,h,A)>0)for(E=a;E<h;E+=A)P=x6(E,u[E],u[E+1],P);else for(E=h-A;E>=a;E-=A)P=x6(E,u[E],u[E+1],P);return P&&OS(P,P.next)&&(Ix(P),P=P.next),P}function l0(u,a){if(!u)return u;a||(a=u);var h,A=u;do if(h=!1,A.steiner||!OS(A,A.next)&&hs(A.prev,A,A.next)!==0)A=A.next;else{if(Ix(A),(A=a=A.prev)===A.next)break;h=!0}while(h||A!==a);return a}function Ex(u,a,h,A,x,E,P){if(u){!P&&E&&function(q,Q,rt,ot){var lt=q;do lt.z===0&&(lt.z=WI(lt.x,lt.y,Q,rt,ot)),lt.prevZ=lt.prev,lt.nextZ=lt.next,lt=lt.next;while(lt!==q);lt.prevZ.nextZ=null,lt.prevZ=null,function(pt){var xt,Mt,Vt,It,zt,ie,ue,Be,Ke=1;do{for(Mt=pt,pt=null,zt=null,ie=0;Mt;){for(ie++,Vt=Mt,ue=0,xt=0;xt<Ke&&(ue++,Vt=Vt.nextZ);xt++);for(Be=Ke;ue>0||Be>0&&Vt;)ue!==0&&(Be===0||!Vt||Mt.z<=Vt.z)?(It=Mt,Mt=Mt.nextZ,ue--):(It=Vt,Vt=Vt.nextZ,Be--),zt?zt.nextZ=It:pt=It,It.prevZ=zt,zt=It;Mt=Vt}zt.nextZ=null,Ke*=2}while(ie>1)}(lt)}(u,A,x,E);for(var D,B,V=u;u.prev!==u.next;)if(D=u.prev,B=u.next,E?WQ(u,A,x,E):GQ(u))a.push(D.i/h|0),a.push(u.i/h|0),a.push(B.i/h|0),Ix(u),u=B.next,V=B.next;else if((u=B)===V){P?P===1?Ex(u=HQ(l0(u),a,h),a,h,A,x,E,2):P===2&&qQ(u,a,h,A,x,E):Ex(l0(u),a,h,A,x,E,1);break}}}function GQ(u){var a=u.prev,h=u,A=u.next;if(hs(a,h,A)>=0)return!1;for(var x=a.x,E=h.x,P=A.x,D=a.y,B=h.y,V=A.y,q=x<E?x<P?x:P:E<P?E:P,Q=D<B?D<V?D:V:B<V?B:V,rt=x>E?x>P?x:P:E>P?E:P,ot=D>B?D>V?D:V:B>V?B:V,lt=A.next;lt!==a;){if(lt.x>=q&&lt.x<=rt&&lt.y>=Q&&lt.y<=ot&&u_(x,D,E,B,P,V,lt.x,lt.y)&&hs(lt.prev,lt,lt.next)>=0)return!1;lt=lt.next}return!0}function WQ(u,a,h,A){var x=u.prev,E=u,P=u.next;if(hs(x,E,P)>=0)return!1;for(var D=x.x,B=E.x,V=P.x,q=x.y,Q=E.y,rt=P.y,ot=D<B?D<V?D:V:B<V?B:V,lt=q<Q?q<rt?q:rt:Q<rt?Q:rt,pt=D>B?D>V?D:V:B>V?B:V,xt=q>Q?q>rt?q:rt:Q>rt?Q:rt,Mt=WI(ot,lt,a,h,A),Vt=WI(pt,xt,a,h,A),It=u.prevZ,zt=u.nextZ;It&&It.z>=Mt&&zt&&zt.z<=Vt;){if(It.x>=ot&&It.x<=pt&&It.y>=lt&&It.y<=xt&&It!==x&&It!==P&&u_(D,q,B,Q,V,rt,It.x,It.y)&&hs(It.prev,It,It.next)>=0||(It=It.prevZ,zt.x>=ot&&zt.x<=pt&&zt.y>=lt&&zt.y<=xt&&zt!==x&&zt!==P&&u_(D,q,B,Q,V,rt,zt.x,zt.y)&&hs(zt.prev,zt,zt.next)>=0))return!1;zt=zt.nextZ}for(;It&&It.z>=Mt;){if(It.x>=ot&&It.x<=pt&&It.y>=lt&&It.y<=xt&&It!==x&&It!==P&&u_(D,q,B,Q,V,rt,It.x,It.y)&&hs(It.prev,It,It.next)>=0)return!1;It=It.prevZ}for(;zt&&zt.z<=Vt;){if(zt.x>=ot&&zt.x<=pt&&zt.y>=lt&&zt.y<=xt&&zt!==x&&zt!==P&&u_(D,q,B,Q,V,rt,zt.x,zt.y)&&hs(zt.prev,zt,zt.next)>=0)return!1;zt=zt.nextZ}return!0}function HQ(u,a,h){var A=u;do{var x=A.prev,E=A.next.next;!OS(x,E)&&y6(x,A,A.next,E)&&Px(x,E)&&Px(E,x)&&(a.push(x.i/h|0),a.push(A.i/h|0),a.push(E.i/h|0),Ix(A),Ix(A.next),A=u=E),A=A.next}while(A!==u);return l0(A)}function qQ(u,a,h,A,x,E){var P=u;do{for(var D=P.next.next;D!==P.prev;){if(P.i!==D.i&&XQ(P,D)){var B=v6(P,D);return P=l0(P,P.next),B=l0(B,B.next),Ex(P,a,h,A,x,E,0),void Ex(B,a,h,A,x,E,0)}D=D.next}P=P.next}while(P!==u)}function ZQ(u,a){return u.x-a.x}function YQ(u,a){var h=function(x,E){var P,D=E,B=x.x,V=x.y,q=-1/0;do{if(V<=D.y&&V>=D.next.y&&D.next.y!==D.y){var Q=D.x+(V-D.y)*(D.next.x-D.x)/(D.next.y-D.y);if(Q<=B&&Q>q&&(q=Q,P=D.x<D.next.x?D:D.next,Q===B))return P}D=D.next}while(D!==E);if(!P)return null;var rt,ot=P,lt=P.x,pt=P.y,xt=1/0;D=P;do B>=D.x&&D.x>=lt&&B!==D.x&&u_(V<pt?B:q,V,lt,pt,V<pt?q:B,V,D.x,D.y)&&(rt=Math.abs(V-D.y)/(B-D.x),Px(D,x)&&(rt<xt||rt===xt&&(D.x>P.x||D.x===P.x&&$Q(P,D)))&&(P=D,xt=rt)),D=D.next;while(D!==ot);return P}(u,a);if(!h)return a;var A=v6(h,u);return l0(A,A.next),l0(h,h.next)}function $Q(u,a){return hs(u.prev,u,a.prev)<0&&hs(a.next,u,u.next)<0}function WI(u,a,h,A,x){return(u=1431655765&((u=858993459&((u=252645135&((u=16711935&((u=(u-h)*x|0)|u<<8))|u<<4))|u<<2))|u<<1))|(a=1431655765&((a=858993459&((a=252645135&((a=16711935&((a=(a-A)*x|0)|a<<8))|a<<4))|a<<2))|a<<1))<<1}function QQ(u){var a=u,h=u;do(a.x<h.x||a.x===h.x&&a.y<h.y)&&(h=a),a=a.next;while(a!==u);return h}function u_(u,a,h,A,x,E,P,D){return(x-P)*(a-D)>=(u-P)*(E-D)&&(u-P)*(A-D)>=(h-P)*(a-D)&&(h-P)*(E-D)>=(x-P)*(A-D)}function XQ(u,a){return u.next.i!==a.i&&u.prev.i!==a.i&&!function(h,A){var x=h;do{if(x.i!==h.i&&x.next.i!==h.i&&x.i!==A.i&&x.next.i!==A.i&&y6(x,x.next,h,A))return!0;x=x.next}while(x!==h);return!1}(u,a)&&(Px(u,a)&&Px(a,u)&&function(h,A){var x=h,E=!1,P=(h.x+A.x)/2,D=(h.y+A.y)/2;do x.y>D!=x.next.y>D&&x.next.y!==x.y&&P<(x.next.x-x.x)*(D-x.y)/(x.next.y-x.y)+x.x&&(E=!E),x=x.next;while(x!==h);return E}(u,a)&&(hs(u.prev,u,a.prev)||hs(u,a.prev,a))||OS(u,a)&&hs(u.prev,u,u.next)>0&&hs(a.prev,a,a.next)>0)}function hs(u,a,h){return(a.y-u.y)*(h.x-a.x)-(a.x-u.x)*(h.y-a.y)}function OS(u,a){return u.x===a.x&&u.y===a.y}function y6(u,a,h,A){var x=FS(hs(u,a,h)),E=FS(hs(u,a,A)),P=FS(hs(h,A,u)),D=FS(hs(h,A,a));return x!==E&&P!==D||!(x!==0||!BS(u,h,a))||!(E!==0||!BS(u,A,a))||!(P!==0||!BS(h,u,A))||!(D!==0||!BS(h,a,A))}function BS(u,a,h){return a.x<=Math.max(u.x,h.x)&&a.x>=Math.min(u.x,h.x)&&a.y<=Math.max(u.y,h.y)&&a.y>=Math.min(u.y,h.y)}function FS(u){return u>0?1:u<0?-1:0}function Px(u,a){return hs(u.prev,u,u.next)<0?hs(u,a,u.next)>=0&&hs(u,u.prev,a)>=0:hs(u,a,u.prev)<0||hs(u,u.next,a)<0}function v6(u,a){var h=new HI(u.i,u.x,u.y),A=new HI(a.i,a.x,a.y),x=u.next,E=a.prev;return u.next=a,a.prev=u,h.next=x,x.prev=h,A.next=h,h.prev=A,E.next=A,A.prev=E,A}function x6(u,a,h,A){var x=new HI(u,a,h);return A?(x.next=A.next,x.prev=A,A.next.prev=x,A.next=x):(x.prev=x,x.next=x),x}function Ix(u){u.next.prev=u.prev,u.prev.next=u.next,u.prevZ&&(u.prevZ.nextZ=u.nextZ),u.nextZ&&(u.nextZ.prevZ=u.prevZ)}function HI(u,a,h){this.i=u,this.x=a,this.y=h,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function qI(u,a,h,A){for(var x=0,E=a,P=h-A;E<h;E+=A)x+=(u[P]-u[E])*(u[E+1]+u[P+1]),P=E;return x}GI.exports=DS,GI.exports.default=DS,DS.deviation=function(u,a,h,A){var x=a&&a.length,E=Math.abs(qI(u,0,x?a[0]*h:u.length,h));if(x)for(var P=0,D=a.length;P<D;P++)E-=Math.abs(qI(u,a[P]*h,P<D-1?a[P+1]*h:u.length,h));var B=0;for(P=0;P<A.length;P+=3){var V=A[P]*h,q=A[P+1]*h,Q=A[P+2]*h;B+=Math.abs((u[V]-u[Q])*(u[q+1]-u[V+1])-(u[V]-u[q])*(u[Q+1]-u[V+1]))}return E===0&&B===0?0:Math.abs((B-E)/E)},DS.flatten=function(u){for(var a=u[0][0].length,h={vertices:[],holes:[],dimensions:a},A=0,x=0;x<u.length;x++){for(var E=0;E<u[x].length;E++)for(var P=0;P<a;P++)h.vertices.push(u[x][E][P]);x>0&&h.holes.push(A+=u[x-1].length)}return h};var b6=o(GI.exports);function KQ(u,a,h,A,x){w6(u,a,h||0,A||u.length-1,x||JQ)}function w6(u,a,h,A,x){for(;A>h;){if(A-h>600){var E=A-h+1,P=a-h+1,D=Math.log(E),B=.5*Math.exp(2*D/3),V=.5*Math.sqrt(D*B*(E-B)/E)*(P-E/2<0?-1:1);w6(u,a,Math.max(h,Math.floor(a-P*B/E+V)),Math.min(A,Math.floor(a+(E-P)*B/E+V)),x)}var q=u[a],Q=h,rt=A;for(Cx(u,h,a),x(u[A],q)>0&&Cx(u,h,A);Q<rt;){for(Cx(u,Q,rt),Q++,rt--;x(u[Q],q)<0;)Q++;for(;x(u[rt],q)>0;)rt--}x(u[h],q)===0?Cx(u,h,rt):Cx(u,++rt,A),rt<=a&&(h=rt+1),a<=rt&&(A=rt-1)}}function Cx(u,a,h){var A=u[a];u[a]=u[h],u[h]=A}function JQ(u,a){return u<a?-1:u>a?1:0}function ZI(u,a){let h=u.length;if(h<=1)return[u];let A=[],x,E;for(let P=0;P<h;P++){let D=lr(u[P]);D!==0&&(u[P].area=Math.abs(D),E===void 0&&(E=D<0),E===D<0?(x&&A.push(x),x=[u[P]]):x.push(u[P]))}if(x&&A.push(x),a>1)for(let P=0;P<A.length;P++)A[P].length<=a||(KQ(A[P],a,1,A[P].length-1,tX),A[P]=A[P].slice(0,a));return A}function tX(u,a){return a.area-u.area}function YI(u,a,h){let A=h.patternDependencies,x=!1;for(let E of a){let P=E.paint.get(`${u}-pattern`);P.isConstant()||(x=!0);let D=P.constantOr(null);D&&(x=!0,A[D.to]=!0,A[D.from]=!0)}return x}function $I(u,a,h,A,x){let E=x.patternDependencies;for(let P of a){let D=P.paint.get(`${u}-pattern`).value;if(D.kind!==\"constant\"){let B=D.evaluate({zoom:A-1},h,{},x.availableImages),V=D.evaluate({zoom:A},h,{},x.availableImages),q=D.evaluate({zoom:A+1},h,{},x.availableImages);B=B&&B.name?B.name:B,V=V&&V.name?V.name:V,q=q&&q.name?q.name:q,E[B]=!0,E[V]=!0,E[q]=!0,h.patterns[P.id]={min:B,mid:V,max:q}}}return h}class QI{constructor(a){this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(h=>h.id),this.index=a.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new _t,this.indexArray=new he,this.indexArray2=new ce,this.programConfigurations=new Cs(a.layers,a.zoom),this.segments=new ur,this.segments2=new ur,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(a,h,A){this.hasPattern=YI(\"fill\",this.layers,h);let x=this.layers[0].layout.get(\"fill-sort-key\"),E=!x.isConstant(),P=[];for(let{feature:D,id:B,index:V,sourceLayerIndex:q}of a){let Q=this.layers[0]._featureFilter.needGeometry,rt=wu(D,Q);if(!this.layers[0]._featureFilter.filter(new ki(this.zoom),rt,A))continue;let ot=E?x.evaluate(rt,{},A,h.availableImages):void 0,lt={id:B,properties:D.properties,type:D.type,sourceLayerIndex:q,index:V,geometry:Q?rt.geometry:De(D),patterns:{},sortKey:ot};P.push(lt)}E&&P.sort((D,B)=>D.sortKey-B.sortKey);for(let D of P){let{geometry:B,index:V,sourceLayerIndex:q}=D;if(this.hasPattern){let Q=$I(\"fill\",this.layers,D,this.zoom,h);this.patternFeatures.push(Q)}else this.addFeature(D,B,V,A,{});h.featureIndex.insert(a[V].feature,B,V,q,this.index)}}update(a,h,A){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(a,h,this.stateDependentLayers,A)}addFeatures(a,h,A){for(let x of this.patternFeatures)this.addFeature(x,x.geometry,x.index,h,A)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(a){this.uploaded||(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,jQ),this.indexBuffer=a.createIndexBuffer(this.indexArray),this.indexBuffer2=a.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(a),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(a,h,A,x,E){for(let P of ZI(h,500)){let D=0;for(let ot of P)D+=ot.length;let B=this.segments.prepareSegment(D,this.layoutVertexArray,this.indexArray),V=B.vertexLength,q=[],Q=[];for(let ot of P){if(ot.length===0)continue;ot!==P[0]&&Q.push(q.length/2);let lt=this.segments2.prepareSegment(ot.length,this.layoutVertexArray,this.indexArray2),pt=lt.vertexLength;this.layoutVertexArray.emplaceBack(ot[0].x,ot[0].y),this.indexArray2.emplaceBack(pt+ot.length-1,pt),q.push(ot[0].x),q.push(ot[0].y);for(let xt=1;xt<ot.length;xt++)this.layoutVertexArray.emplaceBack(ot[xt].x,ot[xt].y),this.indexArray2.emplaceBack(pt+xt-1,pt+xt),q.push(ot[xt].x),q.push(ot[xt].y);lt.vertexLength+=ot.length,lt.primitiveLength+=ot.length}let rt=b6(q,Q);for(let ot=0;ot<rt.length;ot+=3)this.indexArray.emplaceBack(V+rt[ot],V+rt[ot+1],V+rt[ot+2]);B.vertexLength+=D,B.primitiveLength+=rt.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,A,E,x)}}let S6,T6;Fe(\"FillBucket\",QI,{omit:[\"layers\",\"patternFeatures\"]});var eX={get paint(){return T6=T6||new wo({\"fill-antialias\":new Qe(Jt.paint_fill[\"fill-antialias\"]),\"fill-opacity\":new fr(Jt.paint_fill[\"fill-opacity\"]),\"fill-color\":new fr(Jt.paint_fill[\"fill-color\"]),\"fill-outline-color\":new fr(Jt.paint_fill[\"fill-outline-color\"]),\"fill-translate\":new Qe(Jt.paint_fill[\"fill-translate\"]),\"fill-translate-anchor\":new Qe(Jt.paint_fill[\"fill-translate-anchor\"]),\"fill-pattern\":new If(Jt.paint_fill[\"fill-pattern\"])})},get layout(){return S6=S6||new wo({\"fill-sort-key\":new fr(Jt.layout_fill[\"fill-sort-key\"])})}};class rX extends cl{constructor(a){super(a,eX)}recalculate(a,h){super.recalculate(a,h);let A=this.paint._values[\"fill-outline-color\"];A.value.kind===\"constant\"&&A.value.value===void 0&&(this.paint._values[\"fill-outline-color\"]=this.paint._values[\"fill-color\"])}createBucket(a){return new QI(a)}queryRadius(){return et(this.paint.get(\"fill-translate\"))}queryIntersectsFeature(a,h,A,x,E,P,D){return fl(st(a,this.paint.get(\"fill-translate\"),this.paint.get(\"fill-translate-anchor\"),P.angle,D),x)}isTileClipped(){return!0}}let iX=Dn([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_normal_ed\",components:4,type:\"Int16\"}],4),nX=Dn([{name:\"a_centroid\",components:2,type:\"Int16\"}],4),{members:sX}=iX;var cA={},oX=c,M6=h_;function h_(u,a,h,A,x){this.properties={},this.extent=h,this.type=0,this._pbf=u,this._geometry=-1,this._keys=A,this._values=x,u.readFields(aX,this,a)}function aX(u,a,h){u==1?a.id=h.readVarint():u==2?function(A,x){for(var E=A.readVarint()+A.pos;A.pos<E;){var P=x._keys[A.readVarint()],D=x._values[A.readVarint()];x.properties[P]=D}}(h,a):u==3?a.type=h.readVarint():u==4&&(a._geometry=h.pos)}function lX(u){for(var a,h,A=0,x=0,E=u.length,P=E-1;x<E;P=x++)A+=((h=u[P]).x-(a=u[x]).x)*(a.y+h.y);return A}h_.types=[\"Unknown\",\"Point\",\"LineString\",\"Polygon\"],h_.prototype.loadGeometry=function(){var u=this._pbf;u.pos=this._geometry;for(var a,h=u.readVarint()+u.pos,A=1,x=0,E=0,P=0,D=[];u.pos<h;){if(x<=0){var B=u.readVarint();A=7&B,x=B>>3}if(x--,A===1||A===2)E+=u.readSVarint(),P+=u.readSVarint(),A===1&&(a&&D.push(a),a=[]),a.push(new oX(E,P));else{if(A!==7)throw new Error(\"unknown command \"+A);a&&a.push(a[0].clone())}}return a&&D.push(a),D},h_.prototype.bbox=function(){var u=this._pbf;u.pos=this._geometry;for(var a=u.readVarint()+u.pos,h=1,A=0,x=0,E=0,P=1/0,D=-1/0,B=1/0,V=-1/0;u.pos<a;){if(A<=0){var q=u.readVarint();h=7&q,A=q>>3}if(A--,h===1||h===2)(x+=u.readSVarint())<P&&(P=x),x>D&&(D=x),(E+=u.readSVarint())<B&&(B=E),E>V&&(V=E);else if(h!==7)throw new Error(\"unknown command \"+h)}return[P,B,D,V]},h_.prototype.toGeoJSON=function(u,a,h){var A,x,E=this.extent*Math.pow(2,h),P=this.extent*u,D=this.extent*a,B=this.loadGeometry(),V=h_.types[this.type];function q(ot){for(var lt=0;lt<ot.length;lt++){var pt=ot[lt];ot[lt]=[360*(pt.x+P)/E-180,360/Math.PI*Math.atan(Math.exp((180-360*(pt.y+D)/E)*Math.PI/180))-90]}}switch(this.type){case 1:var Q=[];for(A=0;A<B.length;A++)Q[A]=B[A][0];q(B=Q);break;case 2:for(A=0;A<B.length;A++)q(B[A]);break;case 3:for(B=function(ot){var lt=ot.length;if(lt<=1)return[ot];for(var pt,xt,Mt=[],Vt=0;Vt<lt;Vt++){var It=lX(ot[Vt]);It!==0&&(xt===void 0&&(xt=It<0),xt===It<0?(pt&&Mt.push(pt),pt=[ot[Vt]]):pt.push(ot[Vt]))}return pt&&Mt.push(pt),Mt}(B),A=0;A<B.length;A++)for(x=0;x<B[A].length;x++)q(B[A][x])}B.length===1?B=B[0]:V=\"Multi\"+V;var rt={type:\"Feature\",geometry:{type:V,coordinates:B},properties:this.properties};return\"id\"in this&&(rt.id=this.id),rt};var cX=M6,E6=P6;function P6(u,a){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=u,this._keys=[],this._values=[],this._features=[],u.readFields(uX,this,a),this.length=this._features.length}function uX(u,a,h){u===15?a.version=h.readVarint():u===1?a.name=h.readString():u===5?a.extent=h.readVarint():u===2?a._features.push(h.pos):u===3?a._keys.push(h.readString()):u===4&&a._values.push(function(A){for(var x=null,E=A.readVarint()+A.pos;A.pos<E;){var P=A.readVarint()>>3;x=P===1?A.readString():P===2?A.readFloat():P===3?A.readDouble():P===4?A.readVarint64():P===5?A.readVarint():P===6?A.readSVarint():P===7?A.readBoolean():null}return x}(h))}P6.prototype.feature=function(u){if(u<0||u>=this._features.length)throw new Error(\"feature index out of bounds\");this._pbf.pos=this._features[u];var a=this._pbf.readVarint()+this._pbf.pos;return new cX(this._pbf,a,this.extent,this._keys,this._values)};var hX=E6;function fX(u,a,h){if(u===3){var A=new hX(h,h.readVarint()+h.pos);A.length&&(a[A.name]=A)}}cA.VectorTile=function(u,a){this.layers=u.readFields(fX,{},a)},cA.VectorTileFeature=M6,cA.VectorTileLayer=E6;let dX=cA.VectorTileFeature.types,XI=Math.pow(2,13);function Lx(u,a,h,A,x,E,P,D){u.emplaceBack(a,h,2*Math.floor(A*XI)+P,x*XI*2,E*XI*2,Math.round(D))}class KI{constructor(a){this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(h=>h.id),this.index=a.index,this.hasPattern=!1,this.layoutVertexArray=new yt,this.centroidVertexArray=new at,this.indexArray=new he,this.programConfigurations=new Cs(a.layers,a.zoom),this.segments=new ur,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(a,h,A){this.features=[],this.hasPattern=YI(\"fill-extrusion\",this.layers,h);for(let{feature:x,id:E,index:P,sourceLayerIndex:D}of a){let B=this.layers[0]._featureFilter.needGeometry,V=wu(x,B);if(!this.layers[0]._featureFilter.filter(new ki(this.zoom),V,A))continue;let q={id:E,sourceLayerIndex:D,index:P,geometry:B?V.geometry:De(x),properties:x.properties,type:x.type,patterns:{}};this.hasPattern?this.features.push($I(\"fill-extrusion\",this.layers,q,this.zoom,h)):this.addFeature(q,q.geometry,P,A,{}),h.featureIndex.insert(x,q.geometry,P,D,this.index,!0)}}addFeatures(a,h,A){for(let x of this.features){let{geometry:E}=x;this.addFeature(x,E,x.index,h,A)}}update(a,h,A){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(a,h,this.stateDependentLayers,A)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(a){this.uploaded||(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,sX),this.centroidVertexBuffer=a.createVertexBuffer(this.centroidVertexArray,nX.members,!0),this.indexBuffer=a.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(a),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(a,h,A,x,E){let P={x:0,y:0,vertexCount:0};for(let D of ZI(h,500)){let B=0;for(let lt of D)B+=lt.length;let V=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let lt of D){if(lt.length===0||AX(lt))continue;let pt=0;for(let xt=0;xt<lt.length;xt++){let Mt=lt[xt];if(xt>=1){let Vt=lt[xt-1];if(!pX(Mt,Vt)){V.vertexLength+4>ur.MAX_VERTEX_ARRAY_LENGTH&&(V=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let It=Mt.sub(Vt)._perp()._unit(),zt=Vt.dist(Mt);pt+zt>32768&&(pt=0),Lx(this.layoutVertexArray,Mt.x,Mt.y,It.x,It.y,0,0,pt),Lx(this.layoutVertexArray,Mt.x,Mt.y,It.x,It.y,0,1,pt),P.x+=2*Mt.x,P.y+=2*Mt.y,P.vertexCount+=2,pt+=zt,Lx(this.layoutVertexArray,Vt.x,Vt.y,It.x,It.y,0,0,pt),Lx(this.layoutVertexArray,Vt.x,Vt.y,It.x,It.y,0,1,pt),P.x+=2*Vt.x,P.y+=2*Vt.y,P.vertexCount+=2;let ie=V.vertexLength;this.indexArray.emplaceBack(ie,ie+2,ie+1),this.indexArray.emplaceBack(ie+1,ie+2,ie+3),V.vertexLength+=4,V.primitiveLength+=2}}}}if(V.vertexLength+B>ur.MAX_VERTEX_ARRAY_LENGTH&&(V=this.segments.prepareSegment(B,this.layoutVertexArray,this.indexArray)),dX[a.type]!==\"Polygon\")continue;let q=[],Q=[],rt=V.vertexLength;for(let lt of D)if(lt.length!==0){lt!==D[0]&&Q.push(q.length/2);for(let pt=0;pt<lt.length;pt++){let xt=lt[pt];Lx(this.layoutVertexArray,xt.x,xt.y,0,0,1,1,0),P.x+=xt.x,P.y+=xt.y,P.vertexCount+=1,q.push(xt.x),q.push(xt.y)}}let ot=b6(q,Q);for(let lt=0;lt<ot.length;lt+=3)this.indexArray.emplaceBack(rt+ot[lt],rt+ot[lt+2],rt+ot[lt+1]);V.primitiveLength+=ot.length/3,V.vertexLength+=B}for(let D=0;D<P.vertexCount;D++)this.centroidVertexArray.emplaceBack(Math.floor(P.x/P.vertexCount),Math.floor(P.y/P.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,A,E,x)}}function pX(u,a){return u.x===a.x&&(u.x<0||u.x>Bn)||u.y===a.y&&(u.y<0||u.y>Bn)}function AX(u){return u.every(a=>a.x<0)||u.every(a=>a.x>Bn)||u.every(a=>a.y<0)||u.every(a=>a.y>Bn)}let I6;Fe(\"FillExtrusionBucket\",KI,{omit:[\"layers\",\"features\"]});var mX={get paint(){return I6=I6||new wo({\"fill-extrusion-opacity\":new Qe(Jt[\"paint_fill-extrusion\"][\"fill-extrusion-opacity\"]),\"fill-extrusion-color\":new fr(Jt[\"paint_fill-extrusion\"][\"fill-extrusion-color\"]),\"fill-extrusion-translate\":new Qe(Jt[\"paint_fill-extrusion\"][\"fill-extrusion-translate\"]),\"fill-extrusion-translate-anchor\":new Qe(Jt[\"paint_fill-extrusion\"][\"fill-extrusion-translate-anchor\"]),\"fill-extrusion-pattern\":new If(Jt[\"paint_fill-extrusion\"][\"fill-extrusion-pattern\"]),\"fill-extrusion-height\":new fr(Jt[\"paint_fill-extrusion\"][\"fill-extrusion-height\"]),\"fill-extrusion-base\":new fr(Jt[\"paint_fill-extrusion\"][\"fill-extrusion-base\"]),\"fill-extrusion-vertical-gradient\":new Qe(Jt[\"paint_fill-extrusion\"][\"fill-extrusion-vertical-gradient\"])})}};class gX extends cl{constructor(a){super(a,mX)}createBucket(a){return new KI(a)}queryRadius(){return et(this.paint.get(\"fill-extrusion-translate\"))}is3D(){return!0}queryIntersectsFeature(a,h,A,x,E,P,D,B){let V=st(a,this.paint.get(\"fill-extrusion-translate\"),this.paint.get(\"fill-extrusion-translate-anchor\"),P.angle,D),q=this.paint.get(\"fill-extrusion-height\").evaluate(h,A),Q=this.paint.get(\"fill-extrusion-base\").evaluate(h,A),rt=function(lt,pt,xt,Mt){let Vt=[];for(let It of lt){let zt=[It.x,It.y,0,1];Ft(zt,zt,pt),Vt.push(new _(zt[0]/zt[3],zt[1]/zt[3]))}return Vt}(V,B),ot=function(lt,pt,xt,Mt){let Vt=[],It=[],zt=Mt[8]*pt,ie=Mt[9]*pt,ue=Mt[10]*pt,Be=Mt[11]*pt,Ke=Mt[8]*xt,Re=Mt[9]*xt,Ie=Mt[10]*xt,we=Mt[11]*xt;for(let We of lt){let Ee=[],pe=[];for(let cr of We){let tr=cr.x,ei=cr.y,pn=Mt[0]*tr+Mt[4]*ei+Mt[12],Pn=Mt[1]*tr+Mt[5]*ei+Mt[13],Ws=Mt[2]*tr+Mt[6]*ei+Mt[14],Vl=Mt[3]*tr+Mt[7]*ei+Mt[15],Va=Ws+ue,Ls=Vl+Be,To=pn+Ke,Qo=Pn+Re,ja=Ws+Ie,Ga=Vl+we,Hs=new _((pn+zt)/Ls,(Pn+ie)/Ls);Hs.z=Va/Ls,Ee.push(Hs);let qs=new _(To/Ga,Qo/Ga);qs.z=ja/Ga,pe.push(qs)}Vt.push(Ee),It.push(pe)}return[Vt,It]}(x,Q,q,B);return function(lt,pt,xt){let Mt=1/0;fl(xt,pt)&&(Mt=C6(xt,pt[0]));for(let Vt=0;Vt<pt.length;Vt++){let It=pt[Vt],zt=lt[Vt];for(let ie=0;ie<It.length-1;ie++){let ue=It[ie],Be=[ue,It[ie+1],zt[ie+1],zt[ie],ue];fa(xt,Be)&&(Mt=Math.min(Mt,C6(xt,Be)))}}return Mt!==1/0&&Mt}(ot[0],ot[1],rt)}}function kx(u,a){return u.x*a.x+u.y*a.y}function C6(u,a){if(u.length===1){let h=0,A=a[h++],x;for(;!x||A.equals(x);)if(x=a[h++],!x)return 1/0;for(;h<a.length;h++){let E=a[h],P=u[0],D=x.sub(A),B=E.sub(A),V=P.sub(A),q=kx(D,D),Q=kx(D,B),rt=kx(B,B),ot=kx(V,D),lt=kx(V,B),pt=q*rt-Q*Q,xt=(rt*ot-Q*lt)/pt,Mt=(q*lt-Q*ot)/pt,Vt=A.z*(1-xt-Mt)+x.z*xt+E.z*Mt;if(isFinite(Vt))return Vt}return 1/0}{let h=1/0;for(let A of a)h=Math.min(h,A.z);return h}}let _X=Dn([{name:\"a_pos_normal\",components:2,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint8\"}],4),{members:yX}=_X,vX=Dn([{name:\"a_uv_x\",components:1,type:\"Float32\"},{name:\"a_split_index\",components:1,type:\"Float32\"}]),{members:xX}=vX,bX=cA.VectorTileFeature.types,wX=Math.cos(Math.PI/180*37.5),L6=Math.pow(2,14)/.5;class JI{constructor(a){this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(h=>h.id),this.index=a.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(h=>{this.gradients[h.id]={}}),this.layoutVertexArray=new At,this.layoutVertexArray2=new kt,this.indexArray=new he,this.programConfigurations=new Cs(a.layers,a.zoom),this.segments=new ur,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(a,h,A){this.hasPattern=YI(\"line\",this.layers,h);let x=this.layers[0].layout.get(\"line-sort-key\"),E=!x.isConstant(),P=[];for(let{feature:D,id:B,index:V,sourceLayerIndex:q}of a){let Q=this.layers[0]._featureFilter.needGeometry,rt=wu(D,Q);if(!this.layers[0]._featureFilter.filter(new ki(this.zoom),rt,A))continue;let ot=E?x.evaluate(rt,{},A):void 0,lt={id:B,properties:D.properties,type:D.type,sourceLayerIndex:q,index:V,geometry:Q?rt.geometry:De(D),patterns:{},sortKey:ot};P.push(lt)}E&&P.sort((D,B)=>D.sortKey-B.sortKey);for(let D of P){let{geometry:B,index:V,sourceLayerIndex:q}=D;if(this.hasPattern){let Q=$I(\"line\",this.layers,D,this.zoom,h);this.patternFeatures.push(Q)}else this.addFeature(D,B,V,A,{});h.featureIndex.insert(a[V].feature,B,V,q,this.index)}}update(a,h,A){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(a,h,this.stateDependentLayers,A)}addFeatures(a,h,A){for(let x of this.patternFeatures)this.addFeature(x,x.geometry,x.index,h,A)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(a){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=a.createVertexBuffer(this.layoutVertexArray2,xX)),this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,yX),this.indexBuffer=a.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(a),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(a){if(a.properties&&Object.prototype.hasOwnProperty.call(a.properties,\"mapbox_clip_start\")&&Object.prototype.hasOwnProperty.call(a.properties,\"mapbox_clip_end\"))return{start:+a.properties.mapbox_clip_start,end:+a.properties.mapbox_clip_end}}addFeature(a,h,A,x,E){let P=this.layers[0].layout,D=P.get(\"line-join\").evaluate(a,{}),B=P.get(\"line-cap\"),V=P.get(\"line-miter-limit\"),q=P.get(\"line-round-limit\");this.lineClips=this.lineFeatureClips(a);for(let Q of h)this.addLine(Q,a,D,B,V,q);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,a,A,E,x)}addLine(a,h,A,x,E,P){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Mt=0;Mt<a.length-1;Mt++)this.totalDistance+=a[Mt].dist(a[Mt+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let D=bX[h.type]===\"Polygon\",B=a.length;for(;B>=2&&a[B-1].equals(a[B-2]);)B--;let V=0;for(;V<B-1&&a[V].equals(a[V+1]);)V++;if(B<(D?3:2))return;A===\"bevel\"&&(E=1.05);let q=this.overscaling<=16?15*Bn/(512*this.overscaling):0,Q=this.segments.prepareSegment(10*B,this.layoutVertexArray,this.indexArray),rt,ot,lt,pt,xt;this.e1=this.e2=-1,D&&(rt=a[B-2],xt=a[V].sub(rt)._unit()._perp());for(let Mt=V;Mt<B;Mt++){if(lt=Mt===B-1?D?a[V+1]:void 0:a[Mt+1],lt&&a[Mt].equals(lt))continue;xt&&(pt=xt),rt&&(ot=rt),rt=a[Mt],xt=lt?lt.sub(rt)._unit()._perp():pt,pt=pt||xt;let Vt=pt.add(xt);Vt.x===0&&Vt.y===0||Vt._unit();let It=pt.x*xt.x+pt.y*xt.y,zt=Vt.x*xt.x+Vt.y*xt.y,ie=zt!==0?1/zt:1/0,ue=2*Math.sqrt(2-2*zt),Be=zt<wX&&ot&&lt,Ke=pt.x*xt.y-pt.y*xt.x>0;if(Be&&Mt>V){let we=rt.dist(ot);if(we>2*q){let We=rt.sub(rt.sub(ot)._mult(q/we)._round());this.updateDistance(ot,We),this.addCurrentVertex(We,pt,0,0,Q),ot=We}}let Re=ot&&lt,Ie=Re?A:D?\"butt\":x;if(Re&&Ie===\"round\"&&(ie<P?Ie=\"miter\":ie<=2&&(Ie=\"fakeround\")),Ie===\"miter\"&&ie>E&&(Ie=\"bevel\"),Ie===\"bevel\"&&(ie>2&&(Ie=\"flipbevel\"),ie<E&&(Ie=\"miter\")),ot&&this.updateDistance(ot,rt),Ie===\"miter\")Vt._mult(ie),this.addCurrentVertex(rt,Vt,0,0,Q);else if(Ie===\"flipbevel\"){if(ie>100)Vt=xt.mult(-1);else{let we=ie*pt.add(xt).mag()/pt.sub(xt).mag();Vt._perp()._mult(we*(Ke?-1:1))}this.addCurrentVertex(rt,Vt,0,0,Q),this.addCurrentVertex(rt,Vt.mult(-1),0,0,Q)}else if(Ie===\"bevel\"||Ie===\"fakeround\"){let we=-Math.sqrt(ie*ie-1),We=Ke?we:0,Ee=Ke?0:we;if(ot&&this.addCurrentVertex(rt,pt,We,Ee,Q),Ie===\"fakeround\"){let pe=Math.round(180*ue/Math.PI/20);for(let cr=1;cr<pe;cr++){let tr=cr/pe;if(tr!==.5){let pn=tr-.5;tr+=tr*pn*(tr-1)*((1.0904+It*(It*(3.55645-1.43519*It)-3.2452))*pn*pn+(.848013+It*(.215638*It-1.06021)))}let ei=xt.sub(pt)._mult(tr)._add(pt)._unit()._mult(Ke?-1:1);this.addHalfVertex(rt,ei.x,ei.y,!1,Ke,0,Q)}}lt&&this.addCurrentVertex(rt,xt,-We,-Ee,Q)}else if(Ie===\"butt\")this.addCurrentVertex(rt,Vt,0,0,Q);else if(Ie===\"square\"){let we=ot?1:-1;this.addCurrentVertex(rt,Vt,we,we,Q)}else Ie===\"round\"&&(ot&&(this.addCurrentVertex(rt,pt,0,0,Q),this.addCurrentVertex(rt,pt,1,1,Q,!0)),lt&&(this.addCurrentVertex(rt,xt,-1,-1,Q,!0),this.addCurrentVertex(rt,xt,0,0,Q)));if(Be&&Mt<B-1){let we=rt.dist(lt);if(we>2*q){let We=rt.add(lt.sub(rt)._mult(q/we)._round());this.updateDistance(rt,We),this.addCurrentVertex(We,xt,0,0,Q),rt=We}}}}addCurrentVertex(a,h,A,x,E,P=!1){let D=h.y*x-h.x,B=-h.y-h.x*x;this.addHalfVertex(a,h.x+h.y*A,h.y-h.x*A,P,!1,A,E),this.addHalfVertex(a,D,B,P,!0,-x,E),this.distance>L6/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(a,h,A,x,E,P))}addHalfVertex({x:a,y:h},A,x,E,P,D,B){let V=.5*(this.lineClips?this.scaledDistance*(L6-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((a<<1)+(E?1:0),(h<<1)+(P?1:0),Math.round(63*A)+128,Math.round(63*x)+128,1+(D===0?0:D<0?-1:1)|(63&V)<<2,V>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let q=B.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,q),B.primitiveLength++),P?this.e2=q:this.e1=q}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(a,h){this.distance+=a.dist(h),this.updateScaledDistance()}}let k6,R6;Fe(\"LineBucket\",JI,{omit:[\"layers\",\"patternFeatures\"]});var D6={get paint(){return R6=R6||new wo({\"line-opacity\":new fr(Jt.paint_line[\"line-opacity\"]),\"line-color\":new fr(Jt.paint_line[\"line-color\"]),\"line-translate\":new Qe(Jt.paint_line[\"line-translate\"]),\"line-translate-anchor\":new Qe(Jt.paint_line[\"line-translate-anchor\"]),\"line-width\":new fr(Jt.paint_line[\"line-width\"]),\"line-gap-width\":new fr(Jt.paint_line[\"line-gap-width\"]),\"line-offset\":new fr(Jt.paint_line[\"line-offset\"]),\"line-blur\":new fr(Jt.paint_line[\"line-blur\"]),\"line-dasharray\":new xu(Jt.paint_line[\"line-dasharray\"]),\"line-pattern\":new If(Jt.paint_line[\"line-pattern\"]),\"line-gradient\":new t0(Jt.paint_line[\"line-gradient\"])})},get layout(){return k6=k6||new wo({\"line-cap\":new Qe(Jt.layout_line[\"line-cap\"]),\"line-join\":new fr(Jt.layout_line[\"line-join\"]),\"line-miter-limit\":new Qe(Jt.layout_line[\"line-miter-limit\"]),\"line-round-limit\":new Qe(Jt.layout_line[\"line-round-limit\"]),\"line-sort-key\":new fr(Jt.layout_line[\"line-sort-key\"])})}};class SX extends fr{possiblyEvaluate(a,h){return h=new ki(Math.floor(h.zoom),{now:h.now,fadeDuration:h.fadeDuration,zoomHistory:h.zoomHistory,transition:h.transition}),super.possiblyEvaluate(a,h)}evaluate(a,h,A,x){return h=Tt({},h,{zoom:Math.floor(h.zoom)}),super.evaluate(a,h,A,x)}}let zS;class TX extends cl{constructor(a){super(a,D6),this.gradientVersion=0,zS||(zS=new SX(D6.paint.properties[\"line-width\"].specification),zS.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(a){if(a===\"line-gradient\"){let h=this.gradientExpression();this.stepInterpolant=!!function(A){return A._styleExpression!==void 0}(h)&&h._styleExpression.expression instanceof Gp,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values[\"line-gradient\"].value.expression}recalculate(a,h){super.recalculate(a,h),this.paint._values[\"line-floorwidth\"]=zS.possiblyEvaluate(this._transitioningPaint._values[\"line-width\"].value,a)}createBucket(a){return new JI(a)}queryRadius(a){let h=a,A=O6(H(\"line-width\",this,h),H(\"line-gap-width\",this,h)),x=H(\"line-offset\",this,h);return A/2+Math.abs(x)+et(this.paint.get(\"line-translate\"))}queryIntersectsFeature(a,h,A,x,E,P,D){let B=st(a,this.paint.get(\"line-translate\"),this.paint.get(\"line-translate-anchor\"),P.angle,D),V=D/2*O6(this.paint.get(\"line-width\").evaluate(h,A),this.paint.get(\"line-gap-width\").evaluate(h,A)),q=this.paint.get(\"line-offset\").evaluate(h,A);return q&&(x=function(Q,rt){let ot=[];for(let lt=0;lt<Q.length;lt++){let pt=Q[lt],xt=[];for(let Mt=0;Mt<pt.length;Mt++){let Vt=pt[Mt-1],It=pt[Mt],zt=pt[Mt+1],ie=Mt===0?new _(0,0):It.sub(Vt)._unit()._perp(),ue=Mt===pt.length-1?new _(0,0):zt.sub(It)._unit()._perp(),Be=ie._add(ue)._unit(),Ke=Be.x*ue.x+Be.y*ue.y;Ke!==0&&Be._mult(1/Ke),xt.push(Be._mult(rt)._add(It))}ot.push(xt)}return ot}(x,q*D)),function(Q,rt,ot){for(let lt=0;lt<rt.length;lt++){let pt=rt[lt];if(Q.length>=3){for(let xt=0;xt<pt.length;xt++)if(L(Q,pt[xt]))return!0}if(p(Q,pt,ot))return!0}return!1}(B,x,V)}isTileClipped(){return!0}}function O6(u,a){return a>0?a+2*u:u}let MX=Dn([{name:\"a_pos_offset\",components:4,type:\"Int16\"},{name:\"a_data\",components:4,type:\"Uint16\"},{name:\"a_pixeloffset\",components:4,type:\"Int16\"}],4),EX=Dn([{name:\"a_projected_pos\",components:3,type:\"Float32\"}],4);Dn([{name:\"a_fade_opacity\",components:1,type:\"Uint32\"}],4);let PX=Dn([{name:\"a_placed\",components:2,type:\"Uint8\"},{name:\"a_shift\",components:2,type:\"Float32\"}]);Dn([{type:\"Int16\",name:\"anchorPointX\"},{type:\"Int16\",name:\"anchorPointY\"},{type:\"Int16\",name:\"x1\"},{type:\"Int16\",name:\"y1\"},{type:\"Int16\",name:\"x2\"},{type:\"Int16\",name:\"y2\"},{type:\"Uint32\",name:\"featureIndex\"},{type:\"Uint16\",name:\"sourceLayerIndex\"},{type:\"Uint16\",name:\"bucketIndex\"}]);let B6=Dn([{name:\"a_pos\",components:2,type:\"Int16\"},{name:\"a_anchor_pos\",components:2,type:\"Int16\"},{name:\"a_extrude\",components:2,type:\"Int16\"}],4),IX=Dn([{name:\"a_pos\",components:2,type:\"Float32\"},{name:\"a_radius\",components:1,type:\"Float32\"},{name:\"a_flags\",components:2,type:\"Int16\"}],4);function CX(u,a,h){return u.sections.forEach(A=>{A.text=function(x,E,P){let D=E.layout.get(\"text-transform\").evaluate(P,{});return D===\"uppercase\"?x=x.toLocaleUpperCase():D===\"lowercase\"&&(x=x.toLocaleLowerCase()),vu.applyArabicShaping&&(x=vu.applyArabicShaping(x)),x}(A.text,a,h)}),u}Dn([{name:\"triangle\",components:3,type:\"Uint16\"}]),Dn([{type:\"Int16\",name:\"anchorX\"},{type:\"Int16\",name:\"anchorY\"},{type:\"Uint16\",name:\"glyphStartIndex\"},{type:\"Uint16\",name:\"numGlyphs\"},{type:\"Uint32\",name:\"vertexStartIndex\"},{type:\"Uint32\",name:\"lineStartIndex\"},{type:\"Uint32\",name:\"lineLength\"},{type:\"Uint16\",name:\"segment\"},{type:\"Uint16\",name:\"lowerSize\"},{type:\"Uint16\",name:\"upperSize\"},{type:\"Float32\",name:\"lineOffsetX\"},{type:\"Float32\",name:\"lineOffsetY\"},{type:\"Uint8\",name:\"writingMode\"},{type:\"Uint8\",name:\"placedOrientation\"},{type:\"Uint8\",name:\"hidden\"},{type:\"Uint32\",name:\"crossTileID\"},{type:\"Int16\",name:\"associatedIconIndex\"}]),Dn([{type:\"Int16\",name:\"anchorX\"},{type:\"Int16\",name:\"anchorY\"},{type:\"Int16\",name:\"rightJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"centerJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"leftJustifiedTextSymbolIndex\"},{type:\"Int16\",name:\"verticalPlacedTextSymbolIndex\"},{type:\"Int16\",name:\"placedIconSymbolIndex\"},{type:\"Int16\",name:\"verticalPlacedIconSymbolIndex\"},{type:\"Uint16\",name:\"key\"},{type:\"Uint16\",name:\"textBoxStartIndex\"},{type:\"Uint16\",name:\"textBoxEndIndex\"},{type:\"Uint16\",name:\"verticalTextBoxStartIndex\"},{type:\"Uint16\",name:\"verticalTextBoxEndIndex\"},{type:\"Uint16\",name:\"iconBoxStartIndex\"},{type:\"Uint16\",name:\"iconBoxEndIndex\"},{type:\"Uint16\",name:\"verticalIconBoxStartIndex\"},{type:\"Uint16\",name:\"verticalIconBoxEndIndex\"},{type:\"Uint16\",name:\"featureIndex\"},{type:\"Uint16\",name:\"numHorizontalGlyphVertices\"},{type:\"Uint16\",name:\"numVerticalGlyphVertices\"},{type:\"Uint16\",name:\"numIconVertices\"},{type:\"Uint16\",name:\"numVerticalIconVertices\"},{type:\"Uint16\",name:\"useRuntimeCollisionCircles\"},{type:\"Uint32\",name:\"crossTileID\"},{type:\"Float32\",name:\"textBoxScale\"},{type:\"Float32\",name:\"collisionCircleDiameter\"},{type:\"Uint16\",name:\"textAnchorOffsetStartIndex\"},{type:\"Uint16\",name:\"textAnchorOffsetEndIndex\"}]),Dn([{type:\"Float32\",name:\"offsetX\"}]),Dn([{type:\"Int16\",name:\"x\"},{type:\"Int16\",name:\"y\"},{type:\"Int16\",name:\"tileUnitDistanceFromAnchor\"}]),Dn([{type:\"Uint16\",name:\"textAnchor\"},{type:\"Float32\",components:2,name:\"textOffset\"}]);let Rx={\"!\":\"\\uFE15\",\"#\":\"\\uFF03\",$:\"\\uFF04\",\"%\":\"\\uFF05\",\"&\":\"\\uFF06\",\"(\":\"\\uFE35\",\")\":\"\\uFE36\",\"*\":\"\\uFF0A\",\"+\":\"\\uFF0B\",\",\":\"\\uFE10\",\"-\":\"\\uFE32\",\".\":\"\\u30FB\",\"/\":\"\\uFF0F\",\":\":\"\\uFE13\",\";\":\"\\uFE14\",\"<\":\"\\uFE3F\",\"=\":\"\\uFF1D\",\">\":\"\\uFE40\",\"?\":\"\\uFE16\",\"@\":\"\\uFF20\",\"[\":\"\\uFE47\",\"\\\\\":\"\\uFF3C\",\"]\":\"\\uFE48\",\"^\":\"\\uFF3E\",_:\"\\uFE33\",\"`\":\"\\uFF40\",\"{\":\"\\uFE37\",\"|\":\"\\u2015\",\"}\":\"\\uFE38\",\"~\":\"\\uFF5E\",\"\\xA2\":\"\\uFFE0\",\"\\xA3\":\"\\uFFE1\",\"\\xA5\":\"\\uFFE5\",\"\\xA6\":\"\\uFFE4\",\"\\xAC\":\"\\uFFE2\",\"\\xAF\":\"\\uFFE3\",\"\\u2013\":\"\\uFE32\",\"\\u2014\":\"\\uFE31\",\"\\u2018\":\"\\uFE43\",\"\\u2019\":\"\\uFE44\",\"\\u201C\":\"\\uFE41\",\"\\u201D\":\"\\uFE42\",\"\\u2026\":\"\\uFE19\",\"\\u2027\":\"\\u30FB\",\"\\u20A9\":\"\\uFFE6\",\"\\u3001\":\"\\uFE11\",\"\\u3002\":\"\\uFE12\",\"\\u3008\":\"\\uFE3F\",\"\\u3009\":\"\\uFE40\",\"\\u300A\":\"\\uFE3D\",\"\\u300B\":\"\\uFE3E\",\"\\u300C\":\"\\uFE41\",\"\\u300D\":\"\\uFE42\",\"\\u300E\":\"\\uFE43\",\"\\u300F\":\"\\uFE44\",\"\\u3010\":\"\\uFE3B\",\"\\u3011\":\"\\uFE3C\",\"\\u3014\":\"\\uFE39\",\"\\u3015\":\"\\uFE3A\",\"\\u3016\":\"\\uFE17\",\"\\u3017\":\"\\uFE18\",\"\\uFF01\":\"\\uFE15\",\"\\uFF08\":\"\\uFE35\",\"\\uFF09\":\"\\uFE36\",\"\\uFF0C\":\"\\uFE10\",\"\\uFF0D\":\"\\uFE32\",\"\\uFF0E\":\"\\u30FB\",\"\\uFF1A\":\"\\uFE13\",\"\\uFF1B\":\"\\uFE14\",\"\\uFF1C\":\"\\uFE3F\",\"\\uFF1E\":\"\\uFE40\",\"\\uFF1F\":\"\\uFE16\",\"\\uFF3B\":\"\\uFE47\",\"\\uFF3D\":\"\\uFE48\",\"\\uFF3F\":\"\\uFE33\",\"\\uFF5B\":\"\\uFE37\",\"\\uFF5C\":\"\\u2015\",\"\\uFF5D\":\"\\uFE38\",\"\\uFF5F\":\"\\uFE35\",\"\\uFF60\":\"\\uFE36\",\"\\uFF61\":\"\\uFE12\",\"\\uFF62\":\"\\uFE41\",\"\\uFF63\":\"\\uFE42\"};var Gs=24,F6=qi,z6=function(u,a,h,A,x){var E,P,D=8*x-A-1,B=(1<<D)-1,V=B>>1,q=-7,Q=h?x-1:0,rt=h?-1:1,ot=u[a+Q];for(Q+=rt,E=ot&(1<<-q)-1,ot>>=-q,q+=D;q>0;E=256*E+u[a+Q],Q+=rt,q-=8);for(P=E&(1<<-q)-1,E>>=-q,q+=A;q>0;P=256*P+u[a+Q],Q+=rt,q-=8);if(E===0)E=1-V;else{if(E===B)return P?NaN:1/0*(ot?-1:1);P+=Math.pow(2,A),E-=V}return(ot?-1:1)*P*Math.pow(2,E-A)},N6=function(u,a,h,A,x,E){var P,D,B,V=8*E-x-1,q=(1<<V)-1,Q=q>>1,rt=x===23?Math.pow(2,-24)-Math.pow(2,-77):0,ot=A?0:E-1,lt=A?1:-1,pt=a<0||a===0&&1/a<0?1:0;for(a=Math.abs(a),isNaN(a)||a===1/0?(D=isNaN(a)?1:0,P=q):(P=Math.floor(Math.log(a)/Math.LN2),a*(B=Math.pow(2,-P))<1&&(P--,B*=2),(a+=P+Q>=1?rt/B:rt*Math.pow(2,1-Q))*B>=2&&(P++,B/=2),P+Q>=q?(D=0,P=q):P+Q>=1?(D=(a*B-1)*Math.pow(2,x),P+=Q):(D=a*Math.pow(2,Q-1)*Math.pow(2,x),P=0));x>=8;u[h+ot]=255&D,ot+=lt,D/=256,x-=8);for(P=P<<x|D,V+=x;V>0;u[h+ot]=255&P,ot+=lt,P/=256,V-=8);u[h+ot-lt]|=128*pt};function qi(u){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(u)?u:new Uint8Array(u||0),this.pos=0,this.type=0,this.length=this.buf.length}qi.Varint=0,qi.Fixed64=1,qi.Bytes=2,qi.Fixed32=5;var tC=4294967296,U6=1/tC,V6=typeof TextDecoder>\"u\"?null:new TextDecoder(\"utf8\");function Bd(u){return u.type===qi.Bytes?u.readVarint()+u.pos:u.pos+1}function f_(u,a,h){return h?4294967296*a+(u>>>0):4294967296*(a>>>0)+(u>>>0)}function j6(u,a,h){var A=a<=16383?1:a<=2097151?2:a<=268435455?3:Math.floor(Math.log(a)/(7*Math.LN2));h.realloc(A);for(var x=h.pos-1;x>=u;x--)h.buf[x+A]=h.buf[x]}function LX(u,a){for(var h=0;h<u.length;h++)a.writeVarint(u[h])}function kX(u,a){for(var h=0;h<u.length;h++)a.writeSVarint(u[h])}function RX(u,a){for(var h=0;h<u.length;h++)a.writeFloat(u[h])}function DX(u,a){for(var h=0;h<u.length;h++)a.writeDouble(u[h])}function OX(u,a){for(var h=0;h<u.length;h++)a.writeBoolean(u[h])}function BX(u,a){for(var h=0;h<u.length;h++)a.writeFixed32(u[h])}function FX(u,a){for(var h=0;h<u.length;h++)a.writeSFixed32(u[h])}function zX(u,a){for(var h=0;h<u.length;h++)a.writeFixed64(u[h])}function NX(u,a){for(var h=0;h<u.length;h++)a.writeSFixed64(u[h])}function NS(u,a){return(u[a]|u[a+1]<<8|u[a+2]<<16)+16777216*u[a+3]}function d_(u,a,h){u[h]=a,u[h+1]=a>>>8,u[h+2]=a>>>16,u[h+3]=a>>>24}function G6(u,a){return(u[a]|u[a+1]<<8|u[a+2]<<16)+(u[a+3]<<24)}qi.prototype={destroy:function(){this.buf=null},readFields:function(u,a,h){for(h=h||this.length;this.pos<h;){var A=this.readVarint(),x=A>>3,E=this.pos;this.type=7&A,u(x,a,this),this.pos===E&&this.skip(A)}return a},readMessage:function(u,a){return this.readFields(u,a,this.readVarint()+this.pos)},readFixed32:function(){var u=NS(this.buf,this.pos);return this.pos+=4,u},readSFixed32:function(){var u=G6(this.buf,this.pos);return this.pos+=4,u},readFixed64:function(){var u=NS(this.buf,this.pos)+NS(this.buf,this.pos+4)*tC;return this.pos+=8,u},readSFixed64:function(){var u=NS(this.buf,this.pos)+G6(this.buf,this.pos+4)*tC;return this.pos+=8,u},readFloat:function(){var u=z6(this.buf,this.pos,!0,23,4);return this.pos+=4,u},readDouble:function(){var u=z6(this.buf,this.pos,!0,52,8);return this.pos+=8,u},readVarint:function(u){var a,h,A=this.buf;return a=127&(h=A[this.pos++]),h<128?a:(a|=(127&(h=A[this.pos++]))<<7,h<128?a:(a|=(127&(h=A[this.pos++]))<<14,h<128?a:(a|=(127&(h=A[this.pos++]))<<21,h<128?a:function(x,E,P){var D,B,V=P.buf;if(D=(112&(B=V[P.pos++]))>>4,B<128||(D|=(127&(B=V[P.pos++]))<<3,B<128)||(D|=(127&(B=V[P.pos++]))<<10,B<128)||(D|=(127&(B=V[P.pos++]))<<17,B<128)||(D|=(127&(B=V[P.pos++]))<<24,B<128)||(D|=(1&(B=V[P.pos++]))<<31,B<128))return f_(x,D,E);throw new Error(\"Expected varint not more than 10 bytes\")}(a|=(15&(h=A[this.pos]))<<28,u,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var u=this.readVarint();return u%2==1?(u+1)/-2:u/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var u=this.readVarint()+this.pos,a=this.pos;return this.pos=u,u-a>=12&&V6?function(h,A,x){return V6.decode(h.subarray(A,x))}(this.buf,a,u):function(h,A,x){for(var E=\"\",P=A;P<x;){var D,B,V,q=h[P],Q=null,rt=q>239?4:q>223?3:q>191?2:1;if(P+rt>x)break;rt===1?q<128&&(Q=q):rt===2?(192&(D=h[P+1]))==128&&(Q=(31&q)<<6|63&D)<=127&&(Q=null):rt===3?(B=h[P+2],(192&(D=h[P+1]))==128&&(192&B)==128&&((Q=(15&q)<<12|(63&D)<<6|63&B)<=2047||Q>=55296&&Q<=57343)&&(Q=null)):rt===4&&(B=h[P+2],V=h[P+3],(192&(D=h[P+1]))==128&&(192&B)==128&&(192&V)==128&&((Q=(15&q)<<18|(63&D)<<12|(63&B)<<6|63&V)<=65535||Q>=1114112)&&(Q=null)),Q===null?(Q=65533,rt=1):Q>65535&&(Q-=65536,E+=String.fromCharCode(Q>>>10&1023|55296),Q=56320|1023&Q),E+=String.fromCharCode(Q),P+=rt}return E}(this.buf,a,u)},readBytes:function(){var u=this.readVarint()+this.pos,a=this.buf.subarray(this.pos,u);return this.pos=u,a},readPackedVarint:function(u,a){if(this.type!==qi.Bytes)return u.push(this.readVarint(a));var h=Bd(this);for(u=u||[];this.pos<h;)u.push(this.readVarint(a));return u},readPackedSVarint:function(u){if(this.type!==qi.Bytes)return u.push(this.readSVarint());var a=Bd(this);for(u=u||[];this.pos<a;)u.push(this.readSVarint());return u},readPackedBoolean:function(u){if(this.type!==qi.Bytes)return u.push(this.readBoolean());var a=Bd(this);for(u=u||[];this.pos<a;)u.push(this.readBoolean());return u},readPackedFloat:function(u){if(this.type!==qi.Bytes)return u.push(this.readFloat());var a=Bd(this);for(u=u||[];this.pos<a;)u.push(this.readFloat());return u},readPackedDouble:function(u){if(this.type!==qi.Bytes)return u.push(this.readDouble());var a=Bd(this);for(u=u||[];this.pos<a;)u.push(this.readDouble());return u},readPackedFixed32:function(u){if(this.type!==qi.Bytes)return u.push(this.readFixed32());var a=Bd(this);for(u=u||[];this.pos<a;)u.push(this.readFixed32());return u},readPackedSFixed32:function(u){if(this.type!==qi.Bytes)return u.push(this.readSFixed32());var a=Bd(this);for(u=u||[];this.pos<a;)u.push(this.readSFixed32());return u},readPackedFixed64:function(u){if(this.type!==qi.Bytes)return u.push(this.readFixed64());var a=Bd(this);for(u=u||[];this.pos<a;)u.push(this.readFixed64());return u},readPackedSFixed64:function(u){if(this.type!==qi.Bytes)return u.push(this.readSFixed64());var a=Bd(this);for(u=u||[];this.pos<a;)u.push(this.readSFixed64());return u},skip:function(u){var a=7&u;if(a===qi.Varint)for(;this.buf[this.pos++]>127;);else if(a===qi.Bytes)this.pos=this.readVarint()+this.pos;else if(a===qi.Fixed32)this.pos+=4;else{if(a!==qi.Fixed64)throw new Error(\"Unimplemented type: \"+a);this.pos+=8}},writeTag:function(u,a){this.writeVarint(u<<3|a)},realloc:function(u){for(var a=this.length||16;a<this.pos+u;)a*=2;if(a!==this.length){var h=new Uint8Array(a);h.set(this.buf),this.buf=h,this.length=a}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(u){this.realloc(4),d_(this.buf,u,this.pos),this.pos+=4},writeSFixed32:function(u){this.realloc(4),d_(this.buf,u,this.pos),this.pos+=4},writeFixed64:function(u){this.realloc(8),d_(this.buf,-1&u,this.pos),d_(this.buf,Math.floor(u*U6),this.pos+4),this.pos+=8},writeSFixed64:function(u){this.realloc(8),d_(this.buf,-1&u,this.pos),d_(this.buf,Math.floor(u*U6),this.pos+4),this.pos+=8},writeVarint:function(u){(u=+u||0)>268435455||u<0?function(a,h){var A,x;if(a>=0?(A=a%4294967296|0,x=a/4294967296|0):(x=~(-a/4294967296),4294967295^(A=~(-a%4294967296))?A=A+1|0:(A=0,x=x+1|0)),a>=18446744073709552e3||a<-18446744073709552e3)throw new Error(\"Given varint doesn't fit into 10 bytes\");h.realloc(10),function(E,P,D){D.buf[D.pos++]=127&E|128,E>>>=7,D.buf[D.pos++]=127&E|128,E>>>=7,D.buf[D.pos++]=127&E|128,E>>>=7,D.buf[D.pos++]=127&E|128,D.buf[D.pos]=127&(E>>>=7)}(A,0,h),function(E,P){var D=(7&E)<<4;P.buf[P.pos++]|=D|((E>>>=3)?128:0),E&&(P.buf[P.pos++]=127&E|((E>>>=7)?128:0),E&&(P.buf[P.pos++]=127&E|((E>>>=7)?128:0),E&&(P.buf[P.pos++]=127&E|((E>>>=7)?128:0),E&&(P.buf[P.pos++]=127&E|((E>>>=7)?128:0),E&&(P.buf[P.pos++]=127&E)))))}(x,h)}(u,this):(this.realloc(4),this.buf[this.pos++]=127&u|(u>127?128:0),u<=127||(this.buf[this.pos++]=127&(u>>>=7)|(u>127?128:0),u<=127||(this.buf[this.pos++]=127&(u>>>=7)|(u>127?128:0),u<=127||(this.buf[this.pos++]=u>>>7&127))))},writeSVarint:function(u){this.writeVarint(u<0?2*-u-1:2*u)},writeBoolean:function(u){this.writeVarint(!!u)},writeString:function(u){u=String(u),this.realloc(4*u.length),this.pos++;var a=this.pos;this.pos=function(A,x,E){for(var P,D,B=0;B<x.length;B++){if((P=x.charCodeAt(B))>55295&&P<57344){if(!D){P>56319||B+1===x.length?(A[E++]=239,A[E++]=191,A[E++]=189):D=P;continue}if(P<56320){A[E++]=239,A[E++]=191,A[E++]=189,D=P;continue}P=D-55296<<10|P-56320|65536,D=null}else D&&(A[E++]=239,A[E++]=191,A[E++]=189,D=null);P<128?A[E++]=P:(P<2048?A[E++]=P>>6|192:(P<65536?A[E++]=P>>12|224:(A[E++]=P>>18|240,A[E++]=P>>12&63|128),A[E++]=P>>6&63|128),A[E++]=63&P|128)}return E}(this.buf,u,this.pos);var h=this.pos-a;h>=128&&j6(a,h,this),this.pos=a-1,this.writeVarint(h),this.pos+=h},writeFloat:function(u){this.realloc(4),N6(this.buf,u,this.pos,!0,23,4),this.pos+=4},writeDouble:function(u){this.realloc(8),N6(this.buf,u,this.pos,!0,52,8),this.pos+=8},writeBytes:function(u){var a=u.length;this.writeVarint(a),this.realloc(a);for(var h=0;h<a;h++)this.buf[this.pos++]=u[h]},writeRawMessage:function(u,a){this.pos++;var h=this.pos;u(a,this);var A=this.pos-h;A>=128&&j6(h,A,this),this.pos=h-1,this.writeVarint(A),this.pos+=A},writeMessage:function(u,a,h){this.writeTag(u,qi.Bytes),this.writeRawMessage(a,h)},writePackedVarint:function(u,a){a.length&&this.writeMessage(u,LX,a)},writePackedSVarint:function(u,a){a.length&&this.writeMessage(u,kX,a)},writePackedBoolean:function(u,a){a.length&&this.writeMessage(u,OX,a)},writePackedFloat:function(u,a){a.length&&this.writeMessage(u,RX,a)},writePackedDouble:function(u,a){a.length&&this.writeMessage(u,DX,a)},writePackedFixed32:function(u,a){a.length&&this.writeMessage(u,BX,a)},writePackedSFixed32:function(u,a){a.length&&this.writeMessage(u,FX,a)},writePackedFixed64:function(u,a){a.length&&this.writeMessage(u,zX,a)},writePackedSFixed64:function(u,a){a.length&&this.writeMessage(u,NX,a)},writeBytesField:function(u,a){this.writeTag(u,qi.Bytes),this.writeBytes(a)},writeFixed32Field:function(u,a){this.writeTag(u,qi.Fixed32),this.writeFixed32(a)},writeSFixed32Field:function(u,a){this.writeTag(u,qi.Fixed32),this.writeSFixed32(a)},writeFixed64Field:function(u,a){this.writeTag(u,qi.Fixed64),this.writeFixed64(a)},writeSFixed64Field:function(u,a){this.writeTag(u,qi.Fixed64),this.writeSFixed64(a)},writeVarintField:function(u,a){this.writeTag(u,qi.Varint),this.writeVarint(a)},writeSVarintField:function(u,a){this.writeTag(u,qi.Varint),this.writeSVarint(a)},writeStringField:function(u,a){this.writeTag(u,qi.Bytes),this.writeString(a)},writeFloatField:function(u,a){this.writeTag(u,qi.Fixed32),this.writeFloat(a)},writeDoubleField:function(u,a){this.writeTag(u,qi.Fixed64),this.writeDouble(a)},writeBooleanField:function(u,a){this.writeVarintField(u,!!a)}};var eC=o(F6);let rC=3;function UX(u,a,h){u===1&&h.readMessage(VX,a)}function VX(u,a,h){if(u===3){let{id:A,bitmap:x,width:E,height:P,left:D,top:B,advance:V}=h.readMessage(jX,{});a.push({id:A,bitmap:new pi({width:E+2*rC,height:P+2*rC},x),metrics:{width:E,height:P,left:D,top:B,advance:V}})}}function jX(u,a,h){u===1?a.id=h.readVarint():u===2?a.bitmap=h.readBytes():u===3?a.width=h.readVarint():u===4?a.height=h.readVarint():u===5?a.left=h.readSVarint():u===6?a.top=h.readSVarint():u===7&&(a.advance=h.readVarint())}let W6=rC;function H6(u){let a=0,h=0;for(let P of u)a+=P.w*P.h,h=Math.max(h,P.w);u.sort((P,D)=>D.h-P.h);let A=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(a/.95)),h),h:1/0}],x=0,E=0;for(let P of u)for(let D=A.length-1;D>=0;D--){let B=A[D];if(!(P.w>B.w||P.h>B.h)){if(P.x=B.x,P.y=B.y,E=Math.max(E,P.y+P.h),x=Math.max(x,P.x+P.w),P.w===B.w&&P.h===B.h){let V=A.pop();D<A.length&&(A[D]=V)}else P.h===B.h?(B.x+=P.w,B.w-=P.w):P.w===B.w?(B.y+=P.h,B.h-=P.h):(A.push({x:B.x+P.w,y:B.y,w:B.w-P.w,h:P.h}),B.y+=P.h,B.h-=P.h);break}}return{w:x,h:E,fill:a/(x*E)||0}}let dl=1;class iC{constructor(a,{pixelRatio:h,version:A,stretchX:x,stretchY:E,content:P}){this.paddedRect=a,this.pixelRatio=h,this.stretchX=x,this.stretchY=E,this.content=P,this.version=A}get tl(){return[this.paddedRect.x+dl,this.paddedRect.y+dl]}get br(){return[this.paddedRect.x+this.paddedRect.w-dl,this.paddedRect.y+this.paddedRect.h-dl]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*dl)/this.pixelRatio,(this.paddedRect.h-2*dl)/this.pixelRatio]}}class q6{constructor(a,h){let A={},x={};this.haveRenderCallbacks=[];let E=[];this.addImages(a,A,E),this.addImages(h,x,E);let{w:P,h:D}=H6(E),B=new fi({width:P||1,height:D||1});for(let V in a){let q=a[V],Q=A[V].paddedRect;fi.copy(q.data,B,{x:0,y:0},{x:Q.x+dl,y:Q.y+dl},q.data)}for(let V in h){let q=h[V],Q=x[V].paddedRect,rt=Q.x+dl,ot=Q.y+dl,lt=q.data.width,pt=q.data.height;fi.copy(q.data,B,{x:0,y:0},{x:rt,y:ot},q.data),fi.copy(q.data,B,{x:0,y:pt-1},{x:rt,y:ot-1},{width:lt,height:1}),fi.copy(q.data,B,{x:0,y:0},{x:rt,y:ot+pt},{width:lt,height:1}),fi.copy(q.data,B,{x:lt-1,y:0},{x:rt-1,y:ot},{width:1,height:pt}),fi.copy(q.data,B,{x:0,y:0},{x:rt+lt,y:ot},{width:1,height:pt})}this.image=B,this.iconPositions=A,this.patternPositions=x}addImages(a,h,A){for(let x in a){let E=a[x],P={x:0,y:0,w:E.data.width+2*dl,h:E.data.height+2*dl};A.push(P),h[x]=new iC(P,E),E.hasRenderCallback&&this.haveRenderCallbacks.push(x)}}patchUpdatedImages(a,h){a.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let A in a.updatedImages)this.patchUpdatedImage(this.iconPositions[A],a.getImage(A),h),this.patchUpdatedImage(this.patternPositions[A],a.getImage(A),h)}patchUpdatedImage(a,h,A){if(!a||!h||a.version===h.version)return;a.version=h.version;let[x,E]=a.tl;A.update(h.data,void 0,{x,y:E})}}var uA;Fe(\"ImagePosition\",iC),Fe(\"ImageAtlas\",q6),n.ah=void 0,(uA=n.ah||(n.ah={}))[uA.none=0]=\"none\",uA[uA.horizontal=1]=\"horizontal\",uA[uA.vertical=2]=\"vertical\",uA[uA.horizontalOnly=3]=\"horizontalOnly\";let Dx=-17;class Ox{constructor(){this.scale=1,this.fontStack=\"\",this.imageName=null}static forText(a,h){let A=new Ox;return A.scale=a||1,A.fontStack=h,A}static forImage(a){let h=new Ox;return h.imageName=a,h}}class p_{constructor(){this.text=\"\",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(a,h){let A=new p_;for(let x=0;x<a.sections.length;x++){let E=a.sections[x];E.image?A.addImageSection(E):A.addTextSection(E,h)}return A}length(){return this.text.length}getSection(a){return this.sections[this.sectionIndex[a]]}getSectionIndex(a){return this.sectionIndex[a]}getCharCode(a){return this.text.charCodeAt(a)}verticalizePunctuation(){this.text=function(a){let h=\"\";for(let A=0;A<a.length;A++){let x=a.charCodeAt(A+1)||null,E=a.charCodeAt(A-1)||null;h+=x&&Ld(x)&&!Rx[a[A+1]]||E&&Ld(E)&&!Rx[a[A-1]]||!Rx[a[A]]?a[A]:Rx[a[A]]}return h}(this.text)}trim(){let a=0;for(let A=0;A<this.text.length&&VS[this.text.charCodeAt(A)];A++)a++;let h=this.text.length;for(let A=this.text.length-1;A>=0&&A>=a&&VS[this.text.charCodeAt(A)];A--)h--;this.text=this.text.substring(a,h),this.sectionIndex=this.sectionIndex.slice(a,h)}substring(a,h){let A=new p_;return A.text=this.text.substring(a,h),A.sectionIndex=this.sectionIndex.slice(a,h),A.sections=this.sections,A}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((a,h)=>Math.max(a,this.sections[h].scale),0)}addTextSection(a,h){this.text+=a.text,this.sections.push(Ox.forText(a.scale,a.fontStack||h));let A=this.sections.length-1;for(let x=0;x<a.text.length;++x)this.sectionIndex.push(A)}addImageSection(a){let h=a.image?a.image.name:\"\";if(h.length===0)return void Le(\"Can't add FormattedSection with an empty image.\");let A=this.getNextImageSectionCharCode();A?(this.text+=String.fromCharCode(A),this.sections.push(Ox.forImage(h)),this.sectionIndex.push(this.sections.length-1)):Le(\"Reached maximum number of images 6401\")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function US(u,a,h,A,x,E,P,D,B,V,q,Q,rt,ot,lt,pt){let xt=p_.fromFeature(u,x),Mt;Q===n.ah.vertical&&xt.verticalizePunctuation();let{processBidirectionalText:Vt,processStyledBidirectionalText:It}=vu;if(Vt&&xt.sections.length===1){Mt=[];let ue=Vt(xt.toString(),nC(xt,V,E,a,A,ot,lt));for(let Be of ue){let Ke=new p_;Ke.text=Be,Ke.sections=xt.sections;for(let Re=0;Re<Be.length;Re++)Ke.sectionIndex.push(0);Mt.push(Ke)}}else if(It){Mt=[];let ue=It(xt.text,xt.sectionIndex,nC(xt,V,E,a,A,ot,lt));for(let Be of ue){let Ke=new p_;Ke.text=Be[0],Ke.sectionIndex=Be[1],Ke.sections=xt.sections,Mt.push(Ke)}}else Mt=function(ue,Be){let Ke=[],Re=ue.text,Ie=0;for(let we of Be)Ke.push(ue.substring(Ie,we)),Ie=we;return Ie<Re.length&&Ke.push(ue.substring(Ie,Re.length)),Ke}(xt,nC(xt,V,E,a,A,ot,lt));let zt=[],ie={positionedLines:zt,text:xt.toString(),top:q[1],bottom:q[1],left:q[0],right:q[0],writingMode:Q,iconsInText:!1,verticalizable:!1};return function(ue,Be,Ke,Re,Ie,we,We,Ee,pe,cr,tr,ei){let pn=0,Pn=Dx,Ws=0,Vl=0,Va=Ee===\"right\"?1:Ee===\"left\"?0:.5,Ls=0;for(let Hs of Ie){Hs.trim();let qs=Hs.getMaxScale(),da=(qs-1)*Gs,Wa={positionedGlyphs:[],lineOffset:0};ue.positionedLines[Ls]=Wa;let pa=Wa.positionedGlyphs,pl=0;if(!Hs.length()){Pn+=we,++Ls;continue}for(let Zs=0;Zs<Hs.length();Zs++){let li=Hs.getSection(Zs),Aa=Hs.getSectionIndex(Zs),Xo=Hs.getCharCode(Zs),Ys=0,Su=null,Ah=null,mh=null,Fd=Gs,Tu=!(pe===n.ah.horizontal||!tr&&!Cd(Xo)||tr&&(VS[Xo]||(To=Xo,Ce.Arabic(To)||Ce[\"Arabic Supplement\"](To)||Ce[\"Arabic Extended-A\"](To)||Ce[\"Arabic Presentation Forms-A\"](To)||Ce[\"Arabic Presentation Forms-B\"](To))));if(li.imageName){let zc=Re[li.imageName];if(!zc)continue;mh=li.imageName,ue.iconsInText=ue.iconsInText||!0,Ah=zc.paddedRect;let ml=zc.displaySize;li.scale=li.scale*Gs/ei,Su={width:ml[0],height:ml[1],left:dl,top:-W6,advance:Tu?ml[1]:ml[0]},Ys=da+(Gs-ml[1]*li.scale),Fd=Su.advance;let zd=Tu?ml[0]*li.scale-Gs*qs:ml[1]*li.scale-Gs*qs;zd>0&&zd>pl&&(pl=zd)}else{let zc=Ke[li.fontStack],ml=zc&&zc[Xo];if(ml&&ml.rect)Ah=ml.rect,Su=ml.metrics;else{let zd=Be[li.fontStack],Ux=zd&&zd[Xo];if(!Ux)continue;Su=Ux.metrics}Ys=(qs-li.scale)*Gs}Tu?(ue.verticalizable=!0,pa.push({glyph:Xo,imageName:mh,x:pn,y:Pn+Ys,vertical:Tu,scale:li.scale,fontStack:li.fontStack,sectionIndex:Aa,metrics:Su,rect:Ah}),pn+=Fd*li.scale+cr):(pa.push({glyph:Xo,imageName:mh,x:pn,y:Pn+Ys,vertical:Tu,scale:li.scale,fontStack:li.fontStack,sectionIndex:Aa,metrics:Su,rect:Ah}),pn+=Su.advance*li.scale+cr)}pa.length!==0&&(Ws=Math.max(pn-cr,Ws),HX(pa,0,pa.length-1,Va,pl)),pn=0;let Al=we*qs+pl;Wa.lineOffset=Math.max(pl,da),Pn+=Al,Vl=Math.max(Al,Vl),++Ls}var To;let Qo=Pn-Dx,{horizontalAlign:ja,verticalAlign:Ga}=sC(We);(function(Hs,qs,da,Wa,pa,pl,Al,Zs,li){let Aa=(qs-da)*pa,Xo=0;Xo=pl!==Al?-Zs*Wa-Dx:(-Wa*li+.5)*Al;for(let Ys of Hs)for(let Su of Ys.positionedGlyphs)Su.x+=Aa,Su.y+=Xo})(ue.positionedLines,Va,ja,Ga,Ws,Vl,we,Qo,Ie.length),ue.top+=-Ga*Qo,ue.bottom=ue.top+Qo,ue.left+=-ja*Ws,ue.right=ue.left+Ws}(ie,a,h,A,Mt,P,D,B,Q,V,rt,pt),!function(ue){for(let Be of ue)if(Be.positionedGlyphs.length!==0)return!1;return!0}(zt)&&ie}let VS={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},GX={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Z6(u,a,h,A,x,E){if(a.imageName){let P=A[a.imageName];return P?P.displaySize[0]*a.scale*Gs/E+x:0}{let P=h[a.fontStack],D=P&&P[u];return D?D.metrics.advance*a.scale+x:0}}function Y6(u,a,h,A){let x=Math.pow(u-a,2);return A?u<a?x/2:2*x:x+Math.abs(h)*h}function WX(u,a,h){let A=0;return u===10&&(A-=1e4),h&&(A+=150),u!==40&&u!==65288||(A+=50),a!==41&&a!==65289||(A+=50),A}function $6(u,a,h,A,x,E){let P=null,D=Y6(a,h,x,E);for(let B of A){let V=Y6(a-B.x,h,x,E)+B.badness;V<=D&&(P=B,D=V)}return{index:u,x:a,priorBreak:P,badness:D}}function Q6(u){return u?Q6(u.priorBreak).concat(u.index):[]}function nC(u,a,h,A,x,E,P){if(E!==\"point\")return[];if(!u)return[];let D=[],B=function(rt,ot,lt,pt,xt,Mt){let Vt=0;for(let It=0;It<rt.length();It++){let zt=rt.getSection(It);Vt+=Z6(rt.getCharCode(It),zt,pt,xt,ot,Mt)}return Vt/Math.max(1,Math.ceil(Vt/lt))}(u,a,h,A,x,P),V=u.text.indexOf(\"\\u200B\")>=0,q=0;for(let rt=0;rt<u.length();rt++){let ot=u.getSection(rt),lt=u.getCharCode(rt);if(VS[lt]||(q+=Z6(lt,ot,A,x,a,P)),rt<u.length()-1){let pt=!((Q=lt)<11904||!(Ce[\"Bopomofo Extended\"](Q)||Ce.Bopomofo(Q)||Ce[\"CJK Compatibility Forms\"](Q)||Ce[\"CJK Compatibility Ideographs\"](Q)||Ce[\"CJK Compatibility\"](Q)||Ce[\"CJK Radicals Supplement\"](Q)||Ce[\"CJK Strokes\"](Q)||Ce[\"CJK Symbols and Punctuation\"](Q)||Ce[\"CJK Unified Ideographs Extension A\"](Q)||Ce[\"CJK Unified Ideographs\"](Q)||Ce[\"Enclosed CJK Letters and Months\"](Q)||Ce[\"Halfwidth and Fullwidth Forms\"](Q)||Ce.Hiragana(Q)||Ce[\"Ideographic Description Characters\"](Q)||Ce[\"Kangxi Radicals\"](Q)||Ce[\"Katakana Phonetic Extensions\"](Q)||Ce.Katakana(Q)||Ce[\"Vertical Forms\"](Q)||Ce[\"Yi Radicals\"](Q)||Ce[\"Yi Syllables\"](Q)));(GX[lt]||pt||ot.imageName)&&D.push($6(rt+1,q,B,D,WX(lt,u.getCharCode(rt+1),pt&&V),!1))}}var Q;return Q6($6(u.length(),q,B,D,0,!0))}function sC(u){let a=.5,h=.5;switch(u){case\"right\":case\"top-right\":case\"bottom-right\":a=1;break;case\"left\":case\"top-left\":case\"bottom-left\":a=0}switch(u){case\"bottom\":case\"bottom-right\":case\"bottom-left\":h=1;break;case\"top\":case\"top-right\":case\"top-left\":h=0}return{horizontalAlign:a,verticalAlign:h}}function HX(u,a,h,A,x){if(!A&&!x)return;let E=u[h],P=(u[h].x+E.metrics.advance*E.scale)*A;for(let D=a;D<=h;D++)u[D].x-=P,u[D].y+=x}function qX(u,a,h){let{horizontalAlign:A,verticalAlign:x}=sC(h),E=a[0]-u.displaySize[0]*A,P=a[1]-u.displaySize[1]*x;return{image:u,top:P,bottom:P+u.displaySize[1],left:E,right:E+u.displaySize[0]}}function X6(u,a,h,A,x,E){let P=u.image,D;if(P.content){let xt=P.content,Mt=P.pixelRatio||1;D=[xt[0]/Mt,xt[1]/Mt,P.displaySize[0]-xt[2]/Mt,P.displaySize[1]-xt[3]/Mt]}let B=a.left*E,V=a.right*E,q,Q,rt,ot;h===\"width\"||h===\"both\"?(ot=x[0]+B-A[3],Q=x[0]+V+A[1]):(ot=x[0]+(B+V-P.displaySize[0])/2,Q=ot+P.displaySize[0]);let lt=a.top*E,pt=a.bottom*E;return h===\"height\"||h===\"both\"?(q=x[1]+lt-A[0],rt=x[1]+pt+A[2]):(q=x[1]+(lt+pt-P.displaySize[1])/2,rt=q+P.displaySize[1]),{image:P,top:q,right:Q,bottom:rt,left:ot,collisionPadding:D}}let Bx=255,Rf=128,hA=Bx*Rf;function K6(u,a){let{expression:h}=a;if(h.kind===\"constant\")return{kind:\"constant\",layoutSize:h.evaluate(new ki(u+1))};if(h.kind===\"source\")return{kind:\"source\"};{let{zoomStops:A,interpolationType:x}=h,E=0;for(;E<A.length&&A[E]<=u;)E++;E=Math.max(0,E-1);let P=E;for(;P<A.length&&A[P]<u+1;)P++;P=Math.min(A.length-1,P);let D=A[E],B=A[P];return h.kind===\"composite\"?{kind:\"composite\",minZoom:D,maxZoom:B,interpolationType:x}:{kind:\"camera\",minZoom:D,maxZoom:B,minSize:h.evaluate(new ki(D)),maxSize:h.evaluate(new ki(B)),interpolationType:x}}}function oC(u,a,h){let A=\"never\",x=u.get(a);return x?A=x:u.get(h)&&(A=\"always\"),A}let ZX=cA.VectorTileFeature.types,YX=[{name:\"a_fade_opacity\",components:1,type:\"Uint8\",offset:0}];function jS(u,a,h,A,x,E,P,D,B,V,q,Q,rt){let ot=D?Math.min(hA,Math.round(D[0])):0,lt=D?Math.min(hA,Math.round(D[1])):0;u.emplaceBack(a,h,Math.round(32*A),Math.round(32*x),E,P,(ot<<1)+(B?1:0),lt,16*V,16*q,256*Q,256*rt)}function aC(u,a,h){u.emplaceBack(a.x,a.y,h),u.emplaceBack(a.x,a.y,h),u.emplaceBack(a.x,a.y,h),u.emplaceBack(a.x,a.y,h)}function $X(u){for(let a of u.sections)if(Km(a.text))return!0;return!1}class lC{constructor(a){this.layoutVertexArray=new St,this.indexArray=new he,this.programConfigurations=a,this.segments=new ur,this.dynamicLayoutVertexArray=new Nt,this.opacityVertexArray=new Zt,this.hasVisibleVertices=!1,this.placedSymbolArray=new v}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(a,h,A,x){this.isEmpty()||(A&&(this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,MX.members),this.indexBuffer=a.createIndexBuffer(this.indexArray,h),this.dynamicLayoutVertexBuffer=a.createVertexBuffer(this.dynamicLayoutVertexArray,EX.members,!0),this.opacityVertexBuffer=a.createVertexBuffer(this.opacityVertexArray,YX,!0),this.opacityVertexBuffer.itemSize=1),(A||x)&&this.programConfigurations.upload(a))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Fe(\"SymbolBuffers\",lC);class cC{constructor(a,h,A){this.layoutVertexArray=new a,this.layoutAttributes=h,this.indexArray=new A,this.segments=new ur,this.collisionVertexArray=new ne}upload(a){this.layoutVertexBuffer=a.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=a.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=a.createVertexBuffer(this.collisionVertexArray,PX.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Fe(\"CollisionBuffers\",cC);class A_{constructor(a){this.collisionBoxArray=a.collisionBoxArray,this.zoom=a.zoom,this.overscaling=a.overscaling,this.layers=a.layers,this.layerIds=this.layers.map(P=>P.id),this.index=a.index,this.pixelRatio=a.pixelRatio,this.sourceLayerIndex=a.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Se([]),this.placementViewportMatrix=Se([]);let h=this.layers[0]._unevaluatedLayout._values;this.textSizeData=K6(this.zoom,h[\"text-size\"]),this.iconSizeData=K6(this.zoom,h[\"icon-size\"]);let A=this.layers[0].layout,x=A.get(\"symbol-sort-key\"),E=A.get(\"symbol-z-order\");this.canOverlap=oC(A,\"text-overlap\",\"text-allow-overlap\")!==\"never\"||oC(A,\"icon-overlap\",\"icon-allow-overlap\")!==\"never\"||A.get(\"text-ignore-placement\")||A.get(\"icon-ignore-placement\"),this.sortFeaturesByKey=E!==\"viewport-y\"&&!x.isConstant(),this.sortFeaturesByY=(E===\"viewport-y\"||E===\"auto\"&&!this.sortFeaturesByKey)&&this.canOverlap,A.get(\"symbol-placement\")===\"point\"&&(this.writingModes=A.get(\"text-writing-mode\").map(P=>n.ah[P])),this.stateDependentLayerIds=this.layers.filter(P=>P.isStateDependent()).map(P=>P.id),this.sourceID=a.sourceID}createArrays(){this.text=new lC(new Cs(this.layers,this.zoom,a=>/^text/.test(a))),this.icon=new lC(new Cs(this.layers,this.zoom,a=>/^icon/.test(a))),this.glyphOffsetArray=new O,this.lineVertexArray=new F,this.symbolInstances=new M,this.textAnchorOffsets=new W}calculateGlyphDependencies(a,h,A,x,E){for(let P=0;P<a.length;P++)if(h[a.charCodeAt(P)]=!0,(A||x)&&E){let D=Rx[a.charAt(P)];D&&(h[D.charCodeAt(0)]=!0)}}populate(a,h,A){let x=this.layers[0],E=x.layout,P=E.get(\"text-font\"),D=E.get(\"text-field\"),B=E.get(\"icon-image\"),V=(D.value.kind!==\"constant\"||D.value.value instanceof Gn&&!D.value.value.isEmpty()||D.value.value.toString().length>0)&&(P.value.kind!==\"constant\"||P.value.value.length>0),q=B.value.kind!==\"constant\"||!!B.value.value||Object.keys(B.parameters).length>0,Q=E.get(\"symbol-sort-key\");if(this.features=[],!V&&!q)return;let rt=h.iconDependencies,ot=h.glyphDependencies,lt=h.availableImages,pt=new ki(this.zoom);for(let{feature:xt,id:Mt,index:Vt,sourceLayerIndex:It}of a){let zt=x._featureFilter.needGeometry,ie=wu(xt,zt);if(!x._featureFilter.filter(pt,ie,A))continue;let ue,Be;if(zt||(ie.geometry=De(xt)),V){let Re=x.getValueAndResolveTokens(\"text-field\",ie,A,lt),Ie=Gn.factory(Re);$X(Ie)&&(this.hasRTLText=!0),(!this.hasRTLText||vu.getRTLTextPluginStatus()===\"unavailable\"||this.hasRTLText&&vu.isParsed())&&(ue=CX(Ie,x,ie))}if(q){let Re=x.getValueAndResolveTokens(\"icon-image\",ie,A,lt);Be=Re instanceof Wn?Re:Wn.fromString(Re)}if(!ue&&!Be)continue;let Ke=this.sortFeaturesByKey?Q.evaluate(ie,{},A):void 0;if(this.features.push({id:Mt,text:ue,icon:Be,index:Vt,sourceLayerIndex:It,geometry:ie.geometry,properties:xt.properties,type:ZX[xt.type],sortKey:Ke}),Be&&(rt[Be.name]=!0),ue){let Re=P.evaluate(ie,{},A).join(\",\"),Ie=E.get(\"text-rotation-alignment\")!==\"viewport\"&&E.get(\"symbol-placement\")!==\"point\";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(n.ah.vertical)>=0;for(let we of ue.sections)if(we.image)rt[we.image.name]=!0;else{let We=iA(ue.toString()),Ee=we.fontStack||Re,pe=ot[Ee]=ot[Ee]||{};this.calculateGlyphDependencies(we.text,pe,Ie,this.allowVerticalPlacement,We)}}}E.get(\"symbol-placement\")===\"line\"&&(this.features=function(xt){let Mt={},Vt={},It=[],zt=0;function ie(Re){It.push(xt[Re]),zt++}function ue(Re,Ie,we){let We=Vt[Re];return delete Vt[Re],Vt[Ie]=We,It[We].geometry[0].pop(),It[We].geometry[0]=It[We].geometry[0].concat(we[0]),We}function Be(Re,Ie,we){let We=Mt[Ie];return delete Mt[Ie],Mt[Re]=We,It[We].geometry[0].shift(),It[We].geometry[0]=we[0].concat(It[We].geometry[0]),We}function Ke(Re,Ie,we){let We=we?Ie[0][Ie[0].length-1]:Ie[0][0];return`${Re}:${We.x}:${We.y}`}for(let Re=0;Re<xt.length;Re++){let Ie=xt[Re],we=Ie.geometry,We=Ie.text?Ie.text.toString():null;if(!We){ie(Re);continue}let Ee=Ke(We,we),pe=Ke(We,we,!0);if(Ee in Vt&&pe in Mt&&Vt[Ee]!==Mt[pe]){let cr=Be(Ee,pe,we),tr=ue(Ee,pe,It[cr].geometry);delete Mt[Ee],delete Vt[pe],Vt[Ke(We,It[tr].geometry,!0)]=tr,It[cr].geometry=null}else Ee in Vt?ue(Ee,pe,we):pe in Mt?Be(Ee,pe,we):(ie(Re),Mt[Ee]=zt-1,Vt[pe]=zt-1)}return It.filter(Re=>Re.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((xt,Mt)=>xt.sortKey-Mt.sortKey)}update(a,h,A){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(a,h,this.layers,A),this.icon.programConfigurations.updatePaintArrays(a,h,this.layers,A))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(a){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(a),this.iconCollisionBox.upload(a)),this.text.upload(a,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(a,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(a,h){let A=this.lineVertexArray.length;if(a.segment!==void 0){let x=a.dist(h[a.segment+1]),E=a.dist(h[a.segment]),P={};for(let D=a.segment+1;D<h.length;D++)P[D]={x:h[D].x,y:h[D].y,tileUnitDistanceFromAnchor:x},D<h.length-1&&(x+=h[D+1].dist(h[D]));for(let D=a.segment||0;D>=0;D--)P[D]={x:h[D].x,y:h[D].y,tileUnitDistanceFromAnchor:E},D>0&&(E+=h[D-1].dist(h[D]));for(let D=0;D<h.length;D++){let B=P[D];this.lineVertexArray.emplaceBack(B.x,B.y,B.tileUnitDistanceFromAnchor)}}return{lineStartIndex:A,lineLength:this.lineVertexArray.length-A}}addSymbols(a,h,A,x,E,P,D,B,V,q,Q,rt){let ot=a.indexArray,lt=a.layoutVertexArray,pt=a.segments.prepareSegment(4*h.length,lt,ot,this.canOverlap?P.sortKey:void 0),xt=this.glyphOffsetArray.length,Mt=pt.vertexLength,Vt=this.allowVerticalPlacement&&D===n.ah.vertical?Math.PI/2:0,It=P.text&&P.text.sections;for(let zt=0;zt<h.length;zt++){let{tl:ie,tr:ue,bl:Be,br:Ke,tex:Re,pixelOffsetTL:Ie,pixelOffsetBR:we,minFontScaleX:We,minFontScaleY:Ee,glyphOffset:pe,isSDF:cr,sectionIndex:tr}=h[zt],ei=pt.vertexLength,pn=pe[1];jS(lt,B.x,B.y,ie.x,pn+ie.y,Re.x,Re.y,A,cr,Ie.x,Ie.y,We,Ee),jS(lt,B.x,B.y,ue.x,pn+ue.y,Re.x+Re.w,Re.y,A,cr,we.x,Ie.y,We,Ee),jS(lt,B.x,B.y,Be.x,pn+Be.y,Re.x,Re.y+Re.h,A,cr,Ie.x,we.y,We,Ee),jS(lt,B.x,B.y,Ke.x,pn+Ke.y,Re.x+Re.w,Re.y+Re.h,A,cr,we.x,we.y,We,Ee),aC(a.dynamicLayoutVertexArray,B,Vt),ot.emplaceBack(ei,ei+1,ei+2),ot.emplaceBack(ei+1,ei+2,ei+3),pt.vertexLength+=4,pt.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(pe[0]),zt!==h.length-1&&tr===h[zt+1].sectionIndex||a.programConfigurations.populatePaintArrays(lt.length,P,P.index,{},rt,It&&It[tr])}a.placedSymbolArray.emplaceBack(B.x,B.y,xt,this.glyphOffsetArray.length-xt,Mt,V,q,B.segment,A?A[0]:0,A?A[1]:0,x[0],x[1],D,0,!1,0,Q)}_addCollisionDebugVertex(a,h,A,x,E,P){return h.emplaceBack(0,0),a.emplaceBack(A.x,A.y,x,E,Math.round(P.x),Math.round(P.y))}addCollisionDebugVertices(a,h,A,x,E,P,D){let B=E.segments.prepareSegment(4,E.layoutVertexArray,E.indexArray),V=B.vertexLength,q=E.layoutVertexArray,Q=E.collisionVertexArray,rt=D.anchorX,ot=D.anchorY;this._addCollisionDebugVertex(q,Q,P,rt,ot,new _(a,h)),this._addCollisionDebugVertex(q,Q,P,rt,ot,new _(A,h)),this._addCollisionDebugVertex(q,Q,P,rt,ot,new _(A,x)),this._addCollisionDebugVertex(q,Q,P,rt,ot,new _(a,x)),B.vertexLength+=4;let lt=E.indexArray;lt.emplaceBack(V,V+1),lt.emplaceBack(V+1,V+2),lt.emplaceBack(V+2,V+3),lt.emplaceBack(V+3,V),B.primitiveLength+=4}addDebugCollisionBoxes(a,h,A,x){for(let E=a;E<h;E++){let P=this.collisionBoxArray.get(E);this.addCollisionDebugVertices(P.x1,P.y1,P.x2,P.y2,x?this.textCollisionBox:this.iconCollisionBox,P.anchorPoint,A)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new cC(Ht,B6.members,ce),this.iconCollisionBox=new cC(Ht,B6.members,ce);for(let a=0;a<this.symbolInstances.length;a++){let h=this.symbolInstances.get(a);this.addDebugCollisionBoxes(h.textBoxStartIndex,h.textBoxEndIndex,h,!0),this.addDebugCollisionBoxes(h.verticalTextBoxStartIndex,h.verticalTextBoxEndIndex,h,!0),this.addDebugCollisionBoxes(h.iconBoxStartIndex,h.iconBoxEndIndex,h,!1),this.addDebugCollisionBoxes(h.verticalIconBoxStartIndex,h.verticalIconBoxEndIndex,h,!1)}}_deserializeCollisionBoxesForSymbol(a,h,A,x,E,P,D,B,V){let q={};for(let Q=h;Q<A;Q++){let rt=a.get(Q);q.textBox={x1:rt.x1,y1:rt.y1,x2:rt.x2,y2:rt.y2,anchorPointX:rt.anchorPointX,anchorPointY:rt.anchorPointY},q.textFeatureIndex=rt.featureIndex;break}for(let Q=x;Q<E;Q++){let rt=a.get(Q);q.verticalTextBox={x1:rt.x1,y1:rt.y1,x2:rt.x2,y2:rt.y2,anchorPointX:rt.anchorPointX,anchorPointY:rt.anchorPointY},q.verticalTextFeatureIndex=rt.featureIndex;break}for(let Q=P;Q<D;Q++){let rt=a.get(Q);q.iconBox={x1:rt.x1,y1:rt.y1,x2:rt.x2,y2:rt.y2,anchorPointX:rt.anchorPointX,anchorPointY:rt.anchorPointY},q.iconFeatureIndex=rt.featureIndex;break}for(let Q=B;Q<V;Q++){let rt=a.get(Q);q.verticalIconBox={x1:rt.x1,y1:rt.y1,x2:rt.x2,y2:rt.y2,anchorPointX:rt.anchorPointX,anchorPointY:rt.anchorPointY},q.verticalIconFeatureIndex=rt.featureIndex;break}return q}deserializeCollisionBoxes(a){this.collisionArrays=[];for(let h=0;h<this.symbolInstances.length;h++){let A=this.symbolInstances.get(h);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(a,A.textBoxStartIndex,A.textBoxEndIndex,A.verticalTextBoxStartIndex,A.verticalTextBoxEndIndex,A.iconBoxStartIndex,A.iconBoxEndIndex,A.verticalIconBoxStartIndex,A.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(a,h){let A=a.placedSymbolArray.get(h),x=A.vertexStartIndex+4*A.numGlyphs;for(let E=A.vertexStartIndex;E<x;E+=4)a.indexArray.emplaceBack(E,E+1,E+2),a.indexArray.emplaceBack(E+1,E+2,E+3)}getSortedSymbolIndexes(a){if(this.sortedAngle===a&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let h=Math.sin(a),A=Math.cos(a),x=[],E=[],P=[];for(let D=0;D<this.symbolInstances.length;++D){P.push(D);let B=this.symbolInstances.get(D);x.push(0|Math.round(h*B.anchorX+A*B.anchorY)),E.push(B.featureIndex)}return P.sort((D,B)=>x[D]-x[B]||E[B]-E[D]),P}addToSortKeyRanges(a,h){let A=this.sortKeyRanges[this.sortKeyRanges.length-1];A&&A.sortKey===h?A.symbolInstanceEnd=a+1:this.sortKeyRanges.push({sortKey:h,symbolInstanceStart:a,symbolInstanceEnd:a+1})}sortFeatures(a){if(this.sortFeaturesByY&&this.sortedAngle!==a&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(a),this.sortedAngle=a,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let h of this.symbolInstanceIndexes){let A=this.symbolInstances.get(h);this.featureSortOrder.push(A.featureIndex),[A.rightJustifiedTextSymbolIndex,A.centerJustifiedTextSymbolIndex,A.leftJustifiedTextSymbolIndex].forEach((x,E,P)=>{x>=0&&P.indexOf(x)===E&&this.addIndicesForPlacedSymbol(this.text,x)}),A.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,A.verticalPlacedTextSymbolIndex),A.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,A.placedIconSymbolIndex),A.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,A.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let J6,tF;Fe(\"SymbolBucket\",A_,{omit:[\"layers\",\"collisionBoxArray\",\"features\",\"compareText\"]}),A_.MAX_GLYPHS=65535,A_.addDynamicAttributes=aC;var uC={get paint(){return tF=tF||new wo({\"icon-opacity\":new fr(Jt.paint_symbol[\"icon-opacity\"]),\"icon-color\":new fr(Jt.paint_symbol[\"icon-color\"]),\"icon-halo-color\":new fr(Jt.paint_symbol[\"icon-halo-color\"]),\"icon-halo-width\":new fr(Jt.paint_symbol[\"icon-halo-width\"]),\"icon-halo-blur\":new fr(Jt.paint_symbol[\"icon-halo-blur\"]),\"icon-translate\":new Qe(Jt.paint_symbol[\"icon-translate\"]),\"icon-translate-anchor\":new Qe(Jt.paint_symbol[\"icon-translate-anchor\"]),\"text-opacity\":new fr(Jt.paint_symbol[\"text-opacity\"]),\"text-color\":new fr(Jt.paint_symbol[\"text-color\"],{runtimeType:Cn,getOverride:u=>u.textColor,hasOverride:u=>!!u.textColor}),\"text-halo-color\":new fr(Jt.paint_symbol[\"text-halo-color\"]),\"text-halo-width\":new fr(Jt.paint_symbol[\"text-halo-width\"]),\"text-halo-blur\":new fr(Jt.paint_symbol[\"text-halo-blur\"]),\"text-translate\":new Qe(Jt.paint_symbol[\"text-translate\"]),\"text-translate-anchor\":new Qe(Jt.paint_symbol[\"text-translate-anchor\"])})},get layout(){return J6=J6||new wo({\"symbol-placement\":new Qe(Jt.layout_symbol[\"symbol-placement\"]),\"symbol-spacing\":new Qe(Jt.layout_symbol[\"symbol-spacing\"]),\"symbol-avoid-edges\":new Qe(Jt.layout_symbol[\"symbol-avoid-edges\"]),\"symbol-sort-key\":new fr(Jt.layout_symbol[\"symbol-sort-key\"]),\"symbol-z-order\":new Qe(Jt.layout_symbol[\"symbol-z-order\"]),\"icon-allow-overlap\":new Qe(Jt.layout_symbol[\"icon-allow-overlap\"]),\"icon-overlap\":new Qe(Jt.layout_symbol[\"icon-overlap\"]),\"icon-ignore-placement\":new Qe(Jt.layout_symbol[\"icon-ignore-placement\"]),\"icon-optional\":new Qe(Jt.layout_symbol[\"icon-optional\"]),\"icon-rotation-alignment\":new Qe(Jt.layout_symbol[\"icon-rotation-alignment\"]),\"icon-size\":new fr(Jt.layout_symbol[\"icon-size\"]),\"icon-text-fit\":new Qe(Jt.layout_symbol[\"icon-text-fit\"]),\"icon-text-fit-padding\":new Qe(Jt.layout_symbol[\"icon-text-fit-padding\"]),\"icon-image\":new fr(Jt.layout_symbol[\"icon-image\"]),\"icon-rotate\":new fr(Jt.layout_symbol[\"icon-rotate\"]),\"icon-padding\":new fr(Jt.layout_symbol[\"icon-padding\"]),\"icon-keep-upright\":new Qe(Jt.layout_symbol[\"icon-keep-upright\"]),\"icon-offset\":new fr(Jt.layout_symbol[\"icon-offset\"]),\"icon-anchor\":new fr(Jt.layout_symbol[\"icon-anchor\"]),\"icon-pitch-alignment\":new Qe(Jt.layout_symbol[\"icon-pitch-alignment\"]),\"text-pitch-alignment\":new Qe(Jt.layout_symbol[\"text-pitch-alignment\"]),\"text-rotation-alignment\":new Qe(Jt.layout_symbol[\"text-rotation-alignment\"]),\"text-field\":new fr(Jt.layout_symbol[\"text-field\"]),\"text-font\":new fr(Jt.layout_symbol[\"text-font\"]),\"text-size\":new fr(Jt.layout_symbol[\"text-size\"]),\"text-max-width\":new fr(Jt.layout_symbol[\"text-max-width\"]),\"text-line-height\":new Qe(Jt.layout_symbol[\"text-line-height\"]),\"text-letter-spacing\":new fr(Jt.layout_symbol[\"text-letter-spacing\"]),\"text-justify\":new fr(Jt.layout_symbol[\"text-justify\"]),\"text-radial-offset\":new fr(Jt.layout_symbol[\"text-radial-offset\"]),\"text-variable-anchor\":new Qe(Jt.layout_symbol[\"text-variable-anchor\"]),\"text-variable-anchor-offset\":new fr(Jt.layout_symbol[\"text-variable-anchor-offset\"]),\"text-anchor\":new fr(Jt.layout_symbol[\"text-anchor\"]),\"text-max-angle\":new Qe(Jt.layout_symbol[\"text-max-angle\"]),\"text-writing-mode\":new Qe(Jt.layout_symbol[\"text-writing-mode\"]),\"text-rotate\":new fr(Jt.layout_symbol[\"text-rotate\"]),\"text-padding\":new Qe(Jt.layout_symbol[\"text-padding\"]),\"text-keep-upright\":new Qe(Jt.layout_symbol[\"text-keep-upright\"]),\"text-transform\":new fr(Jt.layout_symbol[\"text-transform\"]),\"text-offset\":new fr(Jt.layout_symbol[\"text-offset\"]),\"text-allow-overlap\":new Qe(Jt.layout_symbol[\"text-allow-overlap\"]),\"text-overlap\":new Qe(Jt.layout_symbol[\"text-overlap\"]),\"text-ignore-placement\":new Qe(Jt.layout_symbol[\"text-ignore-placement\"]),\"text-optional\":new Qe(Jt.layout_symbol[\"text-optional\"])})}};class eF{constructor(a){if(a.property.overrides===void 0)throw new Error(\"overrides must be provided to instantiate FormatSectionOverride class\");this.type=a.property.overrides?a.property.overrides.runtimeType:ts,this.defaultValue=a}evaluate(a){if(a.formattedSection){let h=this.defaultValue.property.overrides;if(h&&h.hasOverride(a.formattedSection))return h.getOverride(a.formattedSection)}return a.feature&&a.featureState?this.defaultValue.evaluate(a.feature,a.featureState):this.defaultValue.property.specification.default}eachChild(a){this.defaultValue.isConstant()||a(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Fe(\"FormatSectionOverride\",eF,{omit:[\"defaultValue\"]});class GS extends cl{constructor(a){super(a,uC)}recalculate(a,h){if(super.recalculate(a,h),this.layout.get(\"icon-rotation-alignment\")===\"auto\"&&(this.layout._values[\"icon-rotation-alignment\"]=this.layout.get(\"symbol-placement\")!==\"point\"?\"map\":\"viewport\"),this.layout.get(\"text-rotation-alignment\")===\"auto\"&&(this.layout._values[\"text-rotation-alignment\"]=this.layout.get(\"symbol-placement\")!==\"point\"?\"map\":\"viewport\"),this.layout.get(\"text-pitch-alignment\")===\"auto\"&&(this.layout._values[\"text-pitch-alignment\"]=this.layout.get(\"text-rotation-alignment\")===\"map\"?\"map\":\"viewport\"),this.layout.get(\"icon-pitch-alignment\")===\"auto\"&&(this.layout._values[\"icon-pitch-alignment\"]=this.layout.get(\"icon-rotation-alignment\")),this.layout.get(\"symbol-placement\")===\"point\"){let A=this.layout.get(\"text-writing-mode\");if(A){let x=[];for(let E of A)x.indexOf(E)<0&&x.push(E);this.layout._values[\"text-writing-mode\"]=x}else this.layout._values[\"text-writing-mode\"]=[\"horizontal\"]}this._setPaintOverrides()}getValueAndResolveTokens(a,h,A,x){let E=this.layout.get(a).evaluate(h,{},A,x),P=this._unevaluatedLayout._values[a];return P.isDataDriven()||Ni(P.value)||!E?E:function(D,B){return B.replace(/{([^{}]+)}/g,(V,q)=>D&&q in D?String(D[q]):\"\")}(h.properties,E)}createBucket(a){return new A_(a)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error(\"Should take a different path in FeatureIndex\")}_setPaintOverrides(){for(let a of uC.paint.overridableProperties){if(!GS.hasPaintOverride(this.layout,a))continue;let h=this.paint.get(a),A=new eF(h),x=new en(A,h.property.specification),E=null;E=h.value.kind===\"constant\"||h.value.kind===\"source\"?new wt(\"source\",x):new qm(\"composite\",x,h.value.zoomStops),this.paint._values[a]=new ll(h.property,E,h.parameters)}}_handleOverridablePaintPropertyUpdate(a,h,A){return!(!this.layout||h.isDataDriven()||A.isDataDriven())&&GS.hasPaintOverride(this.layout,a)}static hasPaintOverride(a,h){let A=a.get(\"text-field\"),x=uC.paint.properties[h],E=!1,P=D=>{for(let B of D)if(x.overrides&&x.overrides.hasOverride(B))return void(E=!0)};if(A.value.kind===\"constant\"&&A.value.value instanceof Gn)P(A.value.value.sections);else if(A.value.kind===\"source\"){let D=V=>{E||(V instanceof Ra&&hn(V.value)===jn?P(V.value.sections):V instanceof bt?P(V.sections):V.eachChild(D))},B=A.value;B._styleExpression&&D(B._styleExpression.expression)}return E}}let rF;var QX={get paint(){return rF=rF||new wo({\"background-color\":new Qe(Jt.paint_background[\"background-color\"]),\"background-pattern\":new xu(Jt.paint_background[\"background-pattern\"]),\"background-opacity\":new Qe(Jt.paint_background[\"background-opacity\"])})}};class XX extends cl{constructor(a){super(a,QX)}}let iF;var KX={get paint(){return iF=iF||new wo({\"raster-opacity\":new Qe(Jt.paint_raster[\"raster-opacity\"]),\"raster-hue-rotate\":new Qe(Jt.paint_raster[\"raster-hue-rotate\"]),\"raster-brightness-min\":new Qe(Jt.paint_raster[\"raster-brightness-min\"]),\"raster-brightness-max\":new Qe(Jt.paint_raster[\"raster-brightness-max\"]),\"raster-saturation\":new Qe(Jt.paint_raster[\"raster-saturation\"]),\"raster-contrast\":new Qe(Jt.paint_raster[\"raster-contrast\"]),\"raster-resampling\":new Qe(Jt.paint_raster[\"raster-resampling\"]),\"raster-fade-duration\":new Qe(Jt.paint_raster[\"raster-fade-duration\"])})}};class JX extends cl{constructor(a){super(a,KX)}}class tK extends cl{constructor(a){super(a,{}),this.onAdd=h=>{this.implementation.onAdd&&this.implementation.onAdd(h,h.painter.context.gl)},this.onRemove=h=>{this.implementation.onRemove&&this.implementation.onRemove(h,h.painter.context.gl)},this.implementation=a}is3D(){return this.implementation.renderingMode===\"3d\"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error(\"Custom layers cannot be serialized\")}}class eK{constructor(a){this._methodToThrottle=a,this._triggered=!1,typeof MessageChannel<\"u\"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let hC=63710088e-1;class fA{constructor(a,h){if(isNaN(a)||isNaN(h))throw new Error(`Invalid LngLat object: (${a}, ${h})`);if(this.lng=+a,this.lat=+h,this.lat>90||this.lat<-90)throw new Error(\"Invalid LngLat latitude value: must be between -90 and 90\")}wrap(){return new fA(ht(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(a){let h=Math.PI/180,A=this.lat*h,x=a.lat*h,E=Math.sin(A)*Math.sin(x)+Math.cos(A)*Math.cos(x)*Math.cos((a.lng-this.lng)*h);return hC*Math.acos(Math.min(E,1))}static convert(a){if(a instanceof fA)return a;if(Array.isArray(a)&&(a.length===2||a.length===3))return new fA(Number(a[0]),Number(a[1]));if(!Array.isArray(a)&&typeof a==\"object\"&&a!==null)return new fA(Number(\"lng\"in a?a.lng:a.lon),Number(a.lat));throw new Error(\"`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]\")}}let nF=2*Math.PI*hC;function sF(u){return nF*Math.cos(u*Math.PI/180)}function oF(u){return(180+u)/360}function aF(u){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+u*Math.PI/360)))/360}function lF(u,a){return u/sF(a)}function fC(u){return 360/Math.PI*Math.atan(Math.exp((180-360*u)*Math.PI/180))-90}class WS{constructor(a,h,A=0){this.x=+a,this.y=+h,this.z=+A}static fromLngLat(a,h=0){let A=fA.convert(a);return new WS(oF(A.lng),aF(A.lat),lF(h,A.lat))}toLngLat(){return new fA(360*this.x-180,fC(this.y))}toAltitude(){return this.z*sF(fC(this.y))}meterInMercatorCoordinateUnits(){return 1/nF*(a=fC(this.y),1/Math.cos(a*Math.PI/180));var a}}function cF(u,a,h){var A=2*Math.PI*6378137/256/Math.pow(2,h);return[u*A-2*Math.PI*6378137/2,a*A-2*Math.PI*6378137/2]}class dC{constructor(a,h,A){if(a<0||a>25||A<0||A>=Math.pow(2,a)||h<0||h>=Math.pow(2,a))throw new Error(`x=${h}, y=${A}, z=${a} outside of bounds. 0<=x<${Math.pow(2,a)}, 0<=y<${Math.pow(2,a)} 0<=z<=25 `);this.z=a,this.x=h,this.y=A,this.key=Fx(0,a,a,h,A)}equals(a){return this.z===a.z&&this.x===a.x&&this.y===a.y}url(a,h,A){let x=(P=this.y,D=this.z,B=cF(256*(E=this.x),256*(P=Math.pow(2,D)-P-1),D),V=cF(256*(E+1),256*(P+1),D),B[0]+\",\"+B[1]+\",\"+V[0]+\",\"+V[1]);var E,P,D,B,V;let q=function(Q,rt,ot){let lt,pt=\"\";for(let xt=Q;xt>0;xt--)lt=1<<xt-1,pt+=(rt&lt?1:0)+(ot&lt?2:0);return pt}(this.z,this.x,this.y);return a[(this.x+this.y)%a.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(A===\"tms\"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,h>1?\"@2x\":\"\").replace(/{quadkey}/g,q).replace(/{bbox-epsg-3857}/g,x)}isChildOf(a){let h=this.z-a.z;return h>0&&a.x===this.x>>h&&a.y===this.y>>h}getTilePoint(a){let h=Math.pow(2,this.z);return new _((a.x*h-this.x)*Bn,(a.y*h-this.y)*Bn)}toString(){return`${this.z}/${this.x}/${this.y}`}}class uF{constructor(a,h){this.wrap=a,this.canonical=h,this.key=Fx(a,h.z,h.z,h.x,h.y)}}class Fc{constructor(a,h,A,x,E){if(a<A)throw new Error(`overscaledZ should be >= z; overscaledZ = ${a}; z = ${A}`);this.overscaledZ=a,this.wrap=h,this.canonical=new dC(A,+x,+E),this.key=Fx(h,a,A,x,E)}clone(){return new Fc(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(a){return this.overscaledZ===a.overscaledZ&&this.wrap===a.wrap&&this.canonical.equals(a.canonical)}scaledTo(a){if(a>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${a}; overscaledZ = ${this.overscaledZ}`);let h=this.canonical.z-a;return a>this.canonical.z?new Fc(a,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Fc(a,this.wrap,a,this.canonical.x>>h,this.canonical.y>>h)}calculateScaledKey(a,h){if(a>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${a}; overscaledZ = ${this.overscaledZ}`);let A=this.canonical.z-a;return a>this.canonical.z?Fx(this.wrap*+h,a,this.canonical.z,this.canonical.x,this.canonical.y):Fx(this.wrap*+h,a,a,this.canonical.x>>A,this.canonical.y>>A)}isChildOf(a){if(a.wrap!==this.wrap)return!1;let h=this.canonical.z-a.canonical.z;return a.overscaledZ===0||a.overscaledZ<this.overscaledZ&&a.canonical.x===this.canonical.x>>h&&a.canonical.y===this.canonical.y>>h}children(a){if(this.overscaledZ>=a)return[new Fc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let h=this.canonical.z+1,A=2*this.canonical.x,x=2*this.canonical.y;return[new Fc(h,this.wrap,h,A,x),new Fc(h,this.wrap,h,A+1,x),new Fc(h,this.wrap,h,A,x+1),new Fc(h,this.wrap,h,A+1,x+1)]}isLessThan(a){return this.wrap<a.wrap||!(this.wrap>a.wrap)&&(this.overscaledZ<a.overscaledZ||!(this.overscaledZ>a.overscaledZ)&&(this.canonical.x<a.canonical.x||!(this.canonical.x>a.canonical.x)&&this.canonical.y<a.canonical.y))}wrapped(){return new Fc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(a){return new Fc(this.overscaledZ,a,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new uF(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(a){return this.canonical.getTilePoint(new WS(a.x-this.wrap,a.y))}}function Fx(u,a,h,A,x){(u*=2)<0&&(u=-1*u-1);let E=1<<h;return(E*E*u+E*x+A).toString(36)+h.toString(36)+a.toString(36)}Fe(\"CanonicalTileID\",dC),Fe(\"OverscaledTileID\",Fc,{omit:[\"posMatrix\"]});class hF{constructor(a,h,A,x=1,E=1,P=1,D=0){if(this.uid=a,h.height!==h.width)throw new RangeError(\"DEM tiles must be square\");if(A&&![\"mapbox\",\"terrarium\",\"custom\"].includes(A))return void Le(`\"${A}\" is not a valid encoding type. Valid types include \"mapbox\", \"terrarium\" and \"custom\".`);this.stride=h.height;let B=this.dim=h.height-2;switch(this.data=new Uint32Array(h.data.buffer),A){case\"terrarium\":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case\"custom\":this.redFactor=x,this.greenFactor=E,this.blueFactor=P,this.baseShift=D;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let V=0;V<B;V++)this.data[this._idx(-1,V)]=this.data[this._idx(0,V)],this.data[this._idx(B,V)]=this.data[this._idx(B-1,V)],this.data[this._idx(V,-1)]=this.data[this._idx(V,0)],this.data[this._idx(V,B)]=this.data[this._idx(V,B-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(B,-1)]=this.data[this._idx(B-1,0)],this.data[this._idx(-1,B)]=this.data[this._idx(0,B-1)],this.data[this._idx(B,B)]=this.data[this._idx(B-1,B-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let V=0;V<B;V++)for(let q=0;q<B;q++){let Q=this.get(V,q);Q>this.max&&(this.max=Q),Q<this.min&&(this.min=Q)}}get(a,h){let A=new Uint8Array(this.data.buffer),x=4*this._idx(a,h);return this.unpack(A[x],A[x+1],A[x+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(a,h){if(a<-1||a>=this.dim+1||h<-1||h>=this.dim+1)throw new RangeError(\"out of range source coordinates for DEM data\");return(h+1)*this.stride+(a+1)}unpack(a,h,A){return a*this.redFactor+h*this.greenFactor+A*this.blueFactor-this.baseShift}getPixels(){return new fi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(a,h,A){if(this.dim!==a.dim)throw new Error(\"dem dimension mismatch\");let x=h*this.dim,E=h*this.dim+this.dim,P=A*this.dim,D=A*this.dim+this.dim;switch(h){case-1:x=E-1;break;case 1:E=x+1}switch(A){case-1:P=D-1;break;case 1:D=P+1}let B=-h*this.dim,V=-A*this.dim;for(let q=P;q<D;q++)for(let Q=x;Q<E;Q++)this.data[this._idx(Q,q)]=a.data[this._idx(Q+B,q+V)]}}Fe(\"DEMData\",hF);class fF{constructor(a){this._stringToNumber={},this._numberToString=[];for(let h=0;h<a.length;h++){let A=a[h];this._stringToNumber[A]=h,this._numberToString[h]=A}}encode(a){return this._stringToNumber[a]}decode(a){if(a>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${a} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[a]}}class dF{constructor(a,h,A,x,E){this.type=\"Feature\",this._vectorTileFeature=a,a._z=h,a._x=A,a._y=x,this.properties=a.properties,this.id=E}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(a){this._geometry=a}toJSON(){let a={geometry:this.geometry};for(let h in this)h!==\"_geometry\"&&h!==\"_vectorTileFeature\"&&(a[h]=this[h]);return a}}class pF{constructor(a,h){this.tileID=a,this.x=a.canonical.x,this.y=a.canonical.y,this.z=a.canonical.z,this.grid=new _u(Bn,16,0),this.grid3D=new _u(Bn,16,0),this.featureIndexArray=new X,this.promoteId=h}insert(a,h,A,x,E,P){let D=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(A,x,E);let B=P?this.grid3D:this.grid;for(let V=0;V<h.length;V++){let q=h[V],Q=[1/0,1/0,-1/0,-1/0];for(let rt=0;rt<q.length;rt++){let ot=q[rt];Q[0]=Math.min(Q[0],ot.x),Q[1]=Math.min(Q[1],ot.y),Q[2]=Math.max(Q[2],ot.x),Q[3]=Math.max(Q[3],ot.y)}Q[0]<Bn&&Q[1]<Bn&&Q[2]>=0&&Q[3]>=0&&B.insert(D,Q[0],Q[1],Q[2],Q[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new cA.VectorTile(new eC(this.rawTileData)).layers,this.sourceLayerCoder=new fF(this.vtLayers?Object.keys(this.vtLayers).sort():[\"_geojsonTileLayer\"])),this.vtLayers}query(a,h,A,x){this.loadVTLayers();let E=a.params||{},P=Bn/a.tileSize/a.scale,D=Pd(E.filter),B=a.queryGeometry,V=a.queryPadding*P,q=mF(B),Q=this.grid.query(q.minX-V,q.minY-V,q.maxX+V,q.maxY+V),rt=mF(a.cameraQueryGeometry),ot=this.grid3D.query(rt.minX-V,rt.minY-V,rt.maxX+V,rt.maxY+V,(xt,Mt,Vt,It)=>function(zt,ie,ue,Be,Ke){for(let Ie of zt)if(ie<=Ie.x&&ue<=Ie.y&&Be>=Ie.x&&Ke>=Ie.y)return!0;let Re=[new _(ie,ue),new _(ie,Ke),new _(Be,Ke),new _(Be,ue)];if(zt.length>2){for(let Ie of Re)if(L(zt,Ie))return!0}for(let Ie=0;Ie<zt.length-1;Ie++)if(z(zt[Ie],zt[Ie+1],Re))return!0;return!1}(a.cameraQueryGeometry,xt-V,Mt-V,Vt+V,It+V));for(let xt of ot)Q.push(xt);Q.sort(rK);let lt={},pt;for(let xt=0;xt<Q.length;xt++){let Mt=Q[xt];if(Mt===pt)continue;pt=Mt;let Vt=this.featureIndexArray.get(Mt),It=null;this.loadMatchingFeature(lt,Vt.bucketIndex,Vt.sourceLayerIndex,Vt.featureIndex,D,E.layers,E.availableImages,h,A,x,(zt,ie,ue)=>(It||(It=De(zt)),ie.queryIntersectsFeature(B,zt,ue,It,this.z,a.transform,P,a.pixelPosMatrix)))}return lt}loadMatchingFeature(a,h,A,x,E,P,D,B,V,q,Q){let rt=this.bucketLayerIDs[h];if(P&&!function(xt,Mt){for(let Vt=0;Vt<xt.length;Vt++)if(Mt.indexOf(xt[Vt])>=0)return!0;return!1}(P,rt))return;let ot=this.sourceLayerCoder.decode(A),lt=this.vtLayers[ot].feature(x);if(E.needGeometry){let xt=wu(lt,!0);if(!E.filter(new ki(this.tileID.overscaledZ),xt,this.tileID.canonical))return}else if(!E.filter(new ki(this.tileID.overscaledZ),lt))return;let pt=this.getId(lt,ot);for(let xt=0;xt<rt.length;xt++){let Mt=rt[xt];if(P&&P.indexOf(Mt)<0)continue;let Vt=B[Mt];if(!Vt)continue;let It={};pt&&q&&(It=q.getState(Vt.sourceLayer||\"_geojsonTileLayer\",pt));let zt=Tt({},V[Mt]);zt.paint=AF(zt.paint,Vt.paint,lt,It,D),zt.layout=AF(zt.layout,Vt.layout,lt,It,D);let ie=!Q||Q(lt,Vt,It);if(!ie)continue;let ue=new dF(lt,this.z,this.x,this.y,pt);ue.layer=zt;let Be=a[Mt];Be===void 0&&(Be=a[Mt]=[]),Be.push({featureIndex:x,feature:ue,intersectionZ:ie})}}lookupSymbolFeatures(a,h,A,x,E,P,D,B){let V={};this.loadVTLayers();let q=Pd(E);for(let Q of a)this.loadMatchingFeature(V,A,x,Q,q,P,D,B,h);return V}hasLayer(a){for(let h of this.bucketLayerIDs)for(let A of h)if(a===A)return!0;return!1}getId(a,h){let A=a.id;return this.promoteId&&(A=a.properties[typeof this.promoteId==\"string\"?this.promoteId:this.promoteId[h]],typeof A==\"boolean\"&&(A=Number(A))),A}}function AF(u,a,h,A,x){return Yt(u,(E,P)=>{let D=a instanceof kd?a.get(P):null;return D&&D.evaluate?D.evaluate(h,A,x):D})}function mF(u){let a=1/0,h=1/0,A=-1/0,x=-1/0;for(let E of u)a=Math.min(a,E.x),h=Math.min(h,E.y),A=Math.max(A,E.x),x=Math.max(x,E.y);return{minX:a,minY:h,maxX:A,maxY:x}}function rK(u,a){return a-u}function gF(u,a,h,A,x){let E=[];for(let P=0;P<u.length;P++){let D=u[P],B;for(let V=0;V<D.length-1;V++){let q=D[V],Q=D[V+1];q.x<a&&Q.x<a||(q.x<a?q=new _(a,q.y+(a-q.x)/(Q.x-q.x)*(Q.y-q.y))._round():Q.x<a&&(Q=new _(a,q.y+(a-q.x)/(Q.x-q.x)*(Q.y-q.y))._round()),q.y<h&&Q.y<h||(q.y<h?q=new _(q.x+(h-q.y)/(Q.y-q.y)*(Q.x-q.x),h)._round():Q.y<h&&(Q=new _(q.x+(h-q.y)/(Q.y-q.y)*(Q.x-q.x),h)._round()),q.x>=A&&Q.x>=A||(q.x>=A?q=new _(A,q.y+(A-q.x)/(Q.x-q.x)*(Q.y-q.y))._round():Q.x>=A&&(Q=new _(A,q.y+(A-q.x)/(Q.x-q.x)*(Q.y-q.y))._round()),q.y>=x&&Q.y>=x||(q.y>=x?q=new _(q.x+(x-q.y)/(Q.y-q.y)*(Q.x-q.x),x)._round():Q.y>=x&&(Q=new _(q.x+(x-q.y)/(Q.y-q.y)*(Q.x-q.x),x)._round()),B&&q.equals(B[B.length-1])||(B=[q],E.push(B)),B.push(Q)))))}}return E}Fe(\"FeatureIndex\",pF,{omit:[\"rawTileData\",\"sourceLayerCoder\"]});class dA extends _{constructor(a,h,A,x){super(a,h),this.angle=A,x!==void 0&&(this.segment=x)}clone(){return new dA(this.x,this.y,this.angle,this.segment)}}function _F(u,a,h,A,x){if(a.segment===void 0||h===0)return!0;let E=a,P=a.segment+1,D=0;for(;D>-h/2;){if(P--,P<0)return!1;D-=u[P].dist(E),E=u[P]}D+=u[P].dist(u[P+1]),P++;let B=[],V=0;for(;D<h/2;){let q=u[P],Q=u[P+1];if(!Q)return!1;let rt=u[P-1].angleTo(q)-q.angleTo(Q);for(rt=Math.abs((rt+3*Math.PI)%(2*Math.PI)-Math.PI),B.push({distance:D,angleDelta:rt}),V+=rt;D-B[0].distance>A;)V-=B.shift().angleDelta;if(V>x)return!1;P++,D+=q.dist(Q)}return!0}function yF(u){let a=0;for(let h=0;h<u.length-1;h++)a+=u[h].dist(u[h+1]);return a}function vF(u,a,h){return u?.6*a*h:0}function xF(u,a){return Math.max(u?u.right-u.left:0,a?a.right-a.left:0)}function iK(u,a,h,A,x,E){let P=vF(h,x,E),D=xF(h,A)*E,B=0,V=yF(u)/2;for(let q=0;q<u.length-1;q++){let Q=u[q],rt=u[q+1],ot=Q.dist(rt);if(B+ot>V){let lt=(V-B)/ot,pt=Zo.number(Q.x,rt.x,lt),xt=Zo.number(Q.y,rt.y,lt),Mt=new dA(pt,xt,rt.angleTo(Q),q);return Mt._round(),!P||_F(u,Mt,D,P,a)?Mt:void 0}B+=ot}}function nK(u,a,h,A,x,E,P,D,B){let V=vF(A,E,P),q=xF(A,x),Q=q*P,rt=u[0].x===0||u[0].x===B||u[0].y===0||u[0].y===B;return a-Q<a/4&&(a=Q+a/4),bF(u,rt?a/2*D%a:(q/2+2*E)*P*D%a,a,V,h,Q,rt,!1,B)}function bF(u,a,h,A,x,E,P,D,B){let V=E/2,q=yF(u),Q=0,rt=a-h,ot=[];for(let lt=0;lt<u.length-1;lt++){let pt=u[lt],xt=u[lt+1],Mt=pt.dist(xt),Vt=xt.angleTo(pt);for(;rt+h<Q+Mt;){rt+=h;let It=(rt-Q)/Mt,zt=Zo.number(pt.x,xt.x,It),ie=Zo.number(pt.y,xt.y,It);if(zt>=0&&zt<B&&ie>=0&&ie<B&&rt-V>=0&&rt+V<=q){let ue=new dA(zt,ie,Vt,lt);ue._round(),A&&!_F(u,ue,E,A,x)||ot.push(ue)}}Q+=Mt}return D||ot.length||P||(ot=bF(u,Q/2,h,A,x,E,P,!0,B)),ot}Fe(\"Anchor\",dA);let m_=dl;function wF(u,a,h,A){let x=[],E=u.image,P=E.pixelRatio,D=E.paddedRect.w-2*m_,B=E.paddedRect.h-2*m_,V=u.right-u.left,q=u.bottom-u.top,Q=E.stretchX||[[0,D]],rt=E.stretchY||[[0,B]],ot=(we,We)=>we+We[1]-We[0],lt=Q.reduce(ot,0),pt=rt.reduce(ot,0),xt=D-lt,Mt=B-pt,Vt=0,It=lt,zt=0,ie=pt,ue=0,Be=xt,Ke=0,Re=Mt;if(E.content&&A){let we=E.content;Vt=HS(Q,0,we[0]),zt=HS(rt,0,we[1]),It=HS(Q,we[0],we[2]),ie=HS(rt,we[1],we[3]),ue=we[0]-Vt,Ke=we[1]-zt,Be=we[2]-we[0]-It,Re=we[3]-we[1]-ie}let Ie=(we,We,Ee,pe)=>{let cr=qS(we.stretch-Vt,It,V,u.left),tr=ZS(we.fixed-ue,Be,we.stretch,lt),ei=qS(We.stretch-zt,ie,q,u.top),pn=ZS(We.fixed-Ke,Re,We.stretch,pt),Pn=qS(Ee.stretch-Vt,It,V,u.left),Ws=ZS(Ee.fixed-ue,Be,Ee.stretch,lt),Vl=qS(pe.stretch-zt,ie,q,u.top),Va=ZS(pe.fixed-Ke,Re,pe.stretch,pt),Ls=new _(cr,ei),To=new _(Pn,ei),Qo=new _(Pn,Vl),ja=new _(cr,Vl),Ga=new _(tr/P,pn/P),Hs=new _(Ws/P,Va/P),qs=a*Math.PI/180;if(qs){let pa=Math.sin(qs),pl=Math.cos(qs),Al=[pl,-pa,pa,pl];Ls._matMult(Al),To._matMult(Al),ja._matMult(Al),Qo._matMult(Al)}let da=we.stretch+we.fixed,Wa=We.stretch+We.fixed;return{tl:Ls,tr:To,bl:ja,br:Qo,tex:{x:E.paddedRect.x+m_+da,y:E.paddedRect.y+m_+Wa,w:Ee.stretch+Ee.fixed-da,h:pe.stretch+pe.fixed-Wa},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Ga,pixelOffsetBR:Hs,minFontScaleX:Be/P/V,minFontScaleY:Re/P/q,isSDF:h}};if(A&&(E.stretchX||E.stretchY)){let we=SF(Q,xt,lt),We=SF(rt,Mt,pt);for(let Ee=0;Ee<we.length-1;Ee++){let pe=we[Ee],cr=we[Ee+1];for(let tr=0;tr<We.length-1;tr++)x.push(Ie(pe,We[tr],cr,We[tr+1]))}}else x.push(Ie({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:D+1},{fixed:0,stretch:B+1}));return x}function HS(u,a,h){let A=0;for(let x of u)A+=Math.max(a,Math.min(h,x[1]))-Math.max(a,Math.min(h,x[0]));return A}function SF(u,a,h){let A=[{fixed:-m_,stretch:0}];for(let[x,E]of u){let P=A[A.length-1];A.push({fixed:x-P.stretch,stretch:P.stretch}),A.push({fixed:x-P.stretch,stretch:P.stretch+(E-x)})}return A.push({fixed:a+m_,stretch:h}),A}function qS(u,a,h,A){return u/a*h+A}function ZS(u,a,h,A){return u-a*h/A}class YS{constructor(a,h,A,x,E,P,D,B,V,q){if(this.boxStartIndex=a.length,V){let Q=P.top,rt=P.bottom,ot=P.collisionPadding;ot&&(Q-=ot[1],rt+=ot[3]);let lt=rt-Q;lt>0&&(lt=Math.max(10,lt),this.circleDiameter=lt)}else{let Q=P.top*D-B[0],rt=P.bottom*D+B[2],ot=P.left*D-B[3],lt=P.right*D+B[1],pt=P.collisionPadding;if(pt&&(ot-=pt[0]*D,Q-=pt[1]*D,lt+=pt[2]*D,rt+=pt[3]*D),q){let xt=new _(ot,Q),Mt=new _(lt,Q),Vt=new _(ot,rt),It=new _(lt,rt),zt=q*Math.PI/180;xt._rotate(zt),Mt._rotate(zt),Vt._rotate(zt),It._rotate(zt),ot=Math.min(xt.x,Mt.x,Vt.x,It.x),lt=Math.max(xt.x,Mt.x,Vt.x,It.x),Q=Math.min(xt.y,Mt.y,Vt.y,It.y),rt=Math.max(xt.y,Mt.y,Vt.y,It.y)}a.emplaceBack(h.x,h.y,ot,Q,lt,rt,A,x,E)}this.boxEndIndex=a.length}}class sK{constructor(a=[],h=oK){if(this.data=a,this.length=this.data.length,this.compare=h,this.length>0)for(let A=(this.length>>1)-1;A>=0;A--)this._down(A)}push(a){this.data.push(a),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let a=this.data[0],h=this.data.pop();return this.length--,this.length>0&&(this.data[0]=h,this._down(0)),a}peek(){return this.data[0]}_up(a){let{data:h,compare:A}=this,x=h[a];for(;a>0;){let E=a-1>>1,P=h[E];if(A(x,P)>=0)break;h[a]=P,a=E}h[a]=x}_down(a){let{data:h,compare:A}=this,x=this.length>>1,E=h[a];for(;a<x;){let P=1+(a<<1),D=h[P],B=P+1;if(B<this.length&&A(h[B],D)<0&&(P=B,D=h[B]),A(D,E)>=0)break;h[a]=D,a=P}h[a]=E}}function oK(u,a){return u<a?-1:u>a?1:0}function aK(u,a=1,h=!1){let A=1/0,x=1/0,E=-1/0,P=-1/0,D=u[0];for(let ot=0;ot<D.length;ot++){let lt=D[ot];(!ot||lt.x<A)&&(A=lt.x),(!ot||lt.y<x)&&(x=lt.y),(!ot||lt.x>E)&&(E=lt.x),(!ot||lt.y>P)&&(P=lt.y)}let B=Math.min(E-A,P-x),V=B/2,q=new sK([],lK);if(B===0)return new _(A,x);for(let ot=A;ot<E;ot+=B)for(let lt=x;lt<P;lt+=B)q.push(new g_(ot+V,lt+V,V,u));let Q=function(ot){let lt=0,pt=0,xt=0,Mt=ot[0];for(let Vt=0,It=Mt.length,zt=It-1;Vt<It;zt=Vt++){let ie=Mt[Vt],ue=Mt[zt],Be=ie.x*ue.y-ue.x*ie.y;pt+=(ie.x+ue.x)*Be,xt+=(ie.y+ue.y)*Be,lt+=3*Be}return new g_(pt/lt,xt/lt,0,ot)}(u),rt=q.length;for(;q.length;){let ot=q.pop();(ot.d>Q.d||!Q.d)&&(Q=ot,h&&console.log(\"found best %d after %d probes\",Math.round(1e4*ot.d)/1e4,rt)),ot.max-Q.d<=a||(V=ot.h/2,q.push(new g_(ot.p.x-V,ot.p.y-V,V,u)),q.push(new g_(ot.p.x+V,ot.p.y-V,V,u)),q.push(new g_(ot.p.x-V,ot.p.y+V,V,u)),q.push(new g_(ot.p.x+V,ot.p.y+V,V,u)),rt+=4)}return h&&(console.log(`num probes: ${rt}`),console.log(`best distance: ${Q.d}`)),Q.p}function lK(u,a){return a.max-u.max}function g_(u,a,h,A){this.p=new _(u,a),this.h=h,this.d=function(x,E){let P=!1,D=1/0;for(let B=0;B<E.length;B++){let V=E[B];for(let q=0,Q=V.length,rt=Q-1;q<Q;rt=q++){let ot=V[q],lt=V[rt];ot.y>x.y!=lt.y>x.y&&x.x<(lt.x-ot.x)*(x.y-ot.y)/(lt.y-ot.y)+ot.x&&(P=!P),D=Math.min(D,C(x,ot,lt))}}return(P?1:-1)*Math.sqrt(D)}(this.p,A),this.max=this.d+this.h*Math.SQRT2}var $o;n.ap=void 0,($o=n.ap||(n.ap={}))[$o.center=1]=\"center\",$o[$o.left=2]=\"left\",$o[$o.right=3]=\"right\",$o[$o.top=4]=\"top\",$o[$o.bottom=5]=\"bottom\",$o[$o[\"top-left\"]=6]=\"top-left\",$o[$o[\"top-right\"]=7]=\"top-right\",$o[$o[\"bottom-left\"]=8]=\"bottom-left\",$o[$o[\"bottom-right\"]=9]=\"bottom-right\";let pA=7,pC=Number.POSITIVE_INFINITY;function TF(u,a){return a[1]!==pC?function(h,A,x){let E=0,P=0;switch(A=Math.abs(A),x=Math.abs(x),h){case\"top-right\":case\"top-left\":case\"top\":P=x-pA;break;case\"bottom-right\":case\"bottom-left\":case\"bottom\":P=-x+pA}switch(h){case\"top-right\":case\"bottom-right\":case\"right\":E=-A;break;case\"top-left\":case\"bottom-left\":case\"left\":E=A}return[E,P]}(u,a[0],a[1]):function(h,A){let x=0,E=0;A<0&&(A=0);let P=A/Math.SQRT2;switch(h){case\"top-right\":case\"top-left\":E=P-pA;break;case\"bottom-right\":case\"bottom-left\":E=-P+pA;break;case\"bottom\":E=-A+pA;break;case\"top\":E=A-pA}switch(h){case\"top-right\":case\"bottom-right\":x=-P;break;case\"top-left\":case\"bottom-left\":x=P;break;case\"left\":x=A;break;case\"right\":x=-A}return[x,E]}(u,a[0])}function MF(u,a,h){var A;let x=u.layout,E=(A=x.get(\"text-variable-anchor-offset\"))===null||A===void 0?void 0:A.evaluate(a,{},h);if(E){let D=E.values,B=[];for(let V=0;V<D.length;V+=2){let q=B[V]=D[V],Q=D[V+1].map(rt=>rt*Gs);q.startsWith(\"top\")?Q[1]-=pA:q.startsWith(\"bottom\")&&(Q[1]+=pA),B[V+1]=Q}return new kn(B)}let P=x.get(\"text-variable-anchor\");if(P){let D;D=u._unevaluatedLayout.getValue(\"text-radial-offset\")!==void 0?[x.get(\"text-radial-offset\").evaluate(a,{},h)*Gs,pC]:x.get(\"text-offset\").evaluate(a,{},h).map(V=>V*Gs);let B=[];for(let V of P)B.push(V,TF(V,D));return new kn(B)}return null}function AC(u){switch(u){case\"right\":case\"top-right\":case\"bottom-right\":return\"right\";case\"left\":case\"top-left\":case\"bottom-left\":return\"left\"}return\"center\"}function cK(u,a,h,A,x,E,P,D,B,V,q){let Q=E.textMaxSize.evaluate(a,{});Q===void 0&&(Q=P);let rt=u.layers[0].layout,ot=rt.get(\"icon-offset\").evaluate(a,{},q),lt=PF(h.horizontal),pt=P/24,xt=u.tilePixelRatio*pt,Mt=u.tilePixelRatio*Q/24,Vt=u.tilePixelRatio*D,It=u.tilePixelRatio*rt.get(\"symbol-spacing\"),zt=rt.get(\"text-padding\")*u.tilePixelRatio,ie=function(pe,cr,tr,ei=1){let pn=pe.get(\"icon-padding\").evaluate(cr,{},tr),Pn=pn&&pn.values;return[Pn[0]*ei,Pn[1]*ei,Pn[2]*ei,Pn[3]*ei]}(rt,a,q,u.tilePixelRatio),ue=rt.get(\"text-max-angle\")/180*Math.PI,Be=rt.get(\"text-rotation-alignment\")!==\"viewport\"&&rt.get(\"symbol-placement\")!==\"point\",Ke=rt.get(\"icon-rotation-alignment\")===\"map\"&&rt.get(\"symbol-placement\")!==\"point\",Re=rt.get(\"symbol-placement\"),Ie=It/2,we=rt.get(\"icon-text-fit\"),We;A&&we!==\"none\"&&(u.allowVerticalPlacement&&h.vertical&&(We=X6(A,h.vertical,we,rt.get(\"icon-text-fit-padding\"),ot,pt)),lt&&(A=X6(A,lt,we,rt.get(\"icon-text-fit-padding\"),ot,pt)));let Ee=(pe,cr)=>{cr.x<0||cr.x>=Bn||cr.y<0||cr.y>=Bn||function(tr,ei,pn,Pn,Ws,Vl,Va,Ls,To,Qo,ja,Ga,Hs,qs,da,Wa,pa,pl,Al,Zs,li,Aa,Xo,Ys,Su){let Ah=tr.addToLineVertexArray(ei,pn),mh,Fd,Tu,zc,ml=0,zd=0,Ux=0,kF=0,wC=-1,SC=-1,Nd={},RF=Dr(\"\");if(tr.allowVerticalPlacement&&Pn.vertical){let ma=Ls.layout.get(\"text-rotate\").evaluate(li,{},Ys)+90;Tu=new YS(To,ei,Qo,ja,Ga,Pn.vertical,Hs,qs,da,ma),Va&&(zc=new YS(To,ei,Qo,ja,Ga,Va,pa,pl,da,ma))}if(Ws){let ma=Ls.layout.get(\"icon-rotate\").evaluate(li,{}),Nc=Ls.layout.get(\"icon-text-fit\")!==\"none\",c0=wF(Ws,ma,Xo,Nc),_h=Va?wF(Va,ma,Xo,Nc):void 0;Fd=new YS(To,ei,Qo,ja,Ga,Ws,pa,pl,!1,ma),ml=4*c0.length;let u0=tr.iconSizeData,Df=null;u0.kind===\"source\"?(Df=[Rf*Ls.layout.get(\"icon-size\").evaluate(li,{})],Df[0]>hA&&Le(`${tr.layerIds[0]}: Value for \"icon-size\" is >= ${Bx}. Reduce your \"icon-size\".`)):u0.kind===\"composite\"&&(Df=[Rf*Aa.compositeIconSizes[0].evaluate(li,{},Ys),Rf*Aa.compositeIconSizes[1].evaluate(li,{},Ys)],(Df[0]>hA||Df[1]>hA)&&Le(`${tr.layerIds[0]}: Value for \"icon-size\" is >= ${Bx}. Reduce your \"icon-size\".`)),tr.addSymbols(tr.icon,c0,Df,Zs,Al,li,n.ah.none,ei,Ah.lineStartIndex,Ah.lineLength,-1,Ys),wC=tr.icon.placedSymbolArray.length-1,_h&&(zd=4*_h.length,tr.addSymbols(tr.icon,_h,Df,Zs,Al,li,n.ah.vertical,ei,Ah.lineStartIndex,Ah.lineLength,-1,Ys),SC=tr.icon.placedSymbolArray.length-1)}let DF=Object.keys(Pn.horizontal);for(let ma of DF){let Nc=Pn.horizontal[ma];if(!mh){RF=Dr(Nc.text);let _h=Ls.layout.get(\"text-rotate\").evaluate(li,{},Ys);mh=new YS(To,ei,Qo,ja,Ga,Nc,Hs,qs,da,_h)}let c0=Nc.positionedLines.length===1;if(Ux+=EF(tr,ei,Nc,Vl,Ls,da,li,Wa,Ah,Pn.vertical?n.ah.horizontal:n.ah.horizontalOnly,c0?DF:[ma],Nd,wC,Aa,Ys),c0)break}Pn.vertical&&(kF+=EF(tr,ei,Pn.vertical,Vl,Ls,da,li,Wa,Ah,n.ah.vertical,[\"vertical\"],Nd,SC,Aa,Ys));let fK=mh?mh.boxStartIndex:tr.collisionBoxArray.length,dK=mh?mh.boxEndIndex:tr.collisionBoxArray.length,pK=Tu?Tu.boxStartIndex:tr.collisionBoxArray.length,AK=Tu?Tu.boxEndIndex:tr.collisionBoxArray.length,mK=Fd?Fd.boxStartIndex:tr.collisionBoxArray.length,gK=Fd?Fd.boxEndIndex:tr.collisionBoxArray.length,_K=zc?zc.boxStartIndex:tr.collisionBoxArray.length,yK=zc?zc.boxEndIndex:tr.collisionBoxArray.length,gh=-1,QS=(ma,Nc)=>ma&&ma.circleDiameter?Math.max(ma.circleDiameter,Nc):Nc;gh=QS(mh,gh),gh=QS(Tu,gh),gh=QS(Fd,gh),gh=QS(zc,gh);let OF=gh>-1?1:0;OF&&(gh*=Su/Gs),tr.glyphOffsetArray.length>=A_.MAX_GLYPHS&&Le(\"Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907\"),li.sortKey!==void 0&&tr.addToSortKeyRanges(tr.symbolInstances.length,li.sortKey);let vK=MF(Ls,li,Ys),[xK,bK]=function(ma,Nc){let c0=ma.length,_h=Nc?.values;if(_h?.length>0)for(let u0=0;u0<_h.length;u0+=2){let Df=_h[u0+1];ma.emplaceBack(n.ap[_h[u0]],Df[0],Df[1])}return[c0,ma.length]}(tr.textAnchorOffsets,vK);tr.symbolInstances.emplaceBack(ei.x,ei.y,Nd.right>=0?Nd.right:-1,Nd.center>=0?Nd.center:-1,Nd.left>=0?Nd.left:-1,Nd.vertical||-1,wC,SC,RF,fK,dK,pK,AK,mK,gK,_K,yK,Qo,Ux,kF,ml,zd,OF,0,Hs,gh,xK,bK)}(u,cr,pe,h,A,x,We,u.layers[0],u.collisionBoxArray,a.index,a.sourceLayerIndex,u.index,xt,[zt,zt,zt,zt],Be,B,Vt,ie,Ke,ot,a,E,V,q,P)};if(Re===\"line\")for(let pe of gF(a.geometry,0,0,Bn,Bn)){let cr=nK(pe,It,ue,h.vertical||lt,A,24,Mt,u.overscaling,Bn);for(let tr of cr)lt&&uK(u,lt.text,Ie,tr)||Ee(pe,tr)}else if(Re===\"line-center\"){for(let pe of a.geometry)if(pe.length>1){let cr=iK(pe,ue,h.vertical||lt,A,24,Mt);cr&&Ee(pe,cr)}}else if(a.type===\"Polygon\")for(let pe of ZI(a.geometry,0)){let cr=aK(pe,16);Ee(pe[0],new dA(cr.x,cr.y,0))}else if(a.type===\"LineString\")for(let pe of a.geometry)Ee(pe,new dA(pe[0].x,pe[0].y,0));else if(a.type===\"Point\")for(let pe of a.geometry)for(let cr of pe)Ee([cr],new dA(cr.x,cr.y,0))}function EF(u,a,h,A,x,E,P,D,B,V,q,Q,rt,ot,lt){let pt=function(Vt,It,zt,ie,ue,Be,Ke,Re){let Ie=ie.layout.get(\"text-rotate\").evaluate(Be,{})*Math.PI/180,we=[];for(let We of It.positionedLines)for(let Ee of We.positionedGlyphs){if(!Ee.rect)continue;let pe=Ee.rect||{},cr=W6+1,tr=!0,ei=1,pn=0,Pn=(ue||Re)&&Ee.vertical,Ws=Ee.metrics.advance*Ee.scale/2;if(Re&&It.verticalizable&&(pn=We.lineOffset/2-(Ee.imageName?-(Gs-Ee.metrics.width*Ee.scale)/2:(Ee.scale-1)*Gs)),Ee.imageName){let Zs=Ke[Ee.imageName];tr=Zs.sdf,ei=Zs.pixelRatio,cr=dl/ei}let Vl=ue?[Ee.x+Ws,Ee.y]:[0,0],Va=ue?[0,0]:[Ee.x+Ws+zt[0],Ee.y+zt[1]-pn],Ls=[0,0];Pn&&(Ls=Va,Va=[0,0]);let To=Ee.metrics.isDoubleResolution?2:1,Qo=(Ee.metrics.left-cr)*Ee.scale-Ws+Va[0],ja=(-Ee.metrics.top-cr)*Ee.scale+Va[1],Ga=Qo+pe.w/To*Ee.scale/ei,Hs=ja+pe.h/To*Ee.scale/ei,qs=new _(Qo,ja),da=new _(Ga,ja),Wa=new _(Qo,Hs),pa=new _(Ga,Hs);if(Pn){let Zs=new _(-Ws,Ws-Dx),li=-Math.PI/2,Aa=Gs/2-Ws,Xo=new _(5-Dx-Aa,-(Ee.imageName?Aa:0)),Ys=new _(...Ls);qs._rotateAround(li,Zs)._add(Xo)._add(Ys),da._rotateAround(li,Zs)._add(Xo)._add(Ys),Wa._rotateAround(li,Zs)._add(Xo)._add(Ys),pa._rotateAround(li,Zs)._add(Xo)._add(Ys)}if(Ie){let Zs=Math.sin(Ie),li=Math.cos(Ie),Aa=[li,-Zs,Zs,li];qs._matMult(Aa),da._matMult(Aa),Wa._matMult(Aa),pa._matMult(Aa)}let pl=new _(0,0),Al=new _(0,0);we.push({tl:qs,tr:da,bl:Wa,br:pa,tex:pe,writingMode:It.writingMode,glyphOffset:Vl,sectionIndex:Ee.sectionIndex,isSDF:tr,pixelOffsetTL:pl,pixelOffsetBR:Al,minFontScaleX:0,minFontScaleY:0})}return we}(0,h,D,x,E,P,A,u.allowVerticalPlacement),xt=u.textSizeData,Mt=null;xt.kind===\"source\"?(Mt=[Rf*x.layout.get(\"text-size\").evaluate(P,{})],Mt[0]>hA&&Le(`${u.layerIds[0]}: Value for \"text-size\" is >= ${Bx}. Reduce your \"text-size\".`)):xt.kind===\"composite\"&&(Mt=[Rf*ot.compositeTextSizes[0].evaluate(P,{},lt),Rf*ot.compositeTextSizes[1].evaluate(P,{},lt)],(Mt[0]>hA||Mt[1]>hA)&&Le(`${u.layerIds[0]}: Value for \"text-size\" is >= ${Bx}. Reduce your \"text-size\".`)),u.addSymbols(u.text,pt,Mt,D,E,P,V,a,B.lineStartIndex,B.lineLength,rt,lt);for(let Vt of q)Q[Vt]=u.text.placedSymbolArray.length-1;return 4*pt.length}function PF(u){for(let a in u)return u[a];return null}function uK(u,a,h,A){let x=u.compareText;if(a in x){let E=x[a];for(let P=E.length-1;P>=0;P--)if(A.dist(E[P])<h)return!0}else x[a]=[];return x[a].push(A),!1}let IF=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class mC{static from(a){if(!(a instanceof ArrayBuffer))throw new Error(\"Data must be an instance of ArrayBuffer.\");let[h,A]=new Uint8Array(a,0,2);if(h!==219)throw new Error(\"Data does not appear to be in a KDBush format.\");let x=A>>4;if(x!==1)throw new Error(`Got v${x} data when expected v1.`);let E=IF[15&A];if(!E)throw new Error(\"Unrecognized array type.\");let[P]=new Uint16Array(a,2,1),[D]=new Uint32Array(a,4,1);return new mC(D,P,E,a)}constructor(a,h=64,A=Float64Array,x){if(isNaN(a)||a<0)throw new Error(`Unpexpected numItems value: ${a}.`);this.numItems=+a,this.nodeSize=Math.min(Math.max(+h,2),65535),this.ArrayType=A,this.IndexArrayType=a<65536?Uint16Array:Uint32Array;let E=IF.indexOf(this.ArrayType),P=2*a*this.ArrayType.BYTES_PER_ELEMENT,D=a*this.IndexArrayType.BYTES_PER_ELEMENT,B=(8-D%8)%8;if(E<0)throw new Error(`Unexpected typed array class: ${A}.`);x&&x instanceof ArrayBuffer?(this.data=x,this.ids=new this.IndexArrayType(this.data,8,a),this.coords=new this.ArrayType(this.data,8+D+B,2*a),this._pos=2*a,this._finished=!0):(this.data=new ArrayBuffer(8+P+D+B),this.ids=new this.IndexArrayType(this.data,8,a),this.coords=new this.ArrayType(this.data,8+D+B,2*a),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+E]),new Uint16Array(this.data,2,1)[0]=h,new Uint32Array(this.data,4,1)[0]=a)}add(a,h){let A=this._pos>>1;return this.ids[A]=A,this.coords[this._pos++]=a,this.coords[this._pos++]=h,A}finish(){let a=this._pos>>1;if(a!==this.numItems)throw new Error(`Added ${a} items when expected ${this.numItems}.`);return gC(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(a,h,A,x){if(!this._finished)throw new Error(\"Data not yet indexed - call index.finish().\");let{ids:E,coords:P,nodeSize:D}=this,B=[0,E.length-1,0],V=[];for(;B.length;){let q=B.pop()||0,Q=B.pop()||0,rt=B.pop()||0;if(Q-rt<=D){for(let xt=rt;xt<=Q;xt++){let Mt=P[2*xt],Vt=P[2*xt+1];Mt>=a&&Mt<=A&&Vt>=h&&Vt<=x&&V.push(E[xt])}continue}let ot=rt+Q>>1,lt=P[2*ot],pt=P[2*ot+1];lt>=a&&lt<=A&&pt>=h&&pt<=x&&V.push(E[ot]),(q===0?a<=lt:h<=pt)&&(B.push(rt),B.push(ot-1),B.push(1-q)),(q===0?A>=lt:x>=pt)&&(B.push(ot+1),B.push(Q),B.push(1-q))}return V}within(a,h,A){if(!this._finished)throw new Error(\"Data not yet indexed - call index.finish().\");let{ids:x,coords:E,nodeSize:P}=this,D=[0,x.length-1,0],B=[],V=A*A;for(;D.length;){let q=D.pop()||0,Q=D.pop()||0,rt=D.pop()||0;if(Q-rt<=P){for(let xt=rt;xt<=Q;xt++)LF(E[2*xt],E[2*xt+1],a,h)<=V&&B.push(x[xt]);continue}let ot=rt+Q>>1,lt=E[2*ot],pt=E[2*ot+1];LF(lt,pt,a,h)<=V&&B.push(x[ot]),(q===0?a-A<=lt:h-A<=pt)&&(D.push(rt),D.push(ot-1),D.push(1-q)),(q===0?a+A>=lt:h+A>=pt)&&(D.push(ot+1),D.push(Q),D.push(1-q))}return B}}function gC(u,a,h,A,x,E){if(x-A<=h)return;let P=A+x>>1;CF(u,a,P,A,x,E),gC(u,a,h,A,P-1,1-E),gC(u,a,h,P+1,x,1-E)}function CF(u,a,h,A,x,E){for(;x>A;){if(x-A>600){let V=x-A+1,q=h-A+1,Q=Math.log(V),rt=.5*Math.exp(2*Q/3),ot=.5*Math.sqrt(Q*rt*(V-rt)/V)*(q-V/2<0?-1:1);CF(u,a,h,Math.max(A,Math.floor(h-q*rt/V+ot)),Math.min(x,Math.floor(h+(V-q)*rt/V+ot)),E)}let P=a[2*h+E],D=A,B=x;for(zx(u,a,A,h),a[2*x+E]>P&&zx(u,a,A,x);D<B;){for(zx(u,a,D,B),D++,B--;a[2*D+E]<P;)D++;for(;a[2*B+E]>P;)B--}a[2*A+E]===P?zx(u,a,A,B):(B++,zx(u,a,B,x)),B<=h&&(A=B+1),h<=B&&(x=B-1)}}function zx(u,a,h,A){_C(u,h,A),_C(a,2*h,2*A),_C(a,2*h+1,2*A+1)}function _C(u,a,h){let A=u[a];u[a]=u[h],u[h]=A}function LF(u,a,h,A){let x=u-h,E=a-A;return x*x+E*E}var yC;n.bc=void 0,(yC=n.bc||(n.bc={})).create=\"create\",yC.load=\"load\",yC.fullLoad=\"fullLoad\";let $S=null,Nx=[],vC=1e3/60,xC=\"loadTime\",bC=\"fullLoadTime\",hK={mark(u){performance.mark(u)},frame(u){let a=u;$S!=null&&Nx.push(a-$S),$S=a},clearMetrics(){$S=null,Nx=[],performance.clearMeasures(xC),performance.clearMeasures(bC);for(let u in n.bc)performance.clearMarks(n.bc[u])},getPerformanceMetrics(){performance.measure(xC,n.bc.create,n.bc.load),performance.measure(bC,n.bc.create,n.bc.fullLoad);let u=performance.getEntriesByName(xC)[0].duration,a=performance.getEntriesByName(bC)[0].duration,h=Nx.length,A=1/(Nx.reduce((E,P)=>E+P,0)/h/1e3),x=Nx.filter(E=>E>vC).reduce((E,P)=>E+(P-vC)/vC,0);return{loadTime:u,fullLoadTime:a,fps:A,percentDroppedFrames:x/(h+x)*100,totalFrames:h}}};n.$=ur,n.A=se,n.B=function(u){if(un==null){let a=u.navigator?u.navigator.userAgent:null;un=!!u.safari||!(!a||!(/\\b(iPad|iPhone|iPod)\\b/.test(a)||a.match(\"Safari\")&&!a.match(\"Chrome\")))}return un},n.C=class{constructor(u,a){this.target=u,this.mapId=a,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new eK(()=>this.process()),this.subscription=function(h,A,x,E){return h.addEventListener(A,x,!1),{unsubscribe:()=>{h.removeEventListener(A,x,!1)}}}(this.target,\"message\",h=>this.receive(h)),this.globalScope=Cr(self)?u:window}registerMessageHandler(u,a){this.messageHandlers[u]=a}sendAsync(u,a){return new Promise((h,A)=>{let x=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[x]={resolve:h,reject:A},a&&a.signal.addEventListener(\"abort\",()=>{delete this.resolveRejects[x];let D={id:x,type:\"<cancel>\",origin:location.origin,targetMapId:u.targetMapId,sourceMapId:this.mapId};this.target.postMessage(D)},{once:!0});let E=[],P=Object.assign(Object.assign({},u),{id:x,sourceMapId:this.mapId,origin:location.origin,data:Tf(u.data,E)});this.target.postMessage(P,{transfer:E})})}receive(u){let a=u.data,h=a.id;if(a.origin===location.origin&&(!a.targetMapId||this.mapId===a.targetMapId)){if(a.type===\"<cancel>\"){delete this.tasks[h];let A=this.abortControllers[h];return delete this.abortControllers[h],void(A&&A.abort())}if(Cr(self)||a.mustQueue)return this.tasks[h]=a,this.taskQueue.push(h),void this.invoker.trigger();this.processTask(h,a)}}process(){if(this.taskQueue.length===0)return;let u=this.taskQueue.shift(),a=this.tasks[u];delete this.tasks[u],this.taskQueue.length>0&&this.invoker.trigger(),a&&this.processTask(u,a)}processTask(u,a){return s(this,void 0,void 0,function*(){if(a.type===\"<response>\"){let x=this.resolveRejects[u];return delete this.resolveRejects[u],x?void(a.error?x.reject(Mf(a.error)):x.resolve(Mf(a.data))):void 0}if(!this.messageHandlers[a.type])return void this.completeTask(u,new Error(`Could not find a registered handler for ${a.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(\", \")}`));let h=Mf(a.data),A=new AbortController;this.abortControllers[u]=A;try{let x=yield this.messageHandlers[a.type](a.sourceMapId,h,A);this.completeTask(u,null,x)}catch(x){this.completeTask(u,x)}})}completeTask(u,a,h){let A=[];delete this.abortControllers[u];let x={id:u,type:\"<response>\",sourceMapId:this.mapId,origin:location.origin,error:a?Tf(a):null,data:Tf(h,A)};this.target.postMessage(x,{transfer:A})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},n.D=Qe,n.E=aa,n.F=function(){var u=new se(16);return se!=Float32Array&&(u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[11]=0,u[12]=0,u[13]=0,u[14]=0),u[0]=1,u[5]=1,u[10]=1,u[15]=1,u},n.G=Uo,n.H=function(u,a,h){var A,x,E,P,D,B,V,q,Q,rt,ot,lt,pt=h[0],xt=h[1],Mt=h[2];return a===u?(u[12]=a[0]*pt+a[4]*xt+a[8]*Mt+a[12],u[13]=a[1]*pt+a[5]*xt+a[9]*Mt+a[13],u[14]=a[2]*pt+a[6]*xt+a[10]*Mt+a[14],u[15]=a[3]*pt+a[7]*xt+a[11]*Mt+a[15]):(x=a[1],E=a[2],P=a[3],D=a[4],B=a[5],V=a[6],q=a[7],Q=a[8],rt=a[9],ot=a[10],lt=a[11],u[0]=A=a[0],u[1]=x,u[2]=E,u[3]=P,u[4]=D,u[5]=B,u[6]=V,u[7]=q,u[8]=Q,u[9]=rt,u[10]=ot,u[11]=lt,u[12]=A*pt+D*xt+Q*Mt+a[12],u[13]=x*pt+B*xt+rt*Mt+a[13],u[14]=E*pt+V*xt+ot*Mt+a[14],u[15]=P*pt+q*xt+lt*Mt+a[15]),u},n.I=iC,n.J=function(u,a,h){var A=h[0],x=h[1],E=h[2];return u[0]=a[0]*A,u[1]=a[1]*A,u[2]=a[2]*A,u[3]=a[3]*A,u[4]=a[4]*x,u[5]=a[5]*x,u[6]=a[6]*x,u[7]=a[7]*x,u[8]=a[8]*E,u[9]=a[9]*E,u[10]=a[10]*E,u[11]=a[11]*E,u[12]=a[12],u[13]=a[13],u[14]=a[14],u[15]=a[15],u},n.K=Ge,n.L=function(u,a){let h={};for(let A=0;A<a.length;A++){let x=a[A];x in u&&(h[x]=u[x])}return h},n.M=fA,n.N=oF,n.O=aF,n.P=_,n.Q=Fc,n.R=fi,n.S=Y,n.T=Pf,n.U=it,n.V=ws,n.W=Bn,n.X=Dn,n.Y=WS,n.Z=class extends lo{},n._=s,n.a=sl,n.a$=function(u,a){return u[0]*a[0]+u[1]*a[1]+u[2]*a[2]+u[3]*a[3]},n.a0=dC,n.a1=Ae,n.a2=u=>{let a=window.document.createElement(\"video\");return a.muted=!0,new Promise(h=>{a.onloadstart=()=>{h(a)};for(let A of u){let x=window.document.createElement(\"source\");ls(A)||(a.crossOrigin=\"Anonymous\"),x.src=A,a.appendChild(x)}})},n.a3=function(){return Ot++},n.a4=l,n.a5=A_,n.a6=Pd,n.a7=wu,n.a8=ki,n.a9=dF,n.aA=oe,n.aB=function(u,a){if(!u)return[{command:\"setStyle\",args:[a]}];let h=[];try{if(!ti(u.version,a.version))return[{command:\"setStyle\",args:[a]}];ti(u.center,a.center)||h.push({command:\"setCenter\",args:[a.center]}),ti(u.zoom,a.zoom)||h.push({command:\"setZoom\",args:[a.zoom]}),ti(u.bearing,a.bearing)||h.push({command:\"setBearing\",args:[a.bearing]}),ti(u.pitch,a.pitch)||h.push({command:\"setPitch\",args:[a.pitch]}),ti(u.sprite,a.sprite)||h.push({command:\"setSprite\",args:[a.sprite]}),ti(u.glyphs,a.glyphs)||h.push({command:\"setGlyphs\",args:[a.glyphs]}),ti(u.transition,a.transition)||h.push({command:\"setTransition\",args:[a.transition]}),ti(u.light,a.light)||h.push({command:\"setLight\",args:[a.light]}),ti(u.terrain,a.terrain)||h.push({command:\"setTerrain\",args:[a.terrain]});let A={},x=[];(function(P,D,B,V){let q;for(q in D=D||{},P=P||{})Object.prototype.hasOwnProperty.call(P,q)&&(Object.prototype.hasOwnProperty.call(D,q)||Wo(q,B,V));for(q in D)Object.prototype.hasOwnProperty.call(D,q)&&(Object.prototype.hasOwnProperty.call(P,q)?ti(P[q],D[q])||(P[q].type===\"geojson\"&&D[q].type===\"geojson\"&&Ca(P,D,q)?In(B,{command:\"setGeoJSONSourceData\",args:[q,D[q].data]}):Dl(q,D,B,V)):xn(q,D,B))})(u.sources,a.sources,x,A);let E=[];u.layers&&u.layers.forEach(P=>{\"source\"in P&&A[P.source]?h.push({command:\"removeLayer\",args:[P.id]}):E.push(P)}),h=h.concat(x),function(P,D,B){D=D||[];let V=(P=P||[]).map(hf),q=D.map(hf),Q=P.reduce(Ts,{}),rt=D.reduce(Ts,{}),ot=V.slice(),lt=Object.create(null),pt,xt,Mt,Vt,It;for(let zt=0,ie=0;zt<V.length;zt++)pt=V[zt],Object.prototype.hasOwnProperty.call(rt,pt)?ie++:(In(B,{command:\"removeLayer\",args:[pt]}),ot.splice(ot.indexOf(pt,ie),1));for(let zt=0,ie=0;zt<q.length;zt++)pt=q[q.length-1-zt],ot[ot.length-1-zt]!==pt&&(Object.prototype.hasOwnProperty.call(Q,pt)?(In(B,{command:\"removeLayer\",args:[pt]}),ot.splice(ot.lastIndexOf(pt,ot.length-ie),1)):ie++,Vt=ot[ot.length-zt],In(B,{command:\"addLayer\",args:[rt[pt],Vt]}),ot.splice(ot.length-zt,0,pt),lt[pt]=!0);for(let zt=0;zt<q.length;zt++)if(pt=q[zt],xt=Q[pt],Mt=rt[pt],!lt[pt]&&!ti(xt,Mt))if(ti(xt.source,Mt.source)&&ti(xt[\"source-layer\"],Mt[\"source-layer\"])&&ti(xt.type,Mt.type)){for(It in Tc(xt.layout,Mt.layout,B,pt,null,\"setLayoutProperty\"),Tc(xt.paint,Mt.paint,B,pt,null,\"setPaintProperty\"),ti(xt.filter,Mt.filter)||In(B,{command:\"setFilter\",args:[pt,Mt.filter]}),ti(xt.minzoom,Mt.minzoom)&&ti(xt.maxzoom,Mt.maxzoom)||In(B,{command:\"setLayerZoomRange\",args:[pt,Mt.minzoom,Mt.maxzoom]}),xt)Object.prototype.hasOwnProperty.call(xt,It)&&It!==\"layout\"&&It!==\"paint\"&&It!==\"filter\"&&It!==\"metadata\"&&It!==\"minzoom\"&&It!==\"maxzoom\"&&(It.indexOf(\"paint.\")===0?Tc(xt[It],Mt[It],B,pt,It.slice(6),\"setPaintProperty\"):ti(xt[It],Mt[It])||In(B,{command:\"setLayerProperty\",args:[pt,It,Mt[It]]}));for(It in Mt)Object.prototype.hasOwnProperty.call(Mt,It)&&!Object.prototype.hasOwnProperty.call(xt,It)&&It!==\"layout\"&&It!==\"paint\"&&It!==\"filter\"&&It!==\"metadata\"&&It!==\"minzoom\"&&It!==\"maxzoom\"&&(It.indexOf(\"paint.\")===0?Tc(xt[It],Mt[It],B,pt,It.slice(6),\"setPaintProperty\"):ti(xt[It],Mt[It])||In(B,{command:\"setLayerProperty\",args:[pt,It,Mt[It]]}))}else In(B,{command:\"removeLayer\",args:[pt]}),Vt=ot[ot.lastIndexOf(pt)+1],In(B,{command:\"addLayer\",args:[Mt,Vt]})}(E,a.layers,h)}catch(A){console.warn(\"Unable to compute style diff:\",A),h=[{command:\"setStyle\",args:[a]}]}return h},n.aC=function(u){let a=[],h=u.id;return h===void 0&&a.push({message:`layers.${h}: missing required property \"id\"`}),u.render===void 0&&a.push({message:`layers.${h}: missing required method \"render\"`}),u.renderingMode&&u.renderingMode!==\"2d\"&&u.renderingMode!==\"3d\"&&a.push({message:`layers.${h}: property \"renderingMode\" must be either \"2d\" or \"3d\"`}),a},n.aD=function u(a,h){if(Array.isArray(a)){if(!Array.isArray(h)||a.length!==h.length)return!1;for(let A=0;A<a.length;A++)if(!u(a[A],h[A]))return!1;return!0}if(typeof a==\"object\"&&a!==null&&h!==null){if(typeof h!=\"object\"||Object.keys(a).length!==Object.keys(h).length)return!1;for(let A in a)if(!u(a[A],h[A]))return!1;return!0}return a===h},n.aE=Yt,n.aF=te,n.aG=class extends js{constructor(u,a){super(u,a),this.current=0}set(u){this.current!==u&&(this.current=u,this.gl.uniform1i(this.location,u))}},n.aH=ha,n.aI=class extends js{constructor(u,a){super(u,a),this.current=kf}set(u){if(u[12]!==this.current[12]||u[0]!==this.current[0])return this.current=u,void this.gl.uniformMatrix4fv(this.location,!1,u);for(let a=1;a<16;a++)if(u[a]!==this.current[a]){this.current=u,this.gl.uniformMatrix4fv(this.location,!1,u);break}}},n.aJ=Bc,n.aK=class extends js{constructor(u,a){super(u,a),this.current=[0,0,0]}set(u){u[0]===this.current[0]&&u[1]===this.current[1]&&u[2]===this.current[2]||(this.current=u,this.gl.uniform3f(this.location,u[0],u[1],u[2]))}},n.aL=class extends js{constructor(u,a){super(u,a),this.current=[0,0]}set(u){u[0]===this.current[0]&&u[1]===this.current[1]||(this.current=u,this.gl.uniform2f(this.location,u[0],u[1]))}},n.aM=Lf,n.aN=function(u,a,h,A,x,E,P){var D=1/(a-h),B=1/(A-x),V=1/(E-P);return u[0]=-2*D,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=-2*B,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=2*V,u[11]=0,u[12]=(a+h)*D,u[13]=(x+A)*B,u[14]=(P+E)*V,u[15]=1,u},n.aO=mi,n.aP=ye,n.aQ=class extends Dd{},n.aR=IX,n.aS=class extends fh{},n.aT=function(u){return u<=1?1:Math.pow(2,Math.ceil(Math.log(u)/Math.LN2))},n.aU=ln,n.aV=at,n.aW=class extends aA{},n.aX=he,n.aY=function(u,a){var h=u[0],A=u[1],x=u[2],E=u[3],P=u[4],D=u[5],B=u[6],V=u[7],q=u[8],Q=u[9],rt=u[10],ot=u[11],lt=u[12],pt=u[13],xt=u[14],Mt=u[15],Vt=a[0],It=a[1],zt=a[2],ie=a[3],ue=a[4],Be=a[5],Ke=a[6],Re=a[7],Ie=a[8],we=a[9],We=a[10],Ee=a[11],pe=a[12],cr=a[13],tr=a[14],ei=a[15];return Math.abs(h-Vt)<=Qt*Math.max(1,Math.abs(h),Math.abs(Vt))&&Math.abs(A-It)<=Qt*Math.max(1,Math.abs(A),Math.abs(It))&&Math.abs(x-zt)<=Qt*Math.max(1,Math.abs(x),Math.abs(zt))&&Math.abs(E-ie)<=Qt*Math.max(1,Math.abs(E),Math.abs(ie))&&Math.abs(P-ue)<=Qt*Math.max(1,Math.abs(P),Math.abs(ue))&&Math.abs(D-Be)<=Qt*Math.max(1,Math.abs(D),Math.abs(Be))&&Math.abs(B-Ke)<=Qt*Math.max(1,Math.abs(B),Math.abs(Ke))&&Math.abs(V-Re)<=Qt*Math.max(1,Math.abs(V),Math.abs(Re))&&Math.abs(q-Ie)<=Qt*Math.max(1,Math.abs(q),Math.abs(Ie))&&Math.abs(Q-we)<=Qt*Math.max(1,Math.abs(Q),Math.abs(we))&&Math.abs(rt-We)<=Qt*Math.max(1,Math.abs(rt),Math.abs(We))&&Math.abs(ot-Ee)<=Qt*Math.max(1,Math.abs(ot),Math.abs(Ee))&&Math.abs(lt-pe)<=Qt*Math.max(1,Math.abs(lt),Math.abs(pe))&&Math.abs(pt-cr)<=Qt*Math.max(1,Math.abs(pt),Math.abs(cr))&&Math.abs(xt-tr)<=Qt*Math.max(1,Math.abs(xt),Math.abs(tr))&&Math.abs(Mt-ei)<=Qt*Math.max(1,Math.abs(Mt),Math.abs(ei))},n.aZ=function(u,a){return u[0]=a[0],u[1]=a[1],u[2]=a[2],u[3]=a[3],u[4]=a[4],u[5]=a[5],u[6]=a[6],u[7]=a[7],u[8]=a[8],u[9]=a[9],u[10]=a[10],u[11]=a[11],u[12]=a[12],u[13]=a[13],u[14]=a[14],u[15]=a[15],u},n.a_=function(u,a,h){return u[0]=a[0]*h[0],u[1]=a[1]*h[1],u[2]=a[2]*h[2],u[3]=a[3]*h[3],u},n.aa=function(u){let a={};if(u.replace(/(?:^|(?:\\s*\\,\\s*))([^\\x00-\\x20\\(\\)<>@\\,;\\:\\\\\"\\/\\[\\]\\?\\=\\{\\}\\x7F]+)(?:\\=(?:([^\\x00-\\x20\\(\\)<>@\\,;\\:\\\\\"\\/\\[\\]\\?\\=\\{\\}\\x7F]+)|(?:\\\"((?:[^\"\\\\]|\\\\.)*)\\\")))?/g,(h,A,x,E)=>{let P=x||E;return a[A]=!P||P.toLowerCase(),\"\"}),a[\"max-age\"]){let h=parseInt(a[\"max-age\"],10);isNaN(h)?delete a[\"max-age\"]:a[\"max-age\"]=h}return a},n.ab=function(u,a){let h=[];for(let A in u)A in a||h.push(A);return h},n.ac=J,n.ad=function(u,a,h){var A=Math.sin(h),x=Math.cos(h),E=a[0],P=a[1],D=a[2],B=a[3],V=a[4],q=a[5],Q=a[6],rt=a[7];return a!==u&&(u[8]=a[8],u[9]=a[9],u[10]=a[10],u[11]=a[11],u[12]=a[12],u[13]=a[13],u[14]=a[14],u[15]=a[15]),u[0]=E*x+V*A,u[1]=P*x+q*A,u[2]=D*x+Q*A,u[3]=B*x+rt*A,u[4]=V*x-E*A,u[5]=q*x-P*A,u[6]=Q*x-D*A,u[7]=rt*x-B*A,u},n.ae=function(u){var a=new se(16);return a[0]=u[0],a[1]=u[1],a[2]=u[2],a[3]=u[3],a[4]=u[4],a[5]=u[5],a[6]=u[6],a[7]=u[7],a[8]=u[8],a[9]=u[9],a[10]=u[10],a[11]=u[11],a[12]=u[12],a[13]=u[13],a[14]=u[14],a[15]=u[15],a},n.af=Ft,n.ag=function(u,a){let h=0,A=0;if(u.kind===\"constant\")A=u.layoutSize;else if(u.kind!==\"source\"){let{interpolationType:x,minZoom:E,maxZoom:P}=u,D=x?J(bo.interpolationFactor(x,a,E,P),0,1):0;u.kind===\"camera\"?A=Zo.number(u.minSize,u.maxSize,D):h=D}return{uSizeT:h,uSize:A}},n.ai=function(u,{uSize:a,uSizeT:h},{lowerSize:A,upperSize:x}){return u.kind===\"source\"?A/Rf:u.kind===\"composite\"?Zo.number(A/Rf,x/Rf,h):a},n.aj=aC,n.ak=function(u,a,h,A){let x=a.y-u.y,E=a.x-u.x,P=A.y-h.y,D=A.x-h.x,B=P*E-D*x;if(B===0)return null;let V=(D*(u.y-h.y)-P*(u.x-h.x))/B;return new _(u.x+V*E,u.y+V*x)},n.al=gF,n.am=fa,n.an=Se,n.ao=Gs,n.aq=oC,n.ar=function(u,a){var h=a[0],A=a[1],x=a[2],E=a[3],P=a[4],D=a[5],B=a[6],V=a[7],q=a[8],Q=a[9],rt=a[10],ot=a[11],lt=a[12],pt=a[13],xt=a[14],Mt=a[15],Vt=h*D-A*P,It=h*B-x*P,zt=h*V-E*P,ie=A*B-x*D,ue=A*V-E*D,Be=x*V-E*B,Ke=q*pt-Q*lt,Re=q*xt-rt*lt,Ie=q*Mt-ot*lt,we=Q*xt-rt*pt,We=Q*Mt-ot*pt,Ee=rt*Mt-ot*xt,pe=Vt*Ee-It*We+zt*we+ie*Ie-ue*Re+Be*Ke;return pe?(u[0]=(D*Ee-B*We+V*we)*(pe=1/pe),u[1]=(x*We-A*Ee-E*we)*pe,u[2]=(pt*Be-xt*ue+Mt*ie)*pe,u[3]=(rt*ue-Q*Be-ot*ie)*pe,u[4]=(B*Ie-P*Ee-V*Re)*pe,u[5]=(h*Ee-x*Ie+E*Re)*pe,u[6]=(xt*zt-lt*Be-Mt*It)*pe,u[7]=(q*Be-rt*zt+ot*It)*pe,u[8]=(P*We-D*Ie+V*Ke)*pe,u[9]=(A*Ie-h*We-E*Ke)*pe,u[10]=(lt*ue-pt*zt+Mt*Vt)*pe,u[11]=(Q*zt-q*ue-ot*Vt)*pe,u[12]=(D*Re-P*we-B*Ke)*pe,u[13]=(h*we-A*Re+x*Ke)*pe,u[14]=(pt*It-lt*ie-xt*Vt)*pe,u[15]=(q*ie-Q*It+rt*Vt)*pe,u):null},n.as=AC,n.at=sC,n.au=mC,n.av=function(){let u={},a=Jt.$version;for(let h in Jt.$root){let A=Jt.$root[h];if(A.required){let x=null;x=h===\"version\"?a:A.type===\"array\"?[]:{},x!=null&&(u[h]=x)}}return u},n.aw=rA,n.ax=yo,n.ay=function(u){u=u.slice();let a=Object.create(null);for(let h=0;h<u.length;h++)a[u[h].id]=u[h];for(let h=0;h<u.length;h++)\"ref\"in u[h]&&(u[h]=hu(u[h],a[u[h].ref]));return u},n.az=function(u){if(u.type===\"custom\")return new tK(u);switch(u.type){case\"background\":return new XX(u);case\"circle\":return new qe(u);case\"fill\":return new rX(u);case\"fill-extrusion\":return new gX(u);case\"heatmap\":return new jr(u);case\"hillshade\":return new UQ(u);case\"line\":return new TX(u);case\"raster\":return new JX(u);case\"symbol\":return new GS(u)}},n.b=Fs,n.b0=ht,n.b1=uF,n.b2=lF,n.b3=function(u,a,h,A,x){var E,P=1/Math.tan(a/2);return u[0]=P/h,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=P,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[11]=-1,u[12]=0,u[13]=0,u[15]=0,x!=null&&x!==1/0?(u[10]=(x+A)*(E=1/(A-x)),u[14]=2*x*A*E):(u[10]=-1,u[14]=-2*A),u},n.b4=function(u,a,h){var A=Math.sin(h),x=Math.cos(h),E=a[4],P=a[5],D=a[6],B=a[7],V=a[8],q=a[9],Q=a[10],rt=a[11];return a!==u&&(u[0]=a[0],u[1]=a[1],u[2]=a[2],u[3]=a[3],u[12]=a[12],u[13]=a[13],u[14]=a[14],u[15]=a[15]),u[4]=E*x+V*A,u[5]=P*x+q*A,u[6]=D*x+Q*A,u[7]=B*x+rt*A,u[8]=V*x-E*A,u[9]=q*x-P*A,u[10]=Q*x-D*A,u[11]=rt*x-B*A,u},n.b5=Z,n.b6=K,n.b7=function(u){return u*Math.PI/180},n.b8=function(u,a){return u[0]=a[0],u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=a[1],u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=a[2],u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,u},n.b9=class extends sA{},n.ba=hC,n.bb=hK,n.bd=Ci,n.be=function(u,a){sl.REGISTERED_PROTOCOLS[u]=a},n.bf=function(u){delete sl.REGISTERED_PROTOCOLS[u]},n.bg=function(u,a){let h={};for(let x=0;x<u.length;x++){let E=a&&a[u[x].id]||e_(u[x]);a&&(a[u[x].id]=E);let P=h[E];P||(P=h[E]=[]),P.push(u[x])}let A=[];for(let x in h)A.push(h[x]);return A},n.bh=Fe,n.bi=fF,n.bj=pF,n.bk=q6,n.bl=function(u){u.bucket.createArrays(),u.bucket.tilePixelRatio=Bn/(512*u.bucket.overscaling),u.bucket.compareText={},u.bucket.iconsNeedLinear=!1;let a=u.bucket.layers[0],h=a.layout,A=a._unevaluatedLayout._values,x={layoutIconSize:A[\"icon-size\"].possiblyEvaluate(new ki(u.bucket.zoom+1),u.canonical),layoutTextSize:A[\"text-size\"].possiblyEvaluate(new ki(u.bucket.zoom+1),u.canonical),textMaxSize:A[\"text-size\"].possiblyEvaluate(new ki(18))};if(u.bucket.textSizeData.kind===\"composite\"){let{minZoom:V,maxZoom:q}=u.bucket.textSizeData;x.compositeTextSizes=[A[\"text-size\"].possiblyEvaluate(new ki(V),u.canonical),A[\"text-size\"].possiblyEvaluate(new ki(q),u.canonical)]}if(u.bucket.iconSizeData.kind===\"composite\"){let{minZoom:V,maxZoom:q}=u.bucket.iconSizeData;x.compositeIconSizes=[A[\"icon-size\"].possiblyEvaluate(new ki(V),u.canonical),A[\"icon-size\"].possiblyEvaluate(new ki(q),u.canonical)]}let E=h.get(\"text-line-height\")*Gs,P=h.get(\"text-rotation-alignment\")!==\"viewport\"&&h.get(\"symbol-placement\")!==\"point\",D=h.get(\"text-keep-upright\"),B=h.get(\"text-size\");for(let V of u.bucket.features){let q=h.get(\"text-font\").evaluate(V,{},u.canonical).join(\",\"),Q=B.evaluate(V,{},u.canonical),rt=x.layoutTextSize.evaluate(V,{},u.canonical),ot=x.layoutIconSize.evaluate(V,{},u.canonical),lt={horizontal:{},vertical:void 0},pt=V.text,xt,Mt=[0,0];if(pt){let zt=pt.toString(),ie=h.get(\"text-letter-spacing\").evaluate(V,{},u.canonical)*Gs,ue=Ef(zt)?ie:0,Be=h.get(\"text-anchor\").evaluate(V,{},u.canonical),Ke=MF(a,V,u.canonical);if(!Ke){let Ee=h.get(\"text-radial-offset\").evaluate(V,{},u.canonical);Mt=Ee?TF(Be,[Ee*Gs,pC]):h.get(\"text-offset\").evaluate(V,{},u.canonical).map(pe=>pe*Gs)}let Re=P?\"center\":h.get(\"text-justify\").evaluate(V,{},u.canonical),Ie=h.get(\"symbol-placement\"),we=Ie===\"point\"?h.get(\"text-max-width\").evaluate(V,{},u.canonical)*Gs:0,We=()=>{u.bucket.allowVerticalPlacement&&iA(zt)&&(lt.vertical=US(pt,u.glyphMap,u.glyphPositions,u.imagePositions,q,we,E,Be,\"left\",ue,Mt,n.ah.vertical,!0,Ie,rt,Q))};if(!P&&Ke){let Ee=new Set;if(Re===\"auto\")for(let cr=0;cr<Ke.values.length;cr+=2)Ee.add(AC(Ke.values[cr]));else Ee.add(Re);let pe=!1;for(let cr of Ee)if(!lt.horizontal[cr])if(pe)lt.horizontal[cr]=lt.horizontal[0];else{let tr=US(pt,u.glyphMap,u.glyphPositions,u.imagePositions,q,we,E,\"center\",cr,ue,Mt,n.ah.horizontal,!1,Ie,rt,Q);tr&&(lt.horizontal[cr]=tr,pe=tr.positionedLines.length===1)}We()}else{Re===\"auto\"&&(Re=AC(Be));let Ee=US(pt,u.glyphMap,u.glyphPositions,u.imagePositions,q,we,E,Be,Re,ue,Mt,n.ah.horizontal,!1,Ie,rt,Q);Ee&&(lt.horizontal[Re]=Ee),We(),iA(zt)&&P&&D&&(lt.vertical=US(pt,u.glyphMap,u.glyphPositions,u.imagePositions,q,we,E,Be,Re,ue,Mt,n.ah.vertical,!1,Ie,rt,Q))}}let Vt=!1;if(V.icon&&V.icon.name){let zt=u.imageMap[V.icon.name];zt&&(xt=qX(u.imagePositions[V.icon.name],h.get(\"icon-offset\").evaluate(V,{},u.canonical),h.get(\"icon-anchor\").evaluate(V,{},u.canonical)),Vt=!!zt.sdf,u.bucket.sdfIcons===void 0?u.bucket.sdfIcons=Vt:u.bucket.sdfIcons!==Vt&&Le(\"Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer\"),(zt.pixelRatio!==u.bucket.pixelRatio||h.get(\"icon-rotate\").constantOr(1)!==0)&&(u.bucket.iconsNeedLinear=!0))}let It=PF(lt.horizontal)||lt.vertical;u.bucket.iconsInText=!!It&&It.iconsInText,(It||xt)&&cK(u.bucket,V,lt,xt,u.imageMap,x,rt,ot,Mt,Vt,u.canonical)}u.showCollisionBoxes&&u.bucket.generateCollisionDebugBuffers()},n.bm=JI,n.bn=QI,n.bo=KI,n.bp=cA,n.bq=eC,n.br=class{constructor(u){this._marks={start:[u.url,\"start\"].join(\"#\"),end:[u.url,\"end\"].join(\"#\"),measure:u.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let u=performance.getEntriesByName(this._marks.measure);return u.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),u=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),u}},n.bs=function(u,a,h,A,x){return s(this,void 0,void 0,function*(){if(it())try{return yield ws(u,a,h,A,x)}catch{}return function(E,P,D,B,V){let q=E.width,Q=E.height;io&&Ss||(io=new OffscreenCanvas(q,Q),Ss=io.getContext(\"2d\",{willReadFrequently:!0})),io.width=q,io.height=Q,Ss.drawImage(E,0,0,q,Q);let rt=Ss.getImageData(P,D,B,V);return Ss.clearRect(0,0,q,Q),rt.data}(u,a,h,A,x)})},n.bt=hF,n.bu=o,n.bv=c,n.bw=F6,n.bx=uh,n.by=function(u){return u.message===_o},n.bz=vu,n.c=oa,n.d=u=>s(void 0,void 0,void 0,function*(){if(u.byteLength===0)return createImageBitmap(new ImageData(1,1));let a=new Blob([new Uint8Array(u)],{type:\"image/png\"});try{return createImageBitmap(a)}catch(h){throw new Error(`Could not load image because of ${h.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),n.e=Tt,n.f=u=>new Promise((a,h)=>{let A=new Image;A.onload=()=>{a(A),URL.revokeObjectURL(A.src),A.onload=null,window.requestAnimationFrame(()=>{A.src=Sc})},A.onerror=()=>h(new Error(\"Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.\"));let x=new Blob([new Uint8Array(u)],{type:\"image/png\"});A.src=u.byteLength?URL.createObjectURL(x):Sc}),n.g=Ia,n.h=(u,a)=>Oi(Tt(u,{type:\"json\"}),a),n.i=Cr,n.j=an,n.k=Go,n.l=(u,a)=>Oi(Tt(u,{type:\"arrayBuffer\"}),a),n.m=Oi,n.n=function(u){return new eC(u).readFields(UX,[])},n.o=pi,n.p=H6,n.q=wo,n.r=tA,n.s=ls,n.t=kc,n.u=Ce,n.v=Jt,n.w=Le,n.x=Sf,n.y=function([u,a,h]){return a+=90,a*=Math.PI/180,h*=Math.PI/180,{x:u*Math.cos(a)*Math.sin(h),y:u*Math.sin(a)*Math.sin(h),z:u*Math.cos(h)}},n.z=Zo}),r(\"worker\",[\"./shared\"],function(n){\"use strict\";class s{constructor(tt){this.keyCache={},tt&&this.replace(tt)}replace(tt){this._layerConfigs={},this._layers={},this.update(tt,[])}update(tt,nt){for(let mt of tt){this._layerConfigs[mt.id]=mt;let Rt=this._layers[mt.id]=n.az(mt);Rt._featureFilter=n.a6(Rt.filter),this.keyCache[mt.id]&&delete this.keyCache[mt.id]}for(let mt of nt)delete this.keyCache[mt],delete this._layerConfigs[mt],delete this._layers[mt];this.familiesBySource={};let ct=n.bg(Object.values(this._layerConfigs),this.keyCache);for(let mt of ct){let Rt=mt.map(ee=>this._layers[ee.id]),Dt=Rt[0];if(Dt.visibility===\"none\")continue;let Ut=Dt.source||\"\",ft=this.familiesBySource[Ut];ft||(ft=this.familiesBySource[Ut]={});let jt=Dt.sourceLayer||\"_geojsonTileLayer\",le=ft[jt];le||(le=ft[jt]=[]),le.push(Rt)}}}class o{constructor(tt){let nt={},ct=[];for(let Ut in tt){let ft=tt[Ut],jt=nt[Ut]={};for(let le in ft){let ee=ft[+le];if(!ee||ee.bitmap.width===0||ee.bitmap.height===0)continue;let re={x:0,y:0,w:ee.bitmap.width+2,h:ee.bitmap.height+2};ct.push(re),jt[le]={rect:re,metrics:ee.metrics}}}let{w:mt,h:Rt}=n.p(ct),Dt=new n.o({width:mt||1,height:Rt||1});for(let Ut in tt){let ft=tt[Ut];for(let jt in ft){let le=ft[+jt];if(!le||le.bitmap.width===0||le.bitmap.height===0)continue;let ee=nt[Ut][jt].rect;n.o.copy(le.bitmap,Dt,{x:0,y:0},{x:ee.x+1,y:ee.y+1},le.bitmap)}}this.image=Dt,this.positions=nt}}n.bh(\"GlyphAtlas\",o);class c{constructor(tt){this.tileID=new n.Q(tt.tileID.overscaledZ,tt.tileID.wrap,tt.tileID.canonical.z,tt.tileID.canonical.x,tt.tileID.canonical.y),this.uid=tt.uid,this.zoom=tt.zoom,this.pixelRatio=tt.pixelRatio,this.tileSize=tt.tileSize,this.source=tt.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=tt.showCollisionBoxes,this.collectResourceTiming=!!tt.collectResourceTiming,this.returnDependencies=!!tt.returnDependencies,this.promoteId=tt.promoteId,this.inFlightDependencies=[]}parse(tt,nt,ct,mt){return n._(this,void 0,void 0,function*(){this.status=\"parsing\",this.data=tt,this.collisionBoxArray=new n.a4;let Rt=new n.bi(Object.keys(tt.layers).sort()),Dt=new n.bj(this.tileID,this.promoteId);Dt.bucketLayerIDs=[];let Ut={},ft={featureIndex:Dt,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:ct},jt=nt.familiesBySource[this.source];for(let Rr in jt){let Ji=tt.layers[Rr];if(!Ji)continue;Ji.version===1&&n.w(`Vector tile source \"${this.source}\" layer \"${Rr}\" does not use vector tile spec v2 and therefore may have some rendering errors.`);let tn=Rt.encode(Rr),es=[];for(let cs=0;cs<Ji.length;cs++){let Ln=Ji.feature(cs),la=Dt.getId(Ln,Rr);es.push({feature:Ln,id:la,index:cs,sourceLayerIndex:tn})}for(let cs of jt[Rr]){let Ln=cs[0];Ln.source!==this.source&&n.w(`layer.source = ${Ln.source} does not equal this.source = ${this.source}`),Ln.minzoom&&this.zoom<Math.floor(Ln.minzoom)||Ln.maxzoom&&this.zoom>=Ln.maxzoom||Ln.visibility!==\"none\"&&(d(cs,this.zoom,ct),(Ut[Ln.id]=Ln.createBucket({index:Dt.bucketLayerIDs.length,layers:cs,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:tn,sourceID:this.source})).populate(es,ft,this.tileID.canonical),Dt.bucketLayerIDs.push(cs.map(la=>la.id)))}}let le=n.aE(ft.glyphDependencies,Rr=>Object.keys(Rr).map(Number));this.inFlightDependencies.forEach(Rr=>Rr?.abort()),this.inFlightDependencies=[];let ee=Promise.resolve({});if(Object.keys(le).length){let Rr=new AbortController;this.inFlightDependencies.push(Rr),ee=mt.sendAsync({type:\"getGlyphs\",data:{stacks:le,source:this.source,tileID:this.tileID,type:\"glyphs\"}},Rr)}let re=Object.keys(ft.iconDependencies),Je=Promise.resolve({});if(re.length){let Rr=new AbortController;this.inFlightDependencies.push(Rr),Je=mt.sendAsync({type:\"getImages\",data:{icons:re,source:this.source,tileID:this.tileID,type:\"icons\"}},Rr)}let ir=Object.keys(ft.patternDependencies),kr=Promise.resolve({});if(ir.length){let Rr=new AbortController;this.inFlightDependencies.push(Rr),kr=mt.sendAsync({type:\"getImages\",data:{icons:ir,source:this.source,tileID:this.tileID,type:\"patterns\"}},Rr)}let[_r,ii,Si]=yield Promise.all([ee,Je,kr]),Wi=new o(_r),bn=new n.bk(ii,Si);for(let Rr in Ut){let Ji=Ut[Rr];Ji instanceof n.a5?(d(Ji.layers,this.zoom,ct),n.bl({bucket:Ji,glyphMap:_r,glyphPositions:Wi.positions,imageMap:ii,imagePositions:bn.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Ji.hasPattern&&(Ji instanceof n.bm||Ji instanceof n.bn||Ji instanceof n.bo)&&(d(Ji.layers,this.zoom,ct),Ji.addFeatures(ft,this.tileID.canonical,bn.patternPositions))}return this.status=\"done\",{buckets:Object.values(Ut).filter(Rr=>!Rr.isEmpty()),featureIndex:Dt,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Wi.image,imageAtlas:bn,glyphMap:this.returnDependencies?_r:null,iconMap:this.returnDependencies?ii:null,glyphPositions:this.returnDependencies?Wi.positions:null}})}}function d(vt,tt,nt){let ct=new n.a8(tt);for(let mt of vt)mt.recalculate(ct,nt)}class _{constructor(tt,nt,ct){this.actor=tt,this.layerIndex=nt,this.availableImages=ct,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(tt,nt){return n._(this,void 0,void 0,function*(){let ct=yield n.l(tt.request,nt);try{return{vectorTile:new n.bp.VectorTile(new n.bq(ct.data)),rawData:ct.data,cacheControl:ct.cacheControl,expires:ct.expires}}catch(mt){let Rt=new Uint8Array(ct.data),Dt=`Unable to parse the tile at ${tt.request.url}, `;throw Dt+=Rt[0]===31&&Rt[1]===139?\"please make sure the data is not gzipped and that you have configured the relevant header in the server\":`got error: ${mt.messge}`,new Error(Dt)}})}loadTile(tt){return n._(this,void 0,void 0,function*(){let nt=tt.uid,ct=!!(tt&&tt.request&&tt.request.collectResourceTiming)&&new n.br(tt.request),mt=new c(tt);this.loading[nt]=mt;let Rt=new AbortController;mt.abort=Rt;try{let Dt=yield this.loadVectorTile(tt,Rt);if(delete this.loading[nt],!Dt)return null;let Ut=Dt.rawData,ft={};Dt.expires&&(ft.expires=Dt.expires),Dt.cacheControl&&(ft.cacheControl=Dt.cacheControl);let jt={};if(ct){let ee=ct.finish();ee&&(jt.resourceTiming=JSON.parse(JSON.stringify(ee)))}mt.vectorTile=Dt.vectorTile;let le=mt.parse(Dt.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[nt]=mt,this.fetching[nt]={rawTileData:Ut,cacheControl:ft,resourceTiming:jt};try{let ee=yield le;return n.e({rawTileData:Ut.slice(0)},ee,ft,jt)}finally{delete this.fetching[nt]}}catch(Dt){throw delete this.loading[nt],mt.status=\"done\",this.loaded[nt]=mt,Dt}})}reloadTile(tt){return n._(this,void 0,void 0,function*(){let nt=tt.uid;if(!this.loaded||!this.loaded[nt])throw new Error(\"Should not be trying to reload a tile that was never loaded or has been removed\");let ct=this.loaded[nt];if(ct.showCollisionBoxes=tt.showCollisionBoxes,ct.status===\"parsing\"){let mt=yield ct.parse(ct.vectorTile,this.layerIndex,this.availableImages,this.actor),Rt;if(this.fetching[nt]){let{rawTileData:Dt,cacheControl:Ut,resourceTiming:ft}=this.fetching[nt];delete this.fetching[nt],Rt=n.e({rawTileData:Dt.slice(0)},mt,Ut,ft)}else Rt=mt;return Rt}if(ct.status===\"done\"&&ct.vectorTile)return ct.parse(ct.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(tt){return n._(this,void 0,void 0,function*(){let nt=this.loading,ct=tt.uid;nt&&nt[ct]&&nt[ct].abort&&(nt[ct].abort.abort(),delete nt[ct])})}removeTile(tt){return n._(this,void 0,void 0,function*(){this.loaded&&this.loaded[tt.uid]&&delete this.loaded[tt.uid]})}}class w{constructor(){this.loaded={}}loadTile(tt){return n._(this,void 0,void 0,function*(){let{uid:nt,encoding:ct,rawImageData:mt,redFactor:Rt,greenFactor:Dt,blueFactor:Ut,baseShift:ft}=tt,jt=mt.width+2,le=mt.height+2,ee=n.b(mt)?new n.R({width:jt,height:le},yield n.bs(mt,-1,-1,jt,le)):mt,re=new n.bt(nt,ee,ct,Rt,Dt,Ut,ft);return this.loaded=this.loaded||{},this.loaded[nt]=re,re})}removeTile(tt){let nt=this.loaded,ct=tt.uid;nt&&nt[ct]&&delete nt[ct]}}function I(vt,tt){if(vt.length!==0){R(vt[0],tt);for(var nt=1;nt<vt.length;nt++)R(vt[nt],!tt)}}function R(vt,tt){for(var nt=0,ct=0,mt=0,Rt=vt.length,Dt=Rt-1;mt<Rt;Dt=mt++){var Ut=(vt[mt][0]-vt[Dt][0])*(vt[Dt][1]+vt[mt][1]),ft=nt+Ut;ct+=Math.abs(nt)>=Math.abs(Ut)?nt-ft+Ut:Ut-ft+nt,nt=ft}nt+ct>=0!=!!tt&&vt.reverse()}var N=n.bu(function vt(tt,nt){var ct,mt=tt&&tt.type;if(mt===\"FeatureCollection\")for(ct=0;ct<tt.features.length;ct++)vt(tt.features[ct],nt);else if(mt===\"GeometryCollection\")for(ct=0;ct<tt.geometries.length;ct++)vt(tt.geometries[ct],nt);else if(mt===\"Feature\")vt(tt.geometry,nt);else if(mt===\"Polygon\")I(tt.coordinates,nt);else if(mt===\"MultiPolygon\")for(ct=0;ct<tt.coordinates.length;ct++)I(tt.coordinates[ct],nt);return tt});let j=n.bp.VectorTileFeature.prototype.toGeoJSON;var Y={exports:{}},it=n.bv,Z=n.bp.VectorTileFeature,K=J;function J(vt,tt){this.options=tt||{},this.features=vt,this.length=vt.length}function ht(vt,tt){this.id=typeof vt.id==\"number\"?vt.id:void 0,this.type=vt.type,this.rawGeometry=vt.type===1?[vt.geometry]:vt.geometry,this.properties=vt.tags,this.extent=tt||4096}J.prototype.feature=function(vt){return new ht(this.features[vt],this.options.extent)},ht.prototype.loadGeometry=function(){var vt=this.rawGeometry;this.geometry=[];for(var tt=0;tt<vt.length;tt++){for(var nt=vt[tt],ct=[],mt=0;mt<nt.length;mt++)ct.push(new it(nt[mt][0],nt[mt][1]));this.geometry.push(ct)}return this.geometry},ht.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var vt=this.geometry,tt=1/0,nt=-1/0,ct=1/0,mt=-1/0,Rt=0;Rt<vt.length;Rt++)for(var Dt=vt[Rt],Ut=0;Ut<Dt.length;Ut++){var ft=Dt[Ut];tt=Math.min(tt,ft.x),nt=Math.max(nt,ft.x),ct=Math.min(ct,ft.y),mt=Math.max(mt,ft.y)}return[tt,ct,nt,mt]},ht.prototype.toGeoJSON=Z.prototype.toGeoJSON;var Tt=n.bw,Ot=K;function Yt(vt){var tt=new Tt;return function(nt,ct){for(var mt in nt.layers)ct.writeMessage(3,te,nt.layers[mt])}(vt,tt),tt.finish()}function te(vt,tt){var nt;tt.writeVarintField(15,vt.version||1),tt.writeStringField(1,vt.name||\"\"),tt.writeVarintField(5,vt.extent||4096);var ct={keys:[],values:[],keycache:{},valuecache:{}};for(nt=0;nt<vt.length;nt++)ct.feature=vt.feature(nt),tt.writeMessage(2,oe,ct);var mt=ct.keys;for(nt=0;nt<mt.length;nt++)tt.writeStringField(3,mt[nt]);var Rt=ct.values;for(nt=0;nt<Rt.length;nt++)tt.writeMessage(4,Cr,Rt[nt])}function oe(vt,tt){var nt=vt.feature;nt.id!==void 0&&tt.writeVarintField(1,nt.id),tt.writeMessage(2,ae,vt),tt.writeVarintField(3,nt.type),tt.writeMessage(4,lr,nt)}function ae(vt,tt){var nt=vt.feature,ct=vt.keys,mt=vt.values,Rt=vt.keycache,Dt=vt.valuecache;for(var Ut in nt.properties){var ft=nt.properties[Ut],jt=Rt[Ut];if(ft!==null){jt===void 0&&(ct.push(Ut),Rt[Ut]=jt=ct.length-1),tt.writeVarint(jt);var le=typeof ft;le!==\"string\"&&le!==\"boolean\"&&le!==\"number\"&&(ft=JSON.stringify(ft));var ee=le+\":\"+ft,re=Dt[ee];re===void 0&&(mt.push(ft),Dt[ee]=re=mt.length-1),tt.writeVarint(re)}}}function Le(vt,tt){return(tt<<3)+(7&vt)}function sr(vt){return vt<<1^vt>>31}function lr(vt,tt){for(var nt=vt.loadGeometry(),ct=vt.type,mt=0,Rt=0,Dt=nt.length,Ut=0;Ut<Dt;Ut++){var ft=nt[Ut],jt=1;ct===1&&(jt=ft.length),tt.writeVarint(Le(1,jt));for(var le=ct===3?ft.length-1:ft.length,ee=0;ee<le;ee++){ee===1&&ct!==1&&tt.writeVarint(Le(2,le-1));var re=ft[ee].x-mt,Je=ft[ee].y-Rt;tt.writeVarint(sr(re)),tt.writeVarint(sr(Je)),mt+=re,Rt+=Je}ct===3&&tt.writeVarint(Le(7,1))}}function Cr(vt,tt){var nt=typeof vt;nt===\"string\"?tt.writeStringField(1,vt):nt===\"boolean\"?tt.writeBooleanField(7,vt):nt===\"number\"&&(vt%1!=0?tt.writeDoubleField(3,vt):vt<0?tt.writeSVarintField(6,vt):tt.writeVarintField(5,vt))}Y.exports=Yt,Y.exports.fromVectorTileJs=Yt,Y.exports.fromGeojsonVt=function(vt,tt){tt=tt||{};var nt={};for(var ct in vt)nt[ct]=new Ot(vt[ct].features,tt),nt[ct].name=ct,nt[ct].version=tt.version,nt[ct].extent=tt.extent;return Yt({layers:nt})},Y.exports.GeoJSONWrapper=Ot;var un=n.bu(Y.exports);let Fs={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:vt=>vt},Sc=Math.fround||(ws=new Float32Array(1),vt=>(ws[0]=+vt,ws[0]));var ws;let io=3,Ss=5,_o=6;class oa{constructor(tt){this.options=Object.assign(Object.create(Fs),tt),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(tt){let{log:nt,minZoom:ct,maxZoom:mt}=this.options;nt&&console.time(\"total time\");let Rt=`prepare ${tt.length} points`;nt&&console.time(Rt),this.points=tt;let Dt=[];for(let ft=0;ft<tt.length;ft++){let jt=tt[ft];if(!jt.geometry)continue;let[le,ee]=jt.geometry.coordinates,re=Sc(Uo(le)),Je=Sc(Ci(ee));Dt.push(re,Je,1/0,ft,-1,1),this.options.reduce&&Dt.push(0)}let Ut=this.trees[mt+1]=this._createTree(Dt);nt&&console.timeEnd(Rt);for(let ft=mt;ft>=ct;ft--){let jt=+Date.now();Ut=this.trees[ft]=this._createTree(this._cluster(Ut,ft)),nt&&console.log(\"z%d: %d clusters in %dms\",ft,Ut.numItems,+Date.now()-jt)}return nt&&console.timeEnd(\"total time\"),this}getClusters(tt,nt){let ct=((tt[0]+180)%360+360)%360-180,mt=Math.max(-90,Math.min(90,tt[1])),Rt=tt[2]===180?180:((tt[2]+180)%360+360)%360-180,Dt=Math.max(-90,Math.min(90,tt[3]));if(tt[2]-tt[0]>=360)ct=-180,Rt=180;else if(ct>Rt){let ee=this.getClusters([ct,mt,180,Dt],nt),re=this.getClusters([-180,mt,Rt,Dt],nt);return ee.concat(re)}let Ut=this.trees[this._limitZoom(nt)],ft=Ut.range(Uo(ct),Ci(Dt),Uo(Rt),Ci(mt)),jt=Ut.data,le=[];for(let ee of ft){let re=this.stride*ee;le.push(jt[re+Ss]>1?sl(jt,re,this.clusterProps):this.points[jt[re+io]])}return le}getChildren(tt){let nt=this._getOriginId(tt),ct=this._getOriginZoom(tt),mt=\"No cluster with the specified id.\",Rt=this.trees[ct];if(!Rt)throw new Error(mt);let Dt=Rt.data;if(nt*this.stride>=Dt.length)throw new Error(mt);let Ut=this.options.radius/(this.options.extent*Math.pow(2,ct-1)),ft=Rt.within(Dt[nt*this.stride],Dt[nt*this.stride+1],Ut),jt=[];for(let le of ft){let ee=le*this.stride;Dt[ee+4]===tt&&jt.push(Dt[ee+Ss]>1?sl(Dt,ee,this.clusterProps):this.points[Dt[ee+io]])}if(jt.length===0)throw new Error(mt);return jt}getLeaves(tt,nt,ct){let mt=[];return this._appendLeaves(mt,tt,nt=nt||10,ct=ct||0,0),mt}getTile(tt,nt,ct){let mt=this.trees[this._limitZoom(tt)],Rt=Math.pow(2,tt),{extent:Dt,radius:Ut}=this.options,ft=Ut/Dt,jt=(ct-ft)/Rt,le=(ct+1+ft)/Rt,ee={features:[]};return this._addTileFeatures(mt.range((nt-ft)/Rt,jt,(nt+1+ft)/Rt,le),mt.data,nt,ct,Rt,ee),nt===0&&this._addTileFeatures(mt.range(1-ft/Rt,jt,1,le),mt.data,Rt,ct,Rt,ee),nt===Rt-1&&this._addTileFeatures(mt.range(0,jt,ft/Rt,le),mt.data,-1,ct,Rt,ee),ee.features.length?ee:null}getClusterExpansionZoom(tt){let nt=this._getOriginZoom(tt)-1;for(;nt<=this.options.maxZoom;){let ct=this.getChildren(tt);if(nt++,ct.length!==1)break;tt=ct[0].properties.cluster_id}return nt}_appendLeaves(tt,nt,ct,mt,Rt){let Dt=this.getChildren(nt);for(let Ut of Dt){let ft=Ut.properties;if(ft&&ft.cluster?Rt+ft.point_count<=mt?Rt+=ft.point_count:Rt=this._appendLeaves(tt,ft.cluster_id,ct,mt,Rt):Rt<mt?Rt++:tt.push(Ut),tt.length===ct)break}return Rt}_createTree(tt){let nt=new n.au(tt.length/this.stride|0,this.options.nodeSize,Float32Array);for(let ct=0;ct<tt.length;ct+=this.stride)nt.add(tt[ct],tt[ct+1]);return nt.finish(),nt.data=tt,nt}_addTileFeatures(tt,nt,ct,mt,Rt,Dt){for(let Ut of tt){let ft=Ut*this.stride,jt=nt[ft+Ss]>1,le,ee,re;if(jt)le=Ia(nt,ft,this.clusterProps),ee=nt[ft],re=nt[ft+1];else{let kr=this.points[nt[ft+io]];le=kr.properties;let[_r,ii]=kr.geometry.coordinates;ee=Uo(_r),re=Ci(ii)}let Je={type:1,geometry:[[Math.round(this.options.extent*(ee*Rt-ct)),Math.round(this.options.extent*(re*Rt-mt))]],tags:le},ir;ir=jt||this.options.generateId?nt[ft+io]:this.points[nt[ft+io]].id,ir!==void 0&&(Je.id=ir),Dt.features.push(Je)}}_limitZoom(tt){return Math.max(this.options.minZoom,Math.min(Math.floor(+tt),this.options.maxZoom+1))}_cluster(tt,nt){let{radius:ct,extent:mt,reduce:Rt,minPoints:Dt}=this.options,Ut=ct/(mt*Math.pow(2,nt)),ft=tt.data,jt=[],le=this.stride;for(let ee=0;ee<ft.length;ee+=le){if(ft[ee+2]<=nt)continue;ft[ee+2]=nt;let re=ft[ee],Je=ft[ee+1],ir=tt.within(ft[ee],ft[ee+1],Ut),kr=ft[ee+Ss],_r=kr;for(let ii of ir){let Si=ii*le;ft[Si+2]>nt&&(_r+=ft[Si+Ss])}if(_r>kr&&_r>=Dt){let ii,Si=re*kr,Wi=Je*kr,bn=-1,Rr=((ee/le|0)<<5)+(nt+1)+this.points.length;for(let Ji of ir){let tn=Ji*le;if(ft[tn+2]<=nt)continue;ft[tn+2]=nt;let es=ft[tn+Ss];Si+=ft[tn]*es,Wi+=ft[tn+1]*es,ft[tn+4]=Rr,Rt&&(ii||(ii=this._map(ft,ee,!0),bn=this.clusterProps.length,this.clusterProps.push(ii)),Rt(ii,this._map(ft,tn)))}ft[ee+4]=Rr,jt.push(Si/_r,Wi/_r,1/0,Rr,-1,_r),Rt&&jt.push(bn)}else{for(let ii=0;ii<le;ii++)jt.push(ft[ee+ii]);if(_r>1)for(let ii of ir){let Si=ii*le;if(!(ft[Si+2]<=nt)){ft[Si+2]=nt;for(let Wi=0;Wi<le;Wi++)jt.push(ft[Si+Wi])}}}}return jt}_getOriginId(tt){return tt-this.points.length>>5}_getOriginZoom(tt){return(tt-this.points.length)%32}_map(tt,nt,ct){if(tt[nt+Ss]>1){let Dt=this.clusterProps[tt[nt+_o]];return ct?Object.assign({},Dt):Dt}let mt=this.points[tt[nt+io]].properties,Rt=this.options.map(mt);return ct&&Rt===mt?Object.assign({},Rt):Rt}}function sl(vt,tt,nt){return{type:\"Feature\",id:vt[tt+io],properties:Ia(vt,tt,nt),geometry:{type:\"Point\",coordinates:[(ct=vt[tt],360*(ct-.5)),yo(vt[tt+1])]}};var ct}function Ia(vt,tt,nt){let ct=vt[tt+Ss],mt=ct>=1e4?`${Math.round(ct/1e3)}k`:ct>=1e3?Math.round(ct/100)/10+\"k\":ct,Rt=vt[tt+_o],Dt=Rt===-1?{}:Object.assign({},nt[Rt]);return Object.assign(Dt,{cluster:!0,cluster_id:vt[tt+io],point_count:ct,point_count_abbreviated:mt})}function Uo(vt){return vt/360+.5}function Ci(vt){let tt=Math.sin(vt*Math.PI/180),nt=.5-.25*Math.log((1+tt)/(1-tt))/Math.PI;return nt<0?0:nt>1?1:nt}function yo(vt){let tt=(180-360*vt)*Math.PI/180;return 360*Math.atan(Math.exp(tt))/Math.PI-90}function Oi(vt,tt,nt,ct){for(var mt,Rt=ct,Dt=nt-tt>>1,Ut=nt-tt,ft=vt[tt],jt=vt[tt+1],le=vt[nt],ee=vt[nt+1],re=tt+3;re<nt;re+=3){var Je=ls(vt[re],vt[re+1],ft,jt,le,ee);if(Je>Rt)mt=re,Rt=Je;else if(Je===Rt){var ir=Math.abs(re-Dt);ir<Ut&&(mt=re,Ut=ir)}}Rt>ct&&(mt-tt>3&&Oi(vt,tt,mt,ct),vt[mt+2]=Rt,nt-mt>3&&Oi(vt,mt,nt,ct))}function ls(vt,tt,nt,ct,mt,Rt){var Dt=mt-nt,Ut=Rt-ct;if(Dt!==0||Ut!==0){var ft=((vt-nt)*Dt+(tt-ct)*Ut)/(Dt*Dt+Ut*Ut);ft>1?(nt=mt,ct=Rt):ft>0&&(nt+=Dt*ft,ct+=Ut*ft)}return(Dt=vt-nt)*Dt+(Ut=tt-ct)*Ut}function Vo(vt,tt,nt,ct){var mt={id:vt===void 0?null:vt,type:tt,geometry:nt,tags:ct,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Rt){var Dt=Rt.geometry,Ut=Rt.type;if(Ut===\"Point\"||Ut===\"MultiPoint\"||Ut===\"LineString\")jo(Rt,Dt);else if(Ut===\"Polygon\"||Ut===\"MultiLineString\")for(var ft=0;ft<Dt.length;ft++)jo(Rt,Dt[ft]);else if(Ut===\"MultiPolygon\")for(ft=0;ft<Dt.length;ft++)for(var jt=0;jt<Dt[ft].length;jt++)jo(Rt,Dt[ft][jt])}(mt),mt}function jo(vt,tt){for(var nt=0;nt<tt.length;nt+=3)vt.minX=Math.min(vt.minX,tt[nt]),vt.minY=Math.min(vt.minY,tt[nt+1]),vt.maxX=Math.max(vt.maxX,tt[nt]),vt.maxY=Math.max(vt.maxY,tt[nt+1])}function Go(vt,tt,nt,ct){if(tt.geometry){var mt=tt.geometry.coordinates,Rt=tt.geometry.type,Dt=Math.pow(nt.tolerance/((1<<nt.maxZoom)*nt.extent),2),Ut=[],ft=tt.id;if(nt.promoteId?ft=tt.properties[nt.promoteId]:nt.generateId&&(ft=ct||0),Rt===\"Point\")an(mt,Ut);else if(Rt===\"MultiPoint\")for(var jt=0;jt<mt.length;jt++)an(mt[jt],Ut);else if(Rt===\"LineString\")aa(mt,Ut,Dt,!1);else if(Rt===\"MultiLineString\"){if(nt.lineMetrics){for(jt=0;jt<mt.length;jt++)aa(mt[jt],Ut=[],Dt,!1),vt.push(Vo(ft,\"LineString\",Ut,tt.properties));return}Jt(mt,Ut,Dt,!1)}else if(Rt===\"Polygon\")Jt(mt,Ut,Dt,!0);else{if(Rt!==\"MultiPolygon\"){if(Rt===\"GeometryCollection\"){for(jt=0;jt<tt.geometry.geometries.length;jt++)Go(vt,{id:ft,geometry:tt.geometry.geometries[jt],properties:tt.properties},nt,ct);return}throw new Error(\"Input data is not a valid GeoJSON object.\")}for(jt=0;jt<mt.length;jt++){var le=[];Jt(mt[jt],le,Dt,!0),Ut.push(le)}}vt.push(Vo(ft,Rt,Ut,tt.properties))}}function an(vt,tt){tt.push(vo(vt[0])),tt.push(hu(vt[1])),tt.push(0)}function aa(vt,tt,nt,ct){for(var mt,Rt,Dt=0,Ut=0;Ut<vt.length;Ut++){var ft=vo(vt[Ut][0]),jt=hu(vt[Ut][1]);tt.push(ft),tt.push(jt),tt.push(0),Ut>0&&(Dt+=ct?(mt*jt-ft*Rt)/2:Math.sqrt(Math.pow(ft-mt,2)+Math.pow(jt-Rt,2))),mt=ft,Rt=jt}var le=tt.length-3;tt[2]=1,Oi(tt,0,le,nt),tt[le+2]=1,tt.size=Math.abs(Dt),tt.start=0,tt.end=tt.size}function Jt(vt,tt,nt,ct){for(var mt=0;mt<vt.length;mt++){var Rt=[];aa(vt[mt],Rt,nt,ct),tt.push(Rt)}}function vo(vt){return vt/360+.5}function hu(vt){var tt=Math.sin(vt*Math.PI/180),nt=.5-.25*Math.log((1+tt)/(1-tt))/Math.PI;return nt<0?0:nt>1?1:nt}function ti(vt,tt,nt,ct,mt,Rt,Dt,Ut){if(ct/=tt,Rt>=(nt/=tt)&&Dt<ct)return vt;if(Dt<nt||Rt>=ct)return null;for(var ft=[],jt=0;jt<vt.length;jt++){var le=vt[jt],ee=le.geometry,re=le.type,Je=mt===0?le.minX:le.minY,ir=mt===0?le.maxX:le.maxY;if(Je>=nt&&ir<ct)ft.push(le);else if(!(ir<nt||Je>=ct)){var kr=[];if(re===\"Point\"||re===\"MultiPoint\")In(ee,kr,nt,ct,mt);else if(re===\"LineString\")xn(ee,kr,nt,ct,mt,!1,Ut.lineMetrics);else if(re===\"MultiLineString\")Dl(ee,kr,nt,ct,mt,!1);else if(re===\"Polygon\")Dl(ee,kr,nt,ct,mt,!0);else if(re===\"MultiPolygon\")for(var _r=0;_r<ee.length;_r++){var ii=[];Dl(ee[_r],ii,nt,ct,mt,!0),ii.length&&kr.push(ii)}if(kr.length){if(Ut.lineMetrics&&re===\"LineString\"){for(_r=0;_r<kr.length;_r++)ft.push(Vo(le.id,re,kr[_r],le.tags));continue}re!==\"LineString\"&&re!==\"MultiLineString\"||(kr.length===1?(re=\"LineString\",kr=kr[0]):re=\"MultiLineString\"),re!==\"Point\"&&re!==\"MultiPoint\"||(re=kr.length===3?\"Point\":\"MultiPoint\"),ft.push(Vo(le.id,re,kr,le.tags))}}}return ft.length?ft:null}function In(vt,tt,nt,ct,mt){for(var Rt=0;Rt<vt.length;Rt+=3){var Dt=vt[Rt+mt];Dt>=nt&&Dt<=ct&&(tt.push(vt[Rt]),tt.push(vt[Rt+1]),tt.push(vt[Rt+2]))}}function xn(vt,tt,nt,ct,mt,Rt,Dt){for(var Ut,ft,jt=Wo(vt),le=mt===0?Tc:hf,ee=vt.start,re=0;re<vt.length-3;re+=3){var Je=vt[re],ir=vt[re+1],kr=vt[re+2],_r=vt[re+3],ii=vt[re+4],Si=mt===0?Je:ir,Wi=mt===0?_r:ii,bn=!1;Dt&&(Ut=Math.sqrt(Math.pow(Je-_r,2)+Math.pow(ir-ii,2))),Si<nt?Wi>nt&&(ft=le(jt,Je,ir,_r,ii,nt),Dt&&(jt.start=ee+Ut*ft)):Si>ct?Wi<ct&&(ft=le(jt,Je,ir,_r,ii,ct),Dt&&(jt.start=ee+Ut*ft)):Ca(jt,Je,ir,kr),Wi<nt&&Si>=nt&&(ft=le(jt,Je,ir,_r,ii,nt),bn=!0),Wi>ct&&Si<=ct&&(ft=le(jt,Je,ir,_r,ii,ct),bn=!0),!Rt&&bn&&(Dt&&(jt.end=ee+Ut*ft),tt.push(jt),jt=Wo(vt)),Dt&&(ee+=Ut)}var Rr=vt.length-3;Je=vt[Rr],ir=vt[Rr+1],kr=vt[Rr+2],(Si=mt===0?Je:ir)>=nt&&Si<=ct&&Ca(jt,Je,ir,kr),Rr=jt.length-3,Rt&&Rr>=3&&(jt[Rr]!==jt[0]||jt[Rr+1]!==jt[1])&&Ca(jt,jt[0],jt[1],jt[2]),jt.length&&tt.push(jt)}function Wo(vt){var tt=[];return tt.size=vt.size,tt.start=vt.start,tt.end=vt.end,tt}function Dl(vt,tt,nt,ct,mt,Rt){for(var Dt=0;Dt<vt.length;Dt++)xn(vt[Dt],tt,nt,ct,mt,Rt,!1)}function Ca(vt,tt,nt,ct){vt.push(tt),vt.push(nt),vt.push(ct)}function Tc(vt,tt,nt,ct,mt,Rt){var Dt=(Rt-tt)/(ct-tt);return vt.push(Rt),vt.push(nt+(mt-nt)*Dt),vt.push(1),Dt}function hf(vt,tt,nt,ct,mt,Rt){var Dt=(Rt-nt)/(mt-nt);return vt.push(tt+(ct-tt)*Dt),vt.push(Rt),vt.push(1),Dt}function Ts(vt,tt){for(var nt=[],ct=0;ct<vt.length;ct++){var mt,Rt=vt[ct],Dt=Rt.type;if(Dt===\"Point\"||Dt===\"MultiPoint\"||Dt===\"LineString\")mt=Ae(Rt.geometry,tt);else if(Dt===\"MultiLineString\"||Dt===\"Polygon\"){mt=[];for(var Ut=0;Ut<Rt.geometry.length;Ut++)mt.push(Ae(Rt.geometry[Ut],tt))}else if(Dt===\"MultiPolygon\")for(mt=[],Ut=0;Ut<Rt.geometry.length;Ut++){for(var ft=[],jt=0;jt<Rt.geometry[Ut].length;jt++)ft.push(Ae(Rt.geometry[Ut][jt],tt));mt.push(ft)}nt.push(Vo(Rt.id,Dt,mt,Rt.tags))}return nt}function Ae(vt,tt){var nt=[];nt.size=vt.size,vt.start!==void 0&&(nt.start=vt.start,nt.end=vt.end);for(var ct=0;ct<vt.length;ct+=3)nt.push(vt[ct]+tt,vt[ct+1],vt[ct+2]);return nt}function Ho(vt,tt){if(vt.transformed)return vt;var nt,ct,mt,Rt=1<<vt.z,Dt=vt.x,Ut=vt.y;for(nt=0;nt<vt.features.length;nt++){var ft=vt.features[nt],jt=ft.geometry,le=ft.type;if(ft.geometry=[],le===1)for(ct=0;ct<jt.length;ct+=2)ft.geometry.push(Vn(jt[ct],jt[ct+1],tt,Rt,Dt,Ut));else for(ct=0;ct<jt.length;ct++){var ee=[];for(mt=0;mt<jt[ct].length;mt+=2)ee.push(Vn(jt[ct][mt],jt[ct][mt+1],tt,Rt,Dt,Ut));ft.geometry.push(ee)}}return vt.transformed=!0,vt}function Vn(vt,tt,nt,ct,mt,Rt){return[Math.round(nt*(vt*ct-mt)),Math.round(nt*(tt*ct-Rt))]}function La(vt,tt,nt,ct,mt){for(var Rt=tt===mt.maxZoom?0:mt.tolerance/((1<<tt)*mt.extent),Dt={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:nt,y:ct,z:tt,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},Ut=0;Ut<vt.length;Ut++){Dt.numFeatures++,ts(Dt,vt[Ut],Rt,mt);var ft=vt[Ut].minX,jt=vt[Ut].minY,le=vt[Ut].maxX,ee=vt[Ut].maxY;ft<Dt.minX&&(Dt.minX=ft),jt<Dt.minY&&(Dt.minY=jt),le>Dt.maxX&&(Dt.maxX=le),ee>Dt.maxY&&(Dt.maxY=ee)}return Dt}function ts(vt,tt,nt,ct){var mt=tt.geometry,Rt=tt.type,Dt=[];if(Rt===\"Point\"||Rt===\"MultiPoint\")for(var Ut=0;Ut<mt.length;Ut+=3)Dt.push(mt[Ut]),Dt.push(mt[Ut+1]),vt.numPoints++,vt.numSimplified++;else if(Rt===\"LineString\")be(Dt,mt,vt,nt,!1,!1);else if(Rt===\"MultiLineString\"||Rt===\"Polygon\")for(Ut=0;Ut<mt.length;Ut++)be(Dt,mt[Ut],vt,nt,Rt===\"Polygon\",Ut===0);else if(Rt===\"MultiPolygon\")for(var ft=0;ft<mt.length;ft++){var jt=mt[ft];for(Ut=0;Ut<jt.length;Ut++)be(Dt,jt[Ut],vt,nt,!0,Ut===0)}if(Dt.length){var le=tt.tags||null;if(Rt===\"LineString\"&&ct.lineMetrics){for(var ee in le={},tt.tags)le[ee]=tt.tags[ee];le.mapbox_clip_start=mt.start/mt.size,le.mapbox_clip_end=mt.end/mt.size}var re={geometry:Dt,type:Rt===\"Polygon\"||Rt===\"MultiPolygon\"?3:Rt===\"LineString\"||Rt===\"MultiLineString\"?2:1,tags:le};tt.id!==null&&(re.id=tt.id),vt.features.push(re)}}function be(vt,tt,nt,ct,mt,Rt){var Dt=ct*ct;if(ct>0&&tt.size<(mt?Dt:ct))nt.numPoints+=tt.length/3;else{for(var Ut=[],ft=0;ft<tt.length;ft+=3)(ct===0||tt[ft+2]>Dt)&&(nt.numSimplified++,Ut.push(tt[ft]),Ut.push(tt[ft+1])),nt.numPoints++;mt&&function(jt,le){for(var ee=0,re=0,Je=jt.length,ir=Je-2;re<Je;ir=re,re+=2)ee+=(jt[re]-jt[ir])*(jt[re+1]+jt[ir+1]);if(ee>0===le)for(re=0,Je=jt.length;re<Je/2;re+=2){var kr=jt[re],_r=jt[re+1];jt[re]=jt[Je-2-re],jt[re+1]=jt[Je-1-re],jt[Je-2-re]=kr,jt[Je-1-re]=_r}}(Ut,Rt),vt.push(Ut)}}function Lr(vt,tt){var nt=(tt=this.options=function(mt,Rt){for(var Dt in Rt)mt[Dt]=Rt[Dt];return mt}(Object.create(this.options),tt)).debug;if(nt&&console.time(\"preprocess data\"),tt.maxZoom<0||tt.maxZoom>24)throw new Error(\"maxZoom should be in the 0-24 range\");if(tt.promoteId&&tt.generateId)throw new Error(\"promoteId and generateId cannot be used together.\");var ct=function(mt,Rt){var Dt=[];if(mt.type===\"FeatureCollection\")for(var Ut=0;Ut<mt.features.length;Ut++)Go(Dt,mt.features[Ut],Rt,Ut);else Go(Dt,mt.type===\"Feature\"?mt:{geometry:mt},Rt);return Dt}(vt,tt);this.tiles={},this.tileCoords=[],nt&&(console.timeEnd(\"preprocess data\"),console.log(\"index: maxZoom: %d, maxPoints: %d\",tt.indexMaxZoom,tt.indexMaxPoints),console.time(\"generate tiles\"),this.stats={},this.total=0),ct=function(mt,Rt){var Dt=Rt.buffer/Rt.extent,Ut=mt,ft=ti(mt,1,-1-Dt,Dt,0,-1,2,Rt),jt=ti(mt,1,1-Dt,2+Dt,0,-1,2,Rt);return(ft||jt)&&(Ut=ti(mt,1,-Dt,1+Dt,0,-1,2,Rt)||[],ft&&(Ut=Ts(ft,1).concat(Ut)),jt&&(Ut=Ut.concat(Ts(jt,-1)))),Ut}(ct,tt),ct.length&&this.splitTile(ct,0,0,0),nt&&(ct.length&&console.log(\"features: %d, points: %d\",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd(\"generate tiles\"),console.log(\"tiles generated:\",this.total,JSON.stringify(this.stats)))}function wr(vt,tt,nt){return 32*((1<<vt)*nt+tt)+vt}function Cn(vt,tt){return tt?vt.properties[tt]:vt.id}function ka(vt,tt){if(vt==null)return!0;if(vt.type===\"Feature\")return Cn(vt,tt)!=null;if(vt.type===\"FeatureCollection\"){let nt=new Set;for(let ct of vt.features){let mt=Cn(ct,tt);if(mt==null||nt.has(mt))return!1;nt.add(mt)}return!0}return!1}function mr(vt,tt){let nt=new Map;if(vt!=null)if(vt.type===\"Feature\")nt.set(Cn(vt,tt),vt);else for(let ct of vt.features)nt.set(Cn(ct,tt),ct);return nt}Lr.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Lr.prototype.splitTile=function(vt,tt,nt,ct,mt,Rt,Dt){for(var Ut=[vt,tt,nt,ct],ft=this.options,jt=ft.debug;Ut.length;){ct=Ut.pop(),nt=Ut.pop(),tt=Ut.pop(),vt=Ut.pop();var le=1<<tt,ee=wr(tt,nt,ct),re=this.tiles[ee];if(!re&&(jt>1&&console.time(\"creation\"),re=this.tiles[ee]=La(vt,tt,nt,ct,ft),this.tileCoords.push({z:tt,x:nt,y:ct}),jt)){jt>1&&(console.log(\"tile z%d-%d-%d (features: %d, points: %d, simplified: %d)\",tt,nt,ct,re.numFeatures,re.numPoints,re.numSimplified),console.timeEnd(\"creation\"));var Je=\"z\"+tt;this.stats[Je]=(this.stats[Je]||0)+1,this.total++}if(re.source=vt,mt){if(tt===ft.maxZoom||tt===mt)continue;var ir=1<<mt-tt;if(nt!==Math.floor(Rt/ir)||ct!==Math.floor(Dt/ir))continue}else if(tt===ft.indexMaxZoom||re.numPoints<=ft.indexMaxPoints)continue;if(re.source=null,vt.length!==0){jt>1&&console.time(\"clipping\");var kr,_r,ii,Si,Wi,bn,Rr=.5*ft.buffer/ft.extent,Ji=.5-Rr,tn=.5+Rr,es=1+Rr;kr=_r=ii=Si=null,Wi=ti(vt,le,nt-Rr,nt+tn,0,re.minX,re.maxX,ft),bn=ti(vt,le,nt+Ji,nt+es,0,re.minX,re.maxX,ft),vt=null,Wi&&(kr=ti(Wi,le,ct-Rr,ct+tn,1,re.minY,re.maxY,ft),_r=ti(Wi,le,ct+Ji,ct+es,1,re.minY,re.maxY,ft),Wi=null),bn&&(ii=ti(bn,le,ct-Rr,ct+tn,1,re.minY,re.maxY,ft),Si=ti(bn,le,ct+Ji,ct+es,1,re.minY,re.maxY,ft),bn=null),jt>1&&console.timeEnd(\"clipping\"),Ut.push(kr||[],tt+1,2*nt,2*ct),Ut.push(_r||[],tt+1,2*nt,2*ct+1),Ut.push(ii||[],tt+1,2*nt+1,2*ct),Ut.push(Si||[],tt+1,2*nt+1,2*ct+1)}}},Lr.prototype.getTile=function(vt,tt,nt){var ct=this.options,mt=ct.extent,Rt=ct.debug;if(vt<0||vt>24)return null;var Dt=1<<vt,Ut=wr(vt,tt=(tt%Dt+Dt)%Dt,nt);if(this.tiles[Ut])return Ho(this.tiles[Ut],mt);Rt>1&&console.log(\"drilling down to z%d-%d-%d\",vt,tt,nt);for(var ft,jt=vt,le=tt,ee=nt;!ft&&jt>0;)jt--,le=Math.floor(le/2),ee=Math.floor(ee/2),ft=this.tiles[wr(jt,le,ee)];return ft&&ft.source?(Rt>1&&console.log(\"found parent tile z%d-%d-%d\",jt,le,ee),Rt>1&&console.time(\"drilling down\"),this.splitTile(ft.source,jt,le,ee,vt,tt,nt),Rt>1&&console.timeEnd(\"drilling down\"),this.tiles[Ut]?Ho(this.tiles[Ut],mt):null):null};class Mc extends _{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(tt,nt){return n._(this,void 0,void 0,function*(){let ct=tt.tileID.canonical;if(!this._geoJSONIndex)throw new Error(\"Unable to parse the data into a cluster or geojson\");let mt=this._geoJSONIndex.getTile(ct.z,ct.x,ct.y);if(!mt)return null;let Rt=new class{constructor(Ut){this.layers={_geojsonTileLayer:this},this.name=\"_geojsonTileLayer\",this.extent=n.W,this.length=Ut.length,this._features=Ut}feature(Ut){return new class{constructor(ft){this._feature=ft,this.extent=n.W,this.type=ft.type,this.properties=ft.tags,\"id\"in ft&&!isNaN(ft.id)&&(this.id=parseInt(ft.id,10))}loadGeometry(){if(this._feature.type===1){let ft=[];for(let jt of this._feature.geometry)ft.push([new n.P(jt[0],jt[1])]);return ft}{let ft=[];for(let jt of this._feature.geometry){let le=[];for(let ee of jt)le.push(new n.P(ee[0],ee[1]));ft.push(le)}return ft}}toGeoJSON(ft,jt,le){return j.call(this,ft,jt,le)}}(this._features[Ut])}}(mt.features),Dt=un(Rt);return Dt.byteOffset===0&&Dt.byteLength===Dt.buffer.byteLength||(Dt=new Uint8Array(Dt)),{vectorTile:Rt,rawData:Dt.buffer}})}loadData(tt){var nt;return n._(this,void 0,void 0,function*(){(nt=this._pendingRequest)===null||nt===void 0||nt.abort();let ct=!!(tt&&tt.request&&tt.request.collectResourceTiming)&&new n.br(tt.request);this._pendingRequest=new AbortController;try{let mt=yield this.loadGeoJSON(tt,this._pendingRequest);if(delete this._pendingRequest,typeof mt!=\"object\")throw new Error(`Input data given to '${tt.source}' is not a valid GeoJSON object.`);if(N(mt,!0),tt.filter){let Dt=n.bx(tt.filter,{type:\"boolean\",\"property-type\":\"data-driven\",overridable:!1,transition:!1});if(Dt.result===\"error\")throw new Error(Dt.value.map(ft=>`${ft.key}: ${ft.message}`).join(\", \"));mt={type:\"FeatureCollection\",features:mt.features.filter(ft=>Dt.value.evaluate({zoom:0},ft))}}this._geoJSONIndex=tt.cluster?new oa(function({superclusterOptions:Dt,clusterProperties:Ut}){if(!Ut||!Dt)return Dt;let ft={},jt={},le={accumulated:null,zoom:0},ee={properties:null},re=Object.keys(Ut);for(let Je of re){let[ir,kr]=Ut[Je],_r=n.bx(kr),ii=n.bx(typeof ir==\"string\"?[ir,[\"accumulated\"],[\"get\",Je]]:ir);ft[Je]=_r.value,jt[Je]=ii.value}return Dt.map=Je=>{ee.properties=Je;let ir={};for(let kr of re)ir[kr]=ft[kr].evaluate(le,ee);return ir},Dt.reduce=(Je,ir)=>{ee.properties=ir;for(let kr of re)le.accumulated=Je[kr],Je[kr]=jt[kr].evaluate(le,ee)},Dt}(tt)).load(mt.features):function(Dt,Ut){return new Lr(Dt,Ut)}(mt,tt.geojsonVtOptions),this.loaded={};let Rt={};if(ct){let Dt=ct.finish();Dt&&(Rt.resourceTiming={},Rt.resourceTiming[tt.source]=JSON.parse(JSON.stringify(Dt)))}return Rt}catch(mt){if(delete this._pendingRequest,n.by(mt))return{abandoned:!0};throw mt}})}reloadTile(tt){let nt=this.loaded;return nt&&nt[tt.uid]?super.reloadTile(tt):this.loadTile(tt)}loadGeoJSON(tt,nt){return n._(this,void 0,void 0,function*(){let{promoteId:ct}=tt;if(tt.request){let mt=yield n.h(tt.request,nt);return this._dataUpdateable=ka(mt.data,ct)?mr(mt.data,ct):void 0,mt.data}if(typeof tt.data==\"string\")try{let mt=JSON.parse(tt.data);return this._dataUpdateable=ka(mt,ct)?mr(mt,ct):void 0,mt}catch{throw new Error(`Input data given to '${tt.source}' is not a valid GeoJSON object.`)}if(!tt.dataDiff)throw new Error(`Input data given to '${tt.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${tt.source}`);return function(mt,Rt,Dt){var Ut,ft,jt,le;if(Rt.removeAll&&mt.clear(),Rt.remove)for(let ee of Rt.remove)mt.delete(ee);if(Rt.add)for(let ee of Rt.add){let re=Cn(ee,Dt);re!=null&&mt.set(re,ee)}if(Rt.update)for(let ee of Rt.update){let re=mt.get(ee.id);if(re==null)continue;let Je=!ee.removeAllProperties&&(((Ut=ee.removeProperties)===null||Ut===void 0?void 0:Ut.length)>0||((ft=ee.addOrUpdateProperties)===null||ft===void 0?void 0:ft.length)>0);if((ee.newGeometry||ee.removeAllProperties||Je)&&(re=Object.assign({},re),mt.set(ee.id,re),Je&&(re.properties=Object.assign({},re.properties))),ee.newGeometry&&(re.geometry=ee.newGeometry),ee.removeAllProperties)re.properties={};else if(((jt=ee.removeProperties)===null||jt===void 0?void 0:jt.length)>0)for(let ir of ee.removeProperties)Object.prototype.hasOwnProperty.call(re.properties,ir)&&delete re.properties[ir];if(((le=ee.addOrUpdateProperties)===null||le===void 0?void 0:le.length)>0)for(let{key:ir,value:kr}of ee.addOrUpdateProperties)re.properties[ir]=kr}}(this._dataUpdateable,tt.dataDiff,ct),{type:\"FeatureCollection\",features:Array.from(this._dataUpdateable.values())}})}removeSource(tt){return n._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(tt){return this._geoJSONIndex.getClusterExpansionZoom(tt.clusterId)}getClusterChildren(tt){return this._geoJSONIndex.getChildren(tt.clusterId)}getClusterLeaves(tt){return this._geoJSONIndex.getLeaves(tt.clusterId,tt.limit,tt.offset)}}class jn{constructor(tt){this.self=tt,this.actor=new n.C(tt),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(nt,ct)=>{if(this.externalWorkerSourceTypes[nt])throw new Error(`Worker source with name \"${nt}\" already registered.`);this.externalWorkerSourceTypes[nt]=ct},this.self.addProtocol=n.be,this.self.removeProtocol=n.bf,this.self.registerRTLTextPlugin=nt=>{if(n.bz.isParsed())throw new Error(\"RTL text plugin already registered.\");n.bz.setMethods(nt)},this.actor.registerMessageHandler(\"loadDEMTile\",(nt,ct)=>this._getDEMWorkerSource(nt,ct.source).loadTile(ct)),this.actor.registerMessageHandler(\"removeDEMTile\",(nt,ct)=>n._(this,void 0,void 0,function*(){this._getDEMWorkerSource(nt,ct.source).removeTile(ct)})),this.actor.registerMessageHandler(\"getClusterExpansionZoom\",(nt,ct)=>n._(this,void 0,void 0,function*(){return this._getWorkerSource(nt,ct.type,ct.source).getClusterExpansionZoom(ct)})),this.actor.registerMessageHandler(\"getClusterChildren\",(nt,ct)=>n._(this,void 0,void 0,function*(){return this._getWorkerSource(nt,ct.type,ct.source).getClusterChildren(ct)})),this.actor.registerMessageHandler(\"getClusterLeaves\",(nt,ct)=>n._(this,void 0,void 0,function*(){return this._getWorkerSource(nt,ct.type,ct.source).getClusterLeaves(ct)})),this.actor.registerMessageHandler(\"loadData\",(nt,ct)=>this._getWorkerSource(nt,ct.type,ct.source).loadData(ct)),this.actor.registerMessageHandler(\"loadTile\",(nt,ct)=>this._getWorkerSource(nt,ct.type,ct.source).loadTile(ct)),this.actor.registerMessageHandler(\"reloadTile\",(nt,ct)=>this._getWorkerSource(nt,ct.type,ct.source).reloadTile(ct)),this.actor.registerMessageHandler(\"abortTile\",(nt,ct)=>this._getWorkerSource(nt,ct.type,ct.source).abortTile(ct)),this.actor.registerMessageHandler(\"removeTile\",(nt,ct)=>this._getWorkerSource(nt,ct.type,ct.source).removeTile(ct)),this.actor.registerMessageHandler(\"removeSource\",(nt,ct)=>n._(this,void 0,void 0,function*(){if(!this.workerSources[nt]||!this.workerSources[nt][ct.type]||!this.workerSources[nt][ct.type][ct.source])return;let mt=this.workerSources[nt][ct.type][ct.source];delete this.workerSources[nt][ct.type][ct.source],mt.removeSource!==void 0&&mt.removeSource(ct)})),this.actor.registerMessageHandler(\"setReferrer\",(nt,ct)=>n._(this,void 0,void 0,function*(){this.referrer=ct})),this.actor.registerMessageHandler(\"syncRTLPluginState\",(nt,ct)=>this._syncRTLPluginState(nt,ct)),this.actor.registerMessageHandler(\"importScript\",(nt,ct)=>n._(this,void 0,void 0,function*(){this.self.importScripts(ct)})),this.actor.registerMessageHandler(\"setImages\",(nt,ct)=>this._setImages(nt,ct)),this.actor.registerMessageHandler(\"updateLayers\",(nt,ct)=>n._(this,void 0,void 0,function*(){this._getLayerIndex(nt).update(ct.layers,ct.removedIds)})),this.actor.registerMessageHandler(\"setLayers\",(nt,ct)=>n._(this,void 0,void 0,function*(){this._getLayerIndex(nt).replace(ct)}))}_setImages(tt,nt){return n._(this,void 0,void 0,function*(){this.availableImages[tt]=nt;for(let ct in this.workerSources[tt]){let mt=this.workerSources[tt][ct];for(let Rt in mt)mt[Rt].availableImages=nt}})}_syncRTLPluginState(tt,nt){return n._(this,void 0,void 0,function*(){n.bz.setState(nt);let ct=n.bz.getPluginURL();if(nt.pluginStatus===\"loaded\"&&!n.bz.isParsed()&&ct!=null){this.self.importScripts(ct);let mt=n.bz.isParsed();if(mt)return mt;throw new Error(`RTL Text Plugin failed to import scripts from ${ct}`)}return!1})}_getAvailableImages(tt){let nt=this.availableImages[tt];return nt||(nt=[]),nt}_getLayerIndex(tt){let nt=this.layerIndexes[tt];return nt||(nt=this.layerIndexes[tt]=new s),nt}_getWorkerSource(tt,nt,ct){if(this.workerSources[tt]||(this.workerSources[tt]={}),this.workerSources[tt][nt]||(this.workerSources[tt][nt]={}),!this.workerSources[tt][nt][ct]){let mt={sendAsync:(Rt,Dt)=>(Rt.targetMapId=tt,this.actor.sendAsync(Rt,Dt))};switch(nt){case\"vector\":this.workerSources[tt][nt][ct]=new _(mt,this._getLayerIndex(tt),this._getAvailableImages(tt));break;case\"geojson\":this.workerSources[tt][nt][ct]=new Mc(mt,this._getLayerIndex(tt),this._getAvailableImages(tt));break;default:this.workerSources[tt][nt][ct]=new this.externalWorkerSourceTypes[nt](mt,this._getLayerIndex(tt),this._getAvailableImages(tt))}}return this.workerSources[tt][nt][ct]}_getDEMWorkerSource(tt,nt){return this.demWorkerSources[tt]||(this.demWorkerSources[tt]={}),this.demWorkerSources[tt][nt]||(this.demWorkerSources[tt][nt]=new w),this.demWorkerSources[tt][nt]}}return n.i(self)&&(self.worker=new jn(self)),jn}),r(\"index\",[\"exports\",\"./shared\"],function(n,s){\"use strict\";var o=\"4.0.0\";let c,d,_={now:typeof performance<\"u\"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:T=>new Promise((l,f)=>{let v=requestAnimationFrame(l);T.signal.addEventListener(\"abort\",()=>{cancelAnimationFrame(v),f(s.c())})}),getImageData(T,l=0){return this.getImageCanvasContext(T).getImageData(-l,-l,T.width+2*l,T.height+2*l)},getImageCanvasContext(T){let l=window.document.createElement(\"canvas\"),f=l.getContext(\"2d\",{willReadFrequently:!0});if(!f)throw new Error(\"failed to create canvas 2d context\");return l.width=T.width,l.height=T.height,f.drawImage(T,0,0,T.width,T.height),f},resolveURL:T=>(c||(c=document.createElement(\"a\")),c.href=T,c.href),hardwareConcurrency:typeof navigator<\"u\"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(d==null&&(d=matchMedia(\"(prefers-reduced-motion: reduce)\")),d.matches)}};class w{static testProp(l){if(!w.docStyle)return l[0];for(let f=0;f<l.length;f++)if(l[f]in w.docStyle)return l[f];return l[0]}static create(l,f,v){let b=window.document.createElement(l);return f!==void 0&&(b.className=f),v&&v.appendChild(b),b}static createNS(l,f){return window.document.createElementNS(l,f)}static disableDrag(){w.docStyle&&w.selectProp&&(w.userSelect=w.docStyle[w.selectProp],w.docStyle[w.selectProp]=\"none\")}static enableDrag(){w.docStyle&&w.selectProp&&(w.docStyle[w.selectProp]=w.userSelect)}static setTransform(l,f){l.style[w.transformProp]=f}static addEventListener(l,f,v,b={}){l.addEventListener(f,v,\"passive\"in b?b:b.capture)}static removeEventListener(l,f,v,b={}){l.removeEventListener(f,v,\"passive\"in b?b:b.capture)}static suppressClickInternal(l){l.preventDefault(),l.stopPropagation(),window.removeEventListener(\"click\",w.suppressClickInternal,!0)}static suppressClick(){window.addEventListener(\"click\",w.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener(\"click\",w.suppressClickInternal,!0)},0)}static getScale(l){let f=l.getBoundingClientRect();return{x:f.width/l.offsetWidth||1,y:f.height/l.offsetHeight||1,boundingClientRect:f}}static getPoint(l,f,v){let b=f.boundingClientRect;return new s.P((v.clientX-b.left)/f.x-l.clientLeft,(v.clientY-b.top)/f.y-l.clientTop)}static mousePos(l,f){let v=w.getScale(l);return w.getPoint(l,v,f)}static touchPos(l,f){let v=[],b=w.getScale(l);for(let M=0;M<f.length;M++)v.push(w.getPoint(l,b,f[M]));return v}static mouseButton(l){return l.button}static remove(l){l.parentNode&&l.parentNode.removeChild(l)}}w.docStyle=typeof window<\"u\"&&window.document&&window.document.documentElement.style,w.selectProp=w.testProp([\"userSelect\",\"MozUserSelect\",\"WebkitUserSelect\",\"msUserSelect\"]),w.transformProp=w.testProp([\"transform\",\"WebkitTransform\"]);let I={supported:!1,testSupport:function(T){!j&&N&&(Y?it(T):R=T)}},R,N,j=!1,Y=!1;function it(T){let l=T.createTexture();T.bindTexture(T.TEXTURE_2D,l);try{if(T.texImage2D(T.TEXTURE_2D,0,T.RGBA,T.RGBA,T.UNSIGNED_BYTE,N),T.isContextLost())return;I.supported=!0}catch{}T.deleteTexture(l),j=!0}var Z,K;typeof document<\"u\"&&(N=document.createElement(\"img\"),N.onload=function(){R&&it(R),R=null,Y=!0},N.onerror=function(){j=!0,R=null},N.src=\"data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=\"),function(T){let l,f,v,b;T.resetRequestQueue=()=>{l=[],f=0,v=0,b={}},T.addThrottleControl=U=>{let W=v++;return b[W]=U,W},T.removeThrottleControl=U=>{delete b[U],O()},T.getImage=(U,W,$=!0)=>new Promise((X,at)=>{I.supported&&(U.headers||(U.headers={}),U.headers.accept=\"image/webp,*/*\"),s.e(U,{type:\"image\"}),l.push({abortController:W,requestParameters:U,supportImageRefresh:$,state:\"queued\",onError:gt=>{at(gt)},onSuccess:gt=>{X(gt)}}),O()});let M=U=>s._(this,void 0,void 0,function*(){U.state=\"running\";let{requestParameters:W,supportImageRefresh:$,onError:X,onSuccess:at,abortController:gt}=U,_t=$===!1&&!s.i(self)&&!s.g(W.url)&&(!W.headers||Object.keys(W.headers).reduce((kt,Wt)=>kt&&Wt===\"accept\",!0));f++;let yt=_t?F(W,gt):s.m(W,gt);try{let kt=yield yt;delete U.abortController,U.state=\"completed\",kt.data instanceof HTMLImageElement||s.b(kt.data)?at(kt):kt.data&&at({data:yield(At=kt.data,typeof createImageBitmap==\"function\"?s.d(At):s.f(At)),cacheControl:kt.cacheControl,expires:kt.expires})}catch(kt){delete U.abortController,X(kt)}finally{f--,O()}var At}),O=()=>{let U=(()=>{for(let W of Object.keys(b))if(b[W]())return!0;return!1})()?s.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:s.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let W=f;W<U&&l.length>0;W++){let $=l.shift();$.abortController.signal.aborted?W--:M($)}},F=(U,W)=>new Promise(($,X)=>{let at=new Image,gt=U.url,_t=U.credentials;_t&&_t===\"include\"?at.crossOrigin=\"use-credentials\":(_t&&_t===\"same-origin\"||!s.s(gt))&&(at.crossOrigin=\"anonymous\"),W.signal.addEventListener(\"abort\",()=>{at.src=\"\",X(s.c())}),at.fetchPriority=\"high\",at.onload=()=>{at.onerror=at.onload=null,$({data:at})},at.onerror=()=>{at.onerror=at.onload=null,W.signal.aborted||X(new Error(\"Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.\"))},at.src=gt})}(Z||(Z={})),Z.resetRequestQueue(),function(T){T.Glyphs=\"Glyphs\",T.Image=\"Image\",T.Source=\"Source\",T.SpriteImage=\"SpriteImage\",T.SpriteJSON=\"SpriteJSON\",T.Style=\"Style\",T.Tile=\"Tile\",T.Unknown=\"Unknown\"}(K||(K={}));class J{constructor(l){this._transformRequestFn=l}transformRequest(l,f){return this._transformRequestFn&&this._transformRequestFn(l,f)||{url:l}}normalizeSpriteURL(l,f,v){let b=function(M){let O=M.match(ht);if(!O)throw new Error(`Unable to parse URL \"${M}\"`);return{protocol:O[1],authority:O[2],path:O[3]||\"/\",params:O[4]?O[4].split(\"&\"):[]}}(l);return b.path+=`${f}${v}`,function(M){let O=M.params.length?`?${M.params.join(\"&\")}`:\"\";return`${M.protocol}://${M.authority}${M.path}${O}`}(b)}setTransformRequest(l){this._transformRequestFn=l}}let ht=/^(\\w+):\\/\\/([^/?]*)(\\/[^?]+)?\\??(.+)?/;function Tt(T){var l=new s.A(3);return l[0]=T[0],l[1]=T[1],l[2]=T[2],l}var Ot,Yt=function(T,l,f){return T[0]=l[0]-f[0],T[1]=l[1]-f[1],T[2]=l[2]-f[2],T};Ot=new s.A(3),s.A!=Float32Array&&(Ot[0]=0,Ot[1]=0,Ot[2]=0);var te=function(T){var l=T[0],f=T[1];return l*l+f*f};function oe(T){let l=[];if(typeof T==\"string\")l.push({id:\"default\",url:T});else if(T&&T.length>0){let f=[];for(let{id:v,url:b}of T){let M=`${v}${b}`;f.indexOf(M)===-1&&(f.push(M),l.push({id:v,url:b}))}}return l}(function(){var T=new s.A(2);s.A!=Float32Array&&(T[0]=0,T[1]=0)})();class ae{constructor(l,f,v,b){this.context=l,this.format=v,this.texture=l.gl.createTexture(),this.update(f,b)}update(l,f,v){let{width:b,height:M}=l,O=!(this.size&&this.size[0]===b&&this.size[1]===M||v),{context:F}=this,{gl:U}=F;if(this.useMipmap=!!(f&&f.useMipmap),U.bindTexture(U.TEXTURE_2D,this.texture),F.pixelStoreUnpackFlipY.set(!1),F.pixelStoreUnpack.set(1),F.pixelStoreUnpackPremultiplyAlpha.set(this.format===U.RGBA&&(!f||f.premultiply!==!1)),O)this.size=[b,M],l instanceof HTMLImageElement||l instanceof HTMLCanvasElement||l instanceof HTMLVideoElement||l instanceof ImageData||s.b(l)?U.texImage2D(U.TEXTURE_2D,0,this.format,this.format,U.UNSIGNED_BYTE,l):U.texImage2D(U.TEXTURE_2D,0,this.format,b,M,0,this.format,U.UNSIGNED_BYTE,l.data);else{let{x:W,y:$}=v||{x:0,y:0};l instanceof HTMLImageElement||l instanceof HTMLCanvasElement||l instanceof HTMLVideoElement||l instanceof ImageData||s.b(l)?U.texSubImage2D(U.TEXTURE_2D,0,W,$,U.RGBA,U.UNSIGNED_BYTE,l):U.texSubImage2D(U.TEXTURE_2D,0,W,$,b,M,U.RGBA,U.UNSIGNED_BYTE,l.data)}this.useMipmap&&this.isSizePowerOfTwo()&&U.generateMipmap(U.TEXTURE_2D)}bind(l,f,v){let{context:b}=this,{gl:M}=b;M.bindTexture(M.TEXTURE_2D,this.texture),v!==M.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(v=M.LINEAR),l!==this.filter&&(M.texParameteri(M.TEXTURE_2D,M.TEXTURE_MAG_FILTER,l),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_MIN_FILTER,v||l),this.filter=l),f!==this.wrap&&(M.texParameteri(M.TEXTURE_2D,M.TEXTURE_WRAP_S,f),M.texParameteri(M.TEXTURE_2D,M.TEXTURE_WRAP_T,f),this.wrap=f)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:l}=this.context;l.deleteTexture(this.texture),this.texture=null}}function Le(T){let{userImage:l}=T;return!!(l&&l.render&&l.render())&&(T.data.replace(new Uint8Array(l.data.buffer)),!0)}class sr extends s.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new s.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(l){if(this.loaded!==l&&(this.loaded=l,l)){for(let{ids:f,promiseResolve:v}of this.requestors)v(this._getImagesForIds(f));this.requestors=[]}}getImage(l){let f=this.images[l];if(f&&!f.data&&f.spriteData){let v=f.spriteData;f.data=new s.R({width:v.width,height:v.height},v.context.getImageData(v.x,v.y,v.width,v.height).data),f.spriteData=null}return f}addImage(l,f){if(this.images[l])throw new Error(`Image id ${l} already exist, use updateImage instead`);this._validate(l,f)&&(this.images[l]=f)}_validate(l,f){let v=!0,b=f.data||f.spriteData;return this._validateStretch(f.stretchX,b&&b.width)||(this.fire(new s.j(new Error(`Image \"${l}\" has invalid \"stretchX\" value`))),v=!1),this._validateStretch(f.stretchY,b&&b.height)||(this.fire(new s.j(new Error(`Image \"${l}\" has invalid \"stretchY\" value`))),v=!1),this._validateContent(f.content,f)||(this.fire(new s.j(new Error(`Image \"${l}\" has invalid \"content\" value`))),v=!1),v}_validateStretch(l,f){if(!l)return!0;let v=0;for(let b of l){if(b[0]<v||b[1]<b[0]||f<b[1])return!1;v=b[1]}return!0}_validateContent(l,f){if(!l)return!0;if(l.length!==4)return!1;let v=f.spriteData,b=v&&v.width||f.data.width,M=v&&v.height||f.data.height;return!(l[0]<0||b<l[0]||l[1]<0||M<l[1]||l[2]<0||b<l[2]||l[3]<0||M<l[3]||l[2]<l[0]||l[3]<l[1])}updateImage(l,f,v=!0){let b=this.getImage(l);if(v&&(b.data.width!==f.data.width||b.data.height!==f.data.height))throw new Error(`size mismatch between old image (${b.data.width}x${b.data.height}) and new image (${f.data.width}x${f.data.height}).`);f.version=b.version+1,this.images[l]=f,this.updatedImages[l]=!0}removeImage(l){let f=this.images[l];delete this.images[l],delete this.patterns[l],f.userImage&&f.userImage.onRemove&&f.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(l){return new Promise((f,v)=>{let b=!0;if(!this.isLoaded())for(let M of l)this.images[M]||(b=!1);this.isLoaded()||b?f(this._getImagesForIds(l)):this.requestors.push({ids:l,promiseResolve:f})})}_getImagesForIds(l){let f={};for(let v of l){let b=this.getImage(v);b||(this.fire(new s.k(\"styleimagemissing\",{id:v})),b=this.getImage(v)),b?f[v]={data:b.data.clone(),pixelRatio:b.pixelRatio,sdf:b.sdf,version:b.version,stretchX:b.stretchX,stretchY:b.stretchY,content:b.content,hasRenderCallback:!!(b.userImage&&b.userImage.render)}:s.w(`Image \"${v}\" could not be loaded. Please make sure you have added the image with map.addImage() or a \"sprite\" property in your style. You can provide missing images by listening for the \"styleimagemissing\" map event.`)}return f}getPixelSize(){let{width:l,height:f}=this.atlasImage;return{width:l,height:f}}getPattern(l){let f=this.patterns[l],v=this.getImage(l);if(!v)return null;if(f&&f.position.version===v.version)return f.position;if(f)f.position.version=v.version;else{let b={w:v.data.width+2,h:v.data.height+2,x:0,y:0},M=new s.I(b,v);this.patterns[l]={bin:b,position:M}}return this._updatePatternAtlas(),this.patterns[l].position}bind(l){let f=l.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new ae(l,this.atlasImage,f.RGBA),this.atlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE)}_updatePatternAtlas(){let l=[];for(let M in this.patterns)l.push(this.patterns[M].bin);let{w:f,h:v}=s.p(l),b=this.atlasImage;b.resize({width:f||1,height:v||1});for(let M in this.patterns){let{bin:O}=this.patterns[M],F=O.x+1,U=O.y+1,W=this.getImage(M).data,$=W.width,X=W.height;s.R.copy(W,b,{x:0,y:0},{x:F,y:U},{width:$,height:X}),s.R.copy(W,b,{x:0,y:X-1},{x:F,y:U-1},{width:$,height:1}),s.R.copy(W,b,{x:0,y:0},{x:F,y:U+X},{width:$,height:1}),s.R.copy(W,b,{x:$-1,y:0},{x:F-1,y:U},{width:1,height:X}),s.R.copy(W,b,{x:0,y:0},{x:F+$,y:U},{width:1,height:X})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(l){for(let f of l){if(this.callbackDispatchedThisFrame[f])continue;this.callbackDispatchedThisFrame[f]=!0;let v=this.getImage(f);v||s.w(`Image with ID: \"${f}\" was not found`),Le(v)&&this.updateImage(f,v)}}}let lr=1e20;function Cr(T,l,f,v,b,M,O,F,U){for(let W=l;W<l+v;W++)un(T,f*M+W,M,b,O,F,U);for(let W=f;W<f+b;W++)un(T,W*M+l,1,v,O,F,U)}function un(T,l,f,v,b,M,O){M[0]=0,O[0]=-lr,O[1]=lr,b[0]=T[l];for(let F=1,U=0,W=0;F<v;F++){b[F]=T[l+F*f];let $=F*F;do{let X=M[U];W=(b[F]-b[X]+$-X*X)/(F-X)/2}while(W<=O[U]&&--U>-1);U++,M[U]=F,O[U]=W,O[U+1]=lr}for(let F=0,U=0;F<v;F++){for(;O[U+1]<F;)U++;let W=M[U],$=F-W;T[l+F*f]=b[W]+$*$}}class Fs{constructor(l,f){this.requestManager=l,this.localIdeographFontFamily=f,this.entries={}}setURL(l){this.url=l}getGlyphs(l){return s._(this,void 0,void 0,function*(){let f=[];for(let M in l)for(let O of l[M])f.push(this._getAndCacheGlyphsPromise(M,O));let v=yield Promise.all(f),b={};for(let{stack:M,id:O,glyph:F}of v)b[M]||(b[M]={}),b[M][O]=F&&{id:F.id,bitmap:F.bitmap.clone(),metrics:F.metrics};return b})}_getAndCacheGlyphsPromise(l,f){return s._(this,void 0,void 0,function*(){let v=this.entries[l];v||(v=this.entries[l]={glyphs:{},requests:{},ranges:{}});let b=v.glyphs[f];if(b!==void 0)return{stack:l,id:f,glyph:b};if(b=this._tinySDF(v,l,f),b)return v.glyphs[f]=b,{stack:l,id:f,glyph:b};let M=Math.floor(f/256);if(256*M>65535)throw new Error(\"glyphs > 65535 not supported\");if(v.ranges[M])return{stack:l,id:f,glyph:b};if(!this.url)throw new Error(\"glyphsUrl is not set\");if(!v.requests[M]){let F=Fs.loadGlyphRange(l,M,this.url,this.requestManager);v.requests[M]=F}let O=yield v.requests[M];for(let F in O)this._doesCharSupportLocalGlyph(+F)||(v.glyphs[+F]=O[+F]);return v.ranges[M]=!0,{stack:l,id:f,glyph:O[f]||null}})}_doesCharSupportLocalGlyph(l){return!!this.localIdeographFontFamily&&(s.u[\"CJK Unified Ideographs\"](l)||s.u[\"Hangul Syllables\"](l)||s.u.Hiragana(l)||s.u.Katakana(l))}_tinySDF(l,f,v){let b=this.localIdeographFontFamily;if(!b||!this._doesCharSupportLocalGlyph(v))return;let M=l.tinySDF;if(!M){let F=\"400\";/bold/i.test(f)?F=\"900\":/medium/i.test(f)?F=\"500\":/light/i.test(f)&&(F=\"200\"),M=l.tinySDF=new Fs.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:b,fontWeight:F})}let O=M.draw(String.fromCharCode(v));return{id:v,bitmap:new s.o({width:O.width||60,height:O.height||60},O.data),metrics:{width:O.glyphWidth/2||24,height:O.glyphHeight/2||24,left:O.glyphLeft/2+.5||0,top:O.glyphTop/2-27.5||-8,advance:O.glyphAdvance/2||24,isDoubleResolution:!0}}}}Fs.loadGlyphRange=function(T,l,f,v){return s._(this,void 0,void 0,function*(){let b=256*l,M=b+255,O=v.transformRequest(f.replace(\"{fontstack}\",T).replace(\"{range}\",`${b}-${M}`),K.Glyphs),F=yield s.l(O,new AbortController);if(!F||!F.data)throw new Error(`Could not load glyph range. range: ${l}, ${b}-${M}`);let U={};for(let W of s.n(F.data))U[W.id]=W;return U})},Fs.TinySDF=class{constructor({fontSize:T=24,buffer:l=3,radius:f=8,cutoff:v=.25,fontFamily:b=\"sans-serif\",fontWeight:M=\"normal\",fontStyle:O=\"normal\"}={}){this.buffer=l,this.cutoff=v,this.radius=f;let F=this.size=T+4*l,U=this._createCanvas(F),W=this.ctx=U.getContext(\"2d\",{willReadFrequently:!0});W.font=`${O} ${M} ${T}px ${b}`,W.textBaseline=\"alphabetic\",W.textAlign=\"left\",W.fillStyle=\"black\",this.gridOuter=new Float64Array(F*F),this.gridInner=new Float64Array(F*F),this.f=new Float64Array(F),this.z=new Float64Array(F+1),this.v=new Uint16Array(F)}_createCanvas(T){let l=document.createElement(\"canvas\");return l.width=l.height=T,l}draw(T){let{width:l,actualBoundingBoxAscent:f,actualBoundingBoxDescent:v,actualBoundingBoxLeft:b,actualBoundingBoxRight:M}=this.ctx.measureText(T),O=Math.ceil(f),F=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(M-b))),U=Math.min(this.size-this.buffer,O+Math.ceil(v)),W=F+2*this.buffer,$=U+2*this.buffer,X=Math.max(W*$,0),at=new Uint8ClampedArray(X),gt={data:at,width:W,height:$,glyphWidth:F,glyphHeight:U,glyphTop:O,glyphLeft:0,glyphAdvance:l};if(F===0||U===0)return gt;let{ctx:_t,buffer:yt,gridInner:At,gridOuter:kt}=this;_t.clearRect(yt,yt,F,U),_t.fillText(T,yt,yt+O);let Wt=_t.getImageData(yt,yt,F,U);kt.fill(lr,0,X),At.fill(0,0,X);for(let St=0;St<U;St++)for(let Nt=0;Nt<F;Nt++){let Zt=Wt.data[4*(St*F+Nt)+3]/255;if(Zt===0)continue;let Ht=(St+yt)*W+Nt+yt;if(Zt===1)kt[Ht]=0,At[Ht]=lr;else{let ne=.5-Zt;kt[Ht]=ne>0?ne*ne:0,At[Ht]=ne<0?ne*ne:0}}Cr(kt,0,0,W,$,W,this.f,this.v,this.z),Cr(At,yt,yt,F,U,W,this.f,this.v,this.z);for(let St=0;St<X;St++){let Nt=Math.sqrt(kt[St])-Math.sqrt(At[St]);at[St]=Math.round(255-255*(Nt/this.radius+this.cutoff))}return gt}};class Sc{constructor(){this.specification=s.v.light.position}possiblyEvaluate(l,f){return s.y(l.expression.evaluate(f))}interpolate(l,f,v){return{x:s.z.number(l.x,f.x,v),y:s.z.number(l.y,f.y,v),z:s.z.number(l.z,f.z,v)}}}let ws;class io extends s.E{constructor(l){super(),ws=ws||new s.q({anchor:new s.D(s.v.light.anchor),position:new Sc,color:new s.D(s.v.light.color),intensity:new s.D(s.v.light.intensity)}),this._transitionable=new s.T(ws),this.setLight(l),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(l,f={}){if(!this._validate(s.r,l,f))for(let v in l){let b=l[v];v.endsWith(\"-transition\")?this._transitionable.setTransition(v.slice(0,-11),b):this._transitionable.setValue(v,b)}}updateTransitions(l){this._transitioning=this._transitionable.transitioned(l,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(l){this.properties=this._transitioning.possiblyEvaluate(l)}_validate(l,f,v){return(!v||v.validate!==!1)&&s.t(this,l.call(s.x,{value:f,style:{glyphs:!0,sprite:!0},styleSpec:s.v}))}}class Ss{constructor(l,f){this.width=l,this.height=f,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(l,f){let v=l.join(\",\")+String(f);return this.dashEntry[v]||(this.dashEntry[v]=this.addDash(l,f)),this.dashEntry[v]}getDashRanges(l,f,v){let b=[],M=l.length%2==1?-l[l.length-1]*v:0,O=l[0]*v,F=!0;b.push({left:M,right:O,isDash:F,zeroLength:l[0]===0});let U=l[0];for(let W=1;W<l.length;W++){F=!F;let $=l[W];M=U*v,U+=$,O=U*v,b.push({left:M,right:O,isDash:F,zeroLength:$===0})}return b}addRoundDash(l,f,v){let b=f/2;for(let M=-v;M<=v;M++){let O=this.width*(this.nextRow+v+M),F=0,U=l[F];for(let W=0;W<this.width;W++){W/U.right>1&&(U=l[++F]);let $=Math.abs(W-U.left),X=Math.abs(W-U.right),at=Math.min($,X),gt,_t=M/v*(b+1);if(U.isDash){let yt=b-Math.abs(_t);gt=Math.sqrt(at*at+yt*yt)}else gt=b-Math.sqrt(at*at+_t*_t);this.data[O+W]=Math.max(0,Math.min(255,gt+128))}}}addRegularDash(l){for(let F=l.length-1;F>=0;--F){let U=l[F],W=l[F+1];U.zeroLength?l.splice(F,1):W&&W.isDash===U.isDash&&(W.left=U.left,l.splice(F,1))}let f=l[0],v=l[l.length-1];f.isDash===v.isDash&&(f.left=v.left-this.width,v.right=f.right+this.width);let b=this.width*this.nextRow,M=0,O=l[M];for(let F=0;F<this.width;F++){F/O.right>1&&(O=l[++M]);let U=Math.abs(F-O.left),W=Math.abs(F-O.right),$=Math.min(U,W);this.data[b+F]=Math.max(0,Math.min(255,(O.isDash?$:-$)+128))}}addDash(l,f){let v=f?7:0,b=2*v+1;if(this.nextRow+b>this.height)return s.w(\"LineAtlas out of space\"),null;let M=0;for(let F=0;F<l.length;F++)M+=l[F];if(M!==0){let F=this.width/M,U=this.getDashRanges(l,this.width,F);f?this.addRoundDash(U,F,v):this.addRegularDash(U)}let O={y:(this.nextRow+v+.5)/this.height,height:2*v/this.height,width:M};return this.nextRow+=b,this.dirty=!0,O}bind(l){let f=l.gl;this.texture?(f.bindTexture(f.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,f.texSubImage2D(f.TEXTURE_2D,0,0,0,this.width,this.height,f.ALPHA,f.UNSIGNED_BYTE,this.data))):(this.texture=f.createTexture(),f.bindTexture(f.TEXTURE_2D,this.texture),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.REPEAT),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.REPEAT),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR),f.texImage2D(f.TEXTURE_2D,0,f.ALPHA,this.width,this.height,0,f.ALPHA,f.UNSIGNED_BYTE,this.data))}}let _o=\"maplibre_preloaded_worker_pool\";class oa{constructor(){this.active={}}acquire(l){if(!this.workers)for(this.workers=[];this.workers.length<oa.workerCount;)this.workers.push(new Worker(s.a.WORKER_URL));return this.active[l]=!0,this.workers.slice()}release(l){delete this.active[l],this.numActive()===0&&(this.workers.forEach(f=>{f.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[_o]}numActive(){return Object.keys(this.active).length}}let sl=Math.floor(_.hardwareConcurrency/2),Ia,Uo;function Ci(){return Ia||(Ia=new oa),Ia}oa.workerCount=s.B(globalThis)?Math.max(Math.min(sl,3),1):1;class yo{constructor(l,f){this.workerPool=l,this.actors=[],this.currentActor=0,this.id=f;let v=this.workerPool.acquire(f);for(let b=0;b<v.length;b++){let M=new s.C(v[b],f);M.name=`Worker ${b}`,this.actors.push(M)}if(!this.actors.length)throw new Error(\"No actors found\")}broadcast(l,f){let v=[];for(let b of this.actors)v.push(b.sendAsync({type:l,data:f}));return Promise.all(v)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(l=!0){this.actors.forEach(f=>{f.remove()}),this.actors=[],l&&this.workerPool.release(this.id)}registerMessageHandler(l,f){for(let v of this.actors)v.registerMessageHandler(l,f)}}function Oi(){return Uo||(Uo=new yo(Ci(),s.G),Uo.registerMessageHandler(\"getResource\",(T,l,f)=>s.m(l,f))),Uo}function ls(T,l){let f=s.F();return s.H(f,f,[1,1,0]),s.J(f,f,[.5*T.width,.5*T.height,1]),s.K(f,f,T.calculatePosMatrix(l.toUnwrapped()))}function Vo(T,l,f,v,b,M){let O=function(X,at,gt){if(X)for(let _t of X){let yt=at[_t];if(yt&&yt.source===gt&&yt.type===\"fill-extrusion\")return!0}else for(let _t in at){let yt=at[_t];if(yt.source===gt&&yt.type===\"fill-extrusion\")return!0}return!1}(b&&b.layers,l,T.id),F=M.maxPitchScaleFactor(),U=T.tilesIn(v,F,O);U.sort(jo);let W=[];for(let X of U)W.push({wrappedTileID:X.tileID.wrapped().key,queryResults:X.tile.queryRenderedFeatures(l,f,T._state,X.queryGeometry,X.cameraQueryGeometry,X.scale,b,M,F,ls(T.transform,X.tileID))});let $=function(X){let at={},gt={};for(let _t of X){let yt=_t.queryResults,At=_t.wrappedTileID,kt=gt[At]=gt[At]||{};for(let Wt in yt){let St=yt[Wt],Nt=kt[Wt]=kt[Wt]||{},Zt=at[Wt]=at[Wt]||[];for(let Ht of St)Nt[Ht.featureIndex]||(Nt[Ht.featureIndex]=!0,Zt.push(Ht))}}return at}(W);for(let X in $)$[X].forEach(at=>{let gt=at.feature,_t=T.getFeatureState(gt.layer[\"source-layer\"],gt.id);gt.source=gt.layer.source,gt.layer[\"source-layer\"]&&(gt.sourceLayer=gt.layer[\"source-layer\"]),gt.state=_t});return $}function jo(T,l){let f=T.tileID,v=l.tileID;return f.overscaledZ-v.overscaledZ||f.canonical.y-v.canonical.y||f.wrap-v.wrap||f.canonical.x-v.canonical.x}function Go(T,l,f){return s._(this,void 0,void 0,function*(){let v=T;if(T.url?v=(yield s.h(l.transformRequest(T.url,K.Source),f)).data:yield _.frameAsync(f),!v)return null;let b=s.L(s.e(v,T),[\"tiles\",\"minzoom\",\"maxzoom\",\"attribution\",\"bounds\",\"scheme\",\"tileSize\",\"encoding\"]);return\"vector_layers\"in v&&v.vector_layers&&(b.vectorLayerIds=v.vector_layers.map(M=>M.id)),b})}class an{constructor(l,f){l&&(f?this.setSouthWest(l).setNorthEast(f):Array.isArray(l)&&(l.length===4?this.setSouthWest([l[0],l[1]]).setNorthEast([l[2],l[3]]):this.setSouthWest(l[0]).setNorthEast(l[1])))}setNorthEast(l){return this._ne=l instanceof s.M?new s.M(l.lng,l.lat):s.M.convert(l),this}setSouthWest(l){return this._sw=l instanceof s.M?new s.M(l.lng,l.lat):s.M.convert(l),this}extend(l){let f=this._sw,v=this._ne,b,M;if(l instanceof s.M)b=l,M=l;else{if(!(l instanceof an))return Array.isArray(l)?l.length===4||l.every(Array.isArray)?this.extend(an.convert(l)):this.extend(s.M.convert(l)):l&&(\"lng\"in l||\"lon\"in l)&&\"lat\"in l?this.extend(s.M.convert(l)):this;if(b=l._sw,M=l._ne,!b||!M)return this}return f||v?(f.lng=Math.min(b.lng,f.lng),f.lat=Math.min(b.lat,f.lat),v.lng=Math.max(M.lng,v.lng),v.lat=Math.max(M.lat,v.lat)):(this._sw=new s.M(b.lng,b.lat),this._ne=new s.M(M.lng,M.lat)),this}getCenter(){return new s.M((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new s.M(this.getWest(),this.getNorth())}getSouthEast(){return new s.M(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(l){let{lng:f,lat:v}=s.M.convert(l),b=this._sw.lng<=f&&f<=this._ne.lng;return this._sw.lng>this._ne.lng&&(b=this._sw.lng>=f&&f>=this._ne.lng),this._sw.lat<=v&&v<=this._ne.lat&&b}static convert(l){return l instanceof an?l:l&&new an(l)}static fromLngLat(l,f=0){let v=360*f/40075017,b=v/Math.cos(Math.PI/180*l.lat);return new an(new s.M(l.lng-b,l.lat-v),new s.M(l.lng+b,l.lat+v))}}class aa{constructor(l,f,v){this.bounds=an.convert(this.validateBounds(l)),this.minzoom=f||0,this.maxzoom=v||24}validateBounds(l){return Array.isArray(l)&&l.length===4?[Math.max(-180,l[0]),Math.max(-90,l[1]),Math.min(180,l[2]),Math.min(90,l[3])]:[-180,-90,180,90]}contains(l){let f=Math.pow(2,l.z),v=Math.floor(s.N(this.bounds.getWest())*f),b=Math.floor(s.O(this.bounds.getNorth())*f),M=Math.ceil(s.N(this.bounds.getEast())*f),O=Math.ceil(s.O(this.bounds.getSouth())*f);return l.x>=v&&l.x<M&&l.y>=b&&l.y<O}}class Jt extends s.E{constructor(l,f,v,b){if(super(),this.id=l,this.dispatcher=v,this.type=\"vector\",this.minzoom=0,this.maxzoom=22,this.scheme=\"xyz\",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,s.e(this,s.L(f,[\"url\",\"scheme\",\"tileSize\",\"promoteId\"])),this._options=s.e({type:\"vector\"},f),this._collectResourceTiming=f.collectResourceTiming,this.tileSize!==512)throw new Error(\"vector tile sources must have a tileSize of 512\");this.setEventedParent(b)}load(){return s._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new s.k(\"dataloading\",{dataType:\"source\"})),this._tileJSONRequest=new AbortController;try{let l=yield Go(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),l&&(s.e(this,l),l.bounds&&(this.tileBounds=new aa(l.bounds,this.minzoom,this.maxzoom)),this.fire(new s.k(\"data\",{dataType:\"source\",sourceDataType:\"metadata\"})),this.fire(new s.k(\"data\",{dataType:\"source\",sourceDataType:\"content\"})))}catch(l){this._tileJSONRequest=null,this.fire(new s.j(l))}})}loaded(){return this._loaded}hasTile(l){return!this.tileBounds||this.tileBounds.contains(l.canonical)}onAdd(l){this.map=l,this.load()}setSourceProperty(l){this._tileJSONRequest&&this._tileJSONRequest.abort(),l(),this.load()}setTiles(l){return this.setSourceProperty(()=>{this._options.tiles=l}),this}setUrl(l){return this.setSourceProperty(()=>{this.url=l,this._options.url=l}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return s.e({},this._options)}loadTile(l){return s._(this,void 0,void 0,function*(){let f=l.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),v={request:this.map._requestManager.transformRequest(f,K.Tile),uid:l.uid,tileID:l.tileID,zoom:l.tileID.overscaledZ,tileSize:this.tileSize*l.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};v.request.collectResourceTiming=this._collectResourceTiming;let b=\"reloadTile\";if(l.actor&&l.state!==\"expired\"){if(l.state===\"loading\")return new Promise((M,O)=>{l.reloadPromise={resolve:M,reject:O}})}else l.actor=this.dispatcher.getActor(),b=\"loadTile\";l.abortController=new AbortController;try{let M=yield l.actor.sendAsync({type:b,data:v},l.abortController);if(delete l.abortController,l.aborted)return;this._afterTileLoadWorkerResponse(l,M)}catch(M){if(delete l.abortController,l.aborted)return;if(M&&M.status!==404)throw M;this._afterTileLoadWorkerResponse(l,null)}})}_afterTileLoadWorkerResponse(l,f){if(f&&f.resourceTiming&&(l.resourceTiming=f.resourceTiming),f&&this.map._refreshExpiredTiles&&l.setExpiryData(f),l.loadVectorData(f,this.map.painter),l.reloadPromise){let v=l.reloadPromise;l.reloadPromise=null,this.loadTile(l).then(v.resolve).catch(v.reject)}}abortTile(l){return s._(this,void 0,void 0,function*(){l.abortController&&(l.abortController.abort(),delete l.abortController),l.actor&&(yield l.actor.sendAsync({type:\"abortTile\",data:{uid:l.uid,type:this.type,source:this.id}}))})}unloadTile(l){return s._(this,void 0,void 0,function*(){l.unloadVectorData(),l.actor&&(yield l.actor.sendAsync({type:\"removeTile\",data:{uid:l.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class vo extends s.E{constructor(l,f,v,b){super(),this.id=l,this.dispatcher=v,this.setEventedParent(b),this.type=\"raster\",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme=\"xyz\",this.tileSize=512,this._loaded=!1,this._options=s.e({type:\"raster\"},f),s.e(this,s.L(f,[\"url\",\"scheme\",\"tileSize\"]))}load(){return s._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new s.k(\"dataloading\",{dataType:\"source\"})),this._tileJSONRequest=new AbortController;try{let l=yield Go(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,l&&(s.e(this,l),l.bounds&&(this.tileBounds=new aa(l.bounds,this.minzoom,this.maxzoom)),this.fire(new s.k(\"data\",{dataType:\"source\",sourceDataType:\"metadata\"})),this.fire(new s.k(\"data\",{dataType:\"source\",sourceDataType:\"content\"})))}catch(l){this._tileJSONRequest=null,this.fire(new s.j(l))}})}loaded(){return this._loaded}onAdd(l){this.map=l,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(l){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),l(),this.load()}setTiles(l){return this.setSourceProperty(()=>{this._options.tiles=l}),this}serialize(){return s.e({},this._options)}hasTile(l){return!this.tileBounds||this.tileBounds.contains(l.canonical)}loadTile(l){return s._(this,void 0,void 0,function*(){let f=l.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);l.abortController=new AbortController;try{let v=yield Z.getImage(this.map._requestManager.transformRequest(f,K.Tile),l.abortController,this.map._refreshExpiredTiles);if(delete l.abortController,l.aborted)return void(l.state=\"unloaded\");if(v&&v.data){this.map._refreshExpiredTiles&&v.cacheControl&&v.expires&&l.setExpiryData({cacheControl:v.cacheControl,expires:v.expires});let b=this.map.painter.context,M=b.gl,O=v.data;l.texture=this.map.painter.getTileTexture(O.width),l.texture?l.texture.update(O,{useMipmap:!0}):(l.texture=new ae(b,O,M.RGBA,{useMipmap:!0}),l.texture.bind(M.LINEAR,M.CLAMP_TO_EDGE,M.LINEAR_MIPMAP_NEAREST),b.extTextureFilterAnisotropic&&M.texParameterf(M.TEXTURE_2D,b.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,b.extTextureFilterAnisotropicMax)),l.state=\"loaded\"}}catch(v){if(delete l.abortController,l.aborted)l.state=\"unloaded\";else if(v)throw l.state=\"errored\",v}})}abortTile(l){return s._(this,void 0,void 0,function*(){l.abortController&&(l.abortController.abort(),delete l.abortController)})}unloadTile(l){return s._(this,void 0,void 0,function*(){l.texture&&this.map.painter.saveTileTexture(l.texture)})}hasTransition(){return!1}}class hu extends vo{constructor(l,f,v,b){super(l,f,v,b),this.type=\"raster-dem\",this.maxzoom=22,this._options=s.e({type:\"raster-dem\"},f),this.encoding=f.encoding||\"mapbox\",this.redFactor=f.redFactor,this.greenFactor=f.greenFactor,this.blueFactor=f.blueFactor,this.baseShift=f.baseShift}loadTile(l){return s._(this,void 0,void 0,function*(){let f=l.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),v=this.map._requestManager.transformRequest(f,K.Tile);l.neighboringTiles=this._getNeighboringTiles(l.tileID),l.abortController=new AbortController;try{let b=yield Z.getImage(v,l.abortController,this.map._refreshExpiredTiles);if(delete l.abortController,l.aborted)return void(l.state=\"unloaded\");if(b&&b.data){let M=b.data;this.map._refreshExpiredTiles&&b.cacheControl&&b.expires&&l.setExpiryData({cacheControl:b.cacheControl,expires:b.expires});let O=s.b(M)&&s.S()?M:yield this.readImageNow(M),F={type:this.type,uid:l.uid,source:this.id,rawImageData:O,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!l.actor||l.state===\"expired\"){l.actor=this.dispatcher.getActor();let U=yield l.actor.sendAsync({type:\"loadDEMTile\",data:F});l.dem=U,l.needsHillshadePrepare=!0,l.needsTerrainPrepare=!0,l.state=\"loaded\"}}}catch(b){if(delete l.abortController,l.aborted)l.state=\"unloaded\";else if(b)throw l.state=\"errored\",b}})}readImageNow(l){return s._(this,void 0,void 0,function*(){if(typeof VideoFrame<\"u\"&&s.U()){let f=l.width+2,v=l.height+2;try{return new s.R({width:f,height:v},yield s.V(l,-1,-1,f,v))}catch{}}return _.getImageData(l,1)})}_getNeighboringTiles(l){let f=l.canonical,v=Math.pow(2,f.z),b=(f.x-1+v)%v,M=f.x===0?l.wrap-1:l.wrap,O=(f.x+1+v)%v,F=f.x+1===v?l.wrap+1:l.wrap,U={};return U[new s.Q(l.overscaledZ,M,f.z,b,f.y).key]={backfilled:!1},U[new s.Q(l.overscaledZ,F,f.z,O,f.y).key]={backfilled:!1},f.y>0&&(U[new s.Q(l.overscaledZ,M,f.z,b,f.y-1).key]={backfilled:!1},U[new s.Q(l.overscaledZ,l.wrap,f.z,f.x,f.y-1).key]={backfilled:!1},U[new s.Q(l.overscaledZ,F,f.z,O,f.y-1).key]={backfilled:!1}),f.y+1<v&&(U[new s.Q(l.overscaledZ,M,f.z,b,f.y+1).key]={backfilled:!1},U[new s.Q(l.overscaledZ,l.wrap,f.z,f.x,f.y+1).key]={backfilled:!1},U[new s.Q(l.overscaledZ,F,f.z,O,f.y+1).key]={backfilled:!1}),U}unloadTile(l){return s._(this,void 0,void 0,function*(){l.demTexture&&this.map.painter.saveTileTexture(l.demTexture),l.fbo&&(l.fbo.destroy(),delete l.fbo),l.dem&&delete l.dem,delete l.neighboringTiles,l.state=\"unloaded\",l.actor&&(yield l.actor.sendAsync({type:\"removeDEMTile\",data:{type:this.type,uid:l.uid,source:this.id}}))})}}class ti extends s.E{constructor(l,f,v,b){super(),this.id=l,this.type=\"geojson\",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=v.getActor(),this.setEventedParent(b),this._data=f.data,this._options=s.e({},f),this._collectResourceTiming=f.collectResourceTiming,f.maxzoom!==void 0&&(this.maxzoom=f.maxzoom),f.type&&(this.type=f.type),f.attribution&&(this.attribution=f.attribution),this.promoteId=f.promoteId;let M=s.W/this.tileSize;this.workerOptions=s.e({source:this.id,cluster:f.cluster||!1,geojsonVtOptions:{buffer:(f.buffer!==void 0?f.buffer:128)*M,tolerance:(f.tolerance!==void 0?f.tolerance:.375)*M,extent:s.W,maxZoom:this.maxzoom,lineMetrics:f.lineMetrics||!1,generateId:f.generateId||!1},superclusterOptions:{maxZoom:f.clusterMaxZoom!==void 0?f.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,f.clusterMinPoints||2),extent:s.W,radius:(f.clusterRadius||50)*M,log:!1,generateId:f.generateId||!1},clusterProperties:f.clusterProperties,filter:f.filter},f.workerOptions),typeof this.promoteId==\"string\"&&(this.workerOptions.promoteId=this.promoteId)}load(){return s._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(l){this.map=l,this.load()}setData(l){return this._data=l,this._updateWorkerData(),this}updateData(l){return this._updateWorkerData(l),this}setClusterOptions(l){return this.workerOptions.cluster=l.cluster,l&&(l.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=l.clusterRadius),l.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=l.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(l){return this.actor.sendAsync({type:\"getClusterExpansionZoom\",data:{type:this.type,clusterId:l,source:this.id}})}getClusterChildren(l){return this.actor.sendAsync({type:\"getClusterChildren\",data:{type:this.type,clusterId:l,source:this.id}})}getClusterLeaves(l,f,v){return this.actor.sendAsync({type:\"getClusterLeaves\",data:{type:this.type,source:this.id,clusterId:l,limit:f,offset:v}})}_updateWorkerData(l){return s._(this,void 0,void 0,function*(){let f=s.e({type:this.type},this.workerOptions);l?f.dataDiff=l:typeof this._data==\"string\"?(f.request=this.map._requestManager.transformRequest(_.resolveURL(this._data),K.Source),f.request.collectResourceTiming=this._collectResourceTiming):f.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new s.k(\"dataloading\",{dataType:\"source\"}));try{let v=yield this.actor.sendAsync({type:\"loadData\",data:f});if(this._pendingLoads--,this._removed||v.abandoned)return void this.fire(new s.k(\"dataabort\",{dataType:\"source\"}));let b=null;v.resourceTiming&&v.resourceTiming[this.id]&&(b=v.resourceTiming[this.id].slice(0));let M={dataType:\"source\"};this._collectResourceTiming&&b&&b.length>0&&s.e(M,{resourceTiming:b}),this.fire(new s.k(\"data\",Object.assign(Object.assign({},M),{sourceDataType:\"metadata\"}))),this.fire(new s.k(\"data\",Object.assign(Object.assign({},M),{sourceDataType:\"content\"})))}catch(v){if(this._pendingLoads--,this._removed)return void this.fire(new s.k(\"dataabort\",{dataType:\"source\"}));this.fire(new s.j(v))}})}loaded(){return this._pendingLoads===0}loadTile(l){return s._(this,void 0,void 0,function*(){let f=l.actor?\"reloadTile\":\"loadTile\";l.actor=this.actor;let v={type:this.type,uid:l.uid,tileID:l.tileID,zoom:l.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};l.abortController=new AbortController;let b=yield this.actor.sendAsync({type:f,data:v},l.abortController);delete l.abortController,l.unloadVectorData(),l.aborted||l.loadVectorData(b,this.map.painter,f===\"reloadTile\")})}abortTile(l){return s._(this,void 0,void 0,function*(){l.abortController&&(l.abortController.abort(),delete l.abortController),l.aborted=!0})}unloadTile(l){return s._(this,void 0,void 0,function*(){l.unloadVectorData(),yield this.actor.sendAsync({type:\"removeTile\",data:{uid:l.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:\"removeSource\",data:{type:this.type,source:this.id}})}serialize(){return s.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var In=s.X([{name:\"a_pos\",type:\"Int16\",components:2},{name:\"a_texture_pos\",type:\"Int16\",components:2}]);class xn extends s.E{constructor(l,f,v,b){super(),this.id=l,this.dispatcher=v,this.coordinates=f.coordinates,this.type=\"image\",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(b),this.options=f}load(l){return s._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new s.k(\"dataloading\",{dataType:\"source\"})),this.url=this.options.url,this._request=new AbortController;try{let f=yield Z.getImage(this.map._requestManager.transformRequest(this.url,K.Image),this._request);this._request=null,this._loaded=!0,f&&f.data&&(this.image=f.data,l&&(this.coordinates=l),this._finishLoading())}catch(f){this._request=null,this.fire(new s.j(f))}})}loaded(){return this._loaded}updateImage(l){return l.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=l.url,this.load(l.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new s.k(\"data\",{dataType:\"source\",sourceDataType:\"metadata\"})))}onAdd(l){this.map=l,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(l){this.coordinates=l;let f=l.map(s.Y.fromLngLat);this.tileID=function(b){let M=1/0,O=1/0,F=-1/0,U=-1/0;for(let at of b)M=Math.min(M,at.x),O=Math.min(O,at.y),F=Math.max(F,at.x),U=Math.max(U,at.y);let W=Math.max(F-M,U-O),$=Math.max(0,Math.floor(-Math.log(W)/Math.LN2)),X=Math.pow(2,$);return new s.a0($,Math.floor((M+F)/2*X),Math.floor((O+U)/2*X))}(f),this.minzoom=this.maxzoom=this.tileID.z;let v=f.map(b=>this.tileID.getTilePoint(b)._round());return this._boundsArray=new s.Z,this._boundsArray.emplaceBack(v[0].x,v[0].y,0,0),this._boundsArray.emplaceBack(v[1].x,v[1].y,s.W,0),this._boundsArray.emplaceBack(v[3].x,v[3].y,0,s.W),this._boundsArray.emplaceBack(v[2].x,v[2].y,s.W,s.W),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new s.k(\"data\",{dataType:\"source\",sourceDataType:\"content\"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let l=this.map.painter.context,f=l.gl;this.boundsBuffer||(this.boundsBuffer=l.createVertexBuffer(this._boundsArray,In.members)),this.boundsSegments||(this.boundsSegments=s.$.simpleSegment(0,0,4,2)),this.texture||(this.texture=new ae(l,this.image,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));let v=!1;for(let b in this.tiles){let M=this.tiles[b];M.state!==\"loaded\"&&(M.state=\"loaded\",M.texture=this.texture,v=!0)}v&&this.fire(new s.k(\"data\",{dataType:\"source\",sourceDataType:\"idle\",sourceId:this.id}))}loadTile(l){return s._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(l.tileID.canonical)?(this.tiles[String(l.tileID.wrap)]=l,l.buckets={}):l.state=\"errored\"})}serialize(){return{type:\"image\",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Wo extends xn{constructor(l,f,v,b){super(l,f,v,b),this.roundZoom=!0,this.type=\"video\",this.options=f}load(){return s._(this,void 0,void 0,function*(){this._loaded=!1;let l=this.options;this.urls=[];for(let f of l.urls)this.urls.push(this.map._requestManager.transformRequest(f,K.Source).url);try{let f=yield s.a2(this.urls);if(this._loaded=!0,!f)return;this.video=f,this.video.loop=!0,this.video.addEventListener(\"playing\",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(f){this.fire(new s.j(f))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(l){if(this.video){let f=this.video.seekable;l<f.start(0)||l>f.end(0)?this.fire(new s.j(new s.a1(`sources.${this.id}`,null,`Playback for this video can be set only between the ${f.start(0)} and ${f.end(0)}-second mark.`))):this.video.currentTime=l}}getVideo(){return this.video}onAdd(l){this.map||(this.map=l,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let l=this.map.painter.context,f=l.gl;this.boundsBuffer||(this.boundsBuffer=l.createVertexBuffer(this._boundsArray,In.members)),this.boundsSegments||(this.boundsSegments=s.$.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE),f.texSubImage2D(f.TEXTURE_2D,0,0,0,f.RGBA,f.UNSIGNED_BYTE,this.video)):(this.texture=new ae(l,this.video,f.RGBA),this.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE));let v=!1;for(let b in this.tiles){let M=this.tiles[b];M.state!==\"loaded\"&&(M.state=\"loaded\",M.texture=this.texture,v=!0)}v&&this.fire(new s.k(\"data\",{dataType:\"source\",sourceDataType:\"idle\",sourceId:this.id}))}serialize(){return{type:\"video\",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Dl extends xn{constructor(l,f,v,b){super(l,f,v,b),f.coordinates?Array.isArray(f.coordinates)&&f.coordinates.length===4&&!f.coordinates.some(M=>!Array.isArray(M)||M.length!==2||M.some(O=>typeof O!=\"number\"))||this.fire(new s.j(new s.a1(`sources.${l}`,null,'\"coordinates\" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.j(new s.a1(`sources.${l}`,null,'missing required property \"coordinates\"'))),f.animate&&typeof f.animate!=\"boolean\"&&this.fire(new s.j(new s.a1(`sources.${l}`,null,'optional \"animate\" property must be a boolean value'))),f.canvas?typeof f.canvas==\"string\"||f.canvas instanceof HTMLCanvasElement||this.fire(new s.j(new s.a1(`sources.${l}`,null,'\"canvas\" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new s.j(new s.a1(`sources.${l}`,null,'missing required property \"canvas\"'))),this.options=f,this.animate=f.animate===void 0||f.animate}load(){return s._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new s.j(new Error(\"Canvas dimensions cannot be less than or equal to zero.\"))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(l){this.map=l,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let l=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,l=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,l=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let f=this.map.painter.context,v=f.gl;this.boundsBuffer||(this.boundsBuffer=f.createVertexBuffer(this._boundsArray,In.members)),this.boundsSegments||(this.boundsSegments=s.$.simpleSegment(0,0,4,2)),this.texture?(l||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new ae(f,this.canvas,v.RGBA,{premultiply:!0});let b=!1;for(let M in this.tiles){let O=this.tiles[M];O.state!==\"loaded\"&&(O.state=\"loaded\",O.texture=this.texture,b=!0)}b&&this.fire(new s.k(\"data\",{dataType:\"source\",sourceDataType:\"idle\",sourceId:this.id}))}serialize(){return{type:\"canvas\",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let l of[this.canvas.width,this.canvas.height])if(isNaN(l)||l<=0)return!0;return!1}}let Ca={},Tc=T=>{switch(T){case\"geojson\":return ti;case\"image\":return xn;case\"raster\":return vo;case\"raster-dem\":return hu;case\"vector\":return Jt;case\"video\":return Wo;case\"canvas\":return Dl}return Ca[T]};class hf extends s.E{constructor(){super(...arguments),this.pluginStatus=\"unavailable\",this.pluginURL=null,this.dispatcher=Oi(),this.queue=[]}_sendPluginStateToWorker(){return s._(this,void 0,void 0,function*(){yield this.dispatcher.broadcast(\"syncRTLPluginState\",{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}),this.fire(new s.k(\"pluginStateChange\",{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}))})}getRTLTextPluginStatus(){return this.pluginStatus}clearRTLTextPlugin(){this.pluginStatus=\"unavailable\",this.pluginURL=null}setRTLTextPlugin(l,f=!1){return s._(this,void 0,void 0,function*(){if(this.pluginStatus===\"deferred\"||this.pluginStatus===\"loading\"||this.pluginStatus===\"loaded\")throw new Error(\"setRTLTextPlugin cannot be called multiple times.\");this.pluginURL=_.resolveURL(l),this.pluginStatus=\"deferred\",yield this._sendPluginStateToWorker(),f||(yield this._downloadRTLTextPlugin())})}_downloadRTLTextPlugin(){return s._(this,void 0,void 0,function*(){if(this.pluginStatus!==\"deferred\"||!this.pluginURL)throw new Error(\"rtl-text-plugin cannot be downloaded unless a pluginURL is specified\");try{this.pluginStatus=\"loading\",yield this._sendPluginStateToWorker(),yield s.l({url:this.pluginURL},new AbortController),this.pluginStatus=\"loaded\"}catch{this.pluginStatus=\"error\"}yield this._sendPluginStateToWorker()})}lazyLoadRTLTextPlugin(){return s._(this,void 0,void 0,function*(){this.pluginStatus===\"deferred\"&&(yield this._downloadRTLTextPlugin())})}}let Ts=null;function Ae(){return Ts||(Ts=new hf),Ts}class Ho{constructor(l,f){this.timeAdded=0,this.fadeEndTime=0,this.tileID=l,this.uid=s.a3(),this.uses=0,this.tileSize=f,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state=\"loading\"}registerFadeDuration(l){let f=l+this.timeAdded;f<this.fadeEndTime||(this.fadeEndTime=f)}wasRequested(){return this.state===\"errored\"||this.state===\"loaded\"||this.state===\"reloading\"}clearTextures(l){this.demTexture&&l.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(l,f,v){if(this.hasData()&&this.unloadVectorData(),this.state=\"loaded\",l){l.featureIndex&&(this.latestFeatureIndex=l.featureIndex,l.rawTileData?(this.latestRawTileData=l.rawTileData,this.latestFeatureIndex.rawTileData=l.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=l.collisionBoxArray,this.buckets=function(b,M){let O={};if(!M)return O;for(let F of b){let U=F.layerIds.map(W=>M.getLayer(W)).filter(Boolean);if(U.length!==0){F.layers=U,F.stateDependentLayerIds&&(F.stateDependentLayers=F.stateDependentLayerIds.map(W=>U.filter($=>$.id===W)[0]));for(let W of U)O[W.id]=F}}return O}(l.buckets,f.style),this.hasSymbolBuckets=!1;for(let b in this.buckets){let M=this.buckets[b];if(M instanceof s.a5){if(this.hasSymbolBuckets=!0,!v)break;M.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let b in this.buckets){let M=this.buckets[b];if(M instanceof s.a5&&M.hasRTLText){this.hasRTLText=!0,Ae().lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(let b in this.buckets){let M=this.buckets[b];this.queryPadding=Math.max(this.queryPadding,f.style.getLayer(b).queryRadius(M))}l.imageAtlas&&(this.imageAtlas=l.imageAtlas),l.glyphAtlasImage&&(this.glyphAtlasImage=l.glyphAtlasImage)}else this.collisionBoxArray=new s.a4}unloadVectorData(){for(let l in this.buckets)this.buckets[l].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state=\"unloaded\"}getBucket(l){return this.buckets[l.id]}upload(l){for(let v in this.buckets){let b=this.buckets[v];b.uploadPending()&&b.upload(l)}let f=l.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new ae(l,this.imageAtlas.image,f.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new ae(l,this.glyphAtlasImage,f.ALPHA),this.glyphAtlasImage=null)}prepare(l){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(l,this.imageAtlasTexture)}queryRenderedFeatures(l,f,v,b,M,O,F,U,W,$){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:b,cameraQueryGeometry:M,scale:O,tileSize:this.tileSize,pixelPosMatrix:$,transform:U,params:F,queryPadding:this.queryPadding*W},l,f,v):{}}querySourceFeatures(l,f){let v=this.latestFeatureIndex;if(!v||!v.rawTileData)return;let b=v.loadVTLayers(),M=f&&f.sourceLayer?f.sourceLayer:\"\",O=b._geojsonTileLayer||b[M];if(!O)return;let F=s.a6(f&&f.filter),{z:U,x:W,y:$}=this.tileID.canonical,X={z:U,x:W,y:$};for(let at=0;at<O.length;at++){let gt=O.feature(at);if(F.needGeometry){let At=s.a7(gt,!0);if(!F.filter(new s.a8(this.tileID.overscaledZ),At,this.tileID.canonical))continue}else if(!F.filter(new s.a8(this.tileID.overscaledZ),gt))continue;let _t=v.getId(gt,M),yt=new s.a9(gt,U,W,$,_t);yt.tile=X,l.push(yt)}}hasData(){return this.state===\"loaded\"||this.state===\"reloading\"||this.state===\"expired\"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(l){let f=this.expirationTime;if(l.cacheControl){let v=s.aa(l.cacheControl);v[\"max-age\"]&&(this.expirationTime=Date.now()+1e3*v[\"max-age\"])}else l.expires&&(this.expirationTime=new Date(l.expires).getTime());if(this.expirationTime){let v=Date.now(),b=!1;if(this.expirationTime>v)b=!1;else if(f)if(this.expirationTime<f)b=!0;else{let M=this.expirationTime-f;M?this.expirationTime=v+Math.max(M,3e4):b=!0}else b=!0;b?(this.expiredRequestCount++,this.state=\"expired\"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(l,f){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(l).length===0)return;let v=this.latestFeatureIndex.loadVTLayers();for(let b in this.buckets){if(!f.style.hasLayer(b))continue;let M=this.buckets[b],O=M.layers[0].sourceLayer||\"_geojsonTileLayer\",F=v[O],U=l[O];if(!F||!U||Object.keys(U).length===0)continue;M.update(U,F,this.imageAtlas&&this.imageAtlas.patternPositions||{});let W=f&&f.style&&f.style.getLayer(b);W&&(this.queryPadding=Math.max(this.queryPadding,W.queryRadius(M)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<_.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(l){this.symbolFadeHoldUntil=_.now()+l}setDependencies(l,f){let v={};for(let b of f)v[b]=!0;this.dependencies[l]=v}hasDependency(l,f){for(let v of l){let b=this.dependencies[v];if(b){for(let M of f)if(b[M])return!0}}return!1}}class Vn{constructor(l,f){this.max=l,this.onRemove=f,this.reset()}reset(){for(let l in this.data)for(let f of this.data[l])f.timeout&&clearTimeout(f.timeout),this.onRemove(f.value);return this.data={},this.order=[],this}add(l,f,v){let b=l.wrapped().key;this.data[b]===void 0&&(this.data[b]=[]);let M={value:f,timeout:void 0};if(v!==void 0&&(M.timeout=setTimeout(()=>{this.remove(l,M)},v)),this.data[b].push(M),this.order.push(b),this.order.length>this.max){let O=this._getAndRemoveByKey(this.order[0]);O&&this.onRemove(O)}return this}has(l){return l.wrapped().key in this.data}getAndRemove(l){return this.has(l)?this._getAndRemoveByKey(l.wrapped().key):null}_getAndRemoveByKey(l){let f=this.data[l].shift();return f.timeout&&clearTimeout(f.timeout),this.data[l].length===0&&delete this.data[l],this.order.splice(this.order.indexOf(l),1),f.value}getByKey(l){let f=this.data[l];return f?f[0].value:null}get(l){return this.has(l)?this.data[l.wrapped().key][0].value:null}remove(l,f){if(!this.has(l))return this;let v=l.wrapped().key,b=f===void 0?0:this.data[v].indexOf(f),M=this.data[v][b];return this.data[v].splice(b,1),M.timeout&&clearTimeout(M.timeout),this.data[v].length===0&&delete this.data[v],this.onRemove(M.value),this.order.splice(this.order.indexOf(v),1),this}setMaxSize(l){for(this.max=l;this.order.length>this.max;){let f=this._getAndRemoveByKey(this.order[0]);f&&this.onRemove(f)}return this}filter(l){let f=[];for(let v in this.data)for(let b of this.data[v])l(b.value)||f.push(b);for(let v of f)this.remove(v.value.tileID,v)}}class La{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(l,f,v){let b=String(f);if(this.stateChanges[l]=this.stateChanges[l]||{},this.stateChanges[l][b]=this.stateChanges[l][b]||{},s.e(this.stateChanges[l][b],v),this.deletedStates[l]===null){this.deletedStates[l]={};for(let M in this.state[l])M!==b&&(this.deletedStates[l][M]=null)}else if(this.deletedStates[l]&&this.deletedStates[l][b]===null){this.deletedStates[l][b]={};for(let M in this.state[l][b])v[M]||(this.deletedStates[l][b][M]=null)}else for(let M in v)this.deletedStates[l]&&this.deletedStates[l][b]&&this.deletedStates[l][b][M]===null&&delete this.deletedStates[l][b][M]}removeFeatureState(l,f,v){if(this.deletedStates[l]===null)return;let b=String(f);if(this.deletedStates[l]=this.deletedStates[l]||{},v&&f!==void 0)this.deletedStates[l][b]!==null&&(this.deletedStates[l][b]=this.deletedStates[l][b]||{},this.deletedStates[l][b][v]=null);else if(f!==void 0)if(this.stateChanges[l]&&this.stateChanges[l][b])for(v in this.deletedStates[l][b]={},this.stateChanges[l][b])this.deletedStates[l][b][v]=null;else this.deletedStates[l][b]=null;else this.deletedStates[l]=null}getState(l,f){let v=String(f),b=s.e({},(this.state[l]||{})[v],(this.stateChanges[l]||{})[v]);if(this.deletedStates[l]===null)return{};if(this.deletedStates[l]){let M=this.deletedStates[l][f];if(M===null)return{};for(let O in M)delete b[O]}return b}initializeTileState(l,f){l.setFeatureState(this.state,f)}coalesceChanges(l,f){let v={};for(let b in this.stateChanges){this.state[b]=this.state[b]||{};let M={};for(let O in this.stateChanges[b])this.state[b][O]||(this.state[b][O]={}),s.e(this.state[b][O],this.stateChanges[b][O]),M[O]=this.state[b][O];v[b]=M}for(let b in this.deletedStates){this.state[b]=this.state[b]||{};let M={};if(this.deletedStates[b]===null)for(let O in this.state[b])M[O]={},this.state[b][O]={};else for(let O in this.deletedStates[b]){if(this.deletedStates[b][O]===null)this.state[b][O]={};else for(let F of Object.keys(this.deletedStates[b][O]))delete this.state[b][O][F];M[O]=this.state[b][O]}v[b]=v[b]||{},s.e(v[b],M)}if(this.stateChanges={},this.deletedStates={},Object.keys(v).length!==0)for(let b in l)l[b].setFeatureState(v,f)}}class ts extends s.E{constructor(l,f,v){super(),this.id=l,this.dispatcher=v,this.on(\"data\",b=>{b.dataType===\"source\"&&b.sourceDataType===\"metadata\"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&b.dataType===\"source\"&&b.sourceDataType===\"content\"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on(\"dataloading\",()=>{this._sourceErrored=!1}),this.on(\"error\",()=>{this._sourceErrored=this._source.loaded()}),this._source=((b,M,O,F)=>{let U=new(Tc(M.type))(b,M,O,F);if(U.id!==b)throw new Error(`Expected Source id to be ${b} instead of ${U.id}`);return U})(l,f,v,this),this._tiles={},this._cache=new Vn(0,b=>this._unloadTile(b)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new La,this._didEmitContent=!1,this._updated=!1}onAdd(l){this.map=l,this._maxTileCacheSize=l?l._maxTileCacheSize:null,this._maxTileCacheZoomLevels=l?l._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(l)}onRemove(l){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(l)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let l in this._tiles){let f=this._tiles[l];if(f.state!==\"loaded\"&&f.state!==\"errored\")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let l=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,l&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(l,f,v){return s._(this,void 0,void 0,function*(){try{yield this._source.loadTile(l),this._tileLoaded(l,f,v)}catch(b){l.state=\"errored\",b.status!==404?this._source.fire(new s.j(b,{tile:l})):this.update(this.transform,this.terrain)}})}_unloadTile(l){this._source.unloadTile&&this._source.unloadTile(l)}_abortTile(l){this._source.abortTile&&this._source.abortTile(l),this._source.fire(new s.k(\"dataabort\",{tile:l,coord:l.tileID,dataType:\"source\"}))}serialize(){return this._source.serialize()}prepare(l){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let f in this._tiles){let v=this._tiles[f];v.upload(l),v.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(l=>l.tileID).sort(be).map(l=>l.key)}getRenderableIds(l){let f=[];for(let v in this._tiles)this._isIdRenderable(v,l)&&f.push(this._tiles[v]);return l?f.sort((v,b)=>{let M=v.tileID,O=b.tileID,F=new s.P(M.canonical.x,M.canonical.y)._rotate(this.transform.angle),U=new s.P(O.canonical.x,O.canonical.y)._rotate(this.transform.angle);return M.overscaledZ-O.overscaledZ||U.y-F.y||U.x-F.x}).map(v=>v.tileID.key):f.map(v=>v.tileID).sort(be).map(v=>v.key)}hasRenderableParent(l){let f=this.findLoadedParent(l,0);return!!f&&this._isIdRenderable(f.tileID.key)}_isIdRenderable(l,f){return this._tiles[l]&&this._tiles[l].hasData()&&!this._coveredTiles[l]&&(f||!this._tiles[l].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let l in this._tiles)this._tiles[l].state!==\"errored\"&&this._reloadTile(l,\"reloading\")}}_reloadTile(l,f){return s._(this,void 0,void 0,function*(){let v=this._tiles[l];v&&(v.state!==\"loading\"&&(v.state=f),yield this._loadTile(v,l,f))})}_tileLoaded(l,f,v){l.timeAdded=_.now(),v===\"expired\"&&(l.refreshedUponExpiration=!0),this._setTileReloadTimer(f,l),this.getSource().type===\"raster-dem\"&&l.dem&&this._backfillDEM(l),this._state.initializeTileState(l,this.map?this.map.painter:null),l.aborted||this._source.fire(new s.k(\"data\",{dataType:\"source\",tile:l,coord:l.tileID}))}_backfillDEM(l){let f=this.getRenderableIds();for(let b=0;b<f.length;b++){let M=f[b];if(l.neighboringTiles&&l.neighboringTiles[M]){let O=this.getTileByID(M);v(l,O),v(O,l)}}function v(b,M){b.needsHillshadePrepare=!0,b.needsTerrainPrepare=!0;let O=M.tileID.canonical.x-b.tileID.canonical.x,F=M.tileID.canonical.y-b.tileID.canonical.y,U=Math.pow(2,b.tileID.canonical.z),W=M.tileID.key;O===0&&F===0||Math.abs(F)>1||(Math.abs(O)>1&&(Math.abs(O+U)===1?O+=U:Math.abs(O-U)===1&&(O-=U)),M.dem&&b.dem&&(b.dem.backfillBorder(M.dem,O,F),b.neighboringTiles&&b.neighboringTiles[W]&&(b.neighboringTiles[W].backfilled=!0)))}}getTile(l){return this.getTileByID(l.key)}getTileByID(l){return this._tiles[l]}_retainLoadedChildren(l,f,v,b){for(let M in this._tiles){let O=this._tiles[M];if(b[M]||!O.hasData()||O.tileID.overscaledZ<=f||O.tileID.overscaledZ>v)continue;let F=O.tileID;for(;O&&O.tileID.overscaledZ>f+1;){let W=O.tileID.scaledTo(O.tileID.overscaledZ-1);O=this._tiles[W.key],O&&O.hasData()&&(F=W)}let U=F;for(;U.overscaledZ>f;)if(U=U.scaledTo(U.overscaledZ-1),l[U.key]){b[F.key]=F;break}}}findLoadedParent(l,f){if(l.key in this._loadedParentTiles){let v=this._loadedParentTiles[l.key];return v&&v.tileID.overscaledZ>=f?v:null}for(let v=l.overscaledZ-1;v>=f;v--){let b=l.scaledTo(v),M=this._getLoadedTile(b);if(M)return M}}_getLoadedTile(l){let f=this._tiles[l.key];return f&&f.hasData()?f:this._cache.getByKey(l.wrapped().key)}updateCacheSize(l){let f=Math.ceil(l.width/this._source.tileSize)+1,v=Math.ceil(l.height/this._source.tileSize)+1,b=Math.floor(f*v*(this._maxTileCacheZoomLevels===null?s.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),M=typeof this._maxTileCacheSize==\"number\"?Math.min(this._maxTileCacheSize,b):b;this._cache.setMaxSize(M)}handleWrapJump(l){let f=Math.round((l-(this._prevLng===void 0?l:this._prevLng))/360);if(this._prevLng=l,f){let v={};for(let b in this._tiles){let M=this._tiles[b];M.tileID=M.tileID.unwrapTo(M.tileID.wrap+f),v[M.tileID.key]=M}this._tiles=v;for(let b in this._timers)clearTimeout(this._timers[b]),delete this._timers[b];for(let b in this._tiles)this._setTileReloadTimer(b,this._tiles[b])}}update(l,f){if(this.transform=l,this.terrain=f,!this._sourceLoaded||this._paused)return;let v;this.updateCacheSize(l),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?v=l.getVisibleUnwrappedCoordinates(this._source.tileID).map($=>new s.Q($.canonical.z,$.wrap,$.canonical.z,$.canonical.x,$.canonical.y)):(v=l.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:f}),this._source.hasTile&&(v=v.filter($=>this._source.hasTile($)))):v=[];let b=l.coveringZoomLevel(this._source),M=Math.max(b-ts.maxOverzooming,this._source.minzoom),O=Math.max(b+ts.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let $={};for(let X of v)if(X.canonical.z>this._source.minzoom){let at=X.scaledTo(X.canonical.z-1);$[at.key]=at;let gt=X.scaledTo(Math.max(this._source.minzoom,Math.min(X.canonical.z,5)));$[gt.key]=gt}v=v.concat(Object.values($))}let F=v.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,F&&this.fire(new s.k(\"data\",{sourceDataType:\"idle\",dataType:\"source\",sourceId:this.id}));let U=this._updateRetainedTiles(v,b);if(Lr(this._source.type)){let $={},X={},at=Object.keys(U),gt=_.now();for(let _t of at){let yt=U[_t],At=this._tiles[_t];if(!At||At.fadeEndTime!==0&&At.fadeEndTime<=gt)continue;let kt=this.findLoadedParent(yt,M);kt&&(this._addTile(kt.tileID),$[kt.tileID.key]=kt.tileID),X[_t]=yt}this._retainLoadedChildren(X,b,O,U);for(let _t in $)U[_t]||(this._coveredTiles[_t]=!0,U[_t]=$[_t]);if(f){let _t={},yt={};for(let At of v)this._tiles[At.key].hasData()?_t[At.key]=At:yt[At.key]=At;for(let At in yt){let kt=yt[At].children(this._source.maxzoom);this._tiles[kt[0].key]&&this._tiles[kt[1].key]&&this._tiles[kt[2].key]&&this._tiles[kt[3].key]&&(_t[kt[0].key]=U[kt[0].key]=kt[0],_t[kt[1].key]=U[kt[1].key]=kt[1],_t[kt[2].key]=U[kt[2].key]=kt[2],_t[kt[3].key]=U[kt[3].key]=kt[3],delete yt[At])}for(let At in yt){let kt=this.findLoadedParent(yt[At],this._source.minzoom);if(kt){_t[kt.tileID.key]=U[kt.tileID.key]=kt.tileID;for(let Wt in _t)_t[Wt].isChildOf(kt.tileID)&&delete _t[Wt]}}for(let At in this._tiles)_t[At]||(this._coveredTiles[At]=!0)}}for(let $ in U)this._tiles[$].clearFadeHold();let W=s.ab(this._tiles,U);for(let $ of W){let X=this._tiles[$];X.hasSymbolBuckets&&!X.holdingForFade()?X.setHoldDuration(this.map._fadeDuration):X.hasSymbolBuckets&&!X.symbolFadeFinished()||this._removeTile($)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(let l in this._tiles)this._tiles[l].holdingForFade()&&this._removeTile(l)}_updateRetainedTiles(l,f){let v={},b={},M=Math.max(f-ts.maxOverzooming,this._source.minzoom),O=Math.max(f+ts.maxUnderzooming,this._source.minzoom),F={};for(let U of l){let W=this._addTile(U);v[U.key]=U,W.hasData()||f<this._source.maxzoom&&(F[U.key]=U)}this._retainLoadedChildren(F,f,O,v);for(let U of l){let W=this._tiles[U.key];if(W.hasData())continue;if(f+1>this._source.maxzoom){let X=U.children(this._source.maxzoom)[0],at=this.getTile(X);if(at&&at.hasData()){v[X.key]=X;continue}}else{let X=U.children(this._source.maxzoom);if(v[X[0].key]&&v[X[1].key]&&v[X[2].key]&&v[X[3].key])continue}let $=W.wasRequested();for(let X=U.overscaledZ-1;X>=M;--X){let at=U.scaledTo(X);if(b[at.key])break;if(b[at.key]=!0,W=this.getTile(at),!W&&$&&(W=this._addTile(at)),W){let gt=W.hasData();if(($||gt)&&(v[at.key]=at),$=W.wasRequested(),gt)break}}}return v}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let l in this._tiles){let f=[],v,b=this._tiles[l].tileID;for(;b.overscaledZ>0;){if(b.key in this._loadedParentTiles){v=this._loadedParentTiles[b.key];break}f.push(b.key);let M=b.scaledTo(b.overscaledZ-1);if(v=this._getLoadedTile(M),v)break;b=M}for(let M of f)this._loadedParentTiles[M]=v}}_addTile(l){let f=this._tiles[l.key];if(f)return f;f=this._cache.getAndRemove(l),f&&(this._setTileReloadTimer(l.key,f),f.tileID=l,this._state.initializeTileState(f,this.map?this.map.painter:null),this._cacheTimers[l.key]&&(clearTimeout(this._cacheTimers[l.key]),delete this._cacheTimers[l.key],this._setTileReloadTimer(l.key,f)));let v=f;return f||(f=new Ho(l,this._source.tileSize*l.overscaleFactor()),this._loadTile(f,l.key,f.state)),f.uses++,this._tiles[l.key]=f,v||this._source.fire(new s.k(\"dataloading\",{tile:f,coord:f.tileID,dataType:\"source\"})),f}_setTileReloadTimer(l,f){l in this._timers&&(clearTimeout(this._timers[l]),delete this._timers[l]);let v=f.getExpiryTimeout();v&&(this._timers[l]=setTimeout(()=>{this._reloadTile(l,\"expired\"),delete this._timers[l]},v))}_removeTile(l){let f=this._tiles[l];f&&(f.uses--,delete this._tiles[l],this._timers[l]&&(clearTimeout(this._timers[l]),delete this._timers[l]),f.uses>0||(f.hasData()&&f.state!==\"reloading\"?this._cache.add(f.tileID,f,f.getExpiryTimeout()):(f.aborted=!0,this._abortTile(f),this._unloadTile(f))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let l in this._tiles)this._removeTile(l);this._cache.reset()}tilesIn(l,f,v){let b=[],M=this.transform;if(!M)return b;let O=v?M.getCameraQueryGeometry(l):l,F=l.map(_t=>M.pointCoordinate(_t,this.terrain)),U=O.map(_t=>M.pointCoordinate(_t,this.terrain)),W=this.getIds(),$=1/0,X=1/0,at=-1/0,gt=-1/0;for(let _t of U)$=Math.min($,_t.x),X=Math.min(X,_t.y),at=Math.max(at,_t.x),gt=Math.max(gt,_t.y);for(let _t=0;_t<W.length;_t++){let yt=this._tiles[W[_t]];if(yt.holdingForFade())continue;let At=yt.tileID,kt=Math.pow(2,M.zoom-yt.tileID.overscaledZ),Wt=f*yt.queryPadding*s.W/yt.tileSize/kt,St=[At.getTilePoint(new s.Y($,X)),At.getTilePoint(new s.Y(at,gt))];if(St[0].x-Wt<s.W&&St[0].y-Wt<s.W&&St[1].x+Wt>=0&&St[1].y+Wt>=0){let Nt=F.map(Ht=>At.getTilePoint(Ht)),Zt=U.map(Ht=>At.getTilePoint(Ht));b.push({tile:yt,tileID:At,queryGeometry:Nt,cameraQueryGeometry:Zt,scale:kt})}}return b}getVisibleCoordinates(l){let f=this.getRenderableIds(l).map(v=>this._tiles[v].tileID);for(let v of f)v.posMatrix=this.transform.calculatePosMatrix(v.toUnwrapped());return f}hasTransition(){if(this._source.hasTransition())return!0;if(Lr(this._source.type)){let l=_.now();for(let f in this._tiles)if(this._tiles[f].fadeEndTime>=l)return!0}return!1}setFeatureState(l,f,v){this._state.updateState(l=l||\"_geojsonTileLayer\",f,v)}removeFeatureState(l,f,v){this._state.removeFeatureState(l=l||\"_geojsonTileLayer\",f,v)}getFeatureState(l,f){return this._state.getState(l=l||\"_geojsonTileLayer\",f)}setDependencies(l,f,v){let b=this._tiles[l];b&&b.setDependencies(f,v)}reloadTilesForDependencies(l,f){for(let v in this._tiles)this._tiles[v].hasDependency(l,f)&&this._reloadTile(v,\"reloading\");this._cache.filter(v=>!v.hasDependency(l,f))}}function be(T,l){let f=Math.abs(2*T.wrap)-+(T.wrap<0),v=Math.abs(2*l.wrap)-+(l.wrap<0);return T.overscaledZ-l.overscaledZ||v-f||l.canonical.y-T.canonical.y||l.canonical.x-T.canonical.x}function Lr(T){return T===\"raster\"||T===\"image\"||T===\"video\"}ts.maxOverzooming=10,ts.maxUnderzooming=3;class wr{constructor(l,f){this.reset(l,f)}reset(l,f){this.points=l||[],this._distances=[0];for(let v=1;v<this.points.length;v++)this._distances[v]=this._distances[v-1]+this.points[v].dist(this.points[v-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(f||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(l){if(this.points.length===1)return this.points[0];l=s.ac(l,0,1);let f=1,v=this._distances[f],b=l*this.paddedLength+this.padding;for(;v<b&&f<this._distances.length;)v=this._distances[++f];let M=f-1,O=this._distances[M],F=v-O,U=F>0?(b-O)/F:0;return this.points[M].mult(1-U).add(this.points[f].mult(U))}}function Cn(T,l){let f=!0;return T===\"always\"||T!==\"never\"&&l!==\"never\"||(f=!1),f}class ka{constructor(l,f,v){let b=this.boxCells=[],M=this.circleCells=[];this.xCellCount=Math.ceil(l/v),this.yCellCount=Math.ceil(f/v);for(let O=0;O<this.xCellCount*this.yCellCount;O++)b.push([]),M.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=l,this.height=f,this.xScale=this.xCellCount/l,this.yScale=this.yCellCount/f,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(l,f,v,b,M){this._forEachCell(f,v,b,M,this._insertBoxCell,this.boxUid++),this.boxKeys.push(l),this.bboxes.push(f),this.bboxes.push(v),this.bboxes.push(b),this.bboxes.push(M)}insertCircle(l,f,v,b){this._forEachCell(f-b,v-b,f+b,v+b,this._insertCircleCell,this.circleUid++),this.circleKeys.push(l),this.circles.push(f),this.circles.push(v),this.circles.push(b)}_insertBoxCell(l,f,v,b,M,O){this.boxCells[M].push(O)}_insertCircleCell(l,f,v,b,M,O){this.circleCells[M].push(O)}_query(l,f,v,b,M,O,F){if(v<0||l>this.width||b<0||f>this.height)return[];let U=[];if(l<=0&&f<=0&&this.width<=v&&this.height<=b){if(M)return[{key:null,x1:l,y1:f,x2:v,y2:b}];for(let W=0;W<this.boxKeys.length;W++)U.push({key:this.boxKeys[W],x1:this.bboxes[4*W],y1:this.bboxes[4*W+1],x2:this.bboxes[4*W+2],y2:this.bboxes[4*W+3]});for(let W=0;W<this.circleKeys.length;W++){let $=this.circles[3*W],X=this.circles[3*W+1],at=this.circles[3*W+2];U.push({key:this.circleKeys[W],x1:$-at,y1:X-at,x2:$+at,y2:X+at})}}else this._forEachCell(l,f,v,b,this._queryCell,U,{hitTest:M,overlapMode:O,seenUids:{box:{},circle:{}}},F);return U}query(l,f,v,b){return this._query(l,f,v,b,!1,null)}hitTest(l,f,v,b,M,O){return this._query(l,f,v,b,!0,M,O).length>0}hitTestCircle(l,f,v,b,M){let O=l-v,F=l+v,U=f-v,W=f+v;if(F<0||O>this.width||W<0||U>this.height)return!1;let $=[];return this._forEachCell(O,U,F,W,this._queryCellCircle,$,{hitTest:!0,overlapMode:b,circle:{x:l,y:f,radius:v},seenUids:{box:{},circle:{}}},M),$.length>0}_queryCell(l,f,v,b,M,O,F,U){let{seenUids:W,hitTest:$,overlapMode:X}=F,at=this.boxCells[M];if(at!==null){let _t=this.bboxes;for(let yt of at)if(!W.box[yt]){W.box[yt]=!0;let At=4*yt,kt=this.boxKeys[yt];if(l<=_t[At+2]&&f<=_t[At+3]&&v>=_t[At+0]&&b>=_t[At+1]&&(!U||U(kt))&&(!$||!Cn(X,kt.overlapMode))&&(O.push({key:kt,x1:_t[At],y1:_t[At+1],x2:_t[At+2],y2:_t[At+3]}),$))return!0}}let gt=this.circleCells[M];if(gt!==null){let _t=this.circles;for(let yt of gt)if(!W.circle[yt]){W.circle[yt]=!0;let At=3*yt,kt=this.circleKeys[yt];if(this._circleAndRectCollide(_t[At],_t[At+1],_t[At+2],l,f,v,b)&&(!U||U(kt))&&(!$||!Cn(X,kt.overlapMode))){let Wt=_t[At],St=_t[At+1],Nt=_t[At+2];if(O.push({key:kt,x1:Wt-Nt,y1:St-Nt,x2:Wt+Nt,y2:St+Nt}),$)return!0}}}return!1}_queryCellCircle(l,f,v,b,M,O,F,U){let{circle:W,seenUids:$,overlapMode:X}=F,at=this.boxCells[M];if(at!==null){let _t=this.bboxes;for(let yt of at)if(!$.box[yt]){$.box[yt]=!0;let At=4*yt,kt=this.boxKeys[yt];if(this._circleAndRectCollide(W.x,W.y,W.radius,_t[At+0],_t[At+1],_t[At+2],_t[At+3])&&(!U||U(kt))&&!Cn(X,kt.overlapMode))return O.push(!0),!0}}let gt=this.circleCells[M];if(gt!==null){let _t=this.circles;for(let yt of gt)if(!$.circle[yt]){$.circle[yt]=!0;let At=3*yt,kt=this.circleKeys[yt];if(this._circlesCollide(_t[At],_t[At+1],_t[At+2],W.x,W.y,W.radius)&&(!U||U(kt))&&!Cn(X,kt.overlapMode))return O.push(!0),!0}}}_forEachCell(l,f,v,b,M,O,F,U){let W=this._convertToXCellCoord(l),$=this._convertToYCellCoord(f),X=this._convertToXCellCoord(v),at=this._convertToYCellCoord(b);for(let gt=W;gt<=X;gt++)for(let _t=$;_t<=at;_t++)if(M.call(this,l,f,v,b,this.xCellCount*_t+gt,O,F,U))return}_convertToXCellCoord(l){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(l*this.xScale)))}_convertToYCellCoord(l){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(l*this.yScale)))}_circlesCollide(l,f,v,b,M,O){let F=b-l,U=M-f,W=v+O;return W*W>F*F+U*U}_circleAndRectCollide(l,f,v,b,M,O,F){let U=(O-b)/2,W=Math.abs(l-(b+U));if(W>U+v)return!1;let $=(F-M)/2,X=Math.abs(f-(M+$));if(X>$+v)return!1;if(W<=U||X<=$)return!0;let at=W-U,gt=X-$;return at*at+gt*gt<=v*v}}function mr(T,l,f,v,b){let M=s.F();return l?(s.J(M,M,[1/b,1/b,1]),f||s.ad(M,M,v.angle)):s.K(M,v.labelPlaneMatrix,T),M}function Mc(T,l,f,v,b){if(l){let M=s.ae(T);return s.J(M,M,[b,b,1]),f||s.ad(M,M,-v.angle),M}return v.glCoordMatrix}function jn(T,l,f){let v;f?(v=[T.x,T.y,f(T.x,T.y),1],s.af(v,v,l)):(v=[T.x,T.y,0,1],Je(v,v,l));let b=v[3];return{point:new s.P(v[0]/b,v[1]/b),signedDistanceFromCamera:b}}function vt(T,l){return .5+T/l*.5}function tt(T,l){let f=T[0]/T[3],v=T[1]/T[3];return f>=-l[0]&&f<=l[0]&&v>=-l[1]&&v<=l[1]}function nt(T,l,f,v,b,M,O,F,U,W){let $=v?T.textSizeData:T.iconSizeData,X=s.ag($,f.transform.zoom),at=[256/f.width*2+1,256/f.height*2+1],gt=v?T.text.dynamicLayoutVertexArray:T.icon.dynamicLayoutVertexArray;gt.clear();let _t=T.lineVertexArray,yt=v?T.text.placedSymbolArray:T.icon.placedSymbolArray,At=f.transform.width/f.transform.height,kt=!1;for(let Wt=0;Wt<yt.length;Wt++){let St=yt.get(Wt);if(St.hidden||St.writingMode===s.ah.vertical&&!kt){re(St.numGlyphs,gt);continue}let Nt;if(kt=!1,W?(Nt=[St.anchorX,St.anchorY,W(St.anchorX,St.anchorY),1],s.af(Nt,Nt,l)):(Nt=[St.anchorX,St.anchorY,0,1],Je(Nt,Nt,l)),!tt(Nt,at)){re(St.numGlyphs,gt);continue}let Zt=vt(f.transform.cameraToCenterDistance,Nt[3]),Ht=s.ai($,X,St),ne=O?Ht/Zt:Ht*Zt,he=new s.P(St.anchorX,St.anchorY),ce=jn(he,b,W).point,ge={projections:{},offsets:{}},Ue=Rt(St,ne,!1,F,l,b,M,T.glyphOffsetArray,_t,gt,ce,he,ge,At,U,W);kt=Ue.useVertical,(Ue.notEnoughRoom||kt||Ue.needsFlipping&&Rt(St,ne,!0,F,l,b,M,T.glyphOffsetArray,_t,gt,ce,he,ge,At,U,W).notEnoughRoom)&&re(St.numGlyphs,gt)}v?T.text.dynamicLayoutVertexBuffer.updateData(gt):T.icon.dynamicLayoutVertexBuffer.updateData(gt)}function ct(T,l,f,v,b,M,O,F,U,W,$,X,at){let gt=F.glyphStartIndex+F.numGlyphs,_t=F.lineStartIndex,yt=F.lineStartIndex+F.lineLength,At=l.getoffsetX(F.glyphStartIndex),kt=l.getoffsetX(gt-1),Wt=le(T*At,f,v,b,M,O,F.segment,_t,yt,U,W,$,X,at);if(!Wt)return null;let St=le(T*kt,f,v,b,M,O,F.segment,_t,yt,U,W,$,X,at);return St?{first:Wt,last:St}:null}function mt(T,l,f,v){return T===s.ah.horizontal&&Math.abs(f.y-l.y)>Math.abs(f.x-l.x)*v?{useVertical:!0}:(T===s.ah.vertical?l.y<f.y:l.x>f.x)?{needsFlipping:!0}:null}function Rt(T,l,f,v,b,M,O,F,U,W,$,X,at,gt,_t,yt){let At=l/24,kt=T.lineOffsetX*At,Wt=T.lineOffsetY*At,St;if(T.numGlyphs>1){let Nt=T.glyphStartIndex+T.numGlyphs,Zt=T.lineStartIndex,Ht=T.lineStartIndex+T.lineLength,ne=ct(At,F,kt,Wt,f,$,X,T,U,M,at,_t,yt);if(!ne)return{notEnoughRoom:!0};let he=jn(ne.first.point,O,yt).point,ce=jn(ne.last.point,O,yt).point;if(v&&!f){let ge=mt(T.writingMode,he,ce,gt);if(ge)return ge}St=[ne.first];for(let ge=T.glyphStartIndex+1;ge<Nt-1;ge++)St.push(le(At*F.getoffsetX(ge),kt,Wt,f,$,X,T.segment,Zt,Ht,U,M,at,_t,yt));St.push(ne.last)}else{if(v&&!f){let Zt=jn(X,b,yt).point,Ht=T.lineStartIndex+T.segment+1,ne=new s.P(U.getx(Ht),U.gety(Ht)),he=jn(ne,b,yt),ce=he.signedDistanceFromCamera>0?he.point:Dt(X,ne,Zt,1,b,yt),ge=mt(T.writingMode,Zt,ce,gt);if(ge)return ge}let Nt=le(At*F.getoffsetX(T.glyphStartIndex),kt,Wt,f,$,X,T.segment,T.lineStartIndex,T.lineStartIndex+T.lineLength,U,M,at,_t,yt);if(!Nt)return{notEnoughRoom:!0};St=[Nt]}for(let Nt of St)s.aj(W,Nt.point,Nt.angle);return{}}function Dt(T,l,f,v,b,M){let O=jn(T.add(T.sub(l)._unit()),b,M).point,F=f.sub(O);return f.add(F._mult(v/F.mag()))}function Ut(T,l){let{projectionCache:f,lineVertexArray:v,labelPlaneMatrix:b,tileAnchorPoint:M,distanceFromAnchor:O,getElevation:F,previousVertex:U,direction:W,absOffsetX:$}=l;if(f.projections[T])return f.projections[T];let X=new s.P(v.getx(T),v.gety(T)),at=jn(X,b,F);if(at.signedDistanceFromCamera>0)return f.projections[T]=at.point,at.point;let gt=T-W;return Dt(O===0?M:new s.P(v.getx(gt),v.gety(gt)),X,U,$-O+1,b,F)}function ft(T,l,f){return T._unit()._perp()._mult(l*f)}function jt(T,l,f,v,b,M,O,F){let{projectionCache:U,direction:W}=F;if(U.offsets[T])return U.offsets[T];let $=f.add(l);if(T+W<v||T+W>=b)return U.offsets[T]=$,$;let X=Ut(T+W,F),at=ft(X.sub(f),O,W),gt=f.add(at),_t=X.add(at);return U.offsets[T]=s.ak(M,$,gt,_t)||$,U.offsets[T]}function le(T,l,f,v,b,M,O,F,U,W,$,X,at,gt){let _t=v?T-l:T+l,yt=_t>0?1:-1,At=0;v&&(yt*=-1,At=Math.PI),yt<0&&(At+=Math.PI);let kt,Wt,St=yt>0?F+O:F+O+1,Nt=b,Zt=b,Ht=0,ne=0,he=Math.abs(_t),ce=[],ge;for(;Ht+ne<=he;){if(St+=yt,St<F||St>=U)return null;Ht+=ne,Zt=Nt,Wt=kt;let Me={projectionCache:X,lineVertexArray:W,labelPlaneMatrix:$,tileAnchorPoint:M,distanceFromAnchor:Ht,getElevation:gt,previousVertex:Zt,direction:yt,absOffsetX:he};if(Nt=Ut(St,Me),f===0)ce.push(Zt),ge=Nt.sub(Zt);else{let ar,He=Nt.sub(Zt);ar=He.mag()===0?ft(Ut(St+yt,Me).sub(Nt),f,yt):ft(He,f,yt),Wt||(Wt=Zt.add(ar)),kt=jt(St,ar,Nt,F,U,Wt,f,Me),ce.push(Wt),ge=kt.sub(Wt)}ne=ge.mag()}let Ue=ge._mult((he-Ht)/ne)._add(Wt||Zt),ur=At+Math.atan2(Nt.y-Zt.y,Nt.x-Zt.x);return ce.push(Ue),{point:Ue,angle:at?ur:0,path:ce}}let ee=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function re(T,l){for(let f=0;f<T;f++){let v=l.length;l.resize(v+4),l.float32.set(ee,3*v)}}function Je(T,l,f){let v=l[0],b=l[1];return T[0]=f[0]*v+f[4]*b+f[12],T[1]=f[1]*v+f[5]*b+f[13],T[3]=f[3]*v+f[7]*b+f[15],T}let ir=100;class kr{constructor(l,f=new ka(l.width+200,l.height+200,25),v=new ka(l.width+200,l.height+200,25)){this.transform=l,this.grid=f,this.ignoredGrid=v,this.pitchfactor=Math.cos(l._pitch)*l.cameraToCenterDistance,this.screenRightBoundary=l.width+ir,this.screenBottomBoundary=l.height+ir,this.gridRightBoundary=l.width+200,this.gridBottomBoundary=l.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(l,f,v,b,M,O){let F=this.projectAndGetPerspectiveRatio(b,l.anchorPointX,l.anchorPointY,O),U=v*F.perspectiveRatio,W=l.x1*U+F.point.x,$=l.y1*U+F.point.y,X=l.x2*U+F.point.x,at=l.y2*U+F.point.y;return!this.isInsideGrid(W,$,X,at)||f!==\"always\"&&this.grid.hitTest(W,$,X,at,f,M)||F.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[W,$,X,at],offscreen:this.isOffscreen(W,$,X,at)}}placeCollisionCircles(l,f,v,b,M,O,F,U,W,$,X,at,gt,_t){let yt=[],At=new s.P(f.anchorX,f.anchorY),kt=jn(At,O,_t),Wt=vt(this.transform.cameraToCenterDistance,kt.signedDistanceFromCamera),St=($?M/Wt:M*Wt)/s.ao,Nt=jn(At,F,_t).point,Zt=ct(St,b,f.lineOffsetX*St,f.lineOffsetY*St,!1,Nt,At,f,v,F,{projections:{},offsets:{}},!1,_t),Ht=!1,ne=!1,he=!0;if(Zt){let ce=.5*at*Wt+gt,ge=new s.P(-100,-100),Ue=new s.P(this.screenRightBoundary,this.screenBottomBoundary),ur=new wr,Me=Zt.first,ar=Zt.last,He=[];for(let Fr=Me.path.length-1;Fr>=1;Fr--)He.push(Me.path[Fr]);for(let Fr=1;Fr<ar.path.length;Fr++)He.push(ar.path[Fr]);let rn=2.5*ce;if(U){let Fr=He.map($r=>jn($r,U,_t));He=Fr.some($r=>$r.signedDistanceFromCamera<=0)?[]:Fr.map($r=>$r.point)}let Jr=[];if(He.length>0){let Fr=He[0].clone(),$r=He[0].clone();for(let On=1;On<He.length;On++)Fr.x=Math.min(Fr.x,He[On].x),Fr.y=Math.min(Fr.y,He[On].y),$r.x=Math.max($r.x,He[On].x),$r.y=Math.max($r.y,He[On].y);Jr=Fr.x>=ge.x&&$r.x<=Ue.x&&Fr.y>=ge.y&&$r.y<=Ue.y?[He]:$r.x<ge.x||Fr.x>Ue.x||$r.y<ge.y||Fr.y>Ue.y?[]:s.al([He],ge.x,ge.y,Ue.x,Ue.y)}for(let Fr of Jr){ur.reset(Fr,.25*ce);let $r=0;$r=ur.length<=.5*ce?1:Math.ceil(ur.paddedLength/rn)+1;for(let On=0;On<$r;On++){let Dr=On/Math.max($r-1,1),So=ur.lerp(Dr),Is=So.x+ir,Mn=So.y+ir;yt.push(Is,Mn,ce,0);let Vs=Is-ce,js=Mn-ce,ha=Is+ce,Bc=Mn+ce;if(he=he&&this.isOffscreen(Vs,js,ha,Bc),ne=ne||this.isInsideGrid(Vs,js,ha,Bc),l!==\"always\"&&this.grid.hitTestCircle(Is,Mn,ce,l,X)&&(Ht=!0,!W))return{circles:[],offscreen:!1,collisionDetected:Ht}}}}return{circles:!W&&Ht||!ne||Wt<this.perspectiveRatioCutoff?[]:yt,offscreen:he,collisionDetected:Ht}}queryRenderedSymbols(l){if(l.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let f=[],v=1/0,b=1/0,M=-1/0,O=-1/0;for(let $ of l){let X=new s.P($.x+ir,$.y+ir);v=Math.min(v,X.x),b=Math.min(b,X.y),M=Math.max(M,X.x),O=Math.max(O,X.y),f.push(X)}let F=this.grid.query(v,b,M,O).concat(this.ignoredGrid.query(v,b,M,O)),U={},W={};for(let $ of F){let X=$.key;if(U[X.bucketInstanceId]===void 0&&(U[X.bucketInstanceId]={}),U[X.bucketInstanceId][X.featureIndex])continue;let at=[new s.P($.x1,$.y1),new s.P($.x2,$.y1),new s.P($.x2,$.y2),new s.P($.x1,$.y2)];s.am(f,at)&&(U[X.bucketInstanceId][X.featureIndex]=!0,W[X.bucketInstanceId]===void 0&&(W[X.bucketInstanceId]=[]),W[X.bucketInstanceId].push(X.featureIndex))}return W}insertCollisionBox(l,f,v,b,M,O){(v?this.ignoredGrid:this.grid).insert({bucketInstanceId:b,featureIndex:M,collisionGroupID:O,overlapMode:f},l[0],l[1],l[2],l[3])}insertCollisionCircles(l,f,v,b,M,O){let F=v?this.ignoredGrid:this.grid,U={bucketInstanceId:b,featureIndex:M,collisionGroupID:O,overlapMode:f};for(let W=0;W<l.length;W+=4)F.insertCircle(U,l[W],l[W+1],l[W+2])}projectAndGetPerspectiveRatio(l,f,v,b){let M;return b?(M=[f,v,b(f,v),1],s.af(M,M,l)):(M=[f,v,0,1],Je(M,M,l)),{point:new s.P((M[0]/M[3]+1)/2*this.transform.width+ir,(-M[1]/M[3]+1)/2*this.transform.height+ir),perspectiveRatio:.5+this.transform.cameraToCenterDistance/M[3]*.5}}isOffscreen(l,f,v,b){return v<ir||l>=this.screenRightBoundary||b<ir||f>this.screenBottomBoundary}isInsideGrid(l,f,v,b){return v>=0&&l<this.gridRightBoundary&&b>=0&&f<this.gridBottomBoundary}getViewportMatrix(){let l=s.an([]);return s.H(l,l,[-100,-100,0]),l}}function _r(T,l,f){return l*(s.W/(T.tileSize*Math.pow(2,f-T.tileID.overscaledZ)))}class ii{constructor(l,f,v,b){this.opacity=l?Math.max(0,Math.min(1,l.opacity+(l.placed?f:-f))):b&&v?1:0,this.placed=v}isHidden(){return this.opacity===0&&!this.placed}}class Si{constructor(l,f,v,b,M){this.text=new ii(l?l.text:null,f,v,M),this.icon=new ii(l?l.icon:null,f,b,M)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Wi{constructor(l,f,v){this.text=l,this.icon=f,this.skipFade=v}}class bn{constructor(){this.invProjMatrix=s.F(),this.viewportMatrix=s.F(),this.circles=[]}}class Rr{constructor(l,f,v,b,M){this.bucketInstanceId=l,this.featureIndex=f,this.sourceLayerIndex=v,this.bucketIndex=b,this.tileID=M}}class Ji{constructor(l){this.crossSourceCollisions=l,this.maxGroupID=0,this.collisionGroups={}}get(l){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[l]){let f=++this.maxGroupID;this.collisionGroups[l]={ID:f,predicate:v=>v.collisionGroupID===f}}return this.collisionGroups[l]}}function tn(T,l,f,v,b){let{horizontalAlign:M,verticalAlign:O}=s.at(T);return new s.P(-(M-.5)*l+v[0]*b,-(O-.5)*f+v[1]*b)}function es(T,l,f,v,b,M){let{x1:O,x2:F,y1:U,y2:W,anchorPointX:$,anchorPointY:X}=T,at=new s.P(l,f);return v&&at._rotate(b?M:-M),{x1:O+at.x,y1:U+at.y,x2:F+at.x,y2:W+at.y,anchorPointX:$,anchorPointY:X}}class cs{constructor(l,f,v,b,M){this.transform=l.clone(),this.terrain=f,this.collisionIndex=new kr(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=v,this.retainedQueryData={},this.collisionGroups=new Ji(b),this.collisionCircleArrays={},this.prevPlacement=M,M&&(M.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(l,f,v,b){let M=v.getBucket(f),O=v.latestFeatureIndex;if(!M||!O||f.id!==M.layerIds[0])return;let F=v.collisionBoxArray,U=M.layers[0].layout,W=Math.pow(2,this.transform.zoom-v.tileID.overscaledZ),$=v.tileSize/s.W,X=this.transform.calculatePosMatrix(v.tileID.toUnwrapped()),at=U.get(\"text-pitch-alignment\")===\"map\",gt=U.get(\"text-rotation-alignment\")===\"map\",_t=_r(v,1,this.transform.zoom),yt=mr(X,at,gt,this.transform,_t),At=null;if(at){let Wt=Mc(X,at,gt,this.transform,_t);At=s.K([],this.transform.labelPlaneMatrix,Wt)}this.retainedQueryData[M.bucketInstanceId]=new Rr(M.bucketInstanceId,O,M.sourceLayerIndex,M.index,v.tileID);let kt={bucket:M,layout:U,posMatrix:X,textLabelPlaneMatrix:yt,labelToScreenMatrix:At,scale:W,textPixelRatio:$,holdingForFade:v.holdingForFade(),collisionBoxArray:F,partiallyEvaluatedTextSize:s.ag(M.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(M.sourceID)};if(b)for(let Wt of M.sortKeyRanges){let{sortKey:St,symbolInstanceStart:Nt,symbolInstanceEnd:Zt}=Wt;l.push({sortKey:St,symbolInstanceStart:Nt,symbolInstanceEnd:Zt,parameters:kt})}else l.push({symbolInstanceStart:0,symbolInstanceEnd:M.symbolInstances.length,parameters:kt})}attemptAnchorPlacement(l,f,v,b,M,O,F,U,W,$,X,at,gt,_t,yt,At){let kt=s.ap[l.textAnchor],Wt=[l.textOffset0,l.textOffset1],St=tn(kt,v,b,Wt,M),Nt=this.collisionIndex.placeCollisionBox(es(f,St.x,St.y,O,F,this.transform.angle),X,U,W,$.predicate,At);if((!yt||this.collisionIndex.placeCollisionBox(es(yt,St.x,St.y,O,F,this.transform.angle),X,U,W,$.predicate,At).box.length!==0)&&Nt.box.length>0){let Zt;if(this.prevPlacement&&this.prevPlacement.variableOffsets[at.crossTileID]&&this.prevPlacement.placements[at.crossTileID]&&this.prevPlacement.placements[at.crossTileID].text&&(Zt=this.prevPlacement.variableOffsets[at.crossTileID].anchor),at.crossTileID===0)throw new Error(\"symbolInstance.crossTileID can't be 0\");return this.variableOffsets[at.crossTileID]={textOffset:Wt,width:v,height:b,anchor:kt,textBoxScale:M,prevAnchor:Zt},this.markUsedJustification(gt,kt,at,_t),gt.allowVerticalPlacement&&(this.markUsedOrientation(gt,_t,at),this.placedOrientations[at.crossTileID]=_t),{shift:St,placedGlyphBoxes:Nt}}}placeLayerBucketPart(l,f,v){let{bucket:b,layout:M,posMatrix:O,textLabelPlaneMatrix:F,labelToScreenMatrix:U,textPixelRatio:W,holdingForFade:$,collisionBoxArray:X,partiallyEvaluatedTextSize:at,collisionGroup:gt}=l.parameters,_t=M.get(\"text-optional\"),yt=M.get(\"icon-optional\"),At=s.aq(M,\"text-overlap\",\"text-allow-overlap\"),kt=At===\"always\",Wt=s.aq(M,\"icon-overlap\",\"icon-allow-overlap\"),St=Wt===\"always\",Nt=M.get(\"text-rotation-alignment\")===\"map\",Zt=M.get(\"text-pitch-alignment\")===\"map\",Ht=M.get(\"icon-text-fit\")!==\"none\",ne=M.get(\"symbol-z-order\")===\"viewport-y\",he=kt&&(St||!b.hasIconData()||yt),ce=St&&(kt||!b.hasTextData()||_t);!b.collisionArrays&&X&&b.deserializeCollisionBoxes(X);let ge=this.retainedQueryData[b.bucketInstanceId].tileID,Ue=this.terrain?(Me,ar)=>this.terrain.getElevation(ge,Me,ar):null,ur=(Me,ar)=>{var He,rn;if(f[Me.crossTileID])return;if($)return void(this.placements[Me.crossTileID]=new Wi(!1,!1,!1));let Jr=!1,Fr=!1,$r=!0,On=null,Dr={box:null,offscreen:null},So={box:null,offscreen:null},Is=null,Mn=null,Vs=null,js=0,ha=0,Bc=0;ar.textFeatureIndex?js=ar.textFeatureIndex:Me.useRuntimeCollisionCircles&&(js=Me.featureIndex),ar.verticalTextFeatureIndex&&(ha=ar.verticalTextFeatureIndex);let Lf=ar.textBox;if(Lf){let us=Xe=>{let Bi=s.ah.horizontal;if(b.allowVerticalPlacement&&!Xe&&this.prevPlacement){let Cs=this.prevPlacement.placedOrientations[Me.crossTileID];Cs&&(this.placedOrientations[Me.crossTileID]=Cs,Bi=Cs,this.markUsedOrientation(b,Bi,Me))}return Bi},Zn=(Xe,Bi)=>{if(b.allowVerticalPlacement&&Me.numVerticalGlyphVertices>0&&ar.verticalTextBox){for(let Cs of b.writingModes)if(Cs===s.ah.vertical?(Dr=Bi(),So=Dr):Dr=Xe(),Dr&&Dr.box&&Dr.box.length)break}else Dr=Xe()},nn=Me.textAnchorOffsetStartIndex,dn=Me.textAnchorOffsetEndIndex;if(dn===nn){let Xe=(Bi,Cs)=>{let En=this.collisionIndex.placeCollisionBox(Bi,At,W,O,gt.predicate,Ue);return En&&En.box&&En.box.length&&(this.markUsedOrientation(b,Cs,Me),this.placedOrientations[Me.crossTileID]=Cs),En};Zn(()=>Xe(Lf,s.ah.horizontal),()=>{let Bi=ar.verticalTextBox;return b.allowVerticalPlacement&&Me.numVerticalGlyphVertices>0&&Bi?Xe(Bi,s.ah.vertical):{box:null,offscreen:null}}),us(Dr&&Dr.box&&Dr.box.length)}else{let Xe=s.ap[(rn=(He=this.prevPlacement)===null||He===void 0?void 0:He.variableOffsets[Me.crossTileID])===null||rn===void 0?void 0:rn.anchor],Bi=(En,o0,Bn)=>{let Ul=En.x2-En.x1,ve=En.y2-En.y1,De=Me.textBoxScale,wu=Ht&&Wt===\"never\"?o0:null,Ua={box:[],offscreen:!1},ph=At===\"never\"?1:2,fa=\"never\";Xe&&ph++;for(let a0=0;a0<ph;a0++){for(let fl=nn;fl<dn;fl++){let p=b.textAnchorOffsets.get(fl);if(Xe&&p.textAnchor!==Xe)continue;let m=this.attemptAnchorPlacement(p,En,Ul,ve,De,Nt,Zt,W,O,gt,fa,Me,b,Bn,wu,Ue);if(m&&(Ua=m.placedGlyphBoxes,Ua&&Ua.box&&Ua.box.length))return Jr=!0,On=m.shift,Ua}Xe?Xe=null:fa=At}return Ua};Zn(()=>Bi(Lf,ar.iconBox,s.ah.horizontal),()=>{let En=ar.verticalTextBox;return b.allowVerticalPlacement&&!(Dr&&Dr.box&&Dr.box.length)&&Me.numVerticalGlyphVertices>0&&En?Bi(En,ar.verticalIconBox,s.ah.vertical):{box:null,offscreen:null}}),Dr&&(Jr=Dr.box,$r=Dr.offscreen);let Cs=us(Dr&&Dr.box);if(!Jr&&this.prevPlacement){let En=this.prevPlacement.variableOffsets[Me.crossTileID];En&&(this.variableOffsets[Me.crossTileID]=En,this.markUsedJustification(b,En.anchor,Me,Cs))}}}if(Is=Dr,Jr=Is&&Is.box&&Is.box.length>0,$r=Is&&Is.offscreen,Me.useRuntimeCollisionCircles){let us=b.text.placedSymbolArray.get(Me.centerJustifiedTextSymbolIndex),Zn=s.ai(b.textSizeData,at,us),nn=M.get(\"text-padding\");Mn=this.collisionIndex.placeCollisionCircles(At,us,b.lineVertexArray,b.glyphOffsetArray,Zn,O,F,U,v,Zt,gt.predicate,Me.collisionCircleDiameter,nn,Ue),Mn.circles.length&&Mn.collisionDetected&&!v&&s.w(\"Collisions detected, but collision boxes are not shown\"),Jr=kt||Mn.circles.length>0&&!Mn.collisionDetected,$r=$r&&Mn.offscreen}if(ar.iconFeatureIndex&&(Bc=ar.iconFeatureIndex),ar.iconBox){let us=Zn=>{let nn=Ht&&On?es(Zn,On.x,On.y,Nt,Zt,this.transform.angle):Zn;return this.collisionIndex.placeCollisionBox(nn,Wt,W,O,gt.predicate,Ue)};So&&So.box&&So.box.length&&ar.verticalIconBox?(Vs=us(ar.verticalIconBox),Fr=Vs.box.length>0):(Vs=us(ar.iconBox),Fr=Vs.box.length>0),$r=$r&&Vs.offscreen}let kf=_t||Me.numHorizontalGlyphVertices===0&&Me.numVerticalGlyphVertices===0,bu=yt||Me.numIconVertices===0;if(kf||bu?bu?kf||(Fr=Fr&&Jr):Jr=Fr&&Jr:Fr=Jr=Fr&&Jr,Jr&&Is&&Is.box&&this.collisionIndex.insertCollisionBox(Is.box,At,M.get(\"text-ignore-placement\"),b.bucketInstanceId,So&&So.box&&ha?ha:js,gt.ID),Fr&&Vs&&this.collisionIndex.insertCollisionBox(Vs.box,Wt,M.get(\"icon-ignore-placement\"),b.bucketInstanceId,Bc,gt.ID),Mn&&(Jr&&this.collisionIndex.insertCollisionCircles(Mn.circles,At,M.get(\"text-ignore-placement\"),b.bucketInstanceId,js,gt.ID),v)){let us=b.bucketInstanceId,Zn=this.collisionCircleArrays[us];Zn===void 0&&(Zn=this.collisionCircleArrays[us]=new bn);for(let nn=0;nn<Mn.circles.length;nn+=4)Zn.circles.push(Mn.circles[nn+0]),Zn.circles.push(Mn.circles[nn+1]),Zn.circles.push(Mn.circles[nn+2]),Zn.circles.push(Mn.collisionDetected?1:0)}if(Me.crossTileID===0)throw new Error(\"symbolInstance.crossTileID can't be 0\");if(b.bucketInstanceId===0)throw new Error(\"bucket.bucketInstanceId can't be 0\");this.placements[Me.crossTileID]=new Wi(Jr||he,Fr||ce,$r||b.justReloaded),f[Me.crossTileID]=!0};if(ne){if(l.symbolInstanceStart!==0)throw new Error(\"bucket.bucketInstanceId should be 0\");let Me=b.getSortedSymbolIndexes(this.transform.angle);for(let ar=Me.length-1;ar>=0;--ar){let He=Me[ar];ur(b.symbolInstances.get(He),b.collisionArrays[He])}}else for(let Me=l.symbolInstanceStart;Me<l.symbolInstanceEnd;Me++)ur(b.symbolInstances.get(Me),b.collisionArrays[Me]);if(v&&b.bucketInstanceId in this.collisionCircleArrays){let Me=this.collisionCircleArrays[b.bucketInstanceId];s.ar(Me.invProjMatrix,O),Me.viewportMatrix=this.collisionIndex.getViewportMatrix()}b.justReloaded=!1}markUsedJustification(l,f,v,b){let M;M=b===s.ah.vertical?v.verticalPlacedTextSymbolIndex:{left:v.leftJustifiedTextSymbolIndex,center:v.centerJustifiedTextSymbolIndex,right:v.rightJustifiedTextSymbolIndex}[s.as(f)];let O=[v.leftJustifiedTextSymbolIndex,v.centerJustifiedTextSymbolIndex,v.rightJustifiedTextSymbolIndex,v.verticalPlacedTextSymbolIndex];for(let F of O)F>=0&&(l.text.placedSymbolArray.get(F).crossTileID=M>=0&&F!==M?0:v.crossTileID)}markUsedOrientation(l,f,v){let b=f===s.ah.horizontal||f===s.ah.horizontalOnly?f:0,M=f===s.ah.vertical?f:0,O=[v.leftJustifiedTextSymbolIndex,v.centerJustifiedTextSymbolIndex,v.rightJustifiedTextSymbolIndex];for(let F of O)l.text.placedSymbolArray.get(F).placedOrientation=b;v.verticalPlacedTextSymbolIndex&&(l.text.placedSymbolArray.get(v.verticalPlacedTextSymbolIndex).placedOrientation=M)}commit(l){this.commitTime=l,this.zoomAtLastRecencyCheck=this.transform.zoom;let f=this.prevPlacement,v=!1;this.prevZoomAdjustment=f?f.zoomAdjustment(this.transform.zoom):0;let b=f?f.symbolFadeChange(l):1,M=f?f.opacities:{},O=f?f.variableOffsets:{},F=f?f.placedOrientations:{};for(let U in this.placements){let W=this.placements[U],$=M[U];$?(this.opacities[U]=new Si($,b,W.text,W.icon),v=v||W.text!==$.text.placed||W.icon!==$.icon.placed):(this.opacities[U]=new Si(null,b,W.text,W.icon,W.skipFade),v=v||W.text||W.icon)}for(let U in M){let W=M[U];if(!this.opacities[U]){let $=new Si(W,b,!1,!1);$.isHidden()||(this.opacities[U]=$,v=v||W.text.placed||W.icon.placed)}}for(let U in O)this.variableOffsets[U]||!this.opacities[U]||this.opacities[U].isHidden()||(this.variableOffsets[U]=O[U]);for(let U in F)this.placedOrientations[U]||!this.opacities[U]||this.opacities[U].isHidden()||(this.placedOrientations[U]=F[U]);if(f&&f.lastPlacementChangeTime===void 0)throw new Error(\"Last placement time for previous placement is not defined\");v?this.lastPlacementChangeTime=l:typeof this.lastPlacementChangeTime!=\"number\"&&(this.lastPlacementChangeTime=f?f.lastPlacementChangeTime:l)}updateLayerOpacities(l,f){let v={};for(let b of f){let M=b.getBucket(l);M&&b.latestFeatureIndex&&l.id===M.layerIds[0]&&this.updateBucketOpacities(M,v,b.collisionBoxArray)}}updateBucketOpacities(l,f,v){l.hasTextData()&&(l.text.opacityVertexArray.clear(),l.text.hasVisibleVertices=!1),l.hasIconData()&&(l.icon.opacityVertexArray.clear(),l.icon.hasVisibleVertices=!1),l.hasIconCollisionBoxData()&&l.iconCollisionBox.collisionVertexArray.clear(),l.hasTextCollisionBoxData()&&l.textCollisionBox.collisionVertexArray.clear();let b=l.layers[0],M=b.layout,O=new Si(null,0,!1,!1,!0),F=M.get(\"text-allow-overlap\"),U=M.get(\"icon-allow-overlap\"),W=b._unevaluatedLayout.hasValue(\"text-variable-anchor\")||b._unevaluatedLayout.hasValue(\"text-variable-anchor-offset\"),$=M.get(\"text-rotation-alignment\")===\"map\",X=M.get(\"text-pitch-alignment\")===\"map\",at=M.get(\"icon-text-fit\")!==\"none\",gt=new Si(null,0,F&&(U||!l.hasIconData()||M.get(\"icon-optional\")),U&&(F||!l.hasTextData()||M.get(\"text-optional\")),!0);!l.collisionArrays&&v&&(l.hasIconCollisionBoxData()||l.hasTextCollisionBoxData())&&l.deserializeCollisionBoxes(v);let _t=(yt,At,kt)=>{for(let Wt=0;Wt<At/4;Wt++)yt.opacityVertexArray.emplaceBack(kt);yt.hasVisibleVertices=yt.hasVisibleVertices||kt!==Ol};for(let yt=0;yt<l.symbolInstances.length;yt++){let At=l.symbolInstances.get(yt),{numHorizontalGlyphVertices:kt,numVerticalGlyphVertices:Wt,crossTileID:St}=At,Nt=this.opacities[St];f[St]?Nt=O:Nt||(Nt=gt,this.opacities[St]=Nt),f[St]=!0;let Zt=At.numIconVertices>0,Ht=this.placedOrientations[At.crossTileID],ne=Ht===s.ah.vertical,he=Ht===s.ah.horizontal||Ht===s.ah.horizontalOnly;if(kt>0||Wt>0){let ce=wn(Nt.text);_t(l.text,kt,ne?Ol:ce),_t(l.text,Wt,he?Ol:ce);let ge=Nt.text.isHidden();[At.rightJustifiedTextSymbolIndex,At.centerJustifiedTextSymbolIndex,At.leftJustifiedTextSymbolIndex].forEach(Me=>{Me>=0&&(l.text.placedSymbolArray.get(Me).hidden=ge||ne?1:0)}),At.verticalPlacedTextSymbolIndex>=0&&(l.text.placedSymbolArray.get(At.verticalPlacedTextSymbolIndex).hidden=ge||he?1:0);let Ue=this.variableOffsets[At.crossTileID];Ue&&this.markUsedJustification(l,Ue.anchor,At,Ht);let ur=this.placedOrientations[At.crossTileID];ur&&(this.markUsedJustification(l,\"left\",At,ur),this.markUsedOrientation(l,ur,At))}if(Zt){let ce=wn(Nt.icon),ge=!(at&&At.verticalPlacedIconSymbolIndex&&ne);At.placedIconSymbolIndex>=0&&(_t(l.icon,At.numIconVertices,ge?ce:Ol),l.icon.placedSymbolArray.get(At.placedIconSymbolIndex).hidden=Nt.icon.isHidden()),At.verticalPlacedIconSymbolIndex>=0&&(_t(l.icon,At.numVerticalIconVertices,ge?Ol:ce),l.icon.placedSymbolArray.get(At.verticalPlacedIconSymbolIndex).hidden=Nt.icon.isHidden())}if(l.hasIconCollisionBoxData()||l.hasTextCollisionBoxData()){let ce=l.collisionArrays[yt];if(ce){let ge=new s.P(0,0);if(ce.textBox||ce.verticalTextBox){let ur=!0;if(W){let Me=this.variableOffsets[St];Me?(ge=tn(Me.anchor,Me.width,Me.height,Me.textOffset,Me.textBoxScale),$&&ge._rotate(X?this.transform.angle:-this.transform.angle)):ur=!1}ce.textBox&&Ln(l.textCollisionBox.collisionVertexArray,Nt.text.placed,!ur||ne,ge.x,ge.y),ce.verticalTextBox&&Ln(l.textCollisionBox.collisionVertexArray,Nt.text.placed,!ur||he,ge.x,ge.y)}let Ue=!!(!he&&ce.verticalIconBox);ce.iconBox&&Ln(l.iconCollisionBox.collisionVertexArray,Nt.icon.placed,Ue,at?ge.x:0,at?ge.y:0),ce.verticalIconBox&&Ln(l.iconCollisionBox.collisionVertexArray,Nt.icon.placed,!Ue,at?ge.x:0,at?ge.y:0)}}}if(l.sortFeatures(this.transform.angle),this.retainedQueryData[l.bucketInstanceId]&&(this.retainedQueryData[l.bucketInstanceId].featureSortOrder=l.featureSortOrder),l.hasTextData()&&l.text.opacityVertexBuffer&&l.text.opacityVertexBuffer.updateData(l.text.opacityVertexArray),l.hasIconData()&&l.icon.opacityVertexBuffer&&l.icon.opacityVertexBuffer.updateData(l.icon.opacityVertexArray),l.hasIconCollisionBoxData()&&l.iconCollisionBox.collisionVertexBuffer&&l.iconCollisionBox.collisionVertexBuffer.updateData(l.iconCollisionBox.collisionVertexArray),l.hasTextCollisionBoxData()&&l.textCollisionBox.collisionVertexBuffer&&l.textCollisionBox.collisionVertexBuffer.updateData(l.textCollisionBox.collisionVertexArray),l.text.opacityVertexArray.length!==l.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${l.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${l.text.layoutVertexArray.length}) / 4`);if(l.icon.opacityVertexArray.length!==l.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${l.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${l.icon.layoutVertexArray.length}) / 4`);if(l.bucketInstanceId in this.collisionCircleArrays){let yt=this.collisionCircleArrays[l.bucketInstanceId];l.placementInvProjMatrix=yt.invProjMatrix,l.placementViewportMatrix=yt.viewportMatrix,l.collisionCircleArray=yt.circles,delete this.collisionCircleArrays[l.bucketInstanceId]}}symbolFadeChange(l){return this.fadeDuration===0?1:(l-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(l){return Math.max(0,(this.transform.zoom-l)/1.5)}hasTransitions(l){return this.stale||l-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(l,f){let v=this.zoomAtLastRecencyCheck===f?1-this.zoomAdjustment(f):1;return this.zoomAtLastRecencyCheck=f,this.commitTime+this.fadeDuration*v>l}setStale(){this.stale=!0}}function Ln(T,l,f,v,b){T.emplaceBack(l?1:0,f?1:0,v||0,b||0),T.emplaceBack(l?1:0,f?1:0,v||0,b||0),T.emplaceBack(l?1:0,f?1:0,v||0,b||0),T.emplaceBack(l?1:0,f?1:0,v||0,b||0)}let la=Math.pow(2,25),Fm=Math.pow(2,24),$g=Math.pow(2,17),mi=Math.pow(2,16),xo=Math.pow(2,9),Ec=Math.pow(2,8),Gn=Math.pow(2,1);function wn(T){if(T.opacity===0&&!T.placed)return 0;if(T.opacity===1&&T.placed)return 4294967295;let l=T.placed?1:0,f=Math.floor(127*T.opacity);return f*la+l*Fm+f*$g+l*mi+f*xo+l*Ec+f*Gn+l}let Ol=0;class kn{constructor(l){this._sortAcrossTiles=l.layout.get(\"symbol-z-order\")!==\"viewport-y\"&&!l.layout.get(\"symbol-sort-key\").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(l,f,v,b,M){let O=this._bucketParts;for(;this._currentTileIndex<l.length;)if(f.getBucketParts(O,b,l[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,M())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,O.sort((F,U)=>F.sortKey-U.sortKey));this._currentPartIndex<O.length;)if(f.placeLayerBucketPart(O[this._currentPartIndex],this._seenCrossTileIDs,v),this._currentPartIndex++,M())return!0;return!1}}class Wn{constructor(l,f,v,b,M,O,F,U){this.placement=new cs(l,f,O,F,U),this._currentPlacementIndex=v.length-1,this._forceFullPlacement=b,this._showCollisionBoxes=M,this._done=!1}isDone(){return this._done}continuePlacement(l,f,v){let b=_.now(),M=()=>!this._forceFullPlacement&&_.now()-b>2;for(;this._currentPlacementIndex>=0;){let O=f[l[this._currentPlacementIndex]],F=this.placement.collisionIndex.transform.zoom;if(O.type===\"symbol\"&&(!O.minzoom||O.minzoom<=F)&&(!O.maxzoom||O.maxzoom>F)){if(this._inProgressLayer||(this._inProgressLayer=new kn(O)),this._inProgressLayer.continuePlacement(v[O.source],this.placement,this._showCollisionBoxes,O,M))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(l){return this.placement.commit(l),this.placement}}let fu=512/s.W/2;class ff{constructor(l,f,v){this.tileID=l,this.bucketInstanceId=v,this._symbolsByKey={};let b=new Map;for(let M=0;M<f.length;M++){let O=f.get(M),F=O.key,U=b.get(F);U?U.push(O):b.set(F,[O])}for(let[M,O]of b){let F={positions:O.map(U=>({x:Math.floor(U.anchorX*fu),y:Math.floor(U.anchorY*fu)})),crossTileIDs:O.map(U=>U.crossTileID)};if(F.positions.length>128){let U=new s.au(F.positions.length,16,Uint16Array);for(let{x:W,y:$}of F.positions)U.add(W,$);U.finish(),delete F.positions,F.index=U}this._symbolsByKey[M]=F}}getScaledCoordinates(l,f){let{x:v,y:b,z:M}=this.tileID.canonical,{x:O,y:F,z:U}=f.canonical,W=fu/Math.pow(2,U-M),$=(F*s.W+l.anchorY)*W,X=b*s.W*fu;return{x:Math.floor((O*s.W+l.anchorX)*W-v*s.W*fu),y:Math.floor($-X)}}findMatches(l,f,v){let b=this.tileID.canonical.z<f.canonical.z?1:Math.pow(2,this.tileID.canonical.z-f.canonical.z);for(let M=0;M<l.length;M++){let O=l.get(M);if(O.crossTileID)continue;let F=this._symbolsByKey[O.key];if(!F)continue;let U=this.getScaledCoordinates(O,f);if(F.index){let W=F.index.range(U.x-b,U.y-b,U.x+b,U.y+b).sort();for(let $ of W){let X=F.crossTileIDs[$];if(!v[X]){v[X]=!0,O.crossTileID=X;break}}}else if(F.positions)for(let W=0;W<F.positions.length;W++){let $=F.positions[W],X=F.crossTileIDs[W];if(Math.abs($.x-U.x)<=b&&Math.abs($.y-U.y)<=b&&!v[X]){v[X]=!0,O.crossTileID=X;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:l})=>l)}}class hn{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class no{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(l){let f=Math.round((l-this.lng)/360);if(f!==0)for(let v in this.indexes){let b=this.indexes[v],M={};for(let O in b){let F=b[O];F.tileID=F.tileID.unwrapTo(F.tileID.wrap+f),M[F.tileID.key]=F}this.indexes[v]=M}this.lng=l}addBucket(l,f,v){if(this.indexes[l.overscaledZ]&&this.indexes[l.overscaledZ][l.key]){if(this.indexes[l.overscaledZ][l.key].bucketInstanceId===f.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(l.overscaledZ,this.indexes[l.overscaledZ][l.key])}for(let M=0;M<f.symbolInstances.length;M++)f.symbolInstances.get(M).crossTileID=0;this.usedCrossTileIDs[l.overscaledZ]||(this.usedCrossTileIDs[l.overscaledZ]={});let b=this.usedCrossTileIDs[l.overscaledZ];for(let M in this.indexes){let O=this.indexes[M];if(Number(M)>l.overscaledZ)for(let F in O){let U=O[F];U.tileID.isChildOf(l)&&U.findMatches(f.symbolInstances,l,b)}else{let F=O[l.scaledTo(Number(M)).key];F&&F.findMatches(f.symbolInstances,l,b)}}for(let M=0;M<f.symbolInstances.length;M++){let O=f.symbolInstances.get(M);O.crossTileID||(O.crossTileID=v.generate(),b[O.crossTileID]=!0)}return this.indexes[l.overscaledZ]===void 0&&(this.indexes[l.overscaledZ]={}),this.indexes[l.overscaledZ][l.key]=new ff(l,f.symbolInstances,f.bucketInstanceId),!0}removeBucketCrossTileIDs(l,f){for(let v of f.getCrossTileIDsLists())for(let b of v)delete this.usedCrossTileIDs[l][b]}removeStaleBuckets(l){let f=!1;for(let v in this.indexes){let b=this.indexes[v];for(let M in b)l[b[M].bucketInstanceId]||(this.removeBucketCrossTileIDs(v,b[M]),delete b[M],f=!0)}return f}}class Ra{constructor(){this.layerIndexes={},this.crossTileIDs=new hn,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(l,f,v){let b=this.layerIndexes[l.id];b===void 0&&(b=this.layerIndexes[l.id]=new no);let M=!1,O={};b.handleWrapJump(v);for(let F of f){let U=F.getBucket(l);U&&l.id===U.layerIds[0]&&(U.bucketInstanceId||(U.bucketInstanceId=++this.maxBucketInstanceId),b.addBucket(F.tileID,U,this.crossTileIDs)&&(M=!0),O[U.bucketInstanceId]=!0)}return b.removeStaleBuckets(O)&&(M=!0),M}pruneUnusedLayers(l){let f={};l.forEach(v=>{f[v]=!0});for(let v in this.layerIndexes)f[v]||delete this.layerIndexes[v]}}let Hi=(T,l)=>s.t(T,l&&l.filter(f=>f.identifier!==\"source.canvas\")),lh=s.av();class so extends s.E{constructor(l,f={}){super(),this._rtlTextPluginStateChange=()=>{for(let v in this.sourceCaches){let b=this.sourceCaches[v].getSource().type;b!==\"vector\"&&b!==\"geojson\"||this.sourceCaches[v].reload()}},this.map=l,this.dispatcher=new yo(Ci(),l._getMapId()),this.dispatcher.registerMessageHandler(\"getGlyphs\",(v,b)=>this.getGlyphs(v,b)),this.dispatcher.registerMessageHandler(\"getImages\",(v,b)=>this.getImages(v,b)),this.imageManager=new sr,this.imageManager.setEventedParent(this),this.glyphManager=new Fs(l._requestManager,f.localIdeographFontFamily),this.lineAtlas=new Ss(256,512),this.crossTileSymbolIndex=new Ra,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new s.aw,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast(\"setReferrer\",s.ax()),Ae().on(\"pluginStateChange\",this._rtlTextPluginStateChange),this.on(\"data\",v=>{if(v.dataType!==\"source\"||v.sourceDataType!==\"metadata\")return;let b=this.sourceCaches[v.sourceId];if(!b)return;let M=b.getSource();if(M&&M.vectorLayerIds)for(let O in this._layers){let F=this._layers[O];F.source===M.id&&this._validateLayer(F)}})}loadURL(l,f={},v){this.fire(new s.k(\"dataloading\",{dataType:\"style\"})),f.validate=typeof f.validate!=\"boolean\"||f.validate;let b=this.map._requestManager.transformRequest(l,K.Style);this._loadStyleRequest=new AbortController,s.h(b,this._loadStyleRequest).then(M=>{this._loadStyleRequest=null,this._load(M.data,f,v)}).catch(M=>{this._loadStyleRequest=null,M&&this.fire(new s.j(M))})}loadJSON(l,f={},v){this.fire(new s.k(\"dataloading\",{dataType:\"style\"})),this._frameRequest=new AbortController,_.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,f.validate=f.validate!==!1,this._load(l,f,v)}).catch(()=>{})}loadEmpty(){this.fire(new s.k(\"dataloading\",{dataType:\"style\"})),this._load(lh,{validate:!1})}_load(l,f,v){var b;let M=f.transformStyle?f.transformStyle(v,l):l;if(!f.validate||!Hi(this,s.x(M))){this._loaded=!0,this.stylesheet=M;for(let O in M.sources)this.addSource(O,M.sources[O],{validate:!1});M.sprite?this._loadSprite(M.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(M.glyphs),this._createLayers(),this.light=new io(this.stylesheet.light),this.map.setTerrain((b=this.stylesheet.terrain)!==null&&b!==void 0?b:null),this.fire(new s.k(\"data\",{dataType:\"style\"})),this.fire(new s.k(\"style.load\"))}}_createLayers(){let l=s.ay(this.stylesheet.layers);this.dispatcher.broadcast(\"setLayers\",l),this._order=l.map(f=>f.id),this._layers={},this._serializedLayers=null;for(let f of l){let v=s.az(f);v.setEventedParent(this,{layer:{id:f.id}}),this._layers[f.id]=v}}_loadSprite(l,f=!1,v=void 0){let b;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(M,O,F,U){return s._(this,void 0,void 0,function*(){let W=oe(M),$=F>1?\"@2x\":\"\",X={},at={};for(let{id:gt,url:_t}of W){let yt=O.transformRequest(O.normalizeSpriteURL(_t,$,\".json\"),K.SpriteJSON);X[gt]=s.h(yt,U);let At=O.transformRequest(O.normalizeSpriteURL(_t,$,\".png\"),K.SpriteImage);at[gt]=Z.getImage(At,U)}return yield Promise.all([...Object.values(X),...Object.values(at)]),function(gt,_t){return s._(this,void 0,void 0,function*(){let yt={};for(let At in gt){yt[At]={};let kt=_.getImageCanvasContext((yield _t[At]).data),Wt=(yield gt[At]).data;for(let St in Wt){let{width:Nt,height:Zt,x:Ht,y:ne,sdf:he,pixelRatio:ce,stretchX:ge,stretchY:Ue,content:ur}=Wt[St];yt[At][St]={data:null,pixelRatio:ce,sdf:he,stretchX:ge,stretchY:Ue,content:ur,spriteData:{width:Nt,height:Zt,x:Ht,y:ne,context:kt}}}}return yt})}(X,at)})}(l,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(M=>{if(this._spriteRequest=null,M)for(let O in M){this._spritesImagesIds[O]=[];let F=this._spritesImagesIds[O]?this._spritesImagesIds[O].filter(U=>!(U in M)):[];for(let U of F)this.imageManager.removeImage(U),this._changedImages[U]=!0;for(let U in M[O]){let W=O===\"default\"?U:`${O}:${U}`;this._spritesImagesIds[O].push(W),W in this.imageManager.images?this.imageManager.updateImage(W,M[O][U],!1):this.imageManager.addImage(W,M[O][U]),f&&(this._changedImages[W]=!0)}}}).catch(M=>{this._spriteRequest=null,b=M,this.fire(new s.j(b))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),f&&(this._changed=!0),this.dispatcher.broadcast(\"setImages\",this._availableImages),this.fire(new s.k(\"data\",{dataType:\"style\"})),v&&v(b)})}_unloadSprite(){for(let l of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(l),this._changedImages[l]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast(\"setImages\",this._availableImages),this.fire(new s.k(\"data\",{dataType:\"style\"}))}_validateLayer(l){let f=this.sourceCaches[l.source];if(!f)return;let v=l.sourceLayer;if(!v)return;let b=f.getSource();(b.type===\"geojson\"||b.vectorLayerIds&&b.vectorLayerIds.indexOf(v)===-1)&&this.fire(new s.j(new Error(`Source layer \"${v}\" does not exist on source \"${b.id}\" as specified by style layer \"${l.id}\".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let l in this.sourceCaches)if(!this.sourceCaches[l].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(l){let f=this._serializedAllLayers();if(!l||l.length===0)return Object.values(f);let v=[];for(let b of l)f[b]&&v.push(f[b]);return v}_serializedAllLayers(){let l=this._serializedLayers;if(l)return l;l=this._serializedLayers={};let f=Object.keys(this._layers);for(let v of f){let b=this._layers[v];b.type!==\"custom\"&&(l[v]=b.serialize())}return l}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(let l in this.sourceCaches)if(this.sourceCaches[l].hasTransition())return!0;for(let l in this._layers)if(this._layers[l].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error(\"Style is not done loading.\")}update(l){if(!this._loaded)return;let f=this._changed;if(this._changed){let b=Object.keys(this._updatedLayers),M=Object.keys(this._removedLayers);(b.length||M.length)&&this._updateWorkerLayers(b,M);for(let O in this._updatedSources){let F=this._updatedSources[O];if(F===\"reload\")this._reloadSource(O);else{if(F!==\"clear\")throw new Error(`Invalid action ${F}`);this._clearSource(O)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let O in this._updatedPaintProps)this._layers[O].updateTransitions(l);this.light.updateTransitions(l),this._resetUpdates()}let v={};for(let b in this.sourceCaches){let M=this.sourceCaches[b];v[b]=M.used,M.used=!1}for(let b of this._order){let M=this._layers[b];M.recalculate(l,this._availableImages),!M.isHidden(l.zoom)&&M.source&&(this.sourceCaches[M.source].used=!0)}for(let b in v){let M=this.sourceCaches[b];v[b]!==M.used&&M.fire(new s.k(\"data\",{sourceDataType:\"visibility\",dataType:\"source\",sourceId:b}))}this.light.recalculate(l),this.z=l.zoom,f&&this.fire(new s.k(\"data\",{dataType:\"style\"}))}_updateTilesForChangedImages(){let l=Object.keys(this._changedImages);if(l.length){for(let f in this.sourceCaches)this.sourceCaches[f].reloadTilesForDependencies([\"icons\",\"patterns\"],l);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let l in this.sourceCaches)this.sourceCaches[l].reloadTilesForDependencies([\"glyphs\"],[\"\"]);this._glyphsDidChange=!1}}_updateWorkerLayers(l,f){this.dispatcher.broadcast(\"updateLayers\",{layers:this._serializeByIds(l),removedIds:f})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(l,f={}){this._checkLoaded();let v=this.serialize();if(l=f.transformStyle?f.transformStyle(v,l):l,Hi(this,s.x(l)))return!1;(l=s.aA(l)).layers=s.ay(l.layers);let b=s.aB(v,l),M=this._getOperationsToPerform(b);if(M.unimplemented.length>0)throw new Error(`Unimplemented: ${M.unimplemented.join(\", \")}.`);if(M.operations.length===0)return!1;for(let O of M.operations)O();return this.stylesheet=l,this._serializedLayers=null,!0}_getOperationsToPerform(l){let f=[],v=[];for(let b of l)switch(b.command){case\"setCenter\":case\"setZoom\":case\"setBearing\":case\"setPitch\":continue;case\"addLayer\":f.push(()=>this.addLayer.apply(this,b.args));break;case\"removeLayer\":f.push(()=>this.removeLayer.apply(this,b.args));break;case\"setPaintProperty\":f.push(()=>this.setPaintProperty.apply(this,b.args));break;case\"setLayoutProperty\":f.push(()=>this.setLayoutProperty.apply(this,b.args));break;case\"setFilter\":f.push(()=>this.setFilter.apply(this,b.args));break;case\"addSource\":f.push(()=>this.addSource.apply(this,b.args));break;case\"removeSource\":f.push(()=>this.removeSource.apply(this,b.args));break;case\"setLayerZoomRange\":f.push(()=>this.setLayerZoomRange.apply(this,b.args));break;case\"setLight\":f.push(()=>this.setLight.apply(this,b.args));break;case\"setGeoJSONSourceData\":f.push(()=>this.setGeoJSONSourceData.apply(this,b.args));break;case\"setGlyphs\":f.push(()=>this.setGlyphs.apply(this,b.args));break;case\"setSprite\":f.push(()=>this.setSprite.apply(this,b.args));break;case\"setTerrain\":f.push(()=>this.map.setTerrain.apply(this,b.args));break;case\"setTransition\":f.push(()=>{});break;default:v.push(b.command)}return{operations:f,unimplemented:v}}addImage(l,f){if(this.getImage(l))return this.fire(new s.j(new Error(`An image named \"${l}\" already exists.`)));this.imageManager.addImage(l,f),this._afterImageUpdated(l)}updateImage(l,f){this.imageManager.updateImage(l,f)}getImage(l){return this.imageManager.getImage(l)}removeImage(l){if(!this.getImage(l))return this.fire(new s.j(new Error(`An image named \"${l}\" does not exist.`)));this.imageManager.removeImage(l),this._afterImageUpdated(l)}_afterImageUpdated(l){this._availableImages=this.imageManager.listImages(),this._changedImages[l]=!0,this._changed=!0,this.dispatcher.broadcast(\"setImages\",this._availableImages),this.fire(new s.k(\"data\",{dataType:\"style\"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(l,f,v={}){if(this._checkLoaded(),this.sourceCaches[l]!==void 0)throw new Error(`Source \"${l}\" already exists.`);if(!f.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(f).join(\", \")}.`);if([\"vector\",\"raster\",\"geojson\",\"video\",\"image\"].indexOf(f.type)>=0&&this._validate(s.x.source,`sources.${l}`,f,null,v))return;this.map&&this.map._collectResourceTiming&&(f.collectResourceTiming=!0);let b=this.sourceCaches[l]=new ts(l,f,this.dispatcher);b.style=this,b.setEventedParent(this,()=>({isSourceLoaded:b.loaded(),source:b.serialize(),sourceId:l})),b.onAdd(this.map),this._changed=!0}removeSource(l){if(this._checkLoaded(),this.sourceCaches[l]===void 0)throw new Error(\"There is no source with this ID\");for(let v in this._layers)if(this._layers[v].source===l)return this.fire(new s.j(new Error(`Source \"${l}\" cannot be removed while layer \"${v}\" is using it.`)));let f=this.sourceCaches[l];delete this.sourceCaches[l],delete this._updatedSources[l],f.fire(new s.k(\"data\",{sourceDataType:\"metadata\",dataType:\"source\",sourceId:l})),f.setEventedParent(null),f.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(l,f){if(this._checkLoaded(),this.sourceCaches[l]===void 0)throw new Error(`There is no source with this ID=${l}`);let v=this.sourceCaches[l].getSource();if(v.type!==\"geojson\")throw new Error(`geojsonSource.type is ${v.type}, which is !== 'geojson`);v.setData(f),this._changed=!0}getSource(l){return this.sourceCaches[l]&&this.sourceCaches[l].getSource()}addLayer(l,f,v={}){this._checkLoaded();let b=l.id;if(this.getLayer(b))return void this.fire(new s.j(new Error(`Layer \"${b}\" already exists on this map.`)));let M;if(l.type===\"custom\"){if(Hi(this,s.aC(l)))return;M=s.az(l)}else{if(\"source\"in l&&typeof l.source==\"object\"&&(this.addSource(b,l.source),l=s.aA(l),l=s.e(l,{source:b})),this._validate(s.x.layer,`layers.${b}`,l,{arrayIndex:-1},v))return;M=s.az(l),this._validateLayer(M),M.setEventedParent(this,{layer:{id:b}})}let O=f?this._order.indexOf(f):this._order.length;if(f&&O===-1)this.fire(new s.j(new Error(`Cannot add layer \"${b}\" before non-existing layer \"${f}\".`)));else{if(this._order.splice(O,0,b),this._layerOrderChanged=!0,this._layers[b]=M,this._removedLayers[b]&&M.source&&M.type!==\"custom\"){let F=this._removedLayers[b];delete this._removedLayers[b],F.type!==M.type?this._updatedSources[M.source]=\"clear\":(this._updatedSources[M.source]=\"reload\",this.sourceCaches[M.source].pause())}this._updateLayer(M),M.onAdd&&M.onAdd(this.map)}}moveLayer(l,f){if(this._checkLoaded(),this._changed=!0,!this._layers[l])return void this.fire(new s.j(new Error(`The layer '${l}' does not exist in the map's style and cannot be moved.`)));if(l===f)return;let v=this._order.indexOf(l);this._order.splice(v,1);let b=f?this._order.indexOf(f):this._order.length;f&&b===-1?this.fire(new s.j(new Error(`Cannot move layer \"${l}\" before non-existing layer \"${f}\".`))):(this._order.splice(b,0,l),this._layerOrderChanged=!0)}removeLayer(l){this._checkLoaded();let f=this._layers[l];if(!f)return void this.fire(new s.j(new Error(`Cannot remove non-existing layer \"${l}\".`)));f.setEventedParent(null);let v=this._order.indexOf(l);this._order.splice(v,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[l]=f,delete this._layers[l],this._serializedLayers&&delete this._serializedLayers[l],delete this._updatedLayers[l],delete this._updatedPaintProps[l],f.onRemove&&f.onRemove(this.map)}getLayer(l){return this._layers[l]}getLayersOrder(){return[...this._order]}hasLayer(l){return l in this._layers}setLayerZoomRange(l,f,v){this._checkLoaded();let b=this.getLayer(l);b?b.minzoom===f&&b.maxzoom===v||(f!=null&&(b.minzoom=f),v!=null&&(b.maxzoom=v),this._updateLayer(b)):this.fire(new s.j(new Error(`Cannot set the zoom range of non-existing layer \"${l}\".`)))}setFilter(l,f,v={}){this._checkLoaded();let b=this.getLayer(l);if(b){if(!s.aD(b.filter,f))return f==null?(b.filter=void 0,void this._updateLayer(b)):void(this._validate(s.x.filter,`layers.${b.id}.filter`,f,null,v)||(b.filter=s.aA(f),this._updateLayer(b)))}else this.fire(new s.j(new Error(`Cannot filter non-existing layer \"${l}\".`)))}getFilter(l){return s.aA(this.getLayer(l).filter)}setLayoutProperty(l,f,v,b={}){this._checkLoaded();let M=this.getLayer(l);M?s.aD(M.getLayoutProperty(f),v)||(M.setLayoutProperty(f,v,b),this._updateLayer(M)):this.fire(new s.j(new Error(`Cannot style non-existing layer \"${l}\".`)))}getLayoutProperty(l,f){let v=this.getLayer(l);if(v)return v.getLayoutProperty(f);this.fire(new s.j(new Error(`Cannot get style of non-existing layer \"${l}\".`)))}setPaintProperty(l,f,v,b={}){this._checkLoaded();let M=this.getLayer(l);M?s.aD(M.getPaintProperty(f),v)||(M.setPaintProperty(f,v,b)&&this._updateLayer(M),this._changed=!0,this._updatedPaintProps[l]=!0):this.fire(new s.j(new Error(`Cannot style non-existing layer \"${l}\".`)))}getPaintProperty(l,f){return this.getLayer(l).getPaintProperty(f)}setFeatureState(l,f){this._checkLoaded();let v=l.source,b=l.sourceLayer,M=this.sourceCaches[v];if(M===void 0)return void this.fire(new s.j(new Error(`The source '${v}' does not exist in the map's style.`)));let O=M.getSource().type;O===\"geojson\"&&b?this.fire(new s.j(new Error(\"GeoJSON sources cannot have a sourceLayer parameter.\"))):O!==\"vector\"||b?(l.id===void 0&&this.fire(new s.j(new Error(\"The feature id parameter must be provided.\"))),M.setFeatureState(b,l.id,f)):this.fire(new s.j(new Error(\"The sourceLayer parameter must be provided for vector source types.\")))}removeFeatureState(l,f){this._checkLoaded();let v=l.source,b=this.sourceCaches[v];if(b===void 0)return void this.fire(new s.j(new Error(`The source '${v}' does not exist in the map's style.`)));let M=b.getSource().type,O=M===\"vector\"?l.sourceLayer:void 0;M!==\"vector\"||O?f&&typeof l.id!=\"string\"&&typeof l.id!=\"number\"?this.fire(new s.j(new Error(\"A feature id is required to remove its specific state property.\"))):b.removeFeatureState(O,l.id,f):this.fire(new s.j(new Error(\"The sourceLayer parameter must be provided for vector source types.\")))}getFeatureState(l){this._checkLoaded();let f=l.source,v=l.sourceLayer,b=this.sourceCaches[f];if(b!==void 0)return b.getSource().type!==\"vector\"||v?(l.id===void 0&&this.fire(new s.j(new Error(\"The feature id parameter must be provided.\"))),b.getFeatureState(v,l.id)):void this.fire(new s.j(new Error(\"The sourceLayer parameter must be provided for vector source types.\")));this.fire(new s.j(new Error(`The source '${f}' does not exist in the map's style.`)))}getTransition(){return s.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let l=s.aE(this.sourceCaches,M=>M.serialize()),f=this._serializeByIds(this._order),v=this.map.getTerrain()||void 0,b=this.stylesheet;return s.aF({version:b.version,name:b.name,metadata:b.metadata,light:b.light,center:b.center,zoom:b.zoom,bearing:b.bearing,pitch:b.pitch,sprite:b.sprite,glyphs:b.glyphs,transition:b.transition,sources:l,layers:f,terrain:v},M=>M!==void 0)}_updateLayer(l){this._updatedLayers[l.id]=!0,l.source&&!this._updatedSources[l.source]&&this.sourceCaches[l.source].getSource().type!==\"raster\"&&(this._updatedSources[l.source]=\"reload\",this.sourceCaches[l.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(l){let f=O=>this._layers[O].type===\"fill-extrusion\",v={},b=[];for(let O=this._order.length-1;O>=0;O--){let F=this._order[O];if(f(F)){v[F]=O;for(let U of l){let W=U[F];if(W)for(let $ of W)b.push($)}}}b.sort((O,F)=>F.intersectionZ-O.intersectionZ);let M=[];for(let O=this._order.length-1;O>=0;O--){let F=this._order[O];if(f(F))for(let U=b.length-1;U>=0;U--){let W=b[U].feature;if(v[W.layer.id]<O)break;M.push(W),b.pop()}else for(let U of l){let W=U[F];if(W)for(let $ of W)M.push($.feature)}}return M}queryRenderedFeatures(l,f,v){f&&f.filter&&this._validate(s.x.filter,\"queryRenderedFeatures.filter\",f.filter,null,f);let b={};if(f&&f.layers){if(!Array.isArray(f.layers))return this.fire(new s.j(new Error(\"parameters.layers must be an Array.\"))),[];for(let F of f.layers){let U=this._layers[F];if(!U)return this.fire(new s.j(new Error(`The layer '${F}' does not exist in the map's style and cannot be queried for features.`))),[];b[U.source]=!0}}let M=[];f.availableImages=this._availableImages;let O=this._serializedAllLayers();for(let F in this.sourceCaches)f.layers&&!b[F]||M.push(Vo(this.sourceCaches[F],this._layers,O,l,f,v));return this.placement&&M.push(function(F,U,W,$,X,at,gt){let _t={},yt=at.queryRenderedSymbols($),At=[];for(let kt of Object.keys(yt).map(Number))At.push(gt[kt]);At.sort(jo);for(let kt of At){let Wt=kt.featureIndex.lookupSymbolFeatures(yt[kt.bucketInstanceId],U,kt.bucketIndex,kt.sourceLayerIndex,X.filter,X.layers,X.availableImages,F);for(let St in Wt){let Nt=_t[St]=_t[St]||[],Zt=Wt[St];Zt.sort((Ht,ne)=>{let he=kt.featureSortOrder;if(he){let ce=he.indexOf(Ht.featureIndex);return he.indexOf(ne.featureIndex)-ce}return ne.featureIndex-Ht.featureIndex});for(let Ht of Zt)Nt.push(Ht)}}for(let kt in _t)_t[kt].forEach(Wt=>{let St=Wt.feature,Nt=W[F[kt].source].getFeatureState(St.layer[\"source-layer\"],St.id);St.source=St.layer.source,St.layer[\"source-layer\"]&&(St.sourceLayer=St.layer[\"source-layer\"]),St.state=Nt});return _t}(this._layers,O,this.sourceCaches,l,f,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(M)}querySourceFeatures(l,f){f&&f.filter&&this._validate(s.x.filter,\"querySourceFeatures.filter\",f.filter,null,f);let v=this.sourceCaches[l];return v?function(b,M){let O=b.getRenderableIds().map(W=>b.getTileByID(W)),F=[],U={};for(let W=0;W<O.length;W++){let $=O[W],X=$.tileID.canonical.key;U[X]||(U[X]=!0,$.querySourceFeatures(F,M))}return F}(v,f):[]}getLight(){return this.light.getLight()}setLight(l,f={}){this._checkLoaded();let v=this.light.getLight(),b=!1;for(let O in l)if(!s.aD(l[O],v[O])){b=!0;break}if(!b)return;let M={now:_.now(),transition:s.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(l,f),this.light.updateTransitions(M)}_validate(l,f,v,b,M={}){return(!M||M.validate!==!1)&&Hi(this,l.call(s.x,s.e({key:f,style:this.serialize(),value:v,styleSpec:s.v},b)))}_remove(l=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),Ae().off(\"pluginStateChange\",this._rtlTextPluginStateChange);for(let f in this._layers)this._layers[f].setEventedParent(null);for(let f in this.sourceCaches){let v=this.sourceCaches[f];v.setEventedParent(null),v.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(l)}_clearSource(l){this.sourceCaches[l].clearTiles()}_reloadSource(l){this.sourceCaches[l].resume(),this.sourceCaches[l].reload()}_updateSources(l){for(let f in this.sourceCaches)this.sourceCaches[f].update(l,this.map.terrain)}_generateCollisionBoxes(){for(let l in this.sourceCaches)this._reloadSource(l)}_updatePlacement(l,f,v,b,M=!1){let O=!1,F=!1,U={};for(let W of this._order){let $=this._layers[W];if($.type!==\"symbol\")continue;if(!U[$.source]){let at=this.sourceCaches[$.source];U[$.source]=at.getRenderableIds(!0).map(gt=>at.getTileByID(gt)).sort((gt,_t)=>_t.tileID.overscaledZ-gt.tileID.overscaledZ||(gt.tileID.isLessThan(_t.tileID)?-1:1))}let X=this.crossTileSymbolIndex.addLayer($,U[$.source],l.center.lng);O=O||X}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((M=M||this._layerOrderChanged||v===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(_.now(),l.zoom))&&(this.pauseablePlacement=new Wn(l,this.map.terrain,this._order,M,f,v,b,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,U),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(_.now()),F=!0),O&&this.pauseablePlacement.placement.setStale()),F||O)for(let W of this._order){let $=this._layers[W];$.type===\"symbol\"&&this.placement.updateLayerOpacities($,U[$.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(_.now())}_releaseSymbolFadeTiles(){for(let l in this.sourceCaches)this.sourceCaches[l].releaseSymbolFadeTiles()}getImages(l,f){return s._(this,void 0,void 0,function*(){let v=yield this.imageManager.getImages(f.icons);this._updateTilesForChangedImages();let b=this.sourceCaches[f.source];return b&&b.setDependencies(f.tileID.key,f.type,f.icons),v})}getGlyphs(l,f){return s._(this,void 0,void 0,function*(){let v=yield this.glyphManager.getGlyphs(f.stacks),b=this.sourceCaches[f.source];return b&&b.setDependencies(f.tileID.key,f.type,[\"\"]),v})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(l,f={}){this._checkLoaded(),l&&this._validate(s.x.glyphs,\"glyphs\",l,null,f)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=l,this.glyphManager.entries={},this.glyphManager.setURL(l))}addSprite(l,f,v={},b){this._checkLoaded();let M=[{id:l,url:f}],O=[...oe(this.stylesheet.sprite),...M];this._validate(s.x.sprite,\"sprite\",O,null,v)||(this.stylesheet.sprite=O,this._loadSprite(M,!0,b))}removeSprite(l){this._checkLoaded();let f=oe(this.stylesheet.sprite);if(f.find(v=>v.id===l)){if(this._spritesImagesIds[l])for(let v of this._spritesImagesIds[l])this.imageManager.removeImage(v),this._changedImages[v]=!0;f.splice(f.findIndex(v=>v.id===l),1),this.stylesheet.sprite=f.length>0?f:void 0,delete this._spritesImagesIds[l],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast(\"setImages\",this._availableImages),this.fire(new s.k(\"data\",{dataType:\"style\"}))}else this.fire(new s.j(new Error(`Sprite \"${l}\" doesn't exists on this map.`)))}getSprite(){return oe(this.stylesheet.sprite)}setSprite(l,f={},v){this._checkLoaded(),l&&this._validate(s.x.sprite,\"sprite\",l,null,f)||(this.stylesheet.sprite=l,l?this._loadSprite(l,!0,v):(this._unloadSprite(),v&&v(null)))}}var ch=s.X([{name:\"a_pos\",type:\"Int16\",components:2}]),qo=\"attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}\";let ca={prelude:Ti(`#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n`,`#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}`),background:Ti(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,\"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}\"),backgroundPattern:Ti(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,\"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}\"),circle:Ti(`varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Ti(\"void main() {gl_FragColor=vec4(1.0);}\",\"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}\"),heatmap:Ti(`uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:Ti(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}`,\"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}\"),collisionBox:Ti(\"varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}\",\"attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}\"),collisionCircle:Ti(\"varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}\",\"attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}\"),debug:Ti(\"uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}\",\"attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}\"),fill:Ti(`#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Ti(`varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Ti(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:Ti(`#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:Ti(`varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:Ti(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:Ti(`#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,\"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}\"),hillshade:Ti(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,\"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}\"),line:Ti(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}`),lineGradient:Ti(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}`),linePattern:Ti(`#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Ti(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Ti(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,\"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}\"),symbolIcon:Ti(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:Ti(`#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:Ti(`#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:Ti(\"uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}\",qo),terrainDepth:Ti(\"varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}\",qo),terrainCoords:Ti(\"precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}\",qo)};function Ti(T,l){let f=/#pragma mapbox: ([\\w]+) ([\\w]+) ([\\w]+) ([\\w]+)/g,v=l.match(/attribute ([\\w]+) ([\\w]+)/g),b=T.match(/uniform ([\\w]+) ([\\w]+)([\\s]*)([\\w]*)/g),M=l.match(/uniform ([\\w]+) ([\\w]+)([\\s]*)([\\w]*)/g),O=M?M.concat(b):b,F={};return{fragmentSource:T=T.replace(f,(U,W,$,X,at)=>(F[at]=!0,W===\"define\"?`\n#ifndef HAS_UNIFORM_u_${at}\nvarying ${$} ${X} ${at};\n#else\nuniform ${$} ${X} u_${at};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${at}\n ${$} ${X} ${at} = u_${at};\n#endif\n`)),vertexSource:l=l.replace(f,(U,W,$,X,at)=>{let gt=X===\"float\"?\"vec2\":\"vec4\",_t=at.match(/color/)?\"color\":gt;return F[at]?W===\"define\"?`\n#ifndef HAS_UNIFORM_u_${at}\nuniform lowp float u_${at}_t;\nattribute ${$} ${gt} a_${at};\nvarying ${$} ${X} ${at};\n#else\nuniform ${$} ${X} u_${at};\n#endif\n`:_t===\"vec4\"?`\n#ifndef HAS_UNIFORM_u_${at}\n ${at} = a_${at};\n#else\n ${$} ${X} ${at} = u_${at};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${at}\n ${at} = unpack_mix_${_t}(a_${at}, u_${at}_t);\n#else\n ${$} ${X} ${at} = u_${at};\n#endif\n`:W===\"define\"?`\n#ifndef HAS_UNIFORM_u_${at}\nuniform lowp float u_${at}_t;\nattribute ${$} ${gt} a_${at};\n#else\nuniform ${$} ${X} u_${at};\n#endif\n`:_t===\"vec4\"?`\n#ifndef HAS_UNIFORM_u_${at}\n ${$} ${X} ${at} = a_${at};\n#else\n ${$} ${X} ${at} = u_${at};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${at}\n ${$} ${X} ${at} = unpack_mix_${_t}(a_${at}, u_${at}_t);\n#else\n ${$} ${X} ${at} = u_${at};\n#endif\n`}),staticAttributes:v,staticUniforms:O}}class df{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(l,f,v,b,M,O,F,U,W){this.context=l;let $=this.boundPaintVertexBuffers.length!==b.length;for(let X=0;!$&&X<b.length;X++)this.boundPaintVertexBuffers[X]!==b[X]&&($=!0);!this.vao||this.boundProgram!==f||this.boundLayoutVertexBuffer!==v||$||this.boundIndexBuffer!==M||this.boundVertexOffset!==O||this.boundDynamicVertexBuffer!==F||this.boundDynamicVertexBuffer2!==U||this.boundDynamicVertexBuffer3!==W?this.freshBind(f,v,b,M,O,F,U,W):(l.bindVertexArray.set(this.vao),F&&F.bind(),M&&M.dynamicDraw&&M.bind(),U&&U.bind(),W&&W.bind())}freshBind(l,f,v,b,M,O,F,U){let W=l.numAttributes,$=this.context,X=$.gl;this.vao&&this.destroy(),this.vao=$.createVertexArray(),$.bindVertexArray.set(this.vao),this.boundProgram=l,this.boundLayoutVertexBuffer=f,this.boundPaintVertexBuffers=v,this.boundIndexBuffer=b,this.boundVertexOffset=M,this.boundDynamicVertexBuffer=O,this.boundDynamicVertexBuffer2=F,this.boundDynamicVertexBuffer3=U,f.enableAttributes(X,l);for(let at of v)at.enableAttributes(X,l);O&&O.enableAttributes(X,l),F&&F.enableAttributes(X,l),U&&U.enableAttributes(X,l),f.bind(),f.setVertexAttribPointers(X,l,M);for(let at of v)at.bind(),at.setVertexAttribPointers(X,l,M);O&&(O.bind(),O.setVertexAttribPointers(X,l,M)),b&&b.bind(),F&&(F.bind(),F.setVertexAttribPointers(X,l,M)),U&&(U.bind(),U.setVertexAttribPointers(X,l,M)),$.currentNumAttributes=W}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}function Pc(T){let l=[];for(let f=0;f<T.length;f++){if(T[f]===null)continue;let v=T[f].split(\" \");l.push(v.pop())}return l}class Bl{constructor(l,f,v,b,M,O){let F=l.gl;this.program=F.createProgram();let U=Pc(f.staticAttributes),W=v?v.getBinderAttributes():[],$=U.concat(W),X=ca.prelude.staticUniforms?Pc(ca.prelude.staticUniforms):[],at=f.staticUniforms?Pc(f.staticUniforms):[],gt=v?v.getBinderUniforms():[],_t=X.concat(at).concat(gt),yt=[];for(let Ht of _t)yt.indexOf(Ht)<0&&yt.push(Ht);let At=v?v.defines():[];M&&At.push(\"#define OVERDRAW_INSPECTOR;\"),O&&At.push(\"#define TERRAIN3D;\");let kt=At.concat(ca.prelude.fragmentSource,f.fragmentSource).join(`\n`),Wt=At.concat(ca.prelude.vertexSource,f.vertexSource).join(`\n`),St=F.createShader(F.FRAGMENT_SHADER);if(F.isContextLost())return void(this.failedToCreate=!0);if(F.shaderSource(St,kt),F.compileShader(St),!F.getShaderParameter(St,F.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${F.getShaderInfoLog(St)}`);F.attachShader(this.program,St);let Nt=F.createShader(F.VERTEX_SHADER);if(F.isContextLost())return void(this.failedToCreate=!0);if(F.shaderSource(Nt,Wt),F.compileShader(Nt),!F.getShaderParameter(Nt,F.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${F.getShaderInfoLog(Nt)}`);F.attachShader(this.program,Nt),this.attributes={};let Zt={};this.numAttributes=$.length;for(let Ht=0;Ht<this.numAttributes;Ht++)$[Ht]&&(F.bindAttribLocation(this.program,Ht,$[Ht]),this.attributes[$[Ht]]=Ht);if(F.linkProgram(this.program),!F.getProgramParameter(this.program,F.LINK_STATUS))throw new Error(`Program failed to link: ${F.getProgramInfoLog(this.program)}`);F.deleteShader(Nt),F.deleteShader(St);for(let Ht=0;Ht<yt.length;Ht++){let ne=yt[Ht];if(ne&&!Zt[ne]){let he=F.getUniformLocation(this.program,ne);he&&(Zt[ne]=he)}}this.fixedUniforms=b(l,Zt),this.terrainUniforms=((Ht,ne)=>({u_depth:new s.aG(Ht,ne.u_depth),u_terrain:new s.aG(Ht,ne.u_terrain),u_terrain_dim:new s.aH(Ht,ne.u_terrain_dim),u_terrain_matrix:new s.aI(Ht,ne.u_terrain_matrix),u_terrain_unpack:new s.aJ(Ht,ne.u_terrain_unpack),u_terrain_exaggeration:new s.aH(Ht,ne.u_terrain_exaggeration)}))(l,Zt),this.binderUniforms=v?v.getUniforms(l,Zt):[]}draw(l,f,v,b,M,O,F,U,W,$,X,at,gt,_t,yt,At,kt,Wt){let St=l.gl;if(this.failedToCreate)return;if(l.program.set(this.program),l.setDepthMode(v),l.setStencilMode(b),l.setColorMode(M),l.setCullFace(O),U){l.activeTexture.set(St.TEXTURE2),St.bindTexture(St.TEXTURE_2D,U.depthTexture),l.activeTexture.set(St.TEXTURE3),St.bindTexture(St.TEXTURE_2D,U.texture);for(let Zt in this.terrainUniforms)this.terrainUniforms[Zt].set(U[Zt])}for(let Zt in this.fixedUniforms)this.fixedUniforms[Zt].set(F[Zt]);yt&&yt.setUniforms(l,this.binderUniforms,gt,{zoom:_t});let Nt=0;switch(f){case St.LINES:Nt=2;break;case St.TRIANGLES:Nt=3;break;case St.LINE_STRIP:Nt=1}for(let Zt of at.get()){let Ht=Zt.vaos||(Zt.vaos={});(Ht[W]||(Ht[W]=new df)).bind(l,this,$,yt?yt.getPaintVertexBuffers():[],X,Zt.vertexOffset,At,kt,Wt),St.drawElements(f,Zt.primitiveLength*Nt,St.UNSIGNED_SHORT,Zt.primitiveOffset*Nt*2)}}}function Sd(T,l,f){let v=1/_r(f,1,l.transform.tileZoom),b=Math.pow(2,f.tileID.overscaledZ),M=f.tileSize*Math.pow(2,l.transform.tileZoom)/b,O=M*(f.tileID.canonical.x+f.tileID.wrap*b),F=M*f.tileID.canonical.y;return{u_image:0,u_texsize:f.imageAtlasTexture.size,u_scale:[v,T.fromScale,T.toScale],u_fade:T.t,u_pixel_coord_upper:[O>>16,F>>16],u_pixel_coord_lower:[65535&O,65535&F]}}let pf=(T,l,f,v)=>{let b=l.style.light,M=b.properties.get(\"position\"),O=[M.x,M.y,M.z],F=function(){var W=new s.A(9);return s.A!=Float32Array&&(W[1]=0,W[2]=0,W[3]=0,W[5]=0,W[6]=0,W[7]=0),W[0]=1,W[4]=1,W[8]=1,W}();b.properties.get(\"anchor\")===\"viewport\"&&function(W,$){var X=Math.sin($),at=Math.cos($);W[0]=at,W[1]=X,W[2]=0,W[3]=-X,W[4]=at,W[5]=0,W[6]=0,W[7]=0,W[8]=1}(F,-l.transform.angle),function(W,$,X){var at=$[0],gt=$[1],_t=$[2];W[0]=at*X[0]+gt*X[3]+_t*X[6],W[1]=at*X[1]+gt*X[4]+_t*X[7],W[2]=at*X[2]+gt*X[5]+_t*X[8]}(O,O,F);let U=b.properties.get(\"color\");return{u_matrix:T,u_lightpos:O,u_lightintensity:b.properties.get(\"intensity\"),u_lightcolor:[U.r,U.g,U.b],u_vertical_gradient:+f,u_opacity:v}},ut=(T,l,f,v,b,M,O)=>s.e(pf(T,l,f,v),Sd(M,l,O),{u_height_factor:-Math.pow(2,b.overscaledZ)/O.tileSize/8}),dt=T=>({u_matrix:T}),Ct=(T,l,f,v)=>s.e(dt(T),Sd(f,l,v)),$t=(T,l)=>({u_matrix:T,u_world:l}),me=(T,l,f,v,b)=>s.e(Ct(T,l,f,v),{u_world:b}),Ze=(T,l,f,v)=>{let b=T.transform,M,O;if(v.paint.get(\"circle-pitch-alignment\")===\"map\"){let F=_r(f,1,b.zoom);M=!0,O=[F,F]}else M=!1,O=b.pixelsToGLUnits;return{u_camera_to_center_distance:b.cameraToCenterDistance,u_scale_with_map:+(v.paint.get(\"circle-pitch-scale\")===\"map\"),u_matrix:T.translatePosMatrix(l.posMatrix,f,v.paint.get(\"circle-translate\"),v.paint.get(\"circle-translate-anchor\")),u_pitch_with_map:+M,u_device_pixel_ratio:T.pixelRatio,u_extrude_scale:O}},ni=(T,l,f)=>{let v=_r(f,1,l.zoom),b=Math.pow(2,l.zoom-f.tileID.overscaledZ),M=f.tileID.overscaleFactor();return{u_matrix:T,u_camera_to_center_distance:l.cameraToCenterDistance,u_pixels_to_tile_units:v,u_extrude_scale:[l.pixelsToGLUnits[0]/(v*b),l.pixelsToGLUnits[1]/(v*b)],u_overscale_factor:M}},rs=(T,l,f=1)=>({u_matrix:T,u_color:l,u_overlay:0,u_overlay_scale:f}),Hn=T=>({u_matrix:T}),zs=(T,l,f,v)=>({u_matrix:T,u_extrude_scale:_r(l,1,f),u_intensity:v});function Da(T,l){let f=Math.pow(2,l.canonical.z),v=l.canonical.y;return[new s.Y(0,v/f).toLngLat().lat,new s.Y(0,(v+1)/f).toLngLat().lat]}let zm=(T,l,f,v)=>{let b=T.transform;return{u_matrix:Np(T,l,f,v),u_ratio:1/_r(l,1,b.zoom),u_device_pixel_ratio:T.pixelRatio,u_units_to_pixels:[1/b.pixelsToGLUnits[0],1/b.pixelsToGLUnits[1]]}},bx=(T,l,f,v,b)=>s.e(zm(T,l,f,b),{u_image:0,u_image_height:v}),Af=(T,l,f,v,b)=>{let M=T.transform,O=Oa(l,M);return{u_matrix:Np(T,l,f,b),u_texsize:l.imageAtlasTexture.size,u_ratio:1/_r(l,1,M.zoom),u_device_pixel_ratio:T.pixelRatio,u_image:0,u_scale:[O,v.fromScale,v.toScale],u_fade:v.t,u_units_to_pixels:[1/M.pixelsToGLUnits[0],1/M.pixelsToGLUnits[1]]}},Nm=(T,l,f,v,b,M)=>{let O=T.lineAtlas,F=Oa(l,T.transform),U=f.layout.get(\"line-cap\")===\"round\",W=O.getDash(v.from,U),$=O.getDash(v.to,U),X=W.width*b.fromScale,at=$.width*b.toScale;return s.e(zm(T,l,f,M),{u_patternscale_a:[F/X,-W.height/2],u_patternscale_b:[F/at,-$.height/2],u_sdfgamma:O.width/(256*Math.min(X,at)*T.pixelRatio)/2,u_image:0,u_tex_y_a:W.y,u_tex_y_b:$.y,u_mix:b.t})};function Oa(T,l){return 1/_r(T,1,l.tileZoom)}function Np(T,l,f,v){return T.translatePosMatrix(v?v.posMatrix:l.tileID.posMatrix,l,f.paint.get(\"line-translate\"),f.paint.get(\"line-translate-anchor\"))}let Um=(T,l,f,v,b)=>{return{u_matrix:T,u_tl_parent:l,u_scale_parent:f,u_buffer_scale:1,u_fade_t:v.mix,u_opacity:v.opacity*b.paint.get(\"raster-opacity\"),u_image0:0,u_image1:1,u_brightness_low:b.paint.get(\"raster-brightness-min\"),u_brightness_high:b.paint.get(\"raster-brightness-max\"),u_saturation_factor:(O=b.paint.get(\"raster-saturation\"),O>0?1-1/(1.001-O):-O),u_contrast_factor:(M=b.paint.get(\"raster-contrast\"),M>0?1/(1-M):1+M),u_spin_weights:Up(b.paint.get(\"raster-hue-rotate\"))};var M,O};function Up(T){T*=Math.PI/180;let l=Math.sin(T),f=Math.cos(T);return[(2*f+1)/3,(-Math.sqrt(3)*l-f+1)/3,(Math.sqrt(3)*l-f+1)/3]}let Vp=(T,l,f,v,b,M,O,F,U,W)=>{let $=b.transform;return{u_is_size_zoom_constant:+(T===\"constant\"||T===\"source\"),u_is_size_feature_constant:+(T===\"constant\"||T===\"camera\"),u_size_t:l?l.uSizeT:0,u_size:l?l.uSize:0,u_camera_to_center_distance:$.cameraToCenterDistance,u_pitch:$.pitch/360*2*Math.PI,u_rotate_symbol:+f,u_aspect_ratio:$.width/$.height,u_fade_change:b.options.fadeDuration?b.symbolFadeChange:1,u_matrix:M,u_label_plane_matrix:O,u_coord_matrix:F,u_is_text:+U,u_pitch_with_map:+v,u_texsize:W,u_texture:0}},jp=(T,l,f,v,b,M,O,F,U,W,$)=>{let X=b.transform;return s.e(Vp(T,l,f,v,b,M,O,F,U,W),{u_gamma_scale:v?Math.cos(X._pitch)*X.cameraToCenterDistance:1,u_device_pixel_ratio:b.pixelRatio,u_is_halo:+$})},Gp=(T,l,f,v,b,M,O,F,U,W)=>s.e(jp(T,l,f,v,b,M,O,F,!0,U,!0),{u_texsize_icon:W,u_texture_icon:1}),LS=(T,l,f)=>({u_matrix:T,u_opacity:l,u_color:f}),kS=(T,l,f,v,b,M)=>s.e(function(O,F,U,W){let $=U.imageManager.getPattern(O.from.toString()),X=U.imageManager.getPattern(O.to.toString()),{width:at,height:gt}=U.imageManager.getPixelSize(),_t=Math.pow(2,W.tileID.overscaledZ),yt=W.tileSize*Math.pow(2,U.transform.tileZoom)/_t,At=yt*(W.tileID.canonical.x+W.tileID.wrap*_t),kt=yt*W.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:$.tl,u_pattern_br_a:$.br,u_pattern_tl_b:X.tl,u_pattern_br_b:X.br,u_texsize:[at,gt],u_mix:F.t,u_pattern_size_a:$.displaySize,u_pattern_size_b:X.displaySize,u_scale_a:F.fromScale,u_scale_b:F.toScale,u_tile_units_to_pixels:1/_r(W,1,U.transform.tileZoom),u_pixel_coord_upper:[At>>16,kt>>16],u_pixel_coord_lower:[65535&At,65535&kt]}}(v,M,f,b),{u_matrix:T,u_opacity:l}),wx={fillExtrusion:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_lightpos:new s.aK(T,l.u_lightpos),u_lightintensity:new s.aH(T,l.u_lightintensity),u_lightcolor:new s.aK(T,l.u_lightcolor),u_vertical_gradient:new s.aH(T,l.u_vertical_gradient),u_opacity:new s.aH(T,l.u_opacity)}),fillExtrusionPattern:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_lightpos:new s.aK(T,l.u_lightpos),u_lightintensity:new s.aH(T,l.u_lightintensity),u_lightcolor:new s.aK(T,l.u_lightcolor),u_vertical_gradient:new s.aH(T,l.u_vertical_gradient),u_height_factor:new s.aH(T,l.u_height_factor),u_image:new s.aG(T,l.u_image),u_texsize:new s.aL(T,l.u_texsize),u_pixel_coord_upper:new s.aL(T,l.u_pixel_coord_upper),u_pixel_coord_lower:new s.aL(T,l.u_pixel_coord_lower),u_scale:new s.aK(T,l.u_scale),u_fade:new s.aH(T,l.u_fade),u_opacity:new s.aH(T,l.u_opacity)}),fill:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix)}),fillPattern:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_image:new s.aG(T,l.u_image),u_texsize:new s.aL(T,l.u_texsize),u_pixel_coord_upper:new s.aL(T,l.u_pixel_coord_upper),u_pixel_coord_lower:new s.aL(T,l.u_pixel_coord_lower),u_scale:new s.aK(T,l.u_scale),u_fade:new s.aH(T,l.u_fade)}),fillOutline:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_world:new s.aL(T,l.u_world)}),fillOutlinePattern:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_world:new s.aL(T,l.u_world),u_image:new s.aG(T,l.u_image),u_texsize:new s.aL(T,l.u_texsize),u_pixel_coord_upper:new s.aL(T,l.u_pixel_coord_upper),u_pixel_coord_lower:new s.aL(T,l.u_pixel_coord_lower),u_scale:new s.aK(T,l.u_scale),u_fade:new s.aH(T,l.u_fade)}),circle:(T,l)=>({u_camera_to_center_distance:new s.aH(T,l.u_camera_to_center_distance),u_scale_with_map:new s.aG(T,l.u_scale_with_map),u_pitch_with_map:new s.aG(T,l.u_pitch_with_map),u_extrude_scale:new s.aL(T,l.u_extrude_scale),u_device_pixel_ratio:new s.aH(T,l.u_device_pixel_ratio),u_matrix:new s.aI(T,l.u_matrix)}),collisionBox:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_camera_to_center_distance:new s.aH(T,l.u_camera_to_center_distance),u_pixels_to_tile_units:new s.aH(T,l.u_pixels_to_tile_units),u_extrude_scale:new s.aL(T,l.u_extrude_scale),u_overscale_factor:new s.aH(T,l.u_overscale_factor)}),collisionCircle:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_inv_matrix:new s.aI(T,l.u_inv_matrix),u_camera_to_center_distance:new s.aH(T,l.u_camera_to_center_distance),u_viewport_size:new s.aL(T,l.u_viewport_size)}),debug:(T,l)=>({u_color:new s.aM(T,l.u_color),u_matrix:new s.aI(T,l.u_matrix),u_overlay:new s.aG(T,l.u_overlay),u_overlay_scale:new s.aH(T,l.u_overlay_scale)}),clippingMask:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix)}),heatmap:(T,l)=>({u_extrude_scale:new s.aH(T,l.u_extrude_scale),u_intensity:new s.aH(T,l.u_intensity),u_matrix:new s.aI(T,l.u_matrix)}),heatmapTexture:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_world:new s.aL(T,l.u_world),u_image:new s.aG(T,l.u_image),u_color_ramp:new s.aG(T,l.u_color_ramp),u_opacity:new s.aH(T,l.u_opacity)}),hillshade:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_image:new s.aG(T,l.u_image),u_latrange:new s.aL(T,l.u_latrange),u_light:new s.aL(T,l.u_light),u_shadow:new s.aM(T,l.u_shadow),u_highlight:new s.aM(T,l.u_highlight),u_accent:new s.aM(T,l.u_accent)}),hillshadePrepare:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_image:new s.aG(T,l.u_image),u_dimension:new s.aL(T,l.u_dimension),u_zoom:new s.aH(T,l.u_zoom),u_unpack:new s.aJ(T,l.u_unpack)}),line:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_ratio:new s.aH(T,l.u_ratio),u_device_pixel_ratio:new s.aH(T,l.u_device_pixel_ratio),u_units_to_pixels:new s.aL(T,l.u_units_to_pixels)}),lineGradient:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_ratio:new s.aH(T,l.u_ratio),u_device_pixel_ratio:new s.aH(T,l.u_device_pixel_ratio),u_units_to_pixels:new s.aL(T,l.u_units_to_pixels),u_image:new s.aG(T,l.u_image),u_image_height:new s.aH(T,l.u_image_height)}),linePattern:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_texsize:new s.aL(T,l.u_texsize),u_ratio:new s.aH(T,l.u_ratio),u_device_pixel_ratio:new s.aH(T,l.u_device_pixel_ratio),u_image:new s.aG(T,l.u_image),u_units_to_pixels:new s.aL(T,l.u_units_to_pixels),u_scale:new s.aK(T,l.u_scale),u_fade:new s.aH(T,l.u_fade)}),lineSDF:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_ratio:new s.aH(T,l.u_ratio),u_device_pixel_ratio:new s.aH(T,l.u_device_pixel_ratio),u_units_to_pixels:new s.aL(T,l.u_units_to_pixels),u_patternscale_a:new s.aL(T,l.u_patternscale_a),u_patternscale_b:new s.aL(T,l.u_patternscale_b),u_sdfgamma:new s.aH(T,l.u_sdfgamma),u_image:new s.aG(T,l.u_image),u_tex_y_a:new s.aH(T,l.u_tex_y_a),u_tex_y_b:new s.aH(T,l.u_tex_y_b),u_mix:new s.aH(T,l.u_mix)}),raster:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_tl_parent:new s.aL(T,l.u_tl_parent),u_scale_parent:new s.aH(T,l.u_scale_parent),u_buffer_scale:new s.aH(T,l.u_buffer_scale),u_fade_t:new s.aH(T,l.u_fade_t),u_opacity:new s.aH(T,l.u_opacity),u_image0:new s.aG(T,l.u_image0),u_image1:new s.aG(T,l.u_image1),u_brightness_low:new s.aH(T,l.u_brightness_low),u_brightness_high:new s.aH(T,l.u_brightness_high),u_saturation_factor:new s.aH(T,l.u_saturation_factor),u_contrast_factor:new s.aH(T,l.u_contrast_factor),u_spin_weights:new s.aK(T,l.u_spin_weights)}),symbolIcon:(T,l)=>({u_is_size_zoom_constant:new s.aG(T,l.u_is_size_zoom_constant),u_is_size_feature_constant:new s.aG(T,l.u_is_size_feature_constant),u_size_t:new s.aH(T,l.u_size_t),u_size:new s.aH(T,l.u_size),u_camera_to_center_distance:new s.aH(T,l.u_camera_to_center_distance),u_pitch:new s.aH(T,l.u_pitch),u_rotate_symbol:new s.aG(T,l.u_rotate_symbol),u_aspect_ratio:new s.aH(T,l.u_aspect_ratio),u_fade_change:new s.aH(T,l.u_fade_change),u_matrix:new s.aI(T,l.u_matrix),u_label_plane_matrix:new s.aI(T,l.u_label_plane_matrix),u_coord_matrix:new s.aI(T,l.u_coord_matrix),u_is_text:new s.aG(T,l.u_is_text),u_pitch_with_map:new s.aG(T,l.u_pitch_with_map),u_texsize:new s.aL(T,l.u_texsize),u_texture:new s.aG(T,l.u_texture)}),symbolSDF:(T,l)=>({u_is_size_zoom_constant:new s.aG(T,l.u_is_size_zoom_constant),u_is_size_feature_constant:new s.aG(T,l.u_is_size_feature_constant),u_size_t:new s.aH(T,l.u_size_t),u_size:new s.aH(T,l.u_size),u_camera_to_center_distance:new s.aH(T,l.u_camera_to_center_distance),u_pitch:new s.aH(T,l.u_pitch),u_rotate_symbol:new s.aG(T,l.u_rotate_symbol),u_aspect_ratio:new s.aH(T,l.u_aspect_ratio),u_fade_change:new s.aH(T,l.u_fade_change),u_matrix:new s.aI(T,l.u_matrix),u_label_plane_matrix:new s.aI(T,l.u_label_plane_matrix),u_coord_matrix:new s.aI(T,l.u_coord_matrix),u_is_text:new s.aG(T,l.u_is_text),u_pitch_with_map:new s.aG(T,l.u_pitch_with_map),u_texsize:new s.aL(T,l.u_texsize),u_texture:new s.aG(T,l.u_texture),u_gamma_scale:new s.aH(T,l.u_gamma_scale),u_device_pixel_ratio:new s.aH(T,l.u_device_pixel_ratio),u_is_halo:new s.aG(T,l.u_is_halo)}),symbolTextAndIcon:(T,l)=>({u_is_size_zoom_constant:new s.aG(T,l.u_is_size_zoom_constant),u_is_size_feature_constant:new s.aG(T,l.u_is_size_feature_constant),u_size_t:new s.aH(T,l.u_size_t),u_size:new s.aH(T,l.u_size),u_camera_to_center_distance:new s.aH(T,l.u_camera_to_center_distance),u_pitch:new s.aH(T,l.u_pitch),u_rotate_symbol:new s.aG(T,l.u_rotate_symbol),u_aspect_ratio:new s.aH(T,l.u_aspect_ratio),u_fade_change:new s.aH(T,l.u_fade_change),u_matrix:new s.aI(T,l.u_matrix),u_label_plane_matrix:new s.aI(T,l.u_label_plane_matrix),u_coord_matrix:new s.aI(T,l.u_coord_matrix),u_is_text:new s.aG(T,l.u_is_text),u_pitch_with_map:new s.aG(T,l.u_pitch_with_map),u_texsize:new s.aL(T,l.u_texsize),u_texsize_icon:new s.aL(T,l.u_texsize_icon),u_texture:new s.aG(T,l.u_texture),u_texture_icon:new s.aG(T,l.u_texture_icon),u_gamma_scale:new s.aH(T,l.u_gamma_scale),u_device_pixel_ratio:new s.aH(T,l.u_device_pixel_ratio),u_is_halo:new s.aG(T,l.u_is_halo)}),background:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_opacity:new s.aH(T,l.u_opacity),u_color:new s.aM(T,l.u_color)}),backgroundPattern:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_opacity:new s.aH(T,l.u_opacity),u_image:new s.aG(T,l.u_image),u_pattern_tl_a:new s.aL(T,l.u_pattern_tl_a),u_pattern_br_a:new s.aL(T,l.u_pattern_br_a),u_pattern_tl_b:new s.aL(T,l.u_pattern_tl_b),u_pattern_br_b:new s.aL(T,l.u_pattern_br_b),u_texsize:new s.aL(T,l.u_texsize),u_mix:new s.aH(T,l.u_mix),u_pattern_size_a:new s.aL(T,l.u_pattern_size_a),u_pattern_size_b:new s.aL(T,l.u_pattern_size_b),u_scale_a:new s.aH(T,l.u_scale_a),u_scale_b:new s.aH(T,l.u_scale_b),u_pixel_coord_upper:new s.aL(T,l.u_pixel_coord_upper),u_pixel_coord_lower:new s.aL(T,l.u_pixel_coord_lower),u_tile_units_to_pixels:new s.aH(T,l.u_tile_units_to_pixels)}),terrain:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_texture:new s.aG(T,l.u_texture),u_ele_delta:new s.aH(T,l.u_ele_delta)}),terrainDepth:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_ele_delta:new s.aH(T,l.u_ele_delta)}),terrainCoords:(T,l)=>({u_matrix:new s.aI(T,l.u_matrix),u_texture:new s.aG(T,l.u_texture),u_terrain_coords_id:new s.aH(T,l.u_terrain_coords_id),u_ele_delta:new s.aH(T,l.u_ele_delta)})};class RS{constructor(l,f,v){this.context=l;let b=l.gl;this.buffer=b.createBuffer(),this.dynamicDraw=!!v,this.context.unbindVAO(),l.bindElementBuffer.set(this.buffer),b.bufferData(b.ELEMENT_ARRAY_BUFFER,f.arrayBuffer,this.dynamicDraw?b.DYNAMIC_DRAW:b.STATIC_DRAW),this.dynamicDraw||delete f.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(l){let f=this.context.gl;if(!this.dynamicDraw)throw new Error(\"Attempted to update data while not in dynamic mode.\");this.context.unbindVAO(),this.bind(),f.bufferSubData(f.ELEMENT_ARRAY_BUFFER,0,l.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let mf={Int8:\"BYTE\",Uint8:\"UNSIGNED_BYTE\",Int16:\"SHORT\",Uint16:\"UNSIGNED_SHORT\",Int32:\"INT\",Uint32:\"UNSIGNED_INT\",Float32:\"FLOAT\"};class Vm{constructor(l,f,v,b){this.length=f.length,this.attributes=v,this.itemSize=f.bytesPerElement,this.dynamicDraw=b,this.context=l;let M=l.gl;this.buffer=M.createBuffer(),l.bindVertexBuffer.set(this.buffer),M.bufferData(M.ARRAY_BUFFER,f.arrayBuffer,this.dynamicDraw?M.DYNAMIC_DRAW:M.STATIC_DRAW),this.dynamicDraw||delete f.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(l){if(l.length!==this.length)throw new Error(`Length of new data is ${l.length}, which doesn't match current length of ${this.length}`);let f=this.context.gl;this.bind(),f.bufferSubData(f.ARRAY_BUFFER,0,l.arrayBuffer)}enableAttributes(l,f){for(let v=0;v<this.attributes.length;v++){let b=f.attributes[this.attributes[v].name];b!==void 0&&l.enableVertexAttribArray(b)}}setVertexAttribPointers(l,f,v){for(let b=0;b<this.attributes.length;b++){let M=this.attributes[b],O=f.attributes[M.name];O!==void 0&&l.vertexAttribPointer(O,M.components,l[mf[M.type]],!1,this.itemSize,M.offset+this.itemSize*(v||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Zo=new WeakMap;function bo(T){var l;if(Zo.has(T))return Zo.get(T);{let f=(l=T.getParameter(T.VERSION))===null||l===void 0?void 0:l.startsWith(\"WebGL 2.0\");return Zo.set(T,f),f}}class _i{constructor(l){this.gl=l.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(l){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class jm extends _i{getDefault(){return s.aO.transparent}set(l){let f=this.current;(l.r!==f.r||l.g!==f.g||l.b!==f.b||l.a!==f.a||this.dirty)&&(this.gl.clearColor(l.r,l.g,l.b,l.a),this.current=l,this.dirty=!1)}}class Td extends _i{getDefault(){return 1}set(l){(l!==this.current||this.dirty)&&(this.gl.clearDepth(l),this.current=l,this.dirty=!1)}}class Gm extends _i{getDefault(){return 0}set(l){(l!==this.current||this.dirty)&&(this.gl.clearStencil(l),this.current=l,this.dirty=!1)}}class Wm extends _i{getDefault(){return[!0,!0,!0,!0]}set(l){let f=this.current;(l[0]!==f[0]||l[1]!==f[1]||l[2]!==f[2]||l[3]!==f[3]||this.dirty)&&(this.gl.colorMask(l[0],l[1],l[2],l[3]),this.current=l,this.dirty=!1)}}class gf extends _i{getDefault(){return!0}set(l){(l!==this.current||this.dirty)&&(this.gl.depthMask(l),this.current=l,this.dirty=!1)}}class Wp extends _i{getDefault(){return 255}set(l){(l!==this.current||this.dirty)&&(this.gl.stencilMask(l),this.current=l,this.dirty=!1)}}class Hp extends _i{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(l){let f=this.current;(l.func!==f.func||l.ref!==f.ref||l.mask!==f.mask||this.dirty)&&(this.gl.stencilFunc(l.func,l.ref,l.mask),this.current=l,this.dirty=!1)}}class Md extends _i{getDefault(){let l=this.gl;return[l.KEEP,l.KEEP,l.KEEP]}set(l){let f=this.current;(l[0]!==f[0]||l[1]!==f[1]||l[2]!==f[2]||this.dirty)&&(this.gl.stencilOp(l[0],l[1],l[2]),this.current=l,this.dirty=!1)}}class Ed extends _i{getDefault(){return!1}set(l){if(l===this.current&&!this.dirty)return;let f=this.gl;l?f.enable(f.STENCIL_TEST):f.disable(f.STENCIL_TEST),this.current=l,this.dirty=!1}}class qp extends _i{getDefault(){return[0,1]}set(l){let f=this.current;(l[0]!==f[0]||l[1]!==f[1]||this.dirty)&&(this.gl.depthRange(l[0],l[1]),this.current=l,this.dirty=!1)}}class Ba extends _i{getDefault(){return!1}set(l){if(l===this.current&&!this.dirty)return;let f=this.gl;l?f.enable(f.DEPTH_TEST):f.disable(f.DEPTH_TEST),this.current=l,this.dirty=!1}}class qt extends _i{getDefault(){return this.gl.LESS}set(l){(l!==this.current||this.dirty)&&(this.gl.depthFunc(l),this.current=l,this.dirty=!1)}}class fe extends _i{getDefault(){return!1}set(l){if(l===this.current&&!this.dirty)return;let f=this.gl;l?f.enable(f.BLEND):f.disable(f.BLEND),this.current=l,this.dirty=!1}}class ke extends _i{getDefault(){let l=this.gl;return[l.ONE,l.ZERO]}set(l){let f=this.current;(l[0]!==f[0]||l[1]!==f[1]||this.dirty)&&(this.gl.blendFunc(l[0],l[1]),this.current=l,this.dirty=!1)}}class yr extends _i{getDefault(){return s.aO.transparent}set(l){let f=this.current;(l.r!==f.r||l.g!==f.g||l.b!==f.b||l.a!==f.a||this.dirty)&&(this.gl.blendColor(l.r,l.g,l.b,l.a),this.current=l,this.dirty=!1)}}class g extends _i{getDefault(){return this.gl.FUNC_ADD}set(l){(l!==this.current||this.dirty)&&(this.gl.blendEquation(l),this.current=l,this.dirty=!1)}}class zi extends _i{getDefault(){return!1}set(l){if(l===this.current&&!this.dirty)return;let f=this.gl;l?f.enable(f.CULL_FACE):f.disable(f.CULL_FACE),this.current=l,this.dirty=!1}}class yi extends _i{getDefault(){return this.gl.BACK}set(l){(l!==this.current||this.dirty)&&(this.gl.cullFace(l),this.current=l,this.dirty=!1)}}class bt extends _i{getDefault(){return this.gl.CCW}set(l){(l!==this.current||this.dirty)&&(this.gl.frontFace(l),this.current=l,this.dirty=!1)}}class Ms extends _i{getDefault(){return null}set(l){(l!==this.current||this.dirty)&&(this.gl.useProgram(l),this.current=l,this.dirty=!1)}}class oo extends _i{getDefault(){return this.gl.TEXTURE0}set(l){(l!==this.current||this.dirty)&&(this.gl.activeTexture(l),this.current=l,this.dirty=!1)}}class Zr extends _i{getDefault(){let l=this.gl;return[0,0,l.drawingBufferWidth,l.drawingBufferHeight]}set(l){let f=this.current;(l[0]!==f[0]||l[1]!==f[1]||l[2]!==f[2]||l[3]!==f[3]||this.dirty)&&(this.gl.viewport(l[0],l[1],l[2],l[3]),this.current=l,this.dirty=!1)}}class fn extends _i{getDefault(){return null}set(l){if(l===this.current&&!this.dirty)return;let f=this.gl;f.bindFramebuffer(f.FRAMEBUFFER,l),this.current=l,this.dirty=!1}}class Fl extends _i{getDefault(){return null}set(l){if(l===this.current&&!this.dirty)return;let f=this.gl;f.bindRenderbuffer(f.RENDERBUFFER,l),this.current=l,this.dirty=!1}}class Kr extends _i{getDefault(){return null}set(l){if(l===this.current&&!this.dirty)return;let f=this.gl;f.bindTexture(f.TEXTURE_2D,l),this.current=l,this.dirty=!1}}class Yr extends _i{getDefault(){return null}set(l){if(l===this.current&&!this.dirty)return;let f=this.gl;f.bindBuffer(f.ARRAY_BUFFER,l),this.current=l,this.dirty=!1}}class Ic extends _i{getDefault(){return null}set(l){let f=this.gl;f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,l),this.current=l,this.dirty=!1}}class _f extends _i{getDefault(){return null}set(l){var f;if(l===this.current&&!this.dirty)return;let v=this.gl;bo(v)?v.bindVertexArray(l):(f=v.getExtension(\"OES_vertex_array_object\"))===null||f===void 0||f.bindVertexArrayOES(l),this.current=l,this.dirty=!1}}class yf extends _i{getDefault(){return 4}set(l){if(l===this.current&&!this.dirty)return;let f=this.gl;f.pixelStorei(f.UNPACK_ALIGNMENT,l),this.current=l,this.dirty=!1}}class Zp extends _i{getDefault(){return!1}set(l){if(l===this.current&&!this.dirty)return;let f=this.gl;f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),this.current=l,this.dirty=!1}}class Yo extends _i{getDefault(){return!1}set(l){if(l===this.current&&!this.dirty)return;let f=this.gl;f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,l),this.current=l,this.dirty=!1}}class si extends _i{constructor(l,f){super(l),this.context=l,this.parent=f}getDefault(){return null}}class Fa extends si{setDirty(){this.dirty=!0}set(l){if(l===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let f=this.gl;f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,l,0),this.current=l,this.dirty=!1}}class Sx extends si{set(l){if(l===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let f=this.gl;f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,l),this.current=l,this.dirty=!1}}class du extends si{set(l){if(l===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let f=this.gl;f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_STENCIL_ATTACHMENT,f.RENDERBUFFER,l),this.current=l,this.dirty=!1}}class Sr{constructor(l,f,v,b,M){this.context=l,this.width=f,this.height=v;let O=l.gl,F=this.framebuffer=O.createFramebuffer();if(this.colorAttachment=new Fa(l,F),b)this.depthAttachment=M?new du(l,F):new Sx(l,F);else if(M)throw new Error(\"Stencil cannot be set without depth\");if(O.checkFramebufferStatus(O.FRAMEBUFFER)!==O.FRAMEBUFFER_COMPLETE)throw new Error(\"Framebuffer is not complete\")}destroy(){let l=this.context.gl,f=this.colorAttachment.get();if(f&&l.deleteTexture(f),this.depthAttachment){let v=this.depthAttachment.get();v&&l.deleteRenderbuffer(v)}l.deleteFramebuffer(this.framebuffer)}}class Pt{constructor(l,f,v){this.blendFunction=l,this.blendColor=f,this.mask=v}}Pt.Replace=[1,0],Pt.disabled=new Pt(Pt.Replace,s.aO.transparent,[!1,!1,!1,!1]),Pt.unblended=new Pt(Pt.Replace,s.aO.transparent,[!0,!0,!0,!0]),Pt.alphaBlended=new Pt([1,771],s.aO.transparent,[!0,!0,!0,!0]);class Li{constructor(l){var f,v;if(this.gl=l,this.clearColor=new jm(this),this.clearDepth=new Td(this),this.clearStencil=new Gm(this),this.colorMask=new Wm(this),this.depthMask=new gf(this),this.stencilMask=new Wp(this),this.stencilFunc=new Hp(this),this.stencilOp=new Md(this),this.stencilTest=new Ed(this),this.depthRange=new qp(this),this.depthTest=new Ba(this),this.depthFunc=new qt(this),this.blend=new fe(this),this.blendFunc=new ke(this),this.blendColor=new yr(this),this.blendEquation=new g(this),this.cullFace=new zi(this),this.cullFaceSide=new yi(this),this.frontFace=new bt(this),this.program=new Ms(this),this.activeTexture=new oo(this),this.viewport=new Zr(this),this.bindFramebuffer=new fn(this),this.bindRenderbuffer=new Fl(this),this.bindTexture=new Kr(this),this.bindVertexBuffer=new Yr(this),this.bindElementBuffer=new Ic(this),this.bindVertexArray=new _f(this),this.pixelStoreUnpack=new yf(this),this.pixelStoreUnpackPremultiplyAlpha=new Zp(this),this.pixelStoreUnpackFlipY=new Yo(this),this.extTextureFilterAnisotropic=l.getExtension(\"EXT_texture_filter_anisotropic\")||l.getExtension(\"MOZ_EXT_texture_filter_anisotropic\")||l.getExtension(\"WEBKIT_EXT_texture_filter_anisotropic\"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=l.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=l.getParameter(l.MAX_TEXTURE_SIZE),bo(l)){this.HALF_FLOAT=l.HALF_FLOAT;let b=l.getExtension(\"EXT_color_buffer_half_float\");this.RGBA16F=(f=l.RGBA16F)!==null&&f!==void 0?f:b?.RGBA16F_EXT,this.RGB16F=(v=l.RGB16F)!==null&&v!==void 0?v:b?.RGB16F_EXT,l.getExtension(\"EXT_color_buffer_float\")}else{l.getExtension(\"EXT_color_buffer_half_float\"),l.getExtension(\"OES_texture_half_float_linear\");let b=l.getExtension(\"OES_texture_half_float\");this.HALF_FLOAT=b?.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(l,f){return new RS(this,l,f)}createVertexBuffer(l,f,v){return new Vm(this,l,f,v)}createRenderbuffer(l,f,v){let b=this.gl,M=b.createRenderbuffer();return this.bindRenderbuffer.set(M),b.renderbufferStorage(b.RENDERBUFFER,l,f,v),this.bindRenderbuffer.set(null),M}createFramebuffer(l,f,v,b){return new Sr(this,l,f,v,b)}clear({color:l,depth:f,stencil:v}){let b=this.gl,M=0;l&&(M|=b.COLOR_BUFFER_BIT,this.clearColor.set(l),this.colorMask.set([!0,!0,!0,!0])),f!==void 0&&(M|=b.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(f),this.depthMask.set(!0)),v!==void 0&&(M|=b.STENCIL_BUFFER_BIT,this.clearStencil.set(v),this.stencilMask.set(255)),b.clear(M)}setCullFace(l){l.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(l.mode),this.frontFace.set(l.frontFace))}setDepthMode(l){l.func!==this.gl.ALWAYS||l.mask?(this.depthTest.set(!0),this.depthFunc.set(l.func),this.depthMask.set(l.mask),this.depthRange.set(l.range)):this.depthTest.set(!1)}setStencilMode(l){l.test.func!==this.gl.ALWAYS||l.mask?(this.stencilTest.set(!0),this.stencilMask.set(l.mask),this.stencilOp.set([l.fail,l.depthFail,l.pass]),this.stencilFunc.set({func:l.test.func,ref:l.ref,mask:l.test.mask})):this.stencilTest.set(!1)}setColorMode(l){s.aD(l.blendFunction,Pt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(l.blendFunction),this.blendColor.set(l.blendColor)),this.colorMask.set(l.mask)}createVertexArray(){var l;return bo(this.gl)?this.gl.createVertexArray():(l=this.gl.getExtension(\"OES_vertex_array_object\"))===null||l===void 0?void 0:l.createVertexArrayOES()}deleteVertexArray(l){var f;return bo(this.gl)?this.gl.deleteVertexArray(l):(f=this.gl.getExtension(\"OES_vertex_array_object\"))===null||f===void 0?void 0:f.deleteVertexArrayOES(l)}unbindVAO(){this.bindVertexArray.set(null)}}class oi{constructor(l,f,v){this.func=l,this.mask=f,this.range=v}}oi.ReadOnly=!1,oi.ReadWrite=!0,oi.disabled=new oi(519,oi.ReadOnly,[0,1]);let Hm=7680;class en{constructor(l,f,v,b,M,O){this.test=l,this.ref=f,this.mask=v,this.fail=b,this.depthFail=M,this.pass=O}}en.disabled=new en({func:519,mask:0},0,0,Hm,Hm,Hm);class Ni{constructor(l,f,v){this.enable=l,this.mode=f,this.frontFace=v}}let uh;function wt(T,l,f,v,b,M,O){let F=T.context,U=F.gl,W=T.useProgram(\"collisionBox\"),$=[],X=0,at=0;for(let St=0;St<v.length;St++){let Nt=v[St],Zt=l.getTile(Nt),Ht=Zt.getBucket(f);if(!Ht)continue;let ne=Nt.posMatrix;b[0]===0&&b[1]===0||(ne=T.translatePosMatrix(Nt.posMatrix,Zt,b,M));let he=O?Ht.textCollisionBox:Ht.iconCollisionBox,ce=Ht.collisionCircleArray;if(ce.length>0){let ge=s.F(),Ue=ne;s.aP(ge,Ht.placementInvProjMatrix,T.transform.glCoordMatrix),s.aP(ge,ge,Ht.placementViewportMatrix),$.push({circleArray:ce,circleOffset:at,transform:Ue,invTransform:ge,coord:Nt}),X+=ce.length/4,at=X}he&&W.draw(F,U.LINES,oi.disabled,en.disabled,T.colorModeForRenderPass(),Ni.disabled,ni(ne,T.transform,Zt),T.style.map.terrain&&T.style.map.terrain.getTerrainData(Nt),f.id,he.layoutVertexBuffer,he.indexBuffer,he.segments,null,T.transform.zoom,null,null,he.collisionVertexBuffer)}if(!O||!$.length)return;let gt=T.useProgram(\"collisionCircle\"),_t=new s.aQ;_t.resize(4*X),_t._trim();let yt=0;for(let St of $)for(let Nt=0;Nt<St.circleArray.length/4;Nt++){let Zt=4*Nt,Ht=St.circleArray[Zt+0],ne=St.circleArray[Zt+1],he=St.circleArray[Zt+2],ce=St.circleArray[Zt+3];_t.emplace(yt++,Ht,ne,he,ce,0),_t.emplace(yt++,Ht,ne,he,ce,1),_t.emplace(yt++,Ht,ne,he,ce,2),_t.emplace(yt++,Ht,ne,he,ce,3)}(!uh||uh.length<2*X)&&(uh=function(St){let Nt=2*St,Zt=new s.aS;Zt.resize(Nt),Zt._trim();for(let Ht=0;Ht<Nt;Ht++){let ne=6*Ht;Zt.uint16[ne+0]=4*Ht+0,Zt.uint16[ne+1]=4*Ht+1,Zt.uint16[ne+2]=4*Ht+2,Zt.uint16[ne+3]=4*Ht+2,Zt.uint16[ne+4]=4*Ht+3,Zt.uint16[ne+5]=4*Ht+0}return Zt}(X));let At=F.createIndexBuffer(uh,!0),kt=F.createVertexBuffer(_t,s.aR.members,!0);for(let St of $){let Nt={u_matrix:St.transform,u_inv_matrix:St.invTransform,u_camera_to_center_distance:(Wt=T.transform).cameraToCenterDistance,u_viewport_size:[Wt.width,Wt.height]};gt.draw(F,U.TRIANGLES,oi.disabled,en.disabled,T.colorModeForRenderPass(),Ni.disabled,Nt,T.style.map.terrain&&T.style.map.terrain.getTerrainData(St.coord),f.id,kt,At,s.$.simpleSegment(0,2*St.circleOffset,St.circleArray.length,St.circleArray.length/2),null,T.transform.zoom,null,null,null)}var Wt;kt.destroy(),At.destroy()}Ni.disabled=new Ni(!1,1029,2305),Ni.backCCW=new Ni(!0,1029,2305);let qm=s.an(new Float32Array(16));function Qg(T,l,f,v,b,M){let{horizontalAlign:O,verticalAlign:F}=s.at(T);return new s.P((-(O-.5)*l/b+v[0])*M,(-(F-.5)*f/b+v[1])*M)}function Yp(T,l,f,v,b,M,O,F,U,W,$){let X=T.text.placedSymbolArray,at=T.text.dynamicLayoutVertexArray,gt=T.icon.dynamicLayoutVertexArray,_t={};at.clear();for(let yt=0;yt<X.length;yt++){let At=X.get(yt),kt=At.hidden||!At.crossTileID||T.allowVerticalPlacement&&!At.placedOrientation?null:v[At.crossTileID];if(kt){let Wt=new s.P(At.anchorX,At.anchorY),St=jn(Wt,f?O:M,$),Nt=vt(b.cameraToCenterDistance,St.signedDistanceFromCamera),Zt=s.ai(T.textSizeData,U,At)*Nt/s.ao;f&&(Zt*=T.tilePixelRatio/F);let{width:Ht,height:ne,anchor:he,textOffset:ce,textBoxScale:ge}=kt,Ue=Qg(he,Ht,ne,ce,ge,Zt),ur=f?jn(Wt.add(Ue),M,$).point:St.point.add(l?Ue.rotate(-b.angle):Ue),Me=T.allowVerticalPlacement&&At.placedOrientation===s.ah.vertical?Math.PI/2:0;for(let ar=0;ar<At.numGlyphs;ar++)s.aj(at,ur,Me);W&&At.associatedIconIndex>=0&&(_t[At.associatedIconIndex]={shiftedAnchor:ur,angle:Me})}else re(At.numGlyphs,at)}if(W){gt.clear();let yt=T.icon.placedSymbolArray;for(let At=0;At<yt.length;At++){let kt=yt.get(At);if(kt.hidden)re(kt.numGlyphs,gt);else{let Wt=_t[At];if(Wt)for(let St=0;St<kt.numGlyphs;St++)s.aj(gt,Wt.shiftedAnchor,Wt.angle);else re(kt.numGlyphs,gt)}}T.icon.dynamicLayoutVertexBuffer.updateData(gt)}T.text.dynamicLayoutVertexBuffer.updateData(at)}function $p(T,l,f){return f.iconsInText&&l?\"symbolTextAndIcon\":T?\"symbolSDF\":\"symbolIcon\"}function Qp(T,l,f,v,b,M,O,F,U,W,$,X){let at=T.context,gt=at.gl,_t=T.transform,yt=F===\"map\",At=U===\"map\",kt=F!==\"viewport\"&&f.layout.get(\"symbol-placement\")!==\"point\",Wt=yt&&!At&&!kt,St=!f.layout.get(\"symbol-sort-key\").isConstant(),Nt=!1,Zt=T.depthModeForSublayer(0,oi.ReadOnly),Ht=f._unevaluatedLayout.hasValue(\"text-variable-anchor\")||f._unevaluatedLayout.hasValue(\"text-variable-anchor-offset\"),ne=[];for(let he of v){let ce=l.getTile(he),ge=ce.getBucket(f);if(!ge)continue;let Ue=b?ge.text:ge.icon;if(!Ue||!Ue.segments.get().length||!Ue.hasVisibleVertices)continue;let ur=Ue.programConfigurations.get(f.id),Me=b||ge.sdfIcons,ar=b?ge.textSizeData:ge.iconSizeData,He=At||_t.pitch!==0,rn=T.useProgram($p(Me,b,ge),ur),Jr=s.ag(ar,_t.zoom),Fr=T.style.map.terrain&&T.style.map.terrain.getTerrainData(he),$r,On,Dr,So,Is=[0,0],Mn=null;if(b)On=ce.glyphAtlasTexture,Dr=gt.LINEAR,$r=ce.glyphAtlasTexture.size,ge.iconsInText&&(Is=ce.imageAtlasTexture.size,Mn=ce.imageAtlasTexture,So=He||T.options.rotating||T.options.zooming||ar.kind===\"composite\"||ar.kind===\"camera\"?gt.LINEAR:gt.NEAREST);else{let Xe=f.layout.get(\"icon-size\").constantOr(0)!==1||ge.iconsNeedLinear;On=ce.imageAtlasTexture,Dr=Me||T.options.rotating||T.options.zooming||Xe||He?gt.LINEAR:gt.NEAREST,$r=ce.imageAtlasTexture.size}let Vs=_r(ce,1,T.transform.zoom),js=mr(he.posMatrix,At,yt,T.transform,Vs),ha=Mc(he.posMatrix,At,yt,T.transform,Vs),Bc=Ht&&ge.hasTextData(),Lf=f.layout.get(\"icon-text-fit\")!==\"none\"&&Bc&&ge.hasIconData();if(kt){let Xe=T.style.map.terrain?(Cs,En)=>T.style.map.terrain.getElevation(he,Cs,En):null,Bi=f.layout.get(\"text-rotation-alignment\")===\"map\";nt(ge,he.posMatrix,T,b,js,ha,At,W,Bi,Xe)}let kf=T.translatePosMatrix(he.posMatrix,ce,M,O),bu=kt||b&&Ht||Lf?qm:js,us=T.translatePosMatrix(ha,ce,M,O,!0),Zn=Me&&f.paint.get(b?\"text-halo-width\":\"icon-halo-width\").constantOr(1)!==0,nn;nn=Me?ge.iconsInText?Gp(ar.kind,Jr,Wt,At,T,kf,bu,us,$r,Is):jp(ar.kind,Jr,Wt,At,T,kf,bu,us,b,$r,!0):Vp(ar.kind,Jr,Wt,At,T,kf,bu,us,b,$r);let dn={program:rn,buffers:Ue,uniformValues:nn,atlasTexture:On,atlasTextureIcon:Mn,atlasInterpolation:Dr,atlasInterpolationIcon:So,isSDF:Me,hasHalo:Zn};if(St&&ge.canOverlap){Nt=!0;let Xe=Ue.segments.get();for(let Bi of Xe)ne.push({segments:new s.$([Bi]),sortKey:Bi.sortKey,state:dn,terrainData:Fr})}else ne.push({segments:Ue.segments,sortKey:0,state:dn,terrainData:Fr})}Nt&&ne.sort((he,ce)=>he.sortKey-ce.sortKey);for(let he of ne){let ce=he.state;if(at.activeTexture.set(gt.TEXTURE0),ce.atlasTexture.bind(ce.atlasInterpolation,gt.CLAMP_TO_EDGE),ce.atlasTextureIcon&&(at.activeTexture.set(gt.TEXTURE1),ce.atlasTextureIcon&&ce.atlasTextureIcon.bind(ce.atlasInterpolationIcon,gt.CLAMP_TO_EDGE)),ce.isSDF){let ge=ce.uniformValues;ce.hasHalo&&(ge.u_is_halo=1,Xg(ce.buffers,he.segments,f,T,ce.program,Zt,$,X,ge,he.terrainData)),ge.u_is_halo=0}Xg(ce.buffers,he.segments,f,T,ce.program,Zt,$,X,ce.uniformValues,he.terrainData)}}function Xg(T,l,f,v,b,M,O,F,U,W){let $=v.context;b.draw($,$.gl.TRIANGLES,M,O,F,Ni.disabled,U,W,f.id,T.layoutVertexBuffer,T.indexBuffer,l,f.paint,v.transform.zoom,T.programConfigurations.get(f.id),T.dynamicLayoutVertexBuffer,T.opacityVertexBuffer)}function Pd(T,l,f,v,b){if(!f||!v||!v.imageAtlas)return;let M=v.imageAtlas.patternPositions,O=M[f.to.toString()],F=M[f.from.toString()];if(!O&&F&&(O=F),!F&&O&&(F=O),!O||!F){let U=b.getPaintProperty(l);O=M[U],F=M[U]}O&&F&&T.setConstantPatternPositions(O,F)}function Kg(T,l,f,v,b,M,O){let F=T.context.gl,U=\"fill-pattern\",W=f.paint.get(U),$=W&&W.constantOr(1),X=f.getCrossfadeParameters(),at,gt,_t,yt,At;O?(gt=$&&!f.getPaintProperty(\"fill-outline-color\")?\"fillOutlinePattern\":\"fillOutline\",at=F.LINES):(gt=$?\"fillPattern\":\"fill\",at=F.TRIANGLES);let kt=W.constantOr(null);for(let Wt of v){let St=l.getTile(Wt);if($&&!St.patternsLoaded())continue;let Nt=St.getBucket(f);if(!Nt)continue;let Zt=Nt.programConfigurations.get(f.id),Ht=T.useProgram(gt,Zt),ne=T.style.map.terrain&&T.style.map.terrain.getTerrainData(Wt);$&&(T.context.activeTexture.set(F.TEXTURE0),St.imageAtlasTexture.bind(F.LINEAR,F.CLAMP_TO_EDGE),Zt.updatePaintBuffers(X)),Pd(Zt,U,kt,St,f);let he=ne?Wt:null,ce=T.translatePosMatrix(he?he.posMatrix:Wt.posMatrix,St,f.paint.get(\"fill-translate\"),f.paint.get(\"fill-translate-anchor\"));if(O){yt=Nt.indexBuffer2,At=Nt.segments2;let ge=[F.drawingBufferWidth,F.drawingBufferHeight];_t=gt===\"fillOutlinePattern\"&&$?me(ce,T,X,St,ge):$t(ce,ge)}else yt=Nt.indexBuffer,At=Nt.segments,_t=$?Ct(ce,T,X,St):dt(ce);Ht.draw(T.context,at,b,T.stencilModeForClipping(Wt),M,Ni.disabled,_t,ne,f.id,Nt.layoutVertexBuffer,yt,At,f.paint,T.transform.zoom,Zt)}}function vf(T,l,f,v,b,M,O){let F=T.context,U=F.gl,W=\"fill-extrusion-pattern\",$=f.paint.get(W),X=$.constantOr(1),at=f.getCrossfadeParameters(),gt=f.paint.get(\"fill-extrusion-opacity\"),_t=$.constantOr(null);for(let yt of v){let At=l.getTile(yt),kt=At.getBucket(f);if(!kt)continue;let Wt=T.style.map.terrain&&T.style.map.terrain.getTerrainData(yt),St=kt.programConfigurations.get(f.id),Nt=T.useProgram(X?\"fillExtrusionPattern\":\"fillExtrusion\",St);X&&(T.context.activeTexture.set(U.TEXTURE0),At.imageAtlasTexture.bind(U.LINEAR,U.CLAMP_TO_EDGE),St.updatePaintBuffers(at)),Pd(St,W,_t,At,f);let Zt=T.translatePosMatrix(yt.posMatrix,At,f.paint.get(\"fill-extrusion-translate\"),f.paint.get(\"fill-extrusion-translate-anchor\")),Ht=f.paint.get(\"fill-extrusion-vertical-gradient\"),ne=X?ut(Zt,T,Ht,gt,yt,at,At):pf(Zt,T,Ht,gt);Nt.draw(F,F.gl.TRIANGLES,b,M,O,Ni.backCCW,ne,Wt,f.id,kt.layoutVertexBuffer,kt.indexBuffer,kt.segments,f.paint,T.transform.zoom,St,T.style.map.terrain&&kt.centroidVertexBuffer)}}function ua(T,l,f,v,b,M,O){let F=T.context,U=F.gl,W=f.fbo;if(!W)return;let $=T.useProgram(\"hillshade\"),X=T.style.map.terrain&&T.style.map.terrain.getTerrainData(l);F.activeTexture.set(U.TEXTURE0),U.bindTexture(U.TEXTURE_2D,W.colorAttachment.get()),$.draw(F,U.TRIANGLES,b,M,O,Ni.disabled,((at,gt,_t,yt)=>{let At=_t.paint.get(\"hillshade-shadow-color\"),kt=_t.paint.get(\"hillshade-highlight-color\"),Wt=_t.paint.get(\"hillshade-accent-color\"),St=_t.paint.get(\"hillshade-illumination-direction\")*(Math.PI/180);_t.paint.get(\"hillshade-illumination-anchor\")===\"viewport\"&&(St-=at.transform.angle);let Nt=!at.options.moving;return{u_matrix:yt?yt.posMatrix:at.transform.calculatePosMatrix(gt.tileID.toUnwrapped(),Nt),u_image:0,u_latrange:Da(0,gt.tileID),u_light:[_t.paint.get(\"hillshade-exaggeration\"),St],u_shadow:At,u_highlight:kt,u_accent:Wt}})(T,f,v,X?l:null),X,v.id,T.rasterBoundsBuffer,T.quadTriangleIndexBuffer,T.rasterBoundsSegments)}function Rn(T,l,f,v,b,M){let O=T.context,F=O.gl,U=l.dem;if(U&&U.data){let W=U.dim,$=U.stride,X=U.getPixels();if(O.activeTexture.set(F.TEXTURE1),O.pixelStoreUnpackPremultiplyAlpha.set(!1),l.demTexture=l.demTexture||T.getTileTexture($),l.demTexture){let gt=l.demTexture;gt.update(X,{premultiply:!1}),gt.bind(F.NEAREST,F.CLAMP_TO_EDGE)}else l.demTexture=new ae(O,X,F.RGBA,{premultiply:!1}),l.demTexture.bind(F.NEAREST,F.CLAMP_TO_EDGE);O.activeTexture.set(F.TEXTURE0);let at=l.fbo;if(!at){let gt=new ae(O,{width:W,height:W,data:null},F.RGBA);gt.bind(F.LINEAR,F.CLAMP_TO_EDGE),at=l.fbo=O.createFramebuffer(W,W,!0,!1),at.colorAttachment.set(gt.texture)}O.bindFramebuffer.set(at.framebuffer),O.viewport.set([0,0,W,W]),T.useProgram(\"hillshadePrepare\").draw(O,F.TRIANGLES,v,b,M,Ni.disabled,((gt,_t)=>{let yt=_t.stride,At=s.F();return s.aN(At,0,s.W,-s.W,0,0,1),s.H(At,At,[0,-s.W,0]),{u_matrix:At,u_image:1,u_dimension:[yt,yt],u_zoom:gt.overscaledZ,u_unpack:_t.getUnpackVector()}})(l.tileID,U),null,f.id,T.rasterBoundsBuffer,T.quadTriangleIndexBuffer,T.rasterBoundsSegments),l.needsHillshadePrepare=!1}}function Jg(T,l,f,v,b,M){let O=v.paint.get(\"raster-fade-duration\");if(!M&&O>0){let F=_.now(),U=(F-T.timeAdded)/O,W=l?(F-l.timeAdded)/O:-1,$=f.getSource(),X=b.coveringZoomLevel({tileSize:$.tileSize,roundZoom:$.roundZoom}),at=!l||Math.abs(l.tileID.overscaledZ-X)>Math.abs(T.tileID.overscaledZ-X),gt=at&&T.refreshedUponExpiration?1:s.ac(at?U:1-W,0,1);return T.refreshedUponExpiration&&U>=1&&(T.refreshedUponExpiration=!1),l?{opacity:1,mix:1-gt}:{opacity:gt,mix:0}}return{opacity:1,mix:0}}let t_=new s.aO(1,0,0,1),Xp=new s.aO(0,1,0,1),Zm=new s.aO(0,0,1,1),e_=new s.aO(1,0,1,1),r_=new s.aO(0,1,1,1);function Sn(T,l,f,v){Ns(T,0,l+f/2,T.transform.width,f,v)}function Mi(T,l,f,v){Ns(T,l-f/2,0,f,T.transform.height,v)}function Ns(T,l,f,v,b,M){let O=T.context,F=O.gl;F.enable(F.SCISSOR_TEST),F.scissor(l*T.pixelRatio,f*T.pixelRatio,v*T.pixelRatio,b*T.pixelRatio),O.clear({color:M}),F.disable(F.SCISSOR_TEST)}function Kp(T,l,f){let v=T.context,b=v.gl,M=f.posMatrix,O=T.useProgram(\"debug\"),F=oi.disabled,U=en.disabled,W=T.colorModeForRenderPass(),$=\"$debug\",X=T.style.map.terrain&&T.style.map.terrain.getTerrainData(f);v.activeTexture.set(b.TEXTURE0);let at=l.getTileByID(f.key).latestRawTileData,gt=Math.floor((at&&at.byteLength||0)/1024),_t=l.getTile(f).tileSize,yt=512/Math.min(_t,512)*(f.overscaledZ/T.transform.zoom)*.5,At=f.canonical.toString();f.overscaledZ!==f.canonical.z&&(At+=` => ${f.overscaledZ}`),function(kt,Wt){kt.initDebugOverlayCanvas();let St=kt.debugOverlayCanvas,Nt=kt.context.gl,Zt=kt.debugOverlayCanvas.getContext(\"2d\");Zt.clearRect(0,0,St.width,St.height),Zt.shadowColor=\"white\",Zt.shadowBlur=2,Zt.lineWidth=1.5,Zt.strokeStyle=\"white\",Zt.textBaseline=\"top\",Zt.font=\"bold 36px Open Sans, sans-serif\",Zt.fillText(Wt,5,5),Zt.strokeText(Wt,5,5),kt.debugOverlayTexture.update(St),kt.debugOverlayTexture.bind(Nt.LINEAR,Nt.CLAMP_TO_EDGE)}(T,`${At} ${gt}kB`),O.draw(v,b.TRIANGLES,F,U,Pt.alphaBlended,Ni.disabled,rs(M,s.aO.transparent,yt),null,$,T.debugBuffer,T.quadTriangleIndexBuffer,T.debugSegments),O.draw(v,b.LINE_STRIP,F,U,W,Ni.disabled,rs(M,s.aO.red),X,$,T.debugBuffer,T.tileBorderIndexBuffer,T.debugSegments)}function Jp(T,l,f){let v=T.context,b=v.gl,M=T.colorModeForRenderPass(),O=new oi(b.LEQUAL,oi.ReadWrite,T.depthRangeFor3D),F=T.useProgram(\"terrain\"),U=l.getTerrainMesh();v.bindFramebuffer.set(null),v.viewport.set([0,0,T.width,T.height]);for(let W of f){let $=T.renderToTexture.getTexture(W),X=l.getTerrainData(W.tileID);v.activeTexture.set(b.TEXTURE0),b.bindTexture(b.TEXTURE_2D,$.texture);let at={u_matrix:T.transform.calculatePosMatrix(W.tileID.toUnwrapped()),u_texture:0,u_ele_delta:l.getMeshFrameDelta(T.transform.zoom)};F.draw(v,b.TRIANGLES,O,en.disabled,M,Ni.backCCW,at,X,\"terrain\",U.vertexBuffer,U.indexBuffer,U.segments)}}class i_{constructor(l,f){this.context=new Li(l),this.transform=f,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:s.F(),renderTime:0},this.setup(),this.numSublayers=ts.maxUnderzooming+ts.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ra}resize(l,f,v){if(this.width=Math.floor(l*v),this.height=Math.floor(f*v),this.pixelRatio=v,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let b of this.style._order)this.style._layers[b].resize()}setup(){let l=this.context,f=new s.aV;f.emplaceBack(0,0),f.emplaceBack(s.W,0),f.emplaceBack(0,s.W),f.emplaceBack(s.W,s.W),this.tileExtentBuffer=l.createVertexBuffer(f,ch.members),this.tileExtentSegments=s.$.simpleSegment(0,0,4,2);let v=new s.aV;v.emplaceBack(0,0),v.emplaceBack(s.W,0),v.emplaceBack(0,s.W),v.emplaceBack(s.W,s.W),this.debugBuffer=l.createVertexBuffer(v,ch.members),this.debugSegments=s.$.simpleSegment(0,0,4,5);let b=new s.Z;b.emplaceBack(0,0,0,0),b.emplaceBack(s.W,0,s.W,0),b.emplaceBack(0,s.W,0,s.W),b.emplaceBack(s.W,s.W,s.W,s.W),this.rasterBoundsBuffer=l.createVertexBuffer(b,In.members),this.rasterBoundsSegments=s.$.simpleSegment(0,0,4,2);let M=new s.aV;M.emplaceBack(0,0),M.emplaceBack(1,0),M.emplaceBack(0,1),M.emplaceBack(1,1),this.viewportBuffer=l.createVertexBuffer(M,ch.members),this.viewportSegments=s.$.simpleSegment(0,0,4,2);let O=new s.aW;O.emplaceBack(0),O.emplaceBack(1),O.emplaceBack(3),O.emplaceBack(2),O.emplaceBack(0),this.tileBorderIndexBuffer=l.createIndexBuffer(O);let F=new s.aX;F.emplaceBack(0,1,2),F.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=l.createIndexBuffer(F);let U=this.context.gl;this.stencilClearMode=new en({func:U.ALWAYS,mask:0},0,255,U.ZERO,U.ZERO,U.ZERO)}clearStencil(){let l=this.context,f=l.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let v=s.F();s.aN(v,0,this.width,this.height,0,0,1),s.J(v,v,[f.drawingBufferWidth,f.drawingBufferHeight,0]),this.useProgram(\"clippingMask\").draw(l,f.TRIANGLES,oi.disabled,this.stencilClearMode,Pt.disabled,Ni.disabled,Hn(v),null,\"$clipping\",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(l,f){if(this.currentStencilSource===l.source||!l.isTileClipped()||!f||!f.length)return;this.currentStencilSource=l.source;let v=this.context,b=v.gl;this.nextStencilID+f.length>256&&this.clearStencil(),v.setColorMode(Pt.disabled),v.setDepthMode(oi.disabled);let M=this.useProgram(\"clippingMask\");this._tileClippingMaskIDs={};for(let O of f){let F=this._tileClippingMaskIDs[O.key]=this.nextStencilID++,U=this.style.map.terrain&&this.style.map.terrain.getTerrainData(O);M.draw(v,b.TRIANGLES,oi.disabled,new en({func:b.ALWAYS,mask:0},F,255,b.KEEP,b.KEEP,b.REPLACE),Pt.disabled,Ni.disabled,Hn(O.posMatrix),U,\"$clipping\",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let l=this.nextStencilID++,f=this.context.gl;return new en({func:f.NOTEQUAL,mask:255},l,255,f.KEEP,f.KEEP,f.REPLACE)}stencilModeForClipping(l){let f=this.context.gl;return new en({func:f.EQUAL,mask:255},this._tileClippingMaskIDs[l.key],0,f.KEEP,f.KEEP,f.REPLACE)}stencilConfigForOverlap(l){let f=this.context.gl,v=l.sort((O,F)=>F.overscaledZ-O.overscaledZ),b=v[v.length-1].overscaledZ,M=v[0].overscaledZ-b+1;if(M>1){this.currentStencilSource=void 0,this.nextStencilID+M>256&&this.clearStencil();let O={};for(let F=0;F<M;F++)O[F+b]=new en({func:f.GEQUAL,mask:255},F+this.nextStencilID,255,f.KEEP,f.KEEP,f.REPLACE);return this.nextStencilID+=M,[O,v]}return[{[b]:en.disabled},v]}colorModeForRenderPass(){let l=this.context.gl;return this._showOverdrawInspector?new Pt([l.CONSTANT_COLOR,l.ONE],new s.aO(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass===\"opaque\"?Pt.unblended:Pt.alphaBlended}depthModeForSublayer(l,f,v){if(!this.opaquePassEnabledForLayer())return oi.disabled;let b=1-((1+this.currentLayer)*this.numSublayers+l)*this.depthEpsilon;return new oi(v||this.context.gl.LEQUAL,f,[b,b])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(l,f){this.style=l,this.options=f,this.lineAtlas=l.lineAtlas,this.imageManager=l.imageManager,this.glyphManager=l.glyphManager,this.symbolFadeChange=l.placement.symbolFadeChange(_.now()),this.imageManager.beginFrame();let v=this.style._order,b=this.style.sourceCaches,M={},O={},F={};for(let U in b){let W=b[U];W.used&&W.prepare(this.context),M[U]=W.getVisibleCoordinates(),O[U]=M[U].slice().reverse(),F[U]=W.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let U=0;U<v.length;U++)if(this.style._layers[v[U]].is3D()){this.opaquePassCutoff=U;break}if(this.renderToTexture){this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0;let U=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime);(this.terrainFacilitator.dirty||!s.aY(this.terrainFacilitator.matrix,this.transform.projMatrix)||U.length)&&(s.aZ(this.terrainFacilitator.matrix,this.transform.projMatrix),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(W,$){let X=W.context,at=X.gl,gt=Pt.unblended,_t=new oi(at.LEQUAL,oi.ReadWrite,[0,1]),yt=$.getTerrainMesh(),At=$.sourceCache.getRenderableTiles(),kt=W.useProgram(\"terrainDepth\");X.bindFramebuffer.set($.getFramebuffer(\"depth\").framebuffer),X.viewport.set([0,0,W.width/devicePixelRatio,W.height/devicePixelRatio]),X.clear({color:s.aO.transparent,depth:1});for(let Wt of At){let St=$.getTerrainData(Wt.tileID),Nt={u_matrix:W.transform.calculatePosMatrix(Wt.tileID.toUnwrapped()),u_ele_delta:$.getMeshFrameDelta(W.transform.zoom)};kt.draw(X,at.TRIANGLES,_t,en.disabled,gt,Ni.backCCW,Nt,St,\"terrain\",yt.vertexBuffer,yt.indexBuffer,yt.segments)}X.bindFramebuffer.set(null),X.viewport.set([0,0,W.width,W.height])}(this,this.style.map.terrain),function(W,$){let X=W.context,at=X.gl,gt=Pt.unblended,_t=new oi(at.LEQUAL,oi.ReadWrite,[0,1]),yt=$.getTerrainMesh(),At=$.getCoordsTexture(),kt=$.sourceCache.getRenderableTiles(),Wt=W.useProgram(\"terrainCoords\");X.bindFramebuffer.set($.getFramebuffer(\"coords\").framebuffer),X.viewport.set([0,0,W.width/devicePixelRatio,W.height/devicePixelRatio]),X.clear({color:s.aO.transparent,depth:1}),$.coordsIndex=[];for(let St of kt){let Nt=$.getTerrainData(St.tileID);X.activeTexture.set(at.TEXTURE0),at.bindTexture(at.TEXTURE_2D,At.texture);let Zt={u_matrix:W.transform.calculatePosMatrix(St.tileID.toUnwrapped()),u_terrain_coords_id:(255-$.coordsIndex.length)/255,u_texture:0,u_ele_delta:$.getMeshFrameDelta(W.transform.zoom)};Wt.draw(X,at.TRIANGLES,_t,en.disabled,gt,Ni.backCCW,Zt,Nt,\"terrain\",yt.vertexBuffer,yt.indexBuffer,yt.segments),$.coordsIndex.push(St.tileID.key)}X.bindFramebuffer.set(null),X.viewport.set([0,0,W.width,W.height])}(this,this.style.map.terrain))}this.renderPass=\"offscreen\";for(let U of v){let W=this.style._layers[U];if(!W.hasOffscreenPass()||W.isHidden(this.transform.zoom))continue;let $=O[W.source];(W.type===\"custom\"||$.length)&&this.renderLayer(this,b[W.source],W,$)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:f.showOverdrawInspector?s.aO.black:s.aO.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=f.showOverdrawInspector,this.depthRangeFor3D=[0,1-(l._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass=\"opaque\",this.currentLayer=v.length-1;this.currentLayer>=0;this.currentLayer--){let U=this.style._layers[v[this.currentLayer]],W=b[U.source],$=M[U.source];this._renderTileClippingMasks(U,$),this.renderLayer(this,W,U,$)}for(this.renderPass=\"translucent\",this.currentLayer=0;this.currentLayer<v.length;this.currentLayer++){let U=this.style._layers[v[this.currentLayer]],W=b[U.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(U))continue;let $=(U.type===\"symbol\"?F:O)[U.source];this._renderTileClippingMasks(U,M[U.source]),this.renderLayer(this,W,U,$)}if(this.options.showTileBoundaries){let U=function(W,$){let X=null,at=Object.values(W._layers).flatMap(At=>At.source&&!At.isHidden($)?[W.sourceCaches[At.source]]:[]),gt=at.filter(At=>At.getSource().type===\"vector\"),_t=at.filter(At=>At.getSource().type!==\"vector\"),yt=At=>{(!X||X.getSource().maxzoom<At.getSource().maxzoom)&&(X=At)};return gt.forEach(At=>yt(At)),X||_t.forEach(At=>yt(At)),X}(this.style,this.transform.zoom);U&&function(W,$,X){for(let at=0;at<X.length;at++)Kp(W,$,X[at])}(this,U,U.getVisibleCoordinates())}this.options.showPadding&&function(U){let W=U.transform.padding;Sn(U,U.transform.height-(W.top||0),3,t_),Sn(U,W.bottom||0,3,Xp),Mi(U,W.left||0,3,Zm),Mi(U,U.transform.width-(W.right||0),3,e_);let $=U.transform.centerPoint;(function(X,at,gt,_t){Ns(X,at-1,gt-10,2,20,_t),Ns(X,at-10,gt-1,20,2,_t)})(U,$.x,U.transform.height-$.y,r_)}(this),this.context.setDefault()}renderLayer(l,f,v,b){if(!v.isHidden(this.transform.zoom)&&(v.type===\"background\"||v.type===\"custom\"||(b||[]).length))switch(this.id=v.id,v.type){case\"symbol\":(function(M,O,F,U,W){if(M.renderPass!==\"translucent\")return;let $=en.disabled,X=M.colorModeForRenderPass();(F._unevaluatedLayout.hasValue(\"text-variable-anchor\")||F._unevaluatedLayout.hasValue(\"text-variable-anchor-offset\"))&&function(at,gt,_t,yt,At,kt,Wt){let St=gt.transform,Nt=At===\"map\",Zt=kt===\"map\";for(let Ht of at){let ne=yt.getTile(Ht),he=ne.getBucket(_t);if(!he||!he.text||!he.text.segments.get().length)continue;let ce=s.ag(he.textSizeData,St.zoom),ge=_r(ne,1,gt.transform.zoom),Ue=mr(Ht.posMatrix,Zt,Nt,gt.transform,ge),ur=_t.layout.get(\"icon-text-fit\")!==\"none\"&&he.hasIconData();if(ce){let Me=Math.pow(2,St.zoom-ne.tileID.overscaledZ);Yp(he,Nt,Zt,Wt,St,Ue,Ht.posMatrix,Me,ce,ur,gt.style.map.terrain?(ar,He)=>gt.style.map.terrain.getElevation(Ht,ar,He):null)}}}(U,M,F,O,F.layout.get(\"text-rotation-alignment\"),F.layout.get(\"text-pitch-alignment\"),W),F.paint.get(\"icon-opacity\").constantOr(1)!==0&&Qp(M,O,F,U,!1,F.paint.get(\"icon-translate\"),F.paint.get(\"icon-translate-anchor\"),F.layout.get(\"icon-rotation-alignment\"),F.layout.get(\"icon-pitch-alignment\"),F.layout.get(\"icon-keep-upright\"),$,X),F.paint.get(\"text-opacity\").constantOr(1)!==0&&Qp(M,O,F,U,!0,F.paint.get(\"text-translate\"),F.paint.get(\"text-translate-anchor\"),F.layout.get(\"text-rotation-alignment\"),F.layout.get(\"text-pitch-alignment\"),F.layout.get(\"text-keep-upright\"),$,X),O.map.showCollisionBoxes&&(wt(M,O,F,U,F.paint.get(\"text-translate\"),F.paint.get(\"text-translate-anchor\"),!0),wt(M,O,F,U,F.paint.get(\"icon-translate\"),F.paint.get(\"icon-translate-anchor\"),!1))})(l,f,v,b,this.style.placement.variableOffsets);break;case\"circle\":(function(M,O,F,U){if(M.renderPass!==\"translucent\")return;let W=F.paint.get(\"circle-opacity\"),$=F.paint.get(\"circle-stroke-width\"),X=F.paint.get(\"circle-stroke-opacity\"),at=!F.layout.get(\"circle-sort-key\").isConstant();if(W.constantOr(1)===0&&($.constantOr(1)===0||X.constantOr(1)===0))return;let gt=M.context,_t=gt.gl,yt=M.depthModeForSublayer(0,oi.ReadOnly),At=en.disabled,kt=M.colorModeForRenderPass(),Wt=[];for(let St=0;St<U.length;St++){let Nt=U[St],Zt=O.getTile(Nt),Ht=Zt.getBucket(F);if(!Ht)continue;let ne=Ht.programConfigurations.get(F.id),he=M.useProgram(\"circle\",ne),ce=Ht.layoutVertexBuffer,ge=Ht.indexBuffer,Ue=M.style.map.terrain&&M.style.map.terrain.getTerrainData(Nt),ur={programConfiguration:ne,program:he,layoutVertexBuffer:ce,indexBuffer:ge,uniformValues:Ze(M,Nt,Zt,F),terrainData:Ue};if(at){let Me=Ht.segments.get();for(let ar of Me)Wt.push({segments:new s.$([ar]),sortKey:ar.sortKey,state:ur})}else Wt.push({segments:Ht.segments,sortKey:0,state:ur})}at&&Wt.sort((St,Nt)=>St.sortKey-Nt.sortKey);for(let St of Wt){let{programConfiguration:Nt,program:Zt,layoutVertexBuffer:Ht,indexBuffer:ne,uniformValues:he,terrainData:ce}=St.state;Zt.draw(gt,_t.TRIANGLES,yt,At,kt,Ni.disabled,he,ce,F.id,Ht,ne,St.segments,F.paint,M.transform.zoom,Nt)}})(l,f,v,b);break;case\"heatmap\":(function(M,O,F,U){if(F.paint.get(\"heatmap-opacity\")!==0)if(M.renderPass===\"offscreen\"){let W=M.context,$=W.gl,X=en.disabled,at=new Pt([$.ONE,$.ONE],s.aO.transparent,[!0,!0,!0,!0]);(function(gt,_t,yt){let At=gt.gl;gt.activeTexture.set(At.TEXTURE1),gt.viewport.set([0,0,_t.width/4,_t.height/4]);let kt=yt.heatmapFbo;if(kt)At.bindTexture(At.TEXTURE_2D,kt.colorAttachment.get()),gt.bindFramebuffer.set(kt.framebuffer);else{let Wt=At.createTexture();At.bindTexture(At.TEXTURE_2D,Wt),At.texParameteri(At.TEXTURE_2D,At.TEXTURE_WRAP_S,At.CLAMP_TO_EDGE),At.texParameteri(At.TEXTURE_2D,At.TEXTURE_WRAP_T,At.CLAMP_TO_EDGE),At.texParameteri(At.TEXTURE_2D,At.TEXTURE_MIN_FILTER,At.LINEAR),At.texParameteri(At.TEXTURE_2D,At.TEXTURE_MAG_FILTER,At.LINEAR),kt=yt.heatmapFbo=gt.createFramebuffer(_t.width/4,_t.height/4,!1,!1),function(St,Nt,Zt,Ht){var ne,he;let ce=St.gl,ge=(ne=St.HALF_FLOAT)!==null&&ne!==void 0?ne:ce.UNSIGNED_BYTE,Ue=(he=St.RGBA16F)!==null&&he!==void 0?he:ce.RGBA;ce.texImage2D(ce.TEXTURE_2D,0,Ue,Nt.width/4,Nt.height/4,0,ce.RGBA,ge,null),Ht.colorAttachment.set(Zt)}(gt,_t,Wt,kt)}})(W,M,F),W.clear({color:s.aO.transparent});for(let gt=0;gt<U.length;gt++){let _t=U[gt];if(O.hasRenderableParent(_t))continue;let yt=O.getTile(_t),At=yt.getBucket(F);if(!At)continue;let kt=At.programConfigurations.get(F.id),Wt=M.useProgram(\"heatmap\",kt),{zoom:St}=M.transform;Wt.draw(W,$.TRIANGLES,oi.disabled,X,at,Ni.disabled,zs(_t.posMatrix,yt,St,F.paint.get(\"heatmap-intensity\")),null,F.id,At.layoutVertexBuffer,At.indexBuffer,At.segments,F.paint,M.transform.zoom,kt)}W.viewport.set([0,0,M.width,M.height])}else M.renderPass===\"translucent\"&&(M.context.setColorMode(M.colorModeForRenderPass()),function(W,$){let X=W.context,at=X.gl,gt=$.heatmapFbo;if(!gt)return;X.activeTexture.set(at.TEXTURE0),at.bindTexture(at.TEXTURE_2D,gt.colorAttachment.get()),X.activeTexture.set(at.TEXTURE1);let _t=$.colorRampTexture;_t||(_t=$.colorRampTexture=new ae(X,$.colorRamp,at.RGBA)),_t.bind(at.LINEAR,at.CLAMP_TO_EDGE),W.useProgram(\"heatmapTexture\").draw(X,at.TRIANGLES,oi.disabled,en.disabled,W.colorModeForRenderPass(),Ni.disabled,((yt,At,kt,Wt)=>{let St=s.F();s.aN(St,0,yt.width,yt.height,0,0,1);let Nt=yt.context.gl;return{u_matrix:St,u_world:[Nt.drawingBufferWidth,Nt.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:At.paint.get(\"heatmap-opacity\")}})(W,$),null,$.id,W.viewportBuffer,W.quadTriangleIndexBuffer,W.viewportSegments,$.paint,W.transform.zoom)}(M,F))})(l,f,v,b);break;case\"line\":(function(M,O,F,U){if(M.renderPass!==\"translucent\")return;let W=F.paint.get(\"line-opacity\"),$=F.paint.get(\"line-width\");if(W.constantOr(1)===0||$.constantOr(1)===0)return;let X=M.depthModeForSublayer(0,oi.ReadOnly),at=M.colorModeForRenderPass(),gt=F.paint.get(\"line-dasharray\"),_t=F.paint.get(\"line-pattern\"),yt=_t.constantOr(1),At=F.paint.get(\"line-gradient\"),kt=F.getCrossfadeParameters(),Wt=yt?\"linePattern\":gt?\"lineSDF\":At?\"lineGradient\":\"line\",St=M.context,Nt=St.gl,Zt=!0;for(let Ht of U){let ne=O.getTile(Ht);if(yt&&!ne.patternsLoaded())continue;let he=ne.getBucket(F);if(!he)continue;let ce=he.programConfigurations.get(F.id),ge=M.context.program.get(),Ue=M.useProgram(Wt,ce),ur=Zt||Ue.program!==ge,Me=M.style.map.terrain&&M.style.map.terrain.getTerrainData(Ht),ar=_t.constantOr(null);if(ar&&ne.imageAtlas){let Jr=ne.imageAtlas,Fr=Jr.patternPositions[ar.to.toString()],$r=Jr.patternPositions[ar.from.toString()];Fr&&$r&&ce.setConstantPatternPositions(Fr,$r)}let He=Me?Ht:null,rn=yt?Af(M,ne,F,kt,He):gt?Nm(M,ne,F,gt,kt,He):At?bx(M,ne,F,he.lineClipsArray.length,He):zm(M,ne,F,He);if(yt)St.activeTexture.set(Nt.TEXTURE0),ne.imageAtlasTexture.bind(Nt.LINEAR,Nt.CLAMP_TO_EDGE),ce.updatePaintBuffers(kt);else if(gt&&(ur||M.lineAtlas.dirty))St.activeTexture.set(Nt.TEXTURE0),M.lineAtlas.bind(St);else if(At){let Jr=he.gradients[F.id],Fr=Jr.texture;if(F.gradientVersion!==Jr.version){let $r=256;if(F.stepInterpolant){let On=O.getSource().maxzoom,Dr=Ht.canonical.z===On?Math.ceil(1<<M.transform.maxZoom-Ht.canonical.z):1;$r=s.ac(s.aT(he.maxLineLength/s.W*1024*Dr),256,St.maxTextureSize)}Jr.gradient=s.aU({expression:F.gradientExpression(),evaluationKey:\"lineProgress\",resolution:$r,image:Jr.gradient||void 0,clips:he.lineClipsArray}),Jr.texture?Jr.texture.update(Jr.gradient):Jr.texture=new ae(St,Jr.gradient,Nt.RGBA),Jr.version=F.gradientVersion,Fr=Jr.texture}St.activeTexture.set(Nt.TEXTURE0),Fr.bind(F.stepInterpolant?Nt.NEAREST:Nt.LINEAR,Nt.CLAMP_TO_EDGE)}Ue.draw(St,Nt.TRIANGLES,X,M.stencilModeForClipping(Ht),at,Ni.disabled,rn,Me,F.id,he.layoutVertexBuffer,he.indexBuffer,he.segments,F.paint,M.transform.zoom,ce,he.layoutVertexBuffer2),Zt=!1}})(l,f,v,b);break;case\"fill\":(function(M,O,F,U){let W=F.paint.get(\"fill-color\"),$=F.paint.get(\"fill-opacity\");if($.constantOr(1)===0)return;let X=M.colorModeForRenderPass(),at=F.paint.get(\"fill-pattern\"),gt=M.opaquePassEnabledForLayer()&&!at.constantOr(1)&&W.constantOr(s.aO.transparent).a===1&&$.constantOr(0)===1?\"opaque\":\"translucent\";if(M.renderPass===gt){let _t=M.depthModeForSublayer(1,M.renderPass===\"opaque\"?oi.ReadWrite:oi.ReadOnly);Kg(M,O,F,U,_t,X,!1)}if(M.renderPass===\"translucent\"&&F.paint.get(\"fill-antialias\")){let _t=M.depthModeForSublayer(F.getPaintProperty(\"fill-outline-color\")?2:0,oi.ReadOnly);Kg(M,O,F,U,_t,X,!0)}})(l,f,v,b);break;case\"fill-extrusion\":(function(M,O,F,U){let W=F.paint.get(\"fill-extrusion-opacity\");if(W!==0&&M.renderPass===\"translucent\"){let $=new oi(M.context.gl.LEQUAL,oi.ReadWrite,M.depthRangeFor3D);if(W!==1||F.paint.get(\"fill-extrusion-pattern\").constantOr(1))vf(M,O,F,U,$,en.disabled,Pt.disabled),vf(M,O,F,U,$,M.stencilModeFor3D(),M.colorModeForRenderPass());else{let X=M.colorModeForRenderPass();vf(M,O,F,U,$,en.disabled,X)}}})(l,f,v,b);break;case\"hillshade\":(function(M,O,F,U){if(M.renderPass!==\"offscreen\"&&M.renderPass!==\"translucent\")return;let W=M.context,$=M.depthModeForSublayer(0,oi.ReadOnly),X=M.colorModeForRenderPass(),[at,gt]=M.renderPass===\"translucent\"?M.stencilConfigForOverlap(U):[{},U];for(let _t of gt){let yt=O.getTile(_t);yt.needsHillshadePrepare!==void 0&&yt.needsHillshadePrepare&&M.renderPass===\"offscreen\"?Rn(M,yt,F,$,en.disabled,X):M.renderPass===\"translucent\"&&ua(M,_t,yt,F,$,at[_t.overscaledZ],X)}W.viewport.set([0,0,M.width,M.height])})(l,f,v,b);break;case\"raster\":(function(M,O,F,U){if(M.renderPass!==\"translucent\"||F.paint.get(\"raster-opacity\")===0||!U.length)return;let W=M.context,$=W.gl,X=O.getSource(),at=M.useProgram(\"raster\"),gt=M.colorModeForRenderPass(),[_t,yt]=X instanceof xn?[{},U]:M.stencilConfigForOverlap(U),At=yt[yt.length-1].overscaledZ,kt=!M.options.moving;for(let Wt of yt){let St=M.depthModeForSublayer(Wt.overscaledZ-At,F.paint.get(\"raster-opacity\")===1?oi.ReadWrite:oi.ReadOnly,$.LESS),Nt=O.getTile(Wt);Nt.registerFadeDuration(F.paint.get(\"raster-fade-duration\"));let Zt=O.findLoadedParent(Wt,0),Ht=Jg(Nt,Zt,O,F,M.transform,M.style.map.terrain),ne,he,ce=F.paint.get(\"raster-resampling\")===\"nearest\"?$.NEAREST:$.LINEAR;W.activeTexture.set($.TEXTURE0),Nt.texture.bind(ce,$.CLAMP_TO_EDGE,$.LINEAR_MIPMAP_NEAREST),W.activeTexture.set($.TEXTURE1),Zt?(Zt.texture.bind(ce,$.CLAMP_TO_EDGE,$.LINEAR_MIPMAP_NEAREST),ne=Math.pow(2,Zt.tileID.overscaledZ-Nt.tileID.overscaledZ),he=[Nt.tileID.canonical.x*ne%1,Nt.tileID.canonical.y*ne%1]):Nt.texture.bind(ce,$.CLAMP_TO_EDGE,$.LINEAR_MIPMAP_NEAREST);let ge=M.style.map.terrain&&M.style.map.terrain.getTerrainData(Wt),Ue=ge?Wt:null,ur=Ue?Ue.posMatrix:M.transform.calculatePosMatrix(Wt.toUnwrapped(),kt),Me=Um(ur,he||[0,0],ne||1,Ht,F);X instanceof xn?at.draw(W,$.TRIANGLES,St,en.disabled,gt,Ni.disabled,Me,ge,F.id,X.boundsBuffer,M.quadTriangleIndexBuffer,X.boundsSegments):at.draw(W,$.TRIANGLES,St,_t[Wt.overscaledZ],gt,Ni.disabled,Me,ge,F.id,M.rasterBoundsBuffer,M.quadTriangleIndexBuffer,M.rasterBoundsSegments)}})(l,f,v,b);break;case\"background\":(function(M,O,F,U){let W=F.paint.get(\"background-color\"),$=F.paint.get(\"background-opacity\");if($===0)return;let X=M.context,at=X.gl,gt=M.transform,_t=gt.tileSize,yt=F.paint.get(\"background-pattern\");if(M.isPatternMissing(yt))return;let At=!yt&&W.a===1&&$===1&&M.opaquePassEnabledForLayer()?\"opaque\":\"translucent\";if(M.renderPass!==At)return;let kt=en.disabled,Wt=M.depthModeForSublayer(0,At===\"opaque\"?oi.ReadWrite:oi.ReadOnly),St=M.colorModeForRenderPass(),Nt=M.useProgram(yt?\"backgroundPattern\":\"background\"),Zt=U||gt.coveringTiles({tileSize:_t,terrain:M.style.map.terrain});yt&&(X.activeTexture.set(at.TEXTURE0),M.imageManager.bind(M.context));let Ht=F.getCrossfadeParameters();for(let ne of Zt){let he=U?ne.posMatrix:M.transform.calculatePosMatrix(ne.toUnwrapped()),ce=yt?kS(he,$,M,yt,{tileID:ne,tileSize:_t},Ht):LS(he,$,W),ge=M.style.map.terrain&&M.style.map.terrain.getTerrainData(ne);Nt.draw(X,at.TRIANGLES,Wt,kt,St,Ni.disabled,ce,ge,F.id,M.tileExtentBuffer,M.quadTriangleIndexBuffer,M.tileExtentSegments)}})(l,0,v,b);break;case\"custom\":(function(M,O,F){let U=M.context,W=F.implementation;if(M.renderPass===\"offscreen\"){let $=W.prerender;$&&(M.setCustomLayerDefaults(),U.setColorMode(M.colorModeForRenderPass()),$.call(W,U.gl,M.transform.customLayerMatrix()),U.setDirty(),M.setBaseState())}else if(M.renderPass===\"translucent\"){M.setCustomLayerDefaults(),U.setColorMode(M.colorModeForRenderPass()),U.setStencilMode(en.disabled);let $=W.renderingMode===\"3d\"?new oi(M.context.gl.LEQUAL,oi.ReadWrite,M.depthRangeFor3D):M.depthModeForSublayer(0,oi.ReadOnly);U.setDepthMode($),W.render(U.gl,M.transform.customLayerMatrix()),U.setDirty(),M.setBaseState(),U.bindFramebuffer.set(null)}})(l,0,v)}}translatePosMatrix(l,f,v,b,M){if(!v[0]&&!v[1])return l;let O=M?b===\"map\"?this.transform.angle:0:b===\"viewport\"?-this.transform.angle:0;if(O){let W=Math.sin(O),$=Math.cos(O);v=[v[0]*$-v[1]*W,v[0]*W+v[1]*$]}let F=[M?v[0]:_r(f,v[0],this.transform.zoom),M?v[1]:_r(f,v[1],this.transform.zoom),0],U=new Float32Array(16);return s.H(U,l,F),U}saveTileTexture(l){let f=this._tileTextures[l.size[0]];f?f.push(l):this._tileTextures[l.size[0]]=[l]}getTileTexture(l){let f=this._tileTextures[l];return f&&f.length>0?f.pop():null}isPatternMissing(l){if(!l)return!1;if(!l.from||!l.to)return!0;let f=this.imageManager.getPattern(l.from.toString()),v=this.imageManager.getPattern(l.to.toString());return!f||!v}useProgram(l,f){this.cache=this.cache||{};let v=l+(f?f.cacheKey:\"\")+(this._showOverdrawInspector?\"/overdraw\":\"\")+(this.style.map.terrain?\"/terrain\":\"\");return this.cache[v]||(this.cache[v]=new Bl(this.context,ca[l],f,wx[l],this._showOverdrawInspector,this.style.map.terrain)),this.cache[v]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let l=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(l.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement(\"canvas\"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new ae(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:l,drawingBufferHeight:f}=this.context.gl;return this.width!==l||this.height!==f}}class pu{constructor(l,f){this.points=l,this.planes=f}static fromInvProjectionMatrix(l,f,v){let b=Math.pow(2,v),M=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(F=>{let U=1/(F=s.af([],F,l))[3]/f*b;return s.a_(F,F,[U,U,1/F[3],U])}),O=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(F=>{let U=function(at,gt){var _t=gt[0],yt=gt[1],At=gt[2],kt=_t*_t+yt*yt+At*At;return kt>0&&(kt=1/Math.sqrt(kt)),at[0]=gt[0]*kt,at[1]=gt[1]*kt,at[2]=gt[2]*kt,at}([],function(at,gt,_t){var yt=gt[0],At=gt[1],kt=gt[2],Wt=_t[0],St=_t[1],Nt=_t[2];return at[0]=At*Nt-kt*St,at[1]=kt*Wt-yt*Nt,at[2]=yt*St-At*Wt,at}([],Yt([],M[F[0]],M[F[1]]),Yt([],M[F[2]],M[F[1]]))),W=-(($=U)[0]*(X=M[F[1]])[0]+$[1]*X[1]+$[2]*X[2]);var $,X;return U.concat(W)});return new pu(M,O)}}class Cc{constructor(l,f){this.min=l,this.max=f,this.center=function(v,b,M){return v[0]=.5*b[0],v[1]=.5*b[1],v[2]=.5*b[2],v}([],function(v,b,M){return v[0]=b[0]+M[0],v[1]=b[1]+M[1],v[2]=b[2]+M[2],v}([],this.min,this.max))}quadrant(l){let f=[l%2==0,l<2],v=Tt(this.min),b=Tt(this.max);for(let M=0;M<f.length;M++)v[M]=f[M]?this.min[M]:this.center[M],b[M]=f[M]?this.center[M]:this.max[M];return b[2]=this.max[2],new Cc(v,b)}distanceX(l){return Math.max(Math.min(this.max[0],l[0]),this.min[0])-l[0]}distanceY(l){return Math.max(Math.min(this.max[1],l[1]),this.min[1])-l[1]}intersects(l){let f=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]],v=!0;for(let b=0;b<l.planes.length;b++){let M=l.planes[b],O=0;for(let F=0;F<f.length;F++)s.a$(M,f[F])>=0&&O++;if(O===0)return 0;O!==f.length&&(v=!1)}if(v)return 2;for(let b=0;b<3;b++){let M=Number.MAX_VALUE,O=-Number.MAX_VALUE;for(let F=0;F<l.points.length;F++){let U=l.points[F][b]-this.min[b];M=Math.min(M,U),O=Math.max(O,U)}if(O<0||M>this.max[b]-this.min[b])return 0}return 1}}class Au{constructor(l=0,f=0,v=0,b=0){if(isNaN(l)||l<0||isNaN(f)||f<0||isNaN(v)||v<0||isNaN(b)||b<0)throw new Error(\"Invalid value for edge-insets, top, bottom, left and right must all be numbers\");this.top=l,this.bottom=f,this.left=v,this.right=b}interpolate(l,f,v){return f.top!=null&&l.top!=null&&(this.top=s.z.number(l.top,f.top,v)),f.bottom!=null&&l.bottom!=null&&(this.bottom=s.z.number(l.bottom,f.bottom,v)),f.left!=null&&l.left!=null&&(this.left=s.z.number(l.left,f.left,v)),f.right!=null&&l.right!=null&&(this.right=s.z.number(l.right,f.right,v)),this}getCenter(l,f){let v=s.ac((this.left+l-this.right)/2,0,l),b=s.ac((this.top+f-this.bottom)/2,0,f);return new s.P(v,b)}equals(l){return this.top===l.top&&this.bottom===l.bottom&&this.left===l.left&&this.right===l.right}clone(){return new Au(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class xf{constructor(l,f,v,b,M){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=M===void 0||!!M,this._minZoom=l||0,this._maxZoom=f||22,this._minPitch=v??0,this._maxPitch=b??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new s.M(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Au,this._posMatrixCache={},this._alignedPosMatrixCache={},this.minElevationForCurrentTile=0}clone(){let l=new xf(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return l.apply(this),l}apply(l){this.tileSize=l.tileSize,this.latRange=l.latRange,this.width=l.width,this.height=l.height,this._center=l._center,this._elevation=l._elevation,this.minElevationForCurrentTile=l.minElevationForCurrentTile,this.zoom=l.zoom,this.angle=l.angle,this._fov=l._fov,this._pitch=l._pitch,this._unmodified=l._unmodified,this._edgeInsets=l._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(l){this._minZoom!==l&&(this._minZoom=l,this.zoom=Math.max(this.zoom,l))}get maxZoom(){return this._maxZoom}set maxZoom(l){this._maxZoom!==l&&(this._maxZoom=l,this.zoom=Math.min(this.zoom,l))}get minPitch(){return this._minPitch}set minPitch(l){this._minPitch!==l&&(this._minPitch=l,this.pitch=Math.max(this.pitch,l))}get maxPitch(){return this._maxPitch}set maxPitch(l){this._maxPitch!==l&&(this._maxPitch=l,this.pitch=Math.min(this.pitch,l))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(l){l===void 0?l=!0:l===null&&(l=!1),this._renderWorldCopies=l}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new s.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(l){let f=-s.b0(l,-180,180)*Math.PI/180;this.angle!==f&&(this._unmodified=!1,this.angle=f,this._calcMatrices(),this.rotationMatrix=function(){var v=new s.A(4);return s.A!=Float32Array&&(v[1]=0,v[2]=0),v[0]=1,v[3]=1,v}(),function(v,b,M){var O=b[0],F=b[1],U=b[2],W=b[3],$=Math.sin(M),X=Math.cos(M);v[0]=O*X+U*$,v[1]=F*X+W*$,v[2]=O*-$+U*X,v[3]=F*-$+W*X}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(l){let f=s.ac(l,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==f&&(this._unmodified=!1,this._pitch=f,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(l){l=Math.max(.01,Math.min(60,l)),this._fov!==l&&(this._unmodified=!1,this._fov=l/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(l){let f=Math.min(Math.max(l,this.minZoom),this.maxZoom);this._zoom!==f&&(this._unmodified=!1,this._zoom=f,this.tileZoom=Math.max(0,Math.floor(f)),this.scale=this.zoomScale(f),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(l){l.lat===this._center.lat&&l.lng===this._center.lng||(this._unmodified=!1,this._center=l,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(l){l!==this._elevation&&(this._elevation=l,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(l){this._edgeInsets.equals(l)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,l,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(l){return this._edgeInsets.equals(l)}interpolatePadding(l,f,v){this._unmodified=!1,this._edgeInsets.interpolate(l,f,v),this._constrain(),this._calcMatrices()}coveringZoomLevel(l){let f=(l.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/l.tileSize));return Math.max(0,f)}getVisibleUnwrappedCoordinates(l){let f=[new s.b1(0,l)];if(this._renderWorldCopies){let v=this.pointCoordinate(new s.P(0,0)),b=this.pointCoordinate(new s.P(this.width,0)),M=this.pointCoordinate(new s.P(this.width,this.height)),O=this.pointCoordinate(new s.P(0,this.height)),F=Math.floor(Math.min(v.x,b.x,M.x,O.x)),U=Math.floor(Math.max(v.x,b.x,M.x,O.x)),W=1;for(let $=F-W;$<=U+W;$++)$!==0&&f.push(new s.b1($,l))}return f}coveringTiles(l){var f,v;let b=this.coveringZoomLevel(l),M=b;if(l.minzoom!==void 0&&b<l.minzoom)return[];l.maxzoom!==void 0&&b>l.maxzoom&&(b=l.maxzoom);let O=this.pointCoordinate(this.getCameraPoint()),F=s.Y.fromLngLat(this.center),U=Math.pow(2,b),W=[U*O.x,U*O.y,0],$=[U*F.x,U*F.y,0],X=pu.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,b),at=l.minzoom||0;!l.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(at=b);let gt=l.terrain?2/Math.min(this.tileSize,l.tileSize)*this.tileSize:3,_t=St=>({aabb:new Cc([St*U,0,0],[(St+1)*U,U,0]),zoom:0,x:0,y:0,wrap:St,fullyVisible:!1}),yt=[],At=[],kt=b,Wt=l.reparseOverscaled?M:b;if(this._renderWorldCopies)for(let St=1;St<=3;St++)yt.push(_t(-St)),yt.push(_t(St));for(yt.push(_t(0));yt.length>0;){let St=yt.pop(),Nt=St.x,Zt=St.y,Ht=St.fullyVisible;if(!Ht){let Ue=St.aabb.intersects(X);if(Ue===0)continue;Ht=Ue===2}let ne=l.terrain?W:$,he=St.aabb.distanceX(ne),ce=St.aabb.distanceY(ne),ge=Math.max(Math.abs(he),Math.abs(ce));if(St.zoom===kt||ge>gt+(1<<kt-St.zoom)-2&&St.zoom>=at){let Ue=kt-St.zoom,ur=W[0]-.5-(Nt<<Ue),Me=W[1]-.5-(Zt<<Ue);At.push({tileID:new s.Q(St.zoom===kt?Wt:St.zoom,St.wrap,St.zoom,Nt,Zt),distanceSq:te([$[0]-.5-Nt,$[1]-.5-Zt]),tileDistanceToCamera:Math.sqrt(ur*ur+Me*Me)})}else for(let Ue=0;Ue<4;Ue++){let ur=(Nt<<1)+Ue%2,Me=(Zt<<1)+(Ue>>1),ar=St.zoom+1,He=St.aabb.quadrant(Ue);if(l.terrain){let rn=new s.Q(ar,St.wrap,ar,ur,Me),Jr=l.terrain.getMinMaxElevation(rn),Fr=(f=Jr.minElevation)!==null&&f!==void 0?f:this.elevation,$r=(v=Jr.maxElevation)!==null&&v!==void 0?v:this.elevation;He=new Cc([He.min[0],He.min[1],Fr],[He.max[0],He.max[1],$r])}yt.push({aabb:He,zoom:ar,x:ur,y:Me,wrap:St.wrap,fullyVisible:Ht})}}return At.sort((St,Nt)=>St.distanceSq-Nt.distanceSq).map(St=>St.tileID)}resize(l,f){this.width=l,this.height=f,this.pixelsToGLUnits=[2/l,-2/f],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(l){return Math.pow(2,l)}scaleZoom(l){return Math.log(l)/Math.LN2}project(l){let f=s.ac(l.lat,-this.maxValidLatitude,this.maxValidLatitude);return new s.P(s.N(l.lng)*this.worldSize,s.O(f)*this.worldSize)}unproject(l){return new s.Y(l.x/this.worldSize,l.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(l){let f=this.pointLocation(this.centerPoint,l),v=l.getElevationForLngLatZoom(f,this.tileZoom);if(!(this.elevation-v))return;let b=this.getCameraPosition(),M=s.Y.fromLngLat(b.lngLat,b.altitude),O=s.Y.fromLngLat(f,v),F=M.x-O.x,U=M.y-O.y,W=M.z-O.z,$=Math.sqrt(F*F+U*U+W*W),X=this.scaleZoom(this.cameraToCenterDistance/$/this.tileSize);this._elevation=v,this._center=f,this.zoom=X}setLocationAtPoint(l,f){let v=this.pointCoordinate(f),b=this.pointCoordinate(this.centerPoint),M=this.locationCoordinate(l),O=new s.Y(M.x-(v.x-b.x),M.y-(v.y-b.y));this.center=this.coordinateLocation(O),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(l,f){return f?this.coordinatePoint(this.locationCoordinate(l),f.getElevationForLngLatZoom(l,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(l))}pointLocation(l,f){return this.coordinateLocation(this.pointCoordinate(l,f))}locationCoordinate(l){return s.Y.fromLngLat(l)}coordinateLocation(l){return l&&l.toLngLat()}pointCoordinate(l,f){if(f){let at=f.pointCoordinate(l);if(at!=null)return at}let v=[l.x,l.y,0,1],b=[l.x,l.y,1,1];s.af(v,v,this.pixelMatrixInverse),s.af(b,b,this.pixelMatrixInverse);let M=v[3],O=b[3],F=v[1]/M,U=b[1]/O,W=v[2]/M,$=b[2]/O,X=W===$?0:(0-W)/($-W);return new s.Y(s.z.number(v[0]/M,b[0]/O,X)/this.worldSize,s.z.number(F,U,X)/this.worldSize)}coordinatePoint(l,f=0,v=this.pixelMatrix){let b=[l.x*this.worldSize,l.y*this.worldSize,f,1];return s.af(b,b,v),new s.P(b[0]/b[3],b[1]/b[3])}getBounds(){let l=Math.max(0,this.height/2-this.getHorizon());return new an().extend(this.pointLocation(new s.P(0,l))).extend(this.pointLocation(new s.P(this.width,l))).extend(this.pointLocation(new s.P(this.width,this.height))).extend(this.pointLocation(new s.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new an([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(l){l?(this.lngRange=[l.getWest(),l.getEast()],this.latRange=[l.getSouth(),l.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(l,f=!1){let v=l.key,b=f?this._alignedPosMatrixCache:this._posMatrixCache;if(b[v])return b[v];let M=l.canonical,O=this.worldSize/this.zoomScale(M.z),F=M.x+Math.pow(2,M.z)*l.wrap,U=s.an(new Float64Array(16));return s.H(U,U,[F*O,M.y*O,0]),s.J(U,U,[O/s.W,O/s.W,1]),s.K(U,f?this.alignedProjMatrix:this.projMatrix,U),b[v]=new Float32Array(U),b[v]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let l,f,v,b,M=-90,O=90,F=-180,U=180,W=this.size,$=this._unmodified;if(this.latRange){let gt=this.latRange;M=s.O(gt[1])*this.worldSize,O=s.O(gt[0])*this.worldSize,l=O-M<W.y?W.y/(O-M):0}if(this.lngRange){let gt=this.lngRange;F=s.b0(s.N(gt[0])*this.worldSize,0,this.worldSize),U=s.b0(s.N(gt[1])*this.worldSize,0,this.worldSize),U<F&&(U+=this.worldSize),f=U-F<W.x?W.x/(U-F):0}let X=this.point,at=Math.max(f||0,l||0);if(at)return this.center=this.unproject(new s.P(f?(U+F)/2:X.x,l?(O+M)/2:X.y)),this.zoom+=this.scaleZoom(at),this._unmodified=$,void(this._constraining=!1);if(this.latRange){let gt=X.y,_t=W.y/2;gt-_t<M&&(b=M+_t),gt+_t>O&&(b=O-_t)}if(this.lngRange){let gt=(F+U)/2,_t=s.b0(X.x,gt-this.worldSize/2,gt+this.worldSize/2),yt=W.x/2;_t-yt<F&&(v=F+yt),_t+yt>U&&(v=U-yt)}v===void 0&&b===void 0||(this.center=this.unproject(new s.P(v!==void 0?v:X.x,b!==void 0?b:X.y)).wrap()),this._unmodified=$,this._constraining=!1}_calcMatrices(){if(!this.height)return;let l=this.centerOffset,f=this.point.x,v=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=s.b2(1,this.center.lat)*this.worldSize;let b=s.an(new Float64Array(16));s.J(b,b,[this.width/2,-this.height/2,1]),s.H(b,b,[1,-1,0]),this.labelPlaneMatrix=b,b=s.an(new Float64Array(16)),s.J(b,b,[1,-1,1]),s.H(b,b,[-1,-1,0]),s.J(b,b,[2/this.width,2/this.height,1]),this.glCoordMatrix=b;let M=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),O=Math.min(this.elevation,this.minElevationForCurrentTile),F=M-O*this._pixelPerMeter/Math.cos(this._pitch),U=O<0?F:M,W=Math.PI/2+this._pitch,$=this._fov*(.5+l.y/this.height),X=Math.sin($)*U/Math.sin(s.ac(Math.PI-W-$,.01,Math.PI-.01)),at=this.getHorizon(),gt=2*Math.atan(at/this.cameraToCenterDistance)*(.5+l.y/(2*at)),_t=Math.sin(gt)*U/Math.sin(s.ac(Math.PI-W-gt,.01,Math.PI-.01)),yt=Math.min(X,_t),At=1.01*(Math.cos(Math.PI/2-this._pitch)*yt+U),kt=this.height/50;b=new Float64Array(16),s.b3(b,this._fov,this.width/this.height,kt,At),b[8]=2*-l.x/this.width,b[9]=2*l.y/this.height,s.J(b,b,[1,-1,1]),s.H(b,b,[0,0,-this.cameraToCenterDistance]),s.b4(b,b,this._pitch),s.ad(b,b,this.angle),s.H(b,b,[-f,-v,0]),this.mercatorMatrix=s.J([],b,[this.worldSize,this.worldSize,this.worldSize]),s.J(b,b,[1,1,this._pixelPerMeter]),this.pixelMatrix=s.K(new Float64Array(16),this.labelPlaneMatrix,b),s.H(b,b,[0,0,-this.elevation]),this.projMatrix=b,this.invProjMatrix=s.ar([],b),this.pixelMatrix3D=s.K(new Float64Array(16),this.labelPlaneMatrix,b);let Wt=this.width%2/2,St=this.height%2/2,Nt=Math.cos(this.angle),Zt=Math.sin(this.angle),Ht=f-Math.round(f)+Nt*Wt+Zt*St,ne=v-Math.round(v)+Nt*St+Zt*Wt,he=new Float64Array(b);if(s.H(he,he,[Ht>.5?Ht-1:Ht,ne>.5?ne-1:ne,0]),this.alignedProjMatrix=he,b=s.ar(new Float64Array(16),this.pixelMatrix),!b)throw new Error(\"failed to invert matrix\");this.pixelMatrixInverse=b,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let l=this.pointCoordinate(new s.P(0,0)),f=[l.x*this.worldSize,l.y*this.worldSize,0,1];return s.af(f,f,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let l=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.P(0,l))}getCameraQueryGeometry(l){let f=this.getCameraPoint();if(l.length===1)return[l[0],f];{let v=f.x,b=f.y,M=f.x,O=f.y;for(let F of l)v=Math.min(v,F.x),b=Math.min(b,F.y),M=Math.max(M,F.x),O=Math.max(O,F.y);return[new s.P(v,b),new s.P(M,b),new s.P(M,O),new s.P(v,O),new s.P(v,b)]}}lngLatToCameraDepth(l,f){let v=this.locationCoordinate(l),b=[v.x*this.worldSize,v.y*this.worldSize,f,1];return s.af(b,b,this.projMatrix),b[2]/b[3]}}function Ym(T,l){let f,v=!1,b=null,M=null,O=()=>{b=null,v&&(T.apply(M,f),b=setTimeout(O,l),v=!1)};return(...F)=>(v=!0,M=this,f=F,b||O(),b)}class $m{constructor(l){this._getCurrentHash=()=>{let f=window.location.hash.replace(\"#\",\"\");if(this._hashName){let v;return f.split(\"&\").map(b=>b.split(\"=\")).forEach(b=>{b[0]===this._hashName&&(v=b)}),(v&&v[1]||\"\").split(\"/\")}return f.split(\"/\")},this._onHashChange=()=>{let f=this._getCurrentHash();if(f.length>=3&&!f.some(v=>isNaN(v))){let v=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(f[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+f[2],+f[1]],zoom:+f[0],bearing:v,pitch:+(f[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let f=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,f)}catch{}},this._updateHash=Ym(this._updateHashUnthrottled,300),this._hashName=l&&encodeURIComponent(l)}addTo(l){return this._map=l,addEventListener(\"hashchange\",this._onHashChange,!1),this._map.on(\"moveend\",this._updateHash),this}remove(){return removeEventListener(\"hashchange\",this._onHashChange,!1),this._map.off(\"moveend\",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(l){let f=this._map.getCenter(),v=Math.round(100*this._map.getZoom())/100,b=Math.ceil((v*Math.LN2+Math.log(512/360/.5))/Math.LN10),M=Math.pow(10,b),O=Math.round(f.lng*M)/M,F=Math.round(f.lat*M)/M,U=this._map.getBearing(),W=this._map.getPitch(),$=\"\";if($+=l?`/${O}/${F}/${v}`:`${v}/${F}/${O}`,(U||W)&&($+=\"/\"+Math.round(10*U)/10),W&&($+=`/${Math.round(W)}`),this._hashName){let X=this._hashName,at=!1,gt=window.location.hash.slice(1).split(\"&\").map(_t=>{let yt=_t.split(\"=\")[0];return yt===X?(at=!0,`${yt}=${$}`):_t}).filter(_t=>_t);return at||gt.push(`${X}=${$}`),`#${gt.join(\"&\")}`}return`#${$}`}}let bf={linearity:.3,easing:s.b5(0,0,.3,1)},Qm=s.e({deceleration:2500,maxSpeed:1400},bf),Lc=s.e({deceleration:20,maxSpeed:1400},bf),n_=s.e({deceleration:1e3,maxSpeed:360},bf),s_=s.e({deceleration:1e3,maxSpeed:90},bf);class o_{constructor(l){this._map=l,this.clear()}clear(){this._inertiaBuffer=[]}record(l){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:_.now(),settings:l})}_drainInertiaBuffer(){let l=this._inertiaBuffer,f=_.now();for(;l.length>0&&f-l[0].time>160;)l.shift()}_onMoveEnd(l){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let f={zoom:0,bearing:0,pitch:0,pan:new s.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:M}of this._inertiaBuffer)f.zoom+=M.zoomDelta||0,f.bearing+=M.bearingDelta||0,f.pitch+=M.pitchDelta||0,M.panDelta&&f.pan._add(M.panDelta),M.around&&(f.around=M.around),M.pinchAround&&(f.pinchAround=M.pinchAround);let v=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,b={};if(f.pan.mag()){let M=ol(f.pan.mag(),v,s.e({},Qm,l||{}));b.offset=f.pan.mult(M.amount/f.pan.mag()),b.center=this._map.transform.center,is(b,M)}if(f.zoom){let M=ol(f.zoom,v,Lc);b.zoom=this._map.transform.zoom+M.amount,is(b,M)}if(f.bearing){let M=ol(f.bearing,v,n_);b.bearing=this._map.transform.bearing+s.ac(M.amount,-179,179),is(b,M)}if(f.pitch){let M=ol(f.pitch,v,s_);b.pitch=this._map.transform.pitch+M.amount,is(b,M)}if(b.zoom||b.bearing){let M=f.pinchAround===void 0?f.around:f.pinchAround;b.around=M?this._map.unproject(M):this._map.getCenter()}return this.clear(),s.e(b,{noMoveStart:!0})}}function is(T,l){(!T.duration||T.duration<l.duration)&&(T.duration=l.duration,T.easing=l.easing)}function ol(T,l,f){let{maxSpeed:v,linearity:b,deceleration:M}=f,O=s.ac(T*b/(l/1e3),-v,v),F=Math.abs(O)/(M*b);return{easing:f.easing,duration:1e3*F,amount:O*(F/2)}}class Ui extends s.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(l,f,v,b={}){let M=w.mousePos(f.getCanvas(),v),O=f.unproject(M);super(l,s.e({point:M,lngLat:O,originalEvent:v},b)),this._defaultPrevented=!1,this.target=f}}class mu extends s.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(l,f,v){let b=l===\"touchend\"?v.changedTouches:v.touches,M=w.touchPos(f.getCanvasContainer(),b),O=M.map(U=>f.unproject(U)),F=M.reduce((U,W,$,X)=>U.add(W.div(X.length)),new s.P(0,0));super(l,{points:M,point:F,lngLats:O,lngLat:f.unproject(F),originalEvent:v}),this._defaultPrevented=!1}}class gu extends s.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(l,f,v){super(l,{originalEvent:v}),this._defaultPrevented=!1}}class Id{constructor(l,f){this._map=l,this._clickTolerance=f.clickTolerance}reset(){delete this._mousedownPos}wheel(l){return this._firePreventable(new gu(l.type,this._map,l))}mousedown(l,f){return this._mousedownPos=f,this._firePreventable(new Ui(l.type,this._map,l))}mouseup(l){this._map.fire(new Ui(l.type,this._map,l))}click(l,f){this._mousedownPos&&this._mousedownPos.dist(f)>=this._clickTolerance||this._map.fire(new Ui(l.type,this._map,l))}dblclick(l){return this._firePreventable(new Ui(l.type,this._map,l))}mouseover(l){this._map.fire(new Ui(l.type,this._map,l))}mouseout(l){this._map.fire(new Ui(l.type,this._map,l))}touchstart(l){return this._firePreventable(new mu(l.type,this._map,l))}touchmove(l){this._map.fire(new mu(l.type,this._map,l))}touchend(l){this._map.fire(new mu(l.type,this._map,l))}touchcancel(l){this._map.fire(new mu(l.type,this._map,l))}_firePreventable(l){if(this._map.fire(l),l.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class za{constructor(l){this._map=l}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(l){this._map.fire(new Ui(l.type,this._map,l))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ui(\"contextmenu\",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(l){this._delayContextMenu?this._contextMenuEvent=l:this._ignoreContextMenu||this._map.fire(new Ui(l.type,this._map,l)),this._map.listens(\"contextmenu\")&&l.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ao{constructor(l){this._map=l}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(l){return this.transform.pointLocation(s.P.convert(l),this._map.terrain)}}class wf{constructor(l,f){this._map=l,this._tr=new ao(l),this._el=l.getCanvasContainer(),this._container=l.getContainer(),this._clickTolerance=f.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(l,f){this.isEnabled()&&l.shiftKey&&l.button===0&&(w.disableDrag(),this._startPos=this._lastPos=f,this._active=!0)}mousemoveWindow(l,f){if(!this._active)return;let v=f;if(this._lastPos.equals(v)||!this._box&&v.dist(this._startPos)<this._clickTolerance)return;let b=this._startPos;this._lastPos=v,this._box||(this._box=w.create(\"div\",\"maplibregl-boxzoom\",this._container),this._container.classList.add(\"maplibregl-crosshair\"),this._fireEvent(\"boxzoomstart\",l));let M=Math.min(b.x,v.x),O=Math.max(b.x,v.x),F=Math.min(b.y,v.y),U=Math.max(b.y,v.y);w.setTransform(this._box,`translate(${M}px,${F}px)`),this._box.style.width=O-M+\"px\",this._box.style.height=U-F+\"px\"}mouseupWindow(l,f){if(!this._active||l.button!==0)return;let v=this._startPos,b=f;if(this.reset(),w.suppressClick(),v.x!==b.x||v.y!==b.y)return this._map.fire(new s.k(\"boxzoomend\",{originalEvent:l})),{cameraAnimation:M=>M.fitScreenCoordinates(v,b,this._tr.bearing,{linear:!0})};this._fireEvent(\"boxzoomcancel\",l)}keydown(l){this._active&&l.keyCode===27&&(this.reset(),this._fireEvent(\"boxzoomcancel\",l))}reset(){this._active=!1,this._container.classList.remove(\"maplibregl-crosshair\"),this._box&&(w.remove(this._box),this._box=null),w.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(l,f){return this._map.fire(new s.k(l,{originalEvent:f}))}}function Es(T,l){if(T.length!==l.length)throw new Error(`The number of touches and points are not equal - touches ${T.length}, points ${l.length}`);let f={};for(let v=0;v<T.length;v++)f[T[v].identifier]=l[v];return f}class Sf{constructor(l){this.reset(),this.numTouches=l.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(l,f,v){(this.centroid||v.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=l.timeStamp),v.length===this.numTouches&&(this.centroid=function(b){let M=new s.P(0,0);for(let O of b)M._add(O);return M.div(b.length)}(f),this.touches=Es(v,f)))}touchmove(l,f,v){if(this.aborted||!this.centroid)return;let b=Es(v,f);for(let M in this.touches){let O=b[M];(!O||O.dist(this.touches[M])>30)&&(this.aborted=!0)}}touchend(l,f,v){if((!this.centroid||l.timeStamp-this.startTime>500)&&(this.aborted=!0),v.length===0){let b=!this.aborted&&this.centroid;if(this.reset(),b)return b}}}class tA{constructor(l){this.singleTap=new Sf(l),this.numTaps=l.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(l,f,v){this.singleTap.touchstart(l,f,v)}touchmove(l,f,v){this.singleTap.touchmove(l,f,v)}touchend(l,f,v){let b=this.singleTap.touchend(l,f,v);if(b){let M=l.timeStamp-this.lastTime<500,O=!this.lastTap||this.lastTap.dist(b)<30;if(M&&O||this.reset(),this.count++,this.lastTime=l.timeStamp,this.lastTap=b,this.count===this.numTaps)return this.reset(),b}}}class eA{constructor(l){this._tr=new ao(l),this._zoomIn=new tA({numTouches:1,numTaps:2}),this._zoomOut=new tA({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(l,f,v){this._zoomIn.touchstart(l,f,v),this._zoomOut.touchstart(l,f,v)}touchmove(l,f,v){this._zoomIn.touchmove(l,f,v),this._zoomOut.touchmove(l,f,v)}touchend(l,f,v){let b=this._zoomIn.touchend(l,f,v),M=this._zoomOut.touchend(l,f,v),O=this._tr;return b?(this._active=!0,l.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:F=>F.easeTo({duration:300,zoom:O.zoom+1,around:O.unproject(b)},{originalEvent:l})}):M?(this._active=!0,l.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:F=>F.easeTo({duration:300,zoom:O.zoom-1,around:O.unproject(M)},{originalEvent:l})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class al{constructor(l){this._enabled=!!l.enable,this._moveStateManager=l.moveStateManager,this._clickTolerance=l.clickTolerance||1,this._moveFunction=l.move,this._activateOnStart=!!l.activateOnStart,l.assignEvents(this),this.reset()}reset(l){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(l)}_move(...l){let f=this._moveFunction(...l);if(f.bearingDelta||f.pitchDelta||f.around||f.panDelta)return this._active=!0,f}dragStart(l,f){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(l)&&(this._moveStateManager.startMove(l),this._lastPoint=f.length?f[0]:f,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(l,f){if(!this.isEnabled())return;let v=this._lastPoint;if(!v)return;if(l.preventDefault(),!this._moveStateManager.isValidMoveEvent(l))return void this.reset(l);let b=f.length?f[0]:f;return!this._moved&&b.dist(v)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=b,this._move(v,b))}dragEnd(l){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(l)&&(this._moved&&w.suppressClick(),this.reset(l))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let kc={0:1,2:2};class _u{constructor(l){this._correctEvent=l.checkCorrectEvent}startMove(l){let f=w.mouseButton(l);this._eventButton=f}endMove(l){delete this._eventButton}isValidStartEvent(l){return this._correctEvent(l)}isValidMoveEvent(l){return!function(f,v){let b=kc[v];return f.buttons===void 0||(f.buttons&b)!==b}(l,this._eventButton)}isValidEndEvent(l){return w.mouseButton(l)===this._eventButton}}class zl{constructor(){this._firstTouch=void 0}_isOneFingerTouch(l){return l.targetTouches.length===1}_isSameTouchEvent(l){return l.targetTouches[0].identifier===this._firstTouch}startMove(l){this._firstTouch=l.targetTouches[0].identifier}endMove(l){delete this._firstTouch}isValidStartEvent(l){return this._isOneFingerTouch(l)}isValidMoveEvent(l){return this._isOneFingerTouch(l)&&this._isSameTouchEvent(l)}isValidEndEvent(l){return this._isOneFingerTouch(l)&&this._isSameTouchEvent(l)}}let Fe=T=>{T.mousedown=T.dragStart,T.mousemoveWindow=T.dragMove,T.mouseup=T.dragEnd,T.contextmenu=function(l){l.preventDefault()}},Xm=({enable:T,clickTolerance:l,bearingDegreesPerPixelMoved:f=.8})=>{let v=new _u({checkCorrectEvent:b=>w.mouseButton(b)===0&&b.ctrlKey||w.mouseButton(b)===2});return new al({clickTolerance:l,move:(b,M)=>({bearingDelta:(M.x-b.x)*f}),moveStateManager:v,enable:T,assignEvents:Fe})},Tf=({enable:T,clickTolerance:l,pitchDegreesPerPixelMoved:f=-.5})=>{let v=new _u({checkCorrectEvent:b=>w.mouseButton(b)===0&&b.ctrlKey||w.mouseButton(b)===2});return new al({clickTolerance:l,move:(b,M)=>({pitchDelta:(M.y-b.y)*f}),moveStateManager:v,enable:T,assignEvents:Fe})};class Mf{constructor(l,f){this._clickTolerance=l.clickTolerance||1,this._map=f,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new s.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(l,f,v){return this._calculateTransform(l,f,v)}touchmove(l,f,v){if(this._active&&!(v.length<this.minTouchs()))return l.preventDefault(),this._calculateTransform(l,f,v)}touchend(l,f,v){this._calculateTransform(l,f,v),this._active&&v.length<this.minTouchs()&&this.reset()}touchcancel(){this.reset()}_calculateTransform(l,f,v){v.length>0&&(this._active=!0);let b=Es(v,f),M=new s.P(0,0),O=new s.P(0,0),F=0;for(let W in b){let $=b[W],X=this._touches[W];X&&(M._add($),O._add($.sub(X)),F++,b[W]=$)}if(this._touches=b,F<this.minTouchs()||!O.mag())return;let U=O.div(F);return this._sum._add(U),this._sum.mag()<this._clickTolerance?void 0:{around:M.div(F),panDelta:U}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class rA{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(l,f,v){this._firstTwoTouches||v.length<2||(this._firstTwoTouches=[v[0].identifier,v[1].identifier],this._start([f[0],f[1]]))}touchmove(l,f,v){if(!this._firstTwoTouches)return;l.preventDefault();let[b,M]=this._firstTwoTouches,O=Ce(v,f,b),F=Ce(v,f,M);if(!O||!F)return;let U=this._aroundCenter?null:O.add(F).div(2);return this._move([O,F],U,l)}touchend(l,f,v){if(!this._firstTwoTouches)return;let[b,M]=this._firstTwoTouches,O=Ce(v,f,b),F=Ce(v,f,M);O&&F||(this._active&&w.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(l){this._enabled=!0,this._aroundCenter=!!l&&l.around===\"center\"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Ce(T,l,f){for(let v=0;v<T.length;v++)if(T[v].identifier===f)return l[v]}function iA(T,l){return Math.log(T/l)/Math.LN2}class Ef extends rA{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(l){this._startDistance=this._distance=l[0].dist(l[1])}_move(l,f){let v=this._distance;if(this._distance=l[0].dist(l[1]),this._active||!(Math.abs(iA(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:iA(this._distance,v),pinchAround:f}}}function a_(T,l){return 180*T.angleWith(l)/Math.PI}class Cd extends rA{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(l){this._startVector=this._vector=l[0].sub(l[1]),this._minDiameter=l[0].dist(l[1])}_move(l,f,v){let b=this._vector;if(this._vector=l[0].sub(l[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:a_(this._vector,b),pinchAround:f}}_isBelowThreshold(l){this._minDiameter=Math.min(this._minDiameter,l.mag());let f=25/(Math.PI*this._minDiameter)*360,v=a_(l,this._startVector);return Math.abs(v)<f}}function Ld(T){return Math.abs(T.y)>Math.abs(T.x)}class yu extends rA{constructor(l){super(),this._currentTouchCount=0,this._map=l}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(l,f,v){super.touchstart(l,f,v),this._currentTouchCount=v.length}_start(l){this._lastPoints=l,Ld(l[0].sub(l[1]))&&(this._valid=!1)}_move(l,f,v){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let b=l[0].sub(this._lastPoints[0]),M=l[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(b,M,v.timeStamp),this._valid?(this._lastPoints=l,this._active=!0,{pitchDelta:(b.y+M.y)/2*-.5}):void 0}gestureBeginsVertically(l,f,v){if(this._valid!==void 0)return this._valid;let b=l.mag()>=2,M=f.mag()>=2;if(!b&&!M)return;if(!b||!M)return this._firstMove===void 0&&(this._firstMove=v),v-this._firstMove<100&&void 0;let O=l.y>0==f.y>0;return Ld(l)&&Ld(f)&&O}}let Tx={panStep:100,bearingStep:15,pitchStep:10};class Km{constructor(l){this._tr=new ao(l);let f=Tx;this._panStep=f.panStep,this._bearingStep=f.bearingStep,this._pitchStep=f.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(l){if(l.altKey||l.ctrlKey||l.metaKey)return;let f=0,v=0,b=0,M=0,O=0;switch(l.keyCode){case 61:case 107:case 171:case 187:f=1;break;case 189:case 109:case 173:f=-1;break;case 37:l.shiftKey?v=-1:(l.preventDefault(),M=-1);break;case 39:l.shiftKey?v=1:(l.preventDefault(),M=1);break;case 38:l.shiftKey?b=1:(l.preventDefault(),O=-1);break;case 40:l.shiftKey?b=-1:(l.preventDefault(),O=1);break;default:return}return this._rotationDisabled&&(v=0,b=0),{cameraAnimation:F=>{let U=this._tr;F.easeTo({duration:300,easeId:\"keyboardHandler\",easing:vu,zoom:f?Math.round(U.zoom)+f*(l.shiftKey?2:1):U.zoom,bearing:U.bearing+v*this._bearingStep,pitch:U.pitch+b*this._pitchStep,offset:[-M*this._panStep,-O*this._panStep],center:U.center},{originalEvent:l})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function vu(T){return T*(2-T)}let ki=4.000244140625;class Nl{constructor(l,f){this._onTimeout=v=>{this._type=\"wheel\",this._delta-=this._lastValue,this._active||this._start(v)},this._map=l,this._tr=new ao(l),this._triggerRenderFrame=f,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(l){this._defaultZoomRate=l}setWheelZoomRate(l){this._wheelZoomRate=l}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(l){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!l&&l.around===\"center\")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(l){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!l[this._map.cooperativeGestures._bypassKey])return;let f=l.deltaMode===WheelEvent.DOM_DELTA_LINE?40*l.deltaY:l.deltaY,v=_.now(),b=v-(this._lastWheelEventTime||0);this._lastWheelEventTime=v,f!==0&&f%ki==0?this._type=\"wheel\":f!==0&&Math.abs(f)<4?this._type=\"trackpad\":b>400?(this._type=null,this._lastValue=f,this._timeout=setTimeout(this._onTimeout,40,l)):this._type||(this._type=Math.abs(b*f)<200?\"trackpad\":\"wheel\",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,f+=this._lastValue)),l.shiftKey&&f&&(f/=4),this._type&&(this._lastWheelEvent=l,this._delta-=f,this._active||this._start(l)),l.preventDefault()}_start(l){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let f=w.mousePos(this._map.getCanvas(),l),v=this._tr;this._around=f.y>v.transform.height/2-v.transform.getHorizon()?s.M.convert(this._aroundCenter?v.center:v.unproject(f)):s.M.convert(v.center),this._aroundPoint=v.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let l=this._tr.transform;if(this._delta!==0){let F=this._type===\"wheel\"&&Math.abs(this._delta)>ki?this._wheelZoomRate:this._defaultZoomRate,U=2/(1+Math.exp(-Math.abs(this._delta*F)));this._delta<0&&U!==0&&(U=1/U);let W=typeof this._targetZoom==\"number\"?l.zoomScale(this._targetZoom):l.scale;this._targetZoom=Math.min(l.maxZoom,Math.max(l.minZoom,l.scaleZoom(W*U))),this._type===\"wheel\"&&(this._startZoom=l.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let f=typeof this._targetZoom==\"number\"?this._targetZoom:l.zoom,v=this._startZoom,b=this._easing,M,O=!1;if(this._type===\"wheel\"&&v&&b){let F=Math.min((_.now()-this._lastWheelEventTime)/200,1),U=b(F);M=s.z.number(v,f,U),F<1?this._frameId||(this._frameId=!0):O=!0}else M=f,O=!0;return this._active=!0,O&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!O,zoomDelta:M-l.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(l){let f=s.b6;if(this._prevEase){let v=this._prevEase,b=(_.now()-v.start)/v.duration,M=v.easing(b+.01)-v.easing(b),O=.27/Math.sqrt(M*M+1e-4)*.01,F=Math.sqrt(.0729-O*O);f=s.b5(O,F,.25,1)}return this._prevEase={start:_.now(),duration:l,easing:f},f}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class nA{constructor(l,f){this._clickZoom=l,this._tapZoom=f}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Pf{constructor(l){this._tr=new ao(l),this.reset()}reset(){this._active=!1}dblclick(l,f){return l.preventDefault(),{cameraAnimation:v=>{v.easeTo({duration:300,zoom:this._tr.zoom+(l.shiftKey?-1:1),around:this._tr.unproject(f)},{originalEvent:l})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class l_{constructor(){this._tap=new tA({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(l,f,v){if(!this._swipePoint)if(this._tapTime){let b=f[0],M=l.timeStamp-this._tapTime<500,O=this._tapPoint.dist(b)<30;M&&O?v.length>0&&(this._swipePoint=b,this._swipeTouch=v[0].identifier):this.reset()}else this._tap.touchstart(l,f,v)}touchmove(l,f,v){if(this._tapTime){if(this._swipePoint){if(v[0].identifier!==this._swipeTouch)return;let b=f[0],M=b.y-this._swipePoint.y;return this._swipePoint=b,l.preventDefault(),this._active=!0,{zoomDelta:M/128}}}else this._tap.touchmove(l,f,v)}touchend(l,f,v){if(this._tapTime)this._swipePoint&&v.length===0&&this.reset();else{let b=this._tap.touchend(l,f,v);b&&(this._tapTime=l.timeStamp,this._tapPoint=b)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Jm{constructor(l,f,v){this._el=l,this._mousePan=f,this._touchPan=v}enable(l){this._inertiaOptions=l||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add(\"maplibregl-touch-drag-pan\")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove(\"maplibregl-touch-drag-pan\")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class c_{constructor(l,f,v){this._pitchWithRotate=l.pitchWithRotate,this._mouseRotate=f,this._mousePitch=v}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class ll{constructor(l,f,v,b){this._el=l,this._touchZoom=f,this._touchRotate=v,this._tapDragZoom=b,this._rotationDisabled=!1,this._enabled=!0}enable(l){this._touchZoom.enable(l),this._rotationDisabled||this._touchRotate.enable(l),this._tapDragZoom.enable(),this._el.classList.add(\"maplibregl-touch-zoom-rotate\")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove(\"maplibregl-touch-zoom-rotate\")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class kd{constructor(l,f){this._bypassKey=navigator.userAgent.indexOf(\"Mac\")!==-1?\"metaKey\":\"ctrlKey\",this._map=l,this._options=f,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let l=this._map.getCanvasContainer();l.classList.add(\"maplibregl-cooperative-gestures\"),this._container=w.create(\"div\",\"maplibregl-cooperative-gesture-screen\",l);let f=this._map._getUIString(\"CooperativeGesturesHandler.WindowsHelpText\");this._bypassKey===\"metaKey\"&&(f=this._map._getUIString(\"CooperativeGesturesHandler.MacHelpText\"));let v=this._map._getUIString(\"CooperativeGesturesHandler.MobileHelpText\"),b=document.createElement(\"div\");b.className=\"maplibregl-desktop-message\",b.textContent=f,this._container.appendChild(b);let M=document.createElement(\"div\");M.className=\"maplibregl-mobile-message\",M.textContent=v,this._container.appendChild(M),this._container.setAttribute(\"aria-hidden\",\"true\")}_destoryUI(){this._container&&(w.remove(this._container),this._map.getCanvasContainer().classList.remove(\"maplibregl-cooperative-gestures\")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destoryUI()}isEnabled(){return this._enabled}touchmove(l){this._onCooperativeGesture(l.touches.length===1)}wheel(l){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!l[this._bypassKey])}_onCooperativeGesture(l){this._enabled&&l&&(this._container.classList.add(\"maplibregl-show\"),setTimeout(()=>{this._container.classList.remove(\"maplibregl-show\")},100))}}let Qe=T=>T.zoom||T.drag||T.pitch||T.rotate;class fr extends s.k{}function If(T){return T.panDelta&&T.panDelta.mag()||T.zoomDelta||T.bearingDelta||T.pitchDelta}class xu{constructor(l,f){this.handleWindowEvent=b=>{this.handleEvent(b,`${b.type}Window`)},this.handleEvent=(b,M)=>{if(b.type===\"blur\")return void this.stop(!0);this._updatingCamera=!0;let O=b.type===\"renderFrame\"?void 0:b,F={needsRenderFrame:!1},U={},W={},$=b.touches,X=$?this._getMapTouches($):void 0,at=X?w.touchPos(this._map.getCanvas(),X):w.mousePos(this._map.getCanvas(),b);for(let{handlerName:yt,handler:At,allowed:kt}of this._handlers){if(!At.isEnabled())continue;let Wt;this._blockedByActive(W,kt,yt)?At.reset():At[M||b.type]&&(Wt=At[M||b.type](b,at,X),this.mergeHandlerResult(F,U,Wt,yt,O),Wt&&Wt.needsRenderFrame&&this._triggerRenderFrame()),(Wt||At.isActive())&&(W[yt]=At)}let gt={};for(let yt in this._previousActiveHandlers)W[yt]||(gt[yt]=O);this._previousActiveHandlers=W,(Object.keys(gt).length||If(F))&&(this._changes.push([F,U,gt]),this._triggerRenderFrame()),(Object.keys(W).length||If(F))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:_t}=F;_t&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],_t(this._map))},this._map=l,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new o_(l),this._bearingSnap=f.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(f);let v=this._el;this._listeners=[[v,\"touchstart\",{passive:!0}],[v,\"touchmove\",{passive:!1}],[v,\"touchend\",void 0],[v,\"touchcancel\",void 0],[v,\"mousedown\",void 0],[v,\"mousemove\",void 0],[v,\"mouseup\",void 0],[document,\"mousemove\",{capture:!0}],[document,\"mouseup\",void 0],[v,\"mouseover\",void 0],[v,\"mouseout\",void 0],[v,\"dblclick\",void 0],[v,\"click\",void 0],[v,\"keydown\",{capture:!1}],[v,\"keyup\",void 0],[v,\"wheel\",{passive:!1}],[v,\"contextmenu\",void 0],[window,\"blur\",void 0]];for(let[b,M,O]of this._listeners)w.addEventListener(b,M,b===document?this.handleWindowEvent:this.handleEvent,O)}destroy(){for(let[l,f,v]of this._listeners)w.removeEventListener(l,f,l===document?this.handleWindowEvent:this.handleEvent,v)}_addDefaultHandlers(l){let f=this._map,v=f.getCanvasContainer();this._add(\"mapEvent\",new Id(f,l));let b=f.boxZoom=new wf(f,l);this._add(\"boxZoom\",b),l.interactive&&l.boxZoom&&b.enable();let M=f.cooperativeGestures=new kd(f,l.cooperativeGestures);this._add(\"cooperativeGestures\",M),l.cooperativeGestures&&M.enable();let O=new eA(f),F=new Pf(f);f.doubleClickZoom=new nA(F,O),this._add(\"tapZoom\",O),this._add(\"clickZoom\",F),l.interactive&&l.doubleClickZoom&&f.doubleClickZoom.enable();let U=new l_;this._add(\"tapDragZoom\",U);let W=f.touchPitch=new yu(f);this._add(\"touchPitch\",W),l.interactive&&l.touchPitch&&f.touchPitch.enable(l.touchPitch);let $=Xm(l),X=Tf(l);f.dragRotate=new c_(l,$,X),this._add(\"mouseRotate\",$,[\"mousePitch\"]),this._add(\"mousePitch\",X,[\"mouseRotate\"]),l.interactive&&l.dragRotate&&f.dragRotate.enable();let at=(({enable:Wt,clickTolerance:St})=>{let Nt=new _u({checkCorrectEvent:Zt=>w.mouseButton(Zt)===0&&!Zt.ctrlKey});return new al({clickTolerance:St,move:(Zt,Ht)=>({around:Ht,panDelta:Ht.sub(Zt)}),activateOnStart:!0,moveStateManager:Nt,enable:Wt,assignEvents:Fe})})(l),gt=new Mf(l,f);f.dragPan=new Jm(v,at,gt),this._add(\"mousePan\",at),this._add(\"touchPan\",gt,[\"touchZoom\",\"touchRotate\"]),l.interactive&&l.dragPan&&f.dragPan.enable(l.dragPan);let _t=new Cd,yt=new Ef;f.touchZoomRotate=new ll(v,yt,_t,U),this._add(\"touchRotate\",_t,[\"touchPan\",\"touchZoom\"]),this._add(\"touchZoom\",yt,[\"touchPan\",\"touchRotate\"]),l.interactive&&l.touchZoomRotate&&f.touchZoomRotate.enable(l.touchZoomRotate);let At=f.scrollZoom=new Nl(f,()=>this._triggerRenderFrame());this._add(\"scrollZoom\",At,[\"mousePan\"]),l.interactive&&l.scrollZoom&&f.scrollZoom.enable(l.scrollZoom);let kt=f.keyboard=new Km(f);this._add(\"keyboard\",kt),l.interactive&&l.keyboard&&f.keyboard.enable(),this._add(\"blockableMapEvent\",new za(f))}_add(l,f,v){this._handlers.push({handlerName:l,handler:f,allowed:v}),this._handlersById[l]=f}stop(l){if(!this._updatingCamera){for(let{handler:f}of this._handlers)f.reset();this._inertia.clear(),this._fireEvents({},{},l),this._changes=[]}}isActive(){for(let{handler:l}of this._handlers)if(l.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Qe(this._eventsInProgress)||this.isZooming()}_blockedByActive(l,f,v){for(let b in l)if(b!==v&&(!f||f.indexOf(b)<0))return!0;return!1}_getMapTouches(l){let f=[];for(let v of l)this._el.contains(v.target)&&f.push(v);return f}mergeHandlerResult(l,f,v,b,M){if(!v)return;s.e(l,v);let O={handlerName:b,originalEvent:v.originalEvent||M};v.zoomDelta!==void 0&&(f.zoom=O),v.panDelta!==void 0&&(f.drag=O),v.pitchDelta!==void 0&&(f.pitch=O),v.bearingDelta!==void 0&&(f.rotate=O)}_applyChanges(){let l={},f={},v={};for(let[b,M,O]of this._changes)b.panDelta&&(l.panDelta=(l.panDelta||new s.P(0,0))._add(b.panDelta)),b.zoomDelta&&(l.zoomDelta=(l.zoomDelta||0)+b.zoomDelta),b.bearingDelta&&(l.bearingDelta=(l.bearingDelta||0)+b.bearingDelta),b.pitchDelta&&(l.pitchDelta=(l.pitchDelta||0)+b.pitchDelta),b.around!==void 0&&(l.around=b.around),b.pinchAround!==void 0&&(l.pinchAround=b.pinchAround),b.noInertia&&(l.noInertia=b.noInertia),s.e(f,M),s.e(v,O);this._updateMapTransform(l,f,v),this._changes=[]}_updateMapTransform(l,f,v){let b=this._map,M=b._getTransformForUpdate(),O=b.terrain;if(!(If(l)||O&&this._terrainMovement))return this._fireEvents(f,v,!0);let{panDelta:F,zoomDelta:U,bearingDelta:W,pitchDelta:$,around:X,pinchAround:at}=l;at!==void 0&&(X=at),b._stop(!0),X=X||b.transform.centerPoint;let gt=M.pointLocation(F?X.sub(F):X);W&&(M.bearing+=W),$&&(M.pitch+=$),U&&(M.zoom+=U),O?this._terrainMovement||!f.drag&&!f.zoom?f.drag&&this._terrainMovement?M.center=M.pointLocation(M.centerPoint.sub(F)):M.setLocationAtPoint(gt,X):(this._terrainMovement=!0,this._map._elevationFreeze=!0,M.setLocationAtPoint(gt,X),this._map.once(\"moveend\",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,M.recalculateZoom(b.terrain)})):M.setLocationAtPoint(gt,X),b._applyUpdatedTransform(M),this._map._update(),l.noInertia||this._inertia.record(l),this._fireEvents(f,v,!0)}_fireEvents(l,f,v){let b=Qe(this._eventsInProgress),M=Qe(l),O={};for(let $ in l){let{originalEvent:X}=l[$];this._eventsInProgress[$]||(O[`${$}start`]=X),this._eventsInProgress[$]=l[$]}!b&&M&&this._fireEvent(\"movestart\",M.originalEvent);for(let $ in O)this._fireEvent($,O[$]);M&&this._fireEvent(\"move\",M.originalEvent);for(let $ in l){let{originalEvent:X}=l[$];this._fireEvent($,X)}let F={},U;for(let $ in this._eventsInProgress){let{handlerName:X,originalEvent:at}=this._eventsInProgress[$];this._handlersById[X].isActive()||(delete this._eventsInProgress[$],U=f[X]||at,F[`${$}end`]=U)}for(let $ in F)this._fireEvent($,F[$]);let W=Qe(this._eventsInProgress);if(v&&(b||M)&&!W){this._updatingCamera=!0;let $=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),X=at=>at!==0&&-this._bearingSnap<at&&at<this._bearingSnap;!$||!$.essential&&_.prefersReducedMotion?(this._map.fire(new s.k(\"moveend\",{originalEvent:U})),X(this._map.getBearing())&&this._map.resetNorth()):(X($.bearing||this._map.getBearing())&&($.bearing=0),$.freezeElevation=!0,this._map.easeTo($,{originalEvent:U})),this._updatingCamera=!1}}_fireEvent(l,f){this._map.fire(new s.k(l,f?{originalEvent:f}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(l=>{delete this._frameId,this.handleEvent(new fr(\"renderFrame\",{timeStamp:l})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class t0 extends s.E{constructor(l,f){super(),this._renderFrameCallback=()=>{let v=Math.min((_.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(v)),v<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=l,this._bearingSnap=f.bearingSnap,this.on(\"moveend\",()=>{delete this._requestedCameraState})}getCenter(){return new s.M(this.transform.center.lng,this.transform.center.lat)}setCenter(l,f){return this.jumpTo({center:l},f)}panBy(l,f,v){return l=s.P.convert(l).mult(-1),this.panTo(this.transform.center,s.e({offset:l},f),v)}panTo(l,f,v){return this.easeTo(s.e({center:l},f),v)}getZoom(){return this.transform.zoom}setZoom(l,f){return this.jumpTo({zoom:l},f),this}zoomTo(l,f,v){return this.easeTo(s.e({zoom:l},f),v)}zoomIn(l,f){return this.zoomTo(this.getZoom()+1,l,f),this}zoomOut(l,f){return this.zoomTo(this.getZoom()-1,l,f),this}getBearing(){return this.transform.bearing}setBearing(l,f){return this.jumpTo({bearing:l},f),this}getPadding(){return this.transform.padding}setPadding(l,f){return this.jumpTo({padding:l},f),this}rotateTo(l,f,v){return this.easeTo(s.e({bearing:l},f),v)}resetNorth(l,f){return this.rotateTo(0,s.e({duration:1e3},l),f),this}resetNorthPitch(l,f){return this.easeTo(s.e({bearing:0,pitch:0,duration:1e3},l),f),this}snapToNorth(l,f){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(l,f):this}getPitch(){return this.transform.pitch}setPitch(l,f){return this.jumpTo({pitch:l},f),this}cameraForBounds(l,f){l=an.convert(l);let v=f&&f.bearing||0;return this._cameraForBoxAndBearing(l.getNorthWest(),l.getSouthEast(),v,f)}_cameraForBoxAndBearing(l,f,v,b){let M={top:0,bottom:0,right:0,left:0};if(typeof(b=s.e({padding:M,offset:[0,0],maxZoom:this.transform.maxZoom},b)).padding==\"number\"){let Ue=b.padding;b.padding={top:Ue,bottom:Ue,right:Ue,left:Ue}}b.padding=s.e(M,b.padding);let O=this.transform,F=O.padding,U=new an(l,f),W=O.project(U.getNorthWest()),$=O.project(U.getNorthEast()),X=O.project(U.getSouthEast()),at=O.project(U.getSouthWest()),gt=s.b7(-v),_t=W.rotate(gt),yt=$.rotate(gt),At=X.rotate(gt),kt=at.rotate(gt),Wt=new s.P(Math.max(_t.x,yt.x,kt.x,At.x),Math.max(_t.y,yt.y,kt.y,At.y)),St=new s.P(Math.min(_t.x,yt.x,kt.x,At.x),Math.min(_t.y,yt.y,kt.y,At.y)),Nt=Wt.sub(St),Zt=(O.width-(F.left+F.right+b.padding.left+b.padding.right))/Nt.x,Ht=(O.height-(F.top+F.bottom+b.padding.top+b.padding.bottom))/Nt.y;if(Ht<0||Zt<0)return void s.w(\"Map cannot fit within canvas with the given bounds, padding, and/or offset.\");let ne=Math.min(O.scaleZoom(O.scale*Math.min(Zt,Ht)),b.maxZoom),he=s.P.convert(b.offset),ce=new s.P((b.padding.left-b.padding.right)/2,(b.padding.top-b.padding.bottom)/2).rotate(s.b7(v)),ge=he.add(ce).mult(O.scale/O.zoomScale(ne));return{center:O.unproject(W.add(X).div(2).sub(ge)),zoom:ne,bearing:v}}fitBounds(l,f,v){return this._fitInternal(this.cameraForBounds(l,f),f,v)}fitScreenCoordinates(l,f,v,b,M){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(s.P.convert(l)),this.transform.pointLocation(s.P.convert(f)),v,b),b,M)}_fitInternal(l,f,v){return l?(delete(f=s.e(l,f)).padding,f.linear?this.easeTo(f,v):this.flyTo(f,v)):this}jumpTo(l,f){this.stop();let v=this._getTransformForUpdate(),b=!1,M=!1,O=!1;return\"zoom\"in l&&v.zoom!==+l.zoom&&(b=!0,v.zoom=+l.zoom),l.center!==void 0&&(v.center=s.M.convert(l.center)),\"bearing\"in l&&v.bearing!==+l.bearing&&(M=!0,v.bearing=+l.bearing),\"pitch\"in l&&v.pitch!==+l.pitch&&(O=!0,v.pitch=+l.pitch),l.padding==null||v.isPaddingEqual(l.padding)||(v.padding=l.padding),this._applyUpdatedTransform(v),this.fire(new s.k(\"movestart\",f)).fire(new s.k(\"move\",f)),b&&this.fire(new s.k(\"zoomstart\",f)).fire(new s.k(\"zoom\",f)).fire(new s.k(\"zoomend\",f)),M&&this.fire(new s.k(\"rotatestart\",f)).fire(new s.k(\"rotate\",f)).fire(new s.k(\"rotateend\",f)),O&&this.fire(new s.k(\"pitchstart\",f)).fire(new s.k(\"pitch\",f)).fire(new s.k(\"pitchend\",f)),this.fire(new s.k(\"moveend\",f))}calculateCameraOptionsFromTo(l,f,v,b=0){let M=s.Y.fromLngLat(l,f),O=s.Y.fromLngLat(v,b),F=O.x-M.x,U=O.y-M.y,W=O.z-M.z,$=Math.hypot(F,U,W);if($===0)throw new Error(\"Can't calculate camera options with same From and To\");let X=Math.hypot(F,U),at=this.transform.scaleZoom(this.transform.cameraToCenterDistance/$/this.transform.tileSize),gt=180*Math.atan2(F,-U)/Math.PI,_t=180*Math.acos(X/$)/Math.PI;return _t=W<0?90-_t:90+_t,{center:O.toLngLat(),zoom:at,pitch:_t,bearing:gt}}easeTo(l,f){this._stop(!1,l.easeId),((l=s.e({offset:[0,0],duration:500,easing:s.b6},l)).animate===!1||!l.essential&&_.prefersReducedMotion)&&(l.duration=0);let v=this._getTransformForUpdate(),b=this.getZoom(),M=this.getBearing(),O=this.getPitch(),F=this.getPadding(),U=\"zoom\"in l?+l.zoom:b,W=\"bearing\"in l?this._normalizeBearing(l.bearing,M):M,$=\"pitch\"in l?+l.pitch:O,X=\"padding\"in l?l.padding:v.padding,at=s.P.convert(l.offset),gt=v.centerPoint.add(at),_t=v.pointLocation(gt),yt=s.M.convert(l.center||_t);this._normalizeCenter(yt);let At=v.project(_t),kt=v.project(yt).sub(At),Wt=v.zoomScale(U-b),St,Nt;l.around&&(St=s.M.convert(l.around),Nt=v.locationPoint(St));let Zt={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||U!==b,this._rotating=this._rotating||M!==W,this._pitching=this._pitching||$!==O,this._padding=!v.isPaddingEqual(X),this._easeId=l.easeId,this._prepareEase(f,l.noMoveStart,Zt),this.terrain&&this._prepareElevation(yt),this._ease(Ht=>{if(this._zooming&&(v.zoom=s.z.number(b,U,Ht)),this._rotating&&(v.bearing=s.z.number(M,W,Ht)),this._pitching&&(v.pitch=s.z.number(O,$,Ht)),this._padding&&(v.interpolatePadding(F,X,Ht),gt=v.centerPoint.add(at)),this.terrain&&!l.freezeElevation&&this._updateElevation(Ht),St)v.setLocationAtPoint(St,Nt);else{let ne=v.zoomScale(v.zoom-b),he=U>b?Math.min(2,Wt):Math.max(.5,Wt),ce=Math.pow(he,1-Ht),ge=v.unproject(At.add(kt.mult(Ht*ce)).mult(ne));v.setLocationAtPoint(v.renderWorldCopies?ge.wrap():ge,gt)}this._applyUpdatedTransform(v),this._fireMoveEvents(f)},Ht=>{this.terrain&&this._finalizeElevation(),this._afterEase(f,Ht)},l),this}_prepareEase(l,f,v={}){this._moving=!0,f||v.moving||this.fire(new s.k(\"movestart\",l)),this._zooming&&!v.zooming&&this.fire(new s.k(\"zoomstart\",l)),this._rotating&&!v.rotating&&this.fire(new s.k(\"rotatestart\",l)),this._pitching&&!v.pitching&&this.fire(new s.k(\"pitchstart\",l))}_prepareElevation(l){this._elevationCenter=l,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(l,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(l){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let f=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(l<1&&f!==this._elevationTarget){let v=this._elevationTarget-this._elevationStart;this._elevationStart+=l*(v-(f-(v*l+this._elevationStart))/(1-l)),this._elevationTarget=f}this.transform.elevation=s.z.number(this._elevationStart,this._elevationTarget,l)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(l){if(!this.transformCameraUpdate)return;let f=l.clone(),{center:v,zoom:b,pitch:M,bearing:O,elevation:F}=this.transformCameraUpdate(f);v&&(f.center=v),b!==void 0&&(f.zoom=b),M!==void 0&&(f.pitch=M),O!==void 0&&(f.bearing=O),F!==void 0&&(f.elevation=F),this.transform.apply(f)}_fireMoveEvents(l){this.fire(new s.k(\"move\",l)),this._zooming&&this.fire(new s.k(\"zoom\",l)),this._rotating&&this.fire(new s.k(\"rotate\",l)),this._pitching&&this.fire(new s.k(\"pitch\",l))}_afterEase(l,f){if(this._easeId&&f&&this._easeId===f)return;delete this._easeId;let v=this._zooming,b=this._rotating,M=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,v&&this.fire(new s.k(\"zoomend\",l)),b&&this.fire(new s.k(\"rotateend\",l)),M&&this.fire(new s.k(\"pitchend\",l)),this.fire(new s.k(\"moveend\",l))}flyTo(l,f){if(!l.essential&&_.prefersReducedMotion){let He=s.L(l,[\"center\",\"zoom\",\"bearing\",\"pitch\",\"around\"]);return this.jumpTo(He,f)}this.stop(),l=s.e({offset:[0,0],speed:1.2,curve:1.42,easing:s.b6},l);let v=this._getTransformForUpdate(),b=this.getZoom(),M=this.getBearing(),O=this.getPitch(),F=this.getPadding(),U=\"zoom\"in l?s.ac(+l.zoom,v.minZoom,v.maxZoom):b,W=\"bearing\"in l?this._normalizeBearing(l.bearing,M):M,$=\"pitch\"in l?+l.pitch:O,X=\"padding\"in l?l.padding:v.padding,at=v.zoomScale(U-b),gt=s.P.convert(l.offset),_t=v.centerPoint.add(gt),yt=v.pointLocation(_t),At=s.M.convert(l.center||yt);this._normalizeCenter(At);let kt=v.project(yt),Wt=v.project(At).sub(kt),St=l.curve,Nt=Math.max(v.width,v.height),Zt=Nt/at,Ht=Wt.mag();if(\"minZoom\"in l){let He=s.ac(Math.min(l.minZoom,b,U),v.minZoom,v.maxZoom),rn=Nt/v.zoomScale(He-b);St=Math.sqrt(rn/Ht*2)}let ne=St*St;function he(He){let rn=(Zt*Zt-Nt*Nt+(He?-1:1)*ne*ne*Ht*Ht)/(2*(He?Zt:Nt)*ne*Ht);return Math.log(Math.sqrt(rn*rn+1)-rn)}function ce(He){return(Math.exp(He)-Math.exp(-He))/2}function ge(He){return(Math.exp(He)+Math.exp(-He))/2}let Ue=he(!1),ur=function(He){return ge(Ue)/ge(Ue+St*He)},Me=function(He){return Nt*((ge(Ue)*(ce(rn=Ue+St*He)/ge(rn))-ce(Ue))/ne)/Ht;var rn},ar=(he(!0)-Ue)/St;if(Math.abs(Ht)<1e-6||!isFinite(ar)){if(Math.abs(Nt-Zt)<1e-6)return this.easeTo(l,f);let He=Zt<Nt?-1:1;ar=Math.abs(Math.log(Zt/Nt))/St,Me=function(){return 0},ur=function(rn){return Math.exp(He*St*rn)}}return l.duration=\"duration\"in l?+l.duration:1e3*ar/(\"screenSpeed\"in l?+l.screenSpeed/St:+l.speed),l.maxDuration&&l.duration>l.maxDuration&&(l.duration=0),this._zooming=!0,this._rotating=M!==W,this._pitching=$!==O,this._padding=!v.isPaddingEqual(X),this._prepareEase(f,!1),this.terrain&&this._prepareElevation(At),this._ease(He=>{let rn=He*ar,Jr=1/ur(rn);v.zoom=He===1?U:b+v.scaleZoom(Jr),this._rotating&&(v.bearing=s.z.number(M,W,He)),this._pitching&&(v.pitch=s.z.number(O,$,He)),this._padding&&(v.interpolatePadding(F,X,He),_t=v.centerPoint.add(gt)),this.terrain&&!l.freezeElevation&&this._updateElevation(He);let Fr=He===1?At:v.unproject(kt.add(Wt.mult(Me(rn))).mult(Jr));v.setLocationAtPoint(v.renderWorldCopies?Fr.wrap():Fr,_t),this._applyUpdatedTransform(v),this._fireMoveEvents(f)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(f)},l),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(l,f){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let v=this._onEaseEnd;delete this._onEaseEnd,v.call(this,f)}if(!l){let v=this.handlers;v&&v.stop(!1)}return this}_ease(l,f,v){v.animate===!1||v.duration===0?(l(1),f()):(this._easeStart=_.now(),this._easeOptions=v,this._onEaseFrame=l,this._onEaseEnd=f,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(l,f){l=s.b0(l,-180,180);let v=Math.abs(l-f);return Math.abs(l-360-f)<v&&(l-=360),Math.abs(l+360-f)<v&&(l+=360),l}_normalizeCenter(l){let f=this.transform;if(!f.renderWorldCopies||f.lngRange)return;let v=l.lng-f.center.lng;l.lng+=v>180?-360:v<-180?360:0}queryTerrainElevation(l){return this.terrain?this.terrain.getElevationForLngLatZoom(s.M.convert(l),this.transform.tileZoom)-this.transform.elevation:null}}let wo={compact:!0,customAttribution:'<a href=\"https://maplibre.org/\" target=\"_blank\">MapLibre</a>'};class e0{constructor(l=wo){this._toggleAttribution=()=>{this._container.classList.contains(\"maplibregl-compact\")&&(this._container.classList.contains(\"maplibregl-compact-show\")?(this._container.setAttribute(\"open\",\"\"),this._container.classList.remove(\"maplibregl-compact-show\")):(this._container.classList.add(\"maplibregl-compact-show\"),this._container.removeAttribute(\"open\")))},this._updateData=f=>{!f||f.sourceDataType!==\"metadata\"&&f.sourceDataType!==\"visibility\"&&f.dataType!==\"style\"&&f.type!==\"terrain\"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute(\"open\",\"\"):this._container.classList.contains(\"maplibregl-compact\")||this._container.classList.contains(\"maplibregl-attrib-empty\")||(this._container.setAttribute(\"open\",\"\"),this._container.classList.add(\"maplibregl-compact\",\"maplibregl-compact-show\")):(this._container.setAttribute(\"open\",\"\"),this._container.classList.contains(\"maplibregl-compact\")&&this._container.classList.remove(\"maplibregl-compact\",\"maplibregl-compact-show\"))},this._updateCompactMinimize=()=>{this._container.classList.contains(\"maplibregl-compact\")&&this._container.classList.contains(\"maplibregl-compact-show\")&&this._container.classList.remove(\"maplibregl-compact-show\")},this.options=l}getDefaultPosition(){return\"bottom-right\"}onAdd(l){return this._map=l,this._compact=this.options.compact,this._container=w.create(\"details\",\"maplibregl-ctrl maplibregl-ctrl-attrib\"),this._compactButton=w.create(\"summary\",\"maplibregl-ctrl-attrib-button\",this._container),this._compactButton.addEventListener(\"click\",this._toggleAttribution),this._setElementTitle(this._compactButton,\"ToggleAttribution\"),this._innerContainer=w.create(\"div\",\"maplibregl-ctrl-attrib-inner\",this._container),this._updateAttributions(),this._updateCompact(),this._map.on(\"styledata\",this._updateData),this._map.on(\"sourcedata\",this._updateData),this._map.on(\"terrain\",this._updateData),this._map.on(\"resize\",this._updateCompact),this._map.on(\"drag\",this._updateCompactMinimize),this._container}onRemove(){w.remove(this._container),this._map.off(\"styledata\",this._updateData),this._map.off(\"sourcedata\",this._updateData),this._map.off(\"terrain\",this._updateData),this._map.off(\"resize\",this._updateCompact),this._map.off(\"drag\",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(l,f){let v=this._map._getUIString(`AttributionControl.${f}`);l.title=v,l.setAttribute(\"aria-label\",v)}_updateAttributions(){if(!this._map.style)return;let l=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?l=l.concat(this.options.customAttribution.map(b=>typeof b!=\"string\"?\"\":b)):typeof this.options.customAttribution==\"string\"&&l.push(this.options.customAttribution)),this._map.style.stylesheet){let b=this._map.style.stylesheet;this.styleOwner=b.owner,this.styleId=b.id}let f=this._map.style.sourceCaches;for(let b in f){let M=f[b];if(M.used||M.usedForTerrain){let O=M.getSource();O.attribution&&l.indexOf(O.attribution)<0&&l.push(O.attribution)}}l=l.filter(b=>String(b).trim()),l.sort((b,M)=>b.length-M.length),l=l.filter((b,M)=>{for(let O=M+1;O<l.length;O++)if(l[O].indexOf(b)>=0)return!1;return!0});let v=l.join(\" | \");v!==this._attribHTML&&(this._attribHTML=v,l.length?(this._innerContainer.innerHTML=v,this._container.classList.remove(\"maplibregl-attrib-empty\")):this._container.classList.add(\"maplibregl-attrib-empty\"),this._updateCompact(),this._editLink=null)}}class cl{constructor(l={}){this._updateCompact=()=>{let f=this._container.children;if(f.length){let v=f[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&v.classList.add(\"maplibregl-compact\"):v.classList.remove(\"maplibregl-compact\")}},this.options=l}getDefaultPosition(){return\"bottom-left\"}onAdd(l){this._map=l,this._compact=this.options&&this.options.compact,this._container=w.create(\"div\",\"maplibregl-ctrl\");let f=w.create(\"a\",\"maplibregl-ctrl-logo\");return f.target=\"_blank\",f.rel=\"noopener nofollow\",f.href=\"https://maplibre.org/\",f.setAttribute(\"aria-label\",this._map._getUIString(\"LogoControl.Title\")),f.setAttribute(\"rel\",\"noopener nofollow\"),this._container.appendChild(f),this._container.style.display=\"block\",this._map.on(\"resize\",this._updateCompact),this._updateCompact(),this._container}onRemove(){w.remove(this._container),this._map.off(\"resize\",this._updateCompact),this._map=void 0,this._compact=void 0}}class Mx{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(l){let f=++this._id;return this._queue.push({callback:l,id:f,cancelled:!1}),f}remove(l){let f=this._currentlyRunning,v=f?this._queue.concat(f):this._queue;for(let b of v)if(b.id===l)return void(b.cancelled=!0)}run(l=0){if(this._currentlyRunning)throw new Error(\"Attempting to run(), but is already running.\");let f=this._currentlyRunning=this._queue;this._queue=[];for(let v of f)if(!v.cancelled&&(v.callback(l),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Rd=s.X([{name:\"a_pos3d\",type:\"Int16\",components:3}]);class Tn extends s.E{constructor(l){super(),this.sourceCache=l,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,l.usedForTerrain=!0,l.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(l,f){this.sourceCache.update(l,f),this._renderableTilesKeys=[];let v={};for(let b of l.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:f}))v[b.key]=!0,this._renderableTilesKeys.push(b.key),this._tiles[b.key]||(b.posMatrix=new Float64Array(16),s.aN(b.posMatrix,0,s.W,0,s.W,0,1),this._tiles[b.key]=new Ho(b,this.tileSize));for(let b in this._tiles)v[b]||delete this._tiles[b]}freeRtt(l){for(let f in this._tiles){let v=this._tiles[f];(!l||v.tileID.equals(l)||v.tileID.isChildOf(l)||l.isChildOf(v.tileID))&&(v.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(l=>this.getTileByID(l))}getTileByID(l){return this._tiles[l]}getTerrainCoords(l){let f={};for(let v of this._renderableTilesKeys){let b=this._tiles[v].tileID;if(b.canonical.equals(l.canonical)){let M=l.clone();M.posMatrix=new Float64Array(16),s.aN(M.posMatrix,0,s.W,0,s.W,0,1),f[v]=M}else if(b.canonical.isChildOf(l.canonical)){let M=l.clone();M.posMatrix=new Float64Array(16);let O=b.canonical.z-l.canonical.z,F=b.canonical.x-(b.canonical.x>>O<<O),U=b.canonical.y-(b.canonical.y>>O<<O),W=s.W>>O;s.aN(M.posMatrix,0,W,0,W,0,1),s.H(M.posMatrix,M.posMatrix,[-F*W,-U*W,0]),f[v]=M}else if(l.canonical.isChildOf(b.canonical)){let M=l.clone();M.posMatrix=new Float64Array(16);let O=l.canonical.z-b.canonical.z,F=l.canonical.x-(l.canonical.x>>O<<O),U=l.canonical.y-(l.canonical.y>>O<<O),W=s.W>>O;s.aN(M.posMatrix,0,s.W,0,s.W,0,1),s.H(M.posMatrix,M.posMatrix,[F*W,U*W,0]),s.J(M.posMatrix,M.posMatrix,[1/2**O,1/2**O,0]),f[v]=M}}return f}getSourceTile(l,f){let v=this.sourceCache._source,b=l.overscaledZ-this.deltaZoom;if(b>v.maxzoom&&(b=v.maxzoom),b<v.minzoom)return null;this._sourceTileCache[l.key]||(this._sourceTileCache[l.key]=l.scaledTo(b).key);let M=this.sourceCache.getTileByID(this._sourceTileCache[l.key]);if((!M||!M.dem)&&f)for(;b>=v.minzoom&&(!M||!M.dem);)M=this.sourceCache.getTileByID(l.scaledTo(b--).key);return M}tilesAfterTime(l=Date.now()){return Object.values(this._tiles).filter(f=>f.timeAdded>=l)}}class Dn{constructor(l,f,v){this.painter=l,this.sourceCache=new Tn(f),this.options=v,this.exaggeration=typeof v.exaggeration==\"number\"?v.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(l,f,v,b=s.W){var M;if(!(f>=0&&f<b&&v>=0&&v<b))return 0;let O=this.getTerrainData(l),F=(M=O.tile)===null||M===void 0?void 0:M.dem;if(!F)return 0;let U=function(_t,yt,At){var kt=yt[0],Wt=yt[1];return _t[0]=At[0]*kt+At[4]*Wt+At[12],_t[1]=At[1]*kt+At[5]*Wt+At[13],_t}([],[f/b*s.W,v/b*s.W],O.u_terrain_matrix),W=[U[0]*F.dim,U[1]*F.dim],$=Math.floor(W[0]),X=Math.floor(W[1]),at=W[0]-$,gt=W[1]-X;return F.get($,X)*(1-at)*(1-gt)+F.get($+1,X)*at*(1-gt)+F.get($,X+1)*(1-at)*gt+F.get($+1,X+1)*at*gt}getElevationForLngLatZoom(l,f){let{tileID:v,mercatorX:b,mercatorY:M}=this._getOverscaledTileIDFromLngLatZoom(l,f);return this.getElevation(v,b%s.W,M%s.W,s.W)}getElevation(l,f,v,b=s.W){return this.getDEMElevation(l,f,v,b)*this.exaggeration}getTerrainData(l){if(!this._emptyDemTexture){let b=this.painter.context,M=new s.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new ae(b,M,b.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new ae(b,new s.R({width:1,height:1}),b.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(b.gl.NEAREST,b.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=s.an([])}let f=this.sourceCache.getSourceTile(l,!0);if(f&&f.dem&&(!f.demTexture||f.needsTerrainPrepare)){let b=this.painter.context;f.demTexture=this.painter.getTileTexture(f.dem.stride),f.demTexture?f.demTexture.update(f.dem.getPixels(),{premultiply:!1}):f.demTexture=new ae(b,f.dem.getPixels(),b.gl.RGBA,{premultiply:!1}),f.demTexture.bind(b.gl.NEAREST,b.gl.CLAMP_TO_EDGE),f.needsTerrainPrepare=!1}let v=f&&f+f.tileID.key+l.key;if(v&&!this._demMatrixCache[v]){let b=this.sourceCache.sourceCache._source.maxzoom,M=l.canonical.z-f.tileID.canonical.z;l.overscaledZ>l.canonical.z&&(l.canonical.z>=b?M=l.canonical.z-b:s.w(\"cannot calculate elevation if elevation maxzoom > source.maxzoom\"));let O=l.canonical.x-(l.canonical.x>>M<<M),F=l.canonical.y-(l.canonical.y>>M<<M),U=s.b8(new Float64Array(16),[1/(s.W<<M),1/(s.W<<M),0]);s.H(U,U,[O*s.W,F*s.W,0]),this._demMatrixCache[l.key]={matrix:U,coord:l}}return{u_depth:2,u_terrain:3,u_terrain_dim:f&&f.dem&&f.dem.dim||1,u_terrain_matrix:v?this._demMatrixCache[l.key].matrix:this._emptyDemMatrix,u_terrain_unpack:f&&f.dem&&f.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(f&&f.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:f}}getFramebuffer(l){let f=this.painter,v=f.width/devicePixelRatio,b=f.height/devicePixelRatio;return!this._fbo||this._fbo.width===v&&this._fbo.height===b||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new ae(f.context,{width:v,height:b,data:null},f.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(f.context.gl.NEAREST,f.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new ae(f.context,{width:v,height:b,data:null},f.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(f.context.gl.NEAREST,f.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=f.context.createFramebuffer(v,b,!0,!1),this._fbo.depthAttachment.set(f.context.createRenderbuffer(f.context.gl.DEPTH_COMPONENT16,v,b))),this._fbo.colorAttachment.set(l===\"coords\"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let l=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let f=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let M=0,O=0;M<this._coordsTextureSize;M++)for(let F=0;F<this._coordsTextureSize;F++,O+=4)f[O+0]=255&F,f[O+1]=255&M,f[O+2]=F>>8<<4|M>>8,f[O+3]=0;let v=new s.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(f.buffer)),b=new ae(l,v,l.gl.RGBA,{premultiply:!1});return b.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),this._coordsTexture=b,b}pointCoordinate(l){let f=new Uint8Array(4),v=this.painter.context,b=v.gl;v.bindFramebuffer.set(this.getFramebuffer(\"coords\").framebuffer),b.readPixels(l.x,this.painter.height/devicePixelRatio-l.y-1,1,1,b.RGBA,b.UNSIGNED_BYTE,f),v.bindFramebuffer.set(null);let M=f[0]+(f[2]>>4<<8),O=f[1]+((15&f[2])<<8),F=this.coordsIndex[255-f[3]],U=F&&this.sourceCache.getTileByID(F);if(!U)return null;let W=this._coordsTextureSize,$=(1<<U.tileID.canonical.z)*W;return new s.Y((U.tileID.canonical.x*W+M)/$+U.tileID.wrap,(U.tileID.canonical.y*W+O)/$,this.getElevation(U.tileID,M,O,W))}depthAtPoint(l){let f=new Uint8Array(4),v=this.painter.context,b=v.gl;return v.bindFramebuffer.set(this.getFramebuffer(\"depth\").framebuffer),b.readPixels(l.x,this.painter.height/devicePixelRatio-l.y-1,1,1,b.RGBA,b.UNSIGNED_BYTE,f),v.bindFramebuffer.set(null),(f[0]/16777216+f[1]/65536+f[2]/256+f[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;let l=this.painter.context,f=new s.b9,v=new s.aX,b=this.meshSize,M=s.W/b,O=b*b;for(let X=0;X<=b;X++)for(let at=0;at<=b;at++)f.emplaceBack(at*M,X*M,0);for(let X=0;X<O;X+=b+1)for(let at=0;at<b;at++)v.emplaceBack(at+X,b+at+X+1,b+at+X+2),v.emplaceBack(at+X,b+at+X+2,at+X+1);let F=f.length,U=F+2*(b+1);for(let X of[0,1])for(let at=0;at<=b;at++)for(let gt of[0,1])f.emplaceBack(at*M,X*s.W,gt);for(let X=0;X<2*b;X+=2)v.emplaceBack(U+X,U+X+1,U+X+3),v.emplaceBack(U+X,U+X+3,U+X+2),v.emplaceBack(F+X,F+X+3,F+X+1),v.emplaceBack(F+X,F+X+2,F+X+3);let W=f.length,$=W+2*(b+1);for(let X of[0,1])for(let at=0;at<=b;at++)for(let gt of[0,1])f.emplaceBack(X*s.W,at*M,gt);for(let X=0;X<2*b;X+=2)v.emplaceBack(W+X,W+X+1,W+X+3),v.emplaceBack(W+X,W+X+3,W+X+2),v.emplaceBack($+X,$+X+3,$+X+1),v.emplaceBack($+X,$+X+2,$+X+3);return this._mesh={indexBuffer:l.createIndexBuffer(v),vertexBuffer:l.createVertexBuffer(f,Rd.members),segments:s.$.simpleSegment(0,0,f.length,v.length)},this._mesh}getMeshFrameDelta(l){return 2*Math.PI*s.ba/Math.pow(2,l)/5}getMinTileElevationForLngLatZoom(l,f){var v;let{tileID:b}=this._getOverscaledTileIDFromLngLatZoom(l,f);return(v=this.getMinMaxElevation(b).minElevation)!==null&&v!==void 0?v:0}getMinMaxElevation(l){let f=this.getTerrainData(l).tile,v={minElevation:null,maxElevation:null};return f&&f.dem&&(v.minElevation=f.dem.min*this.exaggeration,v.maxElevation=f.dem.max*this.exaggeration),v}_getOverscaledTileIDFromLngLatZoom(l,f){let v=s.Y.fromLngLat(l.wrap()),b=(1<<f)*s.W,M=v.x*b,O=v.y*b,F=Math.floor(M/s.W),U=Math.floor(O/s.W);return{tileID:new s.Q(f,0,f,F,U),mercatorX:M,mercatorY:O}}}class r0{constructor(l,f,v){this._context=l,this._size=f,this._tileSize=v,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let l of this._objects)l.texture.destroy(),l.fbo.destroy()}_createObject(l){let f=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),v=new ae(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return v.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),f.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),f.colorAttachment.set(v.texture),{id:l,fbo:f,texture:v,stamp:-1,inUse:!1}}getObjectForId(l){return this._objects[l]}useObject(l){l.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(f=>l.id!==f),this._recentlyUsed.push(l.id)}stampObject(l){l.stamp=++this._stamp}getOrCreateFreeObject(){for(let f of this._recentlyUsed)if(!this._objects[f].inUse)return this._objects[f];if(this._objects.length>=this._size)throw new Error(\"No free RenderPool available, call freeAllObjects() required!\");let l=this._createObject(this._objects.length);return this._objects.push(l),l}freeObject(l){l.inUse=!1}freeAllObjects(){for(let l of this._objects)this.freeObject(l)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(l=>!l.inUse)===!1}}let Na={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class sA{constructor(l,f){this.painter=l,this.terrain=f,this.pool=new r0(l.context,30,f.sourceCache.tileSize*f.qualityFactor)}destruct(){this.pool.destruct()}getTexture(l){return this.pool.getObjectForId(l.rtt[this._stacks.length-1].id).texture}prepareForRender(l,f){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=l._order.filter(v=>!l._layers[v].isHidden(f)),this._coordsDescendingInv={};for(let v in l.sourceCaches){this._coordsDescendingInv[v]={};let b=l.sourceCaches[v].getVisibleCoordinates();for(let M of b){let O=this.terrain.sourceCache.getTerrainCoords(M);for(let F in O)this._coordsDescendingInv[v][F]||(this._coordsDescendingInv[v][F]=[]),this._coordsDescendingInv[v][F].push(O[F])}}this._coordsDescendingInvStr={};for(let v of l._order){let b=l._layers[v],M=b.source;if(Na[b.type]&&!this._coordsDescendingInvStr[M]){this._coordsDescendingInvStr[M]={};for(let O in this._coordsDescendingInv[M])this._coordsDescendingInvStr[M][O]=this._coordsDescendingInv[M][O].map(F=>F.key).sort().join()}}for(let v of this._renderableTiles)for(let b in this._coordsDescendingInvStr){let M=this._coordsDescendingInvStr[b][v.tileID.key];M&&M!==v.rttCoords[b]&&(v.rtt=[])}}renderLayer(l){if(l.isHidden(this.painter.transform.zoom))return!1;let f=l.type,v=this.painter,b=this._renderableLayerIds[this._renderableLayerIds.length-1]===l.id;if(Na[f]&&(this._prevType&&Na[this._prevType]||this._stacks.push([]),this._prevType=f,this._stacks[this._stacks.length-1].push(l.id),!b))return!0;if(Na[this._prevType]||Na[f]&&b){this._prevType=f;let M=this._stacks.length-1,O=this._stacks[M]||[];for(let F of this._renderableTiles){if(this.pool.isFull()&&(Jp(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(F),F.rtt[M]){let W=this.pool.getObjectForId(F.rtt[M].id);if(W.stamp===F.rtt[M].stamp){this.pool.useObject(W);continue}}let U=this.pool.getOrCreateFreeObject();this.pool.useObject(U),this.pool.stampObject(U),F.rtt[M]={id:U.id,stamp:U.stamp},v.context.bindFramebuffer.set(U.fbo.framebuffer),v.context.clear({color:s.aO.transparent,stencil:0}),v.currentStencilSource=void 0;for(let W=0;W<O.length;W++){let $=v.style._layers[O[W]],X=$.source?this._coordsDescendingInv[$.source][F.tileID.key]:[F.tileID];v.context.viewport.set([0,0,U.fbo.width,U.fbo.height]),v._renderTileClippingMasks($,X),v.renderLayer(v,v.style.sourceCaches[$.source],$,X),$.source&&(F.rttCoords[$.source]=this._coordsDescendingInvStr[$.source][F.tileID.key])}}return Jp(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),Na[f]}return!1}}let lo={\"AttributionControl.ToggleAttribution\":\"Toggle attribution\",\"AttributionControl.MapFeedback\":\"Map feedback\",\"FullscreenControl.Enter\":\"Enter fullscreen\",\"FullscreenControl.Exit\":\"Exit fullscreen\",\"GeolocateControl.FindMyLocation\":\"Find my location\",\"GeolocateControl.LocationNotAvailable\":\"Location not available\",\"LogoControl.Title\":\"MapLibre logo\",\"NavigationControl.ResetBearing\":\"Reset bearing to north\",\"NavigationControl.ZoomIn\":\"Zoom in\",\"NavigationControl.ZoomOut\":\"Zoom out\",\"ScaleControl.Feet\":\"ft\",\"ScaleControl.Meters\":\"m\",\"ScaleControl.Kilometers\":\"km\",\"ScaleControl.Miles\":\"mi\",\"ScaleControl.NauticalMiles\":\"nm\",\"TerrainControl.Enable\":\"Enable terrain\",\"TerrainControl.Disable\":\"Disable terrain\",\"CooperativeGesturesHandler.WindowsHelpText\":\"Use Ctrl + scroll to zoom the map\",\"CooperativeGesturesHandler.MacHelpText\":\"Use \\u2318 + scroll to zoom the map\",\"CooperativeGesturesHandler.MobileHelpText\":\"Use two fingers to move the map\"},qn=o,i0={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:wo,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:s.a.MAX_TILE_CACHE_ZOOM_LEVELS,localIdeographFontFamily:\"sans-serif\",transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,validateStyle:!0,maxCanvasSize:[4096,4096]},Cf=T=>{T.touchstart=T.dragStart,T.touchmoveWindow=T.dragMove,T.touchend=T.dragEnd},n0={showCompass:!0,showZoom:!0,visualizePitch:!1};class s0{constructor(l,f,v=!1){this.mousedown=O=>{this.startMouse(s.e({},O,{ctrlKey:!0,preventDefault:()=>O.preventDefault()}),w.mousePos(this.element,O)),w.addEventListener(window,\"mousemove\",this.mousemove),w.addEventListener(window,\"mouseup\",this.mouseup)},this.mousemove=O=>{this.moveMouse(O,w.mousePos(this.element,O))},this.mouseup=O=>{this.mouseRotate.dragEnd(O),this.mousePitch&&this.mousePitch.dragEnd(O),this.offTemp()},this.touchstart=O=>{O.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=w.touchPos(this.element,O.targetTouches)[0],this.startTouch(O,this._startPos),w.addEventListener(window,\"touchmove\",this.touchmove,{passive:!1}),w.addEventListener(window,\"touchend\",this.touchend))},this.touchmove=O=>{O.targetTouches.length!==1?this.reset():(this._lastPos=w.touchPos(this.element,O.targetTouches)[0],this.moveTouch(O,this._lastPos))},this.touchend=O=>{O.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let b=l.dragRotate._mouseRotate.getClickTolerance(),M=l.dragRotate._mousePitch.getClickTolerance();this.element=f,this.mouseRotate=Xm({clickTolerance:b,enable:!0}),this.touchRotate=(({enable:O,clickTolerance:F,bearingDegreesPerPixelMoved:U=.8})=>{let W=new zl;return new al({clickTolerance:F,move:($,X)=>({bearingDelta:(X.x-$.x)*U}),moveStateManager:W,enable:O,assignEvents:Cf})})({clickTolerance:b,enable:!0}),this.map=l,v&&(this.mousePitch=Tf({clickTolerance:M,enable:!0}),this.touchPitch=(({enable:O,clickTolerance:F,pitchDegreesPerPixelMoved:U=-.5})=>{let W=new zl;return new al({clickTolerance:F,move:($,X)=>({pitchDelta:(X.y-$.y)*U}),moveStateManager:W,enable:O,assignEvents:Cf})})({clickTolerance:M,enable:!0})),w.addEventListener(f,\"mousedown\",this.mousedown),w.addEventListener(f,\"touchstart\",this.touchstart,{passive:!1}),w.addEventListener(f,\"touchcancel\",this.reset)}startMouse(l,f){this.mouseRotate.dragStart(l,f),this.mousePitch&&this.mousePitch.dragStart(l,f),w.disableDrag()}startTouch(l,f){this.touchRotate.dragStart(l,f),this.touchPitch&&this.touchPitch.dragStart(l,f),w.disableDrag()}moveMouse(l,f){let v=this.map,{bearingDelta:b}=this.mouseRotate.dragMove(l,f)||{};if(b&&v.setBearing(v.getBearing()+b),this.mousePitch){let{pitchDelta:M}=this.mousePitch.dragMove(l,f)||{};M&&v.setPitch(v.getPitch()+M)}}moveTouch(l,f){let v=this.map,{bearingDelta:b}=this.touchRotate.dragMove(l,f)||{};if(b&&v.setBearing(v.getBearing()+b),this.touchPitch){let{pitchDelta:M}=this.touchPitch.dragMove(l,f)||{};M&&v.setPitch(v.getPitch()+M)}}off(){let l=this.element;w.removeEventListener(l,\"mousedown\",this.mousedown),w.removeEventListener(l,\"touchstart\",this.touchstart,{passive:!1}),w.removeEventListener(window,\"touchmove\",this.touchmove,{passive:!1}),w.removeEventListener(window,\"touchend\",this.touchend),w.removeEventListener(l,\"touchcancel\",this.reset),this.offTemp()}offTemp(){w.enableDrag(),w.removeEventListener(window,\"mousemove\",this.mousemove),w.removeEventListener(window,\"mouseup\",this.mouseup),w.removeEventListener(window,\"touchmove\",this.touchmove,{passive:!1}),w.removeEventListener(window,\"touchend\",this.touchend)}}let Rc;function Us(T,l,f){if(T=new s.M(T.lng,T.lat),l){let v=new s.M(T.lng-360,T.lat),b=new s.M(T.lng+360,T.lat),M=f.locationPoint(T).distSqr(l);f.locationPoint(v).distSqr(l)<M?T=v:f.locationPoint(b).distSqr(l)<M&&(T=b)}for(;Math.abs(T.lng-f.center.lng)>180;){let v=f.locationPoint(T);if(v.x>=0&&v.y>=0&&v.x<=f.width&&v.y<=f.height)break;T.lng>f.center.lng?T.lng-=360:T.lng+=360}return T}let hh={center:\"translate(-50%,-50%)\",top:\"translate(-50%,0)\",\"top-left\":\"translate(0,0)\",\"top-right\":\"translate(-100%,0)\",bottom:\"translate(-50%,-100%)\",\"bottom-left\":\"translate(0,-100%)\",\"bottom-right\":\"translate(-100%,-100%)\",left:\"translate(0,-50%)\",right:\"translate(-100%,-50%)\"};function ul(T,l,f){let v=T.classList;for(let b in hh)v.remove(`maplibregl-${f}-anchor-${b}`);v.add(`maplibregl-${f}-anchor-${l}`)}class Dd extends s.E{constructor(l){if(super(),this._onKeyPress=f=>{let v=f.code,b=f.charCode||f.keyCode;v!==\"Space\"&&v!==\"Enter\"&&b!==32&&b!==13||this.togglePopup()},this._onMapClick=f=>{let v=f.originalEvent.target,b=this._element;this._popup&&(v===b||b.contains(v))&&this.togglePopup()},this._update=f=>{if(!this._map)return;let v=this._map.loaded()&&!this._map.isMoving();(f?.type===\"terrain\"||f?.type===\"render\"&&!v)&&this._map.once(\"render\",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=Us(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let b=\"\";this._rotationAlignment===\"viewport\"||this._rotationAlignment===\"auto\"?b=`rotateZ(${this._rotation}deg)`:this._rotationAlignment===\"map\"&&(b=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let M=\"\";this._pitchAlignment===\"viewport\"||this._pitchAlignment===\"auto\"?M=\"rotateX(0deg)\":this._pitchAlignment===\"map\"&&(M=`rotateX(${this._map.getPitch()}deg)`),f&&f.type!==\"moveend\"||(this._pos=this._pos.round()),w.setTransform(this._element,`${hh[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${M} ${b}`),this._updateOpacity(f&&f.type===\"moveend\")},this._onMove=f=>{if(!this._isDragging){let v=this._clickTolerance||this._map._clickTolerance;this._isDragging=f.point.dist(this._pointerdownPos)>=v}this._isDragging&&(this._pos=f.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents=\"none\",this._state===\"pending\"&&(this._state=\"active\",this.fire(new s.k(\"dragstart\"))),this.fire(new s.k(\"drag\")))},this._onUp=()=>{this._element.style.pointerEvents=\"auto\",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off(\"mousemove\",this._onMove),this._map.off(\"touchmove\",this._onMove),this._state===\"active\"&&this.fire(new s.k(\"dragend\")),this._state=\"inactive\"},this._addDragHandler=f=>{this._element.contains(f.originalEvent.target)&&(f.preventDefault(),this._positionDelta=f.point.sub(this._pos).add(this._offset),this._pointerdownPos=f.point,this._state=\"pending\",this._map.on(\"mousemove\",this._onMove),this._map.on(\"touchmove\",this._onMove),this._map.once(\"mouseup\",this._onUp),this._map.once(\"touchend\",this._onUp))},this._anchor=l&&l.anchor||\"center\",this._color=l&&l.color||\"#3FB1CE\",this._scale=l&&l.scale||1,this._draggable=l&&l.draggable||!1,this._clickTolerance=l&&l.clickTolerance||0,this._isDragging=!1,this._state=\"inactive\",this._rotation=l&&l.rotation||0,this._rotationAlignment=l&&l.rotationAlignment||\"auto\",this._pitchAlignment=l&&l.pitchAlignment&&l.pitchAlignment!==\"auto\"?l.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(l?.opacity,l?.opacityWhenCovered),l&&l.element)this._element=l.element,this._offset=s.P.convert(l&&l.offset||[0,0]);else{this._defaultMarker=!0,this._element=w.create(\"div\"),this._element.setAttribute(\"aria-label\",\"Map marker\");let f=w.createNS(\"http://www.w3.org/2000/svg\",\"svg\"),v=41,b=27;f.setAttributeNS(null,\"display\",\"block\"),f.setAttributeNS(null,\"height\",`${v}px`),f.setAttributeNS(null,\"width\",`${b}px`),f.setAttributeNS(null,\"viewBox\",`0 0 ${b} ${v}`);let M=w.createNS(\"http://www.w3.org/2000/svg\",\"g\");M.setAttributeNS(null,\"stroke\",\"none\"),M.setAttributeNS(null,\"stroke-width\",\"1\"),M.setAttributeNS(null,\"fill\",\"none\"),M.setAttributeNS(null,\"fill-rule\",\"evenodd\");let O=w.createNS(\"http://www.w3.org/2000/svg\",\"g\");O.setAttributeNS(null,\"fill-rule\",\"nonzero\");let F=w.createNS(\"http://www.w3.org/2000/svg\",\"g\");F.setAttributeNS(null,\"transform\",\"translate(3.0, 29.0)\"),F.setAttributeNS(null,\"fill\",\"#000000\");let U=[{rx:\"10.5\",ry:\"5.25002273\"},{rx:\"10.5\",ry:\"5.25002273\"},{rx:\"9.5\",ry:\"4.77275007\"},{rx:\"8.5\",ry:\"4.29549936\"},{rx:\"7.5\",ry:\"3.81822308\"},{rx:\"6.5\",ry:\"3.34094679\"},{rx:\"5.5\",ry:\"2.86367051\"},{rx:\"4.5\",ry:\"2.38636864\"}];for(let kt of U){let Wt=w.createNS(\"http://www.w3.org/2000/svg\",\"ellipse\");Wt.setAttributeNS(null,\"opacity\",\"0.04\"),Wt.setAttributeNS(null,\"cx\",\"10.5\"),Wt.setAttributeNS(null,\"cy\",\"5.80029008\"),Wt.setAttributeNS(null,\"rx\",kt.rx),Wt.setAttributeNS(null,\"ry\",kt.ry),F.appendChild(Wt)}let W=w.createNS(\"http://www.w3.org/2000/svg\",\"g\");W.setAttributeNS(null,\"fill\",this._color);let $=w.createNS(\"http://www.w3.org/2000/svg\",\"path\");$.setAttributeNS(null,\"d\",\"M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z\"),W.appendChild($);let X=w.createNS(\"http://www.w3.org/2000/svg\",\"g\");X.setAttributeNS(null,\"opacity\",\"0.25\"),X.setAttributeNS(null,\"fill\",\"#000000\");let at=w.createNS(\"http://www.w3.org/2000/svg\",\"path\");at.setAttributeNS(null,\"d\",\"M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z\"),X.appendChild(at);let gt=w.createNS(\"http://www.w3.org/2000/svg\",\"g\");gt.setAttributeNS(null,\"transform\",\"translate(6.0, 7.0)\"),gt.setAttributeNS(null,\"fill\",\"#FFFFFF\");let _t=w.createNS(\"http://www.w3.org/2000/svg\",\"g\");_t.setAttributeNS(null,\"transform\",\"translate(8.0, 8.0)\");let yt=w.createNS(\"http://www.w3.org/2000/svg\",\"circle\");yt.setAttributeNS(null,\"fill\",\"#000000\"),yt.setAttributeNS(null,\"opacity\",\"0.25\"),yt.setAttributeNS(null,\"cx\",\"5.5\"),yt.setAttributeNS(null,\"cy\",\"5.5\"),yt.setAttributeNS(null,\"r\",\"5.4999962\");let At=w.createNS(\"http://www.w3.org/2000/svg\",\"circle\");At.setAttributeNS(null,\"fill\",\"#FFFFFF\"),At.setAttributeNS(null,\"cx\",\"5.5\"),At.setAttributeNS(null,\"cy\",\"5.5\"),At.setAttributeNS(null,\"r\",\"5.4999962\"),_t.appendChild(yt),_t.appendChild(At),O.appendChild(F),O.appendChild(W),O.appendChild(X),O.appendChild(gt),O.appendChild(_t),f.appendChild(O),f.setAttributeNS(null,\"height\",v*this._scale+\"px\"),f.setAttributeNS(null,\"width\",b*this._scale+\"px\"),this._element.appendChild(f),this._offset=s.P.convert(l&&l.offset||[0,-14])}if(this._element.classList.add(\"maplibregl-marker\"),this._element.addEventListener(\"dragstart\",f=>{f.preventDefault()}),this._element.addEventListener(\"mousedown\",f=>{f.preventDefault()}),ul(this._element,this._anchor,\"marker\"),l&&l.className)for(let f of l.className.split(\" \"))this._element.classList.add(f);this._popup=null}addTo(l){return this.remove(),this._map=l,l.getCanvasContainer().appendChild(this._element),l.on(\"move\",this._update),l.on(\"moveend\",this._update),l.on(\"terrain\",this._update),this.setDraggable(this._draggable),this._update(),this._map.on(\"click\",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off(\"click\",this._onMapClick),this._map.off(\"move\",this._update),this._map.off(\"moveend\",this._update),this._map.off(\"mousedown\",this._addDragHandler),this._map.off(\"touchstart\",this._addDragHandler),this._map.off(\"mouseup\",this._onUp),this._map.off(\"touchend\",this._onUp),this._map.off(\"mousemove\",this._onMove),this._map.off(\"touchmove\",this._onMove),delete this._map),w.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(l){return this._lngLat=s.M.convert(l),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(l){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener(\"keypress\",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute(\"tabindex\")),l){if(!(\"offset\"in l.options)){let b=Math.abs(13.5)/Math.SQRT2;l.options.offset=this._defaultMarker?{top:[0,0],\"top-left\":[0,0],\"top-right\":[0,0],bottom:[0,-38.1],\"bottom-left\":[b,-1*(38.1-13.5+b)],\"bottom-right\":[-b,-1*(38.1-13.5+b)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=l,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute(\"tabindex\"),this._originalTabIndex||this._element.setAttribute(\"tabindex\",\"0\"),this._element.addEventListener(\"keypress\",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){let l=this._popup;return l?(l.isOpen()?l.remove():l.addTo(this._map),this):this}_updateOpacity(l=!1){if(!this._map.terrain)return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(l)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let f=this._map,v=f.terrain.depthAtPoint(this._pos),b=f.terrain.getElevationForLngLatZoom(this._lngLat,f.transform.tileZoom);if(f.transform.lngLatToCameraDepth(this._lngLat,b)-v<.006)return void(this._element.style.opacity=this._opacity);let M=-this._offset.y/f.transform._pixelPerMeter,O=Math.sin(f.getPitch()*Math.PI/180)*M,F=f.terrain.depthAtPoint(new s.P(this._pos.x,this._pos.y-this._offset.y)),U=f.transform.lngLatToCameraDepth(this._lngLat,b+O);this._element.style.opacity=U-F>.006?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(l){return this._offset=s.P.convert(l),this._update(),this}addClassName(l){this._element.classList.add(l)}removeClassName(l){this._element.classList.remove(l)}toggleClassName(l){return this._element.classList.toggle(l)}setDraggable(l){return this._draggable=!!l,this._map&&(l?(this._map.on(\"mousedown\",this._addDragHandler),this._map.on(\"touchstart\",this._addDragHandler)):(this._map.off(\"mousedown\",this._addDragHandler),this._map.off(\"touchstart\",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(l){return this._rotation=l||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(l){return this._rotationAlignment=l||\"auto\",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(l){return this._pitchAlignment=l&&l!==\"auto\"?l:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(l,f){return l===void 0&&f===void 0&&(this._opacity=\"1\",this._opacityWhenCovered=\"0.2\"),l!==void 0&&(this._opacity=l),f!==void 0&&(this._opacityWhenCovered=f),this._map&&this._updateOpacity(!0),this}}let Od={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},fh=0,Ps=!1,oA={maxWidth:100,unit:\"metric\"};function dh(T,l,f){let v=f&&f.maxWidth||100,b=T._container.clientHeight/2,M=T.unproject([0,b]),O=T.unproject([v,b]),F=M.distanceTo(O);if(f&&f.unit===\"imperial\"){let U=3.2808*F;U>5280?hl(l,v,U/5280,T._getUIString(\"ScaleControl.Miles\")):hl(l,v,U,T._getUIString(\"ScaleControl.Feet\"))}else f&&f.unit===\"nautical\"?hl(l,v,F/1852,T._getUIString(\"ScaleControl.NauticalMiles\")):F>=1e3?hl(l,v,F/1e3,T._getUIString(\"ScaleControl.Kilometers\")):hl(l,v,F,T._getUIString(\"ScaleControl.Meters\"))}function hl(T,l,f,v){let b=function(M){let O=Math.pow(10,`${Math.floor(M)}`.length-1),F=M/O;return F=F>=10?10:F>=5?5:F>=3?3:F>=2?2:F>=1?1:function(U){let W=Math.pow(10,Math.ceil(-Math.log(U)/Math.LN10));return Math.round(U*W)/W}(F),O*F}(f);T.style.width=l*(b/f)+\"px\",T.innerHTML=`${b}&nbsp;${v}`}let Dc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:\"\",maxWidth:\"240px\"},Oc=[\"a[href]\",\"[tabindex]:not([tabindex='-1'])\",\"[contenteditable]:not([contenteditable='false'])\",\"button:not([disabled])\",\"input:not([disabled])\",\"select:not([disabled])\",\"textarea:not([disabled])\"].join(\", \");function aA(T){if(T){if(typeof T==\"number\"){let l=Math.round(Math.abs(T)/Math.SQRT2);return{center:new s.P(0,0),top:new s.P(0,T),\"top-left\":new s.P(l,l),\"top-right\":new s.P(-l,l),bottom:new s.P(0,-T),\"bottom-left\":new s.P(l,-l),\"bottom-right\":new s.P(-l,-l),left:new s.P(T,0),right:new s.P(-T,0)}}if(T instanceof s.P||Array.isArray(T)){let l=s.P.convert(T);return{center:l,top:l,\"top-left\":l,\"top-right\":l,bottom:l,\"bottom-left\":l,\"bottom-right\":l,left:l,right:l}}return{center:s.P.convert(T.center||[0,0]),top:s.P.convert(T.top||[0,0]),\"top-left\":s.P.convert(T[\"top-left\"]||[0,0]),\"top-right\":s.P.convert(T[\"top-right\"]||[0,0]),bottom:s.P.convert(T.bottom||[0,0]),\"bottom-left\":s.P.convert(T[\"bottom-left\"]||[0,0]),\"bottom-right\":s.P.convert(T[\"bottom-right\"]||[0,0]),left:s.P.convert(T.left||[0,0]),right:s.P.convert(T.right||[0,0])}}return aA(new s.P(0,0))}let lA=o;n.AJAXError=s.bd,n.Evented=s.E,n.LngLat=s.M,n.MercatorCoordinate=s.Y,n.Point=s.P,n.addProtocol=s.be,n.config=s.a,n.removeProtocol=s.bf,n.AttributionControl=e0,n.BoxZoomHandler=wf,n.CanvasSource=Dl,n.CooperativeGesturesHandler=kd,n.DoubleClickZoomHandler=nA,n.DragPanHandler=Jm,n.DragRotateHandler=c_,n.EdgeInsets=Au,n.FullscreenControl=class extends s.E{constructor(T={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,T&&T.container&&(T.container instanceof HTMLElement?this._container=T.container:s.w(\"Full screen control 'container' must be a DOM element.\")),\"onfullscreenchange\"in document?this._fullscreenchange=\"fullscreenchange\":\"onmozfullscreenchange\"in document?this._fullscreenchange=\"mozfullscreenchange\":\"onwebkitfullscreenchange\"in document?this._fullscreenchange=\"webkitfullscreenchange\":\"onmsfullscreenchange\"in document&&(this._fullscreenchange=\"MSFullscreenChange\")}onAdd(T){return this._map=T,this._container||(this._container=this._map.getContainer()),this._controlContainer=w.create(\"div\",\"maplibregl-ctrl maplibregl-ctrl-group\"),this._setupUI(),this._controlContainer}onRemove(){w.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let T=this._fullscreenButton=w.create(\"button\",\"maplibregl-ctrl-fullscreen\",this._controlContainer);w.create(\"span\",\"maplibregl-ctrl-icon\",T).setAttribute(\"aria-hidden\",\"true\"),T.type=\"button\",this._updateTitle(),this._fullscreenButton.addEventListener(\"click\",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let T=this._getTitle();this._fullscreenButton.setAttribute(\"aria-label\",T),this._fullscreenButton.title=T}_getTitle(){return this._map._getUIString(this._isFullscreen()?\"FullscreenControl.Exit\":\"FullscreenControl.Enter\")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(\"maplibregl-ctrl-shrink\"),this._fullscreenButton.classList.toggle(\"maplibregl-ctrl-fullscreen\"),this._updateTitle(),this._fullscreen?(this.fire(new s.k(\"fullscreenstart\")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new s.k(\"fullscreenend\")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle(\"maplibregl-pseudo-fullscreen\"),this._handleFullscreenChange(),this._map.resize()}},n.GeoJSONSource=ti,n.GeolocateControl=class extends s.E{constructor(T){super(),this._onSuccess=l=>{if(this._map){if(this._isOutOfMapMaxBounds(l))return this._setErrorState(),this.fire(new s.k(\"outofmaxbounds\",l)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=l,this._watchState){case\"WAITING_ACTIVE\":case\"ACTIVE_LOCK\":case\"ACTIVE_ERROR\":this._watchState=\"ACTIVE_LOCK\",this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-waiting\"),this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-active-error\"),this._geolocateButton.classList.add(\"maplibregl-ctrl-geolocate-active\");break;case\"BACKGROUND\":case\"BACKGROUND_ERROR\":this._watchState=\"BACKGROUND\",this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-waiting\"),this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-background-error\"),this._geolocateButton.classList.add(\"maplibregl-ctrl-geolocate-background\");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!==\"OFF\"&&this._updateMarker(l),this.options.trackUserLocation&&this._watchState!==\"ACTIVE_LOCK\"||this._updateCamera(l),this.options.showUserLocation&&this._dotElement.classList.remove(\"maplibregl-user-location-dot-stale\"),this.fire(new s.k(\"geolocate\",l)),this._finish()}},this._updateCamera=l=>{let f=new s.M(l.coords.longitude,l.coords.latitude),v=l.coords.accuracy,b=this._map.getBearing(),M=s.e({bearing:b},this.options.fitBoundsOptions),O=an.fromLngLat(f,v);this._map.fitBounds(O,M,{geolocateSource:!0})},this._updateMarker=l=>{if(l){let f=new s.M(l.coords.longitude,l.coords.latitude);this._accuracyCircleMarker.setLngLat(f).addTo(this._map),this._userLocationDotMarker.setLngLat(f).addTo(this._map),this._accuracy=l.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=l=>{if(this._map){if(this.options.trackUserLocation)if(l.code===1){this._watchState=\"OFF\",this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-waiting\"),this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-active\"),this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-active-error\"),this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-background\"),this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-background-error\"),this._geolocateButton.disabled=!0;let f=this._map._getUIString(\"GeolocateControl.LocationNotAvailable\");this._geolocateButton.title=f,this._geolocateButton.setAttribute(\"aria-label\",f),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(l.code===3&&Ps)return;this._setErrorState()}this._watchState!==\"OFF\"&&this.options.showUserLocation&&this._dotElement.classList.add(\"maplibregl-user-location-dot-stale\"),this.fire(new s.k(\"error\",l)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=l=>{if(this._map){if(this._container.addEventListener(\"contextmenu\",f=>f.preventDefault()),this._geolocateButton=w.create(\"button\",\"maplibregl-ctrl-geolocate\",this._container),w.create(\"span\",\"maplibregl-ctrl-icon\",this._geolocateButton).setAttribute(\"aria-hidden\",\"true\"),this._geolocateButton.type=\"button\",l===!1){s.w(\"Geolocation support is not available so the GeolocateControl will be disabled.\");let f=this._map._getUIString(\"GeolocateControl.LocationNotAvailable\");this._geolocateButton.disabled=!0,this._geolocateButton.title=f,this._geolocateButton.setAttribute(\"aria-label\",f)}else{let f=this._map._getUIString(\"GeolocateControl.FindMyLocation\");this._geolocateButton.title=f,this._geolocateButton.setAttribute(\"aria-label\",f)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute(\"aria-pressed\",\"false\"),this._watchState=\"OFF\"),this.options.showUserLocation&&(this._dotElement=w.create(\"div\",\"maplibregl-user-location-dot\"),this._userLocationDotMarker=new Dd({element:this._dotElement}),this._circleElement=w.create(\"div\",\"maplibregl-user-location-accuracy-circle\"),this._accuracyCircleMarker=new Dd({element:this._circleElement,pitchAlignment:\"map\"}),this.options.trackUserLocation&&(this._watchState=\"OFF\"),this._map.on(\"zoom\",this._onZoom)),this._geolocateButton.addEventListener(\"click\",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on(\"movestart\",f=>{f.geolocateSource||this._watchState!==\"ACTIVE_LOCK\"||f.originalEvent&&f.originalEvent.type===\"resize\"||(this._watchState=\"BACKGROUND\",this._geolocateButton.classList.add(\"maplibregl-ctrl-geolocate-background\"),this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-active\"),this.fire(new s.k(\"trackuserlocationend\")))})}},this.options=s.e({},Od,T)}onAdd(T){return this._map=T,this._container=w.create(\"div\",\"maplibregl-ctrl maplibregl-ctrl-group\"),function(l=!1){return s._(this,void 0,void 0,function*(){if(Rc!==void 0&&!l)return Rc;if(window.navigator.permissions===void 0)return Rc=!!window.navigator.geolocation,Rc;try{Rc=(yield window.navigator.permissions.query({name:\"geolocation\"})).state!==\"denied\"}catch{Rc=!!window.navigator.geolocation}return Rc})}().then(l=>this._setupUI(l)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),w.remove(this._container),this._map.off(\"zoom\",this._onZoom),this._map=void 0,fh=0,Ps=!1}_isOutOfMapMaxBounds(T){let l=this._map.getMaxBounds(),f=T.coords;return l&&(f.longitude<l.getWest()||f.longitude>l.getEast()||f.latitude<l.getSouth()||f.latitude>l.getNorth())}_setErrorState(){switch(this._watchState){case\"WAITING_ACTIVE\":this._watchState=\"ACTIVE_ERROR\",this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-active\"),this._geolocateButton.classList.add(\"maplibregl-ctrl-geolocate-active-error\");break;case\"ACTIVE_LOCK\":this._watchState=\"ACTIVE_ERROR\",this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-active\"),this._geolocateButton.classList.add(\"maplibregl-ctrl-geolocate-active-error\"),this._geolocateButton.classList.add(\"maplibregl-ctrl-geolocate-waiting\");break;case\"BACKGROUND\":this._watchState=\"BACKGROUND_ERROR\",this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-background\"),this._geolocateButton.classList.add(\"maplibregl-ctrl-geolocate-background-error\"),this._geolocateButton.classList.add(\"maplibregl-ctrl-geolocate-waiting\");break;case\"ACTIVE_ERROR\":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let T=this._map.getBounds(),l=T.getSouthEast(),f=T.getNorthEast(),v=l.distanceTo(f),b=Math.ceil(this._accuracy/(v/this._map._container.clientHeight)*2);this._circleElement.style.width=`${b}px`,this._circleElement.style.height=`${b}px`}trigger(){if(!this._setup)return s.w(\"Geolocate control triggered before added to a map\"),!1;if(this.options.trackUserLocation){switch(this._watchState){case\"OFF\":this._watchState=\"WAITING_ACTIVE\",this.fire(new s.k(\"trackuserlocationstart\"));break;case\"WAITING_ACTIVE\":case\"ACTIVE_LOCK\":case\"ACTIVE_ERROR\":case\"BACKGROUND_ERROR\":fh--,Ps=!1,this._watchState=\"OFF\",this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-waiting\"),this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-active\"),this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-active-error\"),this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-background\"),this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-background-error\"),this.fire(new s.k(\"trackuserlocationend\"));break;case\"BACKGROUND\":this._watchState=\"ACTIVE_LOCK\",this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-background\"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.k(\"trackuserlocationstart\"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case\"WAITING_ACTIVE\":this._geolocateButton.classList.add(\"maplibregl-ctrl-geolocate-waiting\"),this._geolocateButton.classList.add(\"maplibregl-ctrl-geolocate-active\");break;case\"ACTIVE_LOCK\":this._geolocateButton.classList.add(\"maplibregl-ctrl-geolocate-active\");break;case\"OFF\":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState===\"OFF\"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let T;this._geolocateButton.classList.add(\"maplibregl-ctrl-geolocate-waiting\"),this._geolocateButton.setAttribute(\"aria-pressed\",\"true\"),fh++,fh>1?(T={maximumAge:6e5,timeout:0},Ps=!0):(T=this.options.positionOptions,Ps=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,T)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove(\"maplibregl-ctrl-geolocate-waiting\"),this._geolocateButton.setAttribute(\"aria-pressed\",\"false\"),this.options.showUserLocation&&this._updateMarker(null)}},n.Hash=$m,n.ImageSource=xn,n.KeyboardHandler=Km,n.LngLatBounds=an,n.LogoControl=cl,n.Map=class extends t0{constructor(T){if(s.bb.mark(s.bc.create),(T=s.e({},i0,T)).minZoom!=null&&T.maxZoom!=null&&T.minZoom>T.maxZoom)throw new Error(\"maxZoom must be greater than or equal to minZoom\");if(T.minPitch!=null&&T.maxPitch!=null&&T.minPitch>T.maxPitch)throw new Error(\"maxPitch must be greater than or equal to minPitch\");if(T.minPitch!=null&&T.minPitch<0)throw new Error(\"minPitch must be greater than or equal to 0\");if(T.maxPitch!=null&&T.maxPitch>85)throw new Error(\"maxPitch must be less than or equal to 85\");if(super(new xf(T.minZoom,T.maxZoom,T.minPitch,T.maxPitch,T.renderWorldCopies),{bearingSnap:T.bearingSnap}),this._contextLost=l=>{l.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new s.k(\"webglcontextlost\",{originalEvent:l}))},this._contextRestored=l=>{this._setupPainter(),this.resize(),this._update(),this.fire(new s.k(\"webglcontextrestored\",{originalEvent:l}))},this._onMapScroll=l=>{if(l.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=T.interactive,this._maxTileCacheSize=T.maxTileCacheSize,this._maxTileCacheZoomLevels=T.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=T.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=T.preserveDrawingBuffer,this._antialias=T.antialias,this._trackResize=T.trackResize,this._bearingSnap=T.bearingSnap,this._refreshExpiredTiles=T.refreshExpiredTiles,this._fadeDuration=T.fadeDuration,this._crossSourceCollisions=T.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=T.collectResourceTiming,this._renderTaskQueue=new Mx,this._controls=[],this._mapId=s.a3(),this._locale=s.e({},lo,T.locale),this._clickTolerance=T.clickTolerance,this._overridePixelRatio=T.pixelRatio,this._maxCanvasSize=T.maxCanvasSize,this.transformCameraUpdate=T.transformCameraUpdate,this._imageQueueHandle=Z.addThrottleControl(()=>this.isMoving()),this._requestManager=new J(T.transformRequest),typeof T.container==\"string\"){if(this._container=document.getElementById(T.container),!this._container)throw new Error(`Container '${T.container}' not found.`)}else{if(!(T.container instanceof HTMLElement))throw new Error(\"Invalid type: 'container' must be a String or HTMLElement.\");this._container=T.container}if(T.maxBounds&&this.setMaxBounds(T.maxBounds),this._setupContainer(),this._setupPainter(),this.on(\"move\",()=>this._update(!1)),this.on(\"moveend\",()=>this._update(!1)),this.on(\"zoom\",()=>this._update(!0)),this.on(\"terrain\",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once(\"idle\",()=>{this._idleTriggered=!0}),typeof window<\"u\"){addEventListener(\"online\",this._onWindowOnline,!1);let l=!1,f=Ym(v=>{this._trackResize&&!this._removed&&this.resize(v)._update()},50);this._resizeObserver=new ResizeObserver(v=>{l?f(v):l=!0}),this._resizeObserver.observe(this._container)}this.handlers=new xu(this,T),this._hash=T.hash&&new $m(typeof T.hash==\"string\"&&T.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:T.center,zoom:T.zoom,bearing:T.bearing,pitch:T.pitch}),T.bounds&&(this.resize(),this.fitBounds(T.bounds,s.e({},T.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=T.localIdeographFontFamily,this._validateStyle=T.validateStyle,T.style&&this.setStyle(T.style,{localIdeographFontFamily:T.localIdeographFontFamily}),T.attributionControl&&this.addControl(new e0(typeof T.attributionControl==\"boolean\"?void 0:T.attributionControl)),T.maplibreLogo&&this.addControl(new cl,T.logoPosition),this.on(\"style.load\",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on(\"data\",l=>{this._update(l.dataType===\"style\"),this.fire(new s.k(`${l.dataType}data`,l))}),this.on(\"dataloading\",l=>{this.fire(new s.k(`${l.dataType}dataloading`,l))}),this.on(\"dataabort\",l=>{this.fire(new s.k(\"sourcedataabort\",l))})}_getMapId(){return this._mapId}addControl(T,l){if(l===void 0&&(l=T.getDefaultPosition?T.getDefaultPosition():\"top-right\"),!T||!T.onAdd)return this.fire(new s.j(new Error(\"Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.\")));let f=T.onAdd(this);this._controls.push(T);let v=this._controlPositions[l];return l.indexOf(\"bottom\")!==-1?v.insertBefore(f,v.firstChild):v.appendChild(f),this}removeControl(T){if(!T||!T.onRemove)return this.fire(new s.j(new Error(\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment