From 10c5e19dd080bbb07f582e6cb443fb401ffbd72b Mon Sep 17 00:00:00 2001 From: Cristine Guadelupe Date: Tue, 16 Jan 2024 11:35:39 -0300 Subject: [PATCH] Bundle maplibre assets (#72) --- .gitignore | 3 + {lib/assets => assets}/maplibre/main.js | 17 +- assets/maplibre/package-lock.json | 1808 +++++++++++++++++++++++ assets/maplibre/package.json | 18 + lib/assets/maplibre/build/main.css | 1 + lib/assets/maplibre/build/main.js | 587 ++++++++ lib/kino/maplibre.ex | 2 +- 7 files changed, 2424 insertions(+), 12 deletions(-) rename {lib/assets => assets}/maplibre/main.js (92%) create mode 100644 assets/maplibre/package-lock.json create mode 100644 assets/maplibre/package.json create mode 100644 lib/assets/maplibre/build/main.css create mode 100644 lib/assets/maplibre/build/main.js diff --git a/.gitignore b/.gitignore index 59dbfc6..b987f43 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,6 @@ kino_maplibre-*.tar # Temporary files, for example, from tests. /tmp/ + +# Node modules. +assets/*/node_modules/ diff --git a/lib/assets/maplibre/main.js b/assets/maplibre/main.js similarity index 92% rename from lib/assets/maplibre/main.js rename to assets/maplibre/main.js index 3270dc1..fc6abe1 100644 --- a/lib/assets/maplibre/main.js +++ b/assets/maplibre/main.js @@ -1,16 +1,11 @@ -import "https://cdn.jsdelivr.net/npm/maplibre-gl@3.6.2/dist/maplibre-gl.min.js"; -// TODO: point to npm when released -import "https://cdn.jsdelivr.net/gh/jimmyrocks/maplibre-gl-vector-text-protocol@main/dist/maplibre-gl-vector-text-protocol.min.js"; -import "https://cdn.jsdelivr.net/npm/@maplibre/maplibre-gl-geocoder@1.5.0/dist/maplibre-gl-geocoder.min.js"; +import * as maplibregl from "maplibre-gl"; +import VectorTextProtocol from "maplibre-gl-vector-text-protocol"; +import MaplibreGeocoder from "@maplibre/maplibre-gl-geocoder"; +import "@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css"; +import "maplibre-gl/dist/maplibre-gl.css"; export function init(ctx, data) { - ctx.importCSS( - "https://cdn.jsdelivr.net/npm/maplibre-gl@3.6.2/dist/maplibre-gl.min.css" - ); - - ctx.importCSS( - "https://cdn.jsdelivr.net/npm/@maplibre/maplibre-gl-geocoder@1.5.0/lib/maplibre-gl-geocoder.min.css" - ); + ctx.importCSS("main.css"); ctx.root.innerHTML = `
diff --git a/assets/maplibre/package-lock.json b/assets/maplibre/package-lock.json new file mode 100644 index 0000000..222a1a3 --- /dev/null +++ b/assets/maplibre/package-lock.json @@ -0,0 +1,1808 @@ +{ + "name": "maplibre", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "@maplibre/maplibre-gl-geocoder": "^1.5.0", + "maplibre-gl": "^3.6.2", + "maplibre-gl-vector-text-protocol": "github:jimmyrocks/maplibre-gl-vector-text-protocol" + }, + "devDependencies": { + "@types/events": "^3.0.3", + "@types/node": "^20.11.2", + "esbuild": "^0.15.16", + "events": "^3.3.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "dependencies": { + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.18.tgz", + "integrity": "sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.18.tgz", + "integrity": "sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@mapbox/geojson-rewind": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@mapbox/geojson-rewind/-/geojson-rewind-0.5.2.tgz", + "integrity": "sha512-tJaT+RbYGJYStt7wI3cq4Nl4SXxG8W7JDG5DMJu97V25RnbNg3QtQtf+KD+VLjNpWKYsRvXDNmNrBgEETr1ifA==", + "dependencies": { + "get-stream": "^6.0.1", + "minimist": "^1.2.6" + }, + "bin": { + "geojson-rewind": "geojson-rewind" + } + }, + "node_modules/@mapbox/jsonlint-lines-primitives": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz", + "integrity": "sha512-rY0o9A5ECsTQRVhv7tL/OyDpGAoUB4tTvLiW1DSzQGq4bvTPhNw1VpSNjDJc5GFZ2XuyOtSWSVN05qOtcD71qQ==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@mapbox/point-geometry": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", + "integrity": "sha512-6j56HdLTwWGO0fJPlrZtdU/B13q8Uwmo18Ck2GnGgN9PCFyKTZ3UbXeEdRFh18i9XQ92eH2VdtpJHpBD3aripQ==" + }, + "node_modules/@mapbox/polyline": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@mapbox/polyline/-/polyline-1.2.1.tgz", + "integrity": "sha512-sn0V18O3OzW4RCcPoUIVDWvEGQaBNH9a0y5lgqrf5hUycyw1CzrhEoxV5irzrMNXKCkw1xRsZXcaVbsVZggHXA==", + "dependencies": { + "meow": "^9.0.0" + }, + "bin": { + "polyline": "bin/polyline.bin.js" + } + }, + "node_modules/@mapbox/sexagesimal": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@mapbox/sexagesimal/-/sexagesimal-1.2.0.tgz", + "integrity": "sha512-+C3+Azc4ObH2qmDYvg9MC+vvlGVfwB1BZNX8jt4XehJjfDGXwlElqJ6PS9BtgLHSjdinEoZTNanTG/WTc+dpRA==", + "bin": { + "sexagesimal": "bin/sexagesimal" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@mapbox/tiny-sdf": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@mapbox/tiny-sdf/-/tiny-sdf-2.0.6.tgz", + "integrity": "sha512-qMqa27TLw+ZQz5Jk+RcwZGH7BQf5G/TrutJhspsca/3SHwmgKQ1iq+d3Jxz5oysPVYTGP6aXxCo5Lk9Er6YBAA==" + }, + "node_modules/@mapbox/unitbezier": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@mapbox/unitbezier/-/unitbezier-0.0.1.tgz", + "integrity": "sha512-nMkuDXFv60aBr9soUG5q+GvZYL+2KZHVvsqFCzqnkGEf46U2fvmytHaEVc1/YZbiLn8X+eR3QzX1+dwDO1lxlw==" + }, + "node_modules/@mapbox/vector-tile": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-1.3.1.tgz", + "integrity": "sha512-MCEddb8u44/xfQ3oD+Srl/tNcQoqTw3goGk2oLsrFxOTc3dUp+kAnby3PvAeeBYSMSjSPD1nd1AJA6W49WnoUw==", + "dependencies": { + "@mapbox/point-geometry": "~0.1.0" + } + }, + "node_modules/@mapbox/whoots-js": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@mapbox/whoots-js/-/whoots-js-3.1.0.tgz", + "integrity": "sha512-Es6WcD0nO5l+2BOQS4uLfNPYQaNDfbot3X1XUoloz+x0mPDS3eeORZJl06HXjwBG1fOGwCRnzK88LMdxKRrd6Q==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@maplibre/maplibre-gl-geocoder": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-geocoder/-/maplibre-gl-geocoder-1.5.0.tgz", + "integrity": "sha512-PsAbV7WFIOu5QYZne95FiXoV7AV1/6ULMjQxgInhZ5DdB0hDLjciQPegnyDgkzI8JfeqoUMZVS/MglZnSZYhyQ==", + "dependencies": { + "lodash.debounce": "^4.0.6", + "subtag": "^0.5.0", + "suggestions-list": "^0.0.2", + "xtend": "^4.0.1" + }, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "maplibre-gl": ">=1.14.0" + } + }, + "node_modules/@maplibre/maplibre-gl-style-spec": { + "version": "19.3.3", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-19.3.3.tgz", + "integrity": "sha512-cOZZOVhDSulgK0meTsTkmNXb1ahVvmTmWmfx9gRBwc6hq98wS9JP35ESIoNq3xqEan+UN+gn8187Z6E4NKhLsw==", + "dependencies": { + "@mapbox/jsonlint-lines-primitives": "~2.0.2", + "@mapbox/unitbezier": "^0.0.1", + "json-stringify-pretty-compact": "^3.0.0", + "minimist": "^1.2.8", + "rw": "^1.3.3", + "sort-object": "^3.0.3" + }, + "bin": { + "gl-style-format": "dist/gl-style-format.mjs", + "gl-style-migrate": "dist/gl-style-migrate.mjs", + "gl-style-validate": "dist/gl-style-validate.mjs" + } + }, + "node_modules/@tmcw/togeojson": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@tmcw/togeojson/-/togeojson-5.8.1.tgz", + "integrity": "sha512-2YNrbis3l5kS0XrYwiHEZcGwiRp0MJ5CvwGwtMWp2z2tsVlskeec2qgvKHnF0RCwI5GnjrrBOoKsWfndEnd3LA==", + "engines": { + "node": "*" + }, + "peerDependencies": { + "@types/geojson": "*" + } + }, + "node_modules/@types/events": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.3.tgz", + "integrity": "sha512-trOc4AAUThEz9hapPtSd7wf5tiQKvTtu5b371UxXdTuqzIh0ArcRspRP0i0Viu+LXstIQ1z96t1nsPxT9ol01g==", + "dev": true + }, + "node_modules/@types/geojson": { + "version": "7946.0.13", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.13.tgz", + "integrity": "sha512-bmrNrgKMOhM3WsafmbGmC+6dsF2Z308vLFsQ3a/bT8X8Sv5clVYpPars/UPq+sAaJP+5OoLAYgwbkS5QEJdLUQ==" + }, + "node_modules/@types/mapbox__point-geometry": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz", + "integrity": "sha512-mUWlSxAmYLfwnRBmgYV86tgYmMIICX4kza8YnE/eIlywGe2XoOxlpVnXWwir92xRLjwyarqwpu2EJKD2pk0IUA==" + }, + "node_modules/@types/mapbox__vector-tile": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@types/mapbox__vector-tile/-/mapbox__vector-tile-1.3.4.tgz", + "integrity": "sha512-bpd8dRn9pr6xKvuEBQup8pwQfD4VUyqO/2deGjfpe6AwC8YRlyEipvefyRJUSiCJTZuCb8Pl1ciVV5ekqJ96Bg==", + "dependencies": { + "@types/geojson": "*", + "@types/mapbox__point-geometry": "*", + "@types/pbf": "*" + } + }, + "node_modules/@types/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==" + }, + "node_modules/@types/node": { + "version": "20.11.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.2.tgz", + "integrity": "sha512-cZShBaVa+UO1LjWWBPmWRR4+/eY/JR/UIEcDlVsw3okjWEu+rB7/mH6X3B/L+qJVHDLjk9QW/y2upp9wp1yDXA==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==" + }, + "node_modules/@types/pbf": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz", + "integrity": "sha512-j3pOPiEcWZ34R6a6mN07mUkM4o4Lwf6hPNt8eilOeZhTFbxFXmKhvXl9Y28jotFPaI1bpPDJsbCprUoNke6OrA==" + }, + "node_modules/@types/supercluster": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@types/supercluster/-/supercluster-7.1.3.tgz", + "integrity": "sha512-Z0pOY34GDFl3Q6hUFYf3HkTwKEE02e7QgtJppBt+beEAxnyOpJua+voGFvxINBHa06GwLFFym7gRPY2SiKIfIA==", + "dependencies": { + "@types/geojson": "*" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/bytewise": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/bytewise/-/bytewise-1.1.0.tgz", + "integrity": "sha512-rHuuseJ9iQ0na6UDhnrRVDh8YnWVlU6xM3VH6q/+yHDeUH2zIhUzP+2/h3LIrhLDBtTqzWpE3p3tP/boefskKQ==", + "dependencies": { + "bytewise-core": "^1.2.2", + "typewise": "^1.0.3" + } + }, + "node_modules/bytewise-core": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/bytewise-core/-/bytewise-core-1.2.3.tgz", + "integrity": "sha512-nZD//kc78OOxeYtRlVk8/zXqTB4gf/nlguL1ggWA8FuchMyOxcyHR4QPQZMUmA7czC+YnaBrPUCubqAWe50DaA==", + "dependencies": { + "typewise-core": "^1.2" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase-keys": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", + "dependencies": { + "camelcase": "^5.3.1", + "map-obj": "^4.0.0", + "quick-lru": "^4.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "node_modules/concat-stream": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "integrity": "sha512-H6xsIBfQ94aESBG8jGHXQ7i5AEpy5ZeVaLDOisDICiTCKpqEfr34/KmTrspKQNoLKNu9gTkovlpQcUi630AKiQ==", + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "inherits": "~2.0.1", + "readable-stream": "~2.0.0", + "typedarray": "~0.0.5" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, + "node_modules/csv2geojson": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/csv2geojson/-/csv2geojson-5.1.2.tgz", + "integrity": "sha512-G9A1mw7jwGta4z9x+mJehRj3OkVaFKMULRj8mZJxdjZ6XN/1Icp7G2RQ0T0vnQoYSNTufK8yPh2fRTRkBPAcdQ==", + "dependencies": { + "@mapbox/sexagesimal": "^1.1.0", + "concat-stream": "~1.5.1", + "d3-dsv": "1.0.1", + "meow": "^9.0.0" + }, + "bin": { + "csv2geojson": "csv2geojson" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/d3-dsv": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-1.0.1.tgz", + "integrity": "sha512-VjRi8bmInbdZsnNr5inlWEEd7GutNcQUb+gXgr4LUyt+8lZjAxU2PBPMNMBBLHCPwosiFcmdwBfnWFpN4/khsQ==", + "dependencies": { + "rw": "1" + }, + "bin": { + "csv2json": "bin/csv2json", + "csv2tsv": "bin/csv2tsv", + "tsv2csv": "bin/tsv2csv", + "tsv2json": "bin/tsv2json" + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decamelize-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz", + "integrity": "sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==", + "dependencies": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decamelize-keys/node_modules/map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/earcut": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", + "integrity": "sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==" + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/esbuild": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.18.tgz", + "integrity": "sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.15.18", + "@esbuild/linux-loong64": "0.15.18", + "esbuild-android-64": "0.15.18", + "esbuild-android-arm64": "0.15.18", + "esbuild-darwin-64": "0.15.18", + "esbuild-darwin-arm64": "0.15.18", + "esbuild-freebsd-64": "0.15.18", + "esbuild-freebsd-arm64": "0.15.18", + "esbuild-linux-32": "0.15.18", + "esbuild-linux-64": "0.15.18", + "esbuild-linux-arm": "0.15.18", + "esbuild-linux-arm64": "0.15.18", + "esbuild-linux-mips64le": "0.15.18", + "esbuild-linux-ppc64le": "0.15.18", + "esbuild-linux-riscv64": "0.15.18", + "esbuild-linux-s390x": "0.15.18", + "esbuild-netbsd-64": "0.15.18", + "esbuild-openbsd-64": "0.15.18", + "esbuild-sunos-64": "0.15.18", + "esbuild-windows-32": "0.15.18", + "esbuild-windows-64": "0.15.18", + "esbuild-windows-arm64": "0.15.18" + } + }, + "node_modules/esbuild-android-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.18.tgz", + "integrity": "sha512-wnpt3OXRhcjfIDSZu9bnzT4/TNTDsOUvip0foZOUBG7QbSt//w3QV4FInVJxNhKc/ErhUxc5z4QjHtMi7/TbgA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-android-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.18.tgz", + "integrity": "sha512-G4xu89B8FCzav9XU8EjsXacCKSG2FT7wW9J6hOc18soEHJdtWu03L3TQDGf0geNxfLTtxENKBzMSq9LlbjS8OQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.18.tgz", + "integrity": "sha512-2WAvs95uPnVJPuYKP0Eqx+Dl/jaYseZEUUT1sjg97TJa4oBtbAKnPnl3b5M9l51/nbx7+QAEtuummJZW0sBEmg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-darwin-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.18.tgz", + "integrity": "sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.18.tgz", + "integrity": "sha512-TT3uBUxkteAjR1QbsmvSsjpKjOX6UkCstr8nMr+q7zi3NuZ1oIpa8U41Y8I8dJH2fJgdC3Dj3CXO5biLQpfdZA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-freebsd-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.18.tgz", + "integrity": "sha512-R/oVr+X3Tkh+S0+tL41wRMbdWtpWB8hEAMsOXDumSSa6qJR89U0S/PpLXrGF7Wk/JykfpWNokERUpCeHDl47wA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-32": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.18.tgz", + "integrity": "sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.18.tgz", + "integrity": "sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.18.tgz", + "integrity": "sha512-UH779gstRblS4aoS2qpMl3wjg7U0j+ygu3GjIeTonCcN79ZvpPee12Qun3vcdxX+37O5LFxz39XeW2I9bybMVA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.18.tgz", + "integrity": "sha512-54qr8kg/6ilcxd+0V3h9rjT4qmjc0CccMVWrjOEM/pEcUzt8X62HfBSeZfT2ECpM7104mk4yfQXkosY8Quptug==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-mips64le": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.18.tgz", + "integrity": "sha512-Mk6Ppwzzz3YbMl/ZZL2P0q1tnYqh/trYZ1VfNP47C31yT0K8t9s7Z077QrDA/guU60tGNp2GOwCQnp+DYv7bxQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-ppc64le": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.18.tgz", + "integrity": "sha512-b0XkN4pL9WUulPTa/VKHx2wLCgvIAbgwABGnKMY19WhKZPT+8BxhZdqz6EgkqCLld7X5qiCY2F/bfpUUlnFZ9w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-riscv64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.18.tgz", + "integrity": "sha512-ba2COaoF5wL6VLZWn04k+ACZjZ6NYniMSQStodFKH/Pu6RxzQqzsmjR1t9QC89VYJxBeyVPTaHuBMCejl3O/xg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-linux-s390x": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.18.tgz", + "integrity": "sha512-VbpGuXEl5FCs1wDVp93O8UIzl3ZrglgnSQ+Hu79g7hZu6te6/YHgVJxCM2SqfIila0J3k0csfnf8VD2W7u2kzQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-netbsd-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.18.tgz", + "integrity": "sha512-98ukeCdvdX7wr1vUYQzKo4kQ0N2p27H7I11maINv73fVEXt2kyh4K4m9f35U1K43Xc2QGXlzAw0K9yoU7JUjOg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-openbsd-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.18.tgz", + "integrity": "sha512-yK5NCcH31Uae076AyQAXeJzt/vxIo9+omZRKj1pauhk3ITuADzuOx5N2fdHrAKPxN+zH3w96uFKlY7yIn490xQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-sunos-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.18.tgz", + "integrity": "sha512-On22LLFlBeLNj/YF3FT+cXcyKPEI263nflYlAhz5crxtp3yRG1Ugfr7ITyxmCmjm4vbN/dGrb/B7w7U8yJR9yw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-32": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.18.tgz", + "integrity": "sha512-o+eyLu2MjVny/nt+E0uPnBxYuJHBvho8vWsC2lV61A7wwTWC3jkN2w36jtA+yv1UgYkHRihPuQsL23hsCYGcOQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.18.tgz", + "integrity": "sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/esbuild-windows-arm64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.18.tgz", + "integrity": "sha512-q9bsYzegpZcLziq0zgUi5KqGVtfhjxGbnksaBFYmWLxeV/S1fK4OLdq2DFYnXcLMjlZw2L0jLsk1eGoB522WXQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/fuzzy": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/fuzzy/-/fuzzy-0.1.3.tgz", + "integrity": "sha512-/gZffu4ykarLrCiP3Ygsa86UAo1E5vEVlvTrpkKywXSbP9Xhln3oSp9QSV57gEq3JFFpGJ4GZ+5zdEp3FcUh4w==", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/geojson-vt": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz", + "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg==" + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/gl-matrix": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/gl-matrix/-/gl-matrix-3.4.3.tgz", + "integrity": "sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==" + }, + "node_modules/global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/hard-rejection": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" + }, + "node_modules/json-stringify-pretty-compact": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-stringify-pretty-compact/-/json-stringify-pretty-compact-3.0.0.tgz", + "integrity": "sha512-Rc2suX5meI0S3bfdZuA7JMFBGkJ875ApfVyq2WHELjBiiG22My/l7/8zPpH/CfFVQHuVLd8NLR0nv6vi0BYYKA==" + }, + "node_modules/kdbush": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz", + "integrity": "sha512-WbCVYJ27Sz8zi9Q7Q0xHC+05iwkm3Znipc2XTlrnJbsHMYktW4hPhXUE8Ys1engBrvffoSCqbil1JQAa7clRpA==" + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/map-obj": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.3.0.tgz", + "integrity": "sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/maplibre-gl": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-3.6.2.tgz", + "integrity": "sha512-krg2KFIdOpLPngONDhP6ixCoWl5kbdMINP0moMSJFVX7wX1Clm2M9hlNKXS8vBGlVWwR5R3ZfI6IPrYz7c+aCQ==", + "dependencies": { + "@mapbox/geojson-rewind": "^0.5.2", + "@mapbox/jsonlint-lines-primitives": "^2.0.2", + "@mapbox/point-geometry": "^0.1.0", + "@mapbox/tiny-sdf": "^2.0.6", + "@mapbox/unitbezier": "^0.0.1", + "@mapbox/vector-tile": "^1.3.1", + "@mapbox/whoots-js": "^3.1.0", + "@maplibre/maplibre-gl-style-spec": "^19.3.3", + "@types/geojson": "^7946.0.13", + "@types/mapbox__point-geometry": "^0.1.4", + "@types/mapbox__vector-tile": "^1.3.4", + "@types/pbf": "^3.0.5", + "@types/supercluster": "^7.1.3", + "earcut": "^2.2.4", + "geojson-vt": "^3.2.1", + "gl-matrix": "^3.4.3", + "global-prefix": "^3.0.0", + "kdbush": "^4.0.2", + "murmurhash-js": "^1.0.0", + "pbf": "^3.2.1", + "potpack": "^2.0.0", + "quickselect": "^2.0.0", + "supercluster": "^8.0.1", + "tinyqueue": "^2.0.3", + "vt-pbf": "^3.1.3" + }, + "engines": { + "node": ">=16.14.0", + "npm": ">=8.1.0" + }, + "funding": { + "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1" + } + }, + "node_modules/maplibre-gl-vector-text-protocol": { + "version": "0.0.3", + "resolved": "git+ssh://git@github.com/jimmyrocks/maplibre-gl-vector-text-protocol.git#9877992676b683431feff403954f6b771de4f9fe", + "license": "MIT", + "dependencies": { + "@mapbox/polyline": "^1.2.1", + "@tmcw/togeojson": "5.8.1", + "csv2geojson": "^5.1.2", + "osm2geojson-lite": "^0.9.4", + "topojson-client": "^3.1.0" + } + }, + "node_modules/meow": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-9.0.0.tgz", + "integrity": "sha512-+obSblOQmRhcyBt62furQqRAQpNyWXo8BuQ5bN7dG8wmwQ+vwHKp/rCFD4CrTP8CsDQD1sjoZ94K417XEUk8IQ==", + "dependencies": { + "@types/minimist": "^1.2.0", + "camelcase-keys": "^6.2.2", + "decamelize": "^1.2.0", + "decamelize-keys": "^1.1.0", + "hard-rejection": "^2.1.0", + "minimist-options": "4.1.0", + "normalize-package-data": "^3.0.0", + "read-pkg-up": "^7.0.1", + "redent": "^3.0.0", + "trim-newlines": "^3.0.0", + "type-fest": "^0.18.0", + "yargs-parser": "^20.2.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minimist-options": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", + "dependencies": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0", + "kind-of": "^6.0.3" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/murmurhash-js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/murmurhash-js/-/murmurhash-js-1.0.0.tgz", + "integrity": "sha512-TvmkNhkv8yct0SVBSy+o8wYzXjE4Zz3PCesbfs8HiCXXdcTuocApFv11UWlNFWKYsP2okqrhb7JNlSm9InBhIw==" + }, + "node_modules/normalize-package-data": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", + "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", + "dependencies": { + "hosted-git-info": "^4.0.1", + "is-core-module": "^2.5.0", + "semver": "^7.3.4", + "validate-npm-package-license": "^3.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/osm2geojson-lite": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/osm2geojson-lite/-/osm2geojson-lite-0.9.4.tgz", + "integrity": "sha512-qRGknILD+Ym2v4KRAMp6Yp3ypFTWpGmK7UnNdWo/GRZ7CMG/u8bewInj6UQ98byVN89YY5i6xvgA7cMO4N09bg==", + "bin": { + "osm2geojson-lite": "osm2geojson-lite" + }, + "optionalDependencies": { + "@types/geojson": "^1.0.6" + } + }, + "node_modules/osm2geojson-lite/node_modules/@types/geojson": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-1.0.6.tgz", + "integrity": "sha512-Xqg/lIZMrUd0VRmSRbCAewtwGZiAk3mEUDvV4op1tGl+LvyPcb/MIOSxTl9z+9+J+R4/vpjiCAT4xeKzH9ji1w==", + "optional": true + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "node_modules/pbf": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz", + "integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==", + "dependencies": { + "ieee754": "^1.1.12", + "resolve-protobuf-schema": "^2.1.0" + }, + "bin": { + "pbf": "bin/pbf" + } + }, + "node_modules/potpack": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-2.0.0.tgz", + "integrity": "sha512-Q+/tYsFU9r7xoOJ+y/ZTtdVQwTWfzjbiXBDMM/JKUux3+QPP02iUuIoeBQ+Ot6oEDlC+/PGjB/5A3K7KKb7hcw==" + }, + "node_modules/process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha512-yN0WQmuCX63LP/TMvAg31nvT6m4vDqJEiiv2CAZqWOGNWutc9DfDk1NPYYmKUFmaVM2UwDowH4u5AHWYP/jxKw==" + }, + "node_modules/protocol-buffers-schema": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", + "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==" + }, + "node_modules/quick-lru": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", + "engines": { + "node": ">=8" + } + }, + "node_modules/quickselect": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", + "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" + }, + "node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" + }, + "node_modules/read-pkg/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/read-pkg/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha512-TXcFfb63BQe1+ySzsHZI/5v1aJPCShfqvWJ64ayNImXMsN1Cd0YGk/wm8KB7/OeessgPc9QvS9Zou8QTkFzsLw==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-protobuf-schema": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", + "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==", + "dependencies": { + "protocol-buffers-schema": "^3.3.1" + } + }, + "node_modules/rw": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", + "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sort-asc": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sort-asc/-/sort-asc-0.2.0.tgz", + "integrity": "sha512-umMGhjPeHAI6YjABoSTrFp2zaBtXBej1a0yKkuMUyjjqu6FJsTF+JYwCswWDg+zJfk/5npWUUbd33HH/WLzpaA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sort-desc": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sort-desc/-/sort-desc-0.2.0.tgz", + "integrity": "sha512-NqZqyvL4VPW+RAxxXnB8gvE1kyikh8+pR+T+CXLksVRN9eiQqkQlPwqWYU0mF9Jm7UnctShlxLyAt1CaBOTL1w==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sort-object": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sort-object/-/sort-object-3.0.3.tgz", + "integrity": "sha512-nK7WOY8jik6zaG9CRwZTaD5O7ETWDLZYMM12pqY8htll+7dYeqGfEUPcUBHOpSJg2vJOrvFIY2Dl5cX2ih1hAQ==", + "dependencies": { + "bytewise": "^1.1.0", + "get-value": "^2.0.2", + "is-extendable": "^0.1.1", + "sort-asc": "^0.2.0", + "sort-desc": "^0.2.0", + "union-value": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz", + "integrity": "sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==" + }, + "node_modules/split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dependencies": { + "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split-string/node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==", + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/split-string/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/subtag": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/subtag/-/subtag-0.5.0.tgz", + "integrity": "sha512-CaIBcTSb/nyk4xiiSOtZYz1B+F12ZxW8NEp54CdT+84vmh/h4sUnHGC6+KQXUfED8u22PQjCYWfZny8d2ELXwg==" + }, + "node_modules/suggestions-list": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/suggestions-list/-/suggestions-list-0.0.2.tgz", + "integrity": "sha512-Yw0fdq14c6RQWQIfE1/8WEi9Dp8rjyCD6FhYA/Tit2/ADbE9Y4ADG4ezlvivsa8Civ5nz++pyVVBMjOMlgIUJw==", + "dependencies": { + "fuzzy": "^0.1.1", + "xtend": "^4.0.0" + } + }, + "node_modules/supercluster": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", + "integrity": "sha512-IiOea5kJ9iqzD2t7QJq/cREyLHTtSmUT6gQsweojg9WH2sYJqZK9SswTu6jrscO6D1G5v5vYZ9ru/eq85lXeZQ==", + "dependencies": { + "kdbush": "^4.0.2" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tinyqueue": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-2.0.3.tgz", + "integrity": "sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA==" + }, + "node_modules/topojson-client": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/topojson-client/-/topojson-client-3.1.0.tgz", + "integrity": "sha512-605uxS6bcYxGXw9qi62XyrV6Q3xwbndjachmNxu8HWTtVPxZfEJN9fd/SZS1Q54Sn2y0TMyMxFj/cJINqGHrKw==", + "dependencies": { + "commander": "2" + }, + "bin": { + "topo2geo": "bin/topo2geo", + "topomerge": "bin/topomerge", + "topoquantize": "bin/topoquantize" + } + }, + "node_modules/trim-newlines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.1.tgz", + "integrity": "sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/type-fest": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", + "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typedarray": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.7.tgz", + "integrity": "sha512-ueeb9YybpjhivjbHP2LdFDAjbS948fGEPj+ACAMs4xCMmh72OCOMQWBQKlaN4ZNQ04yfLSDLSx1tGRIoWimObQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typewise": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typewise/-/typewise-1.0.3.tgz", + "integrity": "sha512-aXofE06xGhaQSPzt8hlTY+/YWQhm9P0jYUp1f2XtmW/3Bk0qzXcyFWAtPoo2uTGQj1ZwbDuSyuxicq+aDo8lCQ==", + "dependencies": { + "typewise-core": "^1.2.0" + } + }, + "node_modules/typewise-core": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/typewise-core/-/typewise-core-1.2.0.tgz", + "integrity": "sha512-2SCC/WLzj2SbUwzFOzqMCkz5amXLlxtJqDKTICqg30x+2DZxcfZN2MvQZmGfXWKNWaKK9pBPsvkcwv8bF/gxKg==" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/vt-pbf": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/vt-pbf/-/vt-pbf-3.1.3.tgz", + "integrity": "sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==", + "dependencies": { + "@mapbox/point-geometry": "0.1.0", + "@mapbox/vector-tile": "^1.3.1", + "pbf": "^3.2.1" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "engines": { + "node": ">=10" + } + } + } +} diff --git a/assets/maplibre/package.json b/assets/maplibre/package.json new file mode 100644 index 0000000..ab0a010 --- /dev/null +++ b/assets/maplibre/package.json @@ -0,0 +1,18 @@ +{ + "private": true, + "scripts": { + "build": "esbuild main.js --bundle --minify --outfile=../../lib/assets/maplibre/build/main.js --format=esm --loader:.js=jsx", + "dev": "esbuild main.js --bundle --minify --outfile=../../lib/assets/maplibre/build/main.js --format=esm --loader:.js=jsx --watch" + }, + "dependencies": { + "@maplibre/maplibre-gl-geocoder": "^1.5.0", + "maplibre-gl": "^3.6.2", + "maplibre-gl-vector-text-protocol": "github:jimmyrocks/maplibre-gl-vector-text-protocol" + }, + "devDependencies": { + "@types/events": "^3.0.3", + "@types/node": "^20.11.2", + "esbuild": "^0.15.16", + "events": "^3.3.0" + } +} diff --git a/lib/assets/maplibre/build/main.css b/lib/assets/maplibre/build/main.css new file mode 100644 index 0000000..1fc0a2c --- /dev/null +++ b/lib/assets/maplibre/build/main.css @@ -0,0 +1 @@ +.maplibregl-ctrl-geocoder,.maplibregl-ctrl-geocoder *,.maplibregl-ctrl-geocoder *:after,.maplibregl-ctrl-geocoder *:before{box-sizing:border-box}.maplibregl-ctrl-geocoder{font-size:18px;line-height:24px;font-family:Open Sans,Helvetica Neue,Arial,Helvetica,sans-serif;position:relative;background-color:#fff;width:100%;min-width:240px;z-index:1;border-radius:4px;transition:width .25s,min-width .25s}.maplibregl-ctrl-geocoder--input{font:inherit;width:100%;border:0;background-color:transparent;margin:0;height:50px;color:#404040;color:#000000bf;padding:6px 45px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.maplibregl-ctrl-geocoder--input::-ms-clear{display:none}.maplibregl-ctrl-geocoder--input:focus{color:#404040;color:#000000bf;outline:0;box-shadow:none;outline:thin dotted}.maplibregl-ctrl-geocoder .maplibregl-ctrl-geocoder--pin-right>*{z-index:2;position:absolute;right:8px;top:7px;display:none}.maplibregl-ctrl-geocoder,.maplibregl-ctrl-geocoder .suggestions{box-shadow:0 0 10px 2px #0000001a}.maplibregl-ctrl-geocoder.maplibregl-ctrl-geocoder--collapsed{width:50px;min-width:50px;transition:width .25s,min-width .25s}.maplibregl-ctrl-geocoder .suggestions{background-color:#fff;border-radius:4px;left:0;list-style:none;margin:0;padding:0;position:absolute;width:100%;top:110%;top:calc(100% + 6px);z-index:1000;overflow:hidden;font-size:15px}.maplibregl-ctrl-bottom-left .suggestions,.maplibregl-ctrl-bottom-right .suggestions{top:auto;bottom:100%}.maplibregl-ctrl-geocoder .suggestions>li>a{cursor:default;display:block;padding:6px 12px;color:#404040}.maplibregl-ctrl-geocoder .suggestions>.active>a,.maplibregl-ctrl-geocoder .suggestions>li>a:hover{color:#404040;background-color:#f3f3f3;text-decoration:none;cursor:pointer}.maplibregl-ctrl-geocoder--suggestion{display:flex;flex-direction:row;align-items:center}.maplibre-ctrl-geocoder--suggestion-icon{min-width:30px;min-height:24px;max-width:30px;max-height:24px;padding-right:12px}.maplibregl-ctrl-geocoder--suggestion-info{display:flex;flex-direction:column}.maplibregl-ctrl-geocoder--suggestion-match{font-weight:700}.maplibregl-ctrl-geocoder--suggestion-title,.maplibregl-ctrl-geocoder--suggestion-address{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.maplibregl-ctrl-geocoder--result{display:flex;flex-direction:row;align-items:center}.maplibre-ctrl-geocoder--result-icon{min-width:30px;min-height:24px;max-width:30px;max-height:24px;padding-right:12px}.maplibregl-ctrl-geocoder--result-title{font-weight:700}.maplibregl-ctrl-geocoder--result-title,.maplibregl-ctrl-geocoder--result-address{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.maplibregl-ctrl-geocoder--icon{display:inline-block;vertical-align:middle;speak:none;fill:#757575;top:15px}.maplibregl-ctrl-geocoder--icon-search{position:absolute;top:13px;left:12px;width:23px;height:23px}.maplibregl-ctrl-geocoder--button{padding:0;margin:0;border:none;cursor:pointer;background:#fff;line-height:1}.maplibregl-ctrl-geocoder--icon-close{width:20px;height:20px;margin-top:8px;margin-right:3px}.maplibregl-ctrl-geocoder--button:hover .maplibregl-ctrl-geocoder--icon-close{fill:#909090}.maplibregl-ctrl-geocoder--icon-loading{width:26px;height:26px;margin-top:5px;margin-right:0;-moz-animation:rotate .8s infinite cubic-bezier(.45,.05,.55,.95);-webkit-animation:rotate .8s infinite cubic-bezier(.45,.05,.55,.95);animation:rotate .8s infinite cubic-bezier(.45,.05,.55,.95)}@-webkit-keyframes rotate{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@media screen and (min-width: 640px){.maplibregl-ctrl-geocoder.maplibregl-ctrl-geocoder--collapsed{width:36px;min-width:36px}.maplibregl-ctrl-geocoder{width:33.3333%;font-size:15px;line-height:20px;max-width:360px}.maplibregl-ctrl-geocoder .suggestions{font-size:13px}.maplibregl-ctrl-geocoder--icon{top:8px}.maplibregl-ctrl-geocoder--icon-close{width:16px;height:16px;margin-top:3px;margin-right:0}.maplibregl-ctrl-geocoder--icon-search{left:7px;width:20px;height:20px}.maplibregl-ctrl-geocoder--input{height:36px;padding:6px 35px}.maplibregl-ctrl-geocoder--icon-loading{width:26px;height:26px;margin-top:-2px;margin-right:-5px}.maplibre-gl-geocoder--error{color:#909090;padding:6px 12px;font-size:16px;text-align:center}}.maplibregl-map{-webkit-tap-highlight-color:rgb(0 0 0/0);font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (-ms-high-contrast:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (-ms-high-contrast:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23999' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8h-8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8h-8z'/%3E%3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (-ms-high-contrast:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (-ms-high-contrast:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.255 1.255 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.255 1.255 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5.11 5.11 0 0 1 .314-.787l.009-.016a4.623 4.623 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.548 4.548 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4.314.319.566.676.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.416 2.416 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.448 2.448 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675c.211.2.381.43.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.76 4.76 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.407 3.407 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.255 1.255 0 0 1 .689 1.004 4.73 4.73 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528 0 .343-.02.694-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.815 5.815 0 0 1-.548-2.512c0-.286.017-.567.053-.843a1.255 1.255 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.778 4.778 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.47 4.47 0 0 1-1.935-.424 1.252 1.252 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.402 2.402 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.703 4.703 0 0 1-1.782 1.884 4.767 4.767 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.47 4.47 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a4.983 4.983 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.255 1.255 0 0 1-1.115.676h-.098a1.255 1.255 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15c.329-.237.574-.499.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267c-.088-.22-.264-.438-.526-.658l-.032-.028a3.16 3.16 0 0 0-.668-.428l-.27-.12a3.293 3.293 0 0 0-1.235-.23c-.757 0-1.415.163-1.974.493a3.36 3.36 0 0 0-1.3 1.382c-.297.593-.444 1.284-.444 2.074 0 .8.17 1.503.51 2.107a3.795 3.795 0 0 0 1.382 1.381 3.883 3.883 0 0 0 1.893.477c.53 0 1.015-.11 1.455-.33zm-2.789-5.38c-.384.45-.575 1.038-.575 1.762 0 .735.186 1.332.559 1.794.384.45.933.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.17 2.17 0 0 0 .468-.29l.178-.161a2.163 2.163 0 0 0 .397-.561c.163-.333.244-.717.244-1.15v-.115c0-.472-.098-.894-.296-1.267l-.043-.077a2.211 2.211 0 0 0-.633-.709l-.13-.086-.047-.028a2.099 2.099 0 0 0-1.073-.285c-.702 0-1.244.231-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.958.958 0 0 0-.353-.389.851.851 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.626 2.626 0 0 0 .331.423c.213.22.464.402.755.548l.173.074c.433.17.93.255 1.49.255.68 0 1.295-.165 1.844-.493a3.447 3.447 0 0 0 1.316-1.4c.329-.603.493-1.299.493-2.089 0-1.273-.33-2.243-.988-2.913-.658-.68-1.52-1.02-2.584-1.02-.598 0-1.124.115-1.575.347a2.807 2.807 0 0 0-.415.262l-.199.166a3.35 3.35 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138c.137.193.297.36.48.5l.155.11.053.034c.34.197.713.297 1.119.297.714 0 1.262-.225 1.645-.675.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.29 0-.569.053-.835.16a2.366 2.366 0 0 0-.284.136 1.99 1.99 0 0 0-.363.254 2.237 2.237 0 0 0-.46.569l-.082.162a2.56 2.56 0 0 0-.213 1.072v.115c0 .471.098.894.296 1.267l.135.211zm.964-.818a1.11 1.11 0 0 0 .367.385.937.937 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a.995.995 0 0 0-.503.135l-.012.007a.859.859 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.43 1.43 0 0 0 .14.66zm15.7-6.222c.232-.23.346-.516.346-.856a1.053 1.053 0 0 0-.345-.79 1.175 1.175 0 0 0-.84-.329c-.34 0-.625.11-.855.33a1.053 1.053 0 0 0-.346.79c0 .34.115.625.346.855.23.23.516.346.856.346.34 0 .62-.115.839-.346zm4.337 9.314.033-1.332c.128.269.324.518.59.747l.098.081a3.727 3.727 0 0 0 .316.224l.223.122a3.21 3.21 0 0 0 1.44.322 3.785 3.785 0 0 0 1.875-.477 3.52 3.52 0 0 0 1.382-1.366c.352-.593.526-1.29.526-2.09 0-.79-.147-1.48-.444-2.073a3.235 3.235 0 0 0-1.283-1.399c-.549-.34-1.195-.51-1.942-.51a3.476 3.476 0 0 0-1.527.344l-.086.043-.165.09a3.412 3.412 0 0 0-.33.214c-.288.21-.507.446-.656.707a1.893 1.893 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.482 2.482 0 0 0 .566.7c.078.065.159.125.245.18l.144.08a2.105 2.105 0 0 0 .975.232c.713 0 1.262-.225 1.645-.675.384-.46.576-1.053.576-1.778 0-.734-.192-1.327-.576-1.777-.373-.46-.921-.692-1.645-.692a2.18 2.18 0 0 0-1.015.235c-.147.075-.285.17-.415.282l-.15.142a2.086 2.086 0 0 0-.42.594c-.149.32-.223.685-.223 1.1v.115c0 .47.097.89.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.868.868 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.13 1.13 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013c.23-.087.472-.134.724-.14l.069-.002c.329 0 .542.033.642.099l.247-1.794c-.13-.066-.37-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2.086 2.086 0 0 0-.411.148 2.18 2.18 0 0 0-.4.249 2.482 2.482 0 0 0-.485.499 2.659 2.659 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884c0-.364.053-.678.159-.943a1.49 1.49 0 0 1 .466-.636 2.52 2.52 0 0 1 .399-.253 2.19 2.19 0 0 1 .224-.099zm9.784 2.656.05-.922c0-1.162-.285-2.062-.856-2.698-.559-.647-1.42-.97-2.584-.97-.746 0-1.415.163-2.007.493a3.462 3.462 0 0 0-1.4 1.382c-.329.604-.493 1.306-.493 2.106 0 .714.143 1.371.428 1.975.285.593.73 1.07 1.332 1.432.604.351 1.355.526 2.255.526.649 0 1.204-.062 1.668-.185l.044-.012.135-.04c.409-.122.736-.263.984-.421l-.542-1.267c-.2.108-.415.199-.642.274l-.297.087c-.34.088-.773.131-1.3.131-.636 0-1.135-.147-1.497-.444a1.573 1.573 0 0 1-.192-.193c-.244-.294-.415-.705-.512-1.234l-.004-.021h5.43zm-5.427-1.256-.003.022h3.752v-.138c-.007-.485-.104-.857-.288-1.118a1.056 1.056 0 0 0-.156-.176c-.307-.285-.746-.428-1.316-.428-.657 0-1.155.202-1.494.604-.253.3-.417.712-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81c-.68 0-1.311-.16-1.893-.478a3.795 3.795 0 0 1-1.381-1.382c-.34-.604-.51-1.306-.51-2.106 0-.79.147-1.482.444-2.074a3.364 3.364 0 0 1 1.3-1.382c.559-.33 1.217-.494 1.974-.494a3.293 3.293 0 0 1 1.234.231 3.341 3.341 0 0 1 .97.575c.264.22.44.439.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332c-.186.395-.526.746-1.02 1.053a3.167 3.167 0 0 1-1.662.444zm.296-1.482c.626 0 1.152-.214 1.58-.642.428-.44.642-1.01.642-1.711v-.115c0-.472-.098-.894-.296-1.267a2.211 2.211 0 0 0-.807-.872 2.098 2.098 0 0 0-1.119-.313c-.702 0-1.245.231-1.629.692-.384.45-.575 1.037-.575 1.76 0 .736.186 1.333.559 1.795.384.45.933.675 1.645.675zm6.521-6.237h1.711v1.4c.604-1.065 1.547-1.597 2.83-1.597 1.064 0 1.926.34 2.584 1.02.659.67.988 1.641.988 2.914 0 .79-.164 1.487-.493 2.09a3.456 3.456 0 0 1-1.316 1.399 3.51 3.51 0 0 1-1.844.493c-.636 0-1.19-.11-1.662-.329a2.665 2.665 0 0 1-1.086-.97l.017 5.134h-1.728V9.242zm4.048 6.22c.714 0 1.262-.224 1.645-.674.385-.46.576-1.048.576-1.762 0-.746-.192-1.338-.576-1.777-.372-.45-.92-.675-1.645-.675-.395 0-.768.098-1.12.296-.34.187-.613.46-.822.823-.197.351-.296.763-.296 1.234v.115c0 .472.098.894.296 1.267.209.362.483.647.823.855.34.197.713.297 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.159 1.159 0 0 1-.856-.346 1.165 1.165 0 0 1-.346-.856 1.053 1.053 0 0 1 .346-.79c.23-.219.516-.329.856-.329.329 0 .609.11.839.33a1.053 1.053 0 0 1 .345.79 1.159 1.159 0 0 1-.345.855c-.22.23-.5.346-.84.346zm7.875 9.133a3.167 3.167 0 0 1-1.662-.444c-.482-.307-.817-.658-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283c.186-.438.548-.812 1.086-1.119a3.486 3.486 0 0 1 1.778-.477c.746 0 1.393.17 1.942.51a3.235 3.235 0 0 1 1.283 1.4c.297.592.444 1.282.444 2.072 0 .8-.175 1.498-.526 2.09a3.52 3.52 0 0 1-1.382 1.366 3.785 3.785 0 0 1-1.876.477zm-.296-1.481c.713 0 1.26-.225 1.645-.675.384-.46.577-1.053.577-1.778 0-.734-.193-1.327-.577-1.776-.373-.46-.921-.692-1.645-.692a2.115 2.115 0 0 0-1.58.659c-.428.428-.642.992-.642 1.694v.115c0 .473.098.895.296 1.267a2.385 2.385 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481c.176-.505.46-.91.856-1.217a2.14 2.14 0 0 1 1.349-.46c.351 0 .593.032.724.098l-.247 1.794c-.099-.066-.313-.099-.642-.099-.516 0-.988.164-1.416.494-.417.329-.626.855-.626 1.58v3.883h-1.777V9.242zm9.534 7.718c-.9 0-1.651-.175-2.255-.526-.603-.362-1.047-.84-1.332-1.432a4.567 4.567 0 0 1-.428-1.975c0-.8.164-1.502.493-2.106a3.462 3.462 0 0 1 1.4-1.382c.592-.33 1.262-.494 2.007-.494 1.163 0 2.024.324 2.584.97.57.637.856 1.537.856 2.7 0 .296-.017.603-.05.92h-5.43c.12.67.356 1.153.708 1.45.362.296.86.443 1.497.443.526 0 .96-.044 1.3-.131a4.123 4.123 0 0 0 .938-.362l.542 1.267c-.274.175-.647.329-1.119.46-.472.132-1.042.197-1.711.197zm1.596-4.558c.01-.68-.137-1.158-.444-1.432-.307-.285-.746-.428-1.316-.428-1.152 0-1.815.62-1.991 1.86h3.752z'/%3E%3Cg fill-rule='evenodd' stroke-width='1.036'%3E%3Cpath fill='%23000' fill-opacity='.4' d='m8.166 16.146-.002.002a1.54 1.54 0 0 1-2.009 0l-.002-.002-.043-.034-.002-.002-.199-.162H4.377a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659H8.411l-.202.164zm-1.121-.905a.29.29 0 0 0 .113.023.286.286 0 0 0 .189-.07l.077-.063c.634-.508 4.672-3.743 4.672-7.575 0-2.55-2.215-4.625-4.938-4.625S2.221 5.006 2.221 7.556c0 3.225 2.86 6.027 4.144 7.137h.004l.04.038.484.4.077.063a.628.628 0 0 0 .074.047zm-2.52-.548a16.898 16.898 0 0 1-1.183-1.315C2.187 11.942.967 9.897.967 7.555c0-3.319 2.855-5.88 6.192-5.88 3.338 0 6.193 2.561 6.193 5.881 0 2.34-1.22 4.387-2.376 5.822a16.898 16.898 0 0 1-1.182 1.315h.15a1.912 1.912 0 0 1 1.914 1.914v1.84a1.912 1.912 0 0 1-1.914 1.914H4.377a1.912 1.912 0 0 1-1.914-1.914v-1.84a1.912 1.912 0 0 1 1.914-1.914zm3.82-6.935c0 .692-.55 1.222-1.187 1.222s-1.185-.529-1.185-1.222.548-1.222 1.185-1.222c.638 0 1.186.529 1.186 1.222zm-1.186 2.477c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477zm2.048 7.71H5.114v-.838h4.093z'/%3E%3Cpath fill='%23e1e3e9' d='M2.222 7.555c0-2.55 2.214-4.625 4.937-4.625 2.723 0 4.938 2.075 4.938 4.625 0 3.832-4.038 7.068-4.672 7.575l-.077.063a.286.286 0 0 1-.189.07.286.286 0 0 1-.188-.07l-.077-.063c-.634-.507-4.672-3.743-4.672-7.575zm4.937 2.68c1.348 0 2.442-1.11 2.442-2.478S8.507 5.28 7.159 5.28 4.72 6.39 4.72 7.758s1.092 2.477 2.44 2.477z'/%3E%3Cpath fill='%23fff' d='M4.377 15.948a.657.657 0 0 0-.659.659v1.84a.657.657 0 0 0 .659.659h5.565a.657.657 0 0 0 .659-.659v-1.84a.657.657 0 0 0-.659-.659zm4.83 1.16H5.114v.838h4.093z'/%3E%3C/g%3E%3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:#ffffff80;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:"";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:rgba(0,0,0,.4);color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999} diff --git a/lib/assets/maplibre/build/main.js b/lib/assets/maplibre/build/main.js new file mode 100644 index 0000000..61952ad --- /dev/null +++ b/lib/assets/maplibre/build/main.js @@ -0,0 +1,587 @@ +var cp=Object.create;var Zh=Object.defineProperty;var gp=Object.getOwnPropertyDescriptor;var hp=Object.getOwnPropertyNames;var up=Object.getPrototypeOf,dp=Object.prototype.hasOwnProperty;var Rl=(k=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(k,{get:(O,re)=>(typeof require<"u"?require:O)[re]}):k)(function(k){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+k+'" is not supported')});var cn=(k,O)=>()=>(O||k((O={exports:{}}).exports,O),O.exports);var pp=(k,O,re,ue)=>{if(O&&typeof O=="object"||typeof O=="function")for(let Ie of hp(O))!dp.call(k,Ie)&&Ie!==re&&Zh(k,Ie,{get:()=>O[Ie],enumerable:!(ue=gp(O,Ie))||ue.enumerable});return k};var Xc=(k,O,re)=>(re=k!=null?cp(up(k)):{},pp(O||!k||!k.__esModule?Zh(re,"default",{value:k,enumerable:!0}):re,k));var Bh=cn((Lc,Hc)=>{(function(k,O){typeof Lc=="object"&&typeof Hc<"u"?Hc.exports=O():typeof define=="function"&&define.amd?define(O):(k=typeof globalThis<"u"?globalThis:k||self,k.maplibregl=O())})(Lc,function(){"use strict";var k,O,re;function ue(c,De){if(!k)k=De;else if(!O)O=De;else{var ee="var sharedChunk = {}; ("+k+")(sharedChunk); ("+O+")(sharedChunk);",yt={};k(yt),re=De(yt),typeof window<"u"&&(re.workerUrl=window.URL.createObjectURL(new Blob([ee],{type:"text/javascript"})))}}ue(["exports"],function(c){"use strict";function De(i,e,s,r){return new(s||(s=Promise))(function(a,h){function d(A){try{C(r.next(A))}catch(b){h(b)}}function p(A){try{C(r.throw(A))}catch(b){h(b)}}function C(A){var b;A.done?a(A.value):(b=A.value,b instanceof s?b:new s(function(x){x(b)})).then(d,p)}C((r=r.apply(i,e||[])).next())})}function ee(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var yt=st;function st(i,e){this.x=i,this.y=e}st.prototype={clone:function(){return new st(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},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(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,s=i.y-this.y;return e*e+s*s},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),s=Math.sin(i),r=s*this.x+e*this.y;return this.x=e*this.x-s*this.y,this.y=r,this},_rotateAround:function(i,e){var s=Math.cos(i),r=Math.sin(i),a=e.y+r*(this.x-e.x)+s*(this.y-e.y);return this.x=e.x+s*(this.x-e.x)-r*(this.y-e.y),this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},st.convert=function(i){return i instanceof st?i:Array.isArray(i)?new st(i[0],i[1]):i};var Ve=ee(yt),di=Qi;function Qi(i,e,s,r){this.cx=3*i,this.bx=3*(s-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=s,this.p2y=r}Qi.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var s=i,r=0;r<8;r++){var a=this.sampleCurveX(s)-i;if(Math.abs(a)a?d=s:p=s,s=.5*(p-d)+d;return s},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var Bi=ee(di);let Qt,qt;function qi(){return Qt==null&&(Qt=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Qt}function pt(){if(qt==null&&(qt=!1,qi())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let r=0;r<5*5;r++){let a=4*r;e.fillStyle=`rgb(${a},${a+1},${a+2})`,e.fillRect(r%5,Math.floor(r/5),1,1)}let s=e.getImageData(0,0,5,5).data;for(let r=0;r<5*5*4;r++)if(r%4!=3&&s[r]!==r){qt=!0;break}}}return qt||!1}function os(i,e,s,r){let a=new Bi(i,e,s,r);return function(h){return a.solve(h)}}let as=os(.25,.1,.25,1);function Ei(i,e,s){return Math.min(s,Math.max(e,i))}function Gi(i,e,s){let r=s-e,a=((i-e)%r+r)%r+e;return a===e?s:a}function _t(i,...e){for(let s of e)for(let r in s)i[r]=s[r];return i}let Ri=1;function Vt(i,e,s){let r={};for(let a in i)r[a]=e.call(s||this,i[a],a,i);return r}function ls(i,e,s){let r={};for(let a in i)e.call(s||this,i[a],a,i)&&(r[a]=i[a]);return r}function Di(i){return Array.isArray(i)?i.map(Di):typeof i=="object"&&i?Vt(i,Di):i}let fs={};function yi(i){fs[i]||(typeof console<"u"&&console.warn(i),fs[i]=!0)}function Vi(i,e,s){return(s.y-i.y)*(e.x-i.x)>(e.y-i.y)*(s.x-i.x)}function Ts(i){let e=0;for(let s,r,a=0,h=i.length,d=h-1;a"u")throw new Error("VideoFrame not supported");let h=new VideoFrame(i,{timestamp:0});try{let d=h?.format;if(!d||!d.startsWith("BGR")&&!d.startsWith("RGB"))throw new Error(`Unrecognized format ${d}`);let p=d.startsWith("BGR"),C=new Uint8ClampedArray(r*a*4);if(yield h.copyTo(C,function(A,b,x,S,G){let R=4*Math.max(-b,0),M=(Math.max(0,x)-x)*S*4+R,P=4*S,N=Math.max(0,b),ne=Math.max(0,x);return{rect:{x:N,y:ne,width:Math.min(A.width,b+S)-N,height:Math.min(A.height,x+G)-ne},layout:[{offset:M,stride:P}]}}(i,e,s,r,a)),p)for(let A=0;AcancelAnimationFrame(e)}},getImageData(i,e=0){return this.getImageCanvasContext(i).getImageData(-e,-e,i.width+2*e,i.height+2*e)},getImageCanvasContext(i){let e=window.document.createElement("canvas"),s=e.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("failed to create canvas 2d context");return e.width=i.width,e.height=i.height,s.drawImage(i,0,0,i.width,i.height),s},resolveURL:i=>(ri||(ri=document.createElement("a")),ri.href=i,ri.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(Es==null&&(Es=matchMedia("(prefers-reduced-motion: reduce)")),Es.matches)}},Ds={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class As extends Error{constructor(e,s,r,a){super(`AJAXError: ${s} (${e}): ${r}`),this.status=e,this.statusText=s,this.url=r,this.body=a}}let ys=Ke()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,cs=i=>Ds.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))];function jn(i,e){let s=new AbortController,r=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,cache:i.cache,referrer:ys(),signal:s.signal}),a=!1,h=!1;return i.type==="json"&&r.headers.set("Accept","application/json"),h||fetch(r).then(d=>d.ok?(p=>{(i.type==="arrayBuffer"||i.type==="image"?p.arrayBuffer():i.type==="json"?p.json():p.text()).then(C=>{h||(a=!0,e(null,C,p.headers.get("Cache-Control"),p.headers.get("Expires")))}).catch(C=>{h||e(new Error(C.message))})})(d):d.blob().then(p=>e(new As(d.status,d.statusText,i.url,p)))).catch(d=>{d.code!==20&&e(new Error(d.message))}),{cancel:()=>{h=!0,a||s.abort()}}}let hn=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(Ke()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!Ke())return(cs(i.url)||jn)(i,e)}if(!(/^file:/.test(s=i.url)||/^file:/.test(ys())&&!/^\w+:/.test(s))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return jn(i,e);if(Ke()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var s;return function(r,a){let h=new XMLHttpRequest;h.open(r.method||"GET",r.url,!0),r.type!=="arrayBuffer"&&r.type!=="image"||(h.responseType="arraybuffer");for(let d in r.headers)h.setRequestHeader(d,r.headers[d]);return r.type==="json"&&(h.responseType="text",h.setRequestHeader("Accept","application/json")),h.withCredentials=r.credentials==="include",h.onerror=()=>{a(new Error(h.statusText))},h.onload=()=>{if((h.status>=200&&h.status<300||h.status===0)&&h.response!==null){let d=h.response;if(r.type==="json")try{d=JSON.parse(h.response)}catch(p){return a(p)}a(null,d,h.getResponseHeader("Cache-Control"),h.getResponseHeader("Expires"))}else{let d=new Blob([h.response],{type:h.getResponseHeader("Content-Type")});a(new As(h.status,h.statusText,r.url,d))}},h.send(r.body),{cancel:()=>h.abort()}}(i,e)},Xn=function(i,e){return hn(_t(i,{type:"arrayBuffer"}),e)};function Ws(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;let e=new URL(i),s=window.location;return e.protocol===s.protocol&&e.host===s.host}function Sn(i,e,s){s[i]&&s[i].indexOf(e)!==-1||(s[i]=s[i]||[],s[i].push(e))}function Zn(i,e,s){if(s&&s[i]){let r=s[i].indexOf(e);r!==-1&&s[i].splice(r,1)}}class un{constructor(e,s={}){_t(this,s),this.type=e}}class dn extends un{constructor(e,s={}){super("error",_t({error:e},s))}}class pn{on(e,s){return this._listeners=this._listeners||{},Sn(e,s,this._listeners),this}off(e,s){return Zn(e,s,this._listeners),Zn(e,s,this._oneTimeListeners),this}once(e,s){return s?(this._oneTimeListeners=this._oneTimeListeners||{},Sn(e,s,this._oneTimeListeners),this):new Promise(r=>this.once(e,r))}fire(e,s){typeof e=="string"&&(e=new un(e,s||{}));let r=e.type;if(this.listens(r)){e.target=this;let a=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(let p of a)p.call(this,e);let h=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(let p of h)Zn(r,p,this._oneTimeListeners),p.call(this,e);let d=this._eventedParent;d&&(_t(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),d.fire(e))}else e instanceof dn&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,s){return this._eventedParent=e,this._eventedParentData=s,this}}var Ce={$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"},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}},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 es=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function bs(i,e){let s={};for(let r in i)r!=="ref"&&(s[r]=i[r]);return es.forEach(r=>{r in e&&(s[r]=e[r])}),s}function Pt(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let s=0;s`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}let oe=[Us,ze,At,ut,Ni,X,js,H(Ct),w,Z,T];function q(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!q(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(let s of oe)if(!q(s,e))return null}}return`Expected ${E(i)} but found ${E(e)} instead.`}function Y(i,e){return e.some(s=>s.kind===i.kind)}function te(i,e){return e.some(s=>s==="null"?i===null:s==="array"?Array.isArray(i):s==="object"?i&&!Array.isArray(i)&&typeof i=="object":s===typeof i)}function fe(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}let _e=.96422,Se=.82521,it=4/29,ct=6/29,Oe=3*ct*ct,nt=ct*ct*ct,dt=Math.PI/180,Mt=180/Math.PI;function Et(i){return(i%=360)<0&&(i+=360),i}function Bt([i,e,s,r]){let a,h,d=Si((.2225045*(i=wt(i))+.7168786*(e=wt(e))+.0606169*(s=wt(s)))/1);i===e&&e===s?a=h=d:(a=Si((.4360747*i+.3850649*e+.1430804*s)/_e),h=Si((.0139322*i+.0971045*e+.7141733*s)/Se));let p=116*d-16;return[p<0?0:p,500*(a-d),200*(d-h),r]}function wt(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function Si(i){return i>nt?Math.pow(i,1/3):i/Oe+it}function Dt([i,e,s,r]){let a=(i+16)/116,h=isNaN(e)?a:a+e/500,d=isNaN(s)?a:a-s/200;return a=1*Ti(a),h=_e*Ti(h),d=Se*Ti(d),[ci(3.1338561*h-1.6168667*a-.4906146*d),ci(-.9787684*h+1.9161415*a+.033454*d),ci(.0719453*h-.2289914*a+1.4052427*d),r]}function ci(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function Ti(i){return i>ct?i*i*i:Oe*(i-it)}function _s(i){return parseInt(i.padEnd(2,i),16)/255}function eo(i,e){return Ln(e?i/100:i,0,1)}function Ln(i,e,s){return Math.min(Math.max(e,i),s)}function Hn(i){return!i.some(Number.isNaN)}let To={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 Kt{constructor(e,s,r,a=1,h=!0){this.r=e,this.g=s,this.b=r,this.a=a,h||(this.r*=a,this.g*=a,this.b*=a,a||this.overwriteGetter("rgb",[e,s,r,a]))}static parse(e){if(e instanceof Kt)return e;if(typeof e!="string")return;let s=function(r){if((r=r.toLowerCase().trim())==="transparent")return[0,0,0,0];let a=To[r];if(a){let[d,p,C]=a;return[d/255,p/255,C/255,1]}if(r.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(r)){let d=r.length<6?1:2,p=1;return[_s(r.slice(p,p+=d)),_s(r.slice(p,p+=d)),_s(r.slice(p,p+=d)),_s(r.slice(p,p+d)||"ff")]}if(r.startsWith("rgb")){let d=r.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(d){let[p,C,A,b,x,S,G,R,M,P,N,ne]=d,Q=[b||" ",G||" ",P].join("");if(Q===" "||Q===" /"||Q===",,"||Q===",,,"){let ae=[A,S,M].join(""),he=ae==="%%%"?100:ae===""?255:0;if(he){let we=[Ln(+C/he,0,1),Ln(+x/he,0,1),Ln(+R/he,0,1),N?eo(+N,ne):1];if(Hn(we))return we}}return}}let h=r.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(h){let[d,p,C,A,b,x,S,G,R]=h,M=[C||" ",b||" ",S].join("");if(M===" "||M===" /"||M===",,"||M===",,,"){let P=[+p,Ln(+A,0,100),Ln(+x,0,100),G?eo(+G,R):1];if(Hn(P))return function([N,ne,Q,ae]){function he(we){let Ee=(we+N/30)%12,Qe=ne*Math.min(Q,1-Q);return Q-Qe*Math.max(-1,Math.min(Ee-3,9-Ee,1))}return N=Et(N),ne/=100,Q/=100,[he(0),he(8),he(4),ae]}(P)}}}(e);return s?new Kt(...s,!1):void 0}get rgb(){let{r:e,g:s,b:r,a}=this,h=a||1/0;return this.overwriteGetter("rgb",[e/h,s/h,r/h,a])}get hcl(){return this.overwriteGetter("hcl",function(e){let[s,r,a,h]=Bt(e),d=Math.sqrt(r*r+a*a);return[Math.round(1e4*d)?Et(Math.atan2(a,r)*Mt):NaN,d,s,h]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Bt(this.rgb))}overwriteGetter(e,s){return Object.defineProperty(this,e,{value:s}),s}toString(){let[e,s,r,a]=this.rgb;return`rgba(${[e,s,r].map(h=>Math.round(255*h)).join(",")},${a})`}}Kt.black=new Kt(0,0,0,1),Kt.white=new Kt(1,1,1,1),Kt.transparent=new Kt(0,0,0,0),Kt.red=new Kt(1,0,0,1);class Vr{constructor(e,s,r){this.sensitivity=e?s?"variant":"case":s?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,s){return this.collator.compare(e,s)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class dr{constructor(e,s,r,a,h){this.text=e,this.image=s,this.scale=r,this.fontStack=a,this.textColor=h}}class Pi{constructor(e){this.sections=e}static fromString(e){return new Pi([new dr(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Pi?e:Pi.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class gs{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof gs)return e;if(typeof e=="number")return new gs([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let s of e)if(typeof s!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new gs(e)}}toString(){return JSON.stringify(this.values)}}let Tr=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class ts{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ts)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let s=0;s=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof s=="number"&&s>=0&&s<=255?r===void 0||typeof r=="number"&&r>=0&&r<=1?null:`Invalid rgba value [${[i,e,s,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof r=="number"?[i,e,s,r]:[i,e,s]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Cn(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof Kt||i instanceof Vr||i instanceof Pi||i instanceof gs||i instanceof ts||i instanceof bi)return!0;if(Array.isArray(i)){for(let e of i)if(!Cn(e))return!1;return!0}if(typeof i=="object"){for(let e in i)if(!Cn(i[e]))return!1;return!0}return!1}function $t(i){if(i===null)return Us;if(typeof i=="string")return At;if(typeof i=="boolean")return ut;if(typeof i=="number")return ze;if(i instanceof Kt)return Ni;if(i instanceof Vr)return Qs;if(i instanceof Pi)return X;if(i instanceof gs)return w;if(i instanceof ts)return T;if(i instanceof bi)return Z;if(Array.isArray(i)){let e=i.length,s;for(let r of i){let a=$t(r);if(s){if(s===a)continue;s=Ct;break}s=a}return H(s||Ct,e)}return js}function Wt(i){let e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof Kt||i instanceof Pi||i instanceof gs||i instanceof ts||i instanceof bi?i.toString():JSON.stringify(i)}class Bn{constructor(e,s){this.type=e,this.value=s}static parse(e,s){if(e.length!==2)return s.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Cn(e[1]))return s.error("invalid value");let r=e[1],a=$t(r),h=s.expectedType;return a.kind!=="array"||a.N!==0||!h||h.kind!=="array"||typeof h.N=="number"&&h.N!==0||(a=h),new Bn(a,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ei{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}let W={string:At,number:ze,boolean:ut,object:js};class z{constructor(e,s){this.type=e,this.args=s}static parse(e,s){if(e.length<2)return s.error("Expected at least one argument.");let r,a=1,h=e[0];if(h==="array"){let p,C;if(e.length>2){let A=e[1];if(typeof A!="string"||!(A in W)||A==="object")return s.error('The item type argument of "array" must be one of string, number, boolean',1);p=W[A],a++}else p=Ct;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return s.error('The length argument to "array" must be a positive integer literal',2);C=e[2],a++}r=H(p,C)}else{if(!W[h])throw new Error(`Types doesn't contain name = ${h}`);r=W[h]}let d=[];for(;ae.outputDefined())}}let V={"to-boolean":ut,"to-color":Ni,"to-number":ze,"to-string":At};class U{constructor(e,s){this.type=e,this.args=s}static parse(e,s){if(e.length<2)return s.error("Expected at least one argument.");let r=e[0];if(!V[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if((r==="to-boolean"||r==="to-string")&&e.length!==2)return s.error("Expected one argument.");let a=V[r],h=[];for(let d=1;d4?`Invalid rbga value ${JSON.stringify(s)}: expected an array containing either three or four numeric values.`:pr(s[0],s[1],s[2],s[3]),!r))return new Kt(s[0]/255,s[1]/255,s[2]/255,s[3])}throw new ei(r||`Could not parse color from value '${typeof s=="string"?s:JSON.stringify(s)}'`)}case"padding":{let s;for(let r of this.args){s=r.evaluate(e);let a=gs.parse(s);if(a)return a}throw new ei(`Could not parse padding from value '${typeof s=="string"?s:JSON.stringify(s)}'`)}case"variableAnchorOffsetCollection":{let s;for(let r of this.args){s=r.evaluate(e);let a=ts.parse(s);if(a)return a}throw new ei(`Could not parse variableAnchorOffsetCollection from value '${typeof s=="string"?s:JSON.stringify(s)}'`)}case"number":{let s=null;for(let r of this.args){if(s=r.evaluate(e),s===null)return 0;let a=Number(s);if(!isNaN(a))return a}throw new ei(`Could not convert ${JSON.stringify(s)} to number.`)}case"formatted":return Pi.fromString(Wt(this.args[0].evaluate(e)));case"resolvedImage":return bi.fromString(Wt(this.args[0].evaluate(e)));default:return Wt(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}let j=["Unknown","Point","LineString","Polygon"];class se{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"?j[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(e){let s=this._parseColorCache[e];return s||(s=this._parseColorCache[e]=Kt.parse(e)),s}}class ce{constructor(e,s,r=[],a,h=new mn,d=[]){this.registry=e,this.path=r,this.key=r.map(p=>`[${p}]`).join(""),this.scope=h,this.errors=d,this.expectedType=a,this._isConstant=s}parse(e,s,r,a,h={}){return s?this.concat(s,r,a)._parse(e,h):this._parse(e,h)}_parse(e,s){function r(a,h,d){return d==="assert"?new z(h,[a]):d==="coerce"?new U(h,[a]):a}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let a=e[0];if(typeof a!="string")return this.error(`Expression name must be a string, but found ${typeof a} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let h=this.registry[a];if(h){let d=h.parse(e,this);if(!d)return null;if(this.expectedType){let p=this.expectedType,C=d.type;if(p.kind!=="string"&&p.kind!=="number"&&p.kind!=="boolean"&&p.kind!=="object"&&p.kind!=="array"||C.kind!=="value")if(p.kind!=="color"&&p.kind!=="formatted"&&p.kind!=="resolvedImage"||C.kind!=="value"&&C.kind!=="string")if(p.kind!=="padding"||C.kind!=="value"&&C.kind!=="number"&&C.kind!=="array")if(p.kind!=="variableAnchorOffsetCollection"||C.kind!=="value"&&C.kind!=="array"){if(this.checkSubtype(p,C))return null}else d=r(d,p,s.typeAnnotation||"coerce");else d=r(d,p,s.typeAnnotation||"coerce");else d=r(d,p,s.typeAnnotation||"coerce");else d=r(d,p,s.typeAnnotation||"assert")}if(!(d instanceof Bn)&&d.type.kind!=="resolvedImage"&&this._isConstant(d)){let p=new se;try{d=new Bn(d.type,d.evaluate(p))}catch(C){return this.error(C.message),null}}return d}return this.error(`Unknown expression "${a}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,s,r){let a=typeof e=="number"?this.path.concat(e):this.path,h=r?this.scope.concat(r):this.scope;return new ce(this.registry,this._isConstant,a,s||null,h,this.errors)}error(e,...s){let r=`${this.key}${s.map(a=>`[${a}]`).join("")}`;this.errors.push(new Ut(r,e))}checkSubtype(e,s){let r=q(e,s);return r&&this.error(r),r}}class xe{constructor(e,s,r){this.type=Qs,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=s}static parse(e,s){if(e.length!==2)return s.error("Expected one argument.");let r=e[1];if(typeof r!="object"||Array.isArray(r))return s.error("Collator options argument must be an object.");let a=s.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,ut);if(!a)return null;let h=s.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,ut);if(!h)return null;let d=null;return r.locale&&(d=s.parse(r.locale,1,At),!d)?null:new xe(a,h,d)}evaluate(e){return new Vr(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}let ye=8192;function me(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function le(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function Ae(i,e){let s=(180+i[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,a=Math.pow(2,e.z);return[Math.round(s*a*ye),Math.round(r*a*ye)]}function be(i,e,s){let r=i[0]-e[0],a=i[1]-e[1],h=i[0]-s[0],d=i[1]-s[1];return r*d-h*a==0&&r*h<=0&&a*d<=0}function ke(i,e){let s=!1;for(let d=0,p=e.length;d(r=i)[1]!=(h=C[A+1])[1]>r[1]&&r[0]<(h[0]-a[0])*(r[1]-a[1])/(h[1]-a[1])+a[0]&&(s=!s)}}var r,a,h;return s}function ot(i,e){for(let s=0;s0&&p<0||d<0&&p>0}function Je(i,e,s){for(let A of s)for(let b=0;bs[2]){let a=.5*r,h=i[0]-s[0]>a?-r:s[0]-i[0]>a?r:0;h===0&&(h=i[0]-s[2]>a?-r:s[2]-i[0]>a?r:0),i[0]+=h}me(e,i)}function Ht(i,e,s,r){let a=Math.pow(2,r.z)*ye,h=[r.x*ye,r.y*ye],d=[];for(let p of i)for(let C of p){let A=[C.x+h[0],C.y+h[1]];Ft(A,e,s,a),d.push(A)}return d}function Ot(i,e,s,r){let a=Math.pow(2,r.z)*ye,h=[r.x*ye,r.y*ye],d=[];for(let C of i){let A=[];for(let b of C){let x=[b.x+h[0],b.y+h[1]];me(e,x),A.push(x)}d.push(A)}if(e[2]-e[0]<=a/2){(p=e)[0]=p[1]=1/0,p[2]=p[3]=-1/0;for(let C of d)for(let A of C)Ft(A,e,s,a)}var p;return d}class oi{constructor(e,s){this.type=ut,this.geojson=e,this.geometries=s}static parse(e,s){if(e.length!==2)return s.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Cn(e[1])){let r=e[1];if(r.type==="FeatureCollection")for(let a=0;a!Array.isArray(A)||A.length===e.length-1),C=null;for(let[A,b]of p){C=new ce(s.registry,hs,s.path,null,s.scope);let x=[],S=!1;for(let G=1;G{return S=x,Array.isArray(S)?`(${S.map(E).join(", ")})`:`(${E(S.type)}...)`;var S}).join(" | "),b=[];for(let x=1;x{s=e?s&&hs(r):s&&r instanceof Bn}),!!s&&qn(i)&&to(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function qn(i){if(i instanceof _i&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof oi)return!1;let e=!0;return i.eachChild(s=>{e&&!qn(s)&&(e=!1)}),e}function Wr(i){if(i instanceof _i&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(s=>{e&&!Wr(s)&&(e=!1)}),e}function to(i,e){if(i instanceof _i&&e.indexOf(i.name)>=0)return!1;let s=!0;return i.eachChild(r=>{s&&!to(r,e)&&(s=!1)}),s}function Ir(i,e){let s=i.length-1,r,a,h=0,d=s,p=0;for(;h<=d;)if(p=Math.floor((h+d)/2),r=i[p],a=i[p+1],r<=e){if(p===s||ee))throw new ei("Input is not a number.");d=p-1}return 0}class Pn{constructor(e,s,r){this.type=e,this.input=s,this.labels=[],this.outputs=[];for(let[a,h]of r)this.labels.push(a),this.outputs.push(h)}static parse(e,s){if(e.length-1<4)return s.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return s.error("Expected an even number of arguments.");let r=s.parse(e[1],1,ze);if(!r)return null;let a=[],h=null;s.expectedType&&s.expectedType.kind!=="value"&&(h=s.expectedType);for(let d=1;d=p)return s.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',A);let x=s.parse(C,b,h);if(!x)return null;h=h||x.type,a.push([p,x])}return new Pn(h,r,a)}evaluate(e){let s=this.labels,r=this.outputs;if(s.length===1)return r[0].evaluate(e);let a=this.input.evaluate(e);if(a<=s[0])return r[0].evaluate(e);let h=s.length;return a>=s[h-1]?r[h-1].evaluate(e):r[Ir(s,a)].evaluate(e)}eachChild(e){e(this.input);for(let s of this.outputs)e(s)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Gt(i,e,s){return i+s*(e-i)}function io(i,e,s){return i.map((r,a)=>Gt(r,e[a],s))}let Js={number:Gt,color:function(i,e,s,r="rgb"){switch(r){case"rgb":{let[a,h,d,p]=io(i.rgb,e.rgb,s);return new Kt(a,h,d,p,!1)}case"hcl":{let[a,h,d,p]=i.hcl,[C,A,b,x]=e.hcl,S,G;if(isNaN(a)||isNaN(C))isNaN(a)?isNaN(C)?S=NaN:(S=C,d!==1&&d!==0||(G=A)):(S=a,b!==1&&b!==0||(G=h));else{let ne=C-a;C>a&&ne>180?ne-=360:C180&&(ne+=360),S=a+s*ne}let[R,M,P,N]=function([ne,Q,ae,he]){return ne=isNaN(ne)?0:ne*dt,Dt([ae,Math.cos(ne)*Q,Math.sin(ne)*Q,he])}([S,G??Gt(h,A,s),Gt(d,b,s),Gt(p,x,s)]);return new Kt(R,M,P,N,!1)}case"lab":{let[a,h,d,p]=Dt(io(i.lab,e.lab,s));return new Kt(a,h,d,p,!1)}}},array:io,padding:function(i,e,s){return new gs(io(i.values,e.values,s))},variableAnchorOffsetCollection:function(i,e,s){let r=i.values,a=e.values;if(r.length!==a.length)throw new ei(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${e.toString()}`);let h=[];for(let d=0;dtypeof b!="number"||b<0||b>1))return s.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:A}}}if(e.length-1<4)return s.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return s.error("Expected an even number of arguments.");if(h=s.parse(h,2,ze),!h)return null;let p=[],C=null;r==="interpolate-hcl"||r==="interpolate-lab"?C=Ni:s.expectedType&&s.expectedType.kind!=="value"&&(C=s.expectedType);for(let A=0;A=b)return s.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',S);let R=s.parse(x,G,C);if(!R)return null;C=C||R.type,p.push([b,R])}return fe(C,ze)||fe(C,Ni)||fe(C,w)||fe(C,T)||fe(C,H(ze))?new zs(C,r,a,h,p):s.error(`Type ${E(C)} is not interpolatable.`)}evaluate(e){let s=this.labels,r=this.outputs;if(s.length===1)return r[0].evaluate(e);let a=this.input.evaluate(e);if(a<=s[0])return r[0].evaluate(e);let h=s.length;if(a>=s[h-1])return r[h-1].evaluate(e);let d=Ir(s,a),p=zs.interpolationFactor(this.interpolation,a,s[d],s[d+1]),C=r[d].evaluate(e),A=r[d+1].evaluate(e);switch(this.operator){case"interpolate":return Js[this.type.kind](C,A,p);case"interpolate-hcl":return Js.color(C,A,p,"hcl");case"interpolate-lab":return Js.color(C,A,p,"lab")}}eachChild(e){e(this.input);for(let s of this.outputs)e(s)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Wo(i,e,s,r){let a=r-s,h=i-s;return a===0?0:e===1?h/a:(Math.pow(e,h)-1)/(Math.pow(e,a)-1)}class so{constructor(e,s){this.type=e,this.args=s}static parse(e,s){if(e.length<2)return s.error("Expectected at least one argument.");let r=null,a=s.expectedType;a&&a.kind!=="value"&&(r=a);let h=[];for(let p of e.slice(1)){let C=s.parse(p,1+h.length,r,void 0,{typeAnnotation:"omit"});if(!C)return null;r=r||C.type,h.push(C)}if(!r)throw new Error("No output type");let d=a&&h.some(p=>q(a,p.type));return new so(d?Ct:r,h)}evaluate(e){let s,r=null,a=0;for(let h of this.args)if(a++,r=h.evaluate(e),r&&r instanceof bi&&!r.available&&(s||(s=r.name),r=null,a===this.args.length&&(r=s)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class no{constructor(e,s){this.type=s.type,this.bindings=[].concat(e),this.result=s}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let s of this.bindings)e(s[1]);e(this.result)}static parse(e,s){if(e.length<4)return s.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let r=[];for(let h=1;h=r.length)throw new ei(`Array index out of bounds: ${s} > ${r.length-1}.`);if(s!==Math.floor(s))throw new ei(`Array index must be an integer, but found ${s} instead.`);return r[s]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class zo{constructor(e,s){this.type=ut,this.needle=e,this.haystack=s}static parse(e,s){if(e.length!==3)return s.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let r=s.parse(e[1],1,Ct),a=s.parse(e[2],2,Ct);return r&&a?Y(r.type,[ut,At,ze,Us,Ct])?new zo(r,a):s.error(`Expected first argument to be of type boolean, string, number or null, but found ${E(r.type)} instead`):null}evaluate(e){let s=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!te(s,["boolean","string","number","null"]))throw new ei(`Expected first argument to be of type boolean, string, number or null, but found ${E($t(s))} instead.`);if(!te(r,["string","array"]))throw new ei(`Expected second argument to be of type array or string, but found ${E($t(r))} instead.`);return r.indexOf(s)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class ro{constructor(e,s,r){this.type=ze,this.needle=e,this.haystack=s,this.fromIndex=r}static parse(e,s){if(e.length<=2||e.length>=5)return s.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let r=s.parse(e[1],1,Ct),a=s.parse(e[2],2,Ct);if(!r||!a)return null;if(!Y(r.type,[ut,At,ze,Us,Ct]))return s.error(`Expected first argument to be of type boolean, string, number or null, but found ${E(r.type)} instead`);if(e.length===4){let h=s.parse(e[3],3,ze);return h?new ro(r,a,h):null}return new ro(r,a)}evaluate(e){let s=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!te(s,["boolean","string","number","null"]))throw new ei(`Expected first argument to be of type boolean, string, number or null, but found ${E($t(s))} instead.`);if(!te(r,["string","array"]))throw new ei(`Expected second argument to be of type array or string, but found ${E($t(r))} instead.`);if(this.fromIndex){let a=this.fromIndex.evaluate(e);return r.indexOf(s,a)}return r.indexOf(s)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Mo{constructor(e,s,r,a,h,d){this.inputType=e,this.type=s,this.input=r,this.cases=a,this.outputs=h,this.otherwise=d}static parse(e,s){if(e.length<5)return s.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return s.error("Expected an even number of arguments.");let r,a;s.expectedType&&s.expectedType.kind!=="value"&&(a=s.expectedType);let h={},d=[];for(let A=2;ANumber.MAX_SAFE_INTEGER)return S.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof R=="number"&&Math.floor(R)!==R)return S.error("Numeric branch labels must be integer values.");if(r){if(S.checkSubtype(r,$t(R)))return null}else r=$t(R);if(h[String(R)]!==void 0)return S.error("Branch labels must be unique.");h[String(R)]=d.length}let G=s.parse(x,A,a);if(!G)return null;a=a||G.type,d.push(G)}let p=s.parse(e[1],1,Ct);if(!p)return null;let C=s.parse(e[e.length-1],e.length-1,a);return C?p.type.kind!=="value"&&s.concat(1).checkSubtype(r,p.type)?null:new Mo(r,a,p,h,d,C):null}evaluate(e){let s=this.input.evaluate(e);return($t(s)===this.inputType&&this.outputs[this.cases[s]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class Fo{constructor(e,s,r){this.type=e,this.branches=s,this.otherwise=r}static parse(e,s){if(e.length<4)return s.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return s.error("Expected an odd number of arguments.");let r;s.expectedType&&s.expectedType.kind!=="value"&&(r=s.expectedType);let a=[];for(let d=1;ds.outputDefined())&&this.otherwise.outputDefined()}}class oo{constructor(e,s,r,a){this.type=e,this.input=s,this.beginIndex=r,this.endIndex=a}static parse(e,s){if(e.length<=2||e.length>=5)return s.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let r=s.parse(e[1],1,Ct),a=s.parse(e[2],2,ze);if(!r||!a)return null;if(!Y(r.type,[H(Ct),At,Ct]))return s.error(`Expected first argument to be of type array or string, but found ${E(r.type)} instead`);if(e.length===4){let h=s.parse(e[3],3,ze);return h?new oo(r.type,r,a,h):null}return new oo(r.type,r,a)}evaluate(e){let s=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!te(s,["string","array"]))throw new ei(`Expected first argument to be of type array or string, but found ${E($t(s))} instead.`);if(this.endIndex){let a=this.endIndex.evaluate(e);return s.slice(r,a)}return s.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Va(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Ta(i,e,s,r){return r.compare(e,s)===0}function mr(i,e,s){let r=i!=="=="&&i!=="!=";return class kh{constructor(h,d,p){this.type=ut,this.lhs=h,this.rhs=d,this.collator=p,this.hasUntypedArgument=h.type.kind==="value"||d.type.kind==="value"}static parse(h,d){if(h.length!==3&&h.length!==4)return d.error("Expected two or three arguments.");let p=h[0],C=d.parse(h[1],1,Ct);if(!C)return null;if(!Va(p,C.type))return d.concat(1).error(`"${p}" comparisons are not supported for type '${E(C.type)}'.`);let A=d.parse(h[2],2,Ct);if(!A)return null;if(!Va(p,A.type))return d.concat(2).error(`"${p}" comparisons are not supported for type '${E(A.type)}'.`);if(C.type.kind!==A.type.kind&&C.type.kind!=="value"&&A.type.kind!=="value")return d.error(`Cannot compare types '${E(C.type)}' and '${E(A.type)}'.`);r&&(C.type.kind==="value"&&A.type.kind!=="value"?C=new z(A.type,[C]):C.type.kind!=="value"&&A.type.kind==="value"&&(A=new z(C.type,[A])));let b=null;if(h.length===4){if(C.type.kind!=="string"&&A.type.kind!=="string"&&C.type.kind!=="value"&&A.type.kind!=="value")return d.error("Cannot use collator to compare non-string types.");if(b=d.parse(h[3],3,Qs),!b)return null}return new kh(C,A,b)}evaluate(h){let d=this.lhs.evaluate(h),p=this.rhs.evaluate(h);if(r&&this.hasUntypedArgument){let C=$t(d),A=$t(p);if(C.kind!==A.kind||C.kind!=="string"&&C.kind!=="number")throw new ei(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${C.kind}, ${A.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){let C=$t(d),A=$t(p);if(C.kind!=="string"||A.kind!=="string")return e(h,d,p)}return this.collator?s(h,d,p,this.collator.evaluate(h)):e(h,d,p)}eachChild(h){h(this.lhs),h(this.rhs),this.collator&&h(this.collator)}outputDefined(){return!0}}}let Ml=mr("==",function(i,e,s){return e===s},Ta),Fl=mr("!=",function(i,e,s){return e!==s},function(i,e,s,r){return!Ta(0,e,s,r)}),Kl=mr("<",function(i,e,s){return e",function(i,e,s){return e>s},function(i,e,s,r){return r.compare(e,s)>0}),Ll=mr("<=",function(i,e,s){return e<=s},function(i,e,s,r){return r.compare(e,s)<=0}),Hl=mr(">=",function(i,e,s){return e>=s},function(i,e,s,r){return r.compare(e,s)>=0});class Ko{constructor(e,s,r,a,h){this.type=At,this.number=e,this.locale=s,this.currency=r,this.minFractionDigits=a,this.maxFractionDigits=h}static parse(e,s){if(e.length!==3)return s.error("Expected two arguments.");let r=s.parse(e[1],1,ze);if(!r)return null;let a=e[2];if(typeof a!="object"||Array.isArray(a))return s.error("NumberFormat options argument must be an object.");let h=null;if(a.locale&&(h=s.parse(a.locale,1,At),!h))return null;let d=null;if(a.currency&&(d=s.parse(a.currency,1,At),!d))return null;let p=null;if(a["min-fraction-digits"]&&(p=s.parse(a["min-fraction-digits"],1,ze),!p))return null;let C=null;return a["max-fraction-digits"]&&(C=s.parse(a["max-fraction-digits"],1,ze),!C)?null:new Ko(r,h,d,p,C)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class ao{constructor(e){this.type=X,this.sections=e}static parse(e,s){if(e.length<2)return s.error("Expected at least one argument.");let r=e[1];if(!Array.isArray(r)&&typeof r=="object")return s.error("First argument must be an image or text section.");let a=[],h=!1;for(let d=1;d<=e.length-1;++d){let p=e[d];if(h&&typeof p=="object"&&!Array.isArray(p)){h=!1;let C=null;if(p["font-scale"]&&(C=s.parse(p["font-scale"],1,ze),!C))return null;let A=null;if(p["text-font"]&&(A=s.parse(p["text-font"],1,H(At)),!A))return null;let b=null;if(p["text-color"]&&(b=s.parse(p["text-color"],1,Ni),!b))return null;let x=a[a.length-1];x.scale=C,x.font=A,x.textColor=b}else{let C=s.parse(e[d],1,Ct);if(!C)return null;let A=C.type.kind;if(A!=="string"&&A!=="value"&&A!=="null"&&A!=="resolvedImage")return s.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");h=!0,a.push({content:C,scale:null,font:null,textColor:null})}}return new ao(a)}evaluate(e){return new Pi(this.sections.map(s=>{let r=s.content.evaluate(e);return $t(r)===Z?new dr("",r,null,null,null):new dr(Wt(r),null,s.scale?s.scale.evaluate(e):null,s.font?s.font.evaluate(e).join(","):null,s.textColor?s.textColor.evaluate(e):null)}))}eachChild(e){for(let s of this.sections)e(s.content),s.scale&&e(s.scale),s.font&&e(s.font),s.textColor&&e(s.textColor)}outputDefined(){return!1}}class Xo{constructor(e){this.type=Z,this.input=e}static parse(e,s){if(e.length!==2)return s.error("Expected two arguments.");let r=s.parse(e[1],1,At);return r?new Xo(r):s.error("No image name provided.")}evaluate(e){let s=this.input.evaluate(e),r=bi.fromString(s);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(s)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Lo{constructor(e){this.type=ze,this.input=e}static parse(e,s){if(e.length!==2)return s.error(`Expected 1 argument, but found ${e.length-1} instead.`);let r=s.parse(e[1],1);return r?r.type.kind!=="array"&&r.type.kind!=="string"&&r.type.kind!=="value"?s.error(`Expected argument of type string or array, but found ${E(r.type)} instead.`):new Lo(r):null}evaluate(e){let s=this.input.evaluate(e);if(typeof s=="string"||Array.isArray(s))return s.length;throw new ei(`Expected value to be of type string or array, but found ${E($t(s))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}let Cr={"==":Ml,"!=":Fl,">":Xl,"<":Kl,">=":Hl,"<=":Ll,array:z,at:Jo,boolean:z,case:Fo,coalesce:so,collator:xe,format:ao,image:Xo,in:zo,"index-of":ro,interpolate:zs,"interpolate-hcl":zs,"interpolate-lab":zs,length:Lo,let:no,literal:Bn,match:Mo,number:z,"number-format":Ko,object:z,slice:oo,step:Pn,string:z,"to-boolean":U,"to-color":U,"to-number":U,"to-string":U,var:Wi,within:oi};function Wa(i,[e,s,r,a]){e=e.evaluate(i),s=s.evaluate(i),r=r.evaluate(i);let h=a?a.evaluate(i):1,d=pr(e,s,r,h);if(d)throw new ei(d);return new Kt(e/255,s/255,r/255,h,!1)}function Ja(i,e){return i in e}function Ho(i,e){let s=e[i];return s===void 0?null:s}function $n(i){return{type:i}}function za(i){return{result:"success",value:i}}function En(i){return{result:"error",value:i}}function fr(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Ma(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function Po(i){return!!i.expression&&i.expression.interpolated}function Xt(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function gi(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Pl(i){return i}function Rt(i,e){let s=e.type==="color",r=i.stops&&typeof i.stops[0][0]=="object",a=r||!(r||i.property!==void 0),h=i.type||(Po(e)?"exponential":"interval");if(s||e.type==="padding"){let b=s?Kt.parse:gs.parse;(i=Yi({},i)).stops&&(i.stops=i.stops.map(x=>[x[0],b(x[1])])),i.default=b(i.default?i.default:e.default)}if(i.colorSpace&&(d=i.colorSpace)!=="rgb"&&d!=="hcl"&&d!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var d;let p,C,A;if(h==="exponential")p=Jr;else if(h==="interval")p=ai;else if(h==="categorical"){p=hi,C=Object.create(null);for(let b of i.stops)C[b[0]]=b[1];A=typeof i.stops[0][0]}else{if(h!=="identity")throw new Error(`Unknown function type "${h}"`);p=Fa}if(r){let b={},x=[];for(let R=0;RR[0]),evaluate:({zoom:R},M)=>Jr({stops:S,base:i.base},e,R).evaluate(R,M)}}if(a){let b=h==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:b,interpolationFactor:zs.interpolationFactor.bind(void 0,b),zoomStops:i.stops.map(x=>x[0]),evaluate:({zoom:x})=>p(i,e,x,C,A)}}return{kind:"source",evaluate(b,x){let S=x&&x.properties?x.properties[i.property]:void 0;return S===void 0?er(i.default,e.default):p(i,e,S,C,A)}}}function er(i,e,s){return i!==void 0?i:e!==void 0?e:s!==void 0?s:void 0}function hi(i,e,s,r,a){return er(typeof s===a?r[s]:void 0,i.default,e.default)}function ai(i,e,s){if(Xt(s)!=="number")return er(i.default,e.default);let r=i.stops.length;if(r===1||s<=i.stops[0][0])return i.stops[0][1];if(s>=i.stops[r-1][0])return i.stops[r-1][1];let a=Ir(i.stops.map(h=>h[0]),s);return i.stops[a][1]}function Jr(i,e,s){let r=i.base!==void 0?i.base:1;if(Xt(s)!=="number")return er(i.default,e.default);let a=i.stops.length;if(a===1||s<=i.stops[0][0])return i.stops[0][1];if(s>=i.stops[a-1][0])return i.stops[a-1][1];let h=Ir(i.stops.map(b=>b[0]),s),d=function(b,x,S,G){let R=G-S,M=b-S;return R===0?0:x===1?M/R:(Math.pow(x,M)-1)/(Math.pow(x,R)-1)}(s,r,i.stops[h][0],i.stops[h+1][0]),p=i.stops[h][1],C=i.stops[h+1][1],A=Js[e.type]||Pl;return typeof p.evaluate=="function"?{evaluate(...b){let x=p.evaluate.apply(void 0,b),S=C.evaluate.apply(void 0,b);if(x!==void 0&&S!==void 0)return A(x,S,d,i.colorSpace)}}:A(p,C,d,i.colorSpace)}function Fa(i,e,s){switch(e.type){case"color":s=Kt.parse(s);break;case"formatted":s=Pi.fromString(s.toString());break;case"resolvedImage":s=bi.fromString(s.toString());break;case"padding":s=gs.parse(s);break;default:Xt(s)===e.type||e.type==="enum"&&e.values[s]||(s=void 0)}return er(s,i.default,e.default)}_i.register(Cr,{error:[{kind:"error"},[At],(i,[e])=>{throw new ei(e.evaluate(i))}],typeof:[At,[Ct],(i,[e])=>E($t(e.evaluate(i)))],"to-rgba":[H(ze,4),[Ni],(i,[e])=>{let[s,r,a,h]=e.evaluate(i).rgb;return[255*s,255*r,255*a,h]}],rgb:[Ni,[ze,ze,ze],Wa],rgba:[Ni,[ze,ze,ze,ze],Wa],has:{type:ut,overloads:[[[At],(i,[e])=>Ja(e.evaluate(i),i.properties())],[[At,js],(i,[e,s])=>Ja(e.evaluate(i),s.evaluate(i))]]},get:{type:Ct,overloads:[[[At],(i,[e])=>Ho(e.evaluate(i),i.properties())],[[At,js],(i,[e,s])=>Ho(e.evaluate(i),s.evaluate(i))]]},"feature-state":[Ct,[At],(i,[e])=>Ho(e.evaluate(i),i.featureState||{})],properties:[js,[],i=>i.properties()],"geometry-type":[At,[],i=>i.geometryType()],id:[Ct,[],i=>i.id()],zoom:[ze,[],i=>i.globals.zoom],"heatmap-density":[ze,[],i=>i.globals.heatmapDensity||0],"line-progress":[ze,[],i=>i.globals.lineProgress||0],accumulated:[Ct,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[ze,$n(ze),(i,e)=>{let s=0;for(let r of e)s+=r.evaluate(i);return s}],"*":[ze,$n(ze),(i,e)=>{let s=1;for(let r of e)s*=r.evaluate(i);return s}],"-":{type:ze,overloads:[[[ze,ze],(i,[e,s])=>e.evaluate(i)-s.evaluate(i)],[[ze],(i,[e])=>-e.evaluate(i)]]},"/":[ze,[ze,ze],(i,[e,s])=>e.evaluate(i)/s.evaluate(i)],"%":[ze,[ze,ze],(i,[e,s])=>e.evaluate(i)%s.evaluate(i)],ln2:[ze,[],()=>Math.LN2],pi:[ze,[],()=>Math.PI],e:[ze,[],()=>Math.E],"^":[ze,[ze,ze],(i,[e,s])=>Math.pow(e.evaluate(i),s.evaluate(i))],sqrt:[ze,[ze],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[ze,[ze],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[ze,[ze],(i,[e])=>Math.log(e.evaluate(i))],log2:[ze,[ze],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[ze,[ze],(i,[e])=>Math.sin(e.evaluate(i))],cos:[ze,[ze],(i,[e])=>Math.cos(e.evaluate(i))],tan:[ze,[ze],(i,[e])=>Math.tan(e.evaluate(i))],asin:[ze,[ze],(i,[e])=>Math.asin(e.evaluate(i))],acos:[ze,[ze],(i,[e])=>Math.acos(e.evaluate(i))],atan:[ze,[ze],(i,[e])=>Math.atan(e.evaluate(i))],min:[ze,$n(ze),(i,e)=>Math.min(...e.map(s=>s.evaluate(i)))],max:[ze,$n(ze),(i,e)=>Math.max(...e.map(s=>s.evaluate(i)))],abs:[ze,[ze],(i,[e])=>Math.abs(e.evaluate(i))],round:[ze,[ze],(i,[e])=>{let s=e.evaluate(i);return s<0?-Math.round(-s):Math.round(s)}],floor:[ze,[ze],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[ze,[ze],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[ut,[At,Ct],(i,[e,s])=>i.properties()[e.value]===s.value],"filter-id-==":[ut,[Ct],(i,[e])=>i.id()===e.value],"filter-type-==":[ut,[At],(i,[e])=>i.geometryType()===e.value],"filter-<":[ut,[At,Ct],(i,[e,s])=>{let r=i.properties()[e.value],a=s.value;return typeof r==typeof a&&r{let s=i.id(),r=e.value;return typeof s==typeof r&&s":[ut,[At,Ct],(i,[e,s])=>{let r=i.properties()[e.value],a=s.value;return typeof r==typeof a&&r>a}],"filter-id->":[ut,[Ct],(i,[e])=>{let s=i.id(),r=e.value;return typeof s==typeof r&&s>r}],"filter-<=":[ut,[At,Ct],(i,[e,s])=>{let r=i.properties()[e.value],a=s.value;return typeof r==typeof a&&r<=a}],"filter-id-<=":[ut,[Ct],(i,[e])=>{let s=i.id(),r=e.value;return typeof s==typeof r&&s<=r}],"filter->=":[ut,[At,Ct],(i,[e,s])=>{let r=i.properties()[e.value],a=s.value;return typeof r==typeof a&&r>=a}],"filter-id->=":[ut,[Ct],(i,[e])=>{let s=i.id(),r=e.value;return typeof s==typeof r&&s>=r}],"filter-has":[ut,[Ct],(i,[e])=>e.value in i.properties()],"filter-has-id":[ut,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[ut,[H(At)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[ut,[H(Ct)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[ut,[At,H(Ct)],(i,[e,s])=>s.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[ut,[At,H(Ct)],(i,[e,s])=>function(r,a,h,d){for(;h<=d;){let p=h+d>>1;if(a[p]===r)return!0;a[p]>r?d=p-1:h=p+1}return!1}(i.properties()[e.value],s.value,0,s.value.length-1)],all:{type:ut,overloads:[[[ut,ut],(i,[e,s])=>e.evaluate(i)&&s.evaluate(i)],[$n(ut),(i,e)=>{for(let s of e)if(!s.evaluate(i))return!1;return!0}]]},any:{type:ut,overloads:[[[ut,ut],(i,[e,s])=>e.evaluate(i)||s.evaluate(i)],[$n(ut),(i,e)=>{for(let s of e)if(s.evaluate(i))return!0;return!1}]]},"!":[ut,[ut],(i,[e])=>!e.evaluate(i)],"is-supported-script":[ut,[At],(i,[e])=>{let s=i.globals&&i.globals.isSupportedScript;return!s||s(e.evaluate(i))}],upcase:[At,[At],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[At,[At],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[At,$n(Ct),(i,e)=>e.map(s=>Wt(s.evaluate(i))).join("")],"resolved-locale":[At,[Qs],(i,[e])=>e.evaluate(i).resolvedLocale()]});class Eo{constructor(e,s){var r;this.expression=e,this._warningHistory={},this._evaluator=new se,this._defaultValue=s?(r=s).type==="color"&&gi(r.default)?new Kt(0,0,0,0):r.type==="color"?Kt.parse(r.default)||null:r.type==="padding"?gs.parse(r.default)||null:r.type==="variableAnchorOffsetCollection"?ts.parse(r.default)||null:r.default===void 0?null:r.default:null,this._enumValues=s&&s.type==="enum"?s.values:null}evaluateWithoutErrorHandling(e,s,r,a,h,d){return this._evaluator.globals=e,this._evaluator.feature=s,this._evaluator.featureState=r,this._evaluator.canonical=a,this._evaluator.availableImages=h||null,this._evaluator.formattedSection=d,this.expression.evaluate(this._evaluator)}evaluate(e,s,r,a,h,d){this._evaluator.globals=e,this._evaluator.feature=s||null,this._evaluator.featureState=r||null,this._evaluator.canonical=a,this._evaluator.availableImages=h||null,this._evaluator.formattedSection=d||null;try{let p=this.expression.evaluate(this._evaluator);if(p==null||typeof p=="number"&&p!=p)return this._defaultValue;if(this._enumValues&&!(p in this._enumValues))throw new ei(`Expected value to be one of ${Object.keys(this._enumValues).map(C=>JSON.stringify(C)).join(", ")}, but found ${JSON.stringify(p)} instead.`);return p}catch(p){return this._warningHistory[p.message]||(this._warningHistory[p.message]=!0,typeof console<"u"&&console.warn(p.message)),this._defaultValue}}}function lo(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in Cr}function co(i,e){let s=new ce(Cr,hs,[],e?function(a){let h={color:Ni,string:At,number:ze,enum:At,boolean:ut,formatted:X,padding:w,resolvedImage:Z,variableAnchorOffsetCollection:T};return a.type==="array"?H(h[a.value]||Ct,a.length):h[a.type]}(e):void 0),r=s.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return r?za(new Eo(r,e)):En(s.errors)}class Do{constructor(e,s){this.kind=e,this._styleExpression=s,this.isStateDependent=e!=="constant"&&!Wr(s.expression)}evaluateWithoutErrorHandling(e,s,r,a,h,d){return this._styleExpression.evaluateWithoutErrorHandling(e,s,r,a,h,d)}evaluate(e,s,r,a,h,d){return this._styleExpression.evaluate(e,s,r,a,h,d)}}class go{constructor(e,s,r,a){this.kind=e,this.zoomStops=r,this._styleExpression=s,this.isStateDependent=e!=="camera"&&!Wr(s.expression),this.interpolationType=a}evaluateWithoutErrorHandling(e,s,r,a,h,d){return this._styleExpression.evaluateWithoutErrorHandling(e,s,r,a,h,d)}evaluate(e,s,r,a,h,d){return this._styleExpression.evaluate(e,s,r,a,h,d)}interpolationFactor(e,s,r){return this.interpolationType?zs.interpolationFactor(this.interpolationType,e,s,r):0}}function Yo(i,e){let s=co(i,e);if(s.result==="error")return s;let r=s.value.expression,a=qn(r);if(!a&&!fr(e))return En([new Ut("","data expressions not supported")]);let h=to(r,["zoom"]);if(!h&&!Ma(e))return En([new Ut("","zoom expressions not supported")]);let d=Mr(r);return d||h?d instanceof Ut?En([d]):d instanceof zs&&!Po(e)?En([new Ut("",'"interpolate" expressions cannot be used with this property')]):za(d?new go(a?"camera":"composite",s.value,d.labels,d instanceof zs?d.interpolation:void 0):new Do(a?"constant":"source",s.value)):En([new Ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class zr{constructor(e,s){this._parameters=e,this._specification=s,Yi(this,Rt(this._parameters,this._specification))}static deserialize(e){return new zr(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Mr(i){let e=null;if(i instanceof no)e=Mr(i.result);else if(i instanceof so){for(let s of i.args)if(e=Mr(s),e)break}else(i instanceof Pn||i instanceof zs)&&i.input instanceof _i&&i.input.name==="zoom"&&(e=i);return e instanceof Ut||i.eachChild(s=>{let r=Mr(s);r instanceof Ut?e=r:!e&&r?e=new Ut("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new Ut("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Fr(i){if(i===!0||i===!1)return!0;if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(let e of i.slice(1))if(!Fr(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}let El={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function No(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Fr(i)||(i=ho(i));let e=co(i,El);if(e.result==="error")throw new Error(e.value.map(s=>`${s.key}: ${s.message}`).join(", "));return{filter:(s,r,a)=>e.value.evaluate(s,r,{},a),needGeometry:Ka(i)}}function Dl(i,e){return ie?1:0}function Ka(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e"||e==="<="||e===">="?Oo(i[1],i[2],e):e==="any"?(s=i.slice(1),["any"].concat(s.map(ho))):e==="all"?["all"].concat(i.slice(1).map(ho)):e==="none"?["all"].concat(i.slice(1).map(ho).map(Kr)):e==="in"?Xa(i[1],i.slice(2)):e==="!in"?Kr(Xa(i[1],i.slice(2))):e==="has"?La(i[1]):e==="!has"?Kr(La(i[1])):e!=="within"||i;var s}function Oo(i,e,s){switch(i){case"$type":return[`filter-type-${s}`,e];case"$id":return[`filter-id-${s}`,e];default:return[`filter-${s}`,i,e]}}function Xa(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(s=>typeof s!=typeof e[0])?["filter-in-large",i,["literal",e.sort(Dl)]]:["filter-in-small",i,["literal",e]]}}function La(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function Kr(i){return["!",i]}function uo(i){let e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let a="[";for(let h of i)a+=`${uo(h)},`;return`${a}]`}let s=Object.keys(i).sort(),r="{";for(let a=0;ar.maximum?[new We(e,s,`${s} is greater than the maximum value ${r.maximum}`)]:[]}function Io(i){let e=i.valueSpec,s=pi(i.value.type),r,a,h,d={},p=s!=="categorical"&&i.value.property===void 0,C=!p,A=Xt(i.value.stops)==="array"&&Xt(i.value.stops[0])==="array"&&Xt(i.value.stops[0][0])==="object",b=vs({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(G){if(s==="identity")return[new We(G.key,G.value,'identity function may not have a "stops" property')];let R=[],M=G.value;return R=R.concat(Ar({key:G.key,value:M,valueSpec:G.valueSpec,validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec,arrayElementValidator:x})),Xt(M)==="array"&&M.length===0&&R.push(new We(G.key,M,"array must have at least one stop")),R},default:function(G){return G.validateSpec({key:G.key,value:G.value,valueSpec:e,validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec})}}});return s==="identity"&&p&&b.push(new We(i.key,i.value,'missing required property "property"')),s==="identity"||i.value.stops||b.push(new We(i.key,i.value,'missing required property "stops"')),s==="exponential"&&i.valueSpec.expression&&!Po(i.valueSpec)&&b.push(new We(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(C&&!fr(i.valueSpec)?b.push(new We(i.key,i.value,"property functions not supported")):p&&!Ma(i.valueSpec)&&b.push(new We(i.key,i.value,"zoom functions not supported"))),s!=="categorical"&&!A||i.value.property!==void 0||b.push(new We(i.key,i.value,'"property" property is required')),b;function x(G){let R=[],M=G.value,P=G.key;if(Xt(M)!=="array")return[new We(P,M,`array expected, ${Xt(M)} found`)];if(M.length!==2)return[new We(P,M,`array length 2 expected, length ${M.length} found`)];if(A){if(Xt(M[0])!=="object")return[new We(P,M,`object expected, ${Xt(M[0])} found`)];if(M[0].zoom===void 0)return[new We(P,M,"object stop key must have zoom")];if(M[0].value===void 0)return[new We(P,M,"object stop key must have value")];if(h&&h>pi(M[0].zoom))return[new We(P,M[0].zoom,"stop zoom values must appear in ascending order")];pi(M[0].zoom)!==h&&(h=pi(M[0].zoom),a=void 0,d={}),R=R.concat(vs({key:`${P}[0]`,value:M[0],valueSpec:{zoom:{}},validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec,objectElementValidators:{zoom:Xr,value:S}}))}else R=R.concat(S({key:`${P}[0]`,value:M[0],valueSpec:{},validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec},M));return lo(tr(M[1]))?R.concat([new We(`${P}[1]`,M[1],"expressions are not allowed in function stops.")]):R.concat(G.validateSpec({key:`${P}[1]`,value:M[1],valueSpec:e,validateSpec:G.validateSpec,style:G.style,styleSpec:G.styleSpec}))}function S(G,R){let M=Xt(G.value),P=pi(G.value),N=G.value!==null?G.value:R;if(r){if(M!==r)return[new We(G.key,N,`${M} stop domain type must match previous stop domain type ${r}`)]}else r=M;if(M!=="number"&&M!=="string"&&M!=="boolean")return[new We(G.key,N,"stop domain value must be a number, string, or boolean")];if(M!=="number"&&s!=="categorical"){let ne=`number expected, ${M} found`;return fr(e)&&s===void 0&&(ne+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new We(G.key,N,ne)]}return s!=="categorical"||M!=="number"||isFinite(P)&&Math.floor(P)===P?s!=="categorical"&&M==="number"&&a!==void 0&&Pnew We(`${i.key}${r.key}`,i.value,r.message));let s=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!s.outputDefined())return[new We(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!Wr(s))return[new We(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!Wr(s))return[new We(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!to(s,["zoom","feature-state"]))return[new We(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!qn(s))return[new We(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Lr(i){let e=i.key,s=i.value,r=i.valueSpec,a=[];return Array.isArray(r.values)?r.values.indexOf(pi(s))===-1&&a.push(new We(e,s,`expected one of [${r.values.join(", ")}], ${JSON.stringify(s)} found`)):Object.keys(r.values).indexOf(pi(s))===-1&&a.push(new We(e,s,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(s)} found`)),a}function yr(i){return Fr(tr(i.value))?ir(Yi({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Pa(i)}function Pa(i){let e=i.value,s=i.key;if(Xt(e)!=="array")return[new We(s,e,`array expected, ${Xt(e)} found`)];let r=i.styleSpec,a,h=[];if(e.length<1)return[new We(s,e,"filter array must have at least 1 element")];switch(h=h.concat(Lr({key:`${s}[0]`,value:e[0],valueSpec:r.filter_operator,style:i.style,styleSpec:i.styleSpec})),pi(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&pi(e[1])==="$type"&&h.push(new We(s,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&h.push(new We(s,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(a=Xt(e[1]),a!=="string"&&h.push(new We(`${s}[1]`,e[1],`string expected, ${a} found`)));for(let d=2;d{A in s&&e.push(new We(r,s[A],`"${A}" is prohibited for ref layers`))}),a.layers.forEach(A=>{pi(A.id)===p&&(C=A)}),C?C.ref?e.push(new We(r,s.ref,"ref cannot reference another ref layer")):d=pi(C.type):e.push(new We(r,s.ref,`ref layer "${p}" not found`))}else if(d!=="background")if(s.source){let C=a.sources&&a.sources[s.source],A=C&&pi(C.type);C?A==="vector"&&d==="raster"?e.push(new We(r,s.source,`layer "${s.id}" requires a raster source`)):A!=="raster-dem"&&d==="hillshade"?e.push(new We(r,s.source,`layer "${s.id}" requires a raster-dem source`)):A==="raster"&&d!=="raster"?e.push(new We(r,s.source,`layer "${s.id}" requires a vector source`)):A!=="vector"||s["source-layer"]?A==="raster-dem"&&d!=="hillshade"?e.push(new We(r,s.source,"raster-dem source can only be used with layer type 'hillshade'.")):d!=="line"||!s.paint||!s.paint["line-gradient"]||A==="geojson"&&C.lineMetrics||e.push(new We(r,s,`layer "${s.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new We(r,s,`layer "${s.id}" must specify a "source-layer"`)):e.push(new We(r,s.source,`source "${s.source}" not found`))}else e.push(new We(r,s,'missing required property "source"'));return e=e.concat(vs({key:r,value:s,valueSpec:h.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${r}.type`,value:s.type,valueSpec:h.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:s,objectKey:"type"}),filter:yr,layout:C=>vs({layer:s,key:C.key,value:C.value,style:C.style,styleSpec:C.styleSpec,validateSpec:C.validateSpec,objectElementValidators:{"*":A=>Ya(Yi({layerType:d},A))}}),paint:C=>vs({layer:s,key:C.key,value:C.value,style:C.style,styleSpec:C.styleSpec,validateSpec:C.validateSpec,objectElementValidators:{"*":A=>Da(Yi({layerType:d},A))}})}})),e}function fn(i){let e=i.value,s=i.key,r=Xt(e);return r!=="string"?[new We(s,e,`string expected, ${r} found`)]:[]}let Hr={promoteId:function({key:i,value:e}){if(Xt(e)==="string")return fn({key:i,value:e});{let s=[];for(let r in e)s.push(...fn({key:`${i}.${r}`,value:e[r]}));return s}}};function Ms(i){let e=i.value,s=i.key,r=i.styleSpec,a=i.style,h=i.validateSpec;if(!e.type)return[new We(s,e,'"type" is required')];let d=pi(e.type),p;switch(d){case"vector":case"raster":return p=vs({key:s,value:e,valueSpec:r[`source_${d.replace("-","_")}`],style:i.style,styleSpec:r,objectElementValidators:Hr,validateSpec:h}),p;case"raster-dem":return p=function(C){var A;let b=(A=C.sourceName)!==null&&A!==void 0?A:"",x=C.value,S=C.styleSpec,G=S.source_raster_dem,R=C.style,M=[],P=Xt(x);if(x===void 0)return M;if(P!=="object")return M.push(new We("source_raster_dem",x,`object expected, ${P} found`)),M;let N=pi(x.encoding)==="custom",ne=["redFactor","greenFactor","blueFactor","baseShift"],Q=C.value.encoding?`"${C.value.encoding}"`:"Default";for(let ae in x)!N&&ne.includes(ae)?M.push(new We(ae,x[ae],`In "${b}": "${ae}" is only valid when "encoding" is set to "custom". ${Q} encoding found`)):G[ae]?M=M.concat(C.validateSpec({key:ae,value:x[ae],valueSpec:G[ae],validateSpec:C.validateSpec,style:R,styleSpec:S})):M.push(new We(ae,x[ae],`unknown property "${ae}"`));return M}({sourceName:s,value:e,style:i.style,styleSpec:r,validateSpec:h}),p;case"geojson":if(p=vs({key:s,value:e,valueSpec:r.source_geojson,style:a,styleSpec:r,validateSpec:h,objectElementValidators:Hr}),e.cluster)for(let C in e.clusterProperties){let[A,b]=e.clusterProperties[C],x=typeof A=="string"?[A,["accumulated"],["get",C]]:A;p.push(...ir({key:`${s}.${C}.map`,value:b,validateSpec:h,expressionContext:"cluster-map"})),p.push(...ir({key:`${s}.${C}.reduce`,value:x,validateSpec:h,expressionContext:"cluster-reduce"}))}return p;case"video":return vs({key:s,value:e,valueSpec:r.source_video,style:a,validateSpec:h,styleSpec:r});case"image":return vs({key:s,value:e,valueSpec:r.source_image,style:a,validateSpec:h,styleSpec:r});case"canvas":return[new We(s,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Lr({key:`${s}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:a,validateSpec:h,styleSpec:r})}}function Pr(i){let e=i.value,s=i.styleSpec,r=s.light,a=i.style,h=[],d=Xt(e);if(e===void 0)return h;if(d!=="object")return h=h.concat([new We("light",e,`object expected, ${d} found`)]),h;for(let p in e){let C=p.match(/^(.*)-transition$/);h=h.concat(C&&r[C[1]]&&r[C[1]].transition?i.validateSpec({key:p,value:e[p],valueSpec:s.transition,validateSpec:i.validateSpec,style:a,styleSpec:s}):r[p]?i.validateSpec({key:p,value:e[p],valueSpec:r[p],validateSpec:i.validateSpec,style:a,styleSpec:s}):[new We(p,e[p],`unknown property "${p}"`)])}return h}function Oa(i){let e=i.value,s=i.styleSpec,r=s.terrain,a=i.style,h=[],d=Xt(e);if(e===void 0)return h;if(d!=="object")return h=h.concat([new We("terrain",e,`object expected, ${d} found`)]),h;for(let p in e)h=h.concat(r[p]?i.validateSpec({key:p,value:e[p],valueSpec:r[p],validateSpec:i.validateSpec,style:a,styleSpec:s}):[new We(p,e[p],`unknown property "${p}"`)]);return h}function Ua(i){let e=[],s=i.value,r=i.key;if(Array.isArray(s)){let a=[],h=[];for(let d in s)s[d].id&&a.includes(s[d].id)&&e.push(new We(r,s,`all the sprites' ids must be unique, but ${s[d].id} is duplicated`)),a.push(s[d].id),s[d].url&&h.includes(s[d].url)&&e.push(new We(r,s,`all the sprites' URLs must be unique, but ${s[d].url} is duplicated`)),h.push(s[d].url),e=e.concat(vs({key:`${r}[${d}]`,value:s[d],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return fn({key:r,value:s})}let ja={"*":()=>[],array:Ar,boolean:function(i){let e=i.value,s=i.key,r=Xt(e);return r!=="boolean"?[new We(s,e,`boolean expected, ${r} found`)]:[]},number:Xr,color:function(i){let e=i.key,s=i.value,r=Xt(s);return r!=="string"?[new We(e,s,`color expected, ${r} found`)]:Kt.parse(String(s))?[]:[new We(e,s,`color expected, "${s}" found`)]},constants:Ha,enum:Lr,filter:yr,function:Io,layer:Na,object:vs,source:Ms,light:Pr,terrain:Oa,string:fn,formatted:function(i){return fn(i).length===0?[]:ir(i)},resolvedImage:function(i){return fn(i).length===0?[]:ir(i)},padding:function(i){let e=i.key,s=i.value;if(Xt(s)==="array"){if(s.length<1||s.length>4)return[new We(e,s,`padding requires 1 to 4 values; ${s.length} values found`)];let r={type:"number"},a=[];for(let h=0;h[]}})),i.constants&&(s=s.concat(Ha({key:"constants",value:i.constants,style:i,styleSpec:e,validateSpec:Gn}))),mo(s)}function Rn(i){return function(e){return i({...e,validateSpec:Gn})}}function mo(i){return[].concat(i).sort((e,s)=>e.line-s.line)}function Vn(i){return function(...e){return mo(i.apply(this,e))}}qs.source=Vn(Rn(Ms)),qs.sprite=Vn(Rn(Ua)),qs.glyphs=Vn(Rn(Qa)),qs.light=Vn(Rn(Pr)),qs.terrain=Vn(Rn(Oa)),qs.layer=Vn(Rn(Na)),qs.filter=Vn(Rn(yr)),qs.paintProperty=Vn(Rn(Da)),qs.layoutProperty=Vn(Rn(Ya));let Tn=qs,Yl=Tn.light,Uo=Tn.paintProperty,qa=Tn.layoutProperty;function Co(i,e){let s=!1;if(e&&e.length)for(let r of e)i.fire(new dn(new Error(r.message))),s=!0;return s}class br{constructor(e,s,r){let a=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let d=new Int32Array(this.arrayBuffer);e=d[0],this.d=(s=d[1])+2*(r=d[2]);for(let C=0;C=x[R+0]&&a>=x[R+1])?(p[G]=!0,d.push(b[G])):p[G]=!1}}}}_forEachCell(e,s,r,a,h,d,p,C){let A=this._convertToCellCoord(e),b=this._convertToCellCoord(s),x=this._convertToCellCoord(r),S=this._convertToCellCoord(a);for(let G=A;G<=x;G++)for(let R=b;R<=S;R++){let M=this.d*R+G;if((!C||C(this._convertFromCellCoord(G),this._convertFromCellCoord(R),this._convertFromCellCoord(G+1),this._convertFromCellCoord(R+1)))&&h.call(this,e,s,r,a,M,d,p,C))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,s=3+this.cells.length+1+1,r=0;for(let d=0;d=0)continue;let d=i[h];a[h]=Wn[r].shallow.indexOf(h)>=0?d:Dn(d,e)}i instanceof Error&&(a.message=i.message)}if(a.$name)throw new Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(a.$name=r),a}throw new Error("can't serialize object of type "+typeof i)}function _r(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||fo(i)||gt(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(_r);if(typeof i=="object"){let e=i.$name||"Object";if(!Wn[e])throw new Error(`can't deserialize unregistered class ${e}`);let{klass:s}=Wn[e];if(!s)throw new Error(`can't deserialize unregistered class ${e}`);if(s.deserialize)return s.deserialize(i);let r=Object.create(s.prototype);for(let a of Object.keys(i)){if(a==="$name")continue;let h=i[a];r[a]=Wn[e].shallow.indexOf(a)>=0?h:_r(h)}return r}throw new Error("can't deserialize object of type "+typeof i)}class $a{constructor(){this.first=!0}update(e,s){let r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=s):this.lastFloorZoomi>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function jo(i){for(let e of i)if(qo(e.charCodeAt(0)))return!0;return!1}function Qo(i){for(let e of i)if(!Nl(e.charCodeAt(0)))return!1;return!0}function Nl(i){return!(Pe.Arabic(i)||Pe["Arabic Supplement"](i)||Pe["Arabic Extended-A"](i)||Pe["Arabic Presentation Forms-A"](i)||Pe["Arabic Presentation Forms-B"](i))}function qo(i){return!(i!==746&&i!==747&&(i<4352||!(Pe["Bopomofo Extended"](i)||Pe.Bopomofo(i)||Pe["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||Pe["CJK Compatibility Ideographs"](i)||Pe["CJK Compatibility"](i)||Pe["CJK Radicals Supplement"](i)||Pe["CJK Strokes"](i)||!(!Pe["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||Pe["CJK Unified Ideographs Extension A"](i)||Pe["CJK Unified Ideographs"](i)||Pe["Enclosed CJK Letters and Months"](i)||Pe["Hangul Compatibility Jamo"](i)||Pe["Hangul Jamo Extended-A"](i)||Pe["Hangul Jamo Extended-B"](i)||Pe["Hangul Jamo"](i)||Pe["Hangul Syllables"](i)||Pe.Hiragana(i)||Pe["Ideographic Description Characters"](i)||Pe.Kanbun(i)||Pe["Kangxi Radicals"](i)||Pe["Katakana Phonetic Extensions"](i)||Pe.Katakana(i)&&i!==12540||!(!Pe["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!Pe["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||Pe["Unified Canadian Aboriginal Syllabics"](i)||Pe["Unified Canadian Aboriginal Syllabics Extended"](i)||Pe["Vertical Forms"](i)||Pe["Yijing Hexagram Symbols"](i)||Pe["Yi Syllables"](i)||Pe["Yi Radicals"](i))))}function el(i){return!(qo(i)||function(e){return!!(Pe["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||Pe["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||Pe["Letterlike Symbols"](e)||Pe["Number Forms"](e)||Pe["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||Pe["Control Pictures"](e)&&e!==9251||Pe["Optical Character Recognition"](e)||Pe["Enclosed Alphanumerics"](e)||Pe["Geometric Shapes"](e)||Pe["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Pe["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Pe["CJK Symbols and Punctuation"](e)||Pe.Katakana(e)||Pe["Private Use Area"](e)||Pe["CJK Compatibility Forms"](e)||Pe["Small Form Variants"](e)||Pe["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function tl(i){return i>=1424&&i<=2303||Pe["Arabic Presentation Forms-A"](i)||Pe["Arabic Presentation Forms-B"](i)}function il(i,e){return!(!e&&tl(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||Pe.Khmer(i))}function Ol(i){for(let e of i)if(tl(e.charCodeAt(0)))return!0;return!1}let $o="deferred",ea="loading",ta="loaded",ia=null,xs="unavailable",Yn=null,Er=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(xs="error"),ia&&ia(i)};function sa(){Dr.fire(new un("pluginStateChange",{pluginStatus:xs,pluginURL:Yn}))}let Dr=new pn,na=function(){return xs},sl=function(){if(xs!==$o||!Yn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");xs=ea,sa(),Yn&&Xn({url:Yn},i=>{i?Er(i):(xs=ta,sa())})},Fs={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>xs===ta||Fs.applyArabicShaping!=null,isLoading:()=>xs===ea,setState(i){if(!Ke())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");xs=i.pluginStatus,Yn=i.pluginURL},isParsed(){if(!Ke())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return Fs.applyArabicShaping!=null&&Fs.processBidirectionalText!=null&&Fs.processStyledBidirectionalText!=null},getPluginURL(){if(!Ke())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Yn}};class ti{constructor(e,s){this.zoom=e,s?(this.now=s.now,this.fadeDuration=s.fadeDuration,this.zoomHistory=s.zoomHistory,this.transition=s.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new $a,this.transition={})}isSupportedScript(e){return function(s,r){for(let a of s)if(!il(a.charCodeAt(0),r))return!1;return!0}(e,Fs.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,s=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:s+(1-s)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*s}}}class Ao{constructor(e,s){this.property=e,this.value=s,this.expression=function(r,a){if(gi(r))return new zr(r,a);if(lo(r)){let h=Yo(r,a);if(h.result==="error")throw new Error(h.value.map(d=>`${d.key}: ${d.message}`).join(", "));return h.value}{let h=r;return a.type==="color"&&typeof r=="string"?h=Kt.parse(r):a.type!=="padding"||typeof r!="number"&&!Array.isArray(r)?a.type==="variableAnchorOffsetCollection"&&Array.isArray(r)&&(h=ts.parse(r)):h=gs.parse(r),{kind:"constant",evaluate:()=>h}}}(s===void 0?e.specification.default:s,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,s,r){return this.property.possiblyEvaluate(this,e,s,r)}}class ra{constructor(e){this.property=e,this.value=new Ao(e,void 0)}transitioned(e,s){return new rl(this.property,this.value,s,_t({},e.transition,this.transition),e.now)}untransitioned(){return new rl(this.property,this.value,null,{},0)}}class nl{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return Di(this._values[e].value.value)}setValue(e,s){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new ra(this._values[e].property)),this._values[e].value=new Ao(this._values[e].property,s===null?void 0:Di(s))}getTransition(e){return Di(this._values[e].transition)}setTransition(e,s){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new ra(this._values[e].property)),this._values[e].transition=Di(s)||void 0}serialize(){let e={};for(let s of Object.keys(this._values)){let r=this.getValue(s);r!==void 0&&(e[s]=r);let a=this.getTransition(s);a!==void 0&&(e[`${s}-transition`]=a)}return e}transitioned(e,s){let r=new ol(this._properties);for(let a of Object.keys(this._values))r._values[a]=this._values[a].transitioned(e,s._values[a]);return r}untransitioned(){let e=new ol(this._properties);for(let s of Object.keys(this._values))e._values[s]=this._values[s].untransitioned();return e}}class rl{constructor(e,s,r,a,h){this.property=e,this.value=s,this.begin=h+a.delay||0,this.end=this.begin+a.duration||0,e.specification.transition&&(a.delay||a.duration)&&(this.prior=r)}possiblyEvaluate(e,s,r){let a=e.now||0,h=this.value.possiblyEvaluate(e,s,r),d=this.prior;if(d){if(a>this.end)return this.prior=null,h;if(this.value.isDataDriven())return this.prior=null,h;if(a=1)return 1;let A=C*C,b=A*C;return 4*(C<.5?b:3*(C-A)+b-.75)}(p))}}return h}}class ol{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,s,r){let a=new yo(this._properties);for(let h of Object.keys(this._values))a._values[h]=this._values[h].possiblyEvaluate(e,s,r);return a}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Ul{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return Di(this._values[e].value)}setValue(e,s){this._values[e]=new Ao(this._values[e].property,s===null?void 0:Di(s))}serialize(){let e={};for(let s of Object.keys(this._values)){let r=this.getValue(s);r!==void 0&&(e[s]=r)}return e}possiblyEvaluate(e,s,r){let a=new yo(this._properties);for(let h of Object.keys(this._values))a._values[h]=this._values[h].possiblyEvaluate(e,s,r);return a}}class us{constructor(e,s,r){this.property=e,this.value=s,this.parameters=r}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,s,r,a){return this.property.evaluate(this.value,this.parameters,e,s,r,a)}}class yo{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class tt{constructor(e){this.specification=e}possiblyEvaluate(e,s){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(s)}interpolate(e,s,r){let a=Js[this.specification.type];return a?a(e,s,r):e}}class at{constructor(e,s){this.specification=e,this.overrides=s}possiblyEvaluate(e,s,r,a){return new us(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(s,null,{},r,a)}:e.expression,s)}interpolate(e,s,r){if(e.value.kind!=="constant"||s.value.kind!=="constant")return e;if(e.value.value===void 0||s.value.value===void 0)return new us(this,{kind:"constant",value:void 0},e.parameters);let a=Js[this.specification.type];if(a){let h=a(e.value.value,s.value.value,r);return new us(this,{kind:"constant",value:h},e.parameters)}return e}evaluate(e,s,r,a,h,d){return e.kind==="constant"?e.value:e.evaluate(s,r,a,h,d)}}class Yr extends at{possiblyEvaluate(e,s,r,a){if(e.value===void 0)return new us(this,{kind:"constant",value:void 0},s);if(e.expression.kind==="constant"){let h=e.expression.evaluate(s,null,{},r,a),d=e.property.specification.type==="resolvedImage"&&typeof h!="string"?h.name:h,p=this._calculate(d,d,d,s);return new us(this,{kind:"constant",value:p},s)}if(e.expression.kind==="camera"){let h=this._calculate(e.expression.evaluate({zoom:s.zoom-1}),e.expression.evaluate({zoom:s.zoom}),e.expression.evaluate({zoom:s.zoom+1}),s);return new us(this,{kind:"constant",value:h},s)}return new us(this,e.expression,s)}evaluate(e,s,r,a,h,d){if(e.kind==="source"){let p=e.evaluate(s,r,a,h,d);return this._calculate(p,p,p,s)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(s.zoom)-1},r,a),e.evaluate({zoom:Math.floor(s.zoom)},r,a),e.evaluate({zoom:Math.floor(s.zoom)+1},r,a),s):e.value}_calculate(e,s,r,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:e,to:s}:{from:r,to:s}}interpolate(e){return e}}class oa{constructor(e){this.specification=e}possiblyEvaluate(e,s,r,a){if(e.value!==void 0){if(e.expression.kind==="constant"){let h=e.expression.evaluate(s,null,{},r,a);return this._calculate(h,h,h,s)}return this._calculate(e.expression.evaluate(new ti(Math.floor(s.zoom-1),s)),e.expression.evaluate(new ti(Math.floor(s.zoom),s)),e.expression.evaluate(new ti(Math.floor(s.zoom+1),s)),s)}}_calculate(e,s,r,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:e,to:s}:{from:r,to:s}}interpolate(e){return e}}class aa{constructor(e){this.specification=e}possiblyEvaluate(e,s,r,a){return!!e.expression.evaluate(s,null,{},r,a)}interpolate(){return!1}}class vi{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let s in e){let r=e[s];r.specification.overridable&&this.overridableProperties.push(s);let a=this.defaultPropertyValues[s]=new Ao(r,void 0),h=this.defaultTransitionablePropertyValues[s]=new ra(r);this.defaultTransitioningPropertyValues[s]=h.untransitioned(),this.defaultPossiblyEvaluatedValues[s]=a.possiblyEvaluate({})}}}Ye("DataDrivenProperty",at),Ye("DataConstantProperty",tt),Ye("CrossFadedDataDrivenProperty",Yr),Ye("CrossFadedProperty",oa),Ye("ColorRampProperty",aa);let la="-transition";class $s extends pn{constructor(e,s){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),s.layout&&(this._unevaluatedLayout=new Ul(s.layout)),s.paint)){this._transitionablePaint=new nl(s.paint);for(let r in e.paint)this.setPaintProperty(r,e.paint[r],{validate:!1});for(let r in e.layout)this.setLayoutProperty(r,e.layout[r],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new yo(s.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,s,r={}){s!=null&&this._validate(qa,`layers.${this.id}.layout.${e}`,e,s,r)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,s):this.visibility=s)}getPaintProperty(e){return e.endsWith(la)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,s,r={}){if(s!=null&&this._validate(Uo,`layers.${this.id}.paint.${e}`,e,s,r))return!1;if(e.endsWith(la))return this._transitionablePaint.setTransition(e.slice(0,-11),s||void 0),!1;{let a=this._transitionablePaint._values[e],h=a.property.specification["property-type"]==="cross-faded-data-driven",d=a.value.isDataDriven(),p=a.value;this._transitionablePaint.setValue(e,s),this._handleSpecialPaintPropertyUpdate(e);let C=this._transitionablePaint._values[e].value;return C.isDataDriven()||d||h||this._handleOverridablePaintPropertyUpdate(e,p,C)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,s,r){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,s){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,s)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,s)}serialize(){let e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),ls(e,(s,r)=>!(s===void 0||r==="layout"&&!Object.keys(s).length||r==="paint"&&!Object.keys(s).length))}_validate(e,s,r,a,h={}){return(!h||h.validate!==!1)&&Co(this,e.call(Tn,{key:s,layerType:this.type,objectKey:r,value:a,styleSpec:Ce,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let s=this.paint.get(e);if(s instanceof us&&fr(s.property.specification)&&(s.value.kind==="source"||s.value.kind==="composite")&&s.value.isStateDependent)return!0}return!1}}let al={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class sr{constructor(e,s){this._structArray=e,this._pos1=s*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Ii{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,s){return e._trim(),s&&(e.isTransferred=!0,s.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let s=Object.create(this.prototype);return s.arrayBuffer=e.arrayBuffer,s.length=e.length,s.capacity=e.arrayBuffer.byteLength/s.bytesPerElement,s._refreshViews(),s}_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(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let s=this.uint8;this._refreshViews(),s&&this.uint8.set(s)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ui(i,e=1){let s=0,r=0;return{members:i.map(a=>{let h=al[a.type].BYTES_PER_ELEMENT,d=s=vr(s,Math.max(e,h)),p=a.components||1;return r=Math.max(r,h),s+=h*p,{name:a.name,type:a.type,components:p,offset:d}}),size:vr(s,Math.max(r,e)),alignment:e}}function vr(i,e){return Math.ceil(i/e)*e}class Nr extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s){let r=this.length;return this.resize(r+1),this.emplace(r,e,s)}emplace(e,s,r){let a=2*e;return this.int16[a+0]=s,this.int16[a+1]=r,e}}Nr.prototype.bytesPerElement=4,Ye("StructArrayLayout2i4",Nr);class Or extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,r){let a=this.length;return this.resize(a+1),this.emplace(a,e,s,r)}emplace(e,s,r,a){let h=3*e;return this.int16[h+0]=s,this.int16[h+1]=r,this.int16[h+2]=a,e}}Or.prototype.bytesPerElement=6,Ye("StructArrayLayout3i6",Or);class nr extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,r,a){let h=this.length;return this.resize(h+1),this.emplace(h,e,s,r,a)}emplace(e,s,r,a,h){let d=4*e;return this.int16[d+0]=s,this.int16[d+1]=r,this.int16[d+2]=a,this.int16[d+3]=h,e}}nr.prototype.bytesPerElement=8,Ye("StructArrayLayout4i8",nr);class ca extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,r,a,h,d){let p=this.length;return this.resize(p+1),this.emplace(p,e,s,r,a,h,d)}emplace(e,s,r,a,h,d,p){let C=6*e;return this.int16[C+0]=s,this.int16[C+1]=r,this.int16[C+2]=a,this.int16[C+3]=h,this.int16[C+4]=d,this.int16[C+5]=p,e}}ca.prototype.bytesPerElement=12,Ye("StructArrayLayout2i4i12",ca);class ga extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,r,a,h,d){let p=this.length;return this.resize(p+1),this.emplace(p,e,s,r,a,h,d)}emplace(e,s,r,a,h,d,p){let C=4*e,A=8*e;return this.int16[C+0]=s,this.int16[C+1]=r,this.uint8[A+4]=a,this.uint8[A+5]=h,this.uint8[A+6]=d,this.uint8[A+7]=p,e}}ga.prototype.bytesPerElement=8,Ye("StructArrayLayout2i4ub8",ga);class xr extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,s){let r=this.length;return this.resize(r+1),this.emplace(r,e,s)}emplace(e,s,r){let a=2*e;return this.float32[a+0]=s,this.float32[a+1]=r,e}}xr.prototype.bytesPerElement=8,Ye("StructArrayLayout2f8",xr);class ha extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s,r,a,h,d,p,C,A,b){let x=this.length;return this.resize(x+1),this.emplace(x,e,s,r,a,h,d,p,C,A,b)}emplace(e,s,r,a,h,d,p,C,A,b,x){let S=10*e;return this.uint16[S+0]=s,this.uint16[S+1]=r,this.uint16[S+2]=a,this.uint16[S+3]=h,this.uint16[S+4]=d,this.uint16[S+5]=p,this.uint16[S+6]=C,this.uint16[S+7]=A,this.uint16[S+8]=b,this.uint16[S+9]=x,e}}ha.prototype.bytesPerElement=20,Ye("StructArrayLayout10ui20",ha);class ua extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s,r,a,h,d,p,C,A,b,x,S){let G=this.length;return this.resize(G+1),this.emplace(G,e,s,r,a,h,d,p,C,A,b,x,S)}emplace(e,s,r,a,h,d,p,C,A,b,x,S,G){let R=12*e;return this.int16[R+0]=s,this.int16[R+1]=r,this.int16[R+2]=a,this.int16[R+3]=h,this.uint16[R+4]=d,this.uint16[R+5]=p,this.uint16[R+6]=C,this.uint16[R+7]=A,this.int16[R+8]=b,this.int16[R+9]=x,this.int16[R+10]=S,this.int16[R+11]=G,e}}ua.prototype.bytesPerElement=24,Ye("StructArrayLayout4i4ui4i24",ua);class Lt extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,s,r){let a=this.length;return this.resize(a+1),this.emplace(a,e,s,r)}emplace(e,s,r,a){let h=3*e;return this.float32[h+0]=s,this.float32[h+1]=r,this.float32[h+2]=a,e}}Lt.prototype.bytesPerElement=12,Ye("StructArrayLayout3f12",Lt);class g extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let s=this.length;return this.resize(s+1),this.emplace(s,e)}emplace(e,s){return this.uint32[1*e+0]=s,e}}g.prototype.bytesPerElement=4,Ye("StructArrayLayout1ul4",g);class t extends Ii{_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(e,s,r,a,h,d,p,C,A){let b=this.length;return this.resize(b+1),this.emplace(b,e,s,r,a,h,d,p,C,A)}emplace(e,s,r,a,h,d,p,C,A,b){let x=10*e,S=5*e;return this.int16[x+0]=s,this.int16[x+1]=r,this.int16[x+2]=a,this.int16[x+3]=h,this.int16[x+4]=d,this.int16[x+5]=p,this.uint32[S+3]=C,this.uint16[x+8]=A,this.uint16[x+9]=b,e}}t.prototype.bytesPerElement=20,Ye("StructArrayLayout6i1ul2ui20",t);class n extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,r,a,h,d){let p=this.length;return this.resize(p+1),this.emplace(p,e,s,r,a,h,d)}emplace(e,s,r,a,h,d,p){let C=6*e;return this.int16[C+0]=s,this.int16[C+1]=r,this.int16[C+2]=a,this.int16[C+3]=h,this.int16[C+4]=d,this.int16[C+5]=p,e}}n.prototype.bytesPerElement=12,Ye("StructArrayLayout2i2i2i12",n);class o extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,s,r,a,h){let d=this.length;return this.resize(d+1),this.emplace(d,e,s,r,a,h)}emplace(e,s,r,a,h,d){let p=4*e,C=8*e;return this.float32[p+0]=s,this.float32[p+1]=r,this.float32[p+2]=a,this.int16[C+6]=h,this.int16[C+7]=d,e}}o.prototype.bytesPerElement=16,Ye("StructArrayLayout2f1f2i16",o);class l extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,s,r,a){let h=this.length;return this.resize(h+1),this.emplace(h,e,s,r,a)}emplace(e,s,r,a,h){let d=12*e,p=3*e;return this.uint8[d+0]=s,this.uint8[d+1]=r,this.float32[p+1]=a,this.float32[p+2]=h,e}}l.prototype.bytesPerElement=12,Ye("StructArrayLayout2ub2f12",l);class u extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s,r){let a=this.length;return this.resize(a+1),this.emplace(a,e,s,r)}emplace(e,s,r,a){let h=3*e;return this.uint16[h+0]=s,this.uint16[h+1]=r,this.uint16[h+2]=a,e}}u.prototype.bytesPerElement=6,Ye("StructArrayLayout3ui6",u);class I extends Ii{_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(e,s,r,a,h,d,p,C,A,b,x,S,G,R,M,P,N){let ne=this.length;return this.resize(ne+1),this.emplace(ne,e,s,r,a,h,d,p,C,A,b,x,S,G,R,M,P,N)}emplace(e,s,r,a,h,d,p,C,A,b,x,S,G,R,M,P,N,ne){let Q=24*e,ae=12*e,he=48*e;return this.int16[Q+0]=s,this.int16[Q+1]=r,this.uint16[Q+2]=a,this.uint16[Q+3]=h,this.uint32[ae+2]=d,this.uint32[ae+3]=p,this.uint32[ae+4]=C,this.uint16[Q+10]=A,this.uint16[Q+11]=b,this.uint16[Q+12]=x,this.float32[ae+7]=S,this.float32[ae+8]=G,this.uint8[he+36]=R,this.uint8[he+37]=M,this.uint8[he+38]=P,this.uint32[ae+10]=N,this.int16[Q+22]=ne,e}}I.prototype.bytesPerElement=48,Ye("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",I);class m extends Ii{_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(e,s,r,a,h,d,p,C,A,b,x,S,G,R,M,P,N,ne,Q,ae,he,we,Ee,Qe,He,Le,Me,Ne){let Fe=this.length;return this.resize(Fe+1),this.emplace(Fe,e,s,r,a,h,d,p,C,A,b,x,S,G,R,M,P,N,ne,Q,ae,he,we,Ee,Qe,He,Le,Me,Ne)}emplace(e,s,r,a,h,d,p,C,A,b,x,S,G,R,M,P,N,ne,Q,ae,he,we,Ee,Qe,He,Le,Me,Ne,Fe){let Ge=32*e,rt=16*e;return this.int16[Ge+0]=s,this.int16[Ge+1]=r,this.int16[Ge+2]=a,this.int16[Ge+3]=h,this.int16[Ge+4]=d,this.int16[Ge+5]=p,this.int16[Ge+6]=C,this.int16[Ge+7]=A,this.uint16[Ge+8]=b,this.uint16[Ge+9]=x,this.uint16[Ge+10]=S,this.uint16[Ge+11]=G,this.uint16[Ge+12]=R,this.uint16[Ge+13]=M,this.uint16[Ge+14]=P,this.uint16[Ge+15]=N,this.uint16[Ge+16]=ne,this.uint16[Ge+17]=Q,this.uint16[Ge+18]=ae,this.uint16[Ge+19]=he,this.uint16[Ge+20]=we,this.uint16[Ge+21]=Ee,this.uint16[Ge+22]=Qe,this.uint32[rt+12]=He,this.float32[rt+13]=Le,this.float32[rt+14]=Me,this.uint16[Ge+30]=Ne,this.uint16[Ge+31]=Fe,e}}m.prototype.bytesPerElement=64,Ye("StructArrayLayout8i15ui1ul2f2ui64",m);class f extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let s=this.length;return this.resize(s+1),this.emplace(s,e)}emplace(e,s){return this.float32[1*e+0]=s,e}}f.prototype.bytesPerElement=4,Ye("StructArrayLayout1f4",f);class y extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,s,r){let a=this.length;return this.resize(a+1),this.emplace(a,e,s,r)}emplace(e,s,r,a){let h=3*e;return this.uint16[6*e+0]=s,this.float32[h+1]=r,this.float32[h+2]=a,e}}y.prototype.bytesPerElement=12,Ye("StructArrayLayout1ui2f12",y);class _ extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s,r){let a=this.length;return this.resize(a+1),this.emplace(a,e,s,r)}emplace(e,s,r,a){let h=4*e;return this.uint32[2*e+0]=s,this.uint16[h+2]=r,this.uint16[h+3]=a,e}}_.prototype.bytesPerElement=8,Ye("StructArrayLayout1ul2ui8",_);class v extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,s){let r=this.length;return this.resize(r+1),this.emplace(r,e,s)}emplace(e,s,r){let a=2*e;return this.uint16[a+0]=s,this.uint16[a+1]=r,e}}v.prototype.bytesPerElement=4,Ye("StructArrayLayout2ui4",v);class B extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let s=this.length;return this.resize(s+1),this.emplace(s,e)}emplace(e,s){return this.uint16[1*e+0]=s,e}}B.prototype.bytesPerElement=2,Ye("StructArrayLayout1ui2",B);class K extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,s,r,a){let h=this.length;return this.resize(h+1),this.emplace(h,e,s,r,a)}emplace(e,s,r,a,h){let d=4*e;return this.float32[d+0]=s,this.float32[d+1]=r,this.float32[d+2]=a,this.float32[d+3]=h,e}}K.prototype.bytesPerElement=16,Ye("StructArrayLayout4f16",K);class F extends sr{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 Ve(this.anchorPointX,this.anchorPointY)}}F.prototype.size=20;class L extends t{get(e){return new F(this,e)}}Ye("CollisionBoxArray",L);class J extends sr{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(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}J.prototype.size=48;class $ extends I{get(e){return new J(this,e)}}Ye("PlacedSymbolArray",$);class ge extends sr{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(e){this._structArray.uint32[this._pos4+12]=e}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]}}ge.prototype.size=64;class D extends m{get(e){return new ge(this,e)}}Ye("SymbolInstanceArray",D);class ie extends f{getoffsetX(e){return this.float32[1*e+0]}}Ye("GlyphOffsetArray",ie);class de extends Or{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Ye("SymbolLineVertexArray",de);class pe extends sr{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]}}pe.prototype.size=12;class ve extends y{get(e){return new pe(this,e)}}Ye("TextAnchorOffsetArray",ve);class Be extends sr{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]}}Be.prototype.size=8;class Ze extends _{get(e){return new Be(this,e)}}Ye("FeatureIndexArray",Ze);class Te extends Nr{}class je extends Nr{}class St extends Nr{}class Xe extends ca{}class lt extends ga{}class qe extends xr{}class Yt extends ha{}class xt extends ua{}class bt extends Lt{}class Zt extends g{}class Ci extends n{}class jt extends l{}class Oi extends u{}class Ji extends v{}let xi=ui([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ks}=xi;class ii{constructor(e=[]){this.segments=e}prepareSegment(e,s,r,a){let h=this.segments[this.segments.length-1];return e>ii.MAX_VERTEX_ARRAY_LENGTH&&yi(`Max vertices per segment is ${ii.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!h||h.vertexLength+e>ii.MAX_VERTEX_ARRAY_LENGTH||h.sortKey!==a)&&(h={vertexOffset:s.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},a!==void 0&&(h.sortKey=a),this.segments.push(h)),h}get(){return this.segments}destroy(){for(let e of this.segments)for(let s in e.vaos)e.vaos[s].destroy()}static simpleSegment(e,s,r,a){return new ii([{vertexOffset:e,primitiveOffset:s,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])}}function An(i,e){return 256*(i=Ei(Math.floor(i),0,255))+Ei(Math.floor(e),0,255)}ii.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Ye("SegmentVector",ii);let yn=ui([{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 Nn={exports:{}},rr={exports:{}};rr.exports=function(i,e){var s,r,a,h,d,p,C,A;for(r=i.length-(s=3&i.length),a=e,d=3432918353,p=461845907,A=0;A>>16)*d&65535)<<16)&4294967295)<<15|C>>>17))*p+(((C>>>16)*p&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(h>>>16)&65535)<<16);switch(C=0,s){case 3:C^=(255&i.charCodeAt(A+2))<<16;case 2:C^=(255&i.charCodeAt(A+1))<<8;case 1:a^=C=(65535&(C=(C=(65535&(C^=255&i.charCodeAt(A)))*d+(((C>>>16)*d&65535)<<16)&4294967295)<<15|C>>>17))*p+(((C>>>16)*p&65535)<<16)&4294967295}return a^=i.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295,(a^=a>>>16)>>>0};var wr=rr.exports,is={exports:{}};is.exports=function(i,e){for(var s,r=i.length,a=e^r,h=0;r>=4;)s=1540483477*(65535&(s=255&i.charCodeAt(h)|(255&i.charCodeAt(++h))<<8|(255&i.charCodeAt(++h))<<16|(255&i.charCodeAt(++h))<<24))+((1540483477*(s>>>16)&65535)<<16),a=1540483477*(65535&a)+((1540483477*(a>>>16)&65535)<<16)^(s=1540483477*(65535&(s^=s>>>24))+((1540483477*(s>>>16)&65535)<<16)),r-=4,++h;switch(r){case 3:a^=(255&i.charCodeAt(h+2))<<16;case 2:a^=(255&i.charCodeAt(h+1))<<8;case 1:a=1540483477*(65535&(a^=255&i.charCodeAt(h)))+((1540483477*(a>>>16)&65535)<<16)}return a=1540483477*(65535&(a^=a>>>13))+((1540483477*(a>>>16)&65535)<<16),(a^=a>>>15)>>>0};var Ui=wr,ds=is.exports;Nn.exports=Ui,Nn.exports.murmur3=Ui,Nn.exports.murmur2=ds;var or=ee(Nn.exports);class fi{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,s,r,a){this.ids.push(zi(e)),this.positions.push(s,r,a)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let s=zi(e),r=0,a=this.ids.length-1;for(;r>1;this.ids[d]>=s?a=d:r=d+1}let h=[];for(;this.ids[r]===s;)h.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return h}static serialize(e,s){let r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return ws(r,a,0,r.length-1),s&&s.push(r.buffer,a.buffer),{ids:r,positions:a}}static deserialize(e){let s=new fi;return s.ids=e.ids,s.positions=e.positions,s.indexed=!0,s}}function zi(i){let e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:or(String(i))}function ws(i,e,s,r){for(;s>1],h=s-1,d=r+1;for(;;){do h++;while(i[h]a);if(h>=d)break;Ai(i,h,d),Ai(e,3*h,3*d),Ai(e,3*h+1,3*d+1),Ai(e,3*h+2,3*d+2)}d-s`u_${a}`),this.type=r}setUniform(e,s,r){e.set(r.constantOr(this.value))}getBinding(e,s,r){return this.type==="color"?new cl(e,s):new bo(e,s)}}class lr{constructor(e,s){this.uniformNames=s.map(r=>`u_${r}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,s){this.pixelRatioFrom=s.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=s.tlbr,this.patternTo=e.tlbr}setUniform(e,s,r,a){let h=a==="u_pattern_to"?this.patternTo:a==="u_pattern_from"?this.patternFrom:a==="u_pixel_ratio_to"?this.pixelRatioTo:a==="u_pixel_ratio_from"?this.pixelRatioFrom:null;h&&e.set(h)}getBinding(e,s,r){return r.substr(0,9)==="u_pattern"?new ll(e,s):new bo(e,s)}}class _n{constructor(e,s,r,a){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=s.map(h=>({name:`a_${h}`,type:"Float32",components:r==="color"?2:1,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,s,r,a,h){let d=this.paintVertexArray.length,p=this.expression.evaluate(new ti(0),s,{},a,[],h);this.paintVertexArray.resize(e),this._setPaintValue(d,e,p)}updatePaintArray(e,s,r,a){let h=this.expression.evaluate({zoom:0},r,a);this._setPaintValue(e,s,h)}_setPaintValue(e,s,r){if(this.type==="color"){let a=da(r);for(let h=e;h`u_${p}_t`),this.type=r,this.useIntegerZoom=a,this.zoom=h,this.maxValue=0,this.paintVertexAttributes=s.map(p=>({name:`a_${p}`,type:"Float32",components:r==="color"?4:2,offset:0})),this.paintVertexArray=new d}populatePaintArray(e,s,r,a,h){let d=this.expression.evaluate(new ti(this.zoom),s,{},a,[],h),p=this.expression.evaluate(new ti(this.zoom+1),s,{},a,[],h),C=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(C,e,d,p)}updatePaintArray(e,s,r,a){let h=this.expression.evaluate({zoom:this.zoom},r,a),d=this.expression.evaluate({zoom:this.zoom+1},r,a);this._setPaintValue(e,s,h,d)}_setPaintValue(e,s,r,a){if(this.type==="color"){let h=da(r),d=da(a);for(let p=e;p`#define HAS_UNIFORM_${a}`))}return e}getBinderAttributes(){let e=[];for(let s in this.binders){let r=this.binders[s];if(r instanceof _n||r instanceof en)for(let a=0;a!0){this.programConfigurations={};for(let a of e)this.programConfigurations[a.id]=new pa(a,s,r);this.needsUpload=!1,this._featureMap=new fi,this._bufferOffset=0}populatePaintArrays(e,s,r,a,h,d){for(let p in this.programConfigurations)this.programConfigurations[p].populatePaintArrays(e,s,a,h,d);s.id!==void 0&&this._featureMap.add(s.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,s,r,a){for(let h of r)this.needsUpload=this.programConfigurations[h.id].updatePaintArrays(e,this._featureMap,s,h,a)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let s in this.programConfigurations)this.programConfigurations[s].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Iu(i,e){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"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function Nc(i,e,s){let r={color:{source:xr,composite:K},number:{source:f,composite:xr}},a=function(h){return{"line-pattern":{source:Yt,composite:Yt},"fill-pattern":{source:Yt,composite:Yt},"fill-extrusion-pattern":{source:Yt,composite:Yt}}[h]}(i);return a&&a[s]||r[e][s]}Ye("ConstantBinder",bn),Ye("CrossFadedConstantBinder",lr),Ye("SourceExpressionBinder",_n),Ye("CrossFadedCompositeBinder",vn),Ye("CompositeExpressionBinder",en),Ye("ProgramConfiguration",pa,{omit:["_buffers"]}),Ye("ProgramConfigurationSet",Jn);let Zi=8192,Ql=Math.pow(2,14)-1,Oc=-Ql-1;function Ur(i){let e=Zi/i.extent,s=i.loadGeometry();for(let r=0;rd.x+1||Cd.y+1)&&yi("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return s}function jr(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?Ur(i):[]}}function gl(i,e,s,r,a){i.emplaceBack(2*e+(r+1)/2,2*s+(a+1)/2)}class ql{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(s=>s.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new je,this.indexArray=new Oi,this.segments=new ii,this.programConfigurations=new Jn(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(e,s,r){let a=this.layers[0],h=[],d=null,p=!1;a.type==="circle"&&(d=a.layout.get("circle-sort-key"),p=!d.isConstant());for(let{feature:C,id:A,index:b,sourceLayerIndex:x}of e){let S=this.layers[0]._featureFilter.needGeometry,G=jr(C,S);if(!this.layers[0]._featureFilter.filter(new ti(this.zoom),G,r))continue;let R=p?d.evaluate(G,{},r):void 0,M={id:A,properties:C.properties,type:C.type,sourceLayerIndex:x,index:b,geometry:S?G.geometry:Ur(C),patterns:{},sortKey:R};h.push(M)}p&&h.sort((C,A)=>C.sortKey-A.sortKey);for(let C of h){let{geometry:A,index:b,sourceLayerIndex:x}=C,S=e[b].feature;this.addFeature(C,A,b,r),s.featureIndex.insert(S,A,b,x,this.index)}}update(e,s,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,s,this.stateDependentLayers,r)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ks),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,s,r,a){for(let h of s)for(let d of h){let p=d.x,C=d.y;if(p<0||p>=Zi||C<0||C>=Zi)continue;let A=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),b=A.vertexLength;gl(this.layoutVertexArray,p,C,-1,-1),gl(this.layoutVertexArray,p,C,1,-1),gl(this.layoutVertexArray,p,C,1,1),gl(this.layoutVertexArray,p,C,-1,1),this.indexArray.emplaceBack(b,b+1,b+2),this.indexArray.emplaceBack(b,b+3,b+2),A.vertexLength+=4,A.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},a)}}function Uc(i,e){for(let s=0;s1){if($l(i,e))return!0;for(let r=0;r1?s:s.sub(e)._mult(a)._add(e))}function qc(i,e){let s,r,a,h=!1;for(let d=0;de.y!=a.y>e.y&&e.x<(a.x-r.x)*(e.y-r.y)/(a.y-r.y)+r.x&&(h=!h)}return h}function _o(i,e){let s=!1;for(let r=0,a=i.length-1;re.y!=d.y>e.y&&e.x<(d.x-h.x)*(e.y-h.y)/(d.y-h.y)+h.x&&(s=!s)}return s}function Au(i,e,s){let r=s[0],a=s[2];if(i.xa.x&&e.x>a.x||i.ya.y&&e.y>a.y)return!1;let h=Vi(i,e,s[0]);return h!==Vi(i,e,s[1])||h!==Vi(i,e,s[2])||h!==Vi(i,e,s[3])}function Ia(i,e,s){let r=e.paint.get(i).value;return r.kind==="constant"?r.value:s.programConfigurations.get(e.id).getMaxValue(i)}function hl(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function ul(i,e,s,r,a){if(!e[0]&&!e[1])return i;let h=Ve.convert(e)._mult(a);s==="viewport"&&h._rotate(-r);let d=[];for(let p=0;pig(P,M))}(A,C),G=x?b*p:b;for(let R of a)for(let M of R){let P=x?M:ig(M,C),N=G,ne=dl([],[M.x,M.y,0,1],C);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?N*=ne[3]/d.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(N*=d.cameraToCenterDistance/ne[3]),mu(S,P,N))return!0}return!1}}function ig(i,e){let s=dl([],[i.x,i.y,0,1],e);return new Ve(s[0]/s[3],s[1]/s[3])}class sg extends ql{}let ng;Ye("HeatmapBucket",sg,{omit:["layers"]});var vu={get paint(){return ng=ng||new vi({"heatmap-radius":new at(Ce.paint_heatmap["heatmap-radius"]),"heatmap-weight":new at(Ce.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new tt(Ce.paint_heatmap["heatmap-intensity"]),"heatmap-color":new aa(Ce.paint_heatmap["heatmap-color"]),"heatmap-opacity":new tt(Ce.paint_heatmap["heatmap-opacity"])})}};function ic(i,{width:e,height:s},r,a){if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==e*s*r)throw new RangeError(`mismatched image size. expected: ${a.length} but got: ${e*s*r}`)}else a=new Uint8Array(e*s*r);return i.width=e,i.height=s,i.data=a,i}function rg(i,{width:e,height:s},r){if(e===i.width&&s===i.height)return;let a=ic({},{width:e,height:s},r);sc(i,a,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,s)},r),i.width=e,i.height=s,i.data=a.data}function sc(i,e,s,r,a,h){if(a.width===0||a.height===0)return e;if(a.width>i.width||a.height>i.height||s.x>i.width-a.width||s.y>i.height-a.height)throw new RangeError("out of range source coordinates for image copy");if(a.width>e.width||a.height>e.height||r.x>e.width-a.width||r.y>e.height-a.height)throw new RangeError("out of range destination coordinates for image copy");let d=i.data,p=e.data;if(d===p)throw new Error("srcData equals dstData, so image is already copied");for(let C=0;C{e[i.evaluationKey]=C;let A=i.expression.evaluate(e);a.data[d+p+0]=Math.floor(255*A.r/A.a),a.data[d+p+1]=Math.floor(255*A.g/A.a),a.data[d+p+2]=Math.floor(255*A.b/A.a),a.data[d+p+3]=Math.floor(255*A.a)};if(i.clips)for(let d=0,p=0;d80*s){r=h=i[0],a=d=i[1];for(var R=s;Rh&&(h=p),C>d&&(d=C);A=(A=Math.max(h-r,d-a))!==0?32767/A:0}return fa(S,G,s,r,a,A,0),G}function lg(i,e,s,r,a){var h,d;if(a===ac(i,e,s,r)>0)for(h=e;h=e;h-=r)d=hg(h,i[h],i[h+1],d);return d&&Il(d,d.next)&&(ya(d),d=d.next),d}function Qr(i,e){if(!i)return i;e||(e=i);var s,r=i;do if(s=!1,r.steiner||!Il(r,r.next)&&wi(r.prev,r,r.next)!==0)r=r.next;else{if(ya(r),(r=e=r.prev)===r.next)break;s=!0}while(s||r!==e);return e}function fa(i,e,s,r,a,h,d){if(i){!d&&h&&function(b,x,S,G){var R=b;do R.z===0&&(R.z=rc(R.x,R.y,x,S,G)),R.prevZ=R.prev,R.nextZ=R.next,R=R.next;while(R!==b);R.prevZ.nextZ=null,R.prevZ=null,function(M){var P,N,ne,Q,ae,he,we,Ee,Qe=1;do{for(N=M,M=null,ae=null,he=0;N;){for(he++,ne=N,we=0,P=0;P0||Ee>0&≠)we!==0&&(Ee===0||!ne||N.z<=ne.z)?(Q=N,N=N.nextZ,we--):(Q=ne,ne=ne.nextZ,Ee--),ae?ae.nextZ=Q:M=Q,Q.prevZ=ae,ae=Q;N=ne}ae.nextZ=null,Qe*=2}while(he>1)}(R)}(i,r,a,h);for(var p,C,A=i;i.prev!==i.next;)if(p=i.prev,C=i.next,h?Gu(i,r,a,h):Bu(i))e.push(p.i/s|0),e.push(i.i/s|0),e.push(C.i/s|0),ya(i),i=C.next,A=C.next;else if((i=C)===A){d?d===1?fa(i=Ru(Qr(i),e,s),e,s,r,a,h,2):d===2&&Vu(i,e,s,r,a,h):fa(Qr(i),e,s,r,a,h,1);break}}}function Bu(i){var e=i.prev,s=i,r=i.next;if(wi(e,s,r)>=0)return!1;for(var a=e.x,h=s.x,d=r.x,p=e.y,C=s.y,A=r.y,b=ah?a>d?a:d:h>d?h:d,G=p>C?p>A?p:A:C>A?C:A,R=r.next;R!==e;){if(R.x>=b&&R.x<=S&&R.y>=x&&R.y<=G&&xo(a,p,h,C,d,A,R.x,R.y)&&wi(R.prev,R,R.next)>=0)return!1;R=R.next}return!0}function Gu(i,e,s,r){var a=i.prev,h=i,d=i.next;if(wi(a,h,d)>=0)return!1;for(var p=a.x,C=h.x,A=d.x,b=a.y,x=h.y,S=d.y,G=pC?p>A?p:A:C>A?C:A,P=b>x?b>S?b:S:x>S?x:S,N=rc(G,R,e,s,r),ne=rc(M,P,e,s,r),Q=i.prevZ,ae=i.nextZ;Q&&Q.z>=N&&ae&&ae.z<=ne;){if(Q.x>=G&&Q.x<=M&&Q.y>=R&&Q.y<=P&&Q!==a&&Q!==d&&xo(p,b,C,x,A,S,Q.x,Q.y)&&wi(Q.prev,Q,Q.next)>=0||(Q=Q.prevZ,ae.x>=G&&ae.x<=M&&ae.y>=R&&ae.y<=P&&ae!==a&&ae!==d&&xo(p,b,C,x,A,S,ae.x,ae.y)&&wi(ae.prev,ae,ae.next)>=0))return!1;ae=ae.nextZ}for(;Q&&Q.z>=N;){if(Q.x>=G&&Q.x<=M&&Q.y>=R&&Q.y<=P&&Q!==a&&Q!==d&&xo(p,b,C,x,A,S,Q.x,Q.y)&&wi(Q.prev,Q,Q.next)>=0)return!1;Q=Q.prevZ}for(;ae&&ae.z<=ne;){if(ae.x>=G&&ae.x<=M&&ae.y>=R&&ae.y<=P&&ae!==a&&ae!==d&&xo(p,b,C,x,A,S,ae.x,ae.y)&&wi(ae.prev,ae,ae.next)>=0)return!1;ae=ae.nextZ}return!0}function Ru(i,e,s){var r=i;do{var a=r.prev,h=r.next.next;!Il(a,h)&&cg(a,r,r.next,h)&&Aa(a,h)&&Aa(h,a)&&(e.push(a.i/s|0),e.push(r.i/s|0),e.push(h.i/s|0),ya(r),ya(r.next),r=i=h),r=r.next}while(r!==i);return Qr(r)}function Vu(i,e,s,r,a,h){var d=i;do{for(var p=d.next.next;p!==d.prev;){if(d.i!==p.i&&Mu(d,p)){var C=gg(d,p);return d=Qr(d,d.next),C=Qr(C,C.next),fa(d,e,s,r,a,h,0),void fa(C,e,s,r,a,h,0)}p=p.next}d=d.next}while(d!==i)}function Tu(i,e){return i.x-e.x}function Wu(i,e){var s=function(a,h){var d,p=h,C=a.x,A=a.y,b=-1/0;do{if(A<=p.y&&A>=p.next.y&&p.next.y!==p.y){var x=p.x+(A-p.y)*(p.next.x-p.x)/(p.next.y-p.y);if(x<=C&&x>b&&(b=x,d=p.x=p.x&&p.x>=R&&C!==p.x&&xo(Ad.x||p.x===d.x&&Ju(d,p)))&&(d=p,P=S)),p=p.next;while(p!==G);return d}(i,e);if(!s)return e;var r=gg(s,i);return Qr(r,r.next),Qr(s,s.next)}function Ju(i,e){return wi(i.prev,i,e.prev)<0&&wi(e.next,i,i.next)<0}function rc(i,e,s,r,a){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-s)*a|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*a|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function zu(i){var e=i,s=i;do(e.x=(i-d)*(h-p)&&(i-d)*(r-p)>=(s-d)*(e-p)&&(s-d)*(h-p)>=(a-d)*(r-p)}function Mu(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(s,r){var a=s;do{if(a.i!==s.i&&a.next.i!==s.i&&a.i!==r.i&&a.next.i!==r.i&&cg(a,a.next,s,r))return!0;a=a.next}while(a!==s);return!1}(i,e)&&(Aa(i,e)&&Aa(e,i)&&function(s,r){var a=s,h=!1,d=(s.x+r.x)/2,p=(s.y+r.y)/2;do a.y>p!=a.next.y>p&&a.next.y!==a.y&&d<(a.next.x-a.x)*(p-a.y)/(a.next.y-a.y)+a.x&&(h=!h),a=a.next;while(a!==s);return h}(i,e)&&(wi(i.prev,i,e.prev)||wi(i,e.prev,e))||Il(i,e)&&wi(i.prev,i,i.next)>0&&wi(e.prev,e,e.next)>0)}function wi(i,e,s){return(e.y-i.y)*(s.x-e.x)-(e.x-i.x)*(s.y-e.y)}function Il(i,e){return i.x===e.x&&i.y===e.y}function cg(i,e,s,r){var a=Cl(wi(i,e,s)),h=Cl(wi(i,e,r)),d=Cl(wi(s,r,i)),p=Cl(wi(s,r,e));return a!==h&&d!==p||!(a!==0||!ml(i,s,e))||!(h!==0||!ml(i,r,e))||!(d!==0||!ml(s,i,r))||!(p!==0||!ml(s,e,r))}function ml(i,e,s){return e.x<=Math.max(i.x,s.x)&&e.x>=Math.min(i.x,s.x)&&e.y<=Math.max(i.y,s.y)&&e.y>=Math.min(i.y,s.y)}function Cl(i){return i>0?1:i<0?-1:0}function Aa(i,e){return wi(i.prev,i,i.next)<0?wi(i,e,i.next)>=0&&wi(i,i.prev,e)>=0:wi(i,e,i.prev)<0||wi(i,i.next,e)<0}function gg(i,e){var s=new oc(i.i,i.x,i.y),r=new oc(e.i,e.x,e.y),a=i.next,h=e.prev;return i.next=e,e.prev=i,s.next=a,a.prev=s,r.next=s,s.prev=r,h.next=r,r.prev=h,r}function hg(i,e,s,r){var a=new oc(i,e,s);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function ya(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function oc(i,e,s){this.i=i,this.x=e,this.y=s,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ac(i,e,s,r){for(var a=0,h=e,d=s-r;h0&&s.holes.push(r+=i[a-1].length)}return s};var ug=ee(nc.exports);function Fu(i,e,s,r,a){dg(i,e,s||0,r||i.length-1,a||Ku)}function dg(i,e,s,r,a){for(;r>s;){if(r-s>600){var h=r-s+1,d=e-s+1,p=Math.log(h),C=.5*Math.exp(2*p/3),A=.5*Math.sqrt(p*C*(h-C)/h)*(d-h/2<0?-1:1);dg(i,e,Math.max(s,Math.floor(e-d*C/h+A)),Math.min(r,Math.floor(e+(h-d)*C/h+A)),a)}var b=i[e],x=s,S=r;for(ba(i,s,e),a(i[r],b)>0&&ba(i,s,r);x0;)S--}a(i[s],b)===0?ba(i,s,S):ba(i,++S,r),S<=e&&(s=S+1),e<=S&&(r=S-1)}}function ba(i,e,s){var r=i[e];i[e]=i[s],i[s]=r}function Ku(i,e){return ie?1:0}function lc(i,e){let s=i.length;if(s<=1)return[i];let r=[],a,h;for(let d=0;d1)for(let d=0;ds.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new St,this.indexArray=new Oi,this.indexArray2=new Ji,this.programConfigurations=new Jn(e.layers,e.zoom),this.segments=new ii,this.segments2=new ii,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(e,s,r){this.hasPattern=cc("fill",this.layers,s);let a=this.layers[0].layout.get("fill-sort-key"),h=!a.isConstant(),d=[];for(let{feature:p,id:C,index:A,sourceLayerIndex:b}of e){let x=this.layers[0]._featureFilter.needGeometry,S=jr(p,x);if(!this.layers[0]._featureFilter.filter(new ti(this.zoom),S,r))continue;let G=h?a.evaluate(S,{},r,s.availableImages):void 0,R={id:C,properties:p.properties,type:p.type,sourceLayerIndex:b,index:A,geometry:x?S.geometry:Ur(p),patterns:{},sortKey:G};d.push(R)}h&&d.sort((p,C)=>p.sortKey-C.sortKey);for(let p of d){let{geometry:C,index:A,sourceLayerIndex:b}=p;if(this.hasPattern){let x=gc("fill",this.layers,p,this.zoom,s);this.patternFeatures.push(x)}else this.addFeature(p,C,A,r,{});s.featureIndex.insert(e[A].feature,C,A,b,this.index)}}update(e,s,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,s,this.stateDependentLayers,r)}addFeatures(e,s,r){for(let a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,s,r)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ku),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),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(e,s,r,a,h){for(let d of lc(s,500)){let p=0;for(let G of d)p+=G.length;let C=this.segments.prepareSegment(p,this.layoutVertexArray,this.indexArray),A=C.vertexLength,b=[],x=[];for(let G of d){if(G.length===0)continue;G!==d[0]&&x.push(b.length/2);let R=this.segments2.prepareSegment(G.length,this.layoutVertexArray,this.indexArray2),M=R.vertexLength;this.layoutVertexArray.emplaceBack(G[0].x,G[0].y),this.indexArray2.emplaceBack(M+G.length-1,M),b.push(G[0].x),b.push(G[0].y);for(let P=1;P>3}if(a--,r===1||r===2)h+=i.readSVarint(),d+=i.readSVarint(),r===1&&(e&&p.push(e),e=[]),e.push(new Yu(h,d));else{if(r!==7)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&p.push(e),p},wo.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,s=1,r=0,a=0,h=0,d=1/0,p=-1/0,C=1/0,A=-1/0;i.pos>3}if(r--,s===1||s===2)(a+=i.readSVarint())p&&(p=a),(h+=i.readSVarint())A&&(A=h);else if(s!==7)throw new Error("unknown command "+s)}return[d,C,p,A]},wo.prototype.toGeoJSON=function(i,e,s){var r,a,h=this.extent*Math.pow(2,s),d=this.extent*i,p=this.extent*e,C=this.loadGeometry(),A=wo.types[this.type];function b(G){for(var R=0;R>3;a=d===1?r.readString():d===2?r.readFloat():d===3?r.readDouble():d===4?r.readVarint64():d===5?r.readVarint():d===6?r.readSVarint():d===7?r.readBoolean():null}return a}(s))}fg.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new Uu(this._pbf,e,this.extent,this._keys,this._values)};var Qu=Cg;function qu(i,e,s){if(i===3){var r=new Qu(s,s.readVarint()+s.pos);r.length&&(e[r.name]=r)}}Sr.VectorTile=function(i,e){this.layers=i.readFields(qu,{},e)},Sr.VectorTileFeature=mg,Sr.VectorTileLayer=Cg;let $u=Sr.VectorTileFeature.types,uc=Math.pow(2,13);function _a(i,e,s,r,a,h,d,p){i.emplaceBack(e,s,2*Math.floor(r*uc)+d,a*uc*2,h*uc*2,Math.round(p))}class dc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(s=>s.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Xe,this.centroidVertexArray=new Te,this.indexArray=new Oi,this.programConfigurations=new Jn(e.layers,e.zoom),this.segments=new ii,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(e,s,r){this.features=[],this.hasPattern=cc("fill-extrusion",this.layers,s);for(let{feature:a,id:h,index:d,sourceLayerIndex:p}of e){let C=this.layers[0]._featureFilter.needGeometry,A=jr(a,C);if(!this.layers[0]._featureFilter.filter(new ti(this.zoom),A,r))continue;let b={id:h,sourceLayerIndex:p,index:d,geometry:C?A.geometry:Ur(a),properties:a.properties,type:a.type,patterns:{}};this.hasPattern?this.features.push(gc("fill-extrusion",this.layers,b,this.zoom,s)):this.addFeature(b,b.geometry,d,r,{}),s.featureIndex.insert(a,b.geometry,d,p,this.index,!0)}}addFeatures(e,s,r){for(let a of this.features){let{geometry:h}=a;this.addFeature(a,h,a.index,s,r)}}update(e,s,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,s,this.stateDependentLayers,r)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Du),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Eu.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,s,r,a,h){let d={x:0,y:0,vertexCount:0};for(let p of lc(s,500)){let C=0;for(let R of p)C+=R.length;let A=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let R of p){if(R.length===0||td(R))continue;let M=0;for(let P=0;P=1){let ne=R[P-1];if(!ed(N,ne)){A.vertexLength+4>ii.MAX_VERTEX_ARRAY_LENGTH&&(A=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let Q=N.sub(ne)._perp()._unit(),ae=ne.dist(N);M+ae>32768&&(M=0),_a(this.layoutVertexArray,N.x,N.y,Q.x,Q.y,0,0,M),_a(this.layoutVertexArray,N.x,N.y,Q.x,Q.y,0,1,M),d.x+=2*N.x,d.y+=2*N.y,d.vertexCount+=2,M+=ae,_a(this.layoutVertexArray,ne.x,ne.y,Q.x,Q.y,0,0,M),_a(this.layoutVertexArray,ne.x,ne.y,Q.x,Q.y,0,1,M),d.x+=2*ne.x,d.y+=2*ne.y,d.vertexCount+=2;let he=A.vertexLength;this.indexArray.emplaceBack(he,he+2,he+1),this.indexArray.emplaceBack(he+1,he+2,he+3),A.vertexLength+=4,A.primitiveLength+=2}}}}if(A.vertexLength+C>ii.MAX_VERTEX_ARRAY_LENGTH&&(A=this.segments.prepareSegment(C,this.layoutVertexArray,this.indexArray)),$u[e.type]!=="Polygon")continue;let b=[],x=[],S=A.vertexLength;for(let R of p)if(R.length!==0){R!==p[0]&&x.push(b.length/2);for(let M=0;MZi)||i.y===e.y&&(i.y<0||i.y>Zi)}function td(i){return i.every(e=>e.x<0)||i.every(e=>e.x>Zi)||i.every(e=>e.y<0)||i.every(e=>e.y>Zi)}let Ag;Ye("FillExtrusionBucket",dc,{omit:["layers","features"]});var id={get paint(){return Ag=Ag||new vi({"fill-extrusion-opacity":new tt(Ce["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new at(Ce["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new tt(Ce["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new tt(Ce["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Yr(Ce["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new at(Ce["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new at(Ce["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new tt(Ce["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class sd extends $s{constructor(e){super(e,id)}createBucket(e){return new dc(e)}queryRadius(){return hl(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,s,r,a,h,d,p,C){let A=ul(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),d.angle,p),b=this.paint.get("fill-extrusion-height").evaluate(s,r),x=this.paint.get("fill-extrusion-base").evaluate(s,r),S=function(R,M,P,N){let ne=[];for(let Q of R){let ae=[Q.x,Q.y,0,1];dl(ae,ae,M),ne.push(new Ve(ae[0]/ae[3],ae[1]/ae[3]))}return ne}(A,C),G=function(R,M,P,N){let ne=[],Q=[],ae=N[8]*M,he=N[9]*M,we=N[10]*M,Ee=N[11]*M,Qe=N[8]*P,He=N[9]*P,Le=N[10]*P,Me=N[11]*P;for(let Ne of R){let Fe=[],Ge=[];for(let rt of Ne){let $e=rt.x,vt=rt.y,si=N[0]*$e+N[4]*vt+N[12],li=N[1]*$e+N[5]*vt+N[13],Fi=N[2]*$e+N[6]*vt+N[14],tn=N[3]*$e+N[7]*vt+N[15],Zs=Fi+we,ki=tn+Ee,ji=si+Qe,ns=li+He,ks=Fi+Le,Bs=tn+Me,Ki=new Ve((si+ae)/ki,(li+he)/ki);Ki.z=Zs/ki,Fe.push(Ki);let Xi=new Ve(ji/Bs,ns/Bs);Xi.z=ks/Bs,Ge.push(Xi)}ne.push(Fe),Q.push(Ge)}return[ne,Q]}(a,x,b,C);return function(R,M,P){let N=1/0;jc(P,M)&&(N=yg(P,M[0]));for(let ne=0;nes.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(s=>{this.gradients[s.id]={}}),this.layoutVertexArray=new lt,this.layoutVertexArray2=new qe,this.indexArray=new Oi,this.programConfigurations=new Jn(e.layers,e.zoom),this.segments=new ii,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(e,s,r){this.hasPattern=cc("line",this.layers,s);let a=this.layers[0].layout.get("line-sort-key"),h=!a.isConstant(),d=[];for(let{feature:p,id:C,index:A,sourceLayerIndex:b}of e){let x=this.layers[0]._featureFilter.needGeometry,S=jr(p,x);if(!this.layers[0]._featureFilter.filter(new ti(this.zoom),S,r))continue;let G=h?a.evaluate(S,{},r):void 0,R={id:C,properties:p.properties,type:p.type,sourceLayerIndex:b,index:A,geometry:x?S.geometry:Ur(p),patterns:{},sortKey:G};d.push(R)}h&&d.sort((p,C)=>p.sortKey-C.sortKey);for(let p of d){let{geometry:C,index:A,sourceLayerIndex:b}=p;if(this.hasPattern){let x=gc("line",this.layers,p,this.zoom,s);this.patternFeatures.push(x)}else this.addFeature(p,C,A,r,{});s.featureIndex.insert(e[A].feature,C,A,b,this.index)}}update(e,s,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,s,this.stateDependentLayers,r)}addFeatures(e,s,r){for(let a of this.patternFeatures)this.addFeature(a,a.geometry,a.index,s,r)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,ad)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,rd),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,s,r,a,h){let d=this.layers[0].layout,p=d.get("line-join").evaluate(e,{}),C=d.get("line-cap"),A=d.get("line-miter-limit"),b=d.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let x of s)this.addLine(x,e,p,C,A,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,h,a)}addLine(e,s,r,a,h,d){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let N=0;N=2&&e[C-1].equals(e[C-2]);)C--;let A=0;for(;A0;if(Ee&&N>A){let Me=S.dist(G);if(Me>2*b){let Ne=S.sub(S.sub(G)._mult(b/Me)._round());this.updateDistance(G,Ne),this.addCurrentVertex(Ne,M,0,0,x),G=Ne}}let He=G&&R,Le=He?r:p?"butt":a;if(He&&Le==="round"&&(heh&&(Le="bevel"),Le==="bevel"&&(he>2&&(Le="flipbevel"),he100)ne=P.mult(-1);else{let Me=he*M.add(P).mag()/M.sub(P).mag();ne._perp()._mult(Me*(Qe?-1:1))}this.addCurrentVertex(S,ne,0,0,x),this.addCurrentVertex(S,ne.mult(-1),0,0,x)}else if(Le==="bevel"||Le==="fakeround"){let Me=-Math.sqrt(he*he-1),Ne=Qe?Me:0,Fe=Qe?0:Me;if(G&&this.addCurrentVertex(S,M,Ne,Fe,x),Le==="fakeround"){let Ge=Math.round(180*we/Math.PI/20);for(let rt=1;rt2*b){let Ne=S.add(R.sub(S)._mult(b/Me)._round());this.updateDistance(S,Ne),this.addCurrentVertex(Ne,P,0,0,x),S=Ne}}}}addCurrentVertex(e,s,r,a,h,d=!1){let p=s.y*a-s.x,C=-s.y-s.x*a;this.addHalfVertex(e,s.x+s.y*r,s.y-s.x*r,d,!1,r,h),this.addHalfVertex(e,p,C,d,!0,-a,h),this.distance>bg/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,s,r,a,h,d))}addHalfVertex({x:e,y:s},r,a,h,d,p,C){let A=.5*(this.lineClips?this.scaledDistance*(bg-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(h?1:0),(s<<1)+(d?1:0),Math.round(63*r)+128,Math.round(63*a)+128,1+(p===0?0:p<0?-1:1)|(63&A)<<2,A>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let b=C.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,b),C.primitiveLength++),d?this.e2=b:this.e1=b}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,s){this.distance+=e.dist(s),this.updateScaledDistance()}}let _g,vg;Ye("LineBucket",pc,{omit:["layers","patternFeatures"]});var xg={get paint(){return vg=vg||new vi({"line-opacity":new at(Ce.paint_line["line-opacity"]),"line-color":new at(Ce.paint_line["line-color"]),"line-translate":new tt(Ce.paint_line["line-translate"]),"line-translate-anchor":new tt(Ce.paint_line["line-translate-anchor"]),"line-width":new at(Ce.paint_line["line-width"]),"line-gap-width":new at(Ce.paint_line["line-gap-width"]),"line-offset":new at(Ce.paint_line["line-offset"]),"line-blur":new at(Ce.paint_line["line-blur"]),"line-dasharray":new oa(Ce.paint_line["line-dasharray"]),"line-pattern":new Yr(Ce.paint_line["line-pattern"]),"line-gradient":new aa(Ce.paint_line["line-gradient"])})},get layout(){return _g=_g||new vi({"line-cap":new tt(Ce.layout_line["line-cap"]),"line-join":new at(Ce.layout_line["line-join"]),"line-miter-limit":new tt(Ce.layout_line["line-miter-limit"]),"line-round-limit":new tt(Ce.layout_line["line-round-limit"]),"line-sort-key":new at(Ce.layout_line["line-sort-key"])})}};class gd extends at{possiblyEvaluate(e,s){return s=new ti(Math.floor(s.zoom),{now:s.now,fadeDuration:s.fadeDuration,zoomHistory:s.zoomHistory,transition:s.transition}),super.possiblyEvaluate(e,s)}evaluate(e,s,r,a){return s=_t({},s,{zoom:Math.floor(s.zoom)}),super.evaluate(e,s,r,a)}}let fl;class hd extends $s{constructor(e){super(e,xg),this.gradientVersion=0,fl||(fl=new gd(xg.paint.properties["line-width"].specification),fl.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let s=this.gradientExpression();this.stepInterpolant=!!function(r){return r._styleExpression!==void 0}(s)&&s._styleExpression.expression instanceof Pn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,s){super.recalculate(e,s),this.paint._values["line-floorwidth"]=fl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new pc(e)}queryRadius(e){let s=e,r=wg(Ia("line-width",this,s),Ia("line-gap-width",this,s)),a=Ia("line-offset",this,s);return r/2+Math.abs(a)+hl(this.paint.get("line-translate"))}queryIntersectsFeature(e,s,r,a,h,d,p){let C=ul(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),d.angle,p),A=p/2*wg(this.paint.get("line-width").evaluate(s,r),this.paint.get("line-gap-width").evaluate(s,r)),b=this.paint.get("line-offset").evaluate(s,r);return b&&(a=function(x,S){let G=[];for(let R=0;R=3){for(let P=0;P0?e+2*i:i}let ud=ui([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),dd=ui([{name:"a_projected_pos",components:3,type:"Float32"}],4);ui([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let pd=ui([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);ui([{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 Sg=ui([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Id=ui([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function md(i,e,s){return i.sections.forEach(r=>{r.text=function(a,h,d){let p=h.layout.get("text-transform").evaluate(d,{});return p==="uppercase"?a=a.toLocaleUpperCase():p==="lowercase"&&(a=a.toLocaleLowerCase()),Fs.applyArabicShaping&&(a=Fs.applyArabicShaping(a)),a}(r.text,e,s)}),i}ui([{name:"triangle",components:3,type:"Uint16"}]),ui([{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"}]),ui([{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"}]),ui([{type:"Float32",name:"offsetX"}]),ui([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ui([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let xa={"!":"\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 Mi=24,Zg=Nt,kg=function(i,e,s,r,a){var h,d,p=8*a-r-1,C=(1<>1,b=-7,x=s?a-1:0,S=s?-1:1,G=i[e+x];for(x+=S,h=G&(1<<-b)-1,G>>=-b,b+=p;b>0;h=256*h+i[e+x],x+=S,b-=8);for(d=h&(1<<-b)-1,h>>=-b,b+=r;b>0;d=256*d+i[e+x],x+=S,b-=8);if(h===0)h=1-A;else{if(h===C)return d?NaN:1/0*(G?-1:1);d+=Math.pow(2,r),h-=A}return(G?-1:1)*d*Math.pow(2,h-r)},Bg=function(i,e,s,r,a,h){var d,p,C,A=8*h-a-1,b=(1<>1,S=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,G=r?0:h-1,R=r?1:-1,M=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,d=b):(d=Math.floor(Math.log(e)/Math.LN2),e*(C=Math.pow(2,-d))<1&&(d--,C*=2),(e+=d+x>=1?S/C:S*Math.pow(2,1-x))*C>=2&&(d++,C/=2),d+x>=b?(p=0,d=b):d+x>=1?(p=(e*C-1)*Math.pow(2,a),d+=x):(p=e*Math.pow(2,x-1)*Math.pow(2,a),d=0));a>=8;i[s+G]=255&p,G+=R,p/=256,a-=8);for(d=d<0;i[s+G]=255&d,G+=R,d/=256,A-=8);i[s+G-R]|=128*M};function Nt(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}Nt.Varint=0,Nt.Fixed64=1,Nt.Bytes=2,Nt.Fixed32=5;var Ic=4294967296,Gg=1/Ic,Rg=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function cr(i){return i.type===Nt.Bytes?i.readVarint()+i.pos:i.pos+1}function So(i,e,s){return s?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function Vg(i,e,s){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));s.realloc(r);for(var a=s.pos-1;a>=i;a--)s.buf[a+r]=s.buf[a]}function Cd(i,e){for(var s=0;s>>8,i[s+2]=e>>>16,i[s+3]=e>>>24}function Tg(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}Nt.prototype={destroy:function(){this.buf=null},readFields:function(i,e,s){for(s=s||this.length;this.pos>3,h=this.pos;this.type=7&r,i(a,e,this),this.pos===h&&this.skip(r)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=Al(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=Tg(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=Al(this.buf,this.pos)+Al(this.buf,this.pos+4)*Ic;return this.pos+=8,i},readSFixed64:function(){var i=Al(this.buf,this.pos)+Tg(this.buf,this.pos+4)*Ic;return this.pos+=8,i},readFloat:function(){var i=kg(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=kg(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,s,r=this.buf;return e=127&(s=r[this.pos++]),s<128?e:(e|=(127&(s=r[this.pos++]))<<7,s<128?e:(e|=(127&(s=r[this.pos++]))<<14,s<128?e:(e|=(127&(s=r[this.pos++]))<<21,s<128?e:function(a,h,d){var p,C,A=d.buf;if(p=(112&(C=A[d.pos++]))>>4,C<128||(p|=(127&(C=A[d.pos++]))<<3,C<128)||(p|=(127&(C=A[d.pos++]))<<10,C<128)||(p|=(127&(C=A[d.pos++]))<<17,C<128)||(p|=(127&(C=A[d.pos++]))<<24,C<128)||(p|=(1&(C=A[d.pos++]))<<31,C<128))return So(a,p,h);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(s=r[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&Rg?function(s,r,a){return Rg.decode(s.subarray(r,a))}(this.buf,e,i):function(s,r,a){for(var h="",d=r;d239?4:b>223?3:b>191?2:1;if(d+S>a)break;S===1?b<128&&(x=b):S===2?(192&(p=s[d+1]))==128&&(x=(31&b)<<6|63&p)<=127&&(x=null):S===3?(C=s[d+2],(192&(p=s[d+1]))==128&&(192&C)==128&&((x=(15&b)<<12|(63&p)<<6|63&C)<=2047||x>=55296&&x<=57343)&&(x=null)):S===4&&(C=s[d+2],A=s[d+3],(192&(p=s[d+1]))==128&&(192&C)==128&&(192&A)==128&&((x=(15&b)<<18|(63&p)<<12|(63&C)<<6|63&A)<=65535||x>=1114112)&&(x=null)),x===null?(x=65533,S=1):x>65535&&(x-=65536,h+=String.fromCharCode(x>>>10&1023|55296),x=56320|1023&x),h+=String.fromCharCode(x),d+=S}return h}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e},readPackedVarint:function(i,e){if(this.type!==Nt.Bytes)return i.push(this.readVarint(e));var s=cr(this);for(i=i||[];this.pos127;);else if(e===Nt.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Nt.Fixed32)this.pos+=4;else{if(e!==Nt.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e268435455||i<0?function(e,s){var r,a;if(e>=0?(r=e%4294967296|0,a=e/4294967296|0):(a=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,a=a+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");s.realloc(10),function(h,d,p){p.buf[p.pos++]=127&h|128,h>>>=7,p.buf[p.pos++]=127&h|128,h>>>=7,p.buf[p.pos++]=127&h|128,h>>>=7,p.buf[p.pos++]=127&h|128,p.buf[p.pos]=127&(h>>>=7)}(r,0,s),function(h,d){var p=(7&h)<<4;d.buf[d.pos++]|=p|((h>>>=3)?128:0),h&&(d.buf[d.pos++]=127&h|((h>>>=7)?128:0),h&&(d.buf[d.pos++]=127&h|((h>>>=7)?128:0),h&&(d.buf[d.pos++]=127&h|((h>>>=7)?128:0),h&&(d.buf[d.pos++]=127&h|((h>>>=7)?128:0),h&&(d.buf[d.pos++]=127&h)))))}(a,s)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(Boolean(i))},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(r,a,h){for(var d,p,C=0;C55295&&d<57344){if(!p){d>56319||C+1===a.length?(r[h++]=239,r[h++]=191,r[h++]=189):p=d;continue}if(d<56320){r[h++]=239,r[h++]=191,r[h++]=189,p=d;continue}d=p-55296<<10|d-56320|65536,p=null}else p&&(r[h++]=239,r[h++]=191,r[h++]=189,p=null);d<128?r[h++]=d:(d<2048?r[h++]=d>>6|192:(d<65536?r[h++]=d>>12|224:(r[h++]=d>>18|240,r[h++]=d>>12&63|128),r[h++]=d>>6&63|128),r[h++]=63&d|128)}return h}(this.buf,i,this.pos);var s=this.pos-e;s>=128&&Vg(e,s,this),this.pos=e-1,this.writeVarint(s),this.pos+=s},writeFloat:function(i){this.realloc(4),Bg(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),Bg(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var s=0;s=128&&Vg(s,r,this),this.pos=s-1,this.writeVarint(r),this.pos+=r},writeMessage:function(i,e,s){this.writeTag(i,Nt.Bytes),this.writeRawMessage(e,s)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,Cd,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,fd,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,bd,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,Ad,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,yd,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,_d,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,vd,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,xd,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,wd,e)},writeBytesField:function(i,e){this.writeTag(i,Nt.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,Nt.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,Nt.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,Nt.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(i,e){this.writeTag(i,Nt.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,Nt.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,Nt.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,Nt.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,Nt.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,Nt.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,Boolean(e))}};var mc=ee(Zg);let Cc=3;function Sd(i,e,s){i===1&&s.readMessage(Zd,e)}function Zd(i,e,s){if(i===3){let{id:r,bitmap:a,width:h,height:d,left:p,top:C,advance:A}=s.readMessage(kd,{});e.push({id:r,bitmap:new Ca({width:h+2*Cc,height:d+2*Cc},a),metrics:{width:h,height:d,left:p,top:C,advance:A}})}}function kd(i,e,s){i===1?e.id=s.readVarint():i===2?e.bitmap=s.readBytes():i===3?e.width=s.readVarint():i===4?e.height=s.readVarint():i===5?e.left=s.readSVarint():i===6?e.top=s.readSVarint():i===7&&(e.advance=s.readVarint())}let Wg=Cc;function Jg(i){let e=0,s=0;for(let d of i)e+=d.w*d.h,s=Math.max(s,d.w);i.sort((d,p)=>p.h-d.h);let r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),s),h:1/0}],a=0,h=0;for(let d of i)for(let p=r.length-1;p>=0;p--){let C=r[p];if(!(d.w>C.w||d.h>C.h)){if(d.x=C.x,d.y=C.y,h=Math.max(h,d.y+d.h),a=Math.max(a,d.x+d.w),d.w===C.w&&d.h===C.h){let A=r.pop();p=0&&r>=e&&bl[this.text.charCodeAt(r)];r--)s--;this.text=this.text.substring(e,s),this.sectionIndex=this.sectionIndex.slice(e,s)}substring(e,s){let r=new ko;return r.text=this.text.substring(e,s),r.sectionIndex=this.sectionIndex.slice(e,s),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,s)=>Math.max(e,this.sections[s].scale),0)}addTextSection(e,s){this.text+=e.text,this.sections.push(Sa.forText(e.scale,e.fontStack||s));let r=this.sections.length-1;for(let a=0;a=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function yl(i,e,s,r,a,h,d,p,C,A,b,x,S,G,R,M){let P=ko.fromFeature(i,a),N;x===c.ai.vertical&&P.verticalizePunctuation();let{processBidirectionalText:ne,processStyledBidirectionalText:Q}=Fs;if(ne&&P.sections.length===1){N=[];let we=ne(P.toString(),Ac(P,A,h,e,r,G,R));for(let Ee of we){let Qe=new ko;Qe.text=Ee,Qe.sections=P.sections;for(let He=0;He0&&hr>Ls&&(Ls=hr)}else{let an=Qe[kt.fontStack],Ps=an&&an[rs];if(Ps&&Ps.rect)zn=Ps.rect,xn=Ps.metrics;else{let hr=Ee[kt.fontStack],Ra=hr&&hr[rs];if(!Ra)continue;xn=Ra.metrics}Hi=(Xi-kt.scale)*Mi}wn?(we.verticalizable=!0,Is.push({glyph:rs,imageName:Mn,x:si,y:li+Hi,vertical:wn,scale:kt.scale,fontStack:kt.fontStack,sectionIndex:ms,metrics:xn,rect:zn}),si+=gr*kt.scale+rt):(Is.push({glyph:rs,imageName:Mn,x:si,y:li+Hi,vertical:wn,scale:kt.scale,fontStack:kt.fontStack,sectionIndex:ms,metrics:xn,rect:zn}),si+=xn.advance*kt.scale+rt)}Is.length!==0&&(Fi=Math.max(si-rt,Fi),Rd(Is,0,Is.length-1,Zs,Ls)),si=0;let Hs=Me*Xi+Ls;Gs.lineOffset=Math.max(Ls,ps),li+=Hs,tn=Math.max(Hs,tn),++ki}var ji;let ns=li-wa,{horizontalAlign:ks,verticalAlign:Bs}=yc(Ne);(function(Ki,Xi,ps,Gs,Is,Ls,Hs,Li,kt){let ms=(Xi-ps)*Is,rs=0;rs=Ls!==Hs?-Li*Gs-wa:(-Gs*kt+.5)*Hs;for(let Hi of Ki)for(let xn of Hi.positionedGlyphs)xn.x+=ms,xn.y+=rs})(we.positionedLines,Zs,ks,Bs,Fi,tn,Me,ns,Le.length),we.top+=-Bs*ns,we.bottom=we.top+ns,we.left+=-ks*Fi,we.right=we.left+Fi}(he,e,s,r,N,d,p,C,x,A,S,M),!function(we){for(let Ee of we)if(Ee.positionedGlyphs.length!==0)return!1;return!0}(ae)&&he}let bl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Bd={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 Mg(i,e,s,r,a,h){if(e.imageName){let d=r[e.imageName];return d?d.displaySize[0]*e.scale*Mi/h+a:0}{let d=s[e.fontStack],p=d&&d[i];return p?p.metrics.advance*e.scale+a:0}}function Fg(i,e,s,r){let a=Math.pow(i-e,2);return r?i=0,b=0;for(let S=0;Sd.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=tc([]),this.placementViewportMatrix=tc([]);let s=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Hg(this.zoom,s["text-size"]),this.iconSizeData=Hg(this.zoom,s["icon-size"]);let r=this.layers[0].layout,a=r.get("symbol-sort-key"),h=r.get("symbol-z-order");this.canOverlap=bc(r,"text-overlap","text-allow-overlap")!=="never"||bc(r,"icon-overlap","icon-allow-overlap")!=="never"||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=h!=="viewport-y"&&!a.isConstant(),this.sortFeaturesByY=(h==="viewport-y"||h==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map(d=>c.ai[d])),this.stateDependentLayerIds=this.layers.filter(d=>d.isStateDependent()).map(d=>d.id),this.sourceID=e.sourceID}createArrays(){this.text=new vc(new Jn(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new vc(new Jn(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new ie,this.lineVertexArray=new de,this.symbolInstances=new D,this.textAnchorOffsets=new ve}calculateGlyphDependencies(e,s,r,a,h){for(let d=0;d0)&&(d.value.kind!=="constant"||d.value.value.length>0),b=C.value.kind!=="constant"||!!C.value.value||Object.keys(C.parameters).length>0,x=h.get("symbol-sort-key");if(this.features=[],!A&&!b)return;let S=s.iconDependencies,G=s.glyphDependencies,R=s.availableImages,M=new ti(this.zoom);for(let{feature:P,id:N,index:ne,sourceLayerIndex:Q}of e){let ae=a._featureFilter.needGeometry,he=jr(P,ae);if(!a._featureFilter.filter(M,he,r))continue;let we,Ee;if(ae||(he.geometry=Ur(P)),A){let He=a.getValueAndResolveTokens("text-field",he,r,R),Le=Pi.factory(He);Jd(Le)&&(this.hasRTLText=!0),(!this.hasRTLText||na()==="unavailable"||this.hasRTLText&&Fs.isParsed())&&(we=md(Le,a,he))}if(b){let He=a.getValueAndResolveTokens("icon-image",he,r,R);Ee=He instanceof bi?He:bi.fromString(He)}if(!we&&!Ee)continue;let Qe=this.sortFeaturesByKey?x.evaluate(he,{},r):void 0;if(this.features.push({id:N,text:we,icon:Ee,index:ne,sourceLayerIndex:Q,geometry:he.geometry,properties:P.properties,type:Td[P.type],sortKey:Qe}),Ee&&(S[Ee.name]=!0),we){let He=d.evaluate(he,{},r).join(","),Le=h.get("text-rotation-alignment")!=="viewport"&&h.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(c.ai.vertical)>=0;for(let Me of we.sections)if(Me.image)S[Me.image.name]=!0;else{let Ne=jo(we.toString()),Fe=Me.fontStack||He,Ge=G[Fe]=G[Fe]||{};this.calculateGlyphDependencies(Me.text,Ge,Le,this.allowVerticalPlacement,Ne)}}}h.get("symbol-placement")==="line"&&(this.features=function(P){let N={},ne={},Q=[],ae=0;function he(He){Q.push(P[He]),ae++}function we(He,Le,Me){let Ne=ne[He];return delete ne[He],ne[Le]=Ne,Q[Ne].geometry[0].pop(),Q[Ne].geometry[0]=Q[Ne].geometry[0].concat(Me[0]),Ne}function Ee(He,Le,Me){let Ne=N[Le];return delete N[Le],N[He]=Ne,Q[Ne].geometry[0].shift(),Q[Ne].geometry[0]=Me[0].concat(Q[Ne].geometry[0]),Ne}function Qe(He,Le,Me){let Ne=Me?Le[0][Le[0].length-1]:Le[0][0];return`${He}:${Ne.x}:${Ne.y}`}for(let He=0;HeHe.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((P,N)=>P.sortKey-N.sortKey)}update(e,s,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,s,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,s,this.layers,r))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,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(e,s){let r=this.lineVertexArray.length;if(e.segment!==void 0){let a=e.dist(s[e.segment+1]),h=e.dist(s[e.segment]),d={};for(let p=e.segment+1;p=0;p--)d[p]={x:s[p].x,y:s[p].y,tileUnitDistanceFromAnchor:h},p>0&&(h+=s[p-1].dist(s[p]));for(let p=0;p0}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(e,s){let r=e.placedSymbolArray.get(s),a=r.vertexStartIndex+4*r.numGlyphs;for(let h=r.vertexStartIndex;ha[p]-a[C]||h[C]-h[p]),d}addToSortKeyRanges(e,s){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===s?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:s,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let s of this.symbolInstanceIndexes){let r=this.symbolInstances.get(s);this.featureSortOrder.push(r.featureIndex),[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex].forEach((a,h,d)=>{a>=0&&d.indexOf(a)===h&&this.addIndicesForPlacedSymbol(this.text,a)}),r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Pg,Eg;Ye("SymbolBucket",Bo,{omit:["layers","collisionBoxArray","features","compareText"]}),Bo.MAX_GLYPHS=65535,Bo.addDynamicAttributes=_c;var wc={get paint(){return Eg=Eg||new vi({"icon-opacity":new at(Ce.paint_symbol["icon-opacity"]),"icon-color":new at(Ce.paint_symbol["icon-color"]),"icon-halo-color":new at(Ce.paint_symbol["icon-halo-color"]),"icon-halo-width":new at(Ce.paint_symbol["icon-halo-width"]),"icon-halo-blur":new at(Ce.paint_symbol["icon-halo-blur"]),"icon-translate":new tt(Ce.paint_symbol["icon-translate"]),"icon-translate-anchor":new tt(Ce.paint_symbol["icon-translate-anchor"]),"text-opacity":new at(Ce.paint_symbol["text-opacity"]),"text-color":new at(Ce.paint_symbol["text-color"],{runtimeType:Ni,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new at(Ce.paint_symbol["text-halo-color"]),"text-halo-width":new at(Ce.paint_symbol["text-halo-width"]),"text-halo-blur":new at(Ce.paint_symbol["text-halo-blur"]),"text-translate":new tt(Ce.paint_symbol["text-translate"]),"text-translate-anchor":new tt(Ce.paint_symbol["text-translate-anchor"])})},get layout(){return Pg=Pg||new vi({"symbol-placement":new tt(Ce.layout_symbol["symbol-placement"]),"symbol-spacing":new tt(Ce.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new tt(Ce.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new at(Ce.layout_symbol["symbol-sort-key"]),"symbol-z-order":new tt(Ce.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new tt(Ce.layout_symbol["icon-allow-overlap"]),"icon-overlap":new tt(Ce.layout_symbol["icon-overlap"]),"icon-ignore-placement":new tt(Ce.layout_symbol["icon-ignore-placement"]),"icon-optional":new tt(Ce.layout_symbol["icon-optional"]),"icon-rotation-alignment":new tt(Ce.layout_symbol["icon-rotation-alignment"]),"icon-size":new at(Ce.layout_symbol["icon-size"]),"icon-text-fit":new tt(Ce.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new tt(Ce.layout_symbol["icon-text-fit-padding"]),"icon-image":new at(Ce.layout_symbol["icon-image"]),"icon-rotate":new at(Ce.layout_symbol["icon-rotate"]),"icon-padding":new at(Ce.layout_symbol["icon-padding"]),"icon-keep-upright":new tt(Ce.layout_symbol["icon-keep-upright"]),"icon-offset":new at(Ce.layout_symbol["icon-offset"]),"icon-anchor":new at(Ce.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new tt(Ce.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new tt(Ce.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new tt(Ce.layout_symbol["text-rotation-alignment"]),"text-field":new at(Ce.layout_symbol["text-field"]),"text-font":new at(Ce.layout_symbol["text-font"]),"text-size":new at(Ce.layout_symbol["text-size"]),"text-max-width":new at(Ce.layout_symbol["text-max-width"]),"text-line-height":new tt(Ce.layout_symbol["text-line-height"]),"text-letter-spacing":new at(Ce.layout_symbol["text-letter-spacing"]),"text-justify":new at(Ce.layout_symbol["text-justify"]),"text-radial-offset":new at(Ce.layout_symbol["text-radial-offset"]),"text-variable-anchor":new tt(Ce.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new at(Ce.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new at(Ce.layout_symbol["text-anchor"]),"text-max-angle":new tt(Ce.layout_symbol["text-max-angle"]),"text-writing-mode":new tt(Ce.layout_symbol["text-writing-mode"]),"text-rotate":new at(Ce.layout_symbol["text-rotate"]),"text-padding":new tt(Ce.layout_symbol["text-padding"]),"text-keep-upright":new tt(Ce.layout_symbol["text-keep-upright"]),"text-transform":new at(Ce.layout_symbol["text-transform"]),"text-offset":new at(Ce.layout_symbol["text-offset"]),"text-allow-overlap":new tt(Ce.layout_symbol["text-allow-overlap"]),"text-overlap":new tt(Ce.layout_symbol["text-overlap"]),"text-ignore-placement":new tt(Ce.layout_symbol["text-ignore-placement"]),"text-optional":new tt(Ce.layout_symbol["text-optional"])})}};class Dg{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Us,this.defaultValue=e}evaluate(e){if(e.formattedSection){let s=this.defaultValue.property.overrides;if(s&&s.hasOverride(e.formattedSection))return s.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Ye("FormatSectionOverride",Dg,{omit:["defaultValue"]});class vl extends $s{constructor(e){super(e,wc)}recalculate(e,s){if(super.recalculate(e,s),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 r=this.layout.get("text-writing-mode");if(r){let a=[];for(let h of r)a.indexOf(h)<0&&a.push(h);this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,s,r,a){let h=this.layout.get(e).evaluate(s,{},r,a),d=this._unevaluatedLayout._values[e];return d.isDataDriven()||lo(d.value)||!h?h:function(p,C){return C.replace(/{([^{}]+)}/g,(A,b)=>p&&b in p?String(p[b]):"")}(s.properties,h)}createBucket(e){return new Bo(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of wc.paint.overridableProperties){if(!vl.hasPaintOverride(this.layout,e))continue;let s=this.paint.get(e),r=new Dg(s),a=new Eo(r,s.property.specification),h=null;h=s.value.kind==="constant"||s.value.kind==="source"?new Do("source",a):new go("composite",a,s.value.zoomStops),this.paint._values[e]=new us(s.property,h,s.parameters)}}_handleOverridablePaintPropertyUpdate(e,s,r){return!(!this.layout||s.isDataDriven()||r.isDataDriven())&&vl.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,s){let r=e.get("text-field"),a=wc.paint.properties[s],h=!1,d=p=>{for(let C of p)if(a.overrides&&a.overrides.hasOverride(C))return void(h=!0)};if(r.value.kind==="constant"&&r.value.value instanceof Pi)d(r.value.value.sections);else if(r.value.kind==="source"){let p=A=>{h||(A instanceof Bn&&$t(A.value)===X?d(A.value.sections):A instanceof ao?d(A.sections):A.eachChild(p))},C=r.value;C._styleExpression&&p(C._styleExpression.expression)}return h}}let Yg;var zd={get paint(){return Yg=Yg||new vi({"background-color":new tt(Ce.paint_background["background-color"]),"background-pattern":new oa(Ce.paint_background["background-pattern"]),"background-opacity":new tt(Ce.paint_background["background-opacity"])})}};class Md extends $s{constructor(e){super(e,zd)}}let Ng;var Fd={get paint(){return Ng=Ng||new vi({"raster-opacity":new tt(Ce.paint_raster["raster-opacity"]),"raster-hue-rotate":new tt(Ce.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new tt(Ce.paint_raster["raster-brightness-min"]),"raster-brightness-max":new tt(Ce.paint_raster["raster-brightness-max"]),"raster-saturation":new tt(Ce.paint_raster["raster-saturation"]),"raster-contrast":new tt(Ce.paint_raster["raster-contrast"]),"raster-resampling":new tt(Ce.paint_raster["raster-resampling"]),"raster-fade-duration":new tt(Ce.paint_raster["raster-fade-duration"])})}};class Kd extends $s{constructor(e){super(e,Fd)}}class Xd extends $s{constructor(e){super(e,{}),this.onAdd=s=>{this.implementation.onAdd&&this.implementation.onAdd(s,s.painter.context.gl)},this.onRemove=s=>{this.implementation.onRemove&&this.implementation.onRemove(s,s.painter.context.gl)},this.implementation=e}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 Ld{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}let Sc=63710088e-1;class Br{constructor(e,s){if(isNaN(e)||isNaN(s))throw new Error(`Invalid LngLat object: (${e}, ${s})`);if(this.lng=+e,this.lat=+s,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Br(Gi(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let s=Math.PI/180,r=this.lat*s,a=e.lat*s,h=Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos((e.lng-this.lng)*s);return Sc*Math.acos(Math.min(h,1))}static convert(e){if(e instanceof Br)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Br(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Br(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}let Og=2*Math.PI*Sc;function Ug(i){return Og*Math.cos(i*Math.PI/180)}function jg(i){return(180+i)/360}function Qg(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function qg(i,e){return i/Ug(e)}function $g(i){return 360*i-180}function Zc(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class xl{constructor(e,s,r=0){this.x=+e,this.y=+s,this.z=+r}static fromLngLat(e,s=0){let r=Br.convert(e);return new xl(jg(r.lng),Qg(r.lat),qg(s,r.lat))}toLngLat(){return new Br($g(this.x),Zc(this.y))}toAltitude(){return this.z*Ug(Zc(this.y))}meterInMercatorCoordinateUnits(){return 1/Og*(e=Zc(this.y),1/Math.cos(e*Math.PI/180));var e}}function eh(i,e,s){var r=2*Math.PI*6378137/256/Math.pow(2,s);return[i*r-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}class kc{constructor(e,s,r){if(e<0||e>25||r<0||r>=Math.pow(2,e)||s<0||s>=Math.pow(2,e))throw new Error(`x=${s}, y=${r}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=s,this.y=r,this.key=ka(0,e,e,s,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,s,r){let a=(d=this.y,p=this.z,C=eh(256*(h=this.x),256*(d=Math.pow(2,p)-d-1),p),A=eh(256*(h+1),256*(d+1),p),C[0]+","+C[1]+","+A[0]+","+A[1]);var h,d,p,C,A;let b=function(x,S,G){let R,M="";for(let P=x;P>0;P--)R=1<1?"@2x":"").replace(/{quadkey}/g,b).replace(/{bbox-epsg-3857}/g,a)}isChildOf(e){let s=this.z-e.z;return s>0&&e.x===this.x>>s&&e.y===this.y>>s}getTilePoint(e){let s=Math.pow(2,this.z);return new Ve((e.x*s-this.x)*Zi,(e.y*s-this.y)*Zi)}toString(){return`${this.z}/${this.x}/${this.y}`}}class th{constructor(e,s){this.wrap=e,this.canonical=s,this.key=ka(e,s.z,s.z,s.x,s.y)}}class on{constructor(e,s,r,a,h){if(e= z; overscaledZ = ${e}; z = ${r}`);this.overscaledZ=e,this.wrap=s,this.canonical=new kc(r,+a,+h),this.key=ka(s,e,r,a,h)}clone(){return new on(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let s=this.canonical.z-e;return e>this.canonical.z?new on(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new on(e,this.wrap,e,this.canonical.x>>s,this.canonical.y>>s)}calculateScaledKey(e,s){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?ka(this.wrap*+s,e,this.canonical.z,this.canonical.x,this.canonical.y):ka(this.wrap*+s,e,e,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(e){if(e.wrap!==this.wrap)return!1;let s=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ>s&&e.canonical.y===this.canonical.y>>s}children(e){if(this.overscaledZ>=e)return[new on(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let s=this.canonical.z+1,r=2*this.canonical.x,a=2*this.canonical.y;return[new on(s,this.wrap,s,r,a),new on(s,this.wrap,s,r+1,a),new on(s,this.wrap,s,r,a+1),new on(s,this.wrap,s,r+1,a+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.ythis.max&&(this.max=x),x=this.dim+1||s<-1||s>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(s+1)*this.stride+(e+1)}unpack(e,s,r){return e*this.redFactor+s*this.greenFactor+r*this.blueFactor-this.baseShift}getPixels(){return new rn({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,s,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let a=s*this.dim,h=s*this.dim+this.dim,d=r*this.dim,p=r*this.dim+this.dim;switch(s){case-1:a=h-1;break;case 1:h=a+1}switch(r){case-1:d=p-1;break;case 1:p=d+1}let C=-s*this.dim,A=-r*this.dim;for(let b=d;b=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class nh{constructor(e,s,r,a,h){this.type="Feature",this._vectorTileFeature=e,e._z=s,e._x=r,e._y=a,this.properties=e.properties,this.id=h}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(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let s in this)s!=="_geometry"&&s!=="_vectorTileFeature"&&(e[s]=this[s]);return e}}class rh{constructor(e,s){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new br(Zi,16,0),this.grid3D=new br(Zi,16,0),this.featureIndexArray=new Ze,this.promoteId=s}insert(e,s,r,a,h,d){let p=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,a,h);let C=d?this.grid3D:this.grid;for(let A=0;A=0&&x[3]>=0&&C.insert(p,x[0],x[1],x[2],x[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Sr.VectorTile(new mc(this.rawTileData)).layers,this.sourceLayerCoder=new sh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,s,r,a){this.loadVTLayers();let h=e.params||{},d=Zi/e.tileSize/e.scale,p=No(h.filter),C=e.queryGeometry,A=e.queryPadding*d,b=ah(C),x=this.grid.query(b.minX-A,b.minY-A,b.maxX+A,b.maxY+A),S=ah(e.cameraQueryGeometry),G=this.grid3D.query(S.minX-A,S.minY-A,S.maxX+A,S.maxY+A,(P,N,ne,Q)=>function(ae,he,we,Ee,Qe){for(let Le of ae)if(he<=Le.x&&we<=Le.y&&Ee>=Le.x&&Qe>=Le.y)return!0;let He=[new Ve(he,we),new Ve(he,Qe),new Ve(Ee,Qe),new Ve(Ee,we)];if(ae.length>2){for(let Le of He)if(_o(ae,Le))return!0}for(let Le=0;Le(Q||(Q=Ur(ae)),he.queryIntersectsFeature(C,ae,we,Q,this.z,e.transform,d,e.pixelPosMatrix)))}return R}loadMatchingFeature(e,s,r,a,h,d,p,C,A,b,x){let S=this.bucketLayerIDs[s];if(d&&!function(P,N){for(let ne=0;ne=0)return!0;return!1}(d,S))return;let G=this.sourceLayerCoder.decode(r),R=this.vtLayers[G].feature(a);if(h.needGeometry){let P=jr(R,!0);if(!h.filter(new ti(this.tileID.overscaledZ),P,this.tileID.canonical))return}else if(!h.filter(new ti(this.tileID.overscaledZ),R))return;let M=this.getId(R,G);for(let P=0;P{let p=e instanceof yo?e.get(d):null;return p&&p.evaluate?p.evaluate(s,r,a):p})}function ah(i){let e=1/0,s=1/0,r=-1/0,a=-1/0;for(let h of i)e=Math.min(e,h.x),s=Math.min(s,h.y),r=Math.max(r,h.x),a=Math.max(a,h.y);return{minX:e,minY:s,maxX:r,maxY:a}}function Hd(i,e){return e-i}function lh(i,e,s,r,a){let h=[];for(let d=0;d=r&&x.x>=r||(b.x>=r?b=new Ve(r,b.y+(r-b.x)/(x.x-b.x)*(x.y-b.y))._round():x.x>=r&&(x=new Ve(r,b.y+(r-b.x)/(x.x-b.x)*(x.y-b.y))._round()),b.y>=a&&x.y>=a||(b.y>=a?b=new Ve(b.x+(a-b.y)/(x.y-b.y)*(x.x-b.x),a)._round():x.y>=a&&(x=new Ve(b.x+(a-b.y)/(x.y-b.y)*(x.x-b.x),a)._round()),C&&b.equals(C[C.length-1])||(C=[b],h.push(C)),C.push(x)))))}}return h}Ye("FeatureIndex",rh,{omit:["rawTileData","sourceLayerCoder"]});class Gr extends Ve{constructor(e,s,r,a){super(e,s),this.angle=r,a!==void 0&&(this.segment=a)}clone(){return new Gr(this.x,this.y,this.angle,this.segment)}}function ch(i,e,s,r,a){if(e.segment===void 0||s===0)return!0;let h=e,d=e.segment+1,p=0;for(;p>-s/2;){if(d--,d<0)return!1;p-=i[d].dist(h),h=i[d]}p+=i[d].dist(i[d+1]),d++;let C=[],A=0;for(;pr;)A-=C.shift().angleDelta;if(A>a)return!1;d++,p+=b.dist(x)}return!0}function gh(i){let e=0;for(let s=0;sA){let R=(A-C)/G,M=Js.number(x.x,S.x,R),P=Js.number(x.y,S.y,R),N=new Gr(M,P,S.angleTo(x),b);return N._round(),!d||ch(i,N,p,d,e)?N:void 0}C+=G}}function Ed(i,e,s,r,a,h,d,p,C){let A=hh(r,h,d),b=uh(r,a),x=b*d,S=i[0].x===0||i[0].x===C||i[0].y===0||i[0].y===C;return e-x=0&&ae=0&&he=0&&S+A<=b){let we=new Gr(ae,he,ne,R);we._round(),r&&!ch(i,we,h,r,a)||G.push(we)}}x+=N}return p||G.length||d||(G=dh(i,x/2,s,r,a,h,d,!0,C)),G}Ye("Anchor",Gr);let Go=Xs;function ph(i,e,s,r){let a=[],h=i.image,d=h.pixelRatio,p=h.paddedRect.w-2*Go,C=h.paddedRect.h-2*Go,A=i.right-i.left,b=i.bottom-i.top,x=h.stretchX||[[0,p]],S=h.stretchY||[[0,C]],G=(Me,Ne)=>Me+Ne[1]-Ne[0],R=x.reduce(G,0),M=S.reduce(G,0),P=p-R,N=C-M,ne=0,Q=R,ae=0,he=M,we=0,Ee=P,Qe=0,He=N;if(h.content&&r){let Me=h.content;ne=wl(x,0,Me[0]),ae=wl(S,0,Me[1]),Q=wl(x,Me[0],Me[2]),he=wl(S,Me[1],Me[3]),we=Me[0]-ne,Qe=Me[1]-ae,Ee=Me[2]-Me[0]-Q,He=Me[3]-Me[1]-he}let Le=(Me,Ne,Fe,Ge)=>{let rt=Sl(Me.stretch-ne,Q,A,i.left),$e=Zl(Me.fixed-we,Ee,Me.stretch,R),vt=Sl(Ne.stretch-ae,he,b,i.top),si=Zl(Ne.fixed-Qe,He,Ne.stretch,M),li=Sl(Fe.stretch-ne,Q,A,i.left),Fi=Zl(Fe.fixed-we,Ee,Fe.stretch,R),tn=Sl(Ge.stretch-ae,he,b,i.top),Zs=Zl(Ge.fixed-Qe,He,Ge.stretch,M),ki=new Ve(rt,vt),ji=new Ve(li,vt),ns=new Ve(li,tn),ks=new Ve(rt,tn),Bs=new Ve($e/d,si/d),Ki=new Ve(Fi/d,Zs/d),Xi=e*Math.PI/180;if(Xi){let Is=Math.sin(Xi),Ls=Math.cos(Xi),Hs=[Ls,-Is,Is,Ls];ki._matMult(Hs),ji._matMult(Hs),ks._matMult(Hs),ns._matMult(Hs)}let ps=Me.stretch+Me.fixed,Gs=Ne.stretch+Ne.fixed;return{tl:ki,tr:ji,bl:ks,br:ns,tex:{x:h.paddedRect.x+Go+ps,y:h.paddedRect.y+Go+Gs,w:Fe.stretch+Fe.fixed-ps,h:Ge.stretch+Ge.fixed-Gs},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Bs,pixelOffsetBR:Ki,minFontScaleX:Ee/d/A,minFontScaleY:He/d/b,isSDF:s}};if(r&&(h.stretchX||h.stretchY)){let Me=Ih(x,P,R),Ne=Ih(S,N,M);for(let Fe=0;Fe0&&(R=Math.max(10,R),this.circleDiameter=R)}else{let x=d.top*p-C[0],S=d.bottom*p+C[2],G=d.left*p-C[3],R=d.right*p+C[1],M=d.collisionPadding;if(M&&(G-=M[0]*p,x-=M[1]*p,R+=M[2]*p,S+=M[3]*p),b){let P=new Ve(G,x),N=new Ve(R,x),ne=new Ve(G,S),Q=new Ve(R,S),ae=b*Math.PI/180;P._rotate(ae),N._rotate(ae),ne._rotate(ae),Q._rotate(ae),G=Math.min(P.x,N.x,ne.x,Q.x),R=Math.max(P.x,N.x,ne.x,Q.x),x=Math.min(P.y,N.y,ne.y,Q.y),S=Math.max(P.y,N.y,ne.y,Q.y)}e.emplaceBack(s.x,s.y,G,x,R,S,r,a,h)}this.boxEndIndex=e.length}}class Dd{constructor(e=[],s=Yd){if(this.data=e,this.length=this.data.length,this.compare=s,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let e=this.data[0],s=this.data.pop();return this.length--,this.length>0&&(this.data[0]=s,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:s,compare:r}=this,a=s[e];for(;e>0;){let h=e-1>>1,d=s[h];if(r(a,d)>=0)break;s[e]=d,e=h}s[e]=a}_down(e){let{data:s,compare:r}=this,a=this.length>>1,h=s[e];for(;e=0)break;s[e]=p,e=d}s[e]=h}}function Yd(i,e){return ie?1:0}function Nd(i,e=1,s=!1){let r=1/0,a=1/0,h=-1/0,d=-1/0,p=i[0];for(let G=0;Gh)&&(h=R.x),(!G||R.y>d)&&(d=R.y)}let C=Math.min(h-r,d-a),A=C/2,b=new Dd([],Od);if(C===0)return new Ve(r,a);for(let G=r;Gx.d||!x.d)&&(x=G,s&&console.log("found best %d after %d probes",Math.round(1e4*G.d)/1e4,S)),G.max-x.d<=e||(A=G.h/2,b.push(new Ro(G.p.x-A,G.p.y-A,A,i)),b.push(new Ro(G.p.x+A,G.p.y-A,A,i)),b.push(new Ro(G.p.x-A,G.p.y+A,A,i)),b.push(new Ro(G.p.x+A,G.p.y+A,A,i)),S+=4)}return s&&(console.log(`num probes: ${S}`),console.log(`best distance: ${x.d}`)),x.p}function Od(i,e){return e.max-i.max}function Ro(i,e,s,r){this.p=new Ve(i,e),this.h=s,this.d=function(a,h){let d=!1,p=1/0;for(let C=0;Ca.y!=R.y>a.y&&a.x<(R.x-G.x)*(a.y-G.y)/(R.y-G.y)+G.x&&(d=!d),p=Math.min(p,Qc(a,G,R))}}return(d?1:-1)*Math.sqrt(p)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}var ss;c.aq=void 0,(ss=c.aq||(c.aq={}))[ss.center=1]="center",ss[ss.left=2]="left",ss[ss.right=3]="right",ss[ss.top=4]="top",ss[ss.bottom=5]="bottom",ss[ss["top-left"]=6]="top-left",ss[ss["top-right"]=7]="top-right",ss[ss["bottom-left"]=8]="bottom-left",ss[ss["bottom-right"]=9]="bottom-right";let Rr=7,Bc=Number.POSITIVE_INFINITY;function mh(i,e){return e[1]!==Bc?function(s,r,a){let h=0,d=0;switch(r=Math.abs(r),a=Math.abs(a),s){case"top-right":case"top-left":case"top":d=a-Rr;break;case"bottom-right":case"bottom-left":case"bottom":d=-a+Rr}switch(s){case"top-right":case"bottom-right":case"right":h=-r;break;case"top-left":case"bottom-left":case"left":h=r}return[h,d]}(i,e[0],e[1]):function(s,r){let a=0,h=0;r<0&&(r=0);let d=r/Math.SQRT2;switch(s){case"top-right":case"top-left":h=d-Rr;break;case"bottom-right":case"bottom-left":h=-d+Rr;break;case"bottom":h=-r+Rr;break;case"top":h=r-Rr}switch(s){case"top-right":case"bottom-right":a=-d;break;case"top-left":case"bottom-left":a=d;break;case"left":a=r;break;case"right":a=-r}return[a,h]}(i,e[0])}function Ch(i,e,s){var r;let a=i.layout,h=(r=a.get("text-variable-anchor-offset"))===null||r===void 0?void 0:r.evaluate(e,{},s);if(h){let p=h.values,C=[];for(let A=0;AS*Mi);b.startsWith("top")?x[1]-=Rr:b.startsWith("bottom")&&(x[1]+=Rr),C[A+1]=x}return new ts(C)}let d=a.get("text-variable-anchor");if(d){let p;p=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[a.get("text-radial-offset").evaluate(e,{},s)*Mi,Bc]:a.get("text-offset").evaluate(e,{},s).map(A=>A*Mi);let C=[];for(let A of d)C.push(A,mh(A,p));return new ts(C)}return null}function Gc(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Ud(i,e,s,r,a,h,d,p,C,A,b){let x=h.textMaxSize.evaluate(e,{});x===void 0&&(x=d);let S=i.layers[0].layout,G=S.get("icon-offset").evaluate(e,{},b),R=Ah(s.horizontal),M=d/24,P=i.tilePixelRatio*M,N=i.tilePixelRatio*x/24,ne=i.tilePixelRatio*p,Q=i.tilePixelRatio*S.get("symbol-spacing"),ae=S.get("text-padding")*i.tilePixelRatio,he=function(Ge,rt,$e,vt=1){let si=Ge.get("icon-padding").evaluate(rt,{},$e),li=si&&si.values;return[li[0]*vt,li[1]*vt,li[2]*vt,li[3]*vt]}(S,e,b,i.tilePixelRatio),we=S.get("text-max-angle")/180*Math.PI,Ee=S.get("text-rotation-alignment")!=="viewport"&&S.get("symbol-placement")!=="point",Qe=S.get("icon-rotation-alignment")==="map"&&S.get("symbol-placement")!=="point",He=S.get("symbol-placement"),Le=Q/2,Me=S.get("icon-text-fit"),Ne;r&&Me!=="none"&&(i.allowVerticalPlacement&&s.vertical&&(Ne=Lg(r,s.vertical,Me,S.get("icon-text-fit-padding"),G,M)),R&&(r=Lg(r,R,Me,S.get("icon-text-fit-padding"),G,M)));let Fe=(Ge,rt)=>{rt.x<0||rt.x>=Zi||rt.y<0||rt.y>=Zi||function($e,vt,si,li,Fi,tn,Zs,ki,ji,ns,ks,Bs,Ki,Xi,ps,Gs,Is,Ls,Hs,Li,kt,ms,rs,Hi,xn){let zn=$e.addToLineVertexArray(vt,si),Mn,gr,wn,an,Ps=0,hr=0,Ra=0,vh=0,Fc=-1,Kc=-1,ur={},xh=or("");if($e.allowVerticalPlacement&&li.vertical){let Cs=ki.layout.get("text-rotate").evaluate(kt,{},Hi)+90;wn=new kl(ji,vt,ns,ks,Bs,li.vertical,Ki,Xi,ps,Cs),Zs&&(an=new kl(ji,vt,ns,ks,Bs,Zs,Is,Ls,ps,Cs))}if(Fi){let Cs=ki.layout.get("icon-rotate").evaluate(kt,{}),ln=ki.layout.get("icon-text-fit")!=="none",qr=ph(Fi,Cs,rs,ln),Kn=Zs?ph(Zs,Cs,rs,ln):void 0;gr=new kl(ji,vt,ns,ks,Bs,Fi,Is,Ls,!1,Cs),Ps=4*qr.length;let $r=$e.iconSizeData,Un=null;$r.kind==="source"?(Un=[On*ki.layout.get("icon-size").evaluate(kt,{})],Un[0]>kr&&yi(`${$e.layerIds[0]}: Value for "icon-size" is >= ${Za}. Reduce your "icon-size".`)):$r.kind==="composite"&&(Un=[On*ms.compositeIconSizes[0].evaluate(kt,{},Hi),On*ms.compositeIconSizes[1].evaluate(kt,{},Hi)],(Un[0]>kr||Un[1]>kr)&&yi(`${$e.layerIds[0]}: Value for "icon-size" is >= ${Za}. Reduce your "icon-size".`)),$e.addSymbols($e.icon,qr,Un,Li,Hs,kt,c.ai.none,vt,zn.lineStartIndex,zn.lineLength,-1,Hi),Fc=$e.icon.placedSymbolArray.length-1,Kn&&(hr=4*Kn.length,$e.addSymbols($e.icon,Kn,Un,Li,Hs,kt,c.ai.vertical,vt,zn.lineStartIndex,zn.lineLength,-1,Hi),Kc=$e.icon.placedSymbolArray.length-1)}let wh=Object.keys(li.horizontal);for(let Cs of wh){let ln=li.horizontal[Cs];if(!Mn){xh=or(ln.text);let Kn=ki.layout.get("text-rotate").evaluate(kt,{},Hi);Mn=new kl(ji,vt,ns,ks,Bs,ln,Ki,Xi,ps,Kn)}let qr=ln.positionedLines.length===1;if(Ra+=fh($e,vt,ln,tn,ki,ps,kt,Gs,zn,li.vertical?c.ai.horizontal:c.ai.horizontalOnly,qr?wh:[Cs],ur,Fc,ms,Hi),qr)break}li.vertical&&(vh+=fh($e,vt,li.vertical,tn,ki,ps,kt,Gs,zn,c.ai.vertical,["vertical"],ur,Kc,ms,Hi));let qd=Mn?Mn.boxStartIndex:$e.collisionBoxArray.length,$d=Mn?Mn.boxEndIndex:$e.collisionBoxArray.length,ep=wn?wn.boxStartIndex:$e.collisionBoxArray.length,tp=wn?wn.boxEndIndex:$e.collisionBoxArray.length,ip=gr?gr.boxStartIndex:$e.collisionBoxArray.length,sp=gr?gr.boxEndIndex:$e.collisionBoxArray.length,np=an?an.boxStartIndex:$e.collisionBoxArray.length,rp=an?an.boxEndIndex:$e.collisionBoxArray.length,Fn=-1,Gl=(Cs,ln)=>Cs&&Cs.circleDiameter?Math.max(Cs.circleDiameter,ln):ln;Fn=Gl(Mn,Fn),Fn=Gl(wn,Fn),Fn=Gl(gr,Fn),Fn=Gl(an,Fn);let Sh=Fn>-1?1:0;Sh&&(Fn*=xn/Mi),$e.glyphOffsetArray.length>=Bo.MAX_GLYPHS&&yi("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),kt.sortKey!==void 0&&$e.addToSortKeyRanges($e.symbolInstances.length,kt.sortKey);let op=Ch(ki,kt,Hi),[ap,lp]=function(Cs,ln){let qr=Cs.length,Kn=ln?.values;if(Kn?.length>0)for(let $r=0;$r=0?ur.right:-1,ur.center>=0?ur.center:-1,ur.left>=0?ur.left:-1,ur.vertical||-1,Fc,Kc,xh,qd,$d,ep,tp,ip,sp,np,rp,ns,Ra,vh,Ps,hr,Sh,0,Ki,Fn,ap,lp)}(i,rt,Ge,s,r,a,Ne,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,P,[ae,ae,ae,ae],Ee,C,ne,he,Qe,G,e,h,A,b,d)};if(He==="line")for(let Ge of lh(e.geometry,0,0,Zi,Zi)){let rt=Ed(Ge,Q,we,s.vertical||R,r,24,N,i.overscaling,Zi);for(let $e of rt)R&&jd(i,R.text,Le,$e)||Fe(Ge,$e)}else if(He==="line-center"){for(let Ge of e.geometry)if(Ge.length>1){let rt=Pd(Ge,we,s.vertical||R,r,24,N);rt&&Fe(Ge,rt)}}else if(e.type==="Polygon")for(let Ge of lc(e.geometry,0)){let rt=Nd(Ge,16);Fe(Ge[0],new Gr(rt.x,rt.y,0))}else if(e.type==="LineString")for(let Ge of e.geometry)Fe(Ge,new Gr(Ge[0].x,Ge[0].y,0));else if(e.type==="Point")for(let Ge of e.geometry)for(let rt of Ge)Fe([rt],new Gr(rt.x,rt.y,0))}function fh(i,e,s,r,a,h,d,p,C,A,b,x,S,G,R){let M=function(ne,Q,ae,he,we,Ee,Qe,He){let Le=he.layout.get("text-rotate").evaluate(Ee,{})*Math.PI/180,Me=[];for(let Ne of Q.positionedLines)for(let Fe of Ne.positionedGlyphs){if(!Fe.rect)continue;let Ge=Fe.rect||{},rt=Wg+1,$e=!0,vt=1,si=0,li=(we||He)&&Fe.vertical,Fi=Fe.metrics.advance*Fe.scale/2;if(He&&Q.verticalizable&&(si=Ne.lineOffset/2-(Fe.imageName?-(Mi-Fe.metrics.width*Fe.scale)/2:(Fe.scale-1)*Mi)),Fe.imageName){let Li=Qe[Fe.imageName];$e=Li.sdf,vt=Li.pixelRatio,rt=Xs/vt}let tn=we?[Fe.x+Fi,Fe.y]:[0,0],Zs=we?[0,0]:[Fe.x+Fi+ae[0],Fe.y+ae[1]-si],ki=[0,0];li&&(ki=Zs,Zs=[0,0]);let ji=Fe.metrics.isDoubleResolution?2:1,ns=(Fe.metrics.left-rt)*Fe.scale-Fi+Zs[0],ks=(-Fe.metrics.top-rt)*Fe.scale+Zs[1],Bs=ns+Ge.w/ji*Fe.scale/vt,Ki=ks+Ge.h/ji*Fe.scale/vt,Xi=new Ve(ns,ks),ps=new Ve(Bs,ks),Gs=new Ve(ns,Ki),Is=new Ve(Bs,Ki);if(li){let Li=new Ve(-Fi,Fi-wa),kt=-Math.PI/2,ms=Mi/2-Fi,rs=new Ve(5-wa-ms,-(Fe.imageName?ms:0)),Hi=new Ve(...ki);Xi._rotateAround(kt,Li)._add(rs)._add(Hi),ps._rotateAround(kt,Li)._add(rs)._add(Hi),Gs._rotateAround(kt,Li)._add(rs)._add(Hi),Is._rotateAround(kt,Li)._add(rs)._add(Hi)}if(Le){let Li=Math.sin(Le),kt=Math.cos(Le),ms=[kt,-Li,Li,kt];Xi._matMult(ms),ps._matMult(ms),Gs._matMult(ms),Is._matMult(ms)}let Ls=new Ve(0,0),Hs=new Ve(0,0);Me.push({tl:Xi,tr:ps,bl:Gs,br:Is,tex:Ge,writingMode:Q.writingMode,glyphOffset:tn,sectionIndex:Fe.sectionIndex,isSDF:$e,pixelOffsetTL:Ls,pixelOffsetBR:Hs,minFontScaleX:0,minFontScaleY:0})}return Me}(0,s,p,a,h,d,r,i.allowVerticalPlacement),P=i.textSizeData,N=null;P.kind==="source"?(N=[On*a.layout.get("text-size").evaluate(d,{})],N[0]>kr&&yi(`${i.layerIds[0]}: Value for "text-size" is >= ${Za}. Reduce your "text-size".`)):P.kind==="composite"&&(N=[On*G.compositeTextSizes[0].evaluate(d,{},R),On*G.compositeTextSizes[1].evaluate(d,{},R)],(N[0]>kr||N[1]>kr)&&yi(`${i.layerIds[0]}: Value for "text-size" is >= ${Za}. Reduce your "text-size".`)),i.addSymbols(i.text,M,N,p,h,d,A,e,C.lineStartIndex,C.lineLength,S,R);for(let ne of b)x[ne]=i.text.placedSymbolArray.length-1;return 4*M.length}function Ah(i){for(let e in i)return i[e];return null}function jd(i,e,s,r){let a=i.compareText;if(e in a){let h=a[e];for(let d=h.length-1;d>=0;d--)if(r.dist(h[d])>4;if(a!==1)throw new Error(`Got v${a} data when expected v1.`);let h=yh[15&r];if(!h)throw new Error("Unrecognized array type.");let[d]=new Uint16Array(e,2,1),[p]=new Uint32Array(e,4,1);return new Rc(p,d,h,e)}constructor(e,s=64,r=Float64Array,a){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+s,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let h=yh.indexOf(this.ArrayType),d=2*e*this.ArrayType.BYTES_PER_ELEMENT,p=e*this.IndexArrayType.BYTES_PER_ELEMENT,C=(8-p%8)%8;if(h<0)throw new Error(`Unexpected typed array class: ${r}.`);a&&a instanceof ArrayBuffer?(this.data=a,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+C,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+d+p+C),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+p+C,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+h]),new Uint16Array(this.data,2,1)[0]=s,new Uint32Array(this.data,4,1)[0]=e)}add(e,s){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=s,r}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Vc(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,s,r,a){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:h,coords:d,nodeSize:p}=this,C=[0,h.length-1,0],A=[];for(;C.length;){let b=C.pop()||0,x=C.pop()||0,S=C.pop()||0;if(x-S<=p){for(let P=S;P<=x;P++){let N=d[2*P],ne=d[2*P+1];N>=e&&N<=r&&ne>=s&&ne<=a&&A.push(h[P])}continue}let G=S+x>>1,R=d[2*G],M=d[2*G+1];R>=e&&R<=r&&M>=s&&M<=a&&A.push(h[G]),(b===0?e<=R:s<=M)&&(C.push(S),C.push(G-1),C.push(1-b)),(b===0?r>=R:a>=M)&&(C.push(G+1),C.push(x),C.push(1-b))}return A}within(e,s,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:a,coords:h,nodeSize:d}=this,p=[0,a.length-1,0],C=[],A=r*r;for(;p.length;){let b=p.pop()||0,x=p.pop()||0,S=p.pop()||0;if(x-S<=d){for(let P=S;P<=x;P++)_h(h[2*P],h[2*P+1],e,s)<=A&&C.push(a[P]);continue}let G=S+x>>1,R=h[2*G],M=h[2*G+1];_h(R,M,e,s)<=A&&C.push(a[G]),(b===0?e-r<=R:s-r<=M)&&(p.push(S),p.push(G-1),p.push(1-b)),(b===0?e+r>=R:s+r>=M)&&(p.push(G+1),p.push(x),p.push(1-b))}return C}}function Vc(i,e,s,r,a,h){if(a-r<=s)return;let d=r+a>>1;bh(i,e,d,r,a,h),Vc(i,e,s,r,d-1,1-h),Vc(i,e,s,d+1,a,1-h)}function bh(i,e,s,r,a,h){for(;a>r;){if(a-r>600){let A=a-r+1,b=s-r+1,x=Math.log(A),S=.5*Math.exp(2*x/3),G=.5*Math.sqrt(x*S*(A-S)/A)*(b-A/2<0?-1:1);bh(i,e,s,Math.max(r,Math.floor(s-b*S/A+G)),Math.min(a,Math.floor(s+(A-b)*S/A+G)),h)}let d=e[2*s+h],p=r,C=a;for(Ba(i,e,r,s),e[2*a+h]>d&&Ba(i,e,r,a);pd;)C--}e[2*r+h]===d?Ba(i,e,r,C):(C++,Ba(i,e,C,a)),C<=s&&(r=C+1),s<=C&&(a=C-1)}}function Ba(i,e,s,r){Tc(i,s,r),Tc(e,2*s,2*r),Tc(e,2*s+1,2*r+1)}function Tc(i,e,s){let r=i[e];i[e]=i[s],i[s]=r}function _h(i,e,s,r){let a=i-s,h=e-r;return a*a+h*h}var Wc;c.bh=void 0,(Wc=c.bh||(c.bh={})).create="create",Wc.load="load",Wc.fullLoad="fullLoad";let Bl=null,Ga=[],Jc=1e3/60,zc="loadTime",Mc="fullLoadTime",Qd={mark(i){performance.mark(i)},frame(i){let e=i;Bl!=null&&Ga.push(e-Bl),Bl=e},clearMetrics(){Bl=null,Ga=[],performance.clearMeasures(zc),performance.clearMeasures(Mc);for(let i in c.bh)performance.clearMarks(c.bh[i])},getPerformanceMetrics(){performance.measure(zc,c.bh.create,c.bh.load),performance.measure(Mc,c.bh.create,c.bh.fullLoad);let i=performance.getEntriesByName(zc)[0].duration,e=performance.getEntriesByName(Mc)[0].duration,s=Ga.length,r=1/(Ga.reduce((h,d)=>h+d,0)/s/1e3),a=Ga.filter(h=>h>Jc).reduce((h,d)=>h+(d-Jc)/Jc,0);return{loadTime:i,fullLoadTime:e,fps:r,percentDroppedFrames:a/(s+a)*100,totalFrames:s}}};c.$=function(i,e,s){var r,a,h,d,p,C,A,b,x,S,G,R,M=s[0],P=s[1],N=s[2];return e===i?(i[12]=e[0]*M+e[4]*P+e[8]*N+e[12],i[13]=e[1]*M+e[5]*P+e[9]*N+e[13],i[14]=e[2]*M+e[6]*P+e[10]*N+e[14],i[15]=e[3]*M+e[7]*P+e[11]*N+e[15]):(a=e[1],h=e[2],d=e[3],p=e[4],C=e[5],A=e[6],b=e[7],x=e[8],S=e[9],G=e[10],R=e[11],i[0]=r=e[0],i[1]=a,i[2]=h,i[3]=d,i[4]=p,i[5]=C,i[6]=A,i[7]=b,i[8]=x,i[9]=S,i[10]=G,i[11]=R,i[12]=r*M+p*P+x*N+e[12],i[13]=a*M+C*P+S*N+e[13],i[14]=h*M+A*P+G*N+e[14],i[15]=d*M+b*P+R*N+e[15]),i},c.A=vo,c.B=Js,c.C=class{constructor(i,e,s){this.receive=r=>{let a=r.data,h=a.id;if(h&&(!a.targetMapId||this.mapId===a.targetMapId))if(a.type===""){delete this.tasks[h];let d=this.cancelCallbacks[h];delete this.cancelCallbacks[h],d&&d()}else Ke()||a.mustQueue?(this.tasks[h]=a,this.taskQueue.push(h),this.invoker.trigger()):this.processTask(h,a)},this.process=()=>{if(!this.taskQueue.length)return;let r=this.taskQueue.shift(),a=this.tasks[r];delete this.tasks[r],this.taskQueue.length&&this.invoker.trigger(),a&&this.processTask(r,a)},this.target=i,this.parent=e,this.mapId=s,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new Ld(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Ke()?i:window}send(i,e,s,r,a=!1){let h=Math.round(1e18*Math.random()).toString(36).substring(0,10);s&&(this.callbacks[h]=s);let d=[],p={id:h,type:i,hasCallback:!!s,targetMapId:r,mustQueue:a,sourceMapId:this.mapId,data:Dn(e,d)};return this.target.postMessage(p,{transfer:d}),{cancel:()=>{s&&delete this.callbacks[h],this.target.postMessage({id:h,type:"",targetMapId:r,sourceMapId:this.mapId})}}}processTask(i,e){if(e.type===""){let s=this.callbacks[i];delete this.callbacks[i],s&&(e.error?s(_r(e.error)):s(null,_r(e.data)))}else{let s=!1,r=[],a=e.hasCallback?(p,C)=>{s=!0,delete this.cancelCallbacks[i];let A={id:i,type:"",sourceMapId:this.mapId,error:p?Dn(p):null,data:Dn(C,r)};this.target.postMessage(A,{transfer:r})}:p=>{s=!0},h=null,d=_r(e.data);if(this.parent[e.type])h=this.parent[e.type](e.sourceMapId,d,a);else if("getWorkerSource"in this.parent){let p=e.type.split(".");h=this.parent.getWorkerSource(e.sourceMapId,p[0],d.source)[p[1]](d,a)}else a(new Error(`Could not find function ${e.type}`));!s&&h&&h.cancel&&(this.cancelCallbacks[i]=h.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},c.D=tt,c.E=pn,c.F=function(i,e){let s={};for(let r=0;r{}}},c.Y=We,c.Z=function(){var i=new vo(16);return vo!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},c._=De,c.a=gt,c.a$=class extends B{},c.a0=function(i,e,s){var r=s[0],a=s[1],h=s[2];return i[0]=e[0]*r,i[1]=e[1]*r,i[2]=e[2]*r,i[3]=e[3]*r,i[4]=e[4]*a,i[5]=e[5]*a,i[6]=e[6]*a,i[7]=e[7]*a,i[8]=e[8]*h,i[9]=e[9]*h,i[10]=e[10]*h,i[11]=e[11]*h,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},c.a1=tg,c.a2=function(){return Ri++},c.a3=L,c.a4=Bo,c.a5=function(){Fs.isLoading()||Fs.isLoaded()||na()!=="deferred"||sl()},c.a6=No,c.a7=jr,c.a8=ti,c.a9=nh,c.aA=Er,c.aB=function(i){i=i.slice();let e=Object.create(null);for(let s=0;s{r[d.source]?s.push({command:Tt.removeLayer,args:[d.id]}):h.push(d)}),s=s.concat(a),function(d,p,C){p=p||[];let A=(d=d||[]).map(Os),b=p.map(Os),x=d.reduce(In,{}),S=p.reduce(In,{}),G=A.slice(),R=Object.create(null),M,P,N,ne,Q,ae,he;for(M=0,P=0;M@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(s,r,a,h)=>{let d=a||h;return e[r]=!d||d.toLowerCase(),""}),e["max-age"]){let s=parseInt(e["max-age"],10);isNaN(s)?delete e["max-age"]:e["max-age"]=s}return e},c.ab=function(i,e){let s=[];for(let r in i)r in e||s.push(r);return s},c.ac=function(i){if(et==null){let e=i.navigator?i.navigator.userAgent:null;et=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return et},c.ad=Ei,c.ae=function(i,e,s){var r=Math.sin(s),a=Math.cos(s),h=e[0],d=e[1],p=e[2],C=e[3],A=e[4],b=e[5],x=e[6],S=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=h*a+A*r,i[1]=d*a+b*r,i[2]=p*a+x*r,i[3]=C*a+S*r,i[4]=A*a-h*r,i[5]=b*a-d*r,i[6]=x*a-p*r,i[7]=S*a-C*r,i},c.af=function(i){var e=new vo(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},c.ag=dl,c.ah=function(i,e){let s=0,r=0;if(i.kind==="constant")r=i.layoutSize;else if(i.kind!=="source"){let{interpolationType:a,minZoom:h,maxZoom:d}=i,p=a?Ei(zs.interpolationFactor(a,e,h,d),0,1):0;i.kind==="camera"?r=Js.number(i.minSize,i.maxSize,p):s=p}return{uSizeT:s,uSize:r}},c.aj=function(i,{uSize:e,uSizeT:s},{lowerSize:r,upperSize:a}){return i.kind==="source"?r/On:i.kind==="composite"?Js.number(r/On,a/On,s):e},c.ak=_c,c.al=function(i,e,s,r){let a=e.y-i.y,h=e.x-i.x,d=r.y-s.y,p=r.x-s.x,C=d*h-p*a;if(C===0)return null;let A=(p*(i.y-s.y)-d*(i.x-s.x))/C;return new Ve(i.x+A*h,i.y+A*a)},c.am=lh,c.an=Uc,c.ao=tc,c.ap=Mi,c.ar=bc,c.as=function(i,e){var s=e[0],r=e[1],a=e[2],h=e[3],d=e[4],p=e[5],C=e[6],A=e[7],b=e[8],x=e[9],S=e[10],G=e[11],R=e[12],M=e[13],P=e[14],N=e[15],ne=s*p-r*d,Q=s*C-a*d,ae=s*A-h*d,he=r*C-a*p,we=r*A-h*p,Ee=a*A-h*C,Qe=b*M-x*R,He=b*P-S*R,Le=b*N-G*R,Me=x*P-S*M,Ne=x*N-G*M,Fe=S*N-G*P,Ge=ne*Fe-Q*Ne+ae*Me+he*Le-we*He+Ee*Qe;return Ge?(i[0]=(p*Fe-C*Ne+A*Me)*(Ge=1/Ge),i[1]=(a*Ne-r*Fe-h*Me)*Ge,i[2]=(M*Ee-P*we+N*he)*Ge,i[3]=(S*we-x*Ee-G*he)*Ge,i[4]=(C*Le-d*Fe-A*He)*Ge,i[5]=(s*Fe-a*Le+h*He)*Ge,i[6]=(P*ae-R*Ee-N*Q)*Ge,i[7]=(b*Ee-S*ae+G*Q)*Ge,i[8]=(d*Ne-p*Le+A*Qe)*Ge,i[9]=(r*Le-s*Ne-h*Qe)*Ge,i[10]=(R*we-M*ae+N*ne)*Ge,i[11]=(x*ae-b*we-G*ne)*Ge,i[12]=(p*He-d*Me-C*Qe)*Ge,i[13]=(s*Me-r*He+a*Qe)*Ge,i[14]=(M*Q-R*he-P*ne)*Ge,i[15]=(b*he-x*Q+S*ne)*Ge,i):null},c.at=Gc,c.au=yc,c.av=Rc,c.aw=function(){let i={},e=Ce.$version;for(let s in Ce.$root){let r=Ce.$root[s];if(r.required){let a=null;a=s==="version"?e:r.type==="array"?[]:{},a!=null&&(i[s]=a)}}return i},c.ax=Tt,c.ay=$a,c.az=ys,c.b=function(i,e){let s=new Blob([new Uint8Array(i)],{type:"image/png"});createImageBitmap(s).then(r=>{e(null,r)}).catch(r=>{e(new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},c.b0=Oi,c.b1=function(i,e){var s=i[0],r=i[1],a=i[2],h=i[3],d=i[4],p=i[5],C=i[6],A=i[7],b=i[8],x=i[9],S=i[10],G=i[11],R=i[12],M=i[13],P=i[14],N=i[15],ne=e[0],Q=e[1],ae=e[2],he=e[3],we=e[4],Ee=e[5],Qe=e[6],He=e[7],Le=e[8],Me=e[9],Ne=e[10],Fe=e[11],Ge=e[12],rt=e[13],$e=e[14],vt=e[15];return Math.abs(s-ne)<=Ss*Math.max(1,Math.abs(s),Math.abs(ne))&&Math.abs(r-Q)<=Ss*Math.max(1,Math.abs(r),Math.abs(Q))&&Math.abs(a-ae)<=Ss*Math.max(1,Math.abs(a),Math.abs(ae))&&Math.abs(h-he)<=Ss*Math.max(1,Math.abs(h),Math.abs(he))&&Math.abs(d-we)<=Ss*Math.max(1,Math.abs(d),Math.abs(we))&&Math.abs(p-Ee)<=Ss*Math.max(1,Math.abs(p),Math.abs(Ee))&&Math.abs(C-Qe)<=Ss*Math.max(1,Math.abs(C),Math.abs(Qe))&&Math.abs(A-He)<=Ss*Math.max(1,Math.abs(A),Math.abs(He))&&Math.abs(b-Le)<=Ss*Math.max(1,Math.abs(b),Math.abs(Le))&&Math.abs(x-Me)<=Ss*Math.max(1,Math.abs(x),Math.abs(Me))&&Math.abs(S-Ne)<=Ss*Math.max(1,Math.abs(S),Math.abs(Ne))&&Math.abs(G-Fe)<=Ss*Math.max(1,Math.abs(G),Math.abs(Fe))&&Math.abs(R-Ge)<=Ss*Math.max(1,Math.abs(R),Math.abs(Ge))&&Math.abs(M-rt)<=Ss*Math.max(1,Math.abs(M),Math.abs(rt))&&Math.abs(P-$e)<=Ss*Math.max(1,Math.abs(P),Math.abs($e))&&Math.abs(N-vt)<=Ss*Math.max(1,Math.abs(N),Math.abs(vt))},c.b2=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},c.b3=function(i,e,s){return i[0]=e[0]*s[0],i[1]=e[1]*s[1],i[2]=e[2]*s[2],i[3]=e[3]*s[3],i},c.b4=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]},c.b5=Gi,c.b6=th,c.b7=qg,c.b8=function(i,e,s,r,a){var h,d=1/Math.tan(e/2);return i[0]=d/s,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=d,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,a!=null&&a!==1/0?(i[10]=(a+r)*(h=1/(r-a)),i[14]=2*a*r*h):(i[10]=-1,i[14]=-2*r),i},c.b9=function(i,e,s){var r=Math.sin(s),a=Math.cos(s),h=e[4],d=e[5],p=e[6],C=e[7],A=e[8],b=e[9],x=e[10],S=e[11];return e!==i&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=h*a+A*r,i[5]=d*a+b*r,i[6]=p*a+x*r,i[7]=C*a+S*r,i[8]=A*a-h*r,i[9]=b*a-d*r,i[10]=x*a-p*r,i[11]=S*a-C*r,i},c.bA=yt,c.bB=Zg,c.bC=co,c.bD=Fs,c.ba=os,c.bb=as,c.bc=function(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},c.bd=class extends Or{},c.be=Sc,c.bf=$g,c.bg=Qd,c.bi=As,c.bj=function(i,e,s=!1){if(xs===$o||xs===ea||xs===ta)throw new Error("setRTLTextPlugin cannot be called multiple times.");Yn=$i.resolveURL(i),xs=$o,ia=e,sa(),s||sl()},c.bk=na,c.bl=function(i,e){let s={};for(let a=0;aGe*Mi)}let He=d?"center":s.get("text-justify").evaluate(A,{},i.canonical),Le=s.get("symbol-placement"),Me=Le==="point"?s.get("text-max-width").evaluate(A,{},i.canonical)*Mi:0,Ne=()=>{i.bucket.allowVerticalPlacement&&jo(ae)&&(R.vertical=yl(M,i.glyphMap,i.glyphPositions,i.imagePositions,b,Me,h,Ee,"left",we,N,c.ai.vertical,!0,Le,S,x))};if(!d&&Qe){let Fe=new Set;if(He==="auto")for(let rt=0;rt{e(null,s),URL.revokeObjectURL(s.src),s.onload=null,window.requestAnimationFrame(()=>{s.src=mi})},s.onerror=()=>e(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 r=new Blob([new Uint8Array(i)],{type:"image/png"});s.src=i.byteLength?URL.createObjectURL(r):mi},c.e=_t,c.f=function(i,e){return hn(_t(i,{type:"json"}),e)},c.g=cs,c.h=$i,c.i=Ke,c.j=dn,c.k=un,c.l=Xn,c.m=hn,c.n=function(i){return new mc(i).readFields(Sd,[])},c.o=function(i,e,s){if(!i.length)return s(null,[]);let r=i.length,a=new Array(i.length),h=null;i.forEach((d,p)=>{e(d,(C,A)=>{C&&(h=C),a[p]=A,--r==0&&s(h,a)})})},c.p=Jg,c.q=Ca,c.r=vi,c.s=Ws,c.t=Yl,c.u=Pe,c.v=Ce,c.w=yi,c.x=Co,c.y=Tn,c.z=function([i,e,s]){return e+=90,e*=Math.PI/180,s*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(s),y:i*Math.sin(e)*Math.sin(s),z:i*Math.cos(s)}}}),ue(["./shared"],function(c){"use strict";class De{constructor(w){this.keyCache={},w&&this.replace(w)}replace(w){this._layerConfigs={},this._layers={},this.update(w,[])}update(w,Z){for(let H of w){this._layerConfigs[H.id]=H;let E=this._layers[H.id]=c.aC(H);E._featureFilter=c.a6(E.filter),this.keyCache[H.id]&&delete this.keyCache[H.id]}for(let H of Z)delete this.keyCache[H],delete this._layerConfigs[H],delete this._layers[H];this.familiesBySource={};let T=c.bl(Object.values(this._layerConfigs),this.keyCache);for(let H of T){let E=H.map(_e=>this._layers[_e.id]),oe=E[0];if(oe.visibility==="none")continue;let q=oe.source||"",Y=this.familiesBySource[q];Y||(Y=this.familiesBySource[q]={});let te=oe.sourceLayer||"_geojsonTileLayer",fe=Y[te];fe||(fe=Y[te]=[]),fe.push(E)}}}class ee{constructor(w){let Z={},T=[];for(let q in w){let Y=w[q],te=Z[q]={};for(let fe in Y){let _e=Y[+fe];if(!_e||_e.bitmap.width===0||_e.bitmap.height===0)continue;let Se={x:0,y:0,w:_e.bitmap.width+2,h:_e.bitmap.height+2};T.push(Se),te[fe]={rect:Se,metrics:_e.metrics}}}let{w:H,h:E}=c.p(T),oe=new c.q({width:H||1,height:E||1});for(let q in w){let Y=w[q];for(let te in Y){let fe=Y[+te];if(!fe||fe.bitmap.width===0||fe.bitmap.height===0)continue;let _e=Z[q][te].rect;c.q.copy(fe.bitmap,oe,{x:0,y:0},{x:_e.x+1,y:_e.y+1},fe.bitmap)}}this.image=oe,this.positions=Z}}c.bm("GlyphAtlas",ee);class yt{constructor(w){this.tileID=new c.O(w.tileID.overscaledZ,w.tileID.wrap,w.tileID.canonical.z,w.tileID.canonical.x,w.tileID.canonical.y),this.uid=w.uid,this.zoom=w.zoom,this.pixelRatio=w.pixelRatio,this.tileSize=w.tileSize,this.source=w.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=w.showCollisionBoxes,this.collectResourceTiming=!!w.collectResourceTiming,this.returnDependencies=!!w.returnDependencies,this.promoteId=w.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(w,Z,T,H,E){this.status="parsing",this.data=w,this.collisionBoxArray=new c.a3;let oe=new c.bn(Object.keys(w.layers).sort()),q=new c.bo(this.tileID,this.promoteId);q.bucketLayerIDs=[];let Y={},te={featureIndex:q,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:T},fe=Z.familiesBySource[this.source];for(let Bt in fe){let wt=w.layers[Bt];if(!wt)continue;wt.version===1&&c.w(`Vector tile source "${this.source}" layer "${Bt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let Si=oe.encode(Bt),Dt=[];for(let ci=0;ci=Ti.maxzoom||Ti.visibility!=="none"&&(st(ci,this.zoom,T),(Y[Ti.id]=Ti.createBucket({index:q.bucketLayerIDs.length,layers:ci,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Si,sourceID:this.source})).populate(Dt,te,this.tileID.canonical),q.bucketLayerIDs.push(ci.map(_s=>_s.id)))}}let _e,Se,it,ct,Oe=c.aH(te.glyphDependencies,Bt=>Object.keys(Bt).map(Number));this.inFlightDependencies.forEach(Bt=>Bt?.cancel()),this.inFlightDependencies=[];let nt=++this.dependencySentinel;Object.keys(Oe).length?this.inFlightDependencies.push(H.send("getGlyphs",{uid:this.uid,stacks:Oe,source:this.source,tileID:this.tileID,type:"glyphs"},(Bt,wt)=>{nt===this.dependencySentinel&&(_e||(_e=Bt,Se=wt,Et.call(this)))})):Se={};let dt=Object.keys(te.iconDependencies);dt.length?this.inFlightDependencies.push(H.send("getImages",{icons:dt,source:this.source,tileID:this.tileID,type:"icons"},(Bt,wt)=>{nt===this.dependencySentinel&&(_e||(_e=Bt,it=wt,Et.call(this)))})):it={};let Mt=Object.keys(te.patternDependencies);function Et(){if(_e)return E(_e);if(Se&&it&&ct){let Bt=new ee(Se),wt=new c.bp(it,ct);for(let Si in Y){let Dt=Y[Si];Dt instanceof c.a4?(st(Dt.layers,this.zoom,T),c.bq({bucket:Dt,glyphMap:Se,glyphPositions:Bt.positions,imageMap:it,imagePositions:wt.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Dt.hasPattern&&(Dt instanceof c.br||Dt instanceof c.bs||Dt instanceof c.bt)&&(st(Dt.layers,this.zoom,T),Dt.addFeatures(te,this.tileID.canonical,wt.patternPositions))}this.status="done",E(null,{buckets:Object.values(Y).filter(Si=>!Si.isEmpty()),featureIndex:q,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Bt.image,imageAtlas:wt,glyphMap:this.returnDependencies?Se:null,iconMap:this.returnDependencies?it:null,glyphPositions:this.returnDependencies?Bt.positions:null})}}Mt.length?this.inFlightDependencies.push(H.send("getImages",{icons:Mt,source:this.source,tileID:this.tileID,type:"patterns"},(Bt,wt)=>{nt===this.dependencySentinel&&(_e||(_e=Bt,ct=wt,Et.call(this)))})):ct={},Et.call(this)}}function st(X,w,Z){let T=new c.a8(w);for(let H of X)H.recalculate(T,Z)}function Ve(X,w){let Z=c.l(X.request,(T,H,E,oe)=>{if(T)w(T);else if(H)try{let q=new c.bw.VectorTile(new c.bv(H));w(null,{vectorTile:q,rawData:H,cacheControl:E,expires:oe})}catch(q){let Y=new Uint8Array(H),te=`Unable to parse the tile at ${X.request.url}, `;te+=Y[0]===31&&Y[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${q.messge}`,w(new Error(te))}});return()=>{Z.cancel(),w()}}class di{constructor(w,Z,T,H){this.actor=w,this.layerIndex=Z,this.availableImages=T,this.loadVectorData=H||Ve,this.fetching={},this.loading={},this.loaded={}}loadTile(w,Z){let T=w.uid;this.loading||(this.loading={});let H=!!(w&&w.request&&w.request.collectResourceTiming)&&new c.bu(w.request),E=this.loading[T]=new yt(w);E.abort=this.loadVectorData(w,(oe,q)=>{if(delete this.loading[T],oe||!q)return E.status="done",this.loaded[T]=E,Z(oe);let Y=q.rawData,te={};q.expires&&(te.expires=q.expires),q.cacheControl&&(te.cacheControl=q.cacheControl);let fe={};if(H){let _e=H.finish();_e&&(fe.resourceTiming=JSON.parse(JSON.stringify(_e)))}E.vectorTile=q.vectorTile,E.parse(q.vectorTile,this.layerIndex,this.availableImages,this.actor,(_e,Se)=>{if(delete this.fetching[T],_e||!Se)return Z(_e);Z(null,c.e({rawTileData:Y.slice(0)},Se,te,fe))}),this.loaded=this.loaded||{},this.loaded[T]=E,this.fetching[T]={rawTileData:Y,cacheControl:te,resourceTiming:fe}})}reloadTile(w,Z){let T=this.loaded,H=w.uid;if(T&&T[H]){let E=T[H];E.showCollisionBoxes=w.showCollisionBoxes,E.status==="parsing"?E.parse(E.vectorTile,this.layerIndex,this.availableImages,this.actor,(oe,q)=>{if(oe||!q)return Z(oe,q);let Y;if(this.fetching[H]){let{rawTileData:te,cacheControl:fe,resourceTiming:_e}=this.fetching[H];delete this.fetching[H],Y=c.e({rawTileData:te.slice(0)},q,fe,_e)}else Y=q;Z(null,Y)}):E.status==="done"&&(E.vectorTile?E.parse(E.vectorTile,this.layerIndex,this.availableImages,this.actor,Z):Z())}}abortTile(w,Z){let T=this.loading,H=w.uid;T&&T[H]&&T[H].abort&&(T[H].abort(),delete T[H]),Z()}removeTile(w,Z){let T=this.loaded,H=w.uid;T&&T[H]&&delete T[H],Z()}}class Qi{constructor(){this.loaded={}}loadTile(w,Z){return c._(this,void 0,void 0,function*(){let{uid:T,encoding:H,rawImageData:E,redFactor:oe,greenFactor:q,blueFactor:Y,baseShift:te}=w,fe=E.width+2,_e=E.height+2,Se=c.a(E)?new c.R({width:fe,height:_e},yield c.bx(E,-1,-1,fe,_e)):E,it=new c.by(T,Se,H,oe,q,Y,te);this.loaded=this.loaded||{},this.loaded[T]=it,Z(null,it)})}removeTile(w){let Z=this.loaded,T=w.uid;Z&&Z[T]&&delete Z[T]}}function Bi(X,w){if(X.length!==0){Qt(X[0],w);for(var Z=1;Z=Math.abs(q)?Z-Y+q:q-Y+Z,Z=Y}Z+T>=0!=!!w&&X.reverse()}var qt=c.bz(function X(w,Z){var T,H=w&&w.type;if(H==="FeatureCollection")for(T=0;T>31}function Ke(X,w){for(var Z=X.loadGeometry(),T=X.type,H=0,E=0,oe=Z.length,q=0;qX},Jt=Math.fround||(zt=new Float32Array(1),X=>(zt[0]=+X,zt[0]));var zt;let ht=3,ri=5,Es=6;class $i{constructor(w){this.options=Object.assign(Object.create(mi),w),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(w){let{log:Z,minZoom:T,maxZoom:H}=this.options;Z&&console.time("total time");let E=`prepare ${w.length} points`;Z&&console.time(E),this.points=w;let oe=[];for(let Y=0;Y=T;Y--){let te=+Date.now();q=this.trees[Y]=this._createTree(this._cluster(q,Y)),Z&&console.log("z%d: %d clusters in %dms",Y,q.numItems,+Date.now()-te)}return Z&&console.timeEnd("total time"),this}getClusters(w,Z){let T=((w[0]+180)%360+360)%360-180,H=Math.max(-90,Math.min(90,w[1])),E=w[2]===180?180:((w[2]+180)%360+360)%360-180,oe=Math.max(-90,Math.min(90,w[3]));if(w[2]-w[0]>=360)T=-180,E=180;else if(T>E){let _e=this.getClusters([T,H,180,oe],Z),Se=this.getClusters([-180,H,E,oe],Z);return _e.concat(Se)}let q=this.trees[this._limitZoom(Z)],Y=q.range(ys(T),cs(oe),ys(E),cs(H)),te=q.data,fe=[];for(let _e of Y){let Se=this.stride*_e;fe.push(te[Se+ri]>1?Ds(te,Se,this.clusterProps):this.points[te[Se+ht]])}return fe}getChildren(w){let Z=this._getOriginId(w),T=this._getOriginZoom(w),H="No cluster with the specified id.",E=this.trees[T];if(!E)throw new Error(H);let oe=E.data;if(Z*this.stride>=oe.length)throw new Error(H);let q=this.options.radius/(this.options.extent*Math.pow(2,T-1)),Y=E.within(oe[Z*this.stride],oe[Z*this.stride+1],q),te=[];for(let fe of Y){let _e=fe*this.stride;oe[_e+4]===w&&te.push(oe[_e+ri]>1?Ds(oe,_e,this.clusterProps):this.points[oe[_e+ht]])}if(te.length===0)throw new Error(H);return te}getLeaves(w,Z,T){let H=[];return this._appendLeaves(H,w,Z=Z||10,T=T||0,0),H}getTile(w,Z,T){let H=this.trees[this._limitZoom(w)],E=Math.pow(2,w),{extent:oe,radius:q}=this.options,Y=q/oe,te=(T-Y)/E,fe=(T+1+Y)/E,_e={features:[]};return this._addTileFeatures(H.range((Z-Y)/E,te,(Z+1+Y)/E,fe),H.data,Z,T,E,_e),Z===0&&this._addTileFeatures(H.range(1-Y/E,te,1,fe),H.data,E,T,E,_e),Z===E-1&&this._addTileFeatures(H.range(0,te,Y/E,fe),H.data,-1,T,E,_e),_e.features.length?_e:null}getClusterExpansionZoom(w){let Z=this._getOriginZoom(w)-1;for(;Z<=this.options.maxZoom;){let T=this.getChildren(w);if(Z++,T.length!==1)break;w=T[0].properties.cluster_id}return Z}_appendLeaves(w,Z,T,H,E){let oe=this.getChildren(Z);for(let q of oe){let Y=q.properties;if(Y&&Y.cluster?E+Y.point_count<=H?E+=Y.point_count:E=this._appendLeaves(w,Y.cluster_id,T,H,E):E1,fe,_e,Se;if(te)fe=As(Z,Y,this.clusterProps),_e=Z[Y],Se=Z[Y+1];else{let Oe=this.points[Z[Y+ht]];fe=Oe.properties;let[nt,dt]=Oe.geometry.coordinates;_e=ys(nt),Se=cs(dt)}let it={type:1,geometry:[[Math.round(this.options.extent*(_e*E-T)),Math.round(this.options.extent*(Se*E-H))]],tags:fe},ct;ct=te||this.options.generateId?Z[Y+ht]:this.points[Z[Y+ht]].id,ct!==void 0&&(it.id=ct),oe.features.push(it)}}_limitZoom(w){return Math.max(this.options.minZoom,Math.min(Math.floor(+w),this.options.maxZoom+1))}_cluster(w,Z){let{radius:T,extent:H,reduce:E,minPoints:oe}=this.options,q=T/(H*Math.pow(2,Z)),Y=w.data,te=[],fe=this.stride;for(let _e=0;_eZ&&(nt+=Y[Mt+ri])}if(nt>Oe&&nt>=oe){let dt,Mt=Se*Oe,Et=it*Oe,Bt=-1,wt=((_e/fe|0)<<5)+(Z+1)+this.points.length;for(let Si of ct){let Dt=Si*fe;if(Y[Dt+2]<=Z)continue;Y[Dt+2]=Z;let ci=Y[Dt+ri];Mt+=Y[Dt]*ci,Et+=Y[Dt+1]*ci,Y[Dt+4]=wt,E&&(dt||(dt=this._map(Y,_e,!0),Bt=this.clusterProps.length,this.clusterProps.push(dt)),E(dt,this._map(Y,Dt)))}Y[_e+4]=wt,te.push(Mt/nt,Et/nt,1/0,wt,-1,nt),E&&te.push(Bt)}else{for(let dt=0;dt1)for(let dt of ct){let Mt=dt*fe;if(!(Y[Mt+2]<=Z)){Y[Mt+2]=Z;for(let Et=0;Et>5}_getOriginZoom(w){return(w-this.points.length)%32}_map(w,Z,T){if(w[Z+ri]>1){let oe=this.clusterProps[w[Z+Es]];return T?Object.assign({},oe):oe}let H=this.points[w[Z+ht]].properties,E=this.options.map(H);return T&&E===H?Object.assign({},E):E}}function Ds(X,w,Z){return{type:"Feature",id:X[w+ht],properties:As(X,w,Z),geometry:{type:"Point",coordinates:[(T=X[w],360*(T-.5)),jn(X[w+1])]}};var T}function As(X,w,Z){let T=X[w+ri],H=T>=1e4?`${Math.round(T/1e3)}k`:T>=1e3?Math.round(T/100)/10+"k":T,E=X[w+Es],oe=E===-1?{}:Object.assign({},Z[E]);return Object.assign(oe,{cluster:!0,cluster_id:X[w+ht],point_count:T,point_count_abbreviated:H})}function ys(X){return X/360+.5}function cs(X){let w=Math.sin(X*Math.PI/180),Z=.5-.25*Math.log((1+w)/(1-w))/Math.PI;return Z<0?0:Z>1?1:Z}function jn(X){let w=(180-360*X)*Math.PI/180;return 360*Math.atan(Math.exp(w))/Math.PI-90}function hn(X,w,Z,T){for(var H,E=T,oe=Z-w>>1,q=Z-w,Y=X[w],te=X[w+1],fe=X[Z],_e=X[Z+1],Se=w+3;SeE)H=Se,E=it;else if(it===E){var ct=Math.abs(Se-oe);ctT&&(H-w>3&&hn(X,w,H,T),X[H+2]=E,Z-H>3&&hn(X,H,Z,T))}function Xn(X,w,Z,T,H,E){var oe=H-Z,q=E-T;if(oe!==0||q!==0){var Y=((X-Z)*oe+(w-T)*q)/(oe*oe+q*q);Y>1?(Z=H,T=E):Y>0&&(Z+=oe*Y,T+=q*Y)}return(oe=X-Z)*oe+(q=w-T)*q}function Ws(X,w,Z,T){var H={id:X===void 0?null:X,type:w,geometry:Z,tags:T,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(E){var oe=E.geometry,q=E.type;if(q==="Point"||q==="MultiPoint"||q==="LineString")Sn(E,oe);else if(q==="Polygon"||q==="MultiLineString")for(var Y=0;Y0&&(oe+=T?(H*te-Y*E)/2:Math.sqrt(Math.pow(Y-H,2)+Math.pow(te-E,2))),H=Y,E=te}var fe=w.length-3;w[2]=1,hn(w,0,fe,Z),w[fe+2]=1,w.size=Math.abs(oe),w.start=0,w.end=w.size}function pn(X,w,Z,T){for(var H=0;H1?1:Z}function bs(X,w,Z,T,H,E,oe,q){if(T/=w,E>=(Z/=w)&&oe=T)return null;for(var Y=[],te=0;te=Z&&ct=T)){var Oe=[];if(Se==="Point"||Se==="MultiPoint")Pt(_e,Oe,Z,T,H);else if(Se==="LineString")Tt(_e,Oe,Z,T,H,!1,q.lineMetrics);else if(Se==="MultiLineString")kn(_e,Oe,Z,T,H,!1);else if(Se==="Polygon")kn(_e,Oe,Z,T,H,!0);else if(Se==="MultiPolygon")for(var nt=0;nt<_e.length;nt++){var dt=[];kn(_e[nt],dt,Z,T,H,!0),dt.length&&Oe.push(dt)}if(Oe.length){if(q.lineMetrics&&Se==="LineString"){for(nt=0;nt=Z&&oe<=T&&(w.push(X[E]),w.push(X[E+1]),w.push(X[E+2]))}}function Tt(X,w,Z,T,H,E,oe){for(var q,Y,te=Ys(X),fe=H===0?Qn:nn,_e=X.start,Se=0;SeZ&&(Y=fe(te,it,ct,nt,dt,Z),oe&&(te.start=_e+q*Y)):Mt>T?Et=Z&&(Y=fe(te,it,ct,nt,dt,Z),Bt=!0),Et>T&&Mt<=T&&(Y=fe(te,it,ct,nt,dt,T),Bt=!0),!E&&Bt&&(oe&&(te.end=_e+q*Y),w.push(te),te=Ys(X)),oe&&(_e+=q)}var wt=X.length-3;it=X[wt],ct=X[wt+1],Oe=X[wt+2],(Mt=H===0?it:ct)>=Z&&Mt<=T&&Ns(te,it,ct,Oe),wt=te.length-3,E&&wt>=3&&(te[wt]!==te[0]||te[wt+1]!==te[1])&&Ns(te,te[0],te[1],te[2]),te.length&&w.push(te)}function Ys(X){var w=[];return w.size=X.size,w.start=X.start,w.end=X.end,w}function kn(X,w,Z,T,H,E){for(var oe=0;oeoe.maxX&&(oe.maxX=fe),_e>oe.maxY&&(oe.maxY=_e)}return oe}function mn(X,w,Z,T){var H=w.geometry,E=w.type,oe=[];if(E==="Point"||E==="MultiPoint")for(var q=0;q0&&w.size<(H?oe:T))Z.numPoints+=w.length/3;else{for(var q=[],Y=0;Yoe)&&(Z.numSimplified++,q.push(w[Y]),q.push(w[Y+1])),Z.numPoints++;H&&function(te,fe){for(var _e=0,Se=0,it=te.length,ct=it-2;Se0===fe)for(Se=0,it=te.length;Se24)throw new Error("maxZoom should be in the 0-24 range");if(w.promoteId&&w.generateId)throw new Error("promoteId and generateId cannot be used together.");var T=function(H,E){var oe=[];if(H.type==="FeatureCollection")for(var q=0;q1&&console.time("creation"),Se=this.tiles[_e]=Ut(X,w,Z,T,Y),this.tileCoords.push({z:w,x:Z,y:T}),te)){te>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",w,Z,T,Se.numFeatures,Se.numPoints,Se.numSimplified),console.timeEnd("creation"));var it="z"+w;this.stats[it]=(this.stats[it]||0)+1,this.total++}if(Se.source=X,H){if(w===Y.maxZoom||w===H)continue;var ct=1<1&&console.time("clipping");var Oe,nt,dt,Mt,Et,Bt,wt=.5*Y.buffer/Y.extent,Si=.5-wt,Dt=.5+wt,ci=1+wt;Oe=nt=dt=Mt=null,Et=bs(X,fe,Z-wt,Z+Dt,0,Se.minX,Se.maxX,Y),Bt=bs(X,fe,Z+Si,Z+ci,0,Se.minX,Se.maxX,Y),X=null,Et&&(Oe=bs(Et,fe,T-wt,T+Dt,1,Se.minY,Se.maxY,Y),nt=bs(Et,fe,T+Si,T+ci,1,Se.minY,Se.maxY,Y),Et=null),Bt&&(dt=bs(Bt,fe,T-wt,T+Dt,1,Se.minY,Se.maxY,Y),Mt=bs(Bt,fe,T+Si,T+ci,1,Se.minY,Se.maxY,Y),Bt=null),te>1&&console.timeEnd("clipping"),q.push(Oe||[],w+1,2*Z,2*T),q.push(nt||[],w+1,2*Z,2*T+1),q.push(dt||[],w+1,2*Z+1,2*T),q.push(Mt||[],w+1,2*Z+1,2*T+1)}}},ze.prototype.getTile=function(X,w,Z){var T=this.options,H=T.extent,E=T.debug;if(X<0||X>24)return null;var oe=1<1&&console.log("drilling down to z%d-%d-%d",X,w,Z);for(var Y,te=X,fe=w,_e=Z;!Y&&te>0;)te--,fe=Math.floor(fe/2),_e=Math.floor(_e/2),Y=this.tiles[At(te,fe,_e)];return Y&&Y.source?(E>1&&console.log("found parent tile z%d-%d-%d",te,fe,_e),E>1&&console.time("drilling down"),this.splitTile(Y.source,te,fe,_e,X,w,Z),E>1&&console.timeEnd("drilling down"),this.tiles[q]?We(this.tiles[q],H):null):null};class Ct extends di{constructor(w,Z,T,H){super(w,Z,T),this._dataUpdateable=new Map,this.loadGeoJSON=(E,oe)=>{let{promoteId:q}=E;if(E.request)return c.f(E.request,(Y,te,fe,_e)=>{this._dataUpdateable=Ni(te,q)?js(te,q):void 0,oe(Y,te,fe,_e)});if(typeof E.data=="string")try{let Y=JSON.parse(E.data);this._dataUpdateable=Ni(Y,q)?js(Y,q):void 0,oe(null,Y)}catch{oe(new Error(`Input data given to '${E.source}' is not a valid GeoJSON object.`))}else E.dataDiff?this._dataUpdateable?(function(Y,te,fe){var _e,Se,it,ct;if(te.removeAll&&Y.clear(),te.remove)for(let Oe of te.remove)Y.delete(Oe);if(te.add)for(let Oe of te.add){let nt=ut(Oe,fe);nt!=null&&Y.set(nt,Oe)}if(te.update)for(let Oe of te.update){let nt=Y.get(Oe.id);if(nt==null)continue;let dt=!Oe.removeAllProperties&&(((_e=Oe.removeProperties)===null||_e===void 0?void 0:_e.length)>0||((Se=Oe.addOrUpdateProperties)===null||Se===void 0?void 0:Se.length)>0);if((Oe.newGeometry||Oe.removeAllProperties||dt)&&(nt=Object.assign({},nt),Y.set(Oe.id,nt),dt&&(nt.properties=Object.assign({},nt.properties))),Oe.newGeometry&&(nt.geometry=Oe.newGeometry),Oe.removeAllProperties)nt.properties={};else if(((it=Oe.removeProperties)===null||it===void 0?void 0:it.length)>0)for(let Mt of Oe.removeProperties)Object.prototype.hasOwnProperty.call(nt.properties,Mt)&&delete nt.properties[Mt];if(((ct=Oe.addOrUpdateProperties)===null||ct===void 0?void 0:ct.length)>0)for(let{key:Mt,value:Et}of Oe.addOrUpdateProperties)nt.properties[Mt]=Et}}(this._dataUpdateable,E.dataDiff,q),oe(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):oe(new Error(`Cannot update existing geojson data in ${E.source}`)):oe(new Error(`Input data given to '${E.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,H&&(this.loadGeoJSON=H)}loadGeoJSONTile(w,Z){let T=w.tileID.canonical;if(!this._geoJSONIndex)return Z(null,null);let H=this._geoJSONIndex.getTile(T.z,T.x,T.y);if(!H)return Z(null,null);let E=new class{constructor(q){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=c.N,this.length=q.length,this._features=q}feature(q){return new class{constructor(Y){this._feature=Y,this.extent=c.N,this.type=Y.type,this.properties=Y.tags,"id"in Y&&!isNaN(Y.id)&&(this.id=parseInt(Y.id,10))}loadGeometry(){if(this._feature.type===1){let Y=[];for(let te of this._feature.geometry)Y.push([new c.P(te[0],te[1])]);return Y}{let Y=[];for(let te of this._feature.geometry){let fe=[];for(let _e of te)fe.push(new c.P(_e[0],_e[1]));Y.push(fe)}return Y}}toGeoJSON(Y,te,fe){return qi.call(this,Y,te,fe)}}(this._features[q])}}(H.features),oe=gt(E);oe.byteOffset===0&&oe.byteLength===oe.buffer.byteLength||(oe=new Uint8Array(oe)),Z(null,{vectorTile:E,rawData:oe.buffer})}loadData(w,Z){var T;(T=this._pendingRequest)===null||T===void 0||T.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});let H=!!(w&&w.request&&w.request.collectResourceTiming)&&new c.bu(w.request);this._pendingCallback=Z,this._pendingRequest=this.loadGeoJSON(w,(E,oe)=>{if(delete this._pendingCallback,delete this._pendingRequest,E||!oe)return Z(E);if(typeof oe!="object")return Z(new Error(`Input data given to '${w.source}' is not a valid GeoJSON object.`));{qt(oe,!0);try{if(w.filter){let Y=c.bC(w.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Y.result==="error")throw new Error(Y.value.map(fe=>`${fe.key}: ${fe.message}`).join(", "));oe={type:"FeatureCollection",features:oe.features.filter(fe=>Y.value.evaluate({zoom:0},fe))}}this._geoJSONIndex=w.cluster?new $i(function({superclusterOptions:Y,clusterProperties:te}){if(!te||!Y)return Y;let fe={},_e={},Se={accumulated:null,zoom:0},it={properties:null},ct=Object.keys(te);for(let Oe of ct){let[nt,dt]=te[Oe],Mt=c.bC(dt),Et=c.bC(typeof nt=="string"?[nt,["accumulated"],["get",Oe]]:nt);fe[Oe]=Mt.value,_e[Oe]=Et.value}return Y.map=Oe=>{it.properties=Oe;let nt={};for(let dt of ct)nt[dt]=fe[dt].evaluate(Se,it);return nt},Y.reduce=(Oe,nt)=>{it.properties=nt;for(let dt of ct)Se.accumulated=Oe[dt],Oe[dt]=_e[dt].evaluate(Se,it)},Y}(w)).load(oe.features):function(Y,te){return new ze(Y,te)}(oe,w.geojsonVtOptions)}catch(Y){return Z(Y)}this.loaded={};let q={};if(H){let Y=H.finish();Y&&(q.resourceTiming={},q.resourceTiming[w.source]=JSON.parse(JSON.stringify(Y)))}Z(null,q)}})}reloadTile(w,Z){let T=this.loaded;return T&&T[w.uid]?super.reloadTile(w,Z):this.loadTile(w,Z)}removeSource(w,Z){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),Z()}getClusterExpansionZoom(w,Z){try{Z(null,this._geoJSONIndex.getClusterExpansionZoom(w.clusterId))}catch(T){Z(T)}}getClusterChildren(w,Z){try{Z(null,this._geoJSONIndex.getChildren(w.clusterId))}catch(T){Z(T)}}getClusterLeaves(w,Z){try{Z(null,this._geoJSONIndex.getLeaves(w.clusterId,w.limit,w.offset))}catch(T){Z(T)}}}class Qs{constructor(w){this.self=w,this.actor=new c.C(w,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:di,geojson:Ct},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(Z,T)=>{if(this.workerSourceTypes[Z])throw new Error(`Worker source with name "${Z}" already registered.`);this.workerSourceTypes[Z]=T},this.self.registerRTLTextPlugin=Z=>{if(c.bD.isParsed())throw new Error("RTL text plugin already registered.");c.bD.applyArabicShaping=Z.applyArabicShaping,c.bD.processBidirectionalText=Z.processBidirectionalText,c.bD.processStyledBidirectionalText=Z.processStyledBidirectionalText}}setReferrer(w,Z){this.referrer=Z}setImages(w,Z,T){this.availableImages[w]=Z;for(let H in this.workerSources[w]){let E=this.workerSources[w][H];for(let oe in E)E[oe].availableImages=Z}T()}setLayers(w,Z,T){this.getLayerIndex(w).replace(Z),T()}updateLayers(w,Z,T){this.getLayerIndex(w).update(Z.layers,Z.removedIds),T()}loadTile(w,Z,T){this.getWorkerSource(w,Z.type,Z.source).loadTile(Z,T)}loadDEMTile(w,Z,T){this.getDEMWorkerSource(w,Z.source).loadTile(Z,T)}reloadTile(w,Z,T){this.getWorkerSource(w,Z.type,Z.source).reloadTile(Z,T)}abortTile(w,Z,T){this.getWorkerSource(w,Z.type,Z.source).abortTile(Z,T)}removeTile(w,Z,T){this.getWorkerSource(w,Z.type,Z.source).removeTile(Z,T)}removeDEMTile(w,Z){this.getDEMWorkerSource(w,Z.source).removeTile(Z)}removeSource(w,Z,T){if(!this.workerSources[w]||!this.workerSources[w][Z.type]||!this.workerSources[w][Z.type][Z.source])return;let H=this.workerSources[w][Z.type][Z.source];delete this.workerSources[w][Z.type][Z.source],H.removeSource!==void 0?H.removeSource(Z,T):T()}loadWorkerSource(w,Z,T){try{this.self.importScripts(Z.url),T()}catch(H){T(H.toString())}}syncRTLPluginState(w,Z,T){try{c.bD.setState(Z);let H=c.bD.getPluginURL();if(c.bD.isLoaded()&&!c.bD.isParsed()&&H!=null){this.self.importScripts(H);let E=c.bD.isParsed();T(E?void 0:new Error(`RTL Text Plugin failed to import scripts from ${H}`),E)}}catch(H){T(H.toString())}}getAvailableImages(w){let Z=this.availableImages[w];return Z||(Z=[]),Z}getLayerIndex(w){let Z=this.layerIndexes[w];return Z||(Z=this.layerIndexes[w]=new De),Z}getWorkerSource(w,Z,T){return this.workerSources[w]||(this.workerSources[w]={}),this.workerSources[w][Z]||(this.workerSources[w][Z]={}),this.workerSources[w][Z][T]||(this.workerSources[w][Z][T]=new this.workerSourceTypes[Z]({send:(H,E,oe)=>{this.actor.send(H,E,oe,w)}},this.getLayerIndex(w),this.getAvailableImages(w))),this.workerSources[w][Z][T]}getDEMWorkerSource(w,Z){return this.demWorkerSources[w]||(this.demWorkerSources[w]={}),this.demWorkerSources[w][Z]||(this.demWorkerSources[w][Z]=new Qi),this.demWorkerSources[w][Z]}}return c.i()&&(self.worker=new Qs(self)),Qs}),ue(["./shared"],function(c){"use strict";var De="3.6.2";class ee{static testProp(t){if(!ee.docStyle)return t[0];for(let n=0;n{window.removeEventListener("click",ee.suppressClickInternal,!0)},0)}static mousePos(t,n){let o=t.getBoundingClientRect();return new c.P(n.clientX-o.left-t.clientLeft,n.clientY-o.top-t.clientTop)}static touchPos(t,n){let o=t.getBoundingClientRect(),l=[];for(let u=0;u{t=[],n=0,o=0,l={}},g.addThrottleControl=y=>{let _=o++;return l[_]=y,_},g.removeThrottleControl=y=>{delete l[y],m()},g.getImage=(y,_,v=!0)=>{yt.supported&&(y.headers||(y.headers={}),y.headers.accept="image/webp,*/*");let B={requestParameters:y,supportImageRefresh:v,callback:_,cancelled:!1,completed:!1,cancel:()=>{B.completed||B.cancelled||(B.cancelled=!0,B.innerRequest&&(B.innerRequest.cancel(),n--),m())}};return t.push(B),m(),B};let u=y=>{let{requestParameters:_,supportImageRefresh:v,callback:B}=y;return c.e(_,{type:"image"}),(v!==!1||c.i()||c.g(_.url)||_.headers&&!Object.keys(_.headers).reduce((K,F)=>K&&F==="accept",!0)?c.m:f)(_,(K,F,L,J)=>{I(y,B,K,F,L,J)})},I=(y,_,v,B,K,F)=>{v?_(v):B instanceof HTMLImageElement||c.a(B)?_(null,B):B&&((L,J)=>{typeof createImageBitmap=="function"?c.b(L,J):c.d(L,J)})(B,(L,J)=>{L!=null?_(L):J!=null&&_(null,J,{cacheControl:K,expires:F})}),y.cancelled||(y.completed=!0,n--,m())},m=()=>{let y=(()=>{let _=Object.keys(l),v=!1;if(_.length>0){for(let B of _)if(v=l[B](),v)break}return v})()?c.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:c.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let _=n;_0;_++){let v=t.shift();if(v.cancelled){_--;continue}let B=u(v);n++,v.innerRequest=B}},f=(y,_)=>{let v=new Image,B=y.url,K=!1,F=y.credentials;return F&&F==="include"?v.crossOrigin="use-credentials":(F&&F==="same-origin"||!c.s(B))&&(v.crossOrigin="anonymous"),v.fetchPriority="high",v.onload=()=>{_(null,v),v.onerror=v.onload=null},v.onerror=()=>{K||_(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.")),v.onerror=v.onload=null},v.src=B,{cancel:()=>{K=!0,v.src=""}}}}(Qt||(Qt={})),Qt.resetRequestQueue(),function(g){g.Glyphs="Glyphs",g.Image="Image",g.Source="Source",g.SpriteImage="SpriteImage",g.SpriteJSON="SpriteJSON",g.Style="Style",g.Tile="Tile",g.Unknown="Unknown"}(qt||(qt={}));class qi{constructor(t){this._transformRequestFn=t}transformRequest(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}}normalizeSpriteURL(t,n,o){let l=function(u){let I=u.match(pt);if(!I)throw new Error(`Unable to parse URL "${u}"`);return{protocol:I[1],authority:I[2],path:I[3]||"/",params:I[4]?I[4].split("&"):[]}}(t);return l.path+=`${n}${o}`,function(u){let I=u.params.length?`?${u.params.join("&")}`:"";return`${u.protocol}://${u.authority}${u.path}${I}`}(l)}setTransformRequest(t){this._transformRequestFn=t}}let pt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function os(g){var t=new c.A(3);return t[0]=g[0],t[1]=g[1],t[2]=g[2],t}var as,Ei=function(g,t,n){return g[0]=t[0]-n[0],g[1]=t[1]-n[1],g[2]=t[2]-n[2],g};as=new c.A(3),c.A!=Float32Array&&(as[0]=0,as[1]=0,as[2]=0);var Gi=function(g){var t=g[0],n=g[1];return t*t+n*n};function _t(g){let t=[];if(typeof g=="string")t.push({id:"default",url:g});else if(g&&g.length>0){let n=[];for(let{id:o,url:l}of g){let u=`${o}${l}`;n.indexOf(u)===-1&&(n.push(u),t.push({id:o,url:l}))}}return t}function Ri(g,t,n,o,l){if(o)return void g(o);if(l!==Object.values(t).length||l!==Object.values(n).length)return;let u={};for(let I in t){u[I]={};let m=c.h.getImageCanvasContext(n[I]),f=t[I];for(let y in f){let{width:_,height:v,x:B,y:K,sdf:F,pixelRatio:L,stretchX:J,stretchY:$,content:ge}=f[y];u[I][y]={data:null,pixelRatio:L,sdf:F,stretchX:J,stretchY:$,content:ge,spriteData:{width:_,height:v,x:B,y:K,context:m}}}}g(null,u)}(function(){var g=new c.A(2);c.A!=Float32Array&&(g[0]=0,g[1]=0)})();class Vt{constructor(t,n,o,l){this.context=t,this.format=o,this.texture=t.gl.createTexture(),this.update(n,l)}update(t,n,o){let{width:l,height:u}=t,I=!(this.size&&this.size[0]===l&&this.size[1]===u||o),{context:m}=this,{gl:f}=m;if(this.useMipmap=Boolean(n&&n.useMipmap),f.bindTexture(f.TEXTURE_2D,this.texture),m.pixelStoreUnpackFlipY.set(!1),m.pixelStoreUnpack.set(1),m.pixelStoreUnpackPremultiplyAlpha.set(this.format===f.RGBA&&(!n||n.premultiply!==!1)),I)this.size=[l,u],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||c.a(t)?f.texImage2D(f.TEXTURE_2D,0,this.format,this.format,f.UNSIGNED_BYTE,t):f.texImage2D(f.TEXTURE_2D,0,this.format,l,u,0,this.format,f.UNSIGNED_BYTE,t.data);else{let{x:y,y:_}=o||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||c.a(t)?f.texSubImage2D(f.TEXTURE_2D,0,y,_,f.RGBA,f.UNSIGNED_BYTE,t):f.texSubImage2D(f.TEXTURE_2D,0,y,_,l,u,f.RGBA,f.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&f.generateMipmap(f.TEXTURE_2D)}bind(t,n,o){let{context:l}=this,{gl:u}=l;u.bindTexture(u.TEXTURE_2D,this.texture),o!==u.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(o=u.LINEAR),t!==this.filter&&(u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,t),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,o||t),this.filter=t),n!==this.wrap&&(u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,n),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,n),this.wrap=n)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function ls(g){let{userImage:t}=g;return!!(t&&t.render&&t.render())&&(g.data.replace(new Uint8Array(t.data.buffer)),!0)}class Di extends c.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new c.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(let{ids:n,callback:o}of this.requestors)this._notify(n,o);this.requestors=[]}}getImage(t){let n=this.images[t];if(n&&!n.data&&n.spriteData){let o=n.spriteData;n.data=new c.R({width:o.width,height:o.height},o.context.getImageData(o.x,o.y,o.width,o.height).data),n.spriteData=null}return n}addImage(t,n){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,n)&&(this.images[t]=n)}_validate(t,n){let o=!0,l=n.data||n.spriteData;return this._validateStretch(n.stretchX,l&&l.width)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "stretchX" value`))),o=!1),this._validateStretch(n.stretchY,l&&l.height)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "stretchY" value`))),o=!1),this._validateContent(n.content,n)||(this.fire(new c.j(new Error(`Image "${t}" has invalid "content" value`))),o=!1),o}_validateStretch(t,n){if(!t)return!0;let o=0;for(let l of t){if(l[0]-1);f++,u[f]=m,I[f]=y,I[f+1]=fs}for(let m=0,f=0;m{let m=this.entries[l];m||(m=this.entries[l]={glyphs:{},requests:{},ranges:{}});let f=m.glyphs[u];if(f!==void 0)return void I(null,{stack:l,id:u,glyph:f});if(f=this._tinySDF(m,l,u),f)return m.glyphs[u]=f,void I(null,{stack:l,id:u,glyph:f});let y=Math.floor(u/256);if(256*y>65535)return void I(new Error("glyphs > 65535 not supported"));if(m.ranges[y])return void I(null,{stack:l,id:u,glyph:f});if(!this.url)return void I(new Error("glyphsUrl is not set"));let _=m.requests[y];_||(_=m.requests[y]=[],Ts.loadGlyphRange(l,y,this.url,this.requestManager,(v,B)=>{if(B){for(let K in B)this._doesCharSupportLocalGlyph(+K)||(m.glyphs[+K]=B[+K]);m.ranges[y]=!0}for(let K of _)K(v,B);delete m.requests[y]})),_.push((v,B)=>{v?I(v):B&&I(null,{stack:l,id:u,glyph:B[u]||null})})},(l,u)=>{if(l)n(l);else if(u){let I={};for(let{stack:m,id:f,glyph:y}of u)(I[m]||(I[m]={}))[f]=y&&{id:y.id,bitmap:y.bitmap.clone(),metrics:y.metrics};n(null,I)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(c.u["CJK Unified Ideographs"](t)||c.u["Hangul Syllables"](t)||c.u.Hiragana(t)||c.u.Katakana(t))}_tinySDF(t,n,o){let l=this.localIdeographFontFamily;if(!l||!this._doesCharSupportLocalGlyph(o))return;let u=t.tinySDF;if(!u){let m="400";/bold/i.test(n)?m="900":/medium/i.test(n)?m="500":/light/i.test(n)&&(m="200"),u=t.tinySDF=new Ts.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:l,fontWeight:m})}let I=u.draw(String.fromCharCode(o));return{id:o,bitmap:new c.q({width:I.width||60,height:I.height||60},I.data),metrics:{width:I.glyphWidth/2||24,height:I.glyphHeight/2||24,left:I.glyphLeft/2+.5||0,top:I.glyphTop/2-27.5||-8,advance:I.glyphAdvance/2||24,isDoubleResolution:!0}}}}Ts.loadGlyphRange=function(g,t,n,o,l){let u=256*t,I=u+255,m=o.transformRequest(n.replace("{fontstack}",g).replace("{range}",`${u}-${I}`),qt.Glyphs);c.l(m,(f,y)=>{if(f)l(f);else if(y){let _={};for(let v of c.n(y))_[v.id]=v;l(null,_)}})},Ts.TinySDF=class{constructor({fontSize:g=24,buffer:t=3,radius:n=8,cutoff:o=.25,fontFamily:l="sans-serif",fontWeight:u="normal",fontStyle:I="normal"}={}){this.buffer=t,this.cutoff=o,this.radius=n;let m=this.size=g+4*t,f=this._createCanvas(m),y=this.ctx=f.getContext("2d",{willReadFrequently:!0});y.font=`${I} ${u} ${g}px ${l}`,y.textBaseline="alphabetic",y.textAlign="left",y.fillStyle="black",this.gridOuter=new Float64Array(m*m),this.gridInner=new Float64Array(m*m),this.f=new Float64Array(m),this.z=new Float64Array(m+1),this.v=new Uint16Array(m)}_createCanvas(g){let t=document.createElement("canvas");return t.width=t.height=g,t}draw(g){let{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:o,actualBoundingBoxLeft:l,actualBoundingBoxRight:u}=this.ctx.measureText(g),I=Math.ceil(n),m=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(u-l))),f=Math.min(this.size-this.buffer,I+Math.ceil(o)),y=m+2*this.buffer,_=f+2*this.buffer,v=Math.max(y*_,0),B=new Uint8ClampedArray(v),K={data:B,width:y,height:_,glyphWidth:m,glyphHeight:f,glyphTop:I,glyphLeft:0,glyphAdvance:t};if(m===0||f===0)return K;let{ctx:F,buffer:L,gridInner:J,gridOuter:$}=this;F.clearRect(L,L,m,f),F.fillText(g,L,L+I);let ge=F.getImageData(L,L,m,f);$.fill(fs,0,v),J.fill(0,0,v);for(let D=0;D0?ve*ve:0,J[pe]=ve<0?ve*ve:0}}yi($,0,0,y,_,y,this.f,this.v,this.z),yi(J,L,L,m,f,y,this.f,this.v,this.z);for(let D=0;D1&&(f=t[++m]);let _=Math.abs(y-f.left),v=Math.abs(y-f.right),B=Math.min(_,v),K,F=u/o*(l+1);if(f.isDash){let L=l-Math.abs(F);K=Math.sqrt(B*B+L*L)}else K=l-Math.sqrt(B*B+F*F);this.data[I+y]=Math.max(0,Math.min(255,K+128))}}}addRegularDash(t){for(let m=t.length-1;m>=0;--m){let f=t[m],y=t[m+1];f.zeroLength?t.splice(m,1):y&&y.isDash===f.isDash&&(y.left=f.left,t.splice(m,1))}let n=t[0],o=t[t.length-1];n.isDash===o.isDash&&(n.left=o.left-this.width,o.right=n.right+this.width);let l=this.width*this.nextRow,u=0,I=t[u];for(let m=0;m1&&(I=t[++u]);let f=Math.abs(m-I.left),y=Math.abs(m-I.right),_=Math.min(f,y);this.data[l+m]=Math.max(0,Math.min(255,(I.isDash?_:-_)+128))}}addDash(t,n){let o=n?7:0,l=2*o+1;if(this.nextRow+l>this.height)return c.w("LineAtlas out of space"),null;let u=0;for(let m=0;m{l.send(t,n,u)},o=o||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(n=>{n.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}}function zt(g,t,n){let o=function(l,u){if(l)return n(l);if(u){let I=c.F(c.e(u,g),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);u.vector_layers&&(I.vectorLayers=u.vector_layers,I.vectorLayerIds=I.vectorLayers.map(m=>m.id)),n(null,I)}};return g.url?c.f(t.transformRequest(g.url,qt.Source),o):c.h.frame(()=>o(null,g))}class ht{constructor(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof c.L?new c.L(t.lng,t.lat):c.L.convert(t),this}setSouthWest(t){return this._sw=t instanceof c.L?new c.L(t.lng,t.lat):c.L.convert(t),this}extend(t){let n=this._sw,o=this._ne,l,u;if(t instanceof c.L)l=t,u=t;else{if(!(t instanceof ht))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(ht.convert(t)):this.extend(c.L.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(c.L.convert(t)):this;if(l=t._sw,u=t._ne,!l||!u)return this}return n||o?(n.lng=Math.min(l.lng,n.lng),n.lat=Math.min(l.lat,n.lat),o.lng=Math.max(u.lng,o.lng),o.lat=Math.max(u.lat,o.lat)):(this._sw=new c.L(l.lng,l.lat),this._ne=new c.L(u.lng,u.lat)),this}getCenter(){return new c.L((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 c.L(this.getWest(),this.getNorth())}getSouthEast(){return new c.L(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(t){let{lng:n,lat:o}=c.L.convert(t),l=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(l=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=o&&o<=this._ne.lat&&l}static convert(t){return t instanceof ht?t:t&&new ht(t)}static fromLngLat(t,n=0){let o=360*n/40075017,l=o/Math.cos(Math.PI/180*t.lat);return new ht(new c.L(t.lng-l,t.lat-o),new c.L(t.lng+l,t.lat+o))}}class ri{constructor(t,n,o){this.bounds=ht.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=o||24}validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){let n=Math.pow(2,t.z),o=Math.floor(c.G(this.bounds.getWest())*n),l=Math.floor(c.H(this.bounds.getNorth())*n),u=Math.ceil(c.G(this.bounds.getEast())*n),I=Math.ceil(c.H(this.bounds.getSouth())*n);return t.x>=o&&t.x=l&&t.y{this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=zt(this._options,this.map._requestManager,(u,I)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),u?this.fire(new c.j(u)):I&&(c.e(this,I),I.bounds&&(this.tileBounds=new ri(I.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})))})},this.serialize=()=>c.e({},this._options),this.id=t,this.dispatcher=o,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,c.e(this,c.F(n,["url","scheme","tileSize","promoteId"])),this._options=c.e({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(l)}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}loadTile(t,n){let o=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),l={request:this.map._requestManager.transformRequest(o,qt.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function u(I,m){return delete t.request,t.aborted?n(null):I&&I.status!==404?n(I):(m&&m.resourceTiming&&(t.resourceTiming=m.resourceTiming),this.map._refreshExpiredTiles&&m&&t.setExpiryData(m),t.loadVectorData(m,this.map.painter),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}l.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=n:t.request=t.actor.send("reloadTile",l,u.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",l,u.bind(this)))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class $i extends c.E{constructor(t,n,o,l){super(),this.id=t,this.dispatcher=o,this.setEventedParent(l),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=c.e({type:"raster"},n),c.e(this,c.F(n,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this._tileJSONRequest=zt(this._options,this.map._requestManager,(t,n)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new c.j(t)):n&&(c.e(this,n),n.bounds&&(this.tileBounds=new ri(n.bounds,this.minzoom,this.maxzoom)),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}serialize(){return c.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,n){let o=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=Qt.getImage(this.map._requestManager.transformRequest(o,qt.Tile),(l,u,I)=>{if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(l)t.state="errored",n(l);else if(u){this.map._refreshExpiredTiles&&I&&t.setExpiryData(I);let m=this.map.painter.context,f=m.gl;t.texture=this.map.painter.getTileTexture(u.width),t.texture?t.texture.update(u,{useMipmap:!0}):(t.texture=new Vt(m,u,f.RGBA,{useMipmap:!0}),t.texture.bind(f.LINEAR,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),m.extTextureFilterAnisotropic&&f.texParameterf(f.TEXTURE_2D,m.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,m.extTextureFilterAnisotropicMax)),t.state="loaded",n(null)}},this.map._refreshExpiredTiles)}abortTile(t,n){t.request&&(t.request.cancel(),delete t.request),n()}unloadTile(t,n){t.texture&&this.map.painter.saveTileTexture(t.texture),n()}hasTransition(){return!1}}class Ds extends $i{constructor(t,n,o,l){super(t,n,o,l),this.type="raster-dem",this.maxzoom=22,this._options=c.e({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox",this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(t,n){let o=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),l=this.map._requestManager.transformRequest(o,qt.Tile);function u(I,m){I&&(t.state="errored",n(I)),m&&(t.dem=m,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",n(null))}t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.request=Qt.getImage(l,(I,m,f)=>c._(this,void 0,void 0,function*(){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(I)t.state="errored",n(I);else if(m){this.map._refreshExpiredTiles&&t.setExpiryData(f);let y=c.a(m)&&c.J()?m:yield function(v){return c._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&c.K()){let B=v.width+2,K=v.height+2;try{return new c.R({width:B,height:K},yield c.M(v,-1,-1,B,K))}catch{}}return c.h.getImageData(v,1)})}(m),_={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:y,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",_,u))}}),this.map._refreshExpiredTiles)}_getNeighboringTiles(t){let n=t.canonical,o=Math.pow(2,n.z),l=(n.x-1+o)%o,u=n.x===0?t.wrap-1:t.wrap,I=(n.x+1+o)%o,m=n.x+1===o?t.wrap+1:t.wrap,f={};return f[new c.O(t.overscaledZ,u,n.z,l,n.y).key]={backfilled:!1},f[new c.O(t.overscaledZ,m,n.z,I,n.y).key]={backfilled:!1},n.y>0&&(f[new c.O(t.overscaledZ,u,n.z,l,n.y-1).key]={backfilled:!1},f[new c.O(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},f[new c.O(t.overscaledZ,m,n.z,I,n.y-1).key]={backfilled:!1}),n.y+1{this._updateWorkerData()},this.serialize=()=>c.e({},this._options,{type:this.type,data:this._data}),this.id=t,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=o.getActor(),this.setEventedParent(l),this._data=n.data,this._options=c.e({},n),this._collectResourceTiming=n.collectResourceTiming,n.maxzoom!==void 0&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;let u=c.N/this.tileSize;this.workerOptions=c.e({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(n.buffer!==void 0?n.buffer:128)*u,tolerance:(n.tolerance!==void 0?n.tolerance:.375)*u,extent:c.N,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:n.clusterMaxZoom!==void 0?n.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:c.N,radius:(n.clusterRadius||50)*u,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(t.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),t.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(t,n){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},n),this}getClusterChildren(t,n){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},n),this}getClusterLeaves(t,n,o,l){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:n,offset:o},l),this}_updateWorkerData(t){let n=c.e({},this.workerOptions);t?n.dataDiff=t:typeof this._data=="string"?(n.request=this.map._requestManager.transformRequest(c.h.resolveURL(this._data),qt.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new c.k("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,n,(o,l)=>{if(this._pendingLoads--,this._removed||l&&l.abandoned)return void this.fire(new c.k("dataabort",{dataType:"source"}));let u=null;if(l&&l.resourceTiming&&l.resourceTiming[this.id]&&(u=l.resourceTiming[this.id].slice(0)),o)return void this.fire(new c.j(o));let I={dataType:"source"};this._collectResourceTiming&&u&&u.length>0&&c.e(I,{resourceTiming:u}),this.fire(new c.k("data",Object.assign(Object.assign({},I),{sourceDataType:"metadata"}))),this.fire(new c.k("data",Object.assign(Object.assign({},I),{sourceDataType:"content"})))})}loaded(){return this._pendingLoads===0}loadTile(t,n){let o=t.actor?"reloadTile":"loadTile";t.actor=this.actor;let l={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(o,l,(u,I)=>(delete t.request,t.unloadVectorData(),t.aborted?n(null):u?n(u):(t.loadVectorData(I,this.map.painter,o==="reloadTile"),n(null))))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}}var ys=c.Q([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class cs extends c.E{constructor(t,n,o,l){super(),this.load=(u,I)=>{this._loaded=!1,this.fire(new c.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=Qt.getImage(this.map._requestManager.transformRequest(this.url,qt.Image),(m,f)=>{this._request=null,this._loaded=!0,m?this.fire(new c.j(m)):f&&(this.image=f,u&&(this.coordinates=u),I&&I(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||!this.image)return;let u=this.map.painter.context,I=u.gl;this.boundsBuffer||(this.boundsBuffer=u.createVertexBuffer(this._boundsArray,ys.members)),this.boundsSegments||(this.boundsSegments=c.S.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Vt(u,this.image,I.RGBA),this.texture.bind(I.LINEAR,I.CLAMP_TO_EDGE));let m=!1;for(let f in this.tiles){let y=this.tiles[f];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture,m=!0)}m&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),this.id=t,this.dispatcher=o,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(l),this.options=n}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new c.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(t){this.coordinates=t;let n=t.map(c.U.fromLngLat);this.tileID=function(l){let u=1/0,I=1/0,m=-1/0,f=-1/0;for(let B of l)u=Math.min(u,B.x),I=Math.min(I,B.y),m=Math.max(m,B.x),f=Math.max(f,B.y);let y=Math.max(m-u,f-I),_=Math.max(0,Math.floor(-Math.log(y)/Math.LN2)),v=Math.pow(2,_);return new c.W(_,Math.floor((u+m)/2*v),Math.floor((I+f)/2*v))}(n),this.minzoom=this.maxzoom=this.tileID.z;let o=n.map(l=>this.tileID.getTilePoint(l)._round());return this._boundsArray=new c.V,this._boundsArray.emplaceBack(o[0].x,o[0].y,0,0),this._boundsArray.emplaceBack(o[1].x,o[1].y,c.N,0),this._boundsArray.emplaceBack(o[3].x,o[3].y,0,c.N),this._boundsArray.emplaceBack(o[2].x,o[2].y,c.N,c.N),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new c.k("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(t,n){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},n(null)):(t.state="errored",n(null))}hasTransition(){return!1}}class jn extends cs{constructor(t,n,o,l){super(t,n,o,l),this.load=()=>{this._loaded=!1;let u=this.options;this.urls=[];for(let I of u.urls)this.urls.push(this.map._requestManager.transformRequest(I,qt.Source).url);c.X(this.urls,(I,m)=>{this._loaded=!0,I?this.fire(new c.j(I)):m&&(this.video=m,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let u=this.map.painter.context,I=u.gl;this.boundsBuffer||(this.boundsBuffer=u.createVertexBuffer(this._boundsArray,ys.members)),this.boundsSegments||(this.boundsSegments=c.S.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(I.LINEAR,I.CLAMP_TO_EDGE),I.texSubImage2D(I.TEXTURE_2D,0,0,0,I.RGBA,I.UNSIGNED_BYTE,this.video)):(this.texture=new Vt(u,this.video,I.RGBA),this.texture.bind(I.LINEAR,I.CLAMP_TO_EDGE));let m=!1;for(let f in this.tiles){let y=this.tiles[f];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture,m=!0)}m&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),this.roundZoom=!0,this.type="video",this.options=n}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){let n=this.video.seekable;tn.end(0)?this.fire(new c.j(new c.Y(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}}class hn extends cs{constructor(t,n,o,l){super(t,n,o,l),this.load=()=>{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 c.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())},this.prepare=()=>{let u=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,u=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,u=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let I=this.map.painter.context,m=I.gl;this.boundsBuffer||(this.boundsBuffer=I.createVertexBuffer(this._boundsArray,ys.members)),this.boundsSegments||(this.boundsSegments=c.S.simpleSegment(0,0,4,2)),this.texture?(u||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Vt(I,this.canvas,m.RGBA,{premultiply:!0});let f=!1;for(let y in this.tiles){let _=this.tiles[y];_.state!=="loaded"&&(_.state="loaded",_.texture=this.texture,f=!0)}f&&this.fire(new c.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some(u=>!Array.isArray(u)||u.length!==2||u.some(I=>typeof I!="number"))||this.fire(new c.j(new c.Y(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new c.j(new c.Y(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&typeof n.animate!="boolean"&&this.fire(new c.j(new c.Y(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?typeof n.canvas=="string"||n.canvas instanceof HTMLCanvasElement||this.fire(new c.j(new c.Y(`sources.${t}`,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 c.j(new c.Y(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=n.animate===void 0||n.animate}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}let Xn={},Ws=g=>{switch(g){case"geojson":return As;case"image":return cs;case"raster":return $i;case"raster-dem":return Ds;case"vector":return Es;case"video":return jn;case"canvas":return hn}return Xn[g]};function Sn(g,t){let n=c.Z();return c.$(n,n,[1,1,0]),c.a0(n,n,[.5*g.width,.5*g.height,1]),c.a1(n,n,g.calculatePosMatrix(t.toUnwrapped()))}function Zn(g,t,n,o,l,u){let I=function(v,B,K){if(v)for(let F of v){let L=B[F];if(L&&L.source===K&&L.type==="fill-extrusion")return!0}else for(let F in B){let L=B[F];if(L.source===K&&L.type==="fill-extrusion")return!0}return!1}(l&&l.layers,t,g.id),m=u.maxPitchScaleFactor(),f=g.tilesIn(o,m,I);f.sort(un);let y=[];for(let v of f)y.push({wrappedTileID:v.tileID.wrapped().key,queryResults:v.tile.queryRenderedFeatures(t,n,g._state,v.queryGeometry,v.cameraQueryGeometry,v.scale,l,u,m,Sn(g.transform,v.tileID))});let _=function(v){let B={},K={};for(let F of v){let L=F.queryResults,J=F.wrappedTileID,$=K[J]=K[J]||{};for(let ge in L){let D=L[ge],ie=$[ge]=$[ge]||{},de=B[ge]=B[ge]||[];for(let pe of D)ie[pe.featureIndex]||(ie[pe.featureIndex]=!0,de.push(pe))}}return B}(y);for(let v in _)_[v].forEach(B=>{let K=B.feature,F=g.getFeatureState(K.layer["source-layer"],K.id);K.source=K.layer.source,K.layer["source-layer"]&&(K.sourceLayer=K.layer["source-layer"]),K.state=F});return _}function un(g,t){let n=g.tileID,o=t.tileID;return n.overscaledZ-o.overscaledZ||n.canonical.y-o.canonical.y||n.wrap-o.wrap||n.canonical.x-o.canonical.x}class dn{constructor(t,n){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=c.a2(),this.uses=0,this.tileSize=n,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(t){let n=t+this.timeAdded;nu.getLayer(y)).filter(Boolean);if(f.length!==0){m.layers=f,m.stateDependentLayerIds&&(m.stateDependentLayers=m.stateDependentLayerIds.map(y=>f.filter(_=>_.id===y)[0]));for(let y of f)I[y.id]=m}}return I}(t.buckets,n.style),this.hasSymbolBuckets=!1;for(let l in this.buckets){let u=this.buckets[l];if(u instanceof c.a4){if(this.hasSymbolBuckets=!0,!o)break;u.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let l in this.buckets){let u=this.buckets[l];if(u instanceof c.a4&&u.hasRTLText){this.hasRTLText=!0,c.a5();break}}this.queryPadding=0;for(let l in this.buckets){let u=this.buckets[l];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(l).queryRadius(u))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new c.a3}unloadVectorData(){for(let t in this.buckets)this.buckets[t].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(t){return this.buckets[t.id]}upload(t){for(let o in this.buckets){let l=this.buckets[o];l.uploadPending()&&l.upload(t)}let n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Vt(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Vt(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,n,o,l,u,I,m,f,y,_){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:l,cameraQueryGeometry:u,scale:I,tileSize:this.tileSize,pixelPosMatrix:_,transform:f,params:m,queryPadding:this.queryPadding*y},t,n,o):{}}querySourceFeatures(t,n){let o=this.latestFeatureIndex;if(!o||!o.rawTileData)return;let l=o.loadVTLayers(),u=n&&n.sourceLayer?n.sourceLayer:"",I=l._geojsonTileLayer||l[u];if(!I)return;let m=c.a6(n&&n.filter),{z:f,x:y,y:_}=this.tileID.canonical,v={z:f,x:y,y:_};for(let B=0;Bo)l=!1;else if(n)if(this.expirationTime{this.remove(t,u)},o)),this.data[l].push(u),this.order.push(l),this.order.length>this.max){let I=this._getAndRemoveByKey(this.order[0]);I&&this.onRemove(I)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){let n=this.data[t].shift();return n.timeout&&clearTimeout(n.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),n.value}getByKey(t){let n=this.data[t];return n?n[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,n){if(!this.has(t))return this;let o=t.wrapped().key,l=n===void 0?0:this.data[o].indexOf(n),u=this.data[o][l];return this.data[o].splice(l,1),u.timeout&&clearTimeout(u.timeout),this.data[o].length===0&&delete this.data[o],this.onRemove(u.value),this.order.splice(this.order.indexOf(o),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){let n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n)}return this}filter(t){let n=[];for(let o in this.data)for(let l of this.data[o])t(l.value)||n.push(l);for(let o of n)this.remove(o.value.tileID,o)}}class Ce{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,n,o){let l=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][l]=this.stateChanges[t][l]||{},c.e(this.stateChanges[t][l],o),this.deletedStates[t]===null){this.deletedStates[t]={};for(let u in this.state[t])u!==l&&(this.deletedStates[t][u]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][l]===null){this.deletedStates[t][l]={};for(let u in this.state[t][l])o[u]||(this.deletedStates[t][l][u]=null)}else for(let u in o)this.deletedStates[t]&&this.deletedStates[t][l]&&this.deletedStates[t][l][u]===null&&delete this.deletedStates[t][l][u]}removeFeatureState(t,n,o){if(this.deletedStates[t]===null)return;let l=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},o&&n!==void 0)this.deletedStates[t][l]!==null&&(this.deletedStates[t][l]=this.deletedStates[t][l]||{},this.deletedStates[t][l][o]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][l])for(o in this.deletedStates[t][l]={},this.stateChanges[t][l])this.deletedStates[t][l][o]=null;else this.deletedStates[t][l]=null;else this.deletedStates[t]=null}getState(t,n){let o=String(n),l=c.e({},(this.state[t]||{})[o],(this.stateChanges[t]||{})[o]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){let u=this.deletedStates[t][n];if(u===null)return{};for(let I in u)delete l[I]}return l}initializeTileState(t,n){t.setFeatureState(this.state,n)}coalesceChanges(t,n){let o={};for(let l in this.stateChanges){this.state[l]=this.state[l]||{};let u={};for(let I in this.stateChanges[l])this.state[l][I]||(this.state[l][I]={}),c.e(this.state[l][I],this.stateChanges[l][I]),u[I]=this.state[l][I];o[l]=u}for(let l in this.deletedStates){this.state[l]=this.state[l]||{};let u={};if(this.deletedStates[l]===null)for(let I in this.state[l])u[I]={},this.state[l][I]={};else for(let I in this.deletedStates[l]){if(this.deletedStates[l][I]===null)this.state[l][I]={};else for(let m of Object.keys(this.deletedStates[l][I]))delete this.state[l][I][m];u[I]=this.state[l][I]}o[l]=o[l]||{},c.e(o[l],u)}if(this.stateChanges={},this.deletedStates={},Object.keys(o).length!==0)for(let l in t)t[l].setFeatureState(o,n)}}class es extends c.E{constructor(t,n,o){super(),this.id=t,this.dispatcher=o,this.on("data",l=>{l.dataType==="source"&&l.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&l.dataType==="source"&&l.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=((l,u,I,m)=>{let f=new(Ws(u.type))(l,u,I,m);if(f.id!==l)throw new Error(`Expected Source id to be ${l} instead of ${f.id}`);return f})(t,n,o,this),this._tiles={},this._cache=new pn(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ce,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}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 t in this._tiles){let n=this._tiles[t];if(n.state!=="loaded"&&n.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,n){return this._source.loadTile(t,n)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new c.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let n in this._tiles){let o=this._tiles[n];o.upload(t),o.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(bs).map(t=>t.key)}getRenderableIds(t){let n=[];for(let o in this._tiles)this._isIdRenderable(o,t)&&n.push(this._tiles[o]);return t?n.sort((o,l)=>{let u=o.tileID,I=l.tileID,m=new c.P(u.canonical.x,u.canonical.y)._rotate(this.transform.angle),f=new c.P(I.canonical.x,I.canonical.y)._rotate(this.transform.angle);return u.overscaledZ-I.overscaledZ||f.y-m.y||f.x-m.x}).map(o=>o.tileID.key):n.map(o=>o.tileID).sort(bs).map(o=>o.key)}hasRenderableParent(t){let n=this.findLoadedParent(t,0);return!!n&&this._isIdRenderable(n.tileID.key)}_isIdRenderable(t,n){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(n||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,n){let o=this._tiles[t];o&&(o.state!=="loading"&&(o.state=n),this._loadTile(o,this._tileLoaded.bind(this,o,t,n)))}_tileLoaded(t,n,o,l){if(l)return t.state="errored",void(l.status!==404?this._source.fire(new c.j(l,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=c.h.now(),o==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(n,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new c.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){let n=this.getRenderableIds();for(let l=0;l1||(Math.abs(I)>1&&(Math.abs(I+f)===1?I+=f:Math.abs(I-f)===1&&(I-=f)),u.dem&&l.dem&&(l.dem.backfillBorder(u.dem,I,m),l.neighboringTiles&&l.neighboringTiles[y]&&(l.neighboringTiles[y].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,n,o,l){for(let u in this._tiles){let I=this._tiles[u];if(l[u]||!I.hasData()||I.tileID.overscaledZ<=n||I.tileID.overscaledZ>o)continue;let m=I.tileID;for(;I&&I.tileID.overscaledZ>n+1;){let y=I.tileID.scaledTo(I.tileID.overscaledZ-1);I=this._tiles[y.key],I&&I.hasData()&&(m=y)}let f=m;for(;f.overscaledZ>n;)if(f=f.scaledTo(f.overscaledZ-1),t[f.key]){l[m.key]=m;break}}}findLoadedParent(t,n){if(t.key in this._loadedParentTiles){let o=this._loadedParentTiles[t.key];return o&&o.tileID.overscaledZ>=n?o:null}for(let o=t.overscaledZ-1;o>=n;o--){let l=t.scaledTo(o),u=this._getLoadedTile(l);if(u)return u}}_getLoadedTile(t){let n=this._tiles[t.key];return n&&n.hasData()?n:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){let n=Math.ceil(t.width/this._source.tileSize)+1,o=Math.ceil(t.height/this._source.tileSize)+1,l=Math.floor(n*o*(this._maxTileCacheZoomLevels===null?c.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),u=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,l):l;this._cache.setMaxSize(u)}handleWrapJump(t){let n=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,n){let o={};for(let l in this._tiles){let u=this._tiles[l];u.tileID=u.tileID.unwrapTo(u.tileID.wrap+n),o[u.tileID.key]=u}this._tiles=o;for(let l in this._timers)clearTimeout(this._timers[l]),delete this._timers[l];for(let l in this._tiles)this._setTileReloadTimer(l,this._tiles[l])}}update(t,n){if(this.transform=t,this.terrain=n,!this._sourceLoaded||this._paused)return;let o;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?o=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(_=>new c.O(_.canonical.z,_.wrap,_.canonical.z,_.canonical.x,_.canonical.y)):(o=t.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:n}),this._source.hasTile&&(o=o.filter(_=>this._source.hasTile(_)))):o=[];let l=t.coveringZoomLevel(this._source),u=Math.max(l-es.maxOverzooming,this._source.minzoom),I=Math.max(l+es.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let _={};for(let v of o)if(v.canonical.z>this._source.minzoom){let B=v.scaledTo(v.canonical.z-1);_[B.key]=B;let K=v.scaledTo(Math.max(this._source.minzoom,Math.min(v.canonical.z,5)));_[K.key]=K}o=o.concat(Object.values(_))}let m=o.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,m&&this.fire(new c.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let f=this._updateRetainedTiles(o,l);if(Pt(this._source.type)){let _={},v={},B=Object.keys(f),K=c.h.now();for(let F of B){let L=f[F],J=this._tiles[F];if(!J||J.fadeEndTime!==0&&J.fadeEndTime<=K)continue;let $=this.findLoadedParent(L,u);$&&(this._addTile($.tileID),_[$.tileID.key]=$.tileID),v[F]=L}this._retainLoadedChildren(v,l,I,f);for(let F in _)f[F]||(this._coveredTiles[F]=!0,f[F]=_[F]);if(n){let F={},L={};for(let J of o)this._tiles[J.key].hasData()?F[J.key]=J:L[J.key]=J;for(let J in L){let $=L[J].children(this._source.maxzoom);this._tiles[$[0].key]&&this._tiles[$[1].key]&&this._tiles[$[2].key]&&this._tiles[$[3].key]&&(F[$[0].key]=f[$[0].key]=$[0],F[$[1].key]=f[$[1].key]=$[1],F[$[2].key]=f[$[2].key]=$[2],F[$[3].key]=f[$[3].key]=$[3],delete L[J])}for(let J in L){let $=this.findLoadedParent(L[J],this._source.minzoom);if($){F[$.tileID.key]=f[$.tileID.key]=$.tileID;for(let ge in F)F[ge].isChildOf($.tileID)&&delete F[ge]}}for(let J in this._tiles)F[J]||(this._coveredTiles[J]=!0)}}for(let _ in f)this._tiles[_].clearFadeHold();let y=c.ab(this._tiles,f);for(let _ of y){let v=this._tiles[_];v.hasSymbolBuckets&&!v.holdingForFade()?v.setHoldDuration(this.map._fadeDuration):v.hasSymbolBuckets&&!v.symbolFadeFinished()||this._removeTile(_)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(let t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,n){let o={},l={},u=Math.max(n-es.maxOverzooming,this._source.minzoom),I=Math.max(n+es.maxUnderzooming,this._source.minzoom),m={};for(let f of t){let y=this._addTile(f);o[f.key]=f,y.hasData()||nthis._source.maxzoom){let v=f.children(this._source.maxzoom)[0],B=this.getTile(v);if(B&&B.hasData()){o[v.key]=v;continue}}else{let v=f.children(this._source.maxzoom);if(o[v[0].key]&&o[v[1].key]&&o[v[2].key]&&o[v[3].key])continue}let _=y.wasRequested();for(let v=f.overscaledZ-1;v>=u;--v){let B=f.scaledTo(v);if(l[B.key])break;if(l[B.key]=!0,y=this.getTile(B),!y&&_&&(y=this._addTile(B)),y){let K=y.hasData();if((_||K)&&(o[B.key]=B),_=y.wasRequested(),K)break}}}return o}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let t in this._tiles){let n=[],o,l=this._tiles[t].tileID;for(;l.overscaledZ>0;){if(l.key in this._loadedParentTiles){o=this._loadedParentTiles[l.key];break}n.push(l.key);let u=l.scaledTo(l.overscaledZ-1);if(o=this._getLoadedTile(u),o)break;l=u}for(let u of n)this._loadedParentTiles[u]=o}}_addTile(t){let n=this._tiles[t.key];if(n)return n;n=this._cache.getAndRemove(t),n&&(this._setTileReloadTimer(t.key,n),n.tileID=t,this._state.initializeTileState(n,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,n)));let o=n;return n||(n=new dn(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(n,this._tileLoaded.bind(this,n,t.key,n.state))),n.uses++,this._tiles[t.key]=n,o||this._source.fire(new c.k("dataloading",{tile:n,coord:n.tileID,dataType:"source"})),n}_setTileReloadTimer(t,n){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);let o=n.getExpiryTimeout();o&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},o))}_removeTile(t){let n=this._tiles[t];n&&(n.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),n.uses>0||(n.hasData()&&n.state!=="reloading"?this._cache.add(n.tileID,n,n.getExpiryTimeout()):(n.aborted=!0,this._abortTile(n),this._unloadTile(n))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,n,o){let l=[],u=this.transform;if(!u)return l;let I=o?u.getCameraQueryGeometry(t):t,m=t.map(F=>u.pointCoordinate(F,this.terrain)),f=I.map(F=>u.pointCoordinate(F,this.terrain)),y=this.getIds(),_=1/0,v=1/0,B=-1/0,K=-1/0;for(let F of f)_=Math.min(_,F.x),v=Math.min(v,F.y),B=Math.max(B,F.x),K=Math.max(K,F.y);for(let F=0;F=0&&D[1].y+ge>=0){let ie=m.map(pe=>J.getTilePoint(pe)),de=f.map(pe=>J.getTilePoint(pe));l.push({tile:L,tileID:J,queryGeometry:ie,cameraQueryGeometry:de,scale:$})}}return l}getVisibleCoordinates(t){let n=this.getRenderableIds(t).map(o=>this._tiles[o].tileID);for(let o of n)o.posMatrix=this.transform.calculatePosMatrix(o.toUnwrapped());return n}hasTransition(){if(this._source.hasTransition())return!0;if(Pt(this._source.type)){let t=c.h.now();for(let n in this._tiles)if(this._tiles[n].fadeEndTime>=t)return!0}return!1}setFeatureState(t,n,o){this._state.updateState(t=t||"_geojsonTileLayer",n,o)}removeFeatureState(t,n,o){this._state.removeFeatureState(t=t||"_geojsonTileLayer",n,o)}getFeatureState(t,n){return this._state.getState(t=t||"_geojsonTileLayer",n)}setDependencies(t,n,o){let l=this._tiles[t];l&&l.setDependencies(n,o)}reloadTilesForDependencies(t,n){for(let o in this._tiles)this._tiles[o].hasDependency(t,n)&&this._reloadTile(o,"reloading");this._cache.filter(o=>!o.hasDependency(t,n))}}function bs(g,t){let n=Math.abs(2*g.wrap)-+(g.wrap<0),o=Math.abs(2*t.wrap)-+(t.wrap<0);return g.overscaledZ-t.overscaledZ||o-n||t.canonical.y-g.canonical.y||t.canonical.x-g.canonical.x}function Pt(g){return g==="raster"||g==="image"||g==="video"}es.maxOverzooming=10,es.maxUnderzooming=3;let Tt="mapboxgl_preloaded_worker_pool";class Ys{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length{n.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Tt]}numActive(){return Object.keys(this.active).length}}let kn=Math.floor(c.h.hardwareConcurrency/2),Ns;function Qn(){return Ns||(Ns=new Ys),Ns}Ys.workerCount=c.ac(globalThis)?Math.max(Math.min(kn,3),1):1;class nn{constructor(t,n){this.reset(t,n)}reset(t,n){this.points=t||[],this._distances=[0];for(let o=1;o0?(l-I)/m:0;return this.points[u].mult(1-f).add(this.points[n].mult(f))}}function Os(g,t){let n=!0;return g==="always"||g!=="never"&&t!=="never"||(n=!1),n}class In{constructor(t,n,o){let l=this.boxCells=[],u=this.circleCells=[];this.xCellCount=Math.ceil(t/o),this.yCellCount=Math.ceil(n/o);for(let I=0;Ithis.width||l<0||n>this.height)return[];let f=[];if(t<=0&&n<=0&&this.width<=o&&this.height<=l){if(u)return[{key:null,x1:t,y1:n,x2:o,y2:l}];for(let y=0;y0}hitTestCircle(t,n,o,l,u){let I=t-o,m=t+o,f=n-o,y=n+o;if(m<0||I>this.width||y<0||f>this.height)return!1;let _=[];return this._forEachCell(I,f,m,y,this._queryCellCircle,_,{hitTest:!0,overlapMode:l,circle:{x:t,y:n,radius:o},seenUids:{box:{},circle:{}}},u),_.length>0}_queryCell(t,n,o,l,u,I,m,f){let{seenUids:y,hitTest:_,overlapMode:v}=m,B=this.boxCells[u];if(B!==null){let F=this.bboxes;for(let L of B)if(!y.box[L]){y.box[L]=!0;let J=4*L,$=this.boxKeys[L];if(t<=F[J+2]&&n<=F[J+3]&&o>=F[J+0]&&l>=F[J+1]&&(!f||f($))&&(!_||!Os(v,$.overlapMode))&&(I.push({key:$,x1:F[J],y1:F[J+1],x2:F[J+2],y2:F[J+3]}),_))return!0}}let K=this.circleCells[u];if(K!==null){let F=this.circles;for(let L of K)if(!y.circle[L]){y.circle[L]=!0;let J=3*L,$=this.circleKeys[L];if(this._circleAndRectCollide(F[J],F[J+1],F[J+2],t,n,o,l)&&(!f||f($))&&(!_||!Os(v,$.overlapMode))){let ge=F[J],D=F[J+1],ie=F[J+2];if(I.push({key:$,x1:ge-ie,y1:D-ie,x2:ge+ie,y2:D+ie}),_)return!0}}}return!1}_queryCellCircle(t,n,o,l,u,I,m,f){let{circle:y,seenUids:_,overlapMode:v}=m,B=this.boxCells[u];if(B!==null){let F=this.bboxes;for(let L of B)if(!_.box[L]){_.box[L]=!0;let J=4*L,$=this.boxKeys[L];if(this._circleAndRectCollide(y.x,y.y,y.radius,F[J+0],F[J+1],F[J+2],F[J+3])&&(!f||f($))&&!Os(v,$.overlapMode))return I.push(!0),!0}}let K=this.circleCells[u];if(K!==null){let F=this.circles;for(let L of K)if(!_.circle[L]){_.circle[L]=!0;let J=3*L,$=this.circleKeys[L];if(this._circlesCollide(F[J],F[J+1],F[J+2],y.x,y.y,y.radius)&&(!f||f($))&&!Os(v,$.overlapMode))return I.push(!0),!0}}}_forEachCell(t,n,o,l,u,I,m,f){let y=this._convertToXCellCoord(t),_=this._convertToYCellCoord(n),v=this._convertToXCellCoord(o),B=this._convertToYCellCoord(l);for(let K=y;K<=v;K++)for(let F=_;F<=B;F++)if(u.call(this,t,n,o,l,this.xCellCount*F+K,I,m,f))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,n,o,l,u,I){let m=l-t,f=u-n,y=o+I;return y*y>m*m+f*f}_circleAndRectCollide(t,n,o,l,u,I,m){let f=(I-l)/2,y=Math.abs(t-(l+f));if(y>f+o)return!1;let _=(m-u)/2,v=Math.abs(n-(u+_));if(v>_+o)return!1;if(y<=f||v<=_)return!0;let B=y-f,K=v-_;return B*B+K*K<=o*o}}function We(g,t,n,o,l){let u=c.Z();return t?(c.a0(u,u,[1/l,1/l,1]),n||c.ae(u,u,o.angle)):c.a1(u,o.labelPlaneMatrix,g),u}function Yi(g,t,n,o,l){if(t){let u=c.af(g);return c.a0(u,u,[l,l,1]),n||c.ae(u,u,-o.angle),u}return o.glCoordMatrix}function Ut(g,t,n){let o;n?(o=[g.x,g.y,n(g.x,g.y),1],c.ag(o,o,t)):(o=[g.x,g.y,0,1],H(o,o,t));let l=o[3];return{point:new c.P(o[0]/l,o[1]/l),signedDistanceFromCamera:l}}function mn(g,t){return .5+g/t*.5}function Us(g,t){let n=g[0]/g[3],o=g[1]/g[3];return n>=-t[0]&&n<=t[0]&&o>=-t[1]&&o<=t[1]}function ze(g,t,n,o,l,u,I,m,f,y){let _=o?g.textSizeData:g.iconSizeData,v=c.ah(_,n.transform.zoom),B=[256/n.width*2+1,256/n.height*2+1],K=o?g.text.dynamicLayoutVertexArray:g.icon.dynamicLayoutVertexArray;K.clear();let F=g.lineVertexArray,L=o?g.text.placedSymbolArray:g.icon.placedSymbolArray,J=n.transform.width/n.transform.height,$=!1;for(let ge=0;geMath.abs(n.x-t.x)*o?{useVertical:!0}:(g===c.ai.vertical?t.yn.x)?{needsFlipping:!0}:null}function Ni(g,t,n,o,l,u,I,m,f,y,_,v,B,K,F,L){let J=t/24,$=g.lineOffsetX*J,ge=g.lineOffsetY*J,D;if(g.numGlyphs>1){let ie=g.glyphStartIndex+g.numGlyphs,de=g.lineStartIndex,pe=g.lineStartIndex+g.lineLength,ve=At(J,m,$,ge,n,_,v,g,f,u,B,F,L);if(!ve)return{notEnoughRoom:!0};let Be=Ut(ve.first.point,I,L).point,Ze=Ut(ve.last.point,I,L).point;if(o&&!n){let Te=ut(g.writingMode,Be,Ze,K);if(Te)return Te}D=[ve.first];for(let Te=g.glyphStartIndex+1;Te0?Be.point:js(v,ve,de,1,l,L),Te=ut(g.writingMode,de,Ze,K);if(Te)return Te}let ie=w(J*m.getoffsetX(g.glyphStartIndex),$,ge,n,_,v,g.segment,g.lineStartIndex,g.lineStartIndex+g.lineLength,f,u,B,F,L);if(!ie)return{notEnoughRoom:!0};D=[ie]}for(let ie of D)c.ak(y,ie.point,ie.angle);return{}}function js(g,t,n,o,l,u){let I=Ut(g.add(g.sub(t)._unit()),l,u).point,m=n.sub(I);return n.add(m._mult(o/m.mag()))}function Ct(g,t){let{projectionCache:n,lineVertexArray:o,labelPlaneMatrix:l,tileAnchorPoint:u,distanceFromAnchor:I,getElevation:m,previousVertex:f,direction:y,absOffsetX:_}=t;if(n.projections[g])return n.projections[g];let v=new c.P(o.getx(g),o.gety(g)),B=Ut(v,l,m);if(B.signedDistanceFromCamera>0)return n.projections[g]=B.point,B.point;let K=g-y;return js(I===0?u:new c.P(o.getx(K),o.gety(K)),v,f,_-I+1,l,m)}function Qs(g,t,n){return g._unit()._perp()._mult(t*n)}function X(g,t,n,o,l,u,I,m){let{projectionCache:f,direction:y}=m;if(f.offsets[g])return f.offsets[g];let _=n.add(t);if(g+y=l)return f.offsets[g]=_,_;let v=Ct(g+y,m),B=Qs(v.sub(n),I,y),K=n.add(B),F=v.add(B);return f.offsets[g]=c.al(u,_,K,F)||_,f.offsets[g]}function w(g,t,n,o,l,u,I,m,f,y,_,v,B,K){let F=o?g-t:g+t,L=F>0?1:-1,J=0;o&&(L*=-1,J=Math.PI),L<0&&(J+=Math.PI);let $,ge,D=L>0?m+I:m+I+1,ie=l,de=l,pe=0,ve=0,Be=Math.abs(F),Ze=[],Te;for(;pe+ve<=Be;){if(D+=L,D=f)return null;pe+=ve,de=ie,ge=$;let Xe={projectionCache:v,lineVertexArray:y,labelPlaneMatrix:_,tileAnchorPoint:u,distanceFromAnchor:pe,getElevation:K,previousVertex:de,direction:L,absOffsetX:Be};if(ie=Ct(D,Xe),n===0)Ze.push(de),Te=ie.sub(de);else{let lt,qe=ie.sub(de);lt=qe.mag()===0?Qs(Ct(D+L,Xe).sub(ie),n,L):Qs(qe,n,L),ge||(ge=de.add(lt)),$=X(D,lt,ie,m,f,ge,n,Xe),Ze.push(ge),Te=$.sub(ge)}ve=Te.mag()}let je=Te._mult((Be-pe)/ve)._add(ge||de),St=J+Math.atan2(ie.y-de.y,ie.x-de.x);return Ze.push(je),{point:je,angle:B?St:0,path:Ze}}let Z=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function T(g,t){for(let n=0;n=1;bt--)qe.push(Xe.path[bt]);for(let bt=1;btUt(Zt,f,F));qe=bt.some(Zt=>Zt.signedDistanceFromCamera<=0)?[]:bt.map(Zt=>Zt.point)}let xt=[];if(qe.length>0){let bt=qe[0].clone(),Zt=qe[0].clone();for(let Ci=1;Ci=Te.x&&Zt.x<=je.x&&bt.y>=Te.y&&Zt.y<=je.y?[qe]:Zt.xje.x||Zt.yje.y?[]:c.am([qe],Te.x,Te.y,je.x,je.y)}for(let bt of xt){St.reset(bt,.25*Ze);let Zt=0;Zt=St.length<=.5*Ze?1:Math.ceil(St.paddedLength/Yt)+1;for(let Ci=0;Ci=this.screenRightBoundary||lthis.screenBottomBoundary}isInsideGrid(t,n,o,l){return o>=0&&t=0&&no.collisionGroupID===n}}return this.collisionGroups[t]}}function ct(g,t,n,o,l){let{horizontalAlign:u,verticalAlign:I}=c.au(g);return new c.P(-(u-.5)*t+o[0]*l,-(I-.5)*n+o[1]*l)}function Oe(g,t,n,o,l,u){let{x1:I,x2:m,y1:f,y2:y,anchorPointX:_,anchorPointY:v}=g,B=new c.P(t,n);return o&&B._rotate(l?u:-u),{x1:I+B.x,y1:f+B.y,x2:m+B.x,y2:y+B.y,anchorPointX:_,anchorPointY:v}}class nt{constructor(t,n,o,l,u){this.transform=t.clone(),this.terrain=n,this.collisionIndex=new oe(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new it(l),this.collisionCircleArrays={},this.prevPlacement=u,u&&(u.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,o,l){let u=o.getBucket(n),I=o.latestFeatureIndex;if(!u||!I||n.id!==u.layerIds[0])return;let m=o.collisionBoxArray,f=u.layers[0].layout,y=Math.pow(2,this.transform.zoom-o.tileID.overscaledZ),_=o.tileSize/c.N,v=this.transform.calculatePosMatrix(o.tileID.toUnwrapped()),B=f.get("text-pitch-alignment")==="map",K=f.get("text-rotation-alignment")==="map",F=q(o,1,this.transform.zoom),L=We(v,B,K,this.transform,F),J=null;if(B){let ge=Yi(v,B,K,this.transform,F);J=c.a1([],this.transform.labelPlaneMatrix,ge)}this.retainedQueryData[u.bucketInstanceId]=new Se(u.bucketInstanceId,I,u.sourceLayerIndex,u.index,o.tileID);let $={bucket:u,layout:f,posMatrix:v,textLabelPlaneMatrix:L,labelToScreenMatrix:J,scale:y,textPixelRatio:_,holdingForFade:o.holdingForFade(),collisionBoxArray:m,partiallyEvaluatedTextSize:c.ah(u.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(u.sourceID)};if(l)for(let ge of u.sortKeyRanges){let{sortKey:D,symbolInstanceStart:ie,symbolInstanceEnd:de}=ge;t.push({sortKey:D,symbolInstanceStart:ie,symbolInstanceEnd:de,parameters:$})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:u.symbolInstances.length,parameters:$})}attemptAnchorPlacement(t,n,o,l,u,I,m,f,y,_,v,B,K,F,L,J){let $=c.aq[t.textAnchor],ge=[t.textOffset0,t.textOffset1],D=ct($,o,l,ge,u),ie=this.collisionIndex.placeCollisionBox(Oe(n,D.x,D.y,I,m,this.transform.angle),v,f,y,_.predicate,J);if((!L||this.collisionIndex.placeCollisionBox(Oe(L,D.x,D.y,I,m,this.transform.angle),v,f,y,_.predicate,J).box.length!==0)&&ie.box.length>0){let de;if(this.prevPlacement&&this.prevPlacement.variableOffsets[B.crossTileID]&&this.prevPlacement.placements[B.crossTileID]&&this.prevPlacement.placements[B.crossTileID].text&&(de=this.prevPlacement.variableOffsets[B.crossTileID].anchor),B.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[B.crossTileID]={textOffset:ge,width:o,height:l,anchor:$,textBoxScale:u,prevAnchor:de},this.markUsedJustification(K,$,B,F),K.allowVerticalPlacement&&(this.markUsedOrientation(K,F,B),this.placedOrientations[B.crossTileID]=F),{shift:D,placedGlyphBoxes:ie}}}placeLayerBucketPart(t,n,o){let{bucket:l,layout:u,posMatrix:I,textLabelPlaneMatrix:m,labelToScreenMatrix:f,textPixelRatio:y,holdingForFade:_,collisionBoxArray:v,partiallyEvaluatedTextSize:B,collisionGroup:K}=t.parameters,F=u.get("text-optional"),L=u.get("icon-optional"),J=c.ar(u,"text-overlap","text-allow-overlap"),$=J==="always",ge=c.ar(u,"icon-overlap","icon-allow-overlap"),D=ge==="always",ie=u.get("text-rotation-alignment")==="map",de=u.get("text-pitch-alignment")==="map",pe=u.get("icon-text-fit")!=="none",ve=u.get("symbol-z-order")==="viewport-y",Be=$&&(D||!l.hasIconData()||L),Ze=D&&($||!l.hasTextData()||F);!l.collisionArrays&&v&&l.deserializeCollisionBoxes(v);let Te=this.retainedQueryData[l.bucketInstanceId].tileID,je=this.terrain?(Xe,lt)=>this.terrain.getElevation(Te,Xe,lt):null,St=(Xe,lt)=>{var qe,Yt;if(n[Xe.crossTileID])return;if(_)return void(this.placements[Xe.crossTileID]=new fe(!1,!1,!1));let xt=!1,bt=!1,Zt=!0,Ci=null,jt={box:null,offscreen:null},Oi={box:null,offscreen:null},Ji=null,xi=null,Ks=null,ii=0,An=0,yn=0;lt.textFeatureIndex?ii=lt.textFeatureIndex:Xe.useRuntimeCollisionCircles&&(ii=Xe.featureIndex),lt.verticalTextFeatureIndex&&(An=lt.verticalTextFeatureIndex);let Nn=lt.textBox;if(Nn){let is=fi=>{let zi=c.ai.horizontal;if(l.allowVerticalPlacement&&!fi&&this.prevPlacement){let ws=this.prevPlacement.placedOrientations[Xe.crossTileID];ws&&(this.placedOrientations[Xe.crossTileID]=ws,zi=ws,this.markUsedOrientation(l,zi,Xe))}return zi},Ui=(fi,zi)=>{if(l.allowVerticalPlacement&&Xe.numVerticalGlyphVertices>0&<.verticalTextBox){for(let ws of l.writingModes)if(ws===c.ai.vertical?(jt=zi(),Oi=jt):jt=fi(),jt&&jt.box&&jt.box.length)break}else jt=fi()},ds=Xe.textAnchorOffsetStartIndex,or=Xe.textAnchorOffsetEndIndex;if(or===ds){let fi=(zi,ws)=>{let Ai=this.collisionIndex.placeCollisionBox(zi,J,y,I,K.predicate,je);return Ai&&Ai.box&&Ai.box.length&&(this.markUsedOrientation(l,ws,Xe),this.placedOrientations[Xe.crossTileID]=ws),Ai};Ui(()=>fi(Nn,c.ai.horizontal),()=>{let zi=lt.verticalTextBox;return l.allowVerticalPlacement&&Xe.numVerticalGlyphVertices>0&&zi?fi(zi,c.ai.vertical):{box:null,offscreen:null}}),is(jt&&jt.box&&jt.box.length)}else{let fi=c.aq[(Yt=(qe=this.prevPlacement)===null||qe===void 0?void 0:qe.variableOffsets[Xe.crossTileID])===null||Yt===void 0?void 0:Yt.anchor],zi=(Ai,ar,bo)=>{let ll=Ai.x2-Ai.x1,cl=Ai.y2-Ai.y1,jl=Xe.textBoxScale,da=pe&&ge==="never"?ar:null,bn={box:[],offscreen:!1},lr=J==="never"?1:2,_n="never";fi&&lr++;for(let en=0;enzi(Nn,lt.iconBox,c.ai.horizontal),()=>{let Ai=lt.verticalTextBox;return l.allowVerticalPlacement&&!(jt&&jt.box&&jt.box.length)&&Xe.numVerticalGlyphVertices>0&&Ai?zi(Ai,lt.verticalIconBox,c.ai.vertical):{box:null,offscreen:null}}),jt&&(xt=jt.box,Zt=jt.offscreen);let ws=is(jt&&jt.box);if(!xt&&this.prevPlacement){let Ai=this.prevPlacement.variableOffsets[Xe.crossTileID];Ai&&(this.variableOffsets[Xe.crossTileID]=Ai,this.markUsedJustification(l,Ai.anchor,Xe,ws))}}}if(Ji=jt,xt=Ji&&Ji.box&&Ji.box.length>0,Zt=Ji&&Ji.offscreen,Xe.useRuntimeCollisionCircles){let is=l.text.placedSymbolArray.get(Xe.centerJustifiedTextSymbolIndex),Ui=c.aj(l.textSizeData,B,is),ds=u.get("text-padding");xi=this.collisionIndex.placeCollisionCircles(J,is,l.lineVertexArray,l.glyphOffsetArray,Ui,I,m,f,o,de,K.predicate,Xe.collisionCircleDiameter,ds,je),xi.circles.length&&xi.collisionDetected&&!o&&c.w("Collisions detected, but collision boxes are not shown"),xt=$||xi.circles.length>0&&!xi.collisionDetected,Zt=Zt&&xi.offscreen}if(lt.iconFeatureIndex&&(yn=lt.iconFeatureIndex),lt.iconBox){let is=Ui=>{let ds=pe&&Ci?Oe(Ui,Ci.x,Ci.y,ie,de,this.transform.angle):Ui;return this.collisionIndex.placeCollisionBox(ds,ge,y,I,K.predicate,je)};Oi&&Oi.box&&Oi.box.length&<.verticalIconBox?(Ks=is(lt.verticalIconBox),bt=Ks.box.length>0):(Ks=is(lt.iconBox),bt=Ks.box.length>0),Zt=Zt&&Ks.offscreen}let rr=F||Xe.numHorizontalGlyphVertices===0&&Xe.numVerticalGlyphVertices===0,wr=L||Xe.numIconVertices===0;if(rr||wr?wr?rr||(bt=bt&&xt):xt=bt&&xt:bt=xt=bt&&xt,xt&&Ji&&Ji.box&&this.collisionIndex.insertCollisionBox(Ji.box,J,u.get("text-ignore-placement"),l.bucketInstanceId,Oi&&Oi.box&&An?An:ii,K.ID),bt&&Ks&&this.collisionIndex.insertCollisionBox(Ks.box,ge,u.get("icon-ignore-placement"),l.bucketInstanceId,yn,K.ID),xi&&(xt&&this.collisionIndex.insertCollisionCircles(xi.circles,J,u.get("text-ignore-placement"),l.bucketInstanceId,ii,K.ID),o)){let is=l.bucketInstanceId,Ui=this.collisionCircleArrays[is];Ui===void 0&&(Ui=this.collisionCircleArrays[is]=new _e);for(let ds=0;ds=0;--lt){let qe=Xe[lt];St(l.symbolInstances.get(qe),l.collisionArrays[qe])}}else for(let Xe=t.symbolInstanceStart;Xe=0&&(t.text.placedSymbolArray.get(m).crossTileID=u>=0&&m!==u?0:o.crossTileID)}markUsedOrientation(t,n,o){let l=n===c.ai.horizontal||n===c.ai.horizontalOnly?n:0,u=n===c.ai.vertical?n:0,I=[o.leftJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.rightJustifiedTextSymbolIndex];for(let m of I)t.text.placedSymbolArray.get(m).placedOrientation=l;o.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).placedOrientation=u)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;let n=this.prevPlacement,o=!1;this.prevZoomAdjustment=n?n.zoomAdjustment(this.transform.zoom):0;let l=n?n.symbolFadeChange(t):1,u=n?n.opacities:{},I=n?n.variableOffsets:{},m=n?n.placedOrientations:{};for(let f in this.placements){let y=this.placements[f],_=u[f];_?(this.opacities[f]=new te(_,l,y.text,y.icon),o=o||y.text!==_.text.placed||y.icon!==_.icon.placed):(this.opacities[f]=new te(null,l,y.text,y.icon,y.skipFade),o=o||y.text||y.icon)}for(let f in u){let y=u[f];if(!this.opacities[f]){let _=new te(y,l,!1,!1);_.isHidden()||(this.opacities[f]=_,o=o||y.text.placed||y.icon.placed)}}for(let f in I)this.variableOffsets[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.variableOffsets[f]=I[f]);for(let f in m)this.placedOrientations[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.placedOrientations[f]=m[f]);if(n&&n.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");o?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=n?n.lastPlacementChangeTime:t)}updateLayerOpacities(t,n){let o={};for(let l of n){let u=l.getBucket(t);u&&l.latestFeatureIndex&&t.id===u.layerIds[0]&&this.updateBucketOpacities(u,o,l.collisionBoxArray)}}updateBucketOpacities(t,n,o){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();let l=t.layers[0],u=l.layout,I=new te(null,0,!1,!1,!0),m=u.get("text-allow-overlap"),f=u.get("icon-allow-overlap"),y=l._unevaluatedLayout.hasValue("text-variable-anchor")||l._unevaluatedLayout.hasValue("text-variable-anchor-offset"),_=u.get("text-rotation-alignment")==="map",v=u.get("text-pitch-alignment")==="map",B=u.get("icon-text-fit")!=="none",K=new te(null,0,m&&(f||!t.hasIconData()||u.get("icon-optional")),f&&(m||!t.hasTextData()||u.get("text-optional")),!0);!t.collisionArrays&&o&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(o);let F=(L,J,$)=>{for(let ge=0;ge0,pe=this.placedOrientations[J.crossTileID],ve=pe===c.ai.vertical,Be=pe===c.ai.horizontal||pe===c.ai.horizontalOnly;if($>0||ge>0){let Ze=Ti(ie.text);F(t.text,$,ve?_s:Ze),F(t.text,ge,Be?_s:Ze);let Te=ie.text.isHidden();[J.rightJustifiedTextSymbolIndex,J.centerJustifiedTextSymbolIndex,J.leftJustifiedTextSymbolIndex].forEach(Xe=>{Xe>=0&&(t.text.placedSymbolArray.get(Xe).hidden=Te||ve?1:0)}),J.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(J.verticalPlacedTextSymbolIndex).hidden=Te||Be?1:0);let je=this.variableOffsets[J.crossTileID];je&&this.markUsedJustification(t,je.anchor,J,pe);let St=this.placedOrientations[J.crossTileID];St&&(this.markUsedJustification(t,"left",J,St),this.markUsedOrientation(t,St,J))}if(de){let Ze=Ti(ie.icon),Te=!(B&&J.verticalPlacedIconSymbolIndex&&ve);J.placedIconSymbolIndex>=0&&(F(t.icon,J.numIconVertices,Te?Ze:_s),t.icon.placedSymbolArray.get(J.placedIconSymbolIndex).hidden=ie.icon.isHidden()),J.verticalPlacedIconSymbolIndex>=0&&(F(t.icon,J.numVerticalIconVertices,Te?_s:Ze),t.icon.placedSymbolArray.get(J.verticalPlacedIconSymbolIndex).hidden=ie.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){let Ze=t.collisionArrays[L];if(Ze){let Te=new c.P(0,0);if(Ze.textBox||Ze.verticalTextBox){let St=!0;if(y){let Xe=this.variableOffsets[D];Xe?(Te=ct(Xe.anchor,Xe.width,Xe.height,Xe.textOffset,Xe.textBoxScale),_&&Te._rotate(v?this.transform.angle:-this.transform.angle)):St=!1}Ze.textBox&&dt(t.textCollisionBox.collisionVertexArray,ie.text.placed,!St||ve,Te.x,Te.y),Ze.verticalTextBox&&dt(t.textCollisionBox.collisionVertexArray,ie.text.placed,!St||Be,Te.x,Te.y)}let je=Boolean(!Be&&Ze.verticalIconBox);Ze.iconBox&&dt(t.iconCollisionBox.collisionVertexArray,ie.icon.placed,je,B?Te.x:0,B?Te.y:0),Ze.verticalIconBox&&dt(t.iconCollisionBox.collisionVertexArray,ie.icon.placed,!je,B?Te.x:0,B?Te.y:0)}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){let L=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=L.invProjMatrix,t.placementViewportMatrix=L.viewportMatrix,t.collisionCircleArray=L.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTimet}setStale(){this.stale=!0}}function dt(g,t,n,o,l){g.emplaceBack(t?1:0,n?1:0,o||0,l||0),g.emplaceBack(t?1:0,n?1:0,o||0,l||0),g.emplaceBack(t?1:0,n?1:0,o||0,l||0),g.emplaceBack(t?1:0,n?1:0,o||0,l||0)}let Mt=Math.pow(2,25),Et=Math.pow(2,24),Bt=Math.pow(2,17),wt=Math.pow(2,16),Si=Math.pow(2,9),Dt=Math.pow(2,8),ci=Math.pow(2,1);function Ti(g){if(g.opacity===0&&!g.placed)return 0;if(g.opacity===1&&g.placed)return 4294967295;let t=g.placed?1:0,n=Math.floor(127*g.opacity);return n*Mt+t*Et+n*Bt+t*wt+n*Si+t*Dt+n*ci+t}let _s=0;class eo{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,n,o,l,u){let I=this._bucketParts;for(;this._currentTileIndexm.sortKey-f.sortKey));this._currentPartIndex!this._forceFullPlacement&&c.h.now()-l>2;for(;this._currentPlacementIndex>=0;){let I=n[t[this._currentPlacementIndex]],m=this.placement.collisionIndex.transform.zoom;if(I.type==="symbol"&&(!I.minzoom||I.minzoom<=m)&&(!I.maxzoom||I.maxzoom>m)){if(this._inProgressLayer||(this._inProgressLayer=new eo(I)),this._inProgressLayer.continuePlacement(o[I.source],this.placement,this._showCollisionBoxes,I,u))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}let Hn=512/c.N/2;class To{constructor(t,n,o){this.tileID=t,this.bucketInstanceId=o,this._symbolsByKey={};let l=new Map;for(let u=0;u({x:Math.floor(f.anchorX*Hn),y:Math.floor(f.anchorY*Hn)})),crossTileIDs:I.map(f=>f.crossTileID)};if(m.positions.length>128){let f=new c.av(m.positions.length,16,Uint16Array);for(let{x:y,y:_}of m.positions)f.add(y,_);f.finish(),delete m.positions,m.index=f}this._symbolsByKey[u]=m}}getScaledCoordinates(t,n){let{x:o,y:l,z:u}=this.tileID.canonical,{x:I,y:m,z:f}=n.canonical,y=Hn/Math.pow(2,f-u),_=(m*c.N+t.anchorY)*y,v=l*c.N*Hn;return{x:Math.floor((I*c.N+t.anchorX)*y-o*c.N*Hn),y:Math.floor(_-v)}}findMatches(t,n,o){let l=this.tileID.canonical.zt)}}class Kt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Vr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){let n=Math.round((t-this.lng)/360);if(n!==0)for(let o in this.indexes){let l=this.indexes[o],u={};for(let I in l){let m=l[I];m.tileID=m.tileID.unwrapTo(m.tileID.wrap+n),u[m.tileID.key]=m}this.indexes[o]=u}this.lng=t}addBucket(t,n,o){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===n.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let u=0;ut.overscaledZ)for(let m in I){let f=I[m];f.tileID.isChildOf(t)&&f.findMatches(n.symbolInstances,t,l)}else{let m=I[t.scaledTo(Number(u)).key];m&&m.findMatches(n.symbolInstances,t,l)}}for(let u=0;u{n[o]=!0});for(let o in this.layerIndexes)n[o]||delete this.layerIndexes[o]}}let Pi=(g,t)=>c.x(g,t&&t.filter(n=>n.identifier!=="source.canvas")),gs=c.F(c.ax,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),Tr=c.F(c.ax,["setCenter","setZoom","setBearing","setPitch"]),ts=c.aw();class bi extends c.E{constructor(t,n={}){super(),this.map=t,this.dispatcher=new Jt(Qn(),this,t._getMapId()),this.imageManager=new Di,this.imageManager.setEventedParent(this),this.glyphManager=new Ts(t._requestManager,n.localIdeographFontFamily),this.lineAtlas=new mi(256,512),this.crossTileSymbolIndex=new dr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new c.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",c.az());let o=this;this._rtlTextPluginCallback=bi.registerForPluginStateChange(l=>{o.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:l.pluginStatus,pluginURL:l.pluginURL},(u,I)=>{if(c.aA(u),I&&I.every(m=>m))for(let m in o.sourceCaches){let f=o.sourceCaches[m].getSource().type;f!=="vector"&&f!=="geojson"||o.sourceCaches[m].reload()}})}),this.on("data",l=>{if(l.dataType!=="source"||l.sourceDataType!=="metadata")return;let u=this.sourceCaches[l.sourceId];if(!u)return;let I=u.getSource();if(I&&I.vectorLayerIds)for(let m in this._layers){let f=this._layers[m];f.source===I.id&&this._validateLayer(f)}})}loadURL(t,n={},o){this.fire(new c.k("dataloading",{dataType:"style"})),n.validate=typeof n.validate!="boolean"||n.validate;let l=this.map._requestManager.transformRequest(t,qt.Style);this._request=c.f(l,(u,I)=>{this._request=null,u?this.fire(new c.j(u)):I&&this._load(I,n,o)})}loadJSON(t,n={},o){this.fire(new c.k("dataloading",{dataType:"style"})),this._request=c.h.frame(()=>{this._request=null,n.validate=n.validate!==!1,this._load(t,n,o)})}loadEmpty(){this.fire(new c.k("dataloading",{dataType:"style"})),this._load(ts,{validate:!1})}_load(t,n,o){var l;let u=n.transformStyle?n.transformStyle(o,t):t;if(!n.validate||!Pi(this,c.y(u))){this._loaded=!0,this.stylesheet=u;for(let I in u.sources)this.addSource(I,u.sources[I],{validate:!1});u.sprite?this._loadSprite(u.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(u.glyphs),this._createLayers(),this.light=new gt(this.stylesheet.light),this.map.setTerrain((l=this.stylesheet.terrain)!==null&&l!==void 0?l:null),this.fire(new c.k("data",{dataType:"style"})),this.fire(new c.k("style.load"))}}_createLayers(){let t=c.aB(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map(n=>n.id),this._layers={},this._serializedLayers=null;for(let n of t){let o=c.aC(n);o.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=o}}_loadSprite(t,n=!1,o=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(l,u,I,m){let f=_t(l),y=f.length,_=I>1?"@2x":"",v={},B={},K={};for(let{id:F,url:L}of f){let J=u.transformRequest(u.normalizeSpriteURL(L,_,".json"),qt.SpriteJSON),$=`${F}_${J.url}`;v[$]=c.f(J,(ie,de)=>{delete v[$],B[F]=de,Ri(m,B,K,ie,y)});let ge=u.transformRequest(u.normalizeSpriteURL(L,_,".png"),qt.SpriteImage),D=`${F}_${ge.url}`;v[D]=Qt.getImage(ge,(ie,de)=>{delete v[D],K[F]=de,Ri(m,B,K,ie,y)})}return{cancel(){for(let F of Object.values(v))F.cancel()}}}(t,this.map._requestManager,this.map.getPixelRatio(),(l,u)=>{if(this._spriteRequest=null,l)this.fire(new c.j(l));else if(u)for(let I in u){this._spritesImagesIds[I]=[];let m=this._spritesImagesIds[I]?this._spritesImagesIds[I].filter(f=>!(f in u)):[];for(let f of m)this.imageManager.removeImage(f),this._changedImages[f]=!0;for(let f in u[I]){let y=I==="default"?f:`${I}:${f}`;this._spritesImagesIds[I].push(y),y in this.imageManager.images?this.imageManager.updateImage(y,u[I][f],!1):this.imageManager.addImage(y,u[I][f]),n&&(this._changedImages[y]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"})),o&&o(l)})}_unloadSprite(){for(let t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}_validateLayer(t){let n=this.sourceCaches[t.source];if(!n)return;let o=t.sourceLayer;if(!o)return;let l=n.getSource();(l.type==="geojson"||l.vectorLayerIds&&l.vectorLayerIds.indexOf(o)===-1)&&this.fire(new c.j(new Error(`Source layer "${o}" does not exist on source "${l.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){let n=this._serializedAllLayers();if(!t||t.length===0)return Object.values(n);let o=[];for(let l of t)n[l]&&o.push(n[l]);return o}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};let n=Object.keys(this._layers);for(let o of n){let l=this._layers[o];l.type!=="custom"&&(t[o]=l.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(let t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(let t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;let n=this._changed;if(this._changed){let l=Object.keys(this._updatedLayers),u=Object.keys(this._removedLayers);(l.length||u.length)&&this._updateWorkerLayers(l,u);for(let I in this._updatedSources){let m=this._updatedSources[I];if(m==="reload")this._reloadSource(I);else{if(m!=="clear")throw new Error(`Invalid action ${m}`);this._clearSource(I)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let I in this._updatedPaintProps)this._layers[I].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}let o={};for(let l in this.sourceCaches){let u=this.sourceCaches[l];o[l]=u.used,u.used=!1}for(let l of this._order){let u=this._layers[l];u.recalculate(t,this._availableImages),!u.isHidden(t.zoom)&&u.source&&(this.sourceCaches[u.source].used=!0)}for(let l in o){let u=this.sourceCaches[l];o[l]!==u.used&&u.fire(new c.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:l}))}this.light.recalculate(t),this.z=t.zoom,n&&this.fire(new c.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){let t=Object.keys(this._changedImages);if(t.length){for(let n in this.sourceCaches)this.sourceCaches[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,n={}){this._checkLoaded();let o=this.serialize();if(t=n.transformStyle?n.transformStyle(o,t):t,Pi(this,c.y(t)))return!1;(t=c.aD(t)).layers=c.aB(t.layers);let l=c.aE(o,t).filter(I=>!(I.command in Tr));if(l.length===0)return!1;let u=l.filter(I=>!(I.command in gs));if(u.length>0)throw new Error(`Unimplemented: ${u.map(I=>I.command).join(", ")}.`);for(let I of l)I.command!=="setTransition"&&this[I.command].apply(this,I.args);return this.stylesheet=t,this._serializedLayers=null,!0}addImage(t,n){if(this.getImage(t))return this.fire(new c.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,n),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new c.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,n,o={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(c.y.source,`sources.${t}`,n,null,o))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);let l=this.sourceCaches[t]=new es(t,n,this.dispatcher);l.style=this,l.setEventedParent(this,()=>({isSourceLoaded:l.loaded(),source:l.serialize(),sourceId:t})),l.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(let o in this._layers)if(this._layers[o].source===t)return this.fire(new c.j(new Error(`Source "${t}" cannot be removed while layer "${o}" is using it.`)));let n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new c.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);let o=this.sourceCaches[t].getSource();if(o.type!=="geojson")throw new Error(`geojsonSource.type is ${o.type}, which is !== 'geojson`);o.setData(n),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,n,o={}){this._checkLoaded();let l=t.id;if(this.getLayer(l))return void this.fire(new c.j(new Error(`Layer "${l}" already exists on this map.`)));let u;if(t.type==="custom"){if(Pi(this,c.aF(t)))return;u=c.aC(t)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(l,t.source),t=c.aD(t),t=c.e(t,{source:l})),this._validate(c.y.layer,`layers.${l}`,t,{arrayIndex:-1},o))return;u=c.aC(t),this._validateLayer(u),u.setEventedParent(this,{layer:{id:l}})}let I=n?this._order.indexOf(n):this._order.length;if(n&&I===-1)this.fire(new c.j(new Error(`Cannot add layer "${l}" before non-existing layer "${n}".`)));else{if(this._order.splice(I,0,l),this._layerOrderChanged=!0,this._layers[l]=u,this._removedLayers[l]&&u.source&&u.type!=="custom"){let m=this._removedLayers[l];delete this._removedLayers[l],m.type!==u.type?this._updatedSources[u.source]="clear":(this._updatedSources[u.source]="reload",this.sourceCaches[u.source].pause())}this._updateLayer(u),u.onAdd&&u.onAdd(this.map)}}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new c.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;let o=this._order.indexOf(t);this._order.splice(o,1);let l=n?this._order.indexOf(n):this._order.length;n&&l===-1?this.fire(new c.j(new Error(`Cannot move layer "${t}" before non-existing layer "${n}".`))):(this._order.splice(l,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();let n=this._layers[t];if(!n)return void this.fire(new c.j(new Error(`Cannot remove non-existing layer "${t}".`)));n.setEventedParent(null);let o=this._order.indexOf(t);this._order.splice(o,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,n,o){this._checkLoaded();let l=this.getLayer(t);l?l.minzoom===n&&l.maxzoom===o||(n!=null&&(l.minzoom=n),o!=null&&(l.maxzoom=o),this._updateLayer(l)):this.fire(new c.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,n,o={}){this._checkLoaded();let l=this.getLayer(t);if(l){if(!c.aG(l.filter,n))return n==null?(l.filter=void 0,void this._updateLayer(l)):void(this._validate(c.y.filter,`layers.${l.id}.filter`,n,null,o)||(l.filter=c.aD(n),this._updateLayer(l)))}else this.fire(new c.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return c.aD(this.getLayer(t).filter)}setLayoutProperty(t,n,o,l={}){this._checkLoaded();let u=this.getLayer(t);u?c.aG(u.getLayoutProperty(n),o)||(u.setLayoutProperty(n,o,l),this._updateLayer(u)):this.fire(new c.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,n){let o=this.getLayer(t);if(o)return o.getLayoutProperty(n);this.fire(new c.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,n,o,l={}){this._checkLoaded();let u=this.getLayer(t);u?c.aG(u.getPaintProperty(n),o)||(u.setPaintProperty(n,o,l)&&this._updateLayer(u),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new c.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,n){this._checkLoaded();let o=t.source,l=t.sourceLayer,u=this.sourceCaches[o];if(u===void 0)return void this.fire(new c.j(new Error(`The source '${o}' does not exist in the map's style.`)));let I=u.getSource().type;I==="geojson"&&l?this.fire(new c.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):I!=="vector"||l?(t.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),u.setFeatureState(l,t.id,n)):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,n){this._checkLoaded();let o=t.source,l=this.sourceCaches[o];if(l===void 0)return void this.fire(new c.j(new Error(`The source '${o}' does not exist in the map's style.`)));let u=l.getSource().type,I=u==="vector"?t.sourceLayer:void 0;u!=="vector"||I?n&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new c.j(new Error("A feature id is required to remove its specific state property."))):l.removeFeatureState(I,t.id,n):this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();let n=t.source,o=t.sourceLayer,l=this.sourceCaches[n];if(l!==void 0)return l.getSource().type!=="vector"||o?(t.id===void 0&&this.fire(new c.j(new Error("The feature id parameter must be provided."))),l.getFeatureState(o,t.id)):void this.fire(new c.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new c.j(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return c.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let t=c.aH(this.sourceCaches,u=>u.serialize()),n=this._serializeByIds(this._order),o=this.map.getTerrain()||void 0,l=this.stylesheet;return c.aI({version:l.version,name:l.name,metadata:l.metadata,light:l.light,center:l.center,zoom:l.zoom,bearing:l.bearing,pitch:l.pitch,sprite:l.sprite,glyphs:l.glyphs,transition:l.transition,sources:t,layers:n,terrain:o},u=>u!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){let n=I=>this._layers[I].type==="fill-extrusion",o={},l=[];for(let I=this._order.length-1;I>=0;I--){let m=this._order[I];if(n(m)){o[m]=I;for(let f of t){let y=f[m];if(y)for(let _ of y)l.push(_)}}}l.sort((I,m)=>m.intersectionZ-I.intersectionZ);let u=[];for(let I=this._order.length-1;I>=0;I--){let m=this._order[I];if(n(m))for(let f=l.length-1;f>=0;f--){let y=l[f].feature;if(o[y.layer.id]{let Be=$.featureSortOrder;if(Be){let Ze=Be.indexOf(pe.featureIndex);return Be.indexOf(ve.featureIndex)-Ze}return ve.featureIndex-pe.featureIndex});for(let pe of de)ie.push(pe)}}for(let $ in F)F[$].forEach(ge=>{let D=ge.feature,ie=y[m[$].source].getFeatureState(D.layer["source-layer"],D.id);D.source=D.layer.source,D.layer["source-layer"]&&(D.sourceLayer=D.layer["source-layer"]),D.state=ie});return F}(this._layers,I,this.sourceCaches,t,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(u)}querySourceFeatures(t,n){n&&n.filter&&this._validate(c.y.filter,"querySourceFeatures.filter",n.filter,null,n);let o=this.sourceCaches[t];return o?function(l,u){let I=l.getRenderableIds().map(y=>l.getTileByID(y)),m=[],f={};for(let y=0;y{Xn[l]=u})(t,n),n.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:n.workerSourceURL},o):o(null,null))}getLight(){return this.light.getLight()}setLight(t,n={}){this._checkLoaded();let o=this.light.getLight(),l=!1;for(let I in t)if(!c.aG(t[I],o[I])){l=!0;break}if(!l)return;let u={now:c.h.now(),transition:c.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,n),this.light.updateTransitions(u)}_validate(t,n,o,l,u={}){return(!u||u.validate!==!1)&&Pi(this,t.call(c.y,c.e({key:n,style:this.serialize(),value:o,styleSpec:c.v},l)))}_remove(t=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),c.aJ.off("pluginStateChange",this._rtlTextPluginCallback);for(let n in this._layers)this._layers[n].setEventedParent(null);for(let n in this.sourceCaches){let o=this.sourceCaches[n];o.setEventedParent(null),o.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(let n in this.sourceCaches)this.sourceCaches[n].update(t,this.map.terrain)}_generateCollisionBoxes(){for(let t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,n,o,l,u=!1){let I=!1,m=!1,f={};for(let y of this._order){let _=this._layers[y];if(_.type!=="symbol")continue;if(!f[_.source]){let B=this.sourceCaches[_.source];f[_.source]=B.getRenderableIds(!0).map(K=>B.getTileByID(K)).sort((K,F)=>F.tileID.overscaledZ-K.tileID.overscaledZ||(K.tileID.isLessThan(F.tileID)?-1:1))}let v=this.crossTileSymbolIndex.addLayer(_,f[_.source],t.center.lng);I=I||v}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((u=u||this._layerOrderChanged||o===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(c.h.now(),t.zoom))&&(this.pauseablePlacement=new Ln(t,this.map.terrain,this._order,u,n,o,l,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,f),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(c.h.now()),m=!0),I&&this.pauseablePlacement.placement.setStale()),m||I)for(let y of this._order){let _=this._layers[y];_.type==="symbol"&&this.placement.updateLayerOpacities(_,f[_.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(c.h.now())}_releaseSymbolFadeTiles(){for(let t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,n,o){this.imageManager.getImages(n.icons,o),this._updateTilesForChangedImages();let l=this.sourceCaches[n.source];l&&l.setDependencies(n.tileID.key,n.type,n.icons)}getGlyphs(t,n,o){this.glyphManager.getGlyphs(n.stacks,o);let l=this.sourceCaches[n.source];l&&l.setDependencies(n.tileID.key,n.type,[""])}getResource(t,n,o){return c.m(n,o)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,n={}){this._checkLoaded(),t&&this._validate(c.y.glyphs,"glyphs",t,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,n,o={},l){this._checkLoaded();let u=[{id:t,url:n}],I=[..._t(this.stylesheet.sprite),...u];this._validate(c.y.sprite,"sprite",I,null,o)||(this.stylesheet.sprite=I,this._loadSprite(u,!0,l))}removeSprite(t){this._checkLoaded();let n=_t(this.stylesheet.sprite);if(n.find(o=>o.id===t)){if(this._spritesImagesIds[t])for(let o of this._spritesImagesIds[t])this.imageManager.removeImage(o),this._changedImages[o]=!0;n.splice(n.findIndex(o=>o.id===t),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new c.k("data",{dataType:"style"}))}else this.fire(new c.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return _t(this.stylesheet.sprite)}setSprite(t,n={},o){this._checkLoaded(),t&&this._validate(c.y.sprite,"sprite",t,null,n)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,o):(this._unloadSprite(),o&&o(null)))}}bi.registerForPluginStateChange=c.aK;var pr=c.Q([{name:"a_pos",type:"Int16",components:2}]),Cn="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 $t={prelude:Wt(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +vec2 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 +);}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;} +#ifdef TERRAIN3D +uniform 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; +#endif +const 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) { +#ifdef TERRAIN3D +highp 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)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +vec3 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; +#else +return 1.0; +#endif +}float ele(vec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +vec2 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; +#else +return 0.0; +#endif +}`),background:Wt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Wt(`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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"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:Wt(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 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:Wt("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:Wt(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float 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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 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:Wt(`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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"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:Wt("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:Wt("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:Wt("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:Wt(`#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_FragColor=color*opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Wt(`varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; +#pragma mapbox: define highp vec4 outline_color +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 outline_color +#pragma mapbox: initialize lowp float opacity +gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Wt(`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; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 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:Wt(`#ifdef GL_ES +precision highp float; +#endif +uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +vec2 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 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:Wt(`varying vec4 v_color;void main() {gl_FragColor=v_color; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec4 v_color; +#pragma mapbox: define highp float base +#pragma mapbox: define highp float height +#pragma mapbox: define highp vec4 color +void main() { +#pragma mapbox: initialize highp float base +#pragma mapbox: initialize highp float height +#pragma mapbox: initialize highp vec4 color +vec3 normal=a_normal_ed.xyz; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=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:Wt(`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; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; +#pragma mapbox: define lowp float base +#pragma mapbox: define lowp float height +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float base +#pragma mapbox: initialize lowp float height +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +vec2 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; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=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 +? a_pos +: 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:Wt(`#ifdef GL_ES +precision highp float; +#endif +uniform 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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"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:Wt(`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; +#define PI 3.141592653589793 +void 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"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:Wt(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute 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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float 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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float 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; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:Wt(`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; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +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);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +attribute 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; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +float 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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float 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; +#endif +v_width2=vec2(outset,inset);}`),linePattern:Wt(`#ifdef GL_ES +precision highp float; +#endif +uniform 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; +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +vec2 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute 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; +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +#pragma mapbox: define lowp vec4 pattern_from +#pragma mapbox: define lowp vec4 pattern_to +#pragma mapbox: define lowp float pixel_ratio_from +#pragma mapbox: define lowp float pixel_ratio_to +void main() { +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +#pragma mapbox: initialize mediump vec4 pattern_from +#pragma mapbox: initialize mediump vec4 pattern_to +#pragma mapbox: initialize lowp float pixel_ratio_from +#pragma mapbox: initialize lowp float pixel_ratio_to +float 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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float 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; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Wt(`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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +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 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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,` +#define scale 0.015873016 +#define LINE_DISTANCE_SCALE 2.0 +attribute 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; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define mediump float gapwidth +#pragma mapbox: define lowp float offset +#pragma mapbox: define mediump float width +#pragma mapbox: define lowp float floorwidth +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize mediump float gapwidth +#pragma mapbox: initialize lowp float offset +#pragma mapbox: initialize mediump float width +#pragma mapbox: initialize lowp float floorwidth +float 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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +float 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; +#endif +v_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:Wt(`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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"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:Wt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define lowp float opacity +void main() { +#pragma mapbox: initialize lowp float opacity +vec2 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 ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_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:Wt(`#define SDF_PX 8.0 +uniform 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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float 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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 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 ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_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:Wt(`#define SDF_PX 8.0 +#define SDF 1.0 +#define ICON 0.0 +uniform 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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +float 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; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +return;}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); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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; +#pragma mapbox: define highp vec4 fill_color +#pragma mapbox: define highp vec4 halo_color +#pragma mapbox: define lowp float opacity +#pragma mapbox: define lowp float halo_width +#pragma mapbox: define lowp float halo_blur +void main() { +#pragma mapbox: initialize highp vec4 fill_color +#pragma mapbox: initialize highp vec4 halo_color +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize lowp float halo_width +#pragma mapbox: initialize lowp float halo_blur +vec2 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 ? +camera_to_anchor_distance/u_camera_to_center_distance : +u_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:Wt("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Cn),terrainDepth:Wt("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);}",Cn),terrainCoords:Wt("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);}",Cn)};function Wt(g,t){let n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,o=t.match(/attribute ([\w]+) ([\w]+)/g),l=g.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),u=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),I=u?u.concat(l):l,m={};return{fragmentSource:g=g.replace(n,(f,y,_,v,B)=>(m[B]=!0,y==="define"?` +#ifndef HAS_UNIFORM_u_${B} +varying ${_} ${v} ${B}; +#else +uniform ${_} ${v} u_${B}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${B} + ${_} ${v} ${B} = u_${B}; +#endif +`)),vertexSource:t=t.replace(n,(f,y,_,v,B)=>{let K=v==="float"?"vec2":"vec4",F=B.match(/color/)?"color":K;return m[B]?y==="define"?` +#ifndef HAS_UNIFORM_u_${B} +uniform lowp float u_${B}_t; +attribute ${_} ${K} a_${B}; +varying ${_} ${v} ${B}; +#else +uniform ${_} ${v} u_${B}; +#endif +`:F==="vec4"?` +#ifndef HAS_UNIFORM_u_${B} + ${B} = a_${B}; +#else + ${_} ${v} ${B} = u_${B}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${B} + ${B} = unpack_mix_${F}(a_${B}, u_${B}_t); +#else + ${_} ${v} ${B} = u_${B}; +#endif +`:y==="define"?` +#ifndef HAS_UNIFORM_u_${B} +uniform lowp float u_${B}_t; +attribute ${_} ${K} a_${B}; +#else +uniform ${_} ${v} u_${B}; +#endif +`:F==="vec4"?` +#ifndef HAS_UNIFORM_u_${B} + ${_} ${v} ${B} = a_${B}; +#else + ${_} ${v} ${B} = u_${B}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${B} + ${_} ${v} ${B} = unpack_mix_${F}(a_${B}, u_${B}_t); +#else + ${_} ${v} ${B} = u_${B}; +#endif +`}),staticAttributes:o,staticUniforms:I}}class Bn{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,o,l,u,I,m,f,y){this.context=t;let _=this.boundPaintVertexBuffers.length!==l.length;for(let v=0;!_&&v({u_depth:new c.aL(pe,ve.u_depth),u_terrain:new c.aL(pe,ve.u_terrain),u_terrain_dim:new c.aM(pe,ve.u_terrain_dim),u_terrain_matrix:new c.aN(pe,ve.u_terrain_matrix),u_terrain_unpack:new c.aO(pe,ve.u_terrain_unpack),u_terrain_exaggeration:new c.aM(pe,ve.u_terrain_exaggeration)}))(t,de),this.binderUniforms=o?o.getUniforms(t,de):[]}draw(t,n,o,l,u,I,m,f,y,_,v,B,K,F,L,J,$,ge){let D=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(o),t.setStencilMode(l),t.setColorMode(u),t.setCullFace(I),f){t.activeTexture.set(D.TEXTURE2),D.bindTexture(D.TEXTURE_2D,f.depthTexture),t.activeTexture.set(D.TEXTURE3),D.bindTexture(D.TEXTURE_2D,f.texture);for(let de in this.terrainUniforms)this.terrainUniforms[de].set(f[de])}for(let de in this.fixedUniforms)this.fixedUniforms[de].set(m[de]);L&&L.setUniforms(t,this.binderUniforms,K,{zoom:F});let ie=0;switch(n){case D.LINES:ie=2;break;case D.TRIANGLES:ie=3;break;case D.LINE_STRIP:ie=1}for(let de of B.get()){let pe=de.vaos||(de.vaos={});(pe[y]||(pe[y]=new Bn)).bind(t,this,_,L?L.getPaintVertexBuffers():[],v,de.vertexOffset,J,$,ge),D.drawElements(n,de.primitiveLength*ie,D.UNSIGNED_SHORT,de.primitiveOffset*ie*2)}}}function z(g,t,n){let o=1/q(n,1,t.transform.tileZoom),l=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,t.transform.tileZoom)/l,I=u*(n.tileID.canonical.x+n.tileID.wrap*l),m=u*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[o,g.fromScale,g.toScale],u_fade:g.t,u_pixel_coord_upper:[I>>16,m>>16],u_pixel_coord_lower:[65535&I,65535&m]}}let V=(g,t,n,o)=>{let l=t.style.light,u=l.properties.get("position"),I=[u.x,u.y,u.z],m=function(){var y=new c.A(9);return c.A!=Float32Array&&(y[1]=0,y[2]=0,y[3]=0,y[5]=0,y[6]=0,y[7]=0),y[0]=1,y[4]=1,y[8]=1,y}();l.properties.get("anchor")==="viewport"&&function(y,_){var v=Math.sin(_),B=Math.cos(_);y[0]=B,y[1]=v,y[2]=0,y[3]=-v,y[4]=B,y[5]=0,y[6]=0,y[7]=0,y[8]=1}(m,-t.transform.angle),function(y,_,v){var B=_[0],K=_[1],F=_[2];y[0]=B*v[0]+K*v[3]+F*v[6],y[1]=B*v[1]+K*v[4]+F*v[7],y[2]=B*v[2]+K*v[5]+F*v[8]}(I,I,m);let f=l.properties.get("color");return{u_matrix:g,u_lightpos:I,u_lightintensity:l.properties.get("intensity"),u_lightcolor:[f.r,f.g,f.b],u_vertical_gradient:+n,u_opacity:o}},U=(g,t,n,o,l,u,I)=>c.e(V(g,t,n,o),z(u,t,I),{u_height_factor:-Math.pow(2,l.overscaledZ)/I.tileSize/8}),j=g=>({u_matrix:g}),se=(g,t,n,o)=>c.e(j(g),z(n,t,o)),ce=(g,t)=>({u_matrix:g,u_world:t}),xe=(g,t,n,o,l)=>c.e(se(g,t,n,o),{u_world:l}),ye=(g,t,n,o)=>{let l=g.transform,u,I;if(o.paint.get("circle-pitch-alignment")==="map"){let m=q(n,1,l.zoom);u=!0,I=[m,m]}else u=!1,I=l.pixelsToGLUnits;return{u_camera_to_center_distance:l.cameraToCenterDistance,u_scale_with_map:+(o.paint.get("circle-pitch-scale")==="map"),u_matrix:g.translatePosMatrix(t.posMatrix,n,o.paint.get("circle-translate"),o.paint.get("circle-translate-anchor")),u_pitch_with_map:+u,u_device_pixel_ratio:g.pixelRatio,u_extrude_scale:I}},me=(g,t,n)=>{let o=q(n,1,t.zoom),l=Math.pow(2,t.zoom-n.tileID.overscaledZ),u=n.tileID.overscaleFactor();return{u_matrix:g,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:o,u_extrude_scale:[t.pixelsToGLUnits[0]/(o*l),t.pixelsToGLUnits[1]/(o*l)],u_overscale_factor:u}},le=(g,t,n=1)=>({u_matrix:g,u_color:t,u_overlay:0,u_overlay_scale:n}),Ae=g=>({u_matrix:g}),be=(g,t,n,o)=>({u_matrix:g,u_extrude_scale:q(t,1,n),u_intensity:o});function ke(g,t){let n=Math.pow(2,t.canonical.z),o=t.canonical.y;return[new c.U(0,o/n).toLngLat().lat,new c.U(0,(o+1)/n).toLngLat().lat]}let ot=(g,t,n,o)=>{let l=g.transform;return{u_matrix:mt(g,t,n,o),u_ratio:1/q(t,1,l.zoom),u_device_pixel_ratio:g.pixelRatio,u_units_to_pixels:[1/l.pixelsToGLUnits[0],1/l.pixelsToGLUnits[1]]}},It=(g,t,n,o,l)=>c.e(ot(g,t,n,l),{u_image:0,u_image_height:o}),Je=(g,t,n,o,l)=>{let u=g.transform,I=Ue(t,u);return{u_matrix:mt(g,t,n,l),u_texsize:t.imageAtlasTexture.size,u_ratio:1/q(t,1,u.zoom),u_device_pixel_ratio:g.pixelRatio,u_image:0,u_scale:[I,o.fromScale,o.toScale],u_fade:o.t,u_units_to_pixels:[1/u.pixelsToGLUnits[0],1/u.pixelsToGLUnits[1]]}},Re=(g,t,n,o,l,u)=>{let I=g.lineAtlas,m=Ue(t,g.transform),f=n.layout.get("line-cap")==="round",y=I.getDash(o.from,f),_=I.getDash(o.to,f),v=y.width*l.fromScale,B=_.width*l.toScale;return c.e(ot(g,t,n,u),{u_patternscale_a:[m/v,-y.height/2],u_patternscale_b:[m/B,-_.height/2],u_sdfgamma:I.width/(256*Math.min(v,B)*g.pixelRatio)/2,u_image:0,u_tex_y_a:y.y,u_tex_y_b:_.y,u_mix:l.t})};function Ue(g,t){return 1/q(g,1,t.tileZoom)}function mt(g,t,n,o){return g.translatePosMatrix(o?o.posMatrix:t.tileID.posMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}let ft=(g,t,n,o,l)=>{return{u_matrix:g,u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:o.mix,u_opacity:o.opacity*l.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:l.paint.get("raster-brightness-min"),u_brightness_high:l.paint.get("raster-brightness-max"),u_saturation_factor:(I=l.paint.get("raster-saturation"),I>0?1-1/(1.001-I):-I),u_contrast_factor:(u=l.paint.get("raster-contrast"),u>0?1/(1-u):1+u),u_spin_weights:Ft(l.paint.get("raster-hue-rotate"))};var u,I};function Ft(g){g*=Math.PI/180;let t=Math.sin(g),n=Math.cos(g);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}let Ht=(g,t,n,o,l,u,I,m,f,y)=>{let _=l.transform;return{u_is_size_zoom_constant:+(g==="constant"||g==="source"),u_is_size_feature_constant:+(g==="constant"||g==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:_.cameraToCenterDistance,u_pitch:_.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:_.width/_.height,u_fade_change:l.options.fadeDuration?l.symbolFadeChange:1,u_matrix:u,u_label_plane_matrix:I,u_coord_matrix:m,u_is_text:+f,u_pitch_with_map:+o,u_texsize:y,u_texture:0}},Ot=(g,t,n,o,l,u,I,m,f,y,_)=>{let v=l.transform;return c.e(Ht(g,t,n,o,l,u,I,m,f,y),{u_gamma_scale:o?Math.cos(v._pitch)*v.cameraToCenterDistance:1,u_device_pixel_ratio:l.pixelRatio,u_is_halo:+_})},oi=(g,t,n,o,l,u,I,m,f,y)=>c.e(Ot(g,t,n,o,l,u,I,m,!0,f,!0),{u_texsize_icon:y,u_texture_icon:1}),Wi=(g,t,n)=>({u_matrix:g,u_opacity:t,u_color:n}),_i=(g,t,n,o,l,u)=>c.e(function(I,m,f,y){let _=f.imageManager.getPattern(I.from.toString()),v=f.imageManager.getPattern(I.to.toString()),{width:B,height:K}=f.imageManager.getPixelSize(),F=Math.pow(2,y.tileID.overscaledZ),L=y.tileSize*Math.pow(2,f.transform.tileZoom)/F,J=L*(y.tileID.canonical.x+y.tileID.wrap*F),$=L*y.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:_.tl,u_pattern_br_a:_.br,u_pattern_tl_b:v.tl,u_pattern_br_b:v.br,u_texsize:[B,K],u_mix:m.t,u_pattern_size_a:_.displaySize,u_pattern_size_b:v.displaySize,u_scale_a:m.fromScale,u_scale_b:m.toScale,u_tile_units_to_pixels:1/q(y,1,f.transform.tileZoom),u_pixel_coord_upper:[J>>16,$>>16],u_pixel_coord_lower:[65535&J,65535&$]}}(o,u,n,l),{u_matrix:g,u_opacity:t}),hs={fillExtrusion:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_lightpos:new c.aP(g,t.u_lightpos),u_lightintensity:new c.aM(g,t.u_lightintensity),u_lightcolor:new c.aP(g,t.u_lightcolor),u_vertical_gradient:new c.aM(g,t.u_vertical_gradient),u_opacity:new c.aM(g,t.u_opacity)}),fillExtrusionPattern:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_lightpos:new c.aP(g,t.u_lightpos),u_lightintensity:new c.aM(g,t.u_lightintensity),u_lightcolor:new c.aP(g,t.u_lightcolor),u_vertical_gradient:new c.aM(g,t.u_vertical_gradient),u_height_factor:new c.aM(g,t.u_height_factor),u_image:new c.aL(g,t.u_image),u_texsize:new c.aQ(g,t.u_texsize),u_pixel_coord_upper:new c.aQ(g,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aQ(g,t.u_pixel_coord_lower),u_scale:new c.aP(g,t.u_scale),u_fade:new c.aM(g,t.u_fade),u_opacity:new c.aM(g,t.u_opacity)}),fill:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix)}),fillPattern:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_image:new c.aL(g,t.u_image),u_texsize:new c.aQ(g,t.u_texsize),u_pixel_coord_upper:new c.aQ(g,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aQ(g,t.u_pixel_coord_lower),u_scale:new c.aP(g,t.u_scale),u_fade:new c.aM(g,t.u_fade)}),fillOutline:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_world:new c.aQ(g,t.u_world)}),fillOutlinePattern:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_world:new c.aQ(g,t.u_world),u_image:new c.aL(g,t.u_image),u_texsize:new c.aQ(g,t.u_texsize),u_pixel_coord_upper:new c.aQ(g,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aQ(g,t.u_pixel_coord_lower),u_scale:new c.aP(g,t.u_scale),u_fade:new c.aM(g,t.u_fade)}),circle:(g,t)=>({u_camera_to_center_distance:new c.aM(g,t.u_camera_to_center_distance),u_scale_with_map:new c.aL(g,t.u_scale_with_map),u_pitch_with_map:new c.aL(g,t.u_pitch_with_map),u_extrude_scale:new c.aQ(g,t.u_extrude_scale),u_device_pixel_ratio:new c.aM(g,t.u_device_pixel_ratio),u_matrix:new c.aN(g,t.u_matrix)}),collisionBox:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_camera_to_center_distance:new c.aM(g,t.u_camera_to_center_distance),u_pixels_to_tile_units:new c.aM(g,t.u_pixels_to_tile_units),u_extrude_scale:new c.aQ(g,t.u_extrude_scale),u_overscale_factor:new c.aM(g,t.u_overscale_factor)}),collisionCircle:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_inv_matrix:new c.aN(g,t.u_inv_matrix),u_camera_to_center_distance:new c.aM(g,t.u_camera_to_center_distance),u_viewport_size:new c.aQ(g,t.u_viewport_size)}),debug:(g,t)=>({u_color:new c.aR(g,t.u_color),u_matrix:new c.aN(g,t.u_matrix),u_overlay:new c.aL(g,t.u_overlay),u_overlay_scale:new c.aM(g,t.u_overlay_scale)}),clippingMask:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix)}),heatmap:(g,t)=>({u_extrude_scale:new c.aM(g,t.u_extrude_scale),u_intensity:new c.aM(g,t.u_intensity),u_matrix:new c.aN(g,t.u_matrix)}),heatmapTexture:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_world:new c.aQ(g,t.u_world),u_image:new c.aL(g,t.u_image),u_color_ramp:new c.aL(g,t.u_color_ramp),u_opacity:new c.aM(g,t.u_opacity)}),hillshade:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_image:new c.aL(g,t.u_image),u_latrange:new c.aQ(g,t.u_latrange),u_light:new c.aQ(g,t.u_light),u_shadow:new c.aR(g,t.u_shadow),u_highlight:new c.aR(g,t.u_highlight),u_accent:new c.aR(g,t.u_accent)}),hillshadePrepare:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_image:new c.aL(g,t.u_image),u_dimension:new c.aQ(g,t.u_dimension),u_zoom:new c.aM(g,t.u_zoom),u_unpack:new c.aO(g,t.u_unpack)}),line:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_ratio:new c.aM(g,t.u_ratio),u_device_pixel_ratio:new c.aM(g,t.u_device_pixel_ratio),u_units_to_pixels:new c.aQ(g,t.u_units_to_pixels)}),lineGradient:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_ratio:new c.aM(g,t.u_ratio),u_device_pixel_ratio:new c.aM(g,t.u_device_pixel_ratio),u_units_to_pixels:new c.aQ(g,t.u_units_to_pixels),u_image:new c.aL(g,t.u_image),u_image_height:new c.aM(g,t.u_image_height)}),linePattern:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_texsize:new c.aQ(g,t.u_texsize),u_ratio:new c.aM(g,t.u_ratio),u_device_pixel_ratio:new c.aM(g,t.u_device_pixel_ratio),u_image:new c.aL(g,t.u_image),u_units_to_pixels:new c.aQ(g,t.u_units_to_pixels),u_scale:new c.aP(g,t.u_scale),u_fade:new c.aM(g,t.u_fade)}),lineSDF:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_ratio:new c.aM(g,t.u_ratio),u_device_pixel_ratio:new c.aM(g,t.u_device_pixel_ratio),u_units_to_pixels:new c.aQ(g,t.u_units_to_pixels),u_patternscale_a:new c.aQ(g,t.u_patternscale_a),u_patternscale_b:new c.aQ(g,t.u_patternscale_b),u_sdfgamma:new c.aM(g,t.u_sdfgamma),u_image:new c.aL(g,t.u_image),u_tex_y_a:new c.aM(g,t.u_tex_y_a),u_tex_y_b:new c.aM(g,t.u_tex_y_b),u_mix:new c.aM(g,t.u_mix)}),raster:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_tl_parent:new c.aQ(g,t.u_tl_parent),u_scale_parent:new c.aM(g,t.u_scale_parent),u_buffer_scale:new c.aM(g,t.u_buffer_scale),u_fade_t:new c.aM(g,t.u_fade_t),u_opacity:new c.aM(g,t.u_opacity),u_image0:new c.aL(g,t.u_image0),u_image1:new c.aL(g,t.u_image1),u_brightness_low:new c.aM(g,t.u_brightness_low),u_brightness_high:new c.aM(g,t.u_brightness_high),u_saturation_factor:new c.aM(g,t.u_saturation_factor),u_contrast_factor:new c.aM(g,t.u_contrast_factor),u_spin_weights:new c.aP(g,t.u_spin_weights)}),symbolIcon:(g,t)=>({u_is_size_zoom_constant:new c.aL(g,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aL(g,t.u_is_size_feature_constant),u_size_t:new c.aM(g,t.u_size_t),u_size:new c.aM(g,t.u_size),u_camera_to_center_distance:new c.aM(g,t.u_camera_to_center_distance),u_pitch:new c.aM(g,t.u_pitch),u_rotate_symbol:new c.aL(g,t.u_rotate_symbol),u_aspect_ratio:new c.aM(g,t.u_aspect_ratio),u_fade_change:new c.aM(g,t.u_fade_change),u_matrix:new c.aN(g,t.u_matrix),u_label_plane_matrix:new c.aN(g,t.u_label_plane_matrix),u_coord_matrix:new c.aN(g,t.u_coord_matrix),u_is_text:new c.aL(g,t.u_is_text),u_pitch_with_map:new c.aL(g,t.u_pitch_with_map),u_texsize:new c.aQ(g,t.u_texsize),u_texture:new c.aL(g,t.u_texture)}),symbolSDF:(g,t)=>({u_is_size_zoom_constant:new c.aL(g,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aL(g,t.u_is_size_feature_constant),u_size_t:new c.aM(g,t.u_size_t),u_size:new c.aM(g,t.u_size),u_camera_to_center_distance:new c.aM(g,t.u_camera_to_center_distance),u_pitch:new c.aM(g,t.u_pitch),u_rotate_symbol:new c.aL(g,t.u_rotate_symbol),u_aspect_ratio:new c.aM(g,t.u_aspect_ratio),u_fade_change:new c.aM(g,t.u_fade_change),u_matrix:new c.aN(g,t.u_matrix),u_label_plane_matrix:new c.aN(g,t.u_label_plane_matrix),u_coord_matrix:new c.aN(g,t.u_coord_matrix),u_is_text:new c.aL(g,t.u_is_text),u_pitch_with_map:new c.aL(g,t.u_pitch_with_map),u_texsize:new c.aQ(g,t.u_texsize),u_texture:new c.aL(g,t.u_texture),u_gamma_scale:new c.aM(g,t.u_gamma_scale),u_device_pixel_ratio:new c.aM(g,t.u_device_pixel_ratio),u_is_halo:new c.aL(g,t.u_is_halo)}),symbolTextAndIcon:(g,t)=>({u_is_size_zoom_constant:new c.aL(g,t.u_is_size_zoom_constant),u_is_size_feature_constant:new c.aL(g,t.u_is_size_feature_constant),u_size_t:new c.aM(g,t.u_size_t),u_size:new c.aM(g,t.u_size),u_camera_to_center_distance:new c.aM(g,t.u_camera_to_center_distance),u_pitch:new c.aM(g,t.u_pitch),u_rotate_symbol:new c.aL(g,t.u_rotate_symbol),u_aspect_ratio:new c.aM(g,t.u_aspect_ratio),u_fade_change:new c.aM(g,t.u_fade_change),u_matrix:new c.aN(g,t.u_matrix),u_label_plane_matrix:new c.aN(g,t.u_label_plane_matrix),u_coord_matrix:new c.aN(g,t.u_coord_matrix),u_is_text:new c.aL(g,t.u_is_text),u_pitch_with_map:new c.aL(g,t.u_pitch_with_map),u_texsize:new c.aQ(g,t.u_texsize),u_texsize_icon:new c.aQ(g,t.u_texsize_icon),u_texture:new c.aL(g,t.u_texture),u_texture_icon:new c.aL(g,t.u_texture_icon),u_gamma_scale:new c.aM(g,t.u_gamma_scale),u_device_pixel_ratio:new c.aM(g,t.u_device_pixel_ratio),u_is_halo:new c.aL(g,t.u_is_halo)}),background:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_opacity:new c.aM(g,t.u_opacity),u_color:new c.aR(g,t.u_color)}),backgroundPattern:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_opacity:new c.aM(g,t.u_opacity),u_image:new c.aL(g,t.u_image),u_pattern_tl_a:new c.aQ(g,t.u_pattern_tl_a),u_pattern_br_a:new c.aQ(g,t.u_pattern_br_a),u_pattern_tl_b:new c.aQ(g,t.u_pattern_tl_b),u_pattern_br_b:new c.aQ(g,t.u_pattern_br_b),u_texsize:new c.aQ(g,t.u_texsize),u_mix:new c.aM(g,t.u_mix),u_pattern_size_a:new c.aQ(g,t.u_pattern_size_a),u_pattern_size_b:new c.aQ(g,t.u_pattern_size_b),u_scale_a:new c.aM(g,t.u_scale_a),u_scale_b:new c.aM(g,t.u_scale_b),u_pixel_coord_upper:new c.aQ(g,t.u_pixel_coord_upper),u_pixel_coord_lower:new c.aQ(g,t.u_pixel_coord_lower),u_tile_units_to_pixels:new c.aM(g,t.u_tile_units_to_pixels)}),terrain:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_texture:new c.aL(g,t.u_texture),u_ele_delta:new c.aM(g,t.u_ele_delta)}),terrainDepth:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_ele_delta:new c.aM(g,t.u_ele_delta)}),terrainCoords:(g,t)=>({u_matrix:new c.aN(g,t.u_matrix),u_texture:new c.aL(g,t.u_texture),u_terrain_coords_id:new c.aM(g,t.u_terrain_coords_id),u_ele_delta:new c.aM(g,t.u_ele_delta)})};class qn{constructor(t,n,o){this.context=t;let l=t.gl;this.buffer=l.createBuffer(),this.dynamicDraw=Boolean(o),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),l.bufferData(l.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?l.DYNAMIC_DRAW:l.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let n=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Wr={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class to{constructor(t,n,o,l){this.length=n.length,this.attributes=o,this.itemSize=n.bytesPerElement,this.dynamicDraw=l,this.context=t;let u=t.gl;this.buffer=u.createBuffer(),t.bindVertexBuffer.set(this.buffer),u.bufferData(u.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?u.DYNAMIC_DRAW:u.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);let n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let o=0;o0){let Te=c.Z(),je=ve;c.aU(Te,pe.placementInvProjMatrix,g.transform.glCoordMatrix),c.aU(Te,Te,pe.placementViewportMatrix),_.push({circleArray:Ze,circleOffset:B,transform:je,invTransform:Te,coord:ie}),v+=Ze.length/4,B=v}Be&&y.draw(m,f.LINES,Rt.disabled,hi.disabled,g.colorModeForRenderPass(),ai.disabled,me(ve,g.transform,de),g.style.map.terrain&&g.style.map.terrain.getTerrainData(ie),n.id,Be.layoutVertexBuffer,Be.indexBuffer,Be.segments,null,g.transform.zoom,null,null,Be.collisionVertexBuffer)}if(!I||!_.length)return;let K=g.useProgram("collisionCircle"),F=new c.aV;F.resize(4*v),F._trim();let L=0;for(let D of _)for(let ie=0;ie=0&&(F[J.associatedIconIndex]={shiftedAnchor:St,angle:Xe})}else T(J.numGlyphs,B)}if(y){K.clear();let L=g.icon.placedSymbolArray;for(let J=0;Jg.style.map.terrain.getElevation(Be,ws,Ai):null,zi=n.layout.get("text-rotation-alignment")==="map";ze(Te,Be.posMatrix,g,l,ii,An,J,y,zi,fi)}let rr=g.translatePosMatrix(Be.posMatrix,Ze,u,I),wr=$||l&&pe||Nn?Eo:ii,is=g.translatePosMatrix(An,Ze,u,I,!0),Ui=Xe&&n.paint.get(l?"text-halo-width":"icon-halo-width").constantOr(1)!==0,ds;ds=Xe?Te.iconsInText?oi(lt.kind,xt,ge,J,g,rr,wr,is,Zt,Ji):Ot(lt.kind,xt,ge,J,g,rr,wr,is,l,Zt,!0):Ht(lt.kind,xt,ge,J,g,rr,wr,is,l,Zt);let or={program:Yt,buffers:je,uniformValues:ds,atlasTexture:Ci,atlasTextureIcon:xi,atlasInterpolation:jt,atlasInterpolationIcon:Oi,isSDF:Xe,hasHalo:Ui};if(D&&Te.canOverlap){ie=!0;let fi=je.segments.get();for(let zi of fi)ve.push({segments:new c.S([zi]),sortKey:zi.sortKey,state:or,terrainData:bt})}else ve.push({segments:je.segments,sortKey:0,state:or,terrainData:bt})}ie&&ve.sort((Be,Ze)=>Be.sortKey-Ze.sortKey);for(let Be of ve){let Ze=Be.state;if(B.activeTexture.set(K.TEXTURE0),Ze.atlasTexture.bind(Ze.atlasInterpolation,K.CLAMP_TO_EDGE),Ze.atlasTextureIcon&&(B.activeTexture.set(K.TEXTURE1),Ze.atlasTextureIcon&&Ze.atlasTextureIcon.bind(Ze.atlasInterpolationIcon,K.CLAMP_TO_EDGE)),Ze.isSDF){let Te=Ze.uniformValues;Ze.hasHalo&&(Te.u_is_halo=1,Yo(Ze.buffers,Be.segments,n,g,Ze.program,de,_,v,Te,Be.terrainData)),Te.u_is_halo=0}Yo(Ze.buffers,Be.segments,n,g,Ze.program,de,_,v,Ze.uniformValues,Be.terrainData)}}function Yo(g,t,n,o,l,u,I,m,f,y){let _=o.context;l.draw(_,_.gl.TRIANGLES,u,I,m,ai.disabled,f,y,n.id,g.layoutVertexBuffer,g.indexBuffer,t,n.paint,o.transform.zoom,g.programConfigurations.get(n.id),g.dynamicLayoutVertexBuffer,g.opacityVertexBuffer)}function zr(g,t,n,o,l){if(!n||!o||!o.imageAtlas)return;let u=o.imageAtlas.patternPositions,I=u[n.to.toString()],m=u[n.from.toString()];if(!I&&m&&(I=m),!m&&I&&(m=I),!I||!m){let f=l.getPaintProperty(t);I=u[f],m=u[f]}I&&m&&g.setConstantPatternPositions(I,m)}function Mr(g,t,n,o,l,u,I){let m=g.context.gl,f="fill-pattern",y=n.paint.get(f),_=y&&y.constantOr(1),v=n.getCrossfadeParameters(),B,K,F,L,J;I?(K=_&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",B=m.LINES):(K=_?"fillPattern":"fill",B=m.TRIANGLES);let $=y.constantOr(null);for(let ge of o){let D=t.getTile(ge);if(_&&!D.patternsLoaded())continue;let ie=D.getBucket(n);if(!ie)continue;let de=ie.programConfigurations.get(n.id),pe=g.useProgram(K,de),ve=g.style.map.terrain&&g.style.map.terrain.getTerrainData(ge);_&&(g.context.activeTexture.set(m.TEXTURE0),D.imageAtlasTexture.bind(m.LINEAR,m.CLAMP_TO_EDGE),de.updatePaintBuffers(v)),zr(de,f,$,D,n);let Be=ve?ge:null,Ze=g.translatePosMatrix(Be?Be.posMatrix:ge.posMatrix,D,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(I){L=ie.indexBuffer2,J=ie.segments2;let Te=[m.drawingBufferWidth,m.drawingBufferHeight];F=K==="fillOutlinePattern"&&_?xe(Ze,g,v,D,Te):ce(Ze,Te)}else L=ie.indexBuffer,J=ie.segments,F=_?se(Ze,g,v,D):j(Ze);pe.draw(g.context,B,l,g.stencilModeForClipping(ge),u,ai.disabled,F,ve,n.id,ie.layoutVertexBuffer,L,J,n.paint,g.transform.zoom,de)}}function Fr(g,t,n,o,l,u,I){let m=g.context,f=m.gl,y="fill-extrusion-pattern",_=n.paint.get(y),v=_.constantOr(1),B=n.getCrossfadeParameters(),K=n.paint.get("fill-extrusion-opacity"),F=_.constantOr(null);for(let L of o){let J=t.getTile(L),$=J.getBucket(n);if(!$)continue;let ge=g.style.map.terrain&&g.style.map.terrain.getTerrainData(L),D=$.programConfigurations.get(n.id),ie=g.useProgram(v?"fillExtrusionPattern":"fillExtrusion",D);v&&(g.context.activeTexture.set(f.TEXTURE0),J.imageAtlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),D.updatePaintBuffers(B)),zr(D,y,F,J,n);let de=g.translatePosMatrix(L.posMatrix,J,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),pe=n.paint.get("fill-extrusion-vertical-gradient"),ve=v?U(de,g,pe,K,L,B,J):V(de,g,pe,K);ie.draw(m,m.gl.TRIANGLES,l,u,I,ai.backCCW,ve,ge,n.id,$.layoutVertexBuffer,$.indexBuffer,$.segments,n.paint,g.transform.zoom,D,g.style.map.terrain&&$.centroidVertexBuffer)}}function El(g,t,n,o,l,u,I){let m=g.context,f=m.gl,y=n.fbo;if(!y)return;let _=g.useProgram("hillshade"),v=g.style.map.terrain&&g.style.map.terrain.getTerrainData(t);m.activeTexture.set(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,y.colorAttachment.get()),_.draw(m,f.TRIANGLES,l,u,I,ai.disabled,((B,K,F,L)=>{let J=F.paint.get("hillshade-shadow-color"),$=F.paint.get("hillshade-highlight-color"),ge=F.paint.get("hillshade-accent-color"),D=F.paint.get("hillshade-illumination-direction")*(Math.PI/180);F.paint.get("hillshade-illumination-anchor")==="viewport"&&(D-=B.transform.angle);let ie=!B.options.moving;return{u_matrix:L?L.posMatrix:B.transform.calculatePosMatrix(K.tileID.toUnwrapped(),ie),u_image:0,u_latrange:ke(0,K.tileID),u_light:[F.paint.get("hillshade-exaggeration"),D],u_shadow:J,u_highlight:$,u_accent:ge}})(g,n,o,v?t:null),v,o.id,g.rasterBoundsBuffer,g.quadTriangleIndexBuffer,g.rasterBoundsSegments)}function No(g,t,n,o,l,u){let I=g.context,m=I.gl,f=t.dem;if(f&&f.data){let y=f.dim,_=f.stride,v=f.getPixels();if(I.activeTexture.set(m.TEXTURE1),I.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||g.getTileTexture(_),t.demTexture){let K=t.demTexture;K.update(v,{premultiply:!1}),K.bind(m.NEAREST,m.CLAMP_TO_EDGE)}else t.demTexture=new Vt(I,v,m.RGBA,{premultiply:!1}),t.demTexture.bind(m.NEAREST,m.CLAMP_TO_EDGE);I.activeTexture.set(m.TEXTURE0);let B=t.fbo;if(!B){let K=new Vt(I,{width:y,height:y,data:null},m.RGBA);K.bind(m.LINEAR,m.CLAMP_TO_EDGE),B=t.fbo=I.createFramebuffer(y,y,!0,!1),B.colorAttachment.set(K.texture)}I.bindFramebuffer.set(B.framebuffer),I.viewport.set([0,0,y,y]),g.useProgram("hillshadePrepare").draw(I,m.TRIANGLES,o,l,u,ai.disabled,((K,F)=>{let L=F.stride,J=c.Z();return c.aS(J,0,c.N,-c.N,0,0,1),c.$(J,J,[0,-c.N,0]),{u_matrix:J,u_image:1,u_dimension:[L,L],u_zoom:K.overscaledZ,u_unpack:F.getUnpackVector()}})(t.tileID,f),null,n.id,g.rasterBoundsBuffer,g.quadTriangleIndexBuffer,g.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function Dl(g,t,n,o,l,u){let I=o.paint.get("raster-fade-duration");if(!u&&I>0){let m=c.h.now(),f=(m-g.timeAdded)/I,y=t?(m-t.timeAdded)/I:-1,_=n.getSource(),v=l.coveringZoomLevel({tileSize:_.tileSize,roundZoom:_.roundZoom}),B=!t||Math.abs(t.tileID.overscaledZ-v)>Math.abs(g.tileID.overscaledZ-v),K=B&&g.refreshedUponExpiration?1:c.ad(B?f:1-y,0,1);return g.refreshedUponExpiration&&f>=1&&(g.refreshedUponExpiration=!1),t?{opacity:1,mix:1-K}:{opacity:K,mix:0}}return{opacity:1,mix:0}}let Ka=new c.aT(1,0,0,1),ho=new c.aT(0,1,0,1),Oo=new c.aT(0,0,1,1),Xa=new c.aT(1,0,1,1),La=new c.aT(0,1,1,1);function Kr(g,t,n,o){po(g,0,t+n/2,g.transform.width,n,o)}function uo(g,t,n,o){po(g,t-n/2,0,n,g.transform.height,o)}function po(g,t,n,o,l,u){let I=g.context,m=I.gl;m.enable(m.SCISSOR_TEST),m.scissor(t*g.pixelRatio,n*g.pixelRatio,o*g.pixelRatio,l*g.pixelRatio),I.clear({color:u}),m.disable(m.SCISSOR_TEST)}function Ha(g,t,n){let o=g.context,l=o.gl,u=n.posMatrix,I=g.useProgram("debug"),m=Rt.disabled,f=hi.disabled,y=g.colorModeForRenderPass(),_="$debug",v=g.style.map.terrain&&g.style.map.terrain.getTerrainData(n);o.activeTexture.set(l.TEXTURE0);let B=t.getTileByID(n.key).latestRawTileData,K=Math.floor((B&&B.byteLength||0)/1024),F=t.getTile(n).tileSize,L=512/Math.min(F,512)*(n.overscaledZ/g.transform.zoom)*.5,J=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(J+=` => ${n.overscaledZ}`),function($,ge){$.initDebugOverlayCanvas();let D=$.debugOverlayCanvas,ie=$.context.gl,de=$.debugOverlayCanvas.getContext("2d");de.clearRect(0,0,D.width,D.height),de.shadowColor="white",de.shadowBlur=2,de.lineWidth=1.5,de.strokeStyle="white",de.textBaseline="top",de.font="bold 36px Open Sans, sans-serif",de.fillText(ge,5,5),de.strokeText(ge,5,5),$.debugOverlayTexture.update(D),$.debugOverlayTexture.bind(ie.LINEAR,ie.CLAMP_TO_EDGE)}(g,`${J} ${K}kB`),I.draw(o,l.TRIANGLES,m,f,gi.alphaBlended,ai.disabled,le(u,c.aT.transparent,L),null,_,g.debugBuffer,g.quadTriangleIndexBuffer,g.debugSegments),I.draw(o,l.LINE_STRIP,m,f,y,ai.disabled,le(u,c.aT.red),v,_,g.debugBuffer,g.tileBorderIndexBuffer,g.debugSegments)}function pi(g,t,n){let o=g.context,l=o.gl,u=g.colorModeForRenderPass(),I=new Rt(l.LEQUAL,Rt.ReadWrite,g.depthRangeFor3D),m=g.useProgram("terrain"),f=t.getTerrainMesh();o.bindFramebuffer.set(null),o.viewport.set([0,0,g.width,g.height]);for(let y of n){let _=g.renderToTexture.getTexture(y),v=t.getTerrainData(y.tileID);o.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,_.texture);let B={u_matrix:g.transform.calculatePosMatrix(y.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(g.transform.zoom)};m.draw(o,l.TRIANGLES,I,hi.disabled,u,ai.backCCW,B,v,"terrain",f.vertexBuffer,f.indexBuffer,f.segments)}}class tr{constructor(t,n){this.context=new Pl(t),this.transform=n,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:c.Z(),renderTime:0},this.setup(),this.numSublayers=es.maxUnderzooming+es.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new dr}resize(t,n,o){if(this.width=Math.floor(t*o),this.height=Math.floor(n*o),this.pixelRatio=o,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let l of this.style._order)this.style._layers[l].resize()}setup(){let t=this.context,n=new c.a_;n.emplaceBack(0,0),n.emplaceBack(c.N,0),n.emplaceBack(0,c.N),n.emplaceBack(c.N,c.N),this.tileExtentBuffer=t.createVertexBuffer(n,pr.members),this.tileExtentSegments=c.S.simpleSegment(0,0,4,2);let o=new c.a_;o.emplaceBack(0,0),o.emplaceBack(c.N,0),o.emplaceBack(0,c.N),o.emplaceBack(c.N,c.N),this.debugBuffer=t.createVertexBuffer(o,pr.members),this.debugSegments=c.S.simpleSegment(0,0,4,5);let l=new c.V;l.emplaceBack(0,0,0,0),l.emplaceBack(c.N,0,c.N,0),l.emplaceBack(0,c.N,0,c.N),l.emplaceBack(c.N,c.N,c.N,c.N),this.rasterBoundsBuffer=t.createVertexBuffer(l,ys.members),this.rasterBoundsSegments=c.S.simpleSegment(0,0,4,2);let u=new c.a_;u.emplaceBack(0,0),u.emplaceBack(1,0),u.emplaceBack(0,1),u.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(u,pr.members),this.viewportSegments=c.S.simpleSegment(0,0,4,2);let I=new c.a$;I.emplaceBack(0),I.emplaceBack(1),I.emplaceBack(3),I.emplaceBack(2),I.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(I);let m=new c.b0;m.emplaceBack(0,1,2),m.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(m);let f=this.context.gl;this.stencilClearMode=new hi({func:f.ALWAYS,mask:0},0,255,f.ZERO,f.ZERO,f.ZERO)}clearStencil(){let t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let o=c.Z();c.aS(o,0,this.width,this.height,0,0,1),c.a0(o,o,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,n.TRIANGLES,Rt.disabled,this.stencilClearMode,gi.disabled,ai.disabled,Ae(o),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,n){if(this.currentStencilSource===t.source||!t.isTileClipped()||!n||!n.length)return;this.currentStencilSource=t.source;let o=this.context,l=o.gl;this.nextStencilID+n.length>256&&this.clearStencil(),o.setColorMode(gi.disabled),o.setDepthMode(Rt.disabled);let u=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let I of n){let m=this._tileClippingMaskIDs[I.key]=this.nextStencilID++,f=this.style.map.terrain&&this.style.map.terrain.getTerrainData(I);u.draw(o,l.TRIANGLES,Rt.disabled,new hi({func:l.ALWAYS,mask:0},m,255,l.KEEP,l.KEEP,l.REPLACE),gi.disabled,ai.disabled,Ae(I.posMatrix),f,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,n=this.context.gl;return new hi({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){let n=this.context.gl;return new hi({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){let n=this.context.gl,o=t.sort((I,m)=>m.overscaledZ-I.overscaledZ),l=o[o.length-1].overscaledZ,u=o[0].overscaledZ-l+1;if(u>1){this.currentStencilSource=void 0,this.nextStencilID+u>256&&this.clearStencil();let I={};for(let m=0;m=0;this.currentLayer--){let f=this.style._layers[o[this.currentLayer]],y=l[f.source],_=u[f.source];this._renderTileClippingMasks(f,_),this.renderLayer(this,y,f,_)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerJ.source&&!J.isHidden(_)?[y.sourceCaches[J.source]]:[]),K=B.filter(J=>J.getSource().type==="vector"),F=B.filter(J=>J.getSource().type!=="vector"),L=J=>{(!v||v.getSource().maxzoomL(J)),v||F.forEach(J=>L(J)),v}(this.style,this.transform.zoom);f&&function(y,_,v){for(let B=0;BK.style.map.terrain.getElevation(pe,lt,qe):null)}}}(f,u,m,I,m.layout.get("text-rotation-alignment"),m.layout.get("text-pitch-alignment"),y),m.paint.get("icon-opacity").constantOr(1)!==0&&go(u,I,m,f,!1,m.paint.get("icon-translate"),m.paint.get("icon-translate-anchor"),m.layout.get("icon-rotation-alignment"),m.layout.get("icon-pitch-alignment"),m.layout.get("icon-keep-upright"),_,v),m.paint.get("text-opacity").constantOr(1)!==0&&go(u,I,m,f,!0,m.paint.get("text-translate"),m.paint.get("text-translate-anchor"),m.layout.get("text-rotation-alignment"),m.layout.get("text-pitch-alignment"),m.layout.get("text-keep-upright"),_,v),I.map.showCollisionBoxes&&(Fa(u,I,m,f,m.paint.get("text-translate"),m.paint.get("text-translate-anchor"),!0),Fa(u,I,m,f,m.paint.get("icon-translate"),m.paint.get("icon-translate-anchor"),!1))})(t,n,o,l,this.style.placement.variableOffsets);break;case"circle":(function(u,I,m,f){if(u.renderPass!=="translucent")return;let y=m.paint.get("circle-opacity"),_=m.paint.get("circle-stroke-width"),v=m.paint.get("circle-stroke-opacity"),B=!m.layout.get("circle-sort-key").isConstant();if(y.constantOr(1)===0&&(_.constantOr(1)===0||v.constantOr(1)===0))return;let K=u.context,F=K.gl,L=u.depthModeForSublayer(0,Rt.ReadOnly),J=hi.disabled,$=u.colorModeForRenderPass(),ge=[];for(let D=0;DD.sortKey-ie.sortKey);for(let D of ge){let{programConfiguration:ie,program:de,layoutVertexBuffer:pe,indexBuffer:ve,uniformValues:Be,terrainData:Ze}=D.state;de.draw(K,F.TRIANGLES,L,J,$,ai.disabled,Be,Ze,m.id,pe,ve,D.segments,m.paint,u.transform.zoom,ie)}})(t,n,o,l);break;case"heatmap":(function(u,I,m,f){if(m.paint.get("heatmap-opacity")!==0)if(u.renderPass==="offscreen"){let y=u.context,_=y.gl,v=hi.disabled,B=new gi([_.ONE,_.ONE],c.aT.transparent,[!0,!0,!0,!0]);(function(K,F,L){let J=K.gl;K.activeTexture.set(J.TEXTURE1),K.viewport.set([0,0,F.width/4,F.height/4]);let $=L.heatmapFbo;if($)J.bindTexture(J.TEXTURE_2D,$.colorAttachment.get()),K.bindFramebuffer.set($.framebuffer);else{let ge=J.createTexture();J.bindTexture(J.TEXTURE_2D,ge),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_WRAP_S,J.CLAMP_TO_EDGE),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_WRAP_T,J.CLAMP_TO_EDGE),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MIN_FILTER,J.LINEAR),J.texParameteri(J.TEXTURE_2D,J.TEXTURE_MAG_FILTER,J.LINEAR),$=L.heatmapFbo=K.createFramebuffer(F.width/4,F.height/4,!1,!1),function(D,ie,de,pe){var ve,Be;let Ze=D.gl,Te=(ve=D.HALF_FLOAT)!==null&&ve!==void 0?ve:Ze.UNSIGNED_BYTE,je=(Be=D.RGBA16F)!==null&&Be!==void 0?Be:Ze.RGBA;Ze.texImage2D(Ze.TEXTURE_2D,0,je,ie.width/4,ie.height/4,0,Ze.RGBA,Te,null),pe.colorAttachment.set(de)}(K,F,ge,$)}})(y,u,m),y.clear({color:c.aT.transparent});for(let K=0;K{let D=c.Z();c.aS(D,0,L.width,L.height,0,0,1);let ie=L.context.gl;return{u_matrix:D,u_world:[ie.drawingBufferWidth,ie.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:J.paint.get("heatmap-opacity")}})(y,_),null,_.id,y.viewportBuffer,y.quadTriangleIndexBuffer,y.viewportSegments,_.paint,y.transform.zoom)}(u,m))})(t,n,o,l);break;case"line":(function(u,I,m,f){if(u.renderPass!=="translucent")return;let y=m.paint.get("line-opacity"),_=m.paint.get("line-width");if(y.constantOr(1)===0||_.constantOr(1)===0)return;let v=u.depthModeForSublayer(0,Rt.ReadOnly),B=u.colorModeForRenderPass(),K=m.paint.get("line-dasharray"),F=m.paint.get("line-pattern"),L=F.constantOr(1),J=m.paint.get("line-gradient"),$=m.getCrossfadeParameters(),ge=L?"linePattern":K?"lineSDF":J?"lineGradient":"line",D=u.context,ie=D.gl,de=!0;for(let pe of f){let ve=I.getTile(pe);if(L&&!ve.patternsLoaded())continue;let Be=ve.getBucket(m);if(!Be)continue;let Ze=Be.programConfigurations.get(m.id),Te=u.context.program.get(),je=u.useProgram(ge,Ze),St=de||je.program!==Te,Xe=u.style.map.terrain&&u.style.map.terrain.getTerrainData(pe),lt=F.constantOr(null);if(lt&&ve.imageAtlas){let xt=ve.imageAtlas,bt=xt.patternPositions[lt.to.toString()],Zt=xt.patternPositions[lt.from.toString()];bt&&Zt&&Ze.setConstantPatternPositions(bt,Zt)}let qe=Xe?pe:null,Yt=L?Je(u,ve,m,$,qe):K?Re(u,ve,m,K,$,qe):J?It(u,ve,m,Be.lineClipsArray.length,qe):ot(u,ve,m,qe);if(L)D.activeTexture.set(ie.TEXTURE0),ve.imageAtlasTexture.bind(ie.LINEAR,ie.CLAMP_TO_EDGE),Ze.updatePaintBuffers($);else if(K&&(St||u.lineAtlas.dirty))D.activeTexture.set(ie.TEXTURE0),u.lineAtlas.bind(D);else if(J){let xt=Be.gradients[m.id],bt=xt.texture;if(m.gradientVersion!==xt.version){let Zt=256;if(m.stepInterpolant){let Ci=I.getSource().maxzoom,jt=pe.canonical.z===Ci?Math.ceil(1<0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let n=this.imageManager.getPattern(t.from.toString()),o=this.imageManager.getPattern(t.to.toString());return!n||!o}useProgram(t,n){this.cache=this.cache||{};let o=t+(n?n.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[o]||(this.cache[o]=new W(this.context,$t[t],n,hs[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[o]}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 t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Vt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}}class vs{constructor(t,n){this.points=t,this.planes=n}static fromInvProjectionMatrix(t,n,o){let l=Math.pow(2,o),u=[[-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(m=>{let f=1/(m=c.ag([],m,t))[3]/n*l;return c.b3(m,m,[f,f,1/m[3],f])}),I=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(m=>{let f=function(B,K){var F=K[0],L=K[1],J=K[2],$=F*F+L*L+J*J;return $>0&&($=1/Math.sqrt($)),B[0]=K[0]*$,B[1]=K[1]*$,B[2]=K[2]*$,B}([],function(B,K,F){var L=K[0],J=K[1],$=K[2],ge=F[0],D=F[1],ie=F[2];return B[0]=J*ie-$*D,B[1]=$*ge-L*ie,B[2]=L*D-J*ge,B}([],Ei([],u[m[0]],u[m[1]]),Ei([],u[m[2]],u[m[1]]))),y=-((_=f)[0]*(v=u[m[1]])[0]+_[1]*v[1]+_[2]*v[2]);var _,v;return f.concat(y)});return new vs(u,I)}}class Ar{constructor(t,n){this.min=t,this.max=n,this.center=function(o,l,u){return o[0]=.5*l[0],o[1]=.5*l[1],o[2]=.5*l[2],o}([],function(o,l,u){return o[0]=l[0]+u[0],o[1]=l[1]+u[1],o[2]=l[2]+u[2],o}([],this.min,this.max))}quadrant(t){let n=[t%2==0,t<2],o=os(this.min),l=os(this.max);for(let u=0;u=0&&I++;if(I===0)return 0;I!==n.length&&(o=!1)}if(o)return 2;for(let l=0;l<3;l++){let u=Number.MAX_VALUE,I=-Number.MAX_VALUE;for(let m=0;mthis.max[l]-this.min[l])return 0}return 1}}class Xr{constructor(t=0,n=0,o=0,l=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(o)||o<0||isNaN(l)||l<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=o,this.right=l}interpolate(t,n,o){return n.top!=null&&t.top!=null&&(this.top=c.B.number(t.top,n.top,o)),n.bottom!=null&&t.bottom!=null&&(this.bottom=c.B.number(t.bottom,n.bottom,o)),n.left!=null&&t.left!=null&&(this.left=c.B.number(t.left,n.left,o)),n.right!=null&&t.right!=null&&(this.right=c.B.number(t.right,n.right,o)),this}getCenter(t,n){let o=c.ad((this.left+t-this.right)/2,0,t),l=c.ad((this.top+n-this.bottom)/2,0,n);return new c.P(o,l)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Xr(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Io{constructor(t,n,o,l,u){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=u===void 0||!!u,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=o??0,this._maxPitch=l??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new c.L(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Xr,this._posMatrixCache={},this._alignedPosMatrixCache={},this._minEleveationForCurrentTile=0}clone(){let t=new Io(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this._minEleveationForCurrentTile=t._minEleveationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new c.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){let n=-c.b5(t,-180,180)*Math.PI/180;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=function(){var o=new c.A(4);return c.A!=Float32Array&&(o[1]=0,o[2]=0),o[0]=1,o[3]=1,o}(),function(o,l,u){var I=l[0],m=l[1],f=l[2],y=l[3],_=Math.sin(u),v=Math.cos(u);o[0]=I*v+f*_,o[1]=m*v+y*_,o[2]=I*-_+f*v,o[3]=m*-_+y*v}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){let n=c.ad(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){let n=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this.tileZoom=Math.max(0,Math.floor(n)),this.scale=this.zoomScale(n),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,n,o){this._unmodified=!1,this._edgeInsets.interpolate(t,n,o),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){let n=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,n)}getVisibleUnwrappedCoordinates(t){let n=[new c.b6(0,t)];if(this._renderWorldCopies){let o=this.pointCoordinate(new c.P(0,0)),l=this.pointCoordinate(new c.P(this.width,0)),u=this.pointCoordinate(new c.P(this.width,this.height)),I=this.pointCoordinate(new c.P(0,this.height)),m=Math.floor(Math.min(o.x,l.x,u.x,I.x)),f=Math.floor(Math.max(o.x,l.x,u.x,I.x)),y=1;for(let _=m-y;_<=f+y;_++)_!==0&&n.push(new c.b6(_,t))}return n}coveringTiles(t){var n,o;let l=this.coveringZoomLevel(t),u=l;if(t.minzoom!==void 0&&lt.maxzoom&&(l=t.maxzoom);let I=this.pointCoordinate(this.getCameraPoint()),m=c.U.fromLngLat(this.center),f=Math.pow(2,l),y=[f*I.x,f*I.y,0],_=[f*m.x,f*m.y,0],v=vs.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,l),B=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(B=l);let K=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,F=D=>({aabb:new Ar([D*f,0,0],[(D+1)*f,f,0]),zoom:0,x:0,y:0,wrap:D,fullyVisible:!1}),L=[],J=[],$=l,ge=t.reparseOverscaled?u:l;if(this._renderWorldCopies)for(let D=1;D<=3;D++)L.push(F(-D)),L.push(F(D));for(L.push(F(0));L.length>0;){let D=L.pop(),ie=D.x,de=D.y,pe=D.fullyVisible;if(!pe){let je=D.aabb.intersects(v);if(je===0)continue;pe=je===2}let ve=t.terrain?y:_,Be=D.aabb.distanceX(ve),Ze=D.aabb.distanceY(ve),Te=Math.max(Math.abs(Be),Math.abs(Ze));if(D.zoom===$||Te>K+(1<<$-D.zoom)-2&&D.zoom>=B){let je=$-D.zoom,St=y[0]-.5-(ie<>1),lt=D.zoom+1,qe=D.aabb.quadrant(je);if(t.terrain){let Yt=new c.O(lt,D.wrap,lt,St,Xe),xt=t.terrain.getMinMaxElevation(Yt),bt=(n=xt.minElevation)!==null&&n!==void 0?n:this.elevation,Zt=(o=xt.maxElevation)!==null&&o!==void 0?o:this.elevation;qe=new Ar([qe.min[0],qe.min[1],bt],[qe.max[0],qe.max[1],Zt])}L.push({aabb:qe,zoom:lt,x:St,y:Xe,wrap:D.wrap,fullyVisible:pe})}}return J.sort((D,ie)=>D.distanceSq-ie.distanceSq).map(D=>D.tileID)}resize(t,n){this.width=t,this.height=n,this.pixelsToGLUnits=[2/t,-2/n],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){let n=c.ad(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new c.P(c.G(t.lng)*this.worldSize,c.H(n)*this.worldSize)}unproject(t){return new c.U(t.x/this.worldSize,t.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(t){let n=this.pointLocation(this.centerPoint,t),o=t.getElevationForLngLatZoom(n,this.tileZoom);if(!(this.elevation-o))return;let l=this.getCameraPosition(),u=c.U.fromLngLat(l.lngLat,l.altitude),I=c.U.fromLngLat(n,o),m=u.x-I.x,f=u.y-I.y,y=u.z-I.z,_=Math.sqrt(m*m+f*f+y*y),v=this.scaleZoom(this.cameraToCenterDistance/_/this.tileSize);this._elevation=o,this._center=n,this.zoom=v}setLocationAtPoint(t,n){let o=this.pointCoordinate(n),l=this.pointCoordinate(this.centerPoint),u=this.locationCoordinate(t),I=new c.U(u.x-(o.x-l.x),u.y-(o.y-l.y));this.center=this.coordinateLocation(I),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,n){return n?this.coordinatePoint(this.locationCoordinate(t),n.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,n){return this.coordinateLocation(this.pointCoordinate(t,n))}locationCoordinate(t){return c.U.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,n){if(n){let B=n.pointCoordinate(t);if(B!=null)return B}let o=[t.x,t.y,0,1],l=[t.x,t.y,1,1];c.ag(o,o,this.pixelMatrixInverse),c.ag(l,l,this.pixelMatrixInverse);let u=o[3],I=l[3],m=o[1]/u,f=l[1]/I,y=o[2]/u,_=l[2]/I,v=y===_?0:(0-y)/(_-y);return new c.U(c.B.number(o[0]/u,l[0]/I,v)/this.worldSize,c.B.number(m,f,v)/this.worldSize)}coordinatePoint(t,n=0,o=this.pixelMatrix){let l=[t.x*this.worldSize,t.y*this.worldSize,n,1];return c.ag(l,l,o),new c.P(l[0]/l[3],l[1]/l[3])}getBounds(){let t=Math.max(0,this.height/2-this.getHorizon());return new ht().extend(this.pointLocation(new c.P(0,t))).extend(this.pointLocation(new c.P(this.width,t))).extend(this.pointLocation(new c.P(this.width,this.height))).extend(this.pointLocation(new c.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new ht([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(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(t,n=!1){let o=t.key,l=n?this._alignedPosMatrixCache:this._posMatrixCache;if(l[o])return l[o];let u=t.canonical,I=this.worldSize/this.zoomScale(u.z),m=u.x+Math.pow(2,u.z)*t.wrap,f=c.ao(new Float64Array(16));return c.$(f,f,[m*I,u.y*I,0]),c.a0(f,f,[I/c.N,I/c.N,1]),c.a1(f,n?this.alignedProjMatrix:this.projMatrix,f),l[o]=new Float32Array(f),l[o]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t,n,o,l,u=-90,I=90,m=-180,f=180,y=this.size,_=this._unmodified;if(this.latRange){let K=this.latRange;u=c.H(K[1])*this.worldSize,I=c.H(K[0])*this.worldSize,t=I-uI&&(l=I-F)}if(this.lngRange){let K=(m+f)/2,F=c.b5(v.x,K-this.worldSize/2,K+this.worldSize/2),L=y.x/2;F-Lf&&(o=f-L)}o===void 0&&l===void 0||(this.center=this.unproject(new c.P(o!==void 0?o:v.x,l!==void 0?l:v.y)).wrap()),this._unmodified=_,this._constraining=!1}_calcMatrices(){if(!this.height)return;let t=this.centerOffset,n=this.point.x,o=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=c.b7(1,this.center.lat)*this.worldSize;let l=c.ao(new Float64Array(16));c.a0(l,l,[this.width/2,-this.height/2,1]),c.$(l,l,[1,-1,0]),this.labelPlaneMatrix=l,l=c.ao(new Float64Array(16)),c.a0(l,l,[1,-1,1]),c.$(l,l,[-1,-1,0]),c.a0(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l;let u=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),I=Math.min(this.elevation,this._minEleveationForCurrentTile),m=u-I*this._pixelPerMeter/Math.cos(this._pitch),f=I<0?m:u,y=Math.PI/2+this._pitch,_=this._fov*(.5+t.y/this.height),v=Math.sin(_)*f/Math.sin(c.ad(Math.PI-y-_,.01,Math.PI-.01)),B=this.getHorizon(),K=2*Math.atan(B/this.cameraToCenterDistance)*(.5+t.y/(2*B)),F=Math.sin(K)*f/Math.sin(c.ad(Math.PI-y-K,.01,Math.PI-.01)),L=Math.min(v,F),J=1.01*(Math.cos(Math.PI/2-this._pitch)*L+f),$=this.height/50;l=new Float64Array(16),c.b8(l,this._fov,this.width/this.height,$,J),l[8]=2*-t.x/this.width,l[9]=2*t.y/this.height,c.a0(l,l,[1,-1,1]),c.$(l,l,[0,0,-this.cameraToCenterDistance]),c.b9(l,l,this._pitch),c.ae(l,l,this.angle),c.$(l,l,[-n,-o,0]),this.mercatorMatrix=c.a0([],l,[this.worldSize,this.worldSize,this.worldSize]),c.a0(l,l,[1,1,this._pixelPerMeter]),this.pixelMatrix=c.a1(new Float64Array(16),this.labelPlaneMatrix,l),c.$(l,l,[0,0,-this.elevation]),this.projMatrix=l,this.invProjMatrix=c.as([],l),this.pixelMatrix3D=c.a1(new Float64Array(16),this.labelPlaneMatrix,l);let ge=this.width%2/2,D=this.height%2/2,ie=Math.cos(this.angle),de=Math.sin(this.angle),pe=n-Math.round(n)+ie*ge+de*D,ve=o-Math.round(o)+ie*D+de*ge,Be=new Float64Array(l);if(c.$(Be,Be,[pe>.5?pe-1:pe,ve>.5?ve-1:ve,0]),this.alignedProjMatrix=Be,l=c.as(new Float64Array(16),this.pixelMatrix),!l)throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let t=this.pointCoordinate(new c.P(0,0)),n=[t.x*this.worldSize,t.y*this.worldSize,0,1];return c.ag(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new c.P(0,t))}getCameraQueryGeometry(t){let n=this.getCameraPoint();if(t.length===1)return[t[0],n];{let o=n.x,l=n.y,u=n.x,I=n.y;for(let m of t)o=Math.min(o,m.x),l=Math.min(l,m.y),u=Math.max(u,m.x),I=Math.max(I,m.y);return[new c.P(o,l),new c.P(u,l),new c.P(u,I),new c.P(o,I),new c.P(o,l)]}}}function ir(g,t){let n,o=!1,l=null,u=null,I=()=>{l=null,o&&(g.apply(u,n),l=setTimeout(I,t),o=!1)};return(...m)=>(o=!0,u=this,n=m,l||I(),l)}class Lr{constructor(t){this._getCurrentHash=()=>{let n=window.location.hash.replace("#","");if(this._hashName){let o;return n.split("&").map(l=>l.split("=")).forEach(l=>{l[0]===this._hashName&&(o=l)}),(o&&o[1]||"").split("/")}return n.split("/")},this._onHashChange=()=>{let n=this._getCurrentHash();if(n.length>=3&&!n.some(o=>isNaN(o))){let o=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(n[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+n[2],+n[1]],zoom:+n[0],bearing:o,pitch:+(n[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let n=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,n)}catch{}},this._updateHash=ir(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,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(t){let n=this._map.getCenter(),o=Math.round(100*this._map.getZoom())/100,l=Math.ceil((o*Math.LN2+Math.log(512/360/.5))/Math.LN10),u=Math.pow(10,l),I=Math.round(n.lng*u)/u,m=Math.round(n.lat*u)/u,f=this._map.getBearing(),y=this._map.getPitch(),_="";if(_+=t?`/${I}/${m}/${o}`:`${o}/${m}/${I}`,(f||y)&&(_+="/"+Math.round(10*f)/10),y&&(_+=`/${Math.round(y)}`),this._hashName){let v=this._hashName,B=!1,K=window.location.hash.slice(1).split("&").map(F=>{let L=F.split("=")[0];return L===v?(B=!0,`${L}=${_}`):F}).filter(F=>F);return B||K.push(`${v}=${_}`),`#${K.join("&")}`}return`#${_}`}}let yr={linearity:.3,easing:c.ba(0,0,.3,1)},Pa=c.e({deceleration:2500,maxSpeed:1400},yr),Ea=c.e({deceleration:20,maxSpeed:1400},yr),Da=c.e({deceleration:1e3,maxSpeed:360},yr),Ya=c.e({deceleration:1e3,maxSpeed:90},yr);class Na{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:c.h.now(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,n=c.h.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let n={zoom:0,bearing:0,pitch:0,pan:new c.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:u}of this._inertiaBuffer)n.zoom+=u.zoomDelta||0,n.bearing+=u.bearingDelta||0,n.pitch+=u.pitchDelta||0,u.panDelta&&n.pan._add(u.panDelta),u.around&&(n.around=u.around),u.pinchAround&&(n.pinchAround=u.pinchAround);let o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};if(n.pan.mag()){let u=Hr(n.pan.mag(),o,c.e({},Pa,t||{}));l.offset=n.pan.mult(u.amount/n.pan.mag()),l.center=this._map.transform.center,fn(l,u)}if(n.zoom){let u=Hr(n.zoom,o,Ea);l.zoom=this._map.transform.zoom+u.amount,fn(l,u)}if(n.bearing){let u=Hr(n.bearing,o,Da);l.bearing=this._map.transform.bearing+c.ad(u.amount,-179,179),fn(l,u)}if(n.pitch){let u=Hr(n.pitch,o,Ya);l.pitch=this._map.transform.pitch+u.amount,fn(l,u)}if(l.zoom||l.bearing){let u=n.pinchAround===void 0?n.around:n.pinchAround;l.around=u?this._map.unproject(u):this._map.getCenter()}return this.clear(),c.e(l,{noMoveStart:!0})}}function fn(g,t){(!g.duration||g.durationn.unproject(f)),m=u.reduce((f,y,_,v)=>f.add(y.div(v.length)),new c.P(0,0));super(t,{points:u,point:m,lngLats:I,lngLat:n.unproject(m),originalEvent:o}),this._defaultPrevented=!1}}class Oa extends c.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,o){super(t,{originalEvent:o}),this._defaultPrevented=!1}}class Ua{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Oa(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new Ms(t.type,this._map,t))}mouseup(t){this._map.fire(new Ms(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new Ms(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Ms(t.type,this._map,t))}mouseover(t){this._map.fire(new Ms(t.type,this._map,t))}mouseout(t){this._map.fire(new Ms(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Pr(t.type,this._map,t))}touchmove(t){this._map.fire(new Pr(t.type,this._map,t))}touchend(t){this._map.fire(new Pr(t.type,this._map,t))}touchcancel(t){this._map.fire(new Pr(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ja{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Ms(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ms("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Ms(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Gn{constructor(t){this._map=t}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(t){return this.transform.pointLocation(c.P.convert(t),this._map.terrain)}}class Qa{constructor(t,n){this._map=t,this._tr=new Gn(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&t.button===0&&(ee.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active)return;let o=n;if(this._lastPos.equals(o)||!this._box&&o.dist(this._startPos)u.fitScreenCoordinates(o,l,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(ee.remove(this._box),this._box=null),ee.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new c.k(t,{originalEvent:n}))}}function qs(g,t){if(g.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${g.length}, points ${t.length}`);let n={};for(let o=0;othis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),o.length===this.numTouches&&(this.centroid=function(l){let u=new c.P(0,0);for(let I of l)u._add(I);return u.div(l.length)}(n),this.touches=qs(o,n)))}touchmove(t,n,o){if(this.aborted||!this.centroid)return;let l=qs(o,n);for(let u in this.touches){let I=l[u];(!I||I.dist(this.touches[u])>30)&&(this.aborted=!0)}}touchend(t,n,o){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),o.length===0){let l=!this.aborted&&this.centroid;if(this.reset(),l)return l}}}class mo{constructor(t){this.singleTap=new Rn(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,o){this.singleTap.touchstart(t,n,o)}touchmove(t,n,o){this.singleTap.touchmove(t,n,o)}touchend(t,n,o){let l=this.singleTap.touchend(t,n,o);if(l){let u=t.timeStamp-this.lastTime<500,I=!this.lastTap||this.lastTap.dist(l)<30;if(u&&I||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=l,this.count===this.numTaps)return this.reset(),l}}}class Vn{constructor(t){this._tr=new Gn(t),this._zoomIn=new mo({numTouches:1,numTaps:2}),this._zoomOut=new mo({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,o){this._zoomIn.touchstart(t,n,o),this._zoomOut.touchstart(t,n,o)}touchmove(t,n,o){this._zoomIn.touchmove(t,n,o),this._zoomOut.touchmove(t,n,o)}touchend(t,n,o){let l=this._zoomIn.touchend(t,n,o),u=this._zoomOut.touchend(t,n,o),I=this._tr;return l?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:m=>m.easeTo({duration:300,zoom:I.zoom+1,around:I.unproject(l)},{originalEvent:t})}):u?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:m=>m.easeTo({duration:300,zoom:I.zoom-1,around:I.unproject(u)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Tn{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){let n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=n.length?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;let o=this._lastPoint;if(!o)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let l=n.length?n[0]:n;return!this._moved&&l.dist(o){g.mousedown=g.dragStart,g.mousemoveWindow=g.dragMove,g.mouseup=g.dragEnd,g.contextmenu=function(t){t.preventDefault()}},br=({enable:g,clickTolerance:t,bearingDegreesPerPixelMoved:n=.8})=>{let o=new Uo({checkCorrectEvent:l=>ee.mouseButton(l)===0&&l.ctrlKey||ee.mouseButton(l)===2});return new Tn({clickTolerance:t,move:(l,u)=>({bearingDelta:(u.x-l.x)*n}),moveStateManager:o,enable:g,assignEvents:Co})},Wn=({enable:g,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5})=>{let o=new Uo({checkCorrectEvent:l=>ee.mouseButton(l)===0&&l.ctrlKey||ee.mouseButton(l)===2});return new Tn({clickTolerance:t,move:(l,u)=>({pitchDelta:(u.y-l.y)*n}),moveStateManager:o,enable:g,assignEvents:Co})};class Ye{constructor(t,n){this._minTouches=t.cooperativeGestures?2:1,this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new c.P(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(t,n,o){return this._calculateTransform(t,n,o)}touchmove(t,n,o){if(this._map._cooperativeGestures&&(this._minTouches===2&&o.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(t,!1,o.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(o.length0&&(this._active=!0);let l=qs(o,n),u=new c.P(0,0),I=new c.P(0,0),m=0;for(let y in l){let _=l[y],v=this._touches[y];v&&(u._add(_),I._add(_.sub(v)),m++,l[y]=_)}if(this._touches=l,mMath.abs(g.x)}class Nl extends fo{constructor(t){super(),this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,o){super.touchstart(t,n,o),this._currentTouchCount=o.length}_start(t){this._lastPoints=t,Qo(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,o){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;let l=t[0].sub(this._lastPoints[0]),u=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(l,u,o.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(l.y+u.y)/2*-.5}):void 0}gestureBeginsVertically(t,n,o){if(this._valid!==void 0)return this._valid;let l=t.mag()>=2,u=n.mag()>=2;if(!l&&!u)return;if(!l||!u)return this._firstMove===void 0&&(this._firstMove=o),o-this._firstMove<100&&void 0;let I=t.y>0==n.y>0;return Qo(t)&&Qo(n)&&I}}let qo={panStep:100,bearingStep:15,pitchStep:10};class el{constructor(t){this._tr=new Gn(t);let n=qo;this._panStep=n.panStep,this._bearingStep=n.bearingStep,this._pitchStep=n.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,o=0,l=0,u=0,I=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?o=-1:(t.preventDefault(),u=-1);break;case 39:t.shiftKey?o=1:(t.preventDefault(),u=1);break;case 38:t.shiftKey?l=1:(t.preventDefault(),I=-1);break;case 40:t.shiftKey?l=-1:(t.preventDefault(),I=1);break;default:return}return this._rotationDisabled&&(o=0,l=0),{cameraAnimation:m=>{let f=this._tr;m.easeTo({duration:300,easeId:"keyboardHandler",easing:tl,zoom:n?Math.round(f.zoom)+n*(t.shiftKey?2:1):f.zoom,bearing:f.bearing+o*this._bearingStep,pitch:f.pitch+l*this._pitchStep,offset:[-u*this._panStep,-I*this._panStep],center:f.center},{originalEvent:t})}}}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 tl(g){return g*(2-g)}let il=4.000244140625;class Ol{constructor(t,n){this._onTimeout=o=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(o)},this._map=t,this._tr=new Gn(t),this._el=t.getCanvasContainer(),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!t[this._map._metaKey])return;t.preventDefault()}let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,o=c.h.now(),l=o-(this._lastWheelEventTime||0);this._lastWheelEventTime=o,n!==0&&n%il==0?this._type="wheel":n!==0&&Math.abs(n)<4?this._type="trackpad":l>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(l*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_start(t){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 n=ee.mousePos(this._el,t),o=this._tr;this._around=c.L.convert(this._aroundCenter?o.center:o.unproject(n)),this._aroundPoint=o.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let t=this._tr.transform;if(this._delta!==0){let m=this._type==="wheel"&&Math.abs(this._delta)>il?this._wheelZoomRate:this._defaultZoomRate,f=2/(1+Math.exp(-Math.abs(this._delta*m)));this._delta<0&&f!==0&&(f=1/f);let y=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(y*f))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let n=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,o=this._startZoom,l=this._easing,u,I=!1;if(this._type==="wheel"&&o&&l){let m=Math.min((c.h.now()-this._lastWheelEventTime)/200,1),f=l(m);u=c.B.number(o,n,f),m<1?this._frameId||(this._frameId=!0):I=!0}else u=n,I=!0;return this._active=!0,I&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!I,zoomDelta:u-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=c.bb;if(this._prevEase){let o=this._prevEase,l=(c.h.now()-o.start)/o.duration,u=o.easing(l+.01)-o.easing(l),I=.27/Math.sqrt(u*u+1e-4)*.01,m=Math.sqrt(.0729-I*I);n=c.ba(I,m,.25,1)}return this._prevEase={start:c.h.now(),duration:t,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class $o{constructor(t,n){this._clickZoom=t,this._tapZoom=n}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 ea{constructor(t){this._tr=new Gn(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:o=>{o.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ta{constructor(){this._tap=new mo({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(t,n,o){if(!this._swipePoint)if(this._tapTime){let l=n[0],u=t.timeStamp-this._tapTime<500,I=this._tapPoint.dist(l)<30;u&&I?o.length>0&&(this._swipePoint=l,this._swipeTouch=o[0].identifier):this.reset()}else this._tap.touchstart(t,n,o)}touchmove(t,n,o){if(this._tapTime){if(this._swipePoint){if(o[0].identifier!==this._swipeTouch)return;let l=n[0],u=l.y-this._swipePoint.y;return this._swipePoint=l,t.preventDefault(),this._active=!0,{zoomDelta:u/128}}}else this._tap.touchmove(t,n,o)}touchend(t,n,o){if(this._tapTime)this._swipePoint&&o.length===0&&this.reset();else{let l=this._tap.touchend(t,n,o);l&&(this._tapTime=t.timeStamp,this._tapPoint=l)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ia{constructor(t,n,o){this._el=t,this._mousePan=n,this._touchPan=o}enable(t){this._inertiaOptions=t||{},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 xs{constructor(t,n,o){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=n,this._mousePitch=o}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 Yn{constructor(t,n,o,l){this._el=t,this._touchZoom=n,this._touchRotate=o,this._tapDragZoom=l,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),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()}}let Er=g=>g.zoom||g.drag||g.pitch||g.rotate;class sa extends c.k{}function Dr(g){return g.panDelta&&g.panDelta.mag()||g.zoomDelta||g.bearingDelta||g.pitchDelta}class na{constructor(t,n){this.handleWindowEvent=l=>{this.handleEvent(l,`${l.type}Window`)},this.handleEvent=(l,u)=>{if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let I=l.type==="renderFrame"?void 0:l,m={needsRenderFrame:!1},f={},y={},_=l.touches,v=_?this._getMapTouches(_):void 0,B=v?ee.touchPos(this._el,v):ee.mousePos(this._el,l);for(let{handlerName:L,handler:J,allowed:$}of this._handlers){if(!J.isEnabled())continue;let ge;this._blockedByActive(y,$,L)?J.reset():J[u||l.type]&&(ge=J[u||l.type](l,B,v),this.mergeHandlerResult(m,f,ge,L,I),ge&&ge.needsRenderFrame&&this._triggerRenderFrame()),(ge||J.isActive())&&(y[L]=J)}let K={};for(let L in this._previousActiveHandlers)y[L]||(K[L]=I);this._previousActiveHandlers=y,(Object.keys(K).length||Dr(m))&&(this._changes.push([m,f,K]),this._triggerRenderFrame()),(Object.keys(y).length||Dr(m))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:F}=m;F&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],F(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Na(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);let o=this._el;this._listeners=[[o,"touchstart",{passive:!0}],[o,"touchmove",{passive:!1}],[o,"touchend",void 0],[o,"touchcancel",void 0],[o,"mousedown",void 0],[o,"mousemove",void 0],[o,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[o,"mouseover",void 0],[o,"mouseout",void 0],[o,"dblclick",void 0],[o,"click",void 0],[o,"keydown",{capture:!1}],[o,"keyup",void 0],[o,"wheel",{passive:!1}],[o,"contextmenu",void 0],[window,"blur",void 0]];for(let[l,u,I]of this._listeners)ee.addEventListener(l,u,l===document?this.handleWindowEvent:this.handleEvent,I)}destroy(){for(let[t,n,o]of this._listeners)ee.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,o)}_addDefaultHandlers(t){let n=this._map,o=n.getCanvasContainer();this._add("mapEvent",new Ua(n,t));let l=n.boxZoom=new Qa(n,t);this._add("boxZoom",l),t.interactive&&t.boxZoom&&l.enable();let u=new Vn(n),I=new ea(n);n.doubleClickZoom=new $o(I,u),this._add("tapZoom",u),this._add("clickZoom",I),t.interactive&&t.doubleClickZoom&&n.doubleClickZoom.enable();let m=new ta;this._add("tapDragZoom",m);let f=n.touchPitch=new Nl(n);this._add("touchPitch",f),t.interactive&&t.touchPitch&&n.touchPitch.enable(t.touchPitch);let y=br(t),_=Wn(t);n.dragRotate=new xs(t,y,_),this._add("mouseRotate",y,["mousePitch"]),this._add("mousePitch",_,["mouseRotate"]),t.interactive&&t.dragRotate&&n.dragRotate.enable();let v=(({enable:$,clickTolerance:ge})=>{let D=new Uo({checkCorrectEvent:ie=>ee.mouseButton(ie)===0&&!ie.ctrlKey});return new Tn({clickTolerance:ge,move:(ie,de)=>({around:de,panDelta:de.sub(ie)}),activateOnStart:!0,moveStateManager:D,enable:$,assignEvents:Co})})(t),B=new Ye(t,n);n.dragPan=new ia(o,v,B),this._add("mousePan",v),this._add("touchPan",B,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&n.dragPan.enable(t.dragPan);let K=new jo,F=new $a;n.touchZoomRotate=new Yn(o,F,K,m),this._add("touchRotate",K,["touchPan","touchZoom"]),this._add("touchZoom",F,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&n.touchZoomRotate.enable(t.touchZoomRotate);let L=n.scrollZoom=new Ol(n,()=>this._triggerRenderFrame());this._add("scrollZoom",L,["mousePan"]),t.interactive&&t.scrollZoom&&n.scrollZoom.enable(t.scrollZoom);let J=n.keyboard=new el(n);this._add("keyboard",J),t.interactive&&t.keyboard&&n.keyboard.enable(),this._add("blockableMapEvent",new ja(n))}_add(t,n,o){this._handlers.push({handlerName:t,handler:n,allowed:o}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(let{handler:n}of this._handlers)n.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(Er(this._eventsInProgress))||this.isZooming()}_blockedByActive(t,n,o){for(let l in t)if(l!==o&&(!n||n.indexOf(l)<0))return!0;return!1}_getMapTouches(t){let n=[];for(let o of t)this._el.contains(o.target)&&n.push(o);return n}mergeHandlerResult(t,n,o,l,u){if(!o)return;c.e(t,o);let I={handlerName:l,originalEvent:o.originalEvent||u};o.zoomDelta!==void 0&&(n.zoom=I),o.panDelta!==void 0&&(n.drag=I),o.pitchDelta!==void 0&&(n.pitch=I),o.bearingDelta!==void 0&&(n.rotate=I)}_applyChanges(){let t={},n={},o={};for(let[l,u,I]of this._changes)l.panDelta&&(t.panDelta=(t.panDelta||new c.P(0,0))._add(l.panDelta)),l.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+l.zoomDelta),l.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+l.bearingDelta),l.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+l.pitchDelta),l.around!==void 0&&(t.around=l.around),l.pinchAround!==void 0&&(t.pinchAround=l.pinchAround),l.noInertia&&(t.noInertia=l.noInertia),c.e(n,u),c.e(o,I);this._updateMapTransform(t,n,o),this._changes=[]}_updateMapTransform(t,n,o){let l=this._map,u=l._getTransformForUpdate(),I=l.terrain;if(!(Dr(t)||I&&this._terrainMovement))return this._fireEvents(n,o,!0);let{panDelta:m,zoomDelta:f,bearingDelta:y,pitchDelta:_,around:v,pinchAround:B}=t;B!==void 0&&(v=B),l._stop(!0),v=v||l.transform.centerPoint;let K=u.pointLocation(m?v.sub(m):v);y&&(u.bearing+=y),_&&(u.pitch+=_),f&&(u.zoom+=f),I?this._terrainMovement||!n.drag&&!n.zoom?n.drag&&this._terrainMovement?u.center=u.pointLocation(u.centerPoint.sub(m)):u.setLocationAtPoint(K,v):(this._terrainMovement=!0,this._map._elevationFreeze=!0,u.setLocationAtPoint(K,v),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,u.recalculateZoom(l.terrain)})):u.setLocationAtPoint(K,v),l._applyUpdatedTransform(u),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,o,!0)}_fireEvents(t,n,o){let l=Er(this._eventsInProgress),u=Er(t),I={};for(let _ in t){let{originalEvent:v}=t[_];this._eventsInProgress[_]||(I[`${_}start`]=v),this._eventsInProgress[_]=t[_]}!l&&u&&this._fireEvent("movestart",u.originalEvent);for(let _ in I)this._fireEvent(_,I[_]);u&&this._fireEvent("move",u.originalEvent);for(let _ in t){let{originalEvent:v}=t[_];this._fireEvent(_,v)}let m={},f;for(let _ in this._eventsInProgress){let{handlerName:v,originalEvent:B}=this._eventsInProgress[_];this._handlersById[v].isActive()||(delete this._eventsInProgress[_],f=n[v]||B,m[`${_}end`]=f)}for(let _ in m)this._fireEvent(_,m[_]);let y=Er(this._eventsInProgress);if(o&&(l||u)&&!y){this._updatingCamera=!0;let _=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),v=B=>B!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new sa("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class sl extends c.E{constructor(t,n){super(),this._renderFrameCallback=()=>{let o=Math.min((c.h.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(o)),o<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new c.L(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}panBy(t,n,o){return t=c.P.convert(t).mult(-1),this.panTo(this.transform.center,c.e({offset:t},n),o)}panTo(t,n,o){return this.easeTo(c.e({center:t},n),o)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,o){return this.easeTo(c.e({zoom:t},n),o)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,o){return this.easeTo(c.e({bearing:t},n),o)}resetNorth(t,n){return this.rotateTo(0,c.e({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(c.e({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing()){if(this._zooming&&(o.zoom=c.B.number(l,f,pe)),this._rotating&&(o.bearing=c.B.number(u,y,pe)),this._pitching&&(o.pitch=c.B.number(I,_,pe)),this._padding&&(o.interpolatePadding(m,v,pe),K=o.centerPoint.add(B)),this.terrain&&!t.freezeElevation&&this._updateElevation(pe),D)o.setLocationAtPoint(D,ie);else{let ve=o.zoomScale(o.zoom-l),Be=f>l?Math.min(2,ge):Math.max(.5,ge),Ze=Math.pow(Be,1-pe),Te=o.unproject(J.add($.mult(pe*Ze)).mult(ve));o.setLocationAtPoint(o.renderWorldCopies?Te.wrap():Te,K)}this._applyUpdatedTransform(o),this._fireMoveEvents(n)},pe=>{this.terrain&&this._finalizeElevation(),this._afterEase(n,pe)},t),this}_prepareEase(t,n,o={}){this._moving=!0,n||o.moving||this.fire(new c.k("movestart",t)),this._zooming&&!o.zooming&&this.fire(new c.k("zoomstart",t)),this._rotating&&!o.rotating&&this.fire(new c.k("rotatestart",t)),this._pitching&&!o.pitching&&this.fire(new c.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&n!==this._elevationTarget){let o=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(o-(n-(o*t+this._elevationStart))/(1-t)),this._elevationTarget=n}this.transform.elevation=c.B.number(this._elevationStart,this._elevationTarget,t)}_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(t){if(!this.transformCameraUpdate)return;let n=t.clone(),{center:o,zoom:l,pitch:u,bearing:I,elevation:m}=this.transformCameraUpdate(n);o&&(n.center=o),l!==void 0&&(n.zoom=l),u!==void 0&&(n.pitch=u),I!==void 0&&(n.bearing=I),m!==void 0&&(n.elevation=m),this.transform.apply(n)}_fireMoveEvents(t){this.fire(new c.k("move",t)),this._zooming&&this.fire(new c.k("zoom",t)),this._rotating&&this.fire(new c.k("rotate",t)),this._pitching&&this.fire(new c.k("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;let o=this._zooming,l=this._rotating,u=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,o&&this.fire(new c.k("zoomend",t)),l&&this.fire(new c.k("rotateend",t)),u&&this.fire(new c.k("pitchend",t)),this.fire(new c.k("moveend",t))}flyTo(t,n){if(!t.essential&&c.h.prefersReducedMotion){let qe=c.F(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(qe,n)}this.stop(),t=c.e({offset:[0,0],speed:1.2,curve:1.42,easing:c.bb},t);let o=this._getTransformForUpdate(),l=this.getZoom(),u=this.getBearing(),I=this.getPitch(),m=this.getPadding(),f="zoom"in t?c.ad(+t.zoom,o.minZoom,o.maxZoom):l,y="bearing"in t?this._normalizeBearing(t.bearing,u):u,_="pitch"in t?+t.pitch:I,v="padding"in t?t.padding:o.padding,B=o.zoomScale(f-l),K=c.P.convert(t.offset),F=o.centerPoint.add(K),L=o.pointLocation(F),J=c.L.convert(t.center||L);this._normalizeCenter(J);let $=o.project(L),ge=o.project(J).sub($),D=t.curve,ie=Math.max(o.width,o.height),de=ie/B,pe=ge.mag();if("minZoom"in t){let qe=c.ad(Math.min(t.minZoom,l,f),o.minZoom,o.maxZoom),Yt=ie/o.zoomScale(qe-l);D=Math.sqrt(Yt/pe*2)}let ve=D*D;function Be(qe){let Yt=(de*de-ie*ie+(qe?-1:1)*ve*ve*pe*pe)/(2*(qe?de:ie)*ve*pe);return Math.log(Math.sqrt(Yt*Yt+1)-Yt)}function Ze(qe){return(Math.exp(qe)-Math.exp(-qe))/2}function Te(qe){return(Math.exp(qe)+Math.exp(-qe))/2}let je=Be(!1),St=function(qe){return Te(je)/Te(je+D*qe)},Xe=function(qe){return ie*((Te(je)*(Ze(Yt=je+D*qe)/Te(Yt))-Ze(je))/ve)/pe;var Yt},lt=(Be(!0)-je)/D;if(Math.abs(pe)<1e-6||!isFinite(lt)){if(Math.abs(ie-de)<1e-6)return this.easeTo(t,n);let qe=det.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=u!==y,this._pitching=_!==I,this._padding=!o.isPaddingEqual(v),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(J),this._ease(qe=>{let Yt=qe*lt,xt=1/St(Yt);o.zoom=qe===1?f:l+o.scaleZoom(xt),this._rotating&&(o.bearing=c.B.number(u,y,qe)),this._pitching&&(o.pitch=c.B.number(I,_,qe)),this._padding&&(o.interpolatePadding(m,v,qe),F=o.centerPoint.add(K)),this.terrain&&!t.freezeElevation&&this._updateElevation(qe);let bt=qe===1?J:o.unproject($.add(ge.mult(Xe(Yt))).mult(xt));o.setLocationAtPoint(o.renderWorldCopies?bt.wrap():bt,F),this._applyUpdatedTransform(o),this._fireMoveEvents(n)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(n)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let o=this._onEaseEnd;delete this._onEaseEnd,o.call(this,n)}if(!t){let o=this.handlers;o&&o.stop(!1)}return this}_ease(t,n,o){o.animate===!1||o.duration===0?(t(1),n()):(this._easeStart=c.h.now(),this._easeOptions=o,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){t=c.b5(t,-180,180);let o=Math.abs(t-n);return Math.abs(t-360-n)180?-360:o<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(c.L.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}class Fs{constructor(t={}){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=n=>{!n||n.sourceDataType!=="metadata"&&n.sourceDataType!=="visibility"&&n.dataType!=="style"&&n.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=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options&&this.options.compact,this._container=ee.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=ee.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ee.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(){ee.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(t,n){let o=this._map._getUIString(`AttributionControl.${n}`);t.title=o,t.setAttribute("aria-label",o)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(l=>typeof l!="string"?"":l)):typeof this.options.customAttribution=="string"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let l=this._map.style.stylesheet;this.styleOwner=l.owner,this.styleId=l.id}let n=this._map.style.sourceCaches;for(let l in n){let u=n[l];if(u.used||u.usedForTerrain){let I=u.getSource();I.attribution&&t.indexOf(I.attribution)<0&&t.push(I.attribution)}}t=t.filter(l=>String(l).trim()),t.sort((l,u)=>l.length-u.length),t=t.filter((l,u)=>{for(let I=u+1;I=0)return!1;return!0});let o=t.join(" | ");o!==this._attribHTML&&(this._attribHTML=o,t.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class ti{constructor(t={}){this._updateCompact=()=>{let n=this._container.children;if(n.length){let o=n[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&o.classList.add("maplibregl-compact"):o.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=ee.create("div","maplibregl-ctrl");let n=ee.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){ee.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ao{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){let n=this._currentlyRunning,o=n?this._queue.concat(n):this._queue;for(let l of o)if(l.id===t)return void(l.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let n=this._currentlyRunning=this._queue;this._queue=[];for(let o of n)if(!o.cancelled&&(o.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}let ra={"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":"Mapbox 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.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var nl=c.Q([{name:"a_pos3d",type:"Int16",components:3}]);class rl extends c.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,n){this.sourceCache.update(t,n),this._renderableTilesKeys=[];let o={};for(let l of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n}))o[l.key]=!0,this._renderableTilesKeys.push(l.key),this._tiles[l.key]||(l.posMatrix=new Float64Array(16),c.aS(l.posMatrix,0,c.N,0,c.N,0,1),this._tiles[l.key]=new dn(l,this.tileSize));for(let l in this._tiles)o[l]||delete this._tiles[l]}freeRtt(t){for(let n in this._tiles){let o=this._tiles[n];(!t||o.tileID.equals(t)||o.tileID.isChildOf(t)||t.isChildOf(o.tileID))&&(o.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){let n={};for(let o of this._renderableTilesKeys){let l=this._tiles[o].tileID;if(l.canonical.equals(t.canonical)){let u=t.clone();u.posMatrix=new Float64Array(16),c.aS(u.posMatrix,0,c.N,0,c.N,0,1),n[o]=u}else if(l.canonical.isChildOf(t.canonical)){let u=t.clone();u.posMatrix=new Float64Array(16);let I=l.canonical.z-t.canonical.z,m=l.canonical.x-(l.canonical.x>>I<>I<>I;c.aS(u.posMatrix,0,y,0,y,0,1),c.$(u.posMatrix,u.posMatrix,[-m*y,-f*y,0]),n[o]=u}else if(t.canonical.isChildOf(l.canonical)){let u=t.clone();u.posMatrix=new Float64Array(16);let I=t.canonical.z-l.canonical.z,m=t.canonical.x-(t.canonical.x>>I<>I<>I;c.aS(u.posMatrix,0,c.N,0,c.N,0,1),c.$(u.posMatrix,u.posMatrix,[m*y,f*y,0]),c.a0(u.posMatrix,u.posMatrix,[1/2**I,1/2**I,0]),n[o]=u}}return n}getSourceTile(t,n){let o=this.sourceCache._source,l=t.overscaledZ-this.deltaZoom;if(l>o.maxzoom&&(l=o.maxzoom),l=o.minzoom&&(!u||!u.dem);)u=this.sourceCache.getTileByID(t.scaledTo(l--).key);return u}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(n=>n.timeAdded>=t)}}class ol{constructor(t,n,o){this.painter=t,this.sourceCache=new rl(n),this.options=o,this.exaggeration=typeof o.exaggeration=="number"?o.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,n,o,l=c.N){var u;if(!(n>=0&&n=0&&ot.canonical.z&&(t.canonical.z>=l?u=t.canonical.z-l:c.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let I=t.canonical.x-(t.canonical.x>>u<>u<>8<<4|u>>8,n[I+3]=0;let o=new c.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),l=new Vt(t,o,t.gl.RGBA,{premultiply:!1});return l.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=l,l}pointCoordinate(t){let n=new Uint8Array(4),o=this.painter.context,l=o.gl;o.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),l.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,n),o.bindFramebuffer.set(null);let u=n[0]+(n[2]>>4<<8),I=n[1]+((15&n[2])<<8),m=this.coordsIndex[255-n[3]],f=m&&this.sourceCache.getTileByID(m);if(!f)return null;let y=this._coordsTextureSize,_=(1<0&&Math.sign(u)<0||!o&&Math.sign(l)<0&&Math.sign(u)>0?(l=360*Math.sign(u)+l,c.G(l)):n}}class Ul{constructor(t,n,o){this._context=t,this._size=n,this._tileSize=o,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){let n=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),o=new Vt(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return o.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),n.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),n.colorAttachment.set(o.texture),{id:t,fbo:n,texture:o,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(n=>t.id!==n),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(let n of this._recentlyUsed)if(!this._objects[n].inUse)return this._objects[n];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(let t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length!t.inUse)===!1}}let us={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class yo{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new Ul(t.context,30,n.sourceCache.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(o=>!t._layers[o].isHidden(n)),this._coordsDescendingInv={};for(let o in t.sourceCaches){this._coordsDescendingInv[o]={};let l=t.sourceCaches[o].getVisibleCoordinates();for(let u of l){let I=this.terrain.sourceCache.getTerrainCoords(u);for(let m in I)this._coordsDescendingInv[o][m]||(this._coordsDescendingInv[o][m]=[]),this._coordsDescendingInv[o][m].push(I[m])}}this._coordsDescendingInvStr={};for(let o of t._order){let l=t._layers[o],u=l.source;if(us[l.type]&&!this._coordsDescendingInvStr[u]){this._coordsDescendingInvStr[u]={};for(let I in this._coordsDescendingInv[u])this._coordsDescendingInvStr[u][I]=this._coordsDescendingInv[u][I].map(m=>m.key).sort().join()}}for(let o of this._renderableTiles)for(let l in this._coordsDescendingInvStr){let u=this._coordsDescendingInvStr[l][o.tileID.key];u&&u!==o.rttCoords[l]&&(o.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;let n=t.type,o=this.painter,l=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(us[n]&&(this._prevType&&us[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!l))return!0;if(us[this._prevType]||us[n]&&l){this._prevType=n;let u=this._stacks.length-1,I=this._stacks[u]||[];for(let m of this._renderableTiles){if(this.pool.isFull()&&(pi(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(m),m.rtt[u]){let y=this.pool.getObjectForId(m.rtt[u].id);if(y.stamp===m.rtt[u].stamp){this.pool.useObject(y);continue}}let f=this.pool.getOrCreateFreeObject();this.pool.useObject(f),this.pool.stampObject(f),m.rtt[u]={id:f.id,stamp:f.stamp},o.context.bindFramebuffer.set(f.fbo.framebuffer),o.context.clear({color:c.aT.transparent,stencil:0}),o.currentStencilSource=void 0;for(let y=0;y{g.touchstart=g.dragStart,g.touchmoveWindow=g.dragMove,g.touchend=g.dragEnd},oa={showCompass:!0,showZoom:!0,visualizePitch:!1};class aa{constructor(t,n,o=!1){this.mousedown=I=>{this.startMouse(c.e({},I,{ctrlKey:!0,preventDefault:()=>I.preventDefault()}),ee.mousePos(this.element,I)),ee.addEventListener(window,"mousemove",this.mousemove),ee.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=I=>{this.moveMouse(I,ee.mousePos(this.element,I))},this.mouseup=I=>{this.mouseRotate.dragEnd(I),this.mousePitch&&this.mousePitch.dragEnd(I),this.offTemp()},this.touchstart=I=>{I.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=ee.touchPos(this.element,I.targetTouches)[0],this.startTouch(I,this._startPos),ee.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),ee.addEventListener(window,"touchend",this.touchend))},this.touchmove=I=>{I.targetTouches.length!==1?this.reset():(this._lastPos=ee.touchPos(this.element,I.targetTouches)[0],this.moveTouch(I,this._lastPos))},this.touchend=I=>{I.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){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 l=t.dragRotate._mouseRotate.getClickTolerance(),u=t.dragRotate._mousePitch.getClickTolerance();this.element=n,this.mouseRotate=br({clickTolerance:l,enable:!0}),this.touchRotate=(({enable:I,clickTolerance:m,bearingDegreesPerPixelMoved:f=.8})=>{let y=new qa;return new Tn({clickTolerance:m,move:(_,v)=>({bearingDelta:(v.x-_.x)*f}),moveStateManager:y,enable:I,assignEvents:Yr})})({clickTolerance:l,enable:!0}),this.map=t,o&&(this.mousePitch=Wn({clickTolerance:u,enable:!0}),this.touchPitch=(({enable:I,clickTolerance:m,pitchDegreesPerPixelMoved:f=-.5})=>{let y=new qa;return new Tn({clickTolerance:m,move:(_,v)=>({pitchDelta:(v.y-_.y)*f}),moveStateManager:y,enable:I,assignEvents:Yr})})({clickTolerance:u,enable:!0})),ee.addEventListener(n,"mousedown",this.mousedown),ee.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),ee.addEventListener(n,"touchcancel",this.reset)}startMouse(t,n){this.mouseRotate.dragStart(t,n),this.mousePitch&&this.mousePitch.dragStart(t,n),ee.disableDrag()}startTouch(t,n){this.touchRotate.dragStart(t,n),this.touchPitch&&this.touchPitch.dragStart(t,n),ee.disableDrag()}moveMouse(t,n){let o=this.map,{bearingDelta:l}=this.mouseRotate.dragMove(t,n)||{};if(l&&o.setBearing(o.getBearing()+l),this.mousePitch){let{pitchDelta:u}=this.mousePitch.dragMove(t,n)||{};u&&o.setPitch(o.getPitch()+u)}}moveTouch(t,n){let o=this.map,{bearingDelta:l}=this.touchRotate.dragMove(t,n)||{};if(l&&o.setBearing(o.getBearing()+l),this.touchPitch){let{pitchDelta:u}=this.touchPitch.dragMove(t,n)||{};u&&o.setPitch(o.getPitch()+u)}}off(){let t=this.element;ee.removeEventListener(t,"mousedown",this.mousedown),ee.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),ee.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),ee.removeEventListener(window,"touchend",this.touchend),ee.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){ee.enableDrag(),ee.removeEventListener(window,"mousemove",this.mousemove),ee.removeEventListener(window,"mouseup",this.mouseup),ee.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),ee.removeEventListener(window,"touchend",this.touchend)}}let vi;function la(g,t,n){if(g=new c.L(g.lng,g.lat),t){let o=new c.L(g.lng-360,g.lat),l=new c.L(g.lng+360,g.lat),u=n.locationPoint(g).distSqr(t);n.locationPoint(o).distSqr(t)180;){let o=n.locationPoint(g);if(o.x>=0&&o.y>=0&&o.x<=n.width&&o.y<=n.height)break;g.lng>n.center.lng?g.lng-=360:g.lng+=360}return g}let $s={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 al(g,t,n){let o=g.classList;for(let l in $s)o.remove(`maplibregl-${n}-anchor-${l}`);o.add(`maplibregl-${n}-anchor-${t}`)}class sr extends c.E{constructor(t){if(super(),this._onKeyPress=n=>{let o=n.code,l=n.charCode||n.keyCode;o!=="Space"&&o!=="Enter"&&l!==32&&l!==13||this.togglePopup()},this._onMapClick=n=>{let o=n.originalEvent.target,l=this._element;this._popup&&(o===l||l.contains(o))&&this.togglePopup()},this._update=n=>{if(!this._map)return;let o=this._map.loaded()&&!this._map.isMoving();(n?.type==="terrain"||n?.type==="render"&&!o)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=la(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let l="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?l=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(l=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let u="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?u="rotateX(0deg)":this._pitchAlignment==="map"&&(u=`rotateX(${this._map.getPitch()}deg)`),n&&n.type!=="moveend"||(this._pos=this._pos.round()),ee.setTransform(this._element,`${$s[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${u} ${l}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{let I=this._map.unproject(this._pos),m=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=I.distanceTo(this._lngLat)>20*m?"0.2":"1.0",this._opacityTimeout=null},100))},this._onMove=n=>{if(!this._isDragging){let o=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=o}this._isDragging&&(this._pos=n.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 c.k("dragstart"))),this.fire(new c.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 c.k("dragend")),this._state="inactive"},this._addDragHandler=n=>{this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.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=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,t&&t.element)this._element=t.element,this._offset=c.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=ee.create("div"),this._element.setAttribute("aria-label","Map marker");let n=ee.createNS("http://www.w3.org/2000/svg","svg"),o=41,l=27;n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height",`${o}px`),n.setAttributeNS(null,"width",`${l}px`),n.setAttributeNS(null,"viewBox",`0 0 ${l} ${o}`);let u=ee.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"stroke","none"),u.setAttributeNS(null,"stroke-width","1"),u.setAttributeNS(null,"fill","none"),u.setAttributeNS(null,"fill-rule","evenodd");let I=ee.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"fill-rule","nonzero");let m=ee.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(3.0, 29.0)"),m.setAttributeNS(null,"fill","#000000");let f=[{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 $ of f){let ge=ee.createNS("http://www.w3.org/2000/svg","ellipse");ge.setAttributeNS(null,"opacity","0.04"),ge.setAttributeNS(null,"cx","10.5"),ge.setAttributeNS(null,"cy","5.80029008"),ge.setAttributeNS(null,"rx",$.rx),ge.setAttributeNS(null,"ry",$.ry),m.appendChild(ge)}let y=ee.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill",this._color);let _=ee.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"),y.appendChild(_);let v=ee.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"opacity","0.25"),v.setAttributeNS(null,"fill","#000000");let B=ee.createNS("http://www.w3.org/2000/svg","path");B.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"),v.appendChild(B);let K=ee.createNS("http://www.w3.org/2000/svg","g");K.setAttributeNS(null,"transform","translate(6.0, 7.0)"),K.setAttributeNS(null,"fill","#FFFFFF");let F=ee.createNS("http://www.w3.org/2000/svg","g");F.setAttributeNS(null,"transform","translate(8.0, 8.0)");let L=ee.createNS("http://www.w3.org/2000/svg","circle");L.setAttributeNS(null,"fill","#000000"),L.setAttributeNS(null,"opacity","0.25"),L.setAttributeNS(null,"cx","5.5"),L.setAttributeNS(null,"cy","5.5"),L.setAttributeNS(null,"r","5.4999962");let J=ee.createNS("http://www.w3.org/2000/svg","circle");J.setAttributeNS(null,"fill","#FFFFFF"),J.setAttributeNS(null,"cx","5.5"),J.setAttributeNS(null,"cy","5.5"),J.setAttributeNS(null,"r","5.4999962"),F.appendChild(L),F.appendChild(J),I.appendChild(m),I.appendChild(y),I.appendChild(v),I.appendChild(K),I.appendChild(F),n.appendChild(I),n.setAttributeNS(null,"height",o*this._scale+"px"),n.setAttributeNS(null,"width",l*this._scale+"px"),this._element.appendChild(n),this._offset=c.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",n=>{n.preventDefault()}),this._element.addEventListener("mousedown",n=>{n.preventDefault()}),al(this._element,this._anchor,"marker"),t&&t.className)for(let n of t.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.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),ee.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=c.L.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){let l=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[l,-1*(38.1-13.5+l)],"bottom-right":[-l,-1*(38.1-13.5+l)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,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 t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}getOffset(){return this._offset}setOffset(t){return this._offset=c.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(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(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}let Ii={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},ui=0,vr=!1,Nr={maxWidth:100,unit:"metric"};function Or(g,t,n){let o=n&&n.maxWidth||100,l=g._container.clientHeight/2,u=g.unproject([0,l]),I=g.unproject([o,l]),m=u.distanceTo(I);if(n&&n.unit==="imperial"){let f=3.2808*m;f>5280?nr(t,o,f/5280,g._getUIString("ScaleControl.Miles")):nr(t,o,f,g._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?nr(t,o,m/1852,g._getUIString("ScaleControl.NauticalMiles")):m>=1e3?nr(t,o,m/1e3,g._getUIString("ScaleControl.Kilometers")):nr(t,o,m,g._getUIString("ScaleControl.Meters"))}function nr(g,t,n,o){let l=function(u){let I=Math.pow(10,`${Math.floor(u)}`.length-1),m=u/I;return m=m>=10?10:m>=5?5:m>=3?3:m>=2?2:m>=1?1:function(f){let y=Math.pow(10,Math.ceil(-Math.log(f)/Math.LN10));return Math.round(f*y)/y}(m),I*m}(n);g.style.width=t*(l/n)+"px",g.innerHTML=`${l} ${o}`}let ca={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ga=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function xr(g){if(g){if(typeof g=="number"){let t=Math.round(Math.abs(g)/Math.SQRT2);return{center:new c.P(0,0),top:new c.P(0,g),"top-left":new c.P(t,t),"top-right":new c.P(-t,t),bottom:new c.P(0,-g),"bottom-left":new c.P(t,-t),"bottom-right":new c.P(-t,-t),left:new c.P(g,0),right:new c.P(-g,0)}}if(g instanceof c.P||Array.isArray(g)){let t=c.P.convert(g);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:c.P.convert(g.center||[0,0]),top:c.P.convert(g.top||[0,0]),"top-left":c.P.convert(g["top-left"]||[0,0]),"top-right":c.P.convert(g["top-right"]||[0,0]),bottom:c.P.convert(g.bottom||[0,0]),"bottom-left":c.P.convert(g["bottom-left"]||[0,0]),"bottom-right":c.P.convert(g["bottom-right"]||[0,0]),left:c.P.convert(g.left||[0,0]),right:c.P.convert(g.right||[0,0])}}return xr(new c.P(0,0))}let ha={extend:(g,...t)=>c.e(g,...t),run(g){g()},logToElement(g,t=!1,n="log"){let o=window.document.getElementById(n);o&&(t&&(o.innerHTML=""),o.innerHTML+=`
${g}`)}},ua=De;class Lt{static get version(){return ua}static get workerCount(){return Ys.workerCount}static set workerCount(t){Ys.workerCount=t}static get maxParallelImageRequests(){return c.c.MAX_PARALLEL_IMAGE_REQUESTS}static set maxParallelImageRequests(t){c.c.MAX_PARALLEL_IMAGE_REQUESTS=t}static get workerUrl(){return c.c.WORKER_URL}static set workerUrl(t){c.c.WORKER_URL=t}static addProtocol(t,n){c.c.REGISTERED_PROTOCOLS[t]=n}static removeProtocol(t){delete c.c.REGISTERED_PROTOCOLS[t]}}return Lt.Map=class extends sl{constructor(g){if(c.bg.mark(c.bh.create),(g=c.e({},at,g)).minZoom!=null&&g.maxZoom!=null&&g.minZoom>g.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(g.minPitch!=null&&g.maxPitch!=null&&g.minPitch>g.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(g.minPitch!=null&&g.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(g.maxPitch!=null&&g.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Io(g.minZoom,g.maxZoom,g.minPitch,g.maxPitch,g.renderWorldCopies),{bearingSnap:g.bearingSnap}),this._cooperativeGesturesOnWheel=t=>{this._onCooperativeGesture(t,t[this._metaKey],1)},this._contextLost=t=>{t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new c.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new c.k("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=g.interactive,this._cooperativeGestures=g.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileCacheSize=g.maxTileCacheSize,this._maxTileCacheZoomLevels=g.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=g.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=g.preserveDrawingBuffer,this._antialias=g.antialias,this._trackResize=g.trackResize,this._bearingSnap=g.bearingSnap,this._refreshExpiredTiles=g.refreshExpiredTiles,this._fadeDuration=g.fadeDuration,this._crossSourceCollisions=g.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=g.collectResourceTiming,this._renderTaskQueue=new Ao,this._controls=[],this._mapId=c.a2(),this._locale=c.e({},ra,g.locale),this._clickTolerance=g.clickTolerance,this._overridePixelRatio=g.pixelRatio,this._maxCanvasSize=g.maxCanvasSize,this.transformCameraUpdate=g.transformCameraUpdate,this._imageQueueHandle=Qt.addThrottleControl(()=>this.isMoving()),this._requestManager=new qi(g.transformRequest),typeof g.container=="string"){if(this._container=document.getElementById(g.container),!this._container)throw new Error(`Container '${g.container}' not found.`)}else{if(!(g.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=g.container}if(g.maxBounds&&this.setMaxBounds(g.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 t=!1,n=ir(o=>{this._trackResize&&!this._removed&&this.resize(o)._update()},50);this._resizeObserver=new ResizeObserver(o=>{t?n(o):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new na(this,g),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=g.hash&&new Lr(typeof g.hash=="string"&&g.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:g.center,zoom:g.zoom,bearing:g.bearing,pitch:g.pitch}),g.bounds&&(this.resize(),this.fitBounds(g.bounds,c.e({},g.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=g.localIdeographFontFamily,this._validateStyle=g.validateStyle,g.style&&this.setStyle(g.style,{localIdeographFontFamily:g.localIdeographFontFamily}),g.attributionControl&&this.addControl(new Fs({customAttribution:g.customAttribution})),g.maplibreLogo&&this.addControl(new ti,g.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this._update(t.dataType==="style"),this.fire(new c.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new c.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new c.k("sourcedataabort",t))})}_getMapId(){return this._mapId}addControl(g,t){if(t===void 0&&(t=g.getDefaultPosition?g.getDefaultPosition():"top-right"),!g||!g.onAdd)return this.fire(new c.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let n=g.onAdd(this);this._controls.push(g);let o=this._controlPositions[t];return t.indexOf("bottom")!==-1?o.insertBefore(n,o.firstChild):o.appendChild(n),this}removeControl(g){if(!g||!g.onRemove)return this.fire(new c.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let t=this._controls.indexOf(g);return t>-1&&this._controls.splice(t,1),g.onRemove(this),this}hasControl(g){return this._controls.indexOf(g)>-1}calculateCameraOptionsFromTo(g,t,n,o){return o==null&&this.terrain&&(o=this.terrain.getElevationForLngLatZoom(n,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(g,t,n,o)}resize(g){var t;let n=this._containerDimensions(),o=n[0],l=n[1],u=this._getClampedPixelRatio(o,l);if(this._resizeCanvas(o,l,u),this.painter.resize(o,l,u),this.painter.overLimit()){let m=this.painter.context.gl;this._maxCanvasSize=[m.drawingBufferWidth,m.drawingBufferHeight];let f=this._getClampedPixelRatio(o,l);this._resizeCanvas(o,l,f),this.painter.resize(o,l,f)}this.transform.resize(o,l),(t=this._requestedCameraState)===null||t===void 0||t.resize(o,l);let I=!this._moving;return I&&(this.stop(),this.fire(new c.k("movestart",g)).fire(new c.k("move",g))),this.fire(new c.k("resize",g)),I&&this.fire(new c.k("moveend",g)),this}_getClampedPixelRatio(g,t){let{0:n,1:o}=this._maxCanvasSize,l=this.getPixelRatio(),u=g*l,I=t*l;return Math.min(u>n?n/u:1,I>o?o/I:1)*l}getPixelRatio(){var g;return(g=this._overridePixelRatio)!==null&&g!==void 0?g:devicePixelRatio}setPixelRatio(g){this._overridePixelRatio=g,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(g){return this.transform.setMaxBounds(ht.convert(g)),this._update()}setMinZoom(g){if((g=g??-2)>=-2&&g<=this.transform.maxZoom)return this.transform.minZoom=g,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=g,this._update(),this.getZoom()>g&&this.setZoom(g),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(g){if((g=g??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(g>=0&&g<=this.transform.maxPitch)return this.transform.minPitch=g,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(g>=this.transform.minPitch)return this.transform.maxPitch=g,this._update(),this.getPitch()>g&&this.setPitch(g),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(g){return this.transform.renderWorldCopies=g,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(g){return this._cooperativeGestures=g,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(g){return this.transform.locationPoint(c.L.convert(g),this.style&&this.terrain)}unproject(g){return this.transform.pointLocation(c.P.convert(g),this.terrain)}isMoving(){var g;return this._moving||((g=this.handlers)===null||g===void 0?void 0:g.isMoving())}isZooming(){var g;return this._zooming||((g=this.handlers)===null||g===void 0?void 0:g.isZooming())}isRotating(){var g;return this._rotating||((g=this.handlers)===null||g===void 0?void 0:g.isRotating())}_createDelegatedListener(g,t,n){if(g==="mouseenter"||g==="mouseover"){let o=!1;return{layer:t,listener:n,delegates:{mousemove:u=>{let I=this.getLayer(t)?this.queryRenderedFeatures(u.point,{layers:[t]}):[];I.length?o||(o=!0,n.call(this,new Ms(g,this,u.originalEvent,{features:I}))):o=!1},mouseout:()=>{o=!1}}}}if(g==="mouseleave"||g==="mouseout"){let o=!1;return{layer:t,listener:n,delegates:{mousemove:I=>{(this.getLayer(t)?this.queryRenderedFeatures(I.point,{layers:[t]}):[]).length?o=!0:o&&(o=!1,n.call(this,new Ms(g,this,I.originalEvent)))},mouseout:I=>{o&&(o=!1,n.call(this,new Ms(g,this,I.originalEvent)))}}}}{let o=l=>{let u=this.getLayer(t)?this.queryRenderedFeatures(l.point,{layers:[t]}):[];u.length&&(l.features=u,n.call(this,l),delete l.features)};return{layer:t,listener:n,delegates:{[g]:o}}}}on(g,t,n){if(n===void 0)return super.on(g,t);let o=this._createDelegatedListener(g,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[g]=this._delegatedListeners[g]||[],this._delegatedListeners[g].push(o);for(let l in o.delegates)this.on(l,o.delegates[l]);return this}once(g,t,n){if(n===void 0)return super.once(g,t);let o=this._createDelegatedListener(g,t,n);for(let l in o.delegates)this.once(l,o.delegates[l]);return this}off(g,t,n){return n===void 0?super.off(g,t):(this._delegatedListeners&&this._delegatedListeners[g]&&(o=>{let l=this._delegatedListeners[g];for(let u=0;uthis._updateStyle(g,t));let n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!g)),g?(this.style=new bi(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof g=="string"?this.style.loadURL(g,t,n):this.style.loadJSON(g,t,n),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new bi(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(g,t){if(typeof g=="string"){let n=this._requestManager.transformRequest(g,qt.Style);c.f(n,(o,l)=>{o?this.fire(new c.j(o)):l&&this._updateDiff(l,t)})}else typeof g=="object"&&this._updateDiff(g,t)}_updateDiff(g,t){try{this.style.setState(g,t)&&this._update(!0)}catch(n){c.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(g,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():c.w("There is no style added to the map.")}addSource(g,t){return this._lazyInitEmptyStyle(),this.style.addSource(g,t),this._update(!0)}isSourceLoaded(g){let t=this.style&&this.style.sourceCaches[g];if(t!==void 0)return t.loaded();this.fire(new c.j(new Error(`There is no source with ID '${g}'`)))}setTerrain(g){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),g){let t=this.style.sourceCaches[g.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${g.source}`);for(let n in this.style._layers){let o=this.style._layers[n];o.type==="hillshade"&&o.source===g.source&&c.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new ol(this.painter,t,g),this.painter.renderToTexture=new yo(this.painter,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=n=>{n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId!==g.source||this._elevationFreeze||(this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0;return this.fire(new c.k("terrain",{terrain:g})),this}getTerrain(){var g,t;return(t=(g=this.terrain)===null||g===void 0?void 0:g.options)!==null&&t!==void 0?t:null}areTilesLoaded(){let g=this.style&&this.style.sourceCaches;for(let t in g){let n=g[t]._tiles;for(let o in n){let l=n[o];if(l.state!=="loaded"&&l.state!=="errored")return!1}}return!0}addSourceType(g,t,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(g,t,n)}removeSource(g){return this.style.removeSource(g),this._update(!0)}getSource(g){return this.style.getSource(g)}addImage(g,t,n={}){let{pixelRatio:o=1,sdf:l=!1,stretchX:u,stretchY:I,content:m}=n;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||c.a(t))){if(t.width===void 0||t.height===void 0)return this.fire(new c.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:f,height:y,data:_}=t,v=t;return this.style.addImage(g,{data:new c.R({width:f,height:y},new Uint8Array(_)),pixelRatio:o,stretchX:u,stretchY:I,content:m,sdf:l,version:0,userImage:v}),v.onAdd&&v.onAdd(this,g),this}}{let{width:f,height:y,data:_}=c.h.getImageData(t);this.style.addImage(g,{data:new c.R({width:f,height:y},_),pixelRatio:o,stretchX:u,stretchY:I,content:m,sdf:l,version:0})}}updateImage(g,t){let n=this.style.getImage(g);if(!n)return this.fire(new c.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let o=t instanceof HTMLImageElement||c.a(t)?c.h.getImageData(t):t,{width:l,height:u,data:I}=o;if(l===void 0||u===void 0)return this.fire(new c.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(l!==n.data.width||u!==n.data.height)return this.fire(new c.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));let m=!(t instanceof HTMLImageElement||c.a(t));return n.data.replace(I,m),this.style.updateImage(g,n),this}getImage(g){return this.style.getImage(g)}hasImage(g){return g?!!this.style.getImage(g):(this.fire(new c.j(new Error("Missing required image id"))),!1)}removeImage(g){this.style.removeImage(g)}loadImage(g,t){Qt.getImage(this._requestManager.transformRequest(g,qt.Image),t)}listImages(){return this.style.listImages()}addLayer(g,t){return this._lazyInitEmptyStyle(),this.style.addLayer(g,t),this._update(!0)}moveLayer(g,t){return this.style.moveLayer(g,t),this._update(!0)}removeLayer(g){return this.style.removeLayer(g),this._update(!0)}getLayer(g){return this.style.getLayer(g)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(g,t,n){return this.style.setLayerZoomRange(g,t,n),this._update(!0)}setFilter(g,t,n={}){return this.style.setFilter(g,t,n),this._update(!0)}getFilter(g){return this.style.getFilter(g)}setPaintProperty(g,t,n,o={}){return this.style.setPaintProperty(g,t,n,o),this._update(!0)}getPaintProperty(g,t){return this.style.getPaintProperty(g,t)}setLayoutProperty(g,t,n,o={}){return this.style.setLayoutProperty(g,t,n,o),this._update(!0)}getLayoutProperty(g,t){return this.style.getLayoutProperty(g,t)}setGlyphs(g,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(g,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(g,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(g,t,n,o=>{o||this._update(!0)}),this}removeSprite(g){return this._lazyInitEmptyStyle(),this.style.removeSprite(g),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(g,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(g,t,n=>{n||this._update(!0)}),this}setLight(g,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(g,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(g,t){return this.style.setFeatureState(g,t),this._update()}removeFeatureState(g,t){return this.style.removeFeatureState(g,t),this._update()}getFeatureState(g){return this.style.getFeatureState(g)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let g=0,t=0;return this._container&&(g=this._container.clientWidth||400,t=this._container.clientHeight||300),[g,t]}_setupContainer(){let g=this._container;g.classList.add("maplibregl-map");let t=this._canvasContainer=ee.create("div","maplibregl-canvas-container",g);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=ee.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");let n=this._containerDimensions(),o=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],o);let l=this._controlContainer=ee.create("div","maplibregl-control-container",g),u=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(I=>{u[I]=ee.create("div",`maplibregl-ctrl-${I} `,l)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=ee.create("div","maplibregl-cooperative-gesture-screen",this._container);let g=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(g=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=` +
${g}
+
${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
+ `,this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){ee.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(g,t,n){this._canvas.width=Math.floor(n*g),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${g}px`,this._canvas.style.height=`${t}px`}_setupPainter(){let g={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},t=null;this._canvas.addEventListener("webglcontextcreationerror",o=>{t={requestedAttributes:g},o&&(t.statusMessage=o.statusMessage,t.type=o.type)},{once:!0});let n=this._canvas.getContext("webgl2",g)||this._canvas.getContext("webgl",g);if(!n){let o="Failed to initialize WebGL";throw t?(t.message=o,new Error(JSON.stringify(t))):new Error(o)}this.painter=new tr(n,this.transform),yt.testSupport(n)}_onCooperativeGesture(g,t,n){return!t&&n<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(g){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||g,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(g){return this._update(),this._renderTaskQueue.add(g)}_cancelRenderFrame(g){this._renderTaskQueue.remove(g)}_render(g){let t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(g),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let l=this.transform.zoom,u=c.h.now();this.style.zoomHistory.update(l,u);let I=new c.a8(l,{now:u,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),m=I.crossFadingFactor();m===1&&m===this._crossFadingFactor||(n=!0,this._crossFadingFactor=m),this.style.update(I)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new c.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,c.bg.mark(c.bh.load),this.fire(new c.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let o=this._sourcesDirty||this._styleDirty||this._placementDirty;return o||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new c.k("idle")),!this._loaded||this._fullyLoaded||o||(this._fullyLoaded=!0,c.bg.mark(c.bh.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var g;this._hash&&this._hash.remove();for(let n of this._controls)n.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),Qt.removeThrottleControl(this._imageQueueHandle),(g=this._resizeObserver)===null||g===void 0||g.disconnect();let t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),ee.remove(this._canvasContainer),ee.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),c.bg.clearMetrics(),this._removed=!0,this.fire(new c.k("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=c.h.frame(g=>{c.bg.frame(g),this._frame=null,this._render(g)}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(g){this._showTileBoundaries!==g&&(this._showTileBoundaries=g,this._update())}get showPadding(){return!!this._showPadding}set showPadding(g){this._showPadding!==g&&(this._showPadding=g,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(g){this._showCollisionBoxes!==g&&(this._showCollisionBoxes=g,g?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(g){this._showOverdrawInspector!==g&&(this._showOverdrawInspector=g,this._update())}get repaint(){return!!this._repaint}set repaint(g){this._repaint!==g&&(this._repaint=g,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(g){this._vertices=g,this._update()}get version(){return tt}getCameraTargetElevation(){return this.transform.elevation}},Lt.NavigationControl=class{constructor(g){this._updateZoomButtons=()=>{let t=this._map.getZoom(),n=t===this._map.getMaxZoom(),o=t===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=o,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",o.toString())},this._rotateCompassArrow=()=>{let t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,n)=>{let o=this._map._getUIString(`NavigationControl.${n}`);t.title=o,t.setAttribute("aria-label",o)},this.options=c.e({},oa,g),this._container=ee.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),ee.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),ee.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=ee.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(g){return this._map=g,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new aa(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){ee.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(g,t){let n=ee.create("button",g,this._container);return n.type="button",n.addEventListener("click",t),n}},Lt.GeolocateControl=class extends c.E{constructor(g){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new c.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,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(t),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new c.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{let n=new c.L(t.coords.longitude,t.coords.latitude),o=t.coords.accuracy,l=this._map.getBearing(),u=c.e({bearing:l},this.options.fitBoundsOptions),I=ht.fromLngLat(n,o);this._map.fitBounds(I,u,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let n=new c.L(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.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=t=>{if(this._map){if(this.options.trackUserLocation)if(t.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 n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&vr)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new c.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=t=>{if(this._map){if(this._container.addEventListener("contextmenu",n=>n.preventDefault()),this._geolocateButton=ee.create("button","maplibregl-ctrl-geolocate",this._container),ee.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){c.w("Geolocation support is not available so the GeolocateControl will be disabled.");let n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}else{let n=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=ee.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new sr({element:this._dotElement}),this._circleElement=ee.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new sr({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",n=>{n.geolocateSource||this._watchState!=="ACTIVE_LOCK"||n.originalEvent&&n.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 c.k("trackuserlocationend")))})}},this.options=c.e({},Ii,g)}onAdd(g){return this._map=g,this._container=ee.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(t,n=!1){vi===void 0||n?window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(o=>{vi=o.state!=="denied",t(vi)}).catch(()=>{vi=!!window.navigator.geolocation,t(vi)}):(vi=!!window.navigator.geolocation,t(vi)):t(vi)}(this._setupUI),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(),ee.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ui=0,vr=!1}_isOutOfMapMaxBounds(g){let t=this._map.getMaxBounds(),n=g.coords;return t&&(n.longitudet.getEast()||n.latitudet.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 g=this._map.getBounds(),t=g.getSouthEast(),n=g.getNorthEast(),o=t.distanceTo(n),l=Math.ceil(this._accuracy/(o/this._map._container.clientHeight)*2);this._circleElement.style.width=`${l}px`,this._circleElement.style.height=`${l}px`}trigger(){if(!this._setup)return c.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 c.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ui--,vr=!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 c.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 c.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 g;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ui++,ui>1?(g={maximumAge:6e5,timeout:0},vr=!0):(g=this.options.positionOptions,vr=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,g)}}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)}},Lt.AttributionControl=Fs,Lt.LogoControl=ti,Lt.ScaleControl=class{constructor(g){this._onMove=()=>{Or(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Or(this._map,this._container,this.options)},this.options=c.e({},Nr,g)}getDefaultPosition(){return"bottom-left"}onAdd(g){return this._map=g,this._container=ee.create("div","maplibregl-ctrl maplibregl-ctrl-scale",g.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){ee.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},Lt.FullscreenControl=class extends c.E{constructor(g={}){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,g&&g.container&&(g.container instanceof HTMLElement?this._container=g.container:c.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(g){return this._map=g,this._container||(this._container=this._map.getContainer()),this._controlContainer=ee.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){ee.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let g=this._fullscreenButton=ee.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);ee.create("span","maplibregl-ctrl-icon",g).setAttribute("aria-hidden","true"),g.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let g=this._getTitle();this._fullscreenButton.setAttribute("aria-label",g),this._fullscreenButton.title=g}_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 c.k("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new c.k("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_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()}},Lt.TerrainControl=class{constructor(g){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))},this.options=g}onAdd(g){return this._map=g,this._container=ee.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=ee.create("button","maplibregl-ctrl-terrain",this._container),ee.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){ee.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},Lt.Popup=class extends c.E{constructor(g){super(),this.remove=()=>(this._content&&ee.remove(this._content),this._container&&(ee.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new c.k("close")),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=ee.create("div","maplibregl-popup",this._map.getContainer()),this._tip=ee.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let I of this.options.className.split(" "))this._container.classList.add(I);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=la(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!t)return;let n=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),o=this.options.anchor,l=xr(this.options.offset);if(!o){let I=this._container.offsetWidth,m=this._container.offsetHeight,f;f=n.y+l.bottom.ythis._map.transform.height-m?["bottom"]:[],n.xthis._map.transform.width-I/2&&f.push("right"),o=f.length===0?"bottom":f.join("-")}let u=n.add(l[o]).round();ee.setTransform(this._container,`${$s[o]} translate(${u.x}px,${u.y}px)`),al(this._container,o,"popup")},this._onClose=()=>{this.remove()},this.options=c.e(Object.create(ca),g)}addTo(g){return this._map&&this.remove(),this._map=g,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new c.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(g){return this._lngLat=c.L.convert(g),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(g){return this.setDOMContent(document.createTextNode(g))}setHTML(g){let t=document.createDocumentFragment(),n=document.createElement("body"),o;for(n.innerHTML=g;o=n.firstChild,o;)t.appendChild(o);return this.setDOMContent(t)}getMaxWidth(){var g;return(g=this._container)===null||g===void 0?void 0:g.style.maxWidth}setMaxWidth(g){return this.options.maxWidth=g,this._update(),this}setDOMContent(g){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=ee.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(g),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(g){this._container&&this._container.classList.add(g)}removeClassName(g){this._container&&this._container.classList.remove(g)}setOffset(g){return this.options.offset=g,this._update(),this}toggleClassName(g){if(this._container)return this._container.classList.toggle(g)}_createCloseButton(){this.options.closeButton&&(this._closeButton=ee.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let g=this._container.querySelector(ga);g&&g.focus()}},Lt.Marker=sr,Lt.Style=bi,Lt.LngLat=c.L,Lt.LngLatBounds=ht,Lt.Point=c.P,Lt.MercatorCoordinate=c.U,Lt.Evented=c.E,Lt.AJAXError=c.bi,Lt.config=c.c,Lt.CanvasSource=hn,Lt.GeoJSONSource=As,Lt.ImageSource=cs,Lt.RasterDEMTileSource=Ds,Lt.RasterTileSource=$i,Lt.VectorTileSource=Es,Lt.VideoSource=jn,Lt.setRTLTextPlugin=c.bj,Lt.getRTLTextPluginStatus=c.bk,Lt.prewarm=function(){Qn().acquire(Tt)},Lt.clearPrewarmedResources=function(){let g=Ns;g&&(g.isPreloaded()&&g.numActive()===1?(g.release(Tt),Ns=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},ha.extend(Lt,{isSafari:c.ac,getPerformanceMetrics:c.bg.getPerformanceMetrics}),Lt});var Ie=re;return Ie})});var Gh=cn((Vl,Tl)=>{(function(k,O){typeof Vl=="object"&&typeof Tl<"u"?O(Vl):typeof define=="function"&&define.amd?define(["exports"],O):O((k=typeof globalThis<"u"?globalThis:k||self).VectorTextProtocol={})})(Vl,function(k){"use strict";function O(W){return W&&W.__esModule&&Object.prototype.hasOwnProperty.call(W,"default")?W.default:W}function re(W){if(W.__esModule)return W;var z=W.default;if(typeof z=="function"){var V=function U(){return this instanceof U?Reflect.construct(z,arguments,this.constructor):z.apply(this,arguments)};V.prototype=z.prototype}else V={};return Object.defineProperty(V,"__esModule",{value:!0}),Object.keys(W).forEach(function(U){var j=Object.getOwnPropertyDescriptor(W,U);Object.defineProperty(V,U,j.get?j:{enumerable:!0,get:function(){return W[U]}})}),V}function ue(W){return new Function("d","return {"+W.map(function(z,V){return JSON.stringify(z)+": d["+V+"]"}).join(",")+"}")}function Ie(W){var z=new RegExp('["'+W+` +]`),V=W.charCodeAt(0);function U(ce,xe){var ye,me,le={},Ae={},be=[],ke=ce.length,ot=0,It=0;function Je(){if(ot>=ke)return Ae;if(me)return me=!1,le;var Ue,mt=ot;if(ce.charCodeAt(mt)===34){for(var ft=mt;ft++=0?0:1],U=Math.abs(W),j=Math.floor(U),se=60*(U-j),ce=Math.floor(se);return{whole:j,minutes:ce,seconds:Math.floor(60*(se-ce)),dir:V}}function as(W,z){if(z||(z="NSEW"),typeof W!="string")return null;var V=(W=W.toUpperCase()).match(/^[\s\,]*([NSEW])?\s*([\-|\—|\―]?[0-9.]+)[°º˚]?\s*(?:([0-9.]+)['’′‘]\s*)?(?:([0-9.]+)(?:''|"|”|″)\s*)?([NSEW])?/);if(!V)return null;var U,j=V[0];if(V[1]&&V[5]?(U=V[1],j=j.slice(0,-1)):U=V[1]||V[5],U&&z.indexOf(U)===-1)return null;var se=V[2]?parseFloat(V[2]):0,ce=V[3]?parseFloat(V[3])/60:0,xe=V[4]?parseFloat(V[4])/3600:0,ye=se<0?-1:1;return U!=="S"&&U!=="W"||(ye*=-1),{val:(Math.abs(se)+ce+xe)*ye,dim:U,matched:j,remain:W.slice(j.length)}}qi.exports=function(W,z){var V=as(W,z);return V===null?null:V.val},qi.exports.pair=function(W,z){var V=as(W=W.trim(),z);if(!V)return null;var U=as(W=V.remain.trim(),z);return!U||U.remain?null:V.dim?function(j,se,ce){if(ce==="N"||ce==="S")return[j,se];if(ce==="W"||ce==="E")return[se,j]}(V.val,U.val,V.dim):[V.val,U.val]},qi.exports.format=pt,qi.exports.formatPair=function(W){return pt(W.lat,"lat")+" "+pt(W.lon,"lon")},qi.exports.coordToDMS=os;var Ei=qi.exports,Gi=qt,_t=Ei,Ri=/(Lat)(itude)?/gi,Vt=/(L)(on|ng)(gitude)?/i;function ls(W,z){var V,U,j;for(var se in W)(U=se.match(z))&&(!V||U[0].length/se.length>j)&&(j=U[0].length/se.length,V=se);return V}function Di(W){return ls(W,Ri)}function fs(W){return ls(W,Vt)}function yi(W){return typeof W=="object"?Object.keys(W).length:0}function Vi(W){var z=[];return[",",";"," ","|"].forEach(function(V){var U=Gi.dsvFormat(V).parse(W);if(U.length>=1){for(var j=yi(U[0]),se=0;se{V[U]=j});return V}function As(W){return W?.nodeType===1}function ys(W){return ht(W,"line",z=>Object.assign({},ri(z,"color",V=>({stroke:`#${V}`})),Es(z,"opacity",V=>({"stroke-opacity":V})),Es(z,"width",V=>({"stroke-width":96*V/25.4}))))}function cs(W){let z=[];if(W===null)return z;for(let V of Array.from(W.childNodes)){if(!As(V))continue;let U=jn(V.nodeName);if(U==="gpxtpx:TrackPointExtension")z=z.concat(cs(V));else{let j=Jt(V);z.push([U,hn(j)])}}return z}function jn(W){return["heart","gpxtpx:hr","hr"].includes(W)?"heart":W}function hn(W){let z=parseFloat(W);return isNaN(z)?W:z}function Xn(W){let z=[parseFloat(W.getAttribute("lon")||""),parseFloat(W.getAttribute("lat")||"")];if(isNaN(z[0])||isNaN(z[1]))return null;$i(W,"ele",U=>{z.push(U)});let V=zt(W,"time");return{coordinates:z,time:V?Jt(V):null,extendedValues:cs(zt(W,"extensions"))}}function Ws(W){let z=Ds(W,["name","cmt","desc","type","time","keywords"]),V=Array.from(W.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3","*"));for(let j of V)j.parentNode?.parentNode===W&&(z[j.tagName.replace(":","_")]=Jt(j));let U=gt(W,"link");return U.length&&(z.links=U.map(j=>Object.assign({href:j.getAttribute("href")},Ds(j,["text","type"])))),z}function Sn(W,z){let V=gt(W,z),U=[],j=[],se={};for(let ce=0;ce1,ce=Object.assign({_gpxType:"trk"},Ws(W),ys(zt(W,"extensions")),U.length?{coordinateProperties:{times:se?U:U[0]}}:{});for(let xe of j){V.push(xe.line),ce.coordinateProperties||(ce.coordinateProperties={});let ye=ce.coordinateProperties,me=Object.entries(xe.extendedValues);for(let le=0;lenew Array(ke.line.length).fill(null))),ye[Ae][le]=be):ye[Ae]=be}}return{type:"Feature",properties:ce,geometry:se?{type:"MultiLineString",coordinates:V}:{type:"LineString",coordinates:V[0]}}}function dn(W){let z=Object.assign(Ws(W),Ds(W,["sym"])),V=Xn(W);return V?{type:"Feature",properties:z,geometry:{type:"Point",coordinates:V.coordinates}}:null}function*pn(W){for(let z of gt(W,"trk")){let V=un(z);V&&(yield V)}for(let z of gt(W,"rte")){let V=Zn(z);V&&(yield V)}for(let z of gt(W,"wpt")){let V=dn(z);V&&(yield V)}}let Ce="http://www.garmin.com/xmlschemas/ActivityExtension/v2",es=[["heartRate","heartRates"],["Cadence","cadences"],["Speed","speeds"],["Watts","watts"]],bs=[["TotalTimeSeconds","totalTimeSeconds"],["DistanceMeters","distanceMeters"],["MaximumSpeed","maxSpeed"],["AverageHeartRateBpm","avgHeartRate"],["MaximumHeartRateBpm","maxHeartRate"],["AvgSpeed","avgSpeed"],["AvgWatts","avgWatts"],["MaxWatts","maxWatts"]];function Pt(W,z){let V=[];for(let[U,j]of z){let se=zt(W,U);if(!se){let xe=W.getElementsByTagNameNS(Ce,U);xe.length&&(se=xe[0])}let ce=parseFloat(Jt(se));isNaN(ce)||V.push([j,ce])}return V}function Tt(W){let z=[$i(W,"LongitudeDegrees"),$i(W,"LatitudeDegrees")];if(z[0]===void 0||isNaN(z[0])||z[1]===void 0||isNaN(z[1]))return null;let V=zt(W,"HeartRateBpm"),U=Jt(zt(W,"Time"));return zt(W,"AltitudeMeters",j=>{let se=parseFloat(Jt(j));isNaN(se)||z.push(se)}),{coordinates:z,time:U||null,heartRate:V?parseFloat(Jt(V)):null,extensions:Pt(W,es)}}function Ys(W){let z=gt(W,"Trackpoint"),V=[],U=[],j=[];if(z.length<2)return null;let se={},ce={extendedProperties:se};for(let xe=0;xe({name:Jt(ye)})));for(let ye of z)ce=Ys(ye),ce&&(V.push(ce.line),ce.times.length&&U.push(ce.times),ce.heartRates.length&&j.push(ce.heartRates),se.push(ce.extendedProperties));for(let ye=0;yeArray(Ae.length).fill(null))),xe[le][ye]=me[le])}return V.length===0?null:((U.length||j.length)&&(xe.coordinateProperties=Object.assign(U.length?{times:V.length===1?U[0]:U}:{},j.length?{heart:V.length===1?j[0]:j}:{})),{type:"Feature",properties:xe,geometry:V.length===1?{type:"LineString",coordinates:V[0]}:{type:"MultiLineString",coordinates:V}})}function*Ns(W){for(let z of gt(W,"Lap")){let V=kn(z);V&&(yield V)}for(let z of gt(W,"Courses")){let V=kn(z);V&&(yield V)}}function Qn(W,z){let V={},U=z=="stroke"||z==="fill"?z:z+"-color";return W[0]==="#"&&(W=W.substring(1)),W.length===6||W.length===3?V[U]="#"+W:W.length===8&&(V[z+"-opacity"]=parseInt(W.substring(0,2),16)/255,V[U]="#"+W.substring(6,8)+W.substring(4,6)+W.substring(2,4)),V}function nn(W,z,V){let U={};return $i(W,z,j=>{U[V]=j}),U}function Os(W,z){return ht(W,"color",V=>Qn(Jt(V),z))}function In(W){return ht(W,"Icon",(z,V)=>(ri(z,"href",U=>{V.icon=U}),V))}function We(W){return Object.assign({},function(z){return ht(z,"PolyStyle",(V,U)=>Object.assign(U,ht(V,"color",j=>Qn(Jt(j),"fill")),ri(V,"fill",j=>{if(j==="0")return{"fill-opacity":0}}),ri(V,"outline",j=>{if(j==="0")return{"stroke-opacity":0}})))}(W),function(z){return ht(z,"LineStyle",V=>Object.assign(Os(V,"stroke"),nn(V,"width","stroke-width")))}(W),function(z){return ht(z,"LabelStyle",V=>Object.assign(Os(V,"label"),nn(V,"scale","label-scale")))}(W),function(z){return ht(z,"IconStyle",V=>Object.assign(Os(V,"icon"),nn(V,"scale","icon-scale"),nn(V,"heading","icon-heading"),ht(V,"hotSpot",U=>{let j=parseFloat(U.getAttribute("x")||""),se=parseFloat(U.getAttribute("y")||""),ce=U.getAttribute("xunits")||"",xe=U.getAttribute("yunits")||"";return isNaN(j)||isNaN(se)?{}:{"icon-offset":[j,se],"icon-offset-units":[ce,xe]}}),In(V)))}(W))}let Yi=W=>Number(W),Ut={string:W=>W,int:Yi,uint:Yi,short:Yi,ushort:Yi,float:Yi,double:Yi,bool:W=>Boolean(W)};function mn(W,z){return ht(W,"ExtendedData",(V,U)=>{for(let j of gt(V,"Data"))U[j.getAttribute("name")||""]=Jt(zt(j,"value"));for(let j of gt(V,"SimpleData")){let se=j.getAttribute("name")||"",ce=z[se]||Ut.string;U[se]=ce(Jt(j))}return U})}function Us(W){let z=zt(W,"description");for(let V of Array.from(z?.childNodes||[]))if(V.nodeType===4)return{description:{"@type":"html",value:Jt(V)}};return{}}function ze(W){return ht(W,"TimeSpan",z=>({timespan:{begin:Jt(zt(z,"begin")),end:Jt(zt(z,"end"))}}))}function At(W){return ht(W,"TimeStamp",z=>({timestamp:Jt(zt(z,"when"))}))}function ut(W,z){return ri(W,"styleUrl",V=>(V=mi(V),z[V]?Object.assign({styleUrl:V},z[V]):{styleUrl:V}))}let Ni=/\s*/g,js=/^\s*|\s*$/g,Ct=/\s+/;function Qs(W){return W.replace(Ni,"").split(",").map(parseFloat).filter(z=>!isNaN(z)).slice(0,3)}function X(W){return W.replace(js,"").split(Ct).map(Qs).filter(z=>z.length>=2)}function w(W){let z=gt(W,"coord");z.length===0&&(z=function(U,j,se){return Array.from(U.getElementsByTagNameNS(se,j))}(W,"coord","*"));let V=z.map(U=>Jt(U).split(" ").map(parseFloat));return V.length===0?null:{geometry:V.length>2?{type:"LineString",coordinates:V}:{type:"Point",coordinates:V[0]},times:gt(W,"when").map(U=>Jt(U))}}function Z(W){if(W.length===0)return W;let z=W[0],V=W[W.length-1],U=!0;for(let j=0;j=2&&z.push({type:"Point",coordinates:se});break}case"LinearRing":case"LineString":{let se=X(T(j));se.length>=2&&z.push({type:"LineString",coordinates:se});break}case"Polygon":{let se=[];for(let ce of gt(j,"LinearRing")){let xe=Z(X(T(ce)));xe.length>=4&&se.push(xe)}se.length&&z.push({type:"Polygon",coordinates:se});break}case"Track":case"gx:Track":{let se=w(j);if(!se)break;let{times:ce,geometry:xe}=se;z.push(xe),ce.length&&V.push(ce);break}}}return{geometries:z,coordTimes:V}}function E(W,z,V,U){let{coordTimes:j,geometries:se}=H(W),ce=function(me){return me.length===0?null:me.length===1?me[0]:{type:"GeometryCollection",geometries:me}}(se);if(!ce&&U.skipNullGeometry)return null;let xe={type:"Feature",geometry:ce,properties:Object.assign(Ds(W,["name","address","visibility","open","phoneNumber","description"]),Us(W),ut(W,z),We(W),mn(W,V),ze(W),At(W),j.length?{coordinateProperties:{times:j.length===1?j[0]:j}}:{})};xe.properties?.visibility!==void 0&&(xe.properties.visibility=xe.properties.visibility!=="0");let ye=W.getAttribute("id");return ye!==null&&ye!==""&&(xe.id=ye),xe}function oe(W){return zt(W,"gx:LatLonQuad")?{geometry:{type:"Polygon",coordinates:[Z(X(T(W)))]}}:function(z){let V=zt(z,"LatLonBox");if(V){let U=$i(V,"north"),j=$i(V,"west"),se=$i(V,"east"),ce=$i(V,"south"),xe=$i(V,"rotation");if(typeof U=="number"&&typeof ce=="number"&&typeof j=="number"&&typeof se=="number"){let ye=[j,ce,se,U],me=[[[j,U],[se,U],[se,ce],[j,ce],[j,U]]];return typeof xe=="number"&&(me=function(le,Ae,be){let ke=[(le[0]+le[2])/2,(le[1]+le[3])/2];return[Ae[0].map(ot=>{let It=ot[1]-ke[1],Je=ot[0]-ke[0],Re=Math.sqrt(Math.pow(It,2)+Math.pow(Je,2)),Ue=Math.atan2(It,Je)+be*q;return[ke[0]+Math.cos(Ue)*Re,ke[1]+Math.sin(Ue)*Re]})]}(ye,me,xe)),{bbox:ye,geometry:{type:"Polygon",coordinates:me}}}}return null}(W)}let q=Math.PI/180;function Y(W,z,V,U){let j=oe(W),se=j?.geometry||null;if(!se&&U.skipNullGeometry)return null;let ce={type:"Feature",geometry:se,properties:Object.assign({"@geometry-type":"groundoverlay"},Ds(W,["name","address","visibility","open","phoneNumber","description"]),Us(W),ut(W,z),We(W),In(W),mn(W,V),ze(W),At(W))};j?.bbox&&(ce.bbox=j.bbox),ce.properties?.visibility!==void 0&&(ce.properties.visibility=ce.properties.visibility!=="0");let xe=W.getAttribute("id");return xe!==null&&xe!==""&&(ce.id=xe),ce}function te(W){let z=W.getAttribute("id"),V=W.parentNode;return!z&&As(V)&&V.localName==="CascadingStyle"&&(z=V.getAttribute("kml:id")||V.getAttribute("id")),mi(z||"")}function fe(W){let z={};for(let V of gt(W,"Style"))z[te(V)]=We(V);for(let V of gt(W,"StyleMap")){let U=mi(V.getAttribute("id")||"");ri(V,"styleUrl",j=>{j=mi(j),z[j]&&(z[U]=z[j])})}return z}function _e(W){let z={};for(let V of gt(W,"SimpleField"))z[V.getAttribute("name")||""]=Ut[V.getAttribute("type")||""]||Ut.string;return z}let Se=["name","visibility","open","address","description","phoneNumber","visibility"];function*it(W,z={skipNullGeometry:!1}){let V=fe(W),U=_e(W);for(let j of gt(W,"Placemark")){let se=E(j,V,U,z);se&&(yield se)}for(let j of gt(W,"GroundOverlay")){let se=Y(j,V,U,z);se&&(yield se)}}var ct=Object.freeze({__proto__:null,gpx:function(W){return{type:"FeatureCollection",features:Array.from(pn(W))}},gpxGen:pn,kml:function(W,z={skipNullGeometry:!1}){return{type:"FeatureCollection",features:Array.from(it(W,z))}},kmlGen:it,kmlWithFolders:function(W,z={skipNullGeometry:!1}){let V=fe(W),U=_e(W),j={type:"root",children:[]};return function se(ce,xe,ye){if(As(ce))switch(ce.tagName){case"GroundOverlay":{let me=Y(ce,V,U,ye);me&&xe.children.push(me);break}case"Placemark":{let me=E(ce,V,U,ye);me&&xe.children.push(me);break}case"Folder":{let me=function(le){let Ae={};for(let be of Array.from(le.childNodes))As(be)&&Se.includes(be.tagName)&&(Ae[be.tagName]=Jt(be));return{type:"folder",meta:Ae,children:[]}}(ce);xe.children.push(me),xe=me;break}}if(ce.childNodes)for(let me=0;me=0?1:-1)}function U(se,ce,xe){var ye=2*((se=V(se*xe))-(ce=V(ce*xe)));ye<0&&(ye=-ye-1);for(var me="";ye>=32;)me+=String.fromCharCode(63+(32|31&ye)),ye/=32;return me+=String.fromCharCode(63+(0|ye))}function j(se){for(var ce=[],xe=0;xe=32);xe=1&ke?(-ke-1)/2:ke/2,be=1,ke=0;do ke+=(31&(ot=se.charCodeAt(ye++)-63))*be,be*=32;while(ot>=32);me+=xe,le+=1&ke?(-ke-1)/2:ke/2,Ae.push([me/It,le/It])}return Ae},z.encode=function(se,ce){if(!se.length)return"";for(var xe=Math.pow(10,Number.isInteger(ce)?ce:5),ye=U(se[0][0],0,xe)+U(se[0][1],0,xe),me=1;me{let W=le=>le[0],z=le=>le[le.length-1],V=le=>le.join(","),U=(le,Ae,be)=>{let ke=le[Ae];ke?ke.push(be):le[Ae]=[be]},j=(le,Ae,be)=>{let ke=le[Ae],ot=null;ke&&(ot=ke.indexOf(be))>=0&&ke.splice(ot,1)},se=(le,Ae)=>{let be=le[Ae];return be&&be.length>0?be[0]:null},ce=le=>le.length>3&&V(W(le))===V(z(le)),xe=(le,Ae,be)=>{Ae=Ae||0,be=be||1;let ke=le.reduce((Ft,Ht,Ot)=>le[Ft][Ae]>Ht[Ae]?Ft:Ot,0),ot=ke<=0?le.length-2:ke-1,It=ke>=le.length-1?1:ke+1,Je=le[ot][Ae],Re=le[ke][Ae],Ue=le[It][Ae],mt=le[ot][be],ft=le[ke][be];return(Re-Je)*(le[It][be]-mt)-(Ue-Je)*(ft-mt)<0?"clockwise":"counterclockwise"},ye=le=>le instanceof Array?le.map(ye):parseFloat(le);class me extends Map{constructor(){super(),this.binders=[]}add(Ae,be){this.has(Ae)||this.set(Ae,be)}addBinder(Ae){this.binders.push(Ae)}bindAll(){this.binders.forEach(Ae=>Ae.bind())}}return{purgeProps:(le,Ae)=>{if(le){let be=Object.assign({},le);if(Ae)for(let ke of Ae)delete be[ke];return be}return{}},mergeProps:(le,Ae)=>(le=le||{},Ae=Ae||{},Object.assign(le,Ae)),first:W,last:z,coordsToKey:V,addToMap:U,removeFromMap:j,getFirstFromMap:se,isRing:ce,ringDirection:xe,ptInsidePolygon:(le,Ae,be,ke)=>{be=be||0,ke=ke||1;let ot=!1;for(let It=0,Je=Ae.length-1;It=0){let be=[Ae,1];le&&be.push(le),[].splice.apply(this.container,be)}}else if(typeof this.container=="object"){let Ae=Object.keys(this.container).find(be=>this.container[be]===this);Ae&&(le?this.container[Ae]=le:delete this.container[Ae])}}},WayCollection:class extends Array{constructor(){super(),this.firstMap={},this.lastMap={}}addWay(le){(le=le.toCoordsArray()).length>0&&(this.push(le),U(this.firstMap,V(W(le)),le),U(this.lastMap,V(z(le)),le))}toStrings(){let le=[],Ae=null;for(;Ae=this.shift();){j(this.firstMap,V(W(Ae)),Ae),j(this.lastMap,V(z(Ae)),Ae);let be=Ae,ke=null;do{let ot=V(z(be)),It=!1;ke=se(this.firstMap,ot),ke||(ke=se(this.lastMap,ot),It=!0),ke&&(this.splice(this.indexOf(ke),1),j(this.firstMap,V(W(ke)),ke),j(this.lastMap,V(z(ke)),ke),It&&(ke.length>be.length&&([be,ke]=[ke,be]),ke.reverse()),be=be.concat(ke.slice(1)))}while(ke);le.push(ye(be))}return le}toRings(le){let Ae=this.toStrings(),be=[],ke=null;for(;ke=Ae.shift();)ce(ke)&&(xe(ke)!==le&&ke.reverse(),be.push(ke));return be}}}})(),Mt={building:{},highway:{whitelist:["services","rest_area","escape","elevator"]},natural:{blacklist:["coastline","cliff","ridge","arete","tree_row"]},landuse:{},waterway:{whitelist:["riverbank","dock","boatyard","dam"]},amenity:{},leisure:{},barrier:{whitelist:["city_wall","ditch","hedge","retaining_wall","wall","spikes"]},railway:{whitelist:["station","turntable","roundhouse","platform"]},area:{},boundary:{},man_made:{blacklist:["cutline","embankment","pipeline"]},power:{whitelist:["plant","substation","generator","transformer"]},place:{},shop:{},aeroway:{blacklist:["taxiway"]},tourism:{},historic:{},public_transport:{},office:{},"building:part":{},military:{},ruins:{},"area:highway":{},craft:{},golf:{},indoor:{}},Et=(()=>{let{first:W,last:z,coordsToKey:V,addToMap:U,removeFromMap:j,getFirstFromMap:se,isRing:ce,ringDirection:xe,ptInsidePolygon:ye,strToFloat:me,LateBinder:le,WayCollection:Ae}=dt,be=Mt;class ke{constructor(Re,Ue,mt){this.type=Re,this.id=Ue,this.refElems=mt,this.tags={},this.props={id:this.getCompositeId()},this.refCount=0,this.hasTag=!1,mt&&mt.add(this.getCompositeId(),this)}addTags(Re){this.tags=Object.assign(this.tags,Re),this.hasTag=!!Re}addTag(Re,Ue){this.tags[Re]=Ue,this.hasTag=!!Re}addProp(Re,Ue){this.props[Re]=Ue}addProps(Re){this.props=Object.assign(this.props,Re)}getCompositeId(){return`${this.type}/${this.id}`}getProps(){return Object.assign(this.props,this.tags)}toFeatureArray(){return[]}}class ot extends ke{constructor(Re,Ue){super("node",Re,Ue),this.latLng=null}setLatLng(Re){this.latLng=Re}toFeatureArray(){return this.latLng?[{type:"Feature",id:this.getCompositeId(),properties:this.getProps(),geometry:{type:"Point",coordinates:me([this.latLng.lon,this.latLng.lat])}}]:[]}getLatLng(){return this.latLng}}class It extends ke{constructor(Re,Ue){super("way",Re,Ue),this.latLngArray=[],this.isPolygon=!1}addLatLng(Re){this.latLngArray.push(Re)}setLatLngArray(Re){this.latLngArray=Re}addNodeRef(Re){let Ue=new le(this.latLngArray,function(mt){let ft=this.refElems.get(`node/${mt}`);if(ft)return ft.refCount++,ft.getLatLng()},this,[Re]);this.latLngArray.push(Ue),this.refElems.addBinder(Ue)}analyzeGeometryType(Re,Ue){let mt=be[Re];mt&&(this.isPolygon=!0,mt.whitelist?this.isPolygon=mt.whitelist.indexOf(Ue)>=0:mt.blacklist&&(this.isPolygon=!(mt.blacklist.indexOf(Ue)>=0)))}addTags(Re){super.addTags(Re);for(let[Ue,mt]of Object.entries(Re))this.analyzeGeometryType(Ue,mt)}addTag(Re,Ue){super.addTag(Re,Ue),this.analyzeGeometryType(Re,Ue)}toCoordsArray(){return this.latLngArray.map(Re=>[Re.lon,Re.lat])}toFeatureArray(){let Re=this.toCoordsArray();if(Re.length>1){Re=me(Re);let Ue={type:"Feature",id:this.getCompositeId(),properties:this.getProps(),geometry:{type:"LineString",coordinates:Re}};return this.isPolygon&&ce(Re)?(xe(Re)!=="counterclockwise"&&Re.reverse(),Ue.geometry={type:"Polygon",coordinates:[Re]},[Ue]):[Ue]}return[]}}return{Node:ot,Way:It,Relation:class extends ke{constructor(Je,Re){super("relation",Je,Re),this.relations=[],this.nodes=[],this.bounds=null}setBounds(Je){this.bounds=Je}addMember(Je){switch(Je.type){case"relation":let Re=new le(this.relations,function(ft){let Ft=this.refElems.get(`relation/${ft}`);if(Ft)return Ft.refCount++,Ft},this,[Je.ref]);this.relations.push(Re),this.refElems.addBinder(Re);break;case"way":Je.role||(Je.role="");let Ue=this[Je.role];if(Ue||(Ue=this[Je.role]=[]),Je.geometry){let ft=new It(Je.ref,this.refElems);ft.setLatLngArray(Je.geometry),ft.refCount++,Ue.push(ft)}else if(Je.nodes){let ft=new It(Je.ref,this.refElems);for(let Ft of Je.nodes)ft.addNodeRef(Ft);ft.refCount++,Ue.push(ft)}else{let ft=new le(Ue,function(Ft){let Ht=this.refElems.get(`way/${Ft}`);if(Ht)return Ht.refCount++,Ht},this,[Je.ref]);Ue.push(ft),this.refElems.addBinder(ft)}break;case"node":let mt=null;if(Je.lat&&Je.lon){mt=new ot(Je.ref,this.refElems),mt.setLatLng({lon:Je.lon,lat:Je.lat}),Je.tags&&mt.addTags(Je.tags);for(let[ft,Ft]of Object.entries(Je))["id","type","lat","lon"].indexOf(ft)<0&&mt.addProp(ft,Ft);mt.refCount++,this.nodes.push(mt)}else{let ft=new le(this.nodes,function(Ft){let Ht=this.refElems.get(`node/${Ft}`);if(Ht)return Ht.refCount++,Ht},this,[Je.ref]);this.nodes.push(ft),this.refElems.addBinder(ft)}}}toFeatureArray(){let Je=[],Re=[],Ue=[],mt=["outer","inner",""];for(let Ht of this.relations)if(Ht)for(let Ot of mt){let oi=Ht[Ot];if(oi){let Wi=this[Ot];Wi?[].splice.apply(Wi,[Wi.length,0].concat(oi)):this[Ot]=oi}}for(let Ht of mt){let Ot=this[Ht];if(Ot){this[Ht]=new Ae;for(let oi of Ot)this[Ht].addWay(oi)}}let ft=null,Ft={type:"Feature",id:this.getCompositeId(),bbox:this.bounds,properties:this.getProps()};this.bounds||delete Ft.bbox,this.outer?(ft=((Ht,Ot)=>{let oi=Ht?Ht.toRings("counterclockwise"):[],Wi=Ot?Ot.toRings("clockwise"):[];if(oi.length>0){let _i=[],hs=null;for(hs of oi)_i.push([hs]);for(;hs=Wi.shift();)for(let qn in oi)if(ye(W(hs),oi[qn])){_i[qn].push(hs);break}return _i.length===1?{type:"Polygon",coordinates:_i[0]}:{type:"MultiPolygon",coordinates:_i}}return null})(this.outer,this.inner),ft&&(Ft.geometry=ft,Je.push(Ft))):this[""]&&(ft=(Ht=>{let Ot=Ht?Ht.toStrings():[];return Ot.length>0?Ot.length===1?{type:"LineString",coordinates:Ot[0]}:{type:"MultiLineString",coordinates:Ot}:null})(this[""]),ft&&(Ft.geometry=ft,Re.push(Ft)));for(let Ht of this.nodes)Ue=Ue.concat(Ht.toFeatureArray());return Je.concat(Re).concat(Ue)}}}})(),Bt=(()=>{function W(V){return V.match(/^(.+?)\[(.+?)\]>$/g)!=null}function z(V){let U=/^(.+?)\[(.+?)\]>$/g.exec(V);return U?{evt:U[1]+">",exp:U[2]}:{evt:V}}return class{constructor(V){V&&(this.queryParent=!!V.queryParent,this.progressive=V.progressive,this.queryParent&&(this.parentMap=new WeakMap)),this.evtListeners={}}parse(V,U,j){j=j?j+".":"";let se=/<([^ >\/]+)(.*?)>/gm,ce=null,xe=[];for(;ce=se.exec(V);){let ye=ce[1],me={$tag:ye},le=j+ye,Ae=ce[2].trim(),be=!1;(Ae.endsWith("/")||ye.startsWith("?")||ye.startsWith("!"))&&(be=!0);let ke=/([^ ]+?)="(.+?)"/g,ot=/([^ ]+?)='(.+?)'/g,It=null,Je=!1;for(;It=ke.exec(Ae);)Je=!0,me[It[1]]=It[2];if(!Je)for(;It=ot.exec(Ae);)Je=!0,me[It[1]]=It[2];if(Je||Ae===""||(me.text=Ae),this.progressive&&this.emit(`<${le}>`,me,U),!be){let Re=new RegExp(`([^]+?)`,"g");Re.lastIndex=se.lastIndex;let Ue=Re.exec(V);if(Ue&&Ue[1]){se.lastIndex=Re.lastIndex;let mt=this.parse(Ue[1],me,le);mt.length>0?me.$innerNodes=mt:me.$innerText=Ue[1]}}this.queryParent&&U&&this.parentMap.set(me,U),this.progressive&&this.emit(``,me,U),xe.push(me)}return xe}getParent(V){return this.queryParent?this.parentMap.get(V):null}#e(V,U){let j=this.evtListeners[V];j?j.push(U):this.evtListeners[V]=[U]}addListener(V,U){W(V)&&(V=z(V),U.condition=function(j){let se="return "+j.replace(/(\$.+?)(?=[=!.])/g,"node.$&")+";";return new Function("node",se)}(V.exp),V=V.evt),this.#e(V,U)}#t(V,U){let j=this.evtListeners[V],se=null;j&&(se=j.indexOf(U))>=0&&j.splice(se,1)}removeListener(V,U){W(V)&&(V=(V=z(V)).evt),this.#t(V,U)}emit(V,...U){let j=this.evtListeners[V];if(j)for(let se of j)se.condition?se.condition.apply(null,U)===!0&&se.apply(null,U):se.apply(null,U)}on(V,U){this.addListener(V,U)}off(V,U){this.removeListener(V,U)}}})();let{Node:wt,Way:Si,Relation:Dt}=Et,{purgeProps:ci,RefElements:Ti}=dt,_s=Bt;var eo=(W,z)=>{let V=!1,U=!1,j=!0;(ye=>{if(ye){V=!(!ye.completeFeature&&!ye.allFeatures),U=!!ye.renderTagged;let me=ye.suppressWay||ye.excludeWay;me===void 0||me||(j=!1)}})(z);let se=(ye=>ye.elements?"json":ye.indexOf("=0?"xml":ye.trim().startsWith("{")?"json-raw":"invalid")(W),ce=new Ti,xe=[];se==="json-raw"&&(se=(W=JSON.parse(W)).elements?"json":"invalid"),se==="json"?(ye=>{for(let me of ye.elements)switch(me.type){case"node":let le=new wt(me.id,ce);me.tags&&le.addTags(me.tags),le.addProps(ci(me,["id","type","tags","lat","lon"])),le.setLatLng(me);break;case"way":let Ae=new Si(me.id,ce);if(me.tags&&Ae.addTags(me.tags),Ae.addProps(ci(me,["id","type","tags","nodes","geometry"])),me.nodes)for(let ke of me.nodes)Ae.addNodeRef(ke);else me.geometry&&Ae.setLatLngArray(me.geometry);break;case"relation":let be=new Dt(me.id,ce);if(me.bounds&&be.setBounds([parseFloat(me.bounds.minlon),parseFloat(me.bounds.minlat),parseFloat(me.bounds.maxlon),parseFloat(me.bounds.maxlat)]),me.tags&&be.addTags(me.tags),be.addProps(ci(me,["id","type","tags","bounds","members"])),me.members)for(let ke of me.members)be.addMember(ke)}})(W):se==="xml"&&(ye=>{let me=new _s({progressive:!0});me.on("",le=>{let Ae=new wt(le.id,ce);for(let[be,ke]of Object.entries(le))!be.startsWith("$")&&["id","lon","lat"].indexOf(be)<0&&Ae.addProp(be,ke);if(Ae.setLatLng(le),le.$innerNodes)for(let be of le.$innerNodes)be.$tag==="tag"&&Ae.addTag(be.k,be.v)}),me.on("",le=>{let Ae=new Si(le.id,ce);for(let[be,ke]of Object.entries(le))!be.startsWith("$")&&["id"].indexOf(be)<0&&Ae.addProp(be,ke);if(le.$innerNodes)for(let be of le.$innerNodes)be.$tag==="nd"?be.lon&&be.lat?Ae.addLatLng(be):be.ref&&Ae.addNodeRef(be.ref):be.$tag==="tag"&&Ae.addTag(be.k,be.v)}),me.on("",le=>{new Dt(le.id,ce)}),me.on("",(le,Ae)=>{let be=ce.get(`relation/${Ae.id}`),ke={type:le.type,role:le.role?le.role:"",ref:le.ref};if(le.lat&&le.lon){ke.lat=le.lat,ke.lon=le.lon,ke.tags={};for(let[ot,It]of Object.entries(le))!ot.startsWith("$")&&["type","lat","lon"].indexOf(ot)<0&&(ke[ot]=It)}if(le.$innerNodes){let ot=[],It=[];for(let Je of le.$innerNodes)Je.lat&&Je.lon?ot.push(Je):It.push(Je.ref);ot.length>0?ke.geometry=ot:It.length>0&&(ke.nodes=It)}be.addMember(ke)}),me.on("",(le,Ae)=>{ce.get(`relation/${Ae.id}`).setBounds([parseFloat(le.minlon),parseFloat(le.minlat),parseFloat(le.maxlon),parseFloat(le.maxlat)])}),me.on("",(le,Ae)=>{ce.get(`relation/${Ae.id}`).addTag(le.k,le.v)}),me.parse(ye)})(W),ce.bindAll();for(let ye of ce.values())if(ye.refCount<=0||ye.hasTag&&U&&!(ye instanceof Si&&j)){let me=ye.toFeatureArray();if(ye instanceof Dt&&!V&&me.length>0)return me[0].geometry;xe=xe.concat(me)}return{type:"FeatureCollection",features:xe}},Ln=O(eo);let Hn=["topojson","osm","kml","gpx","tcx","csv","tsv","polyline"];class To{constructor(z,V,U={}){this.blankGeoJSON=()=>({type:"FeatureCollection",features:[]}),this._rawData=V,this._format=z,this._options=U;let j={topojson:this.loadTopoJson,osm:this.loadOsm,kml:this.loadXml,gpx:this.loadXml,tcx:this.loadXml,csv:this.loadCsv,tsv:this.loadCsv,polyline:this.loadPolyline};this._conversionFn=j[z]}async convert(){return this._conversionFn?this._conversionFn():new Promise((z,V)=>V(`No converter exists for ${this._format}`))}async loadXml(){return ct[this._format](new DOMParser().parseFromString(this._rawData,"text/xml"))}async loadCsv(){let z=this._options.csvOptions||{};return this._format==="tsv"&&(z.delimiter=" "),await new Promise((V,U)=>{Ts.csv2geojson(this._rawData,z,(j,se)=>{j?U(j):V(se)})})}async loadTopoJson(){let z={};try{z=JSON.parse(this._rawData)}catch{throw"Invalid TopoJson"}let V=this.blankGeoJSON();return z.type==="Topology"&&z.objects!==void 0&&(V={type:"FeatureCollection",features:V.features=Object.keys(z.objects).map(U=>{return j=z,typeof(se=U)=="string"&&(se=j.objects[se]),se.type==="GeometryCollection"?{type:"FeatureCollection",features:se.geometries.map(function(ce){return et(j,ce)})}:et(j,se);var j,se}).reduce((U,j)=>[...U,...j.features],[])}),V}async loadOsm(){return Ln(this._rawData)}async loadPolyline(){let z=this._options.polylineOptions||{};return await new Promise((V,U)=>{try{let j=nt.toGeoJSON(this._rawData,z.precision),se=j;z.type==="point"?j.coordinates.length===1?se={type:"Point",coordinates:j.coordinates[0]}:console.warn("Cannot convert polyline to "+z.type):z.type==="polygon"&&(j.coordinates[0][0]===j.coordinates[j.coordinates.length-1][0]&&j.coordinates[0][1]===j.coordinates[j.coordinates.length-1][1]?se={type:"Polygon",coordinates:[j.coordinates]}:console.warn("Cannot convert polyline to "+z.type)),V({type:"FeatureCollection",features:[{type:"Feature",geometry:se,properties:z.properties||{}}]})}catch(j){U(j)}})}}var Kt=null;try{var Vr=typeof Tl<"u"&&typeof Tl.require=="function"&&Rl("worker_threads")||typeof __non_webpack_require__=="function"&&__non_webpack_require__("worker_threads")||typeof Rl=="function"&&Rl("worker_threads");Kt=Vr.Worker}catch{}function dr(W,z,V){var U=z===void 0?null:z,j=function(xe,ye){return Buffer.from(xe,"base64").toString(ye?"utf16":"utf8")}(W,V!==void 0&&V),se=j.indexOf(` +`,10)+1,ce=j.substring(se)+(U?"//# sourceMappingURL="+U:"");return function(xe){return new Kt(ce,Object.assign({},xe,{eval:!0}))}}function Pi(W,z,V){var U=z===void 0?null:z,j=function(ye,me){var le=atob(ye);if(me){for(var Ae=new Uint8Array(le.length),be=0,ke=le.length;beMath.random().toString(36).substring(2);class $t{constructor(z,V){this.initId=Cn()+"-"+z,this.worker=new pr,this.handlers=new Map,this.worker.onmessage=U=>{let j=U.data,se=this.handlers.get(j.id),ce=this;if(se){if(j.type==="response"&&se.resolve(j.message),j.type==="error"){let xe=j.error||new Error(`Unknown error with ${z}`);se.reject(xe)}j.type==="init_response"&&(this._=Object.keys(j.message).map(xe=>{let ye=typeof j.message[xe]=="function";return[xe,function(){return ye?ce.exec(xe)(...arguments):ce.get(xe)}]}).reduce((xe,ye)=>({...xe,[ye[0]]:ye[1]}),{}),se.resolve(this._))}},this.worker.postMessage({type:"init",id:this.initId,command:z,message:V})}onLoad(){return new Promise(z=>{this._===void 0?this.handlers.set(this.initId,{resolve:z,reject:z}):z(this._)})}exec(z){let V=this;return function(...U){return new Promise((j,se)=>{let ce=Cn()+"-"+z;V.handlers.set(ce,{resolve:j,reject:se}),V.worker.postMessage({type:"exec",id:ce,command:z,message:[...U]})})}}get(z){return new Promise((V,U)=>{let j=Cn()+"-"+z;this.handlers.set(j,{resolve:V,reject:U}),this.worker.postMessage({type:"get",id:j,command:z,message:[]})})}}let Wt=new URL("test://http://example.com").href!=="test://http://example.com";async function Bn(W,z,V){let U=await fetch(W,V?{signal:V.signal}:void 0),j={};try{let se=new URL(W,window.location.href).hash,ce=decodeURIComponent(se.slice(1));j=JSON.parse(ce)}catch(se){console.warn("Error parsing or reading URL:",se)}if(U.status==200){let se=await U.text(),ce;return["kml","tcx","gpx"].indexOf(z)>=0||!(()=>{let xe=!1;try{xe=typeof window.Worker=="function"}catch{xe=!1}return xe})()?ce=new To(z,se,j).convert():ce=new $t("Converter",[z,se,j]).exec("convert")(),await ce}throw new Error(`Data fetch error: ${U.statusText}`)}let ei=(W,z)=>{let V=new AbortController,U=W.url.split("://")[0],j=W.url.replace(new RegExp(`^${U}://`),""),se=Wt?(ce=>{let xe=new RegExp("^(https?)(//)");return ce.replace(xe,"$1:$2")})(j):j;return se&&Bn(se,U,V).then(ce=>z(null,ce)).catch(ce=>z(ce)),{cancel:()=>{V.abort()}}};k.VectorTextProtocol=ei,k.addOptions=(W,z)=>{try{let V=new URL(W);return V.hash=`#${encodeURIComponent(JSON.stringify(z))}`,V.toString()}catch(V){return console.error("Error parsing or updating URL:",V),W}},k.addProtocols=W=>{Hn.forEach(z=>{W.addProtocol(z,ei)})}})});var Pc=cn((_I,Rh)=>{Rh.exports=mp;var Ip=Object.prototype.hasOwnProperty;function mp(){for(var k={},O=0;O{(function(){var k=this,O={};typeof Vh<"u"?Th.exports=O:k.fuzzy=O,O.simpleFilter=function(re,ue){return ue.filter(function(Ie){return O.test(re,Ie)})},O.test=function(re,ue){return O.match(re,ue)!==null},O.match=function(re,ue,Ie){Ie=Ie||{};var c=0,De=[],ee=ue.length,yt=0,st=0,Ve=Ie.pre||"",di=Ie.post||"",Qi=Ie.caseSensitive&&ue||ue.toLowerCase(),Bi;re=Ie.caseSensitive&&re||re.toLowerCase();for(var Qt=0;Qt{"use strict";var sn=function(k){return this.component=k,this.items=[],this.active=k.options.noInitialSelection?-1:0,this.wrapper=document.createElement("div"),this.wrapper.className="suggestions-wrapper",this.element=document.createElement("ul"),this.element.className="suggestions",this.wrapper.appendChild(this.element),this.selectingListItem=!1,k.el.parentNode.insertBefore(this.wrapper,k.el.nextSibling),this};sn.prototype.show=function(){this.element.style.display="block"};sn.prototype.hide=function(){this.element.style.display="none"};sn.prototype.add=function(k){this.items.push(k)};sn.prototype.clear=function(){this.items=[],this.active=this.component.options.noInitialSelection?-1:0};sn.prototype.isEmpty=function(){return!this.items.length};sn.prototype.isVisible=function(){return this.element.style.display==="block"};sn.prototype.draw=function(){if(this.element.innerHTML="",this.items.length===0){this.hide();return}for(var k=0;k=this.items.length-1?0:this.active+1)};sn.prototype.drawError=function(k){var O=document.createElement("li");O.innerHTML=k,this.element.appendChild(O),this.show()};Jh.exports=sn});var Fh=cn((xI,Mh)=>{"use strict";var Cp=Pc(),fp=Wh(),Ap=zh(),Rs=function(k,O,re){return re=re||{},this.options=Cp({minLength:2,limit:5,filter:!0,hideOnBlur:!0,noInitialSelection:!0},re),this.el=k,this.data=O||[],this.list=new Ap(this),this.query="",this.selected=null,this.list.draw(),this.el.addEventListener("keyup",function(ue){this.handleKeyUp(ue.keyCode,ue)}.bind(this),!1),this.el.addEventListener("keydown",function(ue){this.handleKeyDown(ue)}.bind(this)),this.el.addEventListener("focus",function(){this.handleFocus()}.bind(this)),this.el.addEventListener("blur",function(){this.handleBlur()}.bind(this)),this.el.addEventListener("paste",function(ue){this.handlePaste(ue)}.bind(this)),this.render=this.options.render?this.options.render.bind(this):this.render.bind(this),this.getItemValue=this.options.getItemValue?this.options.getItemValue.bind(this):this.getItemValue.bind(this),this};Rs.prototype.handleKeyUp=function(k,O){if(!(k===40||k===38||k===27||k===9)){if(k===13){this.list.items[this.list.active]&&(this.list.handleMouseUp(this.list.items[this.list.active]),O.stopPropagation());return}this.handleInputChange(this.el.value)}};Rs.prototype.handleKeyDown=function(k){switch(k.keyCode){case 13:this.list.active>=0&&(this.list.selectingListItem=!0);break;case 9:this.list.isEmpty()||(this.list.isVisible()&&k.preventDefault(),this.value(this.list.active>=0?this.list.items[this.list.active].original:null),this.list.hide());break;case 27:this.list.isEmpty()||this.list.hide();break;case 38:this.list.previous();break;case 40:this.list.next();break}};Rs.prototype.handleBlur=function(){!this.list.selectingListItem&&this.options.hideOnBlur&&this.list.hide()};Rs.prototype.handlePaste=function(k){if(k.clipboardData)this.handleInputChange(k.clipboardData.getData("Text"));else{var O=this;setTimeout(function(){O.handleInputChange(k.target.value)},100)}};Rs.prototype.handleInputChange=function(k){if(this.query=this.normalize(k),this.list.clear(),this.query.length-1};Rs.prototype.value=function(k){if(this.selected=k,this.el.value=this.getItemValue(k||{place_name:this.query}),document.createEvent){var O=document.createEvent("HTMLEvents");O.initEvent("change",!0,!1),this.el.dispatchEvent(O)}else this.el.fireEvent("onchange")};Rs.prototype.getCandidates=function(k){var O={pre:"",post:"",extract:function(ue){return this.getItemValue(ue)}.bind(this)},re;this.options.filter?(re=fp.filter(this.query,this.data,O),re=re.map(function(ue){return{original:ue.original,string:this.render(ue.original,ue.string)}}.bind(this))):re=this.data.map(function(ue){var Ie=this.render(ue);return{original:ue,string:Ie}}.bind(this)),k(re)};Rs.prototype.getItemValue=function(k){return k};Rs.prototype.render=function(k,O){if(O)return O;for(var re=k.original?this.getItemValue(k.original):this.getItemValue(k),ue=this.normalize(re),Ie=ue.lastIndexOf(this.query);Ie>-1;){var c=Ie+this.query.length;re=re.slice(0,Ie)+""+re.slice(Ie,c)+""+re.slice(c),Ie=ue.slice(0,Ie).lastIndexOf(this.query)}return re};Rs.prototype.renderError=function(k){this.list.drawError(k)};Mh.exports=Rs});var Lh=cn((wI,Xh)=>{"use strict";var Kh=Fh();Xh.exports=Kh;typeof window<"u"&&(window.Suggestions=Kh)});var Dh=cn((SI,Eh)=>{var yp="Expected a function",Hh=NaN,bp="[object Symbol]",_p=/^\s+|\s+$/g,vp=/^[-+]0x[0-9a-f]+$/i,xp=/^0b[01]+$/i,wp=/^0o[0-7]+$/i,Sp=parseInt,Zp=typeof global=="object"&&global&&global.Object===Object&&global,kp=typeof self=="object"&&self&&self.Object===Object&&self,Bp=Zp||kp||Function("return this")(),Gp=Object.prototype,Rp=Gp.toString,Vp=Math.max,Tp=Math.min,Ec=function(){return Bp.Date.now()};function Wp(k,O,re){var ue,Ie,c,De,ee,yt,st=0,Ve=!1,di=!1,Qi=!0;if(typeof k!="function")throw new TypeError(yp);O=Ph(O)||0,Dc(re)&&(Ve=!!re.leading,di="maxWait"in re,c=di?Vp(Ph(re.maxWait)||0,O):c,Qi="trailing"in re?!!re.trailing:Qi);function Bi(_t){var Ri=ue,Vt=Ie;return ue=Ie=void 0,st=_t,De=k.apply(Vt,Ri),De}function Qt(_t){return st=_t,ee=setTimeout(pt,O),Ve?Bi(_t):De}function qt(_t){var Ri=_t-yt,Vt=_t-st,ls=O-Ri;return di?Tp(ls,c-Vt):ls}function qi(_t){var Ri=_t-yt,Vt=_t-st;return yt===void 0||Ri>=O||Ri<0||di&&Vt>=c}function pt(){var _t=Ec();if(qi(_t))return os(_t);ee=setTimeout(pt,qt(_t))}function os(_t){return ee=void 0,Qi&&ue?Bi(_t):(ue=Ie=void 0,De)}function as(){ee!==void 0&&clearTimeout(ee),st=0,ue=yt=Ie=ee=void 0}function Ei(){return ee===void 0?De:os(Ec())}function Gi(){var _t=Ec(),Ri=qi(_t);if(ue=arguments,Ie=this,yt=_t,Ri){if(ee===void 0)return Qt(yt);if(di)return ee=setTimeout(pt,O),Bi(yt)}return ee===void 0&&(ee=setTimeout(pt,O)),De}return Gi.cancel=as,Gi.flush=Ei,Gi}function Dc(k){var O=typeof k;return!!k&&(O=="object"||O=="function")}function Jp(k){return!!k&&typeof k=="object"}function zp(k){return typeof k=="symbol"||Jp(k)&&Rp.call(k)==bp}function Ph(k){if(typeof k=="number")return k;if(zp(k))return Hh;if(Dc(k)){var O=typeof k.valueOf=="function"?k.valueOf():k;k=Dc(O)?O+"":O}if(typeof k!="string")return k===0?k:+k;k=k.replace(_p,"");var re=xp.test(k);return re||wp.test(k)?Sp(k.slice(2),re?2:8):vp.test(k)?Hh:+k}Eh.exports=Wp});var iu=cn((ZI,Yc)=>{"use strict";var Vo=typeof Reflect=="object"?Reflect:null,Yh=Vo&&typeof Vo.apply=="function"?Vo.apply:function(O,re,ue){return Function.prototype.apply.call(O,re,ue)},Wl;Vo&&typeof Vo.ownKeys=="function"?Wl=Vo.ownKeys:Object.getOwnPropertySymbols?Wl=function(O){return Object.getOwnPropertyNames(O).concat(Object.getOwnPropertySymbols(O))}:Wl=function(O){return Object.getOwnPropertyNames(O)};function Mp(k){console&&console.warn&&console.warn(k)}var Oh=Number.isNaN||function(O){return O!==O};function ni(){ni.init.call(this)}Yc.exports=ni;Yc.exports.once=Lp;ni.EventEmitter=ni;ni.prototype._events=void 0;ni.prototype._eventsCount=0;ni.prototype._maxListeners=void 0;var Nh=10;function Jl(k){if(typeof k!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof k)}Object.defineProperty(ni,"defaultMaxListeners",{enumerable:!0,get:function(){return Nh},set:function(k){if(typeof k!="number"||k<0||Oh(k))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+k+".");Nh=k}});ni.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};ni.prototype.setMaxListeners=function(O){if(typeof O!="number"||O<0||Oh(O))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+O+".");return this._maxListeners=O,this};function Uh(k){return k._maxListeners===void 0?ni.defaultMaxListeners:k._maxListeners}ni.prototype.getMaxListeners=function(){return Uh(this)};ni.prototype.emit=function(O){for(var re=[],ue=1;ue0&&(De=re[0]),De instanceof Error)throw De;var ee=new Error("Unhandled error."+(De?" ("+De.message+")":""));throw ee.context=De,ee}var yt=c[O];if(yt===void 0)return!1;if(typeof yt=="function")Yh(yt,this,re);else for(var st=yt.length,Ve=eu(yt,st),ue=0;ue0&&De.length>Ie&&!De.warned){De.warned=!0;var ee=new Error("Possible EventEmitter memory leak detected. "+De.length+" "+String(O)+" listeners added. Use emitter.setMaxListeners() to increase limit");ee.name="MaxListenersExceededWarning",ee.emitter=k,ee.type=O,ee.count=De.length,Mp(ee)}return k}ni.prototype.addListener=function(O,re){return jh(this,O,re,!1)};ni.prototype.on=ni.prototype.addListener;ni.prototype.prependListener=function(O,re){return jh(this,O,re,!0)};function Fp(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Qh(k,O,re){var ue={fired:!1,wrapFn:void 0,target:k,type:O,listener:re},Ie=Fp.bind(ue);return Ie.listener=re,ue.wrapFn=Ie,Ie}ni.prototype.once=function(O,re){return Jl(re),this.on(O,Qh(this,O,re)),this};ni.prototype.prependOnceListener=function(O,re){return Jl(re),this.prependListener(O,Qh(this,O,re)),this};ni.prototype.removeListener=function(O,re){var ue,Ie,c,De,ee;if(Jl(re),Ie=this._events,Ie===void 0)return this;if(ue=Ie[O],ue===void 0)return this;if(ue===re||ue.listener===re)--this._eventsCount===0?this._events=Object.create(null):(delete Ie[O],Ie.removeListener&&this.emit("removeListener",O,ue.listener||re));else if(typeof ue!="function"){for(c=-1,De=ue.length-1;De>=0;De--)if(ue[De]===re||ue[De].listener===re){ee=ue[De].listener,c=De;break}if(c<0)return this;c===0?ue.shift():Kp(ue,c),ue.length===1&&(Ie[O]=ue[0]),Ie.removeListener!==void 0&&this.emit("removeListener",O,ee||re)}return this};ni.prototype.off=ni.prototype.removeListener;ni.prototype.removeAllListeners=function(O){var re,ue,Ie;if(ue=this._events,ue===void 0)return this;if(ue.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):ue[O]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete ue[O]),this;if(arguments.length===0){var c=Object.keys(ue),De;for(Ie=0;Ie=0;Ie--)this.removeListener(O,re[Ie]);return this};function qh(k,O,re){var ue=k._events;if(ue===void 0)return[];var Ie=ue[O];return Ie===void 0?[]:typeof Ie=="function"?re?[Ie.listener||Ie]:[Ie]:re?Xp(Ie):eu(Ie,Ie.length)}ni.prototype.listeners=function(O){return qh(this,O,!0)};ni.prototype.rawListeners=function(O){return qh(this,O,!1)};ni.listenerCount=function(k,O){return typeof k.listenerCount=="function"?k.listenerCount(O):$h.call(k,O)};ni.prototype.listenerCount=$h;function $h(k){var O=this._events;if(O!==void 0){var re=O[k];if(typeof re=="function")return 1;if(re!==void 0)return re.length}return 0}ni.prototype.eventNames=function(){return this._eventsCount>0?Wl(this._events):[]};function eu(k,O){for(var re=new Array(O),ue=0;ue{su.exports={fr:{name:"France",bbox:[[-4.59235,41.380007],[9.560016,51.148506]]},us:{name:"United States",bbox:[[-171.791111,18.91619],[-66.96466,71.357764]]},ru:{name:"Russia",bbox:[[19.66064,41.151416],[190.10042,81.2504]]},ca:{name:"Canada",bbox:[[-140.99778,41.675105],[-52.648099,83.23324]]}}});var ou=cn((BI,ru)=>{"use strict";var Pp={de:"Suche",it:"Ricerca",en:"Search",nl:"Zoeken",fr:"Chercher",ca:"Cerca",he:"\u05DC\u05D7\u05E4\u05E9",ja:"\u30B5\u30FC\u30C1",lv:"Mekl\u0113t",pt:"Procurar",sr:"\u041F\u0440\u0435\u0442\u0440\u0430\u0433\u0430",zh:"\u641C\u7D22",cs:"Vyhled\xE1v\xE1n\xED",hu:"Keres\xE9s",ka:"\u10EB\u10D8\u10D4\u10D1\u10D0",nb:"S\xF8ke",sk:"Vyh\u013Ead\xE1vanie",th:"\u0E04\u0E49\u0E19\u0E2B\u0E32",fi:"Hae",is:"Leita",ko:"\uC218\uC0C9",pl:"Szukaj",sl:"Iskanje",fa:"\u062C\u0633\u062A\u062C\u0648",ru:"\u041F\u043E\u0438\u0441\u043A"};ru.exports={placeholder:Pp}});var lu=cn((au,zl)=>{(function(k,O,re){typeof zl<"u"&&zl.exports?zl.exports=re():k[O]=re()})(au,"subtag",function(){var k="",O=/^([a-zA-Z]{2,3})(?:[_-]+([a-zA-Z]{3})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{4})(?=$|[_-]+))?(?:[_-]+([a-zA-Z]{2}|[0-9]{3})(?=$|[_-]+))?/;function re(ee){return ee.match(O)||[]}function ue(ee){return re(ee).filter(function(yt,st){return yt&&st})}function Ie(ee){return ee=re(ee),{language:ee[1]||k,extlang:ee[2]||k,script:ee[3]||k,region:ee[4]||k}}function c(ee,yt,st){Object.defineProperty(ee,yt,{value:st,enumerable:!0})}function De(ee,yt,st){function Ve(di){return re(di)[ee]||k}c(Ve,"pattern",yt),c(Ie,st,Ve)}return De(1,/^[a-zA-Z]{2,3}$/,"language"),De(2,/^[a-zA-Z]{3}$/,"extlang"),De(3,/^[a-zA-Z]{4}$/,"script"),De(4,/^[a-zA-Z]{2}$|^[0-9]{3}$/,"region"),c(Ie,"split",ue),Ie})});var uu=cn((GI,hu)=>{"use strict";var Ep=Lh(),Dp=Dh(),gn=Pc(),Yp=iu().EventEmitter,cu=nu(),Np=ou(),Op=lu();function gu(k,O){this._eventEmitter=new Yp,this.options=gn({},this.options,O),this.inputString="",this.fresh=!0,this.lastSelected=null,this.geocoderApi=k}gu.prototype={options:{zoom:16,flyTo:!0,trackProximity:!0,showResultsWhileTyping:!1,minLength:2,reverseGeocode:!1,limit:5,enableEventLogging:!0,marker:!0,popup:!1,maplibregl:null,collapsed:!1,clearAndBlurOnEsc:!1,clearOnBlur:!1,getItemValue:function(k){return k.text!==void 0?k.text:k.place_name},render:function(k){if(k.geometry){var ee=k.place_name.split(",");return'
'+ee[0]+'
'+ee.splice(1,ee.length).join(",")+"
"}else{var O=k.text,re=O.toLowerCase().indexOf(this.query.toLowerCase()),ue=this.query.length,Ie=O.substring(0,re),c=O.substring(re,re+ue),De=O.substring(re+ue);return'
'+Ie+''+c+""+De+"
"}},popupRender:function(k){var O=k.place_name.split(",");return'"},showResultMarkers:!0,debounceSearch:200},addTo:function(k){function O(ue,Ie){if(!document.body.contains(Ie))throw new Error("Element provided to #addTo() exists, but is not in the DOM");var c=ue.onAdd();Ie.appendChild(c)}if(k._controlContainer)k.addControl(this);else if(k instanceof HTMLElement)O(this,k);else if(typeof k=="string"){var re=document.querySelectorAll(k);if(re.length===0)throw new Error("Element ",k,"not found.");if(re.length>1)throw new Error("Geocoder can only be added to a single html element");O(this,re[0])}else throw new Error("Error: addTo must be a maplibre-gl-js map, an html element, or a CSS selector query for a single html element")},onAdd:function(k){if(k&&typeof k!="string"&&(this._map=k),this.setLanguage(),this.options.localGeocoderOnly&&!this.options.localGeocoder)throw new Error("A localGeocoder function must be specified to use localGeocoderOnly mode");this._onChange=this._onChange.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onPaste=this._onPaste.bind(this),this._onBlur=this._onBlur.bind(this),this._showButton=this._showButton.bind(this),this._hideButton=this._hideButton.bind(this),this._onQueryResult=this._onQueryResult.bind(this),this.clear=this.clear.bind(this),this._updateProximity=this._updateProximity.bind(this),this._collapse=this._collapse.bind(this),this._unCollapse=this._unCollapse.bind(this),this._clear=this._clear.bind(this),this._clearOnBlur=this._clearOnBlur.bind(this);var O=this.container=document.createElement("div");O.className="mapboxgl-ctrl-geocoder mapboxgl-ctrl maplibregl-ctrl-geocoder maplibregl-ctrl";var re=this.createIcon("search",'');this._inputEl=document.createElement("input"),this._inputEl.type="text",this._inputEl.className="mapboxgl-ctrl-geocoder--input maplibregl-ctrl-geocoder--input",this.setPlaceholder(),this.options.collapsed&&(this._collapse(),this.container.addEventListener("mouseenter",this._unCollapse),this.container.addEventListener("mouseleave",this._collapse),this._inputEl.addEventListener("focus",this._unCollapse)),(this.options.collapsed||this.options.clearOnBlur)&&this._inputEl.addEventListener("blur",this._onBlur),this._inputEl.addEventListener("keydown",Dp(this._onKeyDown,this.options.debounceSearch)),this._inputEl.addEventListener("paste",this._onPaste),this._inputEl.addEventListener("change",this._onChange),this.container.addEventListener("mouseenter",this._showButton),this.container.addEventListener("mouseleave",this._hideButton);var ue=document.createElement("div");ue.classList.add("mapboxgl-ctrl-geocoder--pin-right","maplibregl-ctrl-geocoder--pin-right"),this._clearEl=document.createElement("button"),this._clearEl.setAttribute("aria-label","Clear"),this._clearEl.addEventListener("click",this.clear),this._clearEl.className="mapboxgl-ctrl-geocoder--button maplibregl-ctrl-geocoder--button";var Ie=this.createIcon("close",'');return this._clearEl.appendChild(Ie),this._loadingEl=this.createIcon("loading",''),ue.appendChild(this._clearEl),ue.appendChild(this._loadingEl),O.appendChild(re),O.appendChild(this._inputEl),O.appendChild(ue),this._typeahead=new Ep(this._inputEl,[],{filter:!1,minLength:this.options.minLength,limit:this.options.limit,noInitialSelection:!0}),this.setRenderFunction(this.options.render),this._typeahead.getItemValue=this.options.getItemValue,this.mapMarker=null,this.resultMarkers=[],this._handleMarker=this._handleMarker.bind(this),this._handleResultMarkers=this._handleResultMarkers.bind(this),this._map&&(this.options.trackProximity&&(this._updateProximity(),this._map.on("moveend",this._updateProximity)),this._maplibregl=this.options.maplibregl,!this._maplibregl&&this.options.marker&&(console.error("No maplibregl detected in options. Map markers are disabled. Please set options.maplibregl."),this.options.marker=!1)),O},createIcon:function(k,O){var re=document.createElementNS("http://www.w3.org/2000/svg","svg");if(re.setAttribute("class","mapboxgl-ctrl-geocoder--icon mapboxgl-ctrl-geocoder--icon-"+k+" maplibregl-ctrl-geocoder--icon maplibregl-ctrl-geocoder--icon-"+k),re.setAttribute("viewBox","0 0 18 18"),re.setAttribute("xml:space","preserve"),re.setAttribute("width",18),re.setAttribute("height",18),"innerHTML"in re)re.innerHTML=O;else{var ue=document.createElement("div");ue.innerHTML=""+O.valueOf().toString()+"";var Ie=ue.firstChild,c=Ie.firstChild;re.appendChild(c)}return re},onRemove:function(){return this.container.parentNode.removeChild(this.container),this.options.trackProximity&&this._map&&this._map.off("moveend",this._updateProximity),this._removeMarker(),this._map=null,this},_onPaste:function(k){var O=(k.clipboardData||window.clipboardData).getData("text");O.length>=this.options.minLength&&this.options.showResultsWhileTyping&&this._geocode(O)},_onKeyDown:function(k){var O=27,re=9;if(k.keyCode===O&&this.options.clearAndBlurOnEsc)return this._clear(k),this._inputEl.blur();var ue=k.target&&k.target.shadowRoot?k.target.shadowRoot.activeElement:k.target,Ie=ue?ue.value:"";if(!Ie)return this.fresh=!0,k.keyCode!==re&&this.clear(k),this._clearEl.style.display="none";if(!(k.metaKey||[re,O,37,39,38,40].indexOf(k.keyCode)!==-1)){if(k.keyCode===13)if(!this.options.showResultsWhileTyping)this._typeahead.selected||this._geocode(ue.value);else{this._typeahead.selected==null&&this.geocoderApi.getSuggestions?this._geocode(ue.value,!0):this._typeahead.selected==null&&this.options.showResultMarkers&&this._fitBoundsForMarkers();return}ue.value.length>=this.options.minLength&&this.options.showResultsWhileTyping&&this._geocode(ue.value)}},_showButton:function(){this._inputEl.value.length>0&&(this._clearEl.style.display="block")},_hideButton:function(){this._typeahead.selected&&(this._clearEl.style.display="none")},_onBlur:function(k){this.options.clearOnBlur&&this._clearOnBlur(k),this.options.collapsed&&this._collapse()},_onChange:function(){var k=this._typeahead.selected;if(k&&!k.geometry)k.placeId?this._geocode(k.placeId,!0,!0):this._geocode(k.text,!0);else if(k&&JSON.stringify(k)!==this.lastSelected){if(this._clearEl.style.display="none",this.options.flyTo){var O;if(this._removeResultMarkers(),k.properties&&cu[k.properties.short_code])O=gn({},this.options.flyTo),this._map&&this._map.fitBounds(cu[k.properties.short_code].bbox,O);else if(k.bbox){var re=k.bbox;O=gn({},this.options.flyTo),this._map&&this._map.fitBounds([[re[0],re[1]],[re[2],re[3]]],O)}else{var ue={zoom:this.options.zoom};O=gn({},ue,this.options.flyTo),k.center?O.center=k.center:k.geometry&&k.geometry.type&&k.geometry.type==="Point"&&k.geometry.coordinates&&(O.center=k.geometry.coordinates),this._map&&this._map.flyTo(O)}}this.options.marker&&this._maplibregl&&this._handleMarker(k),this._inputEl.focus(),this._inputEl.scrollLeft=0,this._inputEl.setSelectionRange(0,0),this.lastSelected=JSON.stringify(k),this._typeahead.selected=null,this._eventEmitter.emit("result",{result:k})}},_getConfigForRequest:function(){var k=["bbox","limit","proximity","countries","types","language","reverseMode"],O=this,re=k.reduce(function(ue,Ie){return O.options[Ie]&&(["countries","types","language"].indexOf(Ie)>-1?ue[Ie]=O.options[Ie].split(/[\s,]+/):ue[Ie]=O.options[Ie],Ie==="proximity"&&O.options[Ie]&&typeof O.options[Ie].longitude=="number"&&typeof O.options[Ie].latitude=="number"&&(ue[Ie]=[O.options[Ie].longitude,O.options[Ie].latitude])),ue},{});return re},_geocode:function(k,O,re){this._loadingEl.style.display="block",this._eventEmitter.emit("loading",{query:k}),this.inputString=k;var ue=null,Ie=this._getConfigForRequest(),c;if(this.options.localGeocoderOnly)c=Promise.resolve();else if(this.options.reverseGeocode&&/(-?\d+\.?\d*)[, ]+(-?\d+\.?\d*)[ ]*$/.test(k)){var De=k.split(/[\s(,)?]+/).map(function(st){return parseFloat(st,10)}).reverse();Ie.types&&Ie.types[0],Ie=gn(Ie,{query:De,limit:1}),"proximity"in Ie&&delete Ie.proximity,c=this.geocoderApi.reverseGeocode(Ie)}else Ie=gn(Ie,{query:k}),this.geocoderApi.getSuggestions?O?this.geocoderApi.searchByPlaceId&&re?c=this.geocoderApi.searchByPlaceId(Ie):c=this.geocoderApi.forwardGeocode(Ie):c=this.geocoderApi.getSuggestions(Ie):c=this.geocoderApi.forwardGeocode(Ie);var ee=[];this.options.localGeocoder&&(ee=this.options.localGeocoder(k),ee||(ee=[]));var yt=[];return c.catch(function(st){ue=st}.bind(this)).then(function(st){this._loadingEl.style.display="none";var Ve={};return st?Ve=st:Ve={type:"FeatureCollection",features:[]},Ve.config=Ie,this.fresh&&(this.fresh=!1),Ve.features=Ve.features?ee.concat(Ve.features):ee,this.options.externalGeocoder?(yt=this.options.externalGeocoder(k,Ve.features,Ie)||[],yt.then(function(di){return Ve.features=Ve.features?di.concat(Ve.features):di,Ve},function(){return Ve})):Ve}.bind(this)).then(function(st){if(ue)throw ue;this.options.filter&&st.features.length&&(st.features=st.features.filter(this.options.filter));var Ve=[];st.suggestions?Ve=st.suggestions:st.place?Ve=[st.place]:Ve=st.features,Ve.length?(this._clearEl.style.display="block",this._typeahead.update(Ve),(!this.options.showResultsWhileTyping||O)&&this.options.showResultMarkers&&(st.features.length>0||st.place)&&this._fitBoundsForMarkers(),this._eventEmitter.emit("results",st)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderNoResults(),this._eventEmitter.emit("results",st))}.bind(this)).catch(function(st){this._loadingEl.style.display="none",ee.length&&this.options.localGeocoder||yt.length&&this.options.externalGeocoder?(this._clearEl.style.display="block",this._typeahead.update(ee)):(this._clearEl.style.display="none",this._typeahead.selected=null,this._renderError()),this._eventEmitter.emit("results",{features:ee}),this._eventEmitter.emit("error",{error:st})}.bind(this)),c},_clear:function(k){k&&k.preventDefault(),this._inputEl.value="",this._typeahead.selected=null,this._typeahead.clear(),this._onChange(),this._clearEl.style.display="none",this._removeMarker(),this._removeResultMarkers(),this.lastSelected=null,this._eventEmitter.emit("clear"),this.fresh=!0},clear:function(k){this._clear(k),this._inputEl.focus()},_clearOnBlur:function(k){var O=this;k.relatedTarget&&O._clear(k)},_onQueryResult:function(k){var O=k;if(!!O.features.length){var re=O.features[0];this._typeahead.selected=re,this._inputEl.value=re.place_name,this._onChange()}},_updateProximity:function(){if(!!this._map)if(this._map.getZoom()>9){var k=this._map.getCenter().wrap();this.setProximity({longitude:k.lng,latitude:k.lat})}else this.setProximity(null)},_collapse:function(){!this._inputEl.value&&this._inputEl!==document.activeElement&&this.container.classList.add("mapboxgl-ctrl-geocoder--collapsed","maplibregl-ctrl-geocoder--collapsed")},_unCollapse:function(){this.container.classList.remove("mapboxgl-ctrl-geocoder--collapsed","maplibregl-ctrl-geocoder--collapsed")},query:function(k){return this._geocode(k).then(this._onQueryResult),this},_renderError:function(){var k="
There was an error reaching the server
";this._renderMessage(k)},_renderNoResults:function(){var k="
No results found
";this._renderMessage(k)},_renderMessage:function(k){this._typeahead.update([]),this._typeahead.selected=null,this._typeahead.clear(),this._typeahead.renderError(k)},_getPlaceholderText:function(){if(this.options.placeholder)return this.options.placeholder;if(this.options.language){var k=this.options.language.split(",")[0],O=Op.language(k),re=Np.placeholder[O];if(re)return re}return"Search"},_fitBoundsForMarkers:function(){if(!(this._typeahead.data.length<1)){var k=this._typeahead.data.filter(function(Ie){return typeof Ie!="string"}).slice(0,this.options.limit);if(this._clearEl.style.display="none",this.options.flyTo&&this._maplibregl&&this._map){var O={padding:100},re=gn({},O,this.options.flyTo),ue=new this._maplibregl.LngLatBounds;k.forEach(function(Ie){ue.extend(Ie.geometry.coordinates)}),this._map.fitBounds(ue.toArray(),re)}return k.length>0&&this._maplibregl&&this._handleResultMarkers(k),this}},setInput:function(k){return this._inputEl.value=k,this._typeahead.selected=null,this._typeahead.clear(),k.length>=this.options.minLength&&this.options.showResultsWhileTyping&&this._geocode(k),this},setProximity:function(k){return this.options.proximity=k,this},getProximity:function(){return this.options.proximity},setRenderFunction:function(k){return k&&typeof k=="function"&&(this._typeahead.render=k),this},getRenderFunction:function(){return this._typeahead.render},setLanguage:function(k){var O=navigator.language||navigator.userLanguage||navigator.browserLanguage;return this.options.language=k||this.options.language||O,this},getLanguage:function(){return this.options.language},getZoom:function(){return this.options.zoom},setZoom:function(k){return this.options.zoom=k,this},getFlyTo:function(){return this.options.flyTo},setFlyTo:function(k){return this.options.flyTo=k,this},getPlaceholder:function(){return this.options.placeholder},setPlaceholder:function(k){return this.placeholder=k||this._getPlaceholderText(),this._inputEl.placeholder=this.placeholder,this._inputEl.setAttribute("aria-label",this.placeholder),this},getBbox:function(){return this.options.bbox},setBbox:function(k){return this.options.bbox=k,this},getCountries:function(){return this.options.countries},setCountries:function(k){return this.options.countries=k,this},getTypes:function(){return this.options.types},setTypes:function(k){return this.options.types=k,this},getMinLength:function(){return this.options.minLength},setMinLength:function(k){return this.options.minLength=k,this._typeahead&&(this._typeahead.options.minLength=k),this},getLimit:function(){return this.options.limit},setLimit:function(k){return this.options.limit=k,this._typeahead&&(this._typeahead.options.limit=k),this},getFilter:function(){return this.options.filter},setFilter:function(k){return this.options.filter=k,this},setGeocoderApi:function(k){return this.geocoderApi=k,this},getGeocoderApi:function(){return this.geocoderApi},_handleMarker:function(k){if(!!this._map){this._removeMarker();var O={color:"#4668F2"},re=gn({},O,this.options.marker);this.mapMarker=new this._maplibregl.Marker(re);var ue;if(this.options.popup){var Ie={},c=gn({},Ie,this.options.popup);ue=new this._maplibregl.Popup(c).setHTML(this.options.popupRender(k))}return k.center?(this.mapMarker.setLngLat(k.center).addTo(this._map),this.options.popup&&this.mapMarker.setPopup(ue)):k.geometry&&k.geometry.type&&k.geometry.type==="Point"&&k.geometry.coordinates&&(this.mapMarker.setLngLat(k.geometry.coordinates).addTo(this._map),this.options.popup&&this.mapMarker.setPopup(ue)),this}},_removeMarker:function(){this.mapMarker&&(this.mapMarker.remove(),this.mapMarker=null)},_handleResultMarkers:function(k){if(!!this._map){this._removeResultMarkers();var O={color:"#4668F2"},re=gn({},O,this.options.showResultMarkers);return k.forEach(function(ue){if(this.options.showResultMarkers&&this.options.showResultMarkers.element){var Ie=this.options.showResultMarkers.element.cloneNode(!0);re=gn(re,{element:Ie})}var c=new this._maplibregl.Marker(gn({},re,{element:Ie})),De;if(this.options.popup){var ee={},yt=gn({},ee,this.options.popup);De=new this._maplibregl.Popup(yt).setHTML(this.options.popupRender(ue))}ue.center?(c.setLngLat(ue.center).addTo(this._map),this.options.popup&&c.setPopup(De)):ue.geometry&&ue.geometry.type&&ue.geometry.type==="Point"&&ue.geometry.coordinates&&(c.setLngLat(ue.geometry.coordinates).addTo(this._map),this.options.popup&&c.setPopup(De)),this.resultMarkers.push(c)}.bind(this)),this}},_removeResultMarkers:function(){this.resultMarkers&&this.resultMarkers.length>0&&(this.resultMarkers.forEach(function(k){k.remove()}),this.resultMarkers=[])},on:function(k,O){return this._eventEmitter.on(k,O),this},off:function(k,O){return this._eventEmitter.removeListener(k,O),this}};hu.exports=gu});var Vs=Xc(Bh()),du=Xc(Gh()),pu=Xc(uu());function MI(k,O){k.importCSS("main.css"),k.root.innerHTML=` +
+ `;let re="map",ue=O.spec,{markers:Ie=[],clusters:c=[],controls:De=[],locate:ee=[],terrain:yt=[],geocode:st=[],fullscreen:Ve=[],hover:di=[],center:Qi=[],info:Bi=[],images:Qt=[],jumps:qt=[],fit_bounds:qi=[]}=O.events,pt=new Vs.Map({container:re,style:ue});du.default.addProtocols(Vs),pt.on("load",function(){Ie.forEach(({location:Ke,options:et})=>{os({location:Ke,options:et})}),c.forEach(Ke=>{yi(Ke)}),De.forEach(({position:Ke,options:et})=>{as({position:Ke,options:et})}),ee.forEach(({high_accuracy:Ke,options:et})=>{Ei({high_accuracy:Ke,options:et})}),yt.forEach(()=>{Gi()}),st.forEach(()=>{_t()}),Ve.forEach(()=>{Ri()}),di.forEach(Ke=>{fs(Ke)}),Qi.forEach(Ke=>{ls(Ke)}),Bi.forEach(({layer:Ke,property:et})=>{Di({layer:Ke,property:et})}),Qt.forEach(({name:Ke,url:et,options:gt})=>{Vt({name:Ke,url:et,options:gt})}),qt.forEach(({location:Ke,options:et})=>{pt.easeTo({center:Ke,...et})}),qi.forEach(({bounds:Ke,options:et})=>{pt.fitBounds(Ke,et)})}),k.handleEvent("add_markers",Ke=>{Ke.forEach(({location:et,options:gt})=>{os({location:et,options:gt})})}),k.handleEvent("add_marker",({location:Ke,options:et})=>{os({location:Ke,options:et})}),k.handleEvent("add_nav_controls",({position:Ke,options:et})=>{as({position:Ke,options:et})}),k.handleEvent("add_locate",({high_accuracy:Ke,options:et})=>{Ei({high_accuracy:Ke,options:et})}),k.handleEvent("add_terrain",()=>{Gi()}),k.handleEvent("add_geocode",()=>{_t()}),k.handleEvent("add_fullscreen",()=>{Ri()}),k.handleEvent("clusters_expansion",Ke=>{yi(Ke)}),k.handleEvent("add_hover",Ke=>{fs(Ke)}),k.handleEvent("center_on_click",Ke=>{ls(Ke)}),k.handleEvent("info_on_click",({layer:Ke,property:et})=>{Di({layer:Ke,property:et})}),k.handleEvent("add_custom_image",({name:Ke,url:et,options:gt})=>{Vt({name:Ke,url:et,options:gt})}),k.handleEvent("jump_to",({location:Ke,options:et})=>{pt.easeTo({center:Ke,...et})}),k.handleEvent("fit_bounds",({bounds:Ke,options:et})=>{pt.fitBounds(Ke,et)});function os({location:Ke,options:et}){new Vs.Marker(et).setLngLat(Ke).addTo(pt)}function as({position:Ke,options:et}){let gt=new Vs.NavigationControl(et);pt.addControl(gt,Ke)}function Ei({high_accuracy:Ke,options:et}){let gt=new Vs.GeolocateControl({positionOptions:{enableHighAccuracy:Ke,maximumAge:0,timeout:6e3},...et});pt.addControl(gt)}function Gi(){let Ke=pt.getTerrain(),et=new Vs.TerrainControl(Ke);pt.addControl(et)}function _t(){pt.addControl(Ts())}function Ri(){let Ke=new Vs.FullscreenControl;pt.addControl(Ke)}function Vt({name:Ke,url:et,options:gt}){pt.loadImage(et,(mi,Jt)=>{if(mi)throw mi;pt.addImage(Ke,Jt,gt)})}function ls(Ke){pt.on("click",Ke,et=>{let gt=et.features[0].geometry.coordinates;pt.easeTo({center:gt})})}function Di({layer:Ke,property:et}){pt.on("click",Ke,gt=>{new Vs.Popup().setLngLat(gt.lngLat).setHTML(gt.features[0].properties[et]).addTo(pt)}),Vi(Ke)}function fs(Ke){let et=null,gt=pt.getLayer(Ke).source;pt.on("mousemove",Ke,mi=>{mi.features.length>0&&(et&&pt.setFeatureState({source:gt,id:et},{hover:!1}),et=mi.features[0].id,pt.setFeatureState({source:gt,id:et},{hover:!0}))}),pt.on("mouseleave",Ke,()=>{et&&pt.setFeatureState({source:gt,id:et},{hover:!1}),et=null})}function yi(Ke){pt.on("click",Ke,et=>{let gt=pt.getLayer(Ke).source,mi=pt.queryRenderedFeatures(et.point,{layers:[Ke]}),Jt=mi[0].properties.cluster_id;pt.getSource(gt).getClusterExpansionZoom(Jt,(zt,ht)=>{zt||pt.easeTo({center:mi[0].geometry.coordinates,zoom:ht})})}),Vi(Ke)}function Vi(Ke){pt.on("mouseenter",Ke,()=>{pt.getCanvas().style.cursor="pointer"}),pt.on("mouseleave",Ke,()=>{pt.getCanvas().style.cursor=""})}function Ts(){let Ke={forwardGeocode:async et=>{let gt=[];try{let mi=`https://nominatim.openstreetmap.org/search?q=${et.query}&format=geojson&polygon_geojson=1&addressdetails=1`,zt=await(await fetch(mi)).json();for(let ht of zt.features){let ri=[ht.bbox[0]+(ht.bbox[2]-ht.bbox[0])/2,ht.bbox[1]+(ht.bbox[3]-ht.bbox[1])/2],Es={type:"Feature",geometry:{type:"Point",coordinates:ri},place_name:ht.properties.display_name,properties:ht.properties,text:ht.properties.display_name,place_type:["place"],center:ri};gt.push(Es)}}catch(mi){console.error(`Failed to forwardGeocode with error: ${mi}`)}return{features:gt}}};return new pu.default(Ke,{maplibregl:Vs})}}export{MI as init}; diff --git a/lib/kino/maplibre.ex b/lib/kino/maplibre.ex index 11809d2..d032023 100644 --- a/lib/kino/maplibre.ex +++ b/lib/kino/maplibre.ex @@ -26,7 +26,7 @@ defmodule Kino.MapLibre do |> Kino.MapLibre.add_marker({-69, 50}) """ - use Kino.JS, assets_path: "lib/assets/maplibre" + use Kino.JS, assets_path: "lib/assets/maplibre/build" use Kino.JS.Live defstruct spec: %{}, events: %{}