@yarrow-uz/yarrow-map-web-sdk 1.0.46 → 1.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/README.md +28 -1015
- package/dist/main.umd.js +835 -0
- package/dist/module.d.ts +16599 -0
- package/dist/module.js +834 -4
- package/dist/react/index.d.ts +342 -4
- package/dist/react/index.js +83 -2
- package/package.json +9 -15
- package/dist/config/main.d.ts +0 -6
- package/dist/main.d.ts +0 -3
- package/dist/main.js +0 -5
- package/dist/maps/brandBadge.d.ts +0 -24
- package/dist/maps/yarrow.d.ts +0 -173
- package/dist/maps/yarrowControls.d.ts +0 -52
- package/dist/react/YarrowMapView.d.ts +0 -12
- package/dist/react/useYarrowMap.d.ts +0 -39
package/dist/main.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).YarrowMap={})}(this,function(t){"use strict";function e(t,e,i,r){return new(i||(i=Promise))(function(n,a){function o(t){try{l(r.next(t))}catch(t){a(t)}}function s(t){try{l(r.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(o,s)}l((r=r.apply(t,e||[])).next())})}!function(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}(".maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0,0,0,0)}.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;-webkit-user-select:none;-moz-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 rgba(0,0,0,.1)}@media (forced-colors: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 (forced-colors: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}@media (hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}}.maplibregl-ctrl button:not(:disabled):active{background-color:rgba(0,0,0,.05)}.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 13z'/%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.5'/%3E%3C/svg%3E\")}@media (forced-colors: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 13z'/%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.5'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.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 13z'/%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.5'/%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-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%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-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E\")}@media (forced-colors: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-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%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-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.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-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%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-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%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 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}@media (forced-colors: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 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.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 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}}.maplibregl-ctrl button.maplibregl-ctrl-globe .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='none' stroke='%23333' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='8.5'/%3E%3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E%3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E%3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138q.07-.058.224-.138c.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138 1.3 1.3 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.3 1.3 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5 1.5 0 0 1-.39-.272.3.3 0 0 1-.047-.064.3.3 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.3.3 0 0 1 .047.064.3.3 0 0 1-.048.064 1.4 1.4 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0 .018v.002zm17.002.002v-.002zm0-.018v-.002z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-globe-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='none' stroke='%2333b5e5' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='8.5'/%3E%3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E%3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517s-.461-.118-.775-.517c-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11s.331-4.64.853-6.206c.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517s.461.118.775.517c.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E%3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138q.07-.058.224-.138c.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138q-.07.058-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.3 1.3 0 0 1-.224-.138 1.3 1.3 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5s3.622.166 4.845.428c.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.3 1.3 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.5 1.5 0 0 1-.39-.272.3.3 0 0 1-.047-.064.3.3 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.3.3 0 0 1 .047.064.3.3 0 0 1-.048.064 1.4 1.4 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002zm0 .018v.002zm17.002.002v-.002zm0-.018v-.002z'/%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors: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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%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-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E\")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}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.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 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.4q.47.48.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.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.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.8 4.8 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.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 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.528q-.001.515-.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.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 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.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 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.7 4.7 0 0 1-1.782 1.884 4.77 4.77 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.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 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.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 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.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 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-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.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.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.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.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 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.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%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 (forced-colors: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.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 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.4q.47.48.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.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.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.8 4.8 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.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 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.528q-.001.515-.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.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 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.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 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.7 4.7 0 0 1-1.782 1.884 4.77 4.77 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.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 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.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 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.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 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-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.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.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.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.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 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.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){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.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 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.4q.47.48.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.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.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.8 4.8 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.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 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.528q-.001.515-.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.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 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.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 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.7 4.7 0 0 1-1.782 1.884 4.77 4.77 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.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 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.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 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.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 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-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.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.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.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.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 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.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E\")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:hsla(0,0%,100%,.5);margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;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:hsla(0,0%,100%,.5);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{-webkit-appearance:none;-moz-appearance:none;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:rgba(0,0,0,.05)}.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 (forced-colors: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 (forced-colors:active) and (prefers-color-scheme:light){.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:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px;white-space:nowrap}.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}[dir=rtl] .maplibregl-popup-anchor-left{flex-direction:row-reverse}[dir=rtl] .maplibregl-popup-anchor-right{flex-direction:row}[dir=rtl] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-start}[dir=rtl] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-start}.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:rgba(0,0,0,.05)}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);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;-webkit-user-select:none;-moz-user-select: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;transition:opacity .2s;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 rgba(0,0,0,.35);box-sizing:border-box;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@media (prefers-reduced-motion:reduce){.maplibregl-user-location-dot:before{animation:none}}@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),(pointer:coarse){.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}"),"function"==typeof SuppressedError&&SuppressedError;var i,r={exports:{}};
|
|
2
|
-
/**
|
|
3
|
-
* MapLibre GL JS
|
|
4
|
-
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.22.0/LICENSE.txt
|
|
5
|
-
*/var n=(i||(i=1,function(t){t.exports=function(){var t={},e={};function i(i,r,n){if(e[i]=n,"index"===i){var a="var sharedModule = {}; ("+e.shared+")(sharedModule); ("+e.worker+")(sharedModule);",o={};return e.shared(o),e.index(t,o),"undefined"!=typeof window&&t.setWorkerUrl(window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))),t}}return i("shared",["exports"],function(t){function e(t,e,i,r){return new(i||(i=Promise))(function(n,a){function o(t){try{l(r.next(t))}catch(t){a(t)}}function s(t){try{l(r.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(o,s)}l((r=r.apply(t,e||[])).next())})}function i(t,e){this.x=t,this.y=e}function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var n,a;"function"==typeof SuppressedError&&SuppressedError,i.prototype={clone(){return new i(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,e){return this.clone()._rotateAround(t,e)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){const e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult(t){const e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){const t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){const e=Math.cos(t),i=Math.sin(t),r=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=r,this},_rotateAround(t,e){const i=Math.cos(t),r=Math.sin(t),n=e.y+r*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-r*(this.y-e.y),this.y=n,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:i},i.convert=function(t){if(t instanceof i)return t;if(Array.isArray(t))return new i(+t[0],+t[1]);if(void 0!==t.x&&void 0!==t.y)return new i(+t.x,+t.y);throw new Error("Expected [x, y] or {x, y} point format")};var o=function(){if(a)return n;function t(t,e,i,r){this.cx=3*t,this.bx=3*(i-t)-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=t,this.p1y=e,this.p2x=i,this.p2y=r}return a=1,n=t,t.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var n=this.sampleCurveX(i)-t;if(Math.abs(n)<e)return i;var a=this.sampleCurveDerivativeX(i);if(Math.abs(a)<1e-6)break;i-=n/a}var o=0,s=1;for(i=t,r=0;r<20&&(n=this.sampleCurveX(i),!(Math.abs(n-t)<e));r++)t>n?o=i:s=i,i=.5*(s-o)+o;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},n}(),s=r(o);let l,c;function h(){return null==l&&(l="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),l}function u(){if(null==c&&(c=!1,h())){const t=5,e=new OffscreenCanvas(t,t).getContext("2d",{willReadFrequently:!0});if(e){for(let i=0;i<t*t;i++){const r=4*i;e.fillStyle=`rgb(${r},${r+1},${r+2})`,e.fillRect(i%t,Math.floor(i/t),1,1)}const i=e.getImageData(0,0,t,t).data;for(let e=0;e<t*t*4;e++)if(e%4!=3&&i[e]!==e){c=!0;break}}}return c||!1}var d=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array;function m(){var t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function f(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function g(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function _(t){var e=t[0],i=t[1],r=t[2];return Math.sqrt(e*e+i*i+r*r)}function y(t,e,i){var r=new p(3);return r[0]=t,r[1]=e,r[2]=i,r}function x(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function b(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function v(t,e,i){var r=e[0],n=e[1],a=e[2],o=i[0],s=i[1],l=i[2];return t[0]=n*l-a*s,t[1]=a*o-r*l,t[2]=r*s-n*o,t}var T,w=_;function V(t,e,i){var r=e[0],n=e[1],a=e[2],o=e[3];return t[0]=i[0]*r+i[4]*n+i[8]*a+i[12]*o,t[1]=i[1]*r+i[5]*n+i[9]*a+i[13]*o,t[2]=i[2]*r+i[6]*n+i[10]*a+i[14]*o,t[3]=i[3]*r+i[7]*n+i[11]*a+i[15]*o,t}function R(){var t=new p(4);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function M(t,e,i,r){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",a=Math.PI/360;e*=a,r*=a,i*=a;var o=Math.sin(e),s=Math.cos(e),l=Math.sin(i),c=Math.cos(i),h=Math.sin(r),u=Math.cos(r);switch(n){case"xyz":t[0]=o*c*u+s*l*h,t[1]=s*l*u-o*c*h,t[2]=s*c*h+o*l*u,t[3]=s*c*u-o*l*h;break;case"xzy":t[0]=o*c*u-s*l*h,t[1]=s*l*u-o*c*h,t[2]=s*c*h+o*l*u,t[3]=s*c*u+o*l*h;break;case"yxz":t[0]=o*c*u+s*l*h,t[1]=s*l*u-o*c*h,t[2]=s*c*h-o*l*u,t[3]=s*c*u+o*l*h;break;case"yzx":t[0]=o*c*u+s*l*h,t[1]=s*l*u+o*c*h,t[2]=s*c*h-o*l*u,t[3]=s*c*u-o*l*h;break;case"zxy":t[0]=o*c*u-s*l*h,t[1]=s*l*u+o*c*h,t[2]=s*c*h+o*l*u,t[3]=s*c*u-o*l*h;break;case"zyx":t[0]=o*c*u-s*l*h,t[1]=s*l*u+o*c*h,t[2]=s*c*h-o*l*u,t[3]=s*c*u+o*l*h;break;default:throw new Error("Unknown angle order "+n)}return t}function U(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function S(t,e){var i=new p(2);return i[0]=t,i[1]=e,i}g(),T=new p(4),p!=Float32Array&&(T[0]=0,T[1]=0,T[2]=0,T[3]=0),g(),y(1,0,0),y(0,1,0),R(),R(),m(),U();const N=8192;function E(t,e,i){return e*(N/(t.tileSize*Math.pow(2,i-t.tileID.overscaledZ)))}function F(t,e){return(t%e+e)%e}function Z(t,e,i){return t*(1-i)+e*i}function k(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}function z(t,e,i,r){const n=new s(t,e,i,r);return t=>n.solve(t)}const W=z(.25,.1,.25,1);function I(t,e,i){return Math.min(i,Math.max(e,t))}function D(t,e,i){const r=i-e,n=((t-e)%r+r)%r+e;return n===e?i:n}function C(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}let B=1;function P(t,e,i){const r={};for(const i in t)r[i]=e.call(this,t[i],i,t);return r}function O(t,e,i){const r={};for(const i in t)e.call(this,t[i],i,t)&&(r[i]=t[i]);return r}function L(t){return Array.isArray(t)?t.map(L):"object"==typeof t&&t?P(t,L):t}const j={};function A(t){j[t]||("undefined"!=typeof console&&console.warn(t),j[t]=!0)}function G(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function Y(t){return"undefined"!=typeof WorkerGlobalScope&&void 0!==t&&t instanceof WorkerGlobalScope}let Q=null;function J(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap}const X="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function H(t,i,r,n,a){return e(this,void 0,void 0,function*(){if("undefined"==typeof VideoFrame)throw new Error("VideoFrame not supported");const e=new VideoFrame(t,{timestamp:0});try{const o=null==e?void 0:e.format;if(!o||!o.startsWith("BGR")&&!o.startsWith("RGB"))throw new Error(`Unrecognized format ${o}`);const s=o.startsWith("BGR"),l=new Uint8ClampedArray(n*a*4);if(yield e.copyTo(l,function(t,e,i,r,n){const a=4*Math.max(-e,0),o=(Math.max(0,i)-i)*r*4+a,s=4*r,l=Math.max(0,e),c=Math.max(0,i);return{rect:{x:l,y:c,width:Math.min(t.width,e+r)-l,height:Math.min(t.height,i+n)-c},layout:[{offset:o,stride:s}]}}(t,i,r,n,a)),s)for(let t=0;t<l.length;t+=4){const e=l[t];l[t]=l[t+2],l[t+2]=e}return l}finally{e.close()}})}let q,K;function $(t,e,i,r){return t.addEventListener(e,i,r),{unsubscribe:()=>{t.removeEventListener(e,i,r)}}}function tt(t){return t*Math.PI/180}function et(t){return t/Math.PI*180}const it={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},rt={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},nt="AbortError";class at extends Error{constructor(t=nt){super(t instanceof Error?t.message:t),this.name=nt,t instanceof Error&&t.stack&&(this.stack=t.stack)}}function ot(t){return t.name===nt}function st(t){if(t.aborted)throw new at(t.reason)}const lt={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function ct(t){return lt.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}const ht="global-dispatcher";class ut extends Error{constructor(t,e,i,r){super(`AJAXError: ${e} (${t}): ${i}`),this.status=t,this.statusText=e,this.url=i,this.body=r}}const dt=()=>Y(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,pt=function(t,i){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){const e=ct(t.url);if(e)return e(t,i);if(Y(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:ht},i)}if(!(/^file:/.test(r=t.url)||/^file:/.test(dt())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(t,i){return e(this,void 0,void 0,function*(){const e=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:dt(),referrerPolicy:t.referrerPolicy,signal:i.signal});let r,n;"json"!==t.type||e.headers.has("Accept")||e.headers.set("Accept","application/json");try{r=yield fetch(e)}catch(e){if(ot(e))throw e;throw new ut(0,e.message,t.url,new Blob)}if(!r.ok){const e=yield r.blob();throw new ut(r.status,r.statusText,t.url,e)}n="arrayBuffer"===t.type||"image"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text();const a=yield n;return st(i.signal),{data:a,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires"),etag:r.headers.get("ETag")}})}(t,i);if(Y(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:ht},i)}var r;return function(t,e){return new Promise((i,r)=>{var n;const a=new XMLHttpRequest;a.open(t.method||"GET",t.url,!0),"arrayBuffer"!==t.type&&"image"!==t.type||(a.responseType="arraybuffer");for(const e in t.headers)a.setRequestHeader(e,t.headers[e]);"json"===t.type&&(a.responseType="text",(null===(n=t.headers)||void 0===n?void 0:n.Accept)||a.setRequestHeader("Accept","application/json")),a.withCredentials="include"===t.credentials,a.onerror=()=>{r(new Error(a.statusText))},a.onload=()=>{if(!e.signal.aborted)if((a.status>=200&&a.status<300||0===a.status)&&null!==a.response){let e=a.response;if("json"===t.type)try{e=JSON.parse(a.response)}catch(t){return void r(t)}i({data:e,cacheControl:a.getResponseHeader("Cache-Control"),expires:a.getResponseHeader("Expires"),etag:a.getResponseHeader("ETag")})}else{const e=new Blob([a.response],{type:a.getResponseHeader("Content-Type")});r(new ut(a.status,a.statusText,t.url,e))}},e.signal.addEventListener("abort",()=>{a.abort(),r(new at(e.signal.reason))}),a.send(t.body)})}(t,i)};function mt(t){if(!t||t.indexOf("://")<=0||0===t.indexOf("data:image/")||0===t.indexOf("blob:"))return!0;const e=new URL(t),i=window.location;return e.protocol===i.protocol&&e.host===i.host}function ft(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function gt(t,e,i){if(i&&i[t]){const r=i[t].indexOf(e);-1!==r&&i[t].splice(r,1)}}class _t{constructor(t,e={}){C(this,e),this.type=t}}class yt extends _t{constructor(t,e={}){super("error",C({error:t},e))}}class xt{on(t,e){return this._listeners=this._listeners||{},ft(t,e,this._listeners),{unsubscribe:()=>{this.off(t,e)}}}off(t,e){return gt(t,e,this._listeners),gt(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},ft(t,e,this._oneTimeListeners),this):new Promise(e=>this.once(t,e))}fire(t,e){"string"==typeof t&&(t=new _t(t,e||{}));const i=t.type;if(this.listens(i)){t.target=this;const e=this._listeners&&this._listeners[i]?this._listeners[i].slice():[];for(const i of e)i.call(this,t);const r=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];for(const e of r)gt(i,e,this._oneTimeListeners),e.call(this,t);const n=this._eventedParent;n&&(C(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),n.fire(t))}else t instanceof yt&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}var bt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},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},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{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:"filter"},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:{},"color-relief":{},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_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"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","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},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:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","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","feature"]},"property-type":"cross-faded-data-driven"},"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"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,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:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",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"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const vt=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Tt(t,e){const i={};for(const e in t)"ref"!==e&&(i[e]=t[e]);return vt.forEach(t=>{t in e&&(i[t]=e[t])}),i}function wt(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!wt(t[i],e[i]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(!wt(t[i],e[i]))return!1;return!0}return t===e}function Vt(t,e){t.push(e)}function Rt(t,e,i){Vt(i,{command:"addSource",args:[t,e[t]]})}function Mt(t,e,i){Vt(e,{command:"removeSource",args:[t]}),i[t]=!0}function Ut(t,e,i,r){Mt(t,i,r),Rt(t,e,i)}function St(t,e,i){let r;for(r in t[i])if(Object.prototype.hasOwnProperty.call(t[i],r)&&"data"!==r&&!wt(t[i][r],e[i][r]))return!1;for(r in e[i])if(Object.prototype.hasOwnProperty.call(e[i],r)&&"data"!==r&&!wt(t[i][r],e[i][r]))return!1;return!0}function Nt(t,e,i,r,n,a){t=t||{},e=e||{};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(wt(t[o],e[o])||i.push({command:a,args:[r,o,e[o],n]}));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&!Object.prototype.hasOwnProperty.call(t,o)&&(wt(t[o],e[o])||i.push({command:a,args:[r,o,e[o],n]}))}function Et(t){return t.id}function Ft(t,e){return t[e.id]=e,t}class Zt{constructor(t,e,i,r){this.message=(t?`${t}: `:"")+i,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)}}function kt(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}class zt extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Wt{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,i]of e)this.bindings[t]=i}concat(t){return new Wt(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const It={kind:"null"},Dt={kind:"number"},Ct={kind:"string"},Bt={kind:"boolean"},Pt={kind:"color"},Ot={kind:"projectionDefinition"},Lt={kind:"object"},jt={kind:"value"},At={kind:"collator"},Gt={kind:"formatted"},Yt={kind:"padding"},Qt={kind:"colorArray"},Jt={kind:"numberArray"},Xt={kind:"resolvedImage"},Ht={kind:"variableAnchorOffsetCollection"};function qt(t,e){return{kind:"array",itemType:t,N:e}}function Kt(t){if("array"===t.kind){const e=Kt(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const $t=[It,Dt,Ct,Bt,Pt,Ot,Gt,Lt,qt(jt),Yt,Jt,Qt,Xt,Ht];function te(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!te(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of $t)if(!te(t,e))return null}return`Expected ${Kt(t)} but found ${Kt(e)} instead.`}function ee(t,e){return e.some(e=>e.kind===t.kind)}function ie(t,e){return e.some(e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t)}function re(t,e){return"array"===t.kind&&"array"===e.kind?t.itemType.kind===e.itemType.kind&&"number"==typeof t.N:t.kind===e.kind}const ne=.96422,ae=.82521,oe=4/29,se=6/29,le=3*se*se,ce=se*se*se,he=Math.PI/180,ue=180/Math.PI;function de(t){return(t%=360)<0&&(t+=360),t}function pe([t,e,i,r]){let n,a;const o=fe((.2225045*(t=me(t))+.7168786*(e=me(e))+.0606169*(i=me(i)))/1);t===e&&e===i?n=a=o:(n=fe((.4360747*t+.3850649*e+.1430804*i)/ne),a=fe((.0139322*t+.0971045*e+.7141733*i)/ae));const s=116*o-16;return[s<0?0:s,500*(n-o),200*(o-a),r]}function me(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fe(t){return t>ce?Math.pow(t,1/3):t/le+oe}function ge([t,e,i,r]){let n=(t+16)/116,a=isNaN(e)?n:n+e/500,o=isNaN(i)?n:n-i/200;return n=1*ye(n),a=ne*ye(a),o=ae*ye(o),[_e(3.1338561*a-1.6168667*n-.4906146*o),_e(-.9787684*a+1.9161415*n+.033454*o),_e(.0719453*a-.2289914*n+1.4052427*o),r]}function _e(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function ye(t){return t>se?t*t*t:le*(t-oe)}const xe=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function be(t,e){return xe(t,e)?t[e]:void 0}function ve(t){return parseInt(t.padEnd(2,t),16)/255}function Te(t,e){return we(e?t/100:t,0,1)}function we(t,e,i){return Math.min(Math.max(e,t),i)}function Ve(t){return!t.some(Number.isNaN)}const Re={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]};function Me(t,e,i){return t+i*(e-t)}function Ue(t,e,i){return t.map((t,r)=>Me(t,e[r],i))}class Se{constructor(t,e,i,r=1,n=!0){this.r=t,this.g=e,this.b=i,this.a=r,n||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter("rgb",[t,e,i,r]))}static parse(t){if(t instanceof Se)return t;if("string"!=typeof t)return;const e=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0];const e=be(Re,t);if(e){const[t,i,r]=e;return[t/255,i/255,r/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){const e=t.length<6?1:2;let i=1;return[ve(t.slice(i,i+=e)),ve(t.slice(i,i+=e)),ve(t.slice(i,i+=e)),ve(t.slice(i,i+e)||"ff")]}if(t.startsWith("rgb")){const e=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(e){const[t,i,r,n,a,o,s,l,c,h,u,d]=e,p=[n||" ",s||" ",h].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const t=[r,o,c].join(""),e="%%%"===t?100:""===t?255:0;if(e){const t=[we(+i/e,0,1),we(+a/e,0,1),we(+l/e,0,1),u?Te(+u,d):1];if(Ve(t))return t}}return}}const i=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){const[t,e,r,n,a,o,s,l,c]=i,h=[r||" ",a||" ",s].join("");if(" "===h||" /"===h||",,"===h||",,,"===h){const t=[+e,we(+n,0,100),we(+o,0,100),l?Te(+l,c):1];if(Ve(t))return function([t,e,i,r]){function n(r){const n=(r+t/30)%12,a=e*Math.min(i,1-i);return i-a*Math.max(-1,Math.min(n-3,9-n,1))}return t=de(t),e/=100,i/=100,[n(0),n(8),n(4),r]}(t)}}}(t);return e?new Se(...e,!1):void 0}get rgb(){const{r:t,g:e,b:i,a:r}=this,n=r||1/0;return this.overwriteGetter("rgb",[t/n,e/n,i/n,r])}get hcl(){return this.overwriteGetter("hcl",function(t){const[e,i,r,n]=pe(t),a=Math.sqrt(i*i+r*r);return[Math.round(1e4*a)?de(Math.atan2(r,i)*ue):NaN,a,e,n]}(this.rgb))}get lab(){return this.overwriteGetter("lab",pe(this.rgb))}overwriteGetter(t,e){return Object.defineProperty(this,t,{value:e}),e}toString(){const[t,e,i,r]=this.rgb;return`rgba(${[t,e,i].map(t=>Math.round(255*t)).join(",")},${r})`}static interpolate(t,e,i,r="rgb"){switch(r){case"rgb":{const[r,n,a,o]=Ue(t.rgb,e.rgb,i);return new Se(r,n,a,o,!1)}case"hcl":{const[r,n,a,o]=t.hcl,[s,l,c,h]=e.hcl;let u,d;if(isNaN(r)||isNaN(s))isNaN(r)?isNaN(s)?u=NaN:(u=s,1!==a&&0!==a||(d=l)):(u=r,1!==c&&0!==c||(d=n));else{let t=s-r;s>r&&t>180?t-=360:s<r&&r-s>180&&(t+=360),u=r+i*t}const[p,m,f,g]=function([t,e,i,r]){return t=isNaN(t)?0:t*he,ge([i,Math.cos(t)*e,Math.sin(t)*e,r])}([u,null!=d?d:Me(n,l,i),Me(a,c,i),Me(o,h,i)]);return new Se(p,m,f,g,!1)}case"lab":{const[r,n,a,o]=ge(Ue(t.lab,e.lab,i));return new Se(r,n,a,o,!1)}}}}Se.black=new Se(0,0,0,1),Se.white=new Se(1,1,1,1),Se.transparent=new Se(0,0,0,0),Se.red=new Se(1,0,0,1);class Ne{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Ee=["bottom","center","top"];class Fe{constructor(t,e,i,r,n,a){this.text=t,this.image=e,this.scale=i,this.fontStack=r,this.textColor=n,this.verticalAlign=a}}class Ze{constructor(t){this.sections=t}static fromString(t){return new Ze([new Fe(t,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(t=>0!==t.text.length||t.image&&0!==t.image.name.length)}static factory(t){return t instanceof Ze?t:Ze.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(t=>t.text).join("")}}class ke{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ke)return t;if("number"==typeof t)return new ke([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new ke(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,e,i){return new ke(Ue(t.values,e.values,i))}}class ze{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof ze)return t;if("number"==typeof t)return new ze([t]);if(Array.isArray(t)){for(const e of t)if("number"!=typeof e)return;return new ze(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,e,i){return new ze(Ue(t.values,e.values,i))}}class We{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof We)return t;if("string"==typeof t){const e=Se.parse(t);if(!e)return;return new We([e])}if(!Array.isArray(t))return;const e=[];for(const i of t){if("string"!=typeof i)return;const t=Se.parse(i);if(!t)return;e.push(t)}return new We(e)}toString(){return JSON.stringify(this.values)}static interpolate(t,e,i,r="rgb"){const n=[];if(t.values.length!=e.values.length)throw new Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${e.values.length}), cannot interpolate.`);for(let a=0;a<t.values.length;a++)n.push(Se.interpolate(t.values[a],e.values[a],i,r));return new We(n)}}class Ie extends Error{constructor(t){super(t),this.name="RuntimeError"}toJSON(){return this.message}}const De=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Ce{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Ce)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e<t.length;e+=2){const i=t[e],r=t[e+1];if("string"!=typeof i||!De.has(i))return;if(!Array.isArray(r)||2!==r.length||"number"!=typeof r[0]||"number"!=typeof r[1])return}return new Ce(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,e,i){const r=t.values,n=e.values;if(r.length!==n.length)throw new Ie(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${e.toString()}`);const a=[];for(let t=0;t<r.length;t+=2){if(r[t]!==n[t])throw new Ie(`Cannot interpolate values containing mismatched anchors. from[${t}]: ${r[t]}, to[${t}]: ${n[t]}`);a.push(r[t]);const[e,o]=r[t+1],[s,l]=n[t+1];a.push([Me(e,s,i),Me(o,l,i)])}return new Ce(a)}}class Be{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Be({name:t,available:!1}):null}}class Pe{constructor(t,e,i){this.from=t,this.to=e,this.transition=i}static interpolate(t,e,i){return new Pe(t,e,i)}static parse(t){return t instanceof Pe?t:Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]?new Pe(t[0],t[1],t[2]):"object"==typeof t&&"string"==typeof t.from&&"string"==typeof t.to&&"number"==typeof t.transition?new Pe(t.from,t.to,t.transition):"string"==typeof t?new Pe(t,t,1):void 0}}function Oe(t,e,i,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[t,e,i,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof r?[t,e,i,r]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Le(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof Pe||t instanceof Se||t instanceof Ne||t instanceof Ze||t instanceof ke||t instanceof ze||t instanceof We||t instanceof Ce||t instanceof Be)return!0;if(Array.isArray(t)){for(const e of t)if(!Le(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!Le(t[e]))return!1;return!0}return!1}function je(t){if(null===t)return It;if("string"==typeof t)return Ct;if("boolean"==typeof t)return Bt;if("number"==typeof t)return Dt;if(t instanceof Se)return Pt;if(t instanceof Pe)return Ot;if(t instanceof Ne)return At;if(t instanceof Ze)return Gt;if(t instanceof ke)return Yt;if(t instanceof ze)return Jt;if(t instanceof We)return Qt;if(t instanceof Ce)return Ht;if(t instanceof Be)return Xt;if(Array.isArray(t)){const e=t.length;let i;for(const e of t){const t=je(e);if(i){if(i===t)continue;i=jt;break}i=t}return qt(i||jt,e)}return Lt}function Ae(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Se||t instanceof Pe||t instanceof Ze||t instanceof ke||t instanceof ze||t instanceof We||t instanceof Ce||t instanceof Be?t.toString():JSON.stringify(t)}class Ge{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Le(t[1]))return e.error("invalid value");const i=t[1];let r=je(i);const n=e.expectedType;return"array"!==r.kind||0!==r.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(r=n),new Ge(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Ye={string:Ct,number:Dt,boolean:Bt,object:Lt};class Qe{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,r=1;const n=t[0];if("array"===n){let n,a;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in Ye)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=Ye[i],r++}else n=jt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);a=t[2],r++}i=qt(n,a)}else{if(!Ye[n])throw new Error(`Types doesn't contain name = ${n}`);i=Ye[n]}const a=[];for(;r<t.length;r++){const i=e.parse(t[r],r,jt);if(!i)return null;a.push(i)}return new Qe(i,a)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!te(this.type,je(i)))return i;if(e===this.args.length-1)throw new Ie(`Expected value to be of type ${Kt(this.type)}, but found ${Kt(je(i))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const Je={"to-boolean":Bt,"to-color":Pt,"to-number":Dt,"to-string":Ct};class Xe{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(!Je[i])throw new Error(`Can't parse ${i} as it is not part of the known types`);if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const r=Je[i],n=[];for(let i=1;i<t.length;i++){const r=e.parse(t[i],i,jt);if(!r)return null;n.push(r)}return new Xe(r,n)}evaluate(t){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(t));case"color":{let e,i;for(const r of this.args){if(e=r.evaluate(t),i=null,e instanceof Se)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rgba value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:Oe(e[0],e[1],e[2],e[3]),!i))return new Se(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Ie(i||`Could not parse color from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"padding":{let e;for(const i of this.args){e=i.evaluate(t);const r=ke.parse(e);if(r)return r}throw new Ie(`Could not parse padding from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"numberArray":{let e;for(const i of this.args){e=i.evaluate(t);const r=ze.parse(e);if(r)return r}throw new Ie(`Could not parse numberArray from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"colorArray":{let e;for(const i of this.args){e=i.evaluate(t);const r=We.parse(e);if(r)return r}throw new Ie(`Could not parse colorArray from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"variableAnchorOffsetCollection":{let e;for(const i of this.args){e=i.evaluate(t);const r=Ce.parse(e);if(r)return r}throw new Ie(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"number":{let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const r=Number(e);if(!isNaN(r))return r}throw new Ie(`Could not convert ${JSON.stringify(e)} to number.`)}case"formatted":return Ze.fromString(Ae(this.args[0].evaluate(t)));case"resolvedImage":return Be.fromString(Ae(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return Ae(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const He=["Unknown","Point","LineString","Polygon"];class qe{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?He[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(t){let e=this._parseColorCache.get(t);return e||(e=Se.parse(t),this._parseColorCache.set(t,e)),e}}class Ke{constructor(t,e,i=[],r,n=new Wt,a=[]){this.registry=t,this.path=i,this.key=i.map(t=>`[${t}]`).join(""),this.scope=n,this.errors=a,this.expectedType=r,this._isConstant=e}parse(t,e,i,r,n={}){return e?this.concat(e,i,r)._parse(t,n):this._parse(t,n)}_parse(t,e){function i(t,e,i){return"assert"===i?new Qe(e,[t]):"coerce"===i?new Xe(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const n=this.registry[r];if(n){let r=n.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,n=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind){if("projectionDefinition"===t.kind&&["string","array"].includes(n.kind)||["color","formatted","resolvedImage"].includes(t.kind)&&["value","string"].includes(n.kind)||["padding","numberArray"].includes(t.kind)&&["value","number","array"].includes(n.kind)||"colorArray"===t.kind&&["value","string","array"].includes(n.kind)||"variableAnchorOffsetCollection"===t.kind&&["value","array"].includes(n.kind))r=i(r,t,e.typeAnnotation||"coerce");else if(this.checkSubtype(t,n))return null}else r=i(r,t,e.typeAnnotation||"assert")}if(!(r instanceof Ge)&&"resolvedImage"!==r.type.kind&&this._isConstant(r)){const e=new qe;try{r=new Ge(r.type,r.evaluate(e))}catch(t){return this.error(t.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,i){const r="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new Ke(this.registry,this._isConstant,r,e||null,n,this.errors)}error(t,...e){const i=`${this.key}${e.map(t=>`[${t}]`).join("")}`;this.errors.push(new zt(i,t))}checkSubtype(t,e){const i=te(t,e);return i&&this.error(i),i}}class $e{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let r=1;r<t.length-1;r+=2){const n=t[r];if("string"!=typeof n)return e.error(`Expected string, but found ${typeof n} instead.`,r);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);const a=e.parse(t[r+1],r+1);if(!a)return null;i.push([n,a])}const r=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return r?new $e(i,r):null}outputDefined(){return this.result.outputDefined()}}class ti{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new ti(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class ei{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Dt),r=e.parse(t[2],2,qt(e.expectedType||jt));return i&&r?new ei(r.type.itemType,i,r):null}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new Ie(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new Ie(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new Ie(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class ii{constructor(t,e){this.type=Bt,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,jt),r=e.parse(t[2],2,jt);return i&&r?ee(i.type,[Bt,Ct,Dt,It,jt])?new ii(i,r):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Kt(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!ie(e,["boolean","string","number","null"]))throw new Ie(`Expected first argument to be of type boolean, string, number or null, but found ${Kt(je(e))} instead.`);if(!ie(i,["string","array"]))throw new Ie(`Expected second argument to be of type array or string, but found ${Kt(je(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class ri{constructor(t,e,i){this.type=Dt,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,jt),r=e.parse(t[2],2,jt);if(!i||!r)return null;if(!ee(i.type,[Bt,Ct,Dt,It,jt]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Kt(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,Dt);return n?new ri(i,r,n):null}return new ri(i,r)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!ie(e,["boolean","string","number","null"]))throw new Ie(`Expected first argument to be of type boolean, string, number or null, but found ${Kt(je(e))} instead.`);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(t)),ie(i,["string"])){const t=i.indexOf(e,r);return-1===t?-1:[...i.slice(0,t)].length}if(ie(i,["array"]))return i.indexOf(e,r);throw new Ie(`Expected second argument to be of type array or string, but found ${Kt(je(i))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class ni{constructor(t,e,i,r,n,a){this.inputType=t,this.type=e,this.input=i,this.cases=r,this.outputs=n,this.otherwise=a}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const n={},a=[];for(let o=2;o<t.length-1;o+=2){let s=t[o];const l=t[o+1];Array.isArray(s)||(s=[s]);const c=e.concat(o);if(0===s.length)return c.error("Expected at least one branch label.");for(const t of s){if("number"!=typeof t&&"string"!=typeof t)return c.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(i){if(c.checkSubtype(i,je(t)))return null}else i=je(t);if(void 0!==n[String(t)])return c.error("Branch labels must be unique.");n[String(t)]=a.length}const h=e.parse(l,o,r);if(!h)return null;r=r||h.type,a.push(h)}const o=e.parse(t[1],1,jt);if(!o)return null;const s=e.parse(t[t.length-1],t.length-1,r);return s?"value"!==o.type.kind&&e.concat(1).checkSubtype(i,o.type)?null:new ni(i,r,o,n,a,s):null}evaluate(t){const e=this.input.evaluate(t);return(je(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class ai{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const r=[];for(let n=1;n<t.length-1;n+=2){const a=e.parse(t[n],n,Bt);if(!a)return null;const o=e.parse(t[n+1],n+1,i);if(!o)return null;r.push([a,o]),i=i||o.type}const n=e.parse(t[t.length-1],t.length-1,i);if(!n)return null;if(!i)throw new Error("Can't infer output type");return new ai(i,r,n)}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every(([t,e])=>e.outputDefined())&&this.otherwise.outputDefined()}}class oi{constructor(t,e,i,r){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,jt),r=e.parse(t[2],2,Dt);if(!i||!r)return null;if(!ee(i.type,[qt(jt),Ct,jt]))return e.error(`Expected first argument to be of type array or string, but found ${Kt(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,Dt);return n?new oi(i.type,i,r,n):null}return new oi(i.type,i,r)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);let r;if(this.endIndex&&(r=this.endIndex.evaluate(t)),ie(e,["string"]))return[...e].slice(i,r).join("");if(ie(e,["array"]))return e.slice(i,r);throw new Ie(`Expected first argument to be of type array or string, but found ${Kt(je(e))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function si(t,e){const i=t.length-1;let r,n,a=0,o=i,s=0;for(;a<=o;)if(s=Math.floor((a+o)/2),r=t[s],n=t[s+1],r<=e){if(s===i||e<n)return s;a=s+1}else{if(!(r>e))throw new Ie("Input is not a number.");o=s-1}return 0}class li{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of i)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,Dt);if(!i)return null;const r=[];let n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(let i=1;i<t.length;i+=2){const a=1===i?-1/0:t[i],o=t[i+1],s=i,l=i+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(r.length&&r[r.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=e.parse(o,l,n);if(!c)return null;n=n||c.type,r.push([a,c])}return new li(n,i,r)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);const n=e.length;return r>=e[n-1]?i[n-1].evaluate(t):i[si(e,r)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function ci(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var hi,ui,di=function(){if(ui)return hi;function t(t,e,i,r){this.cx=3*t,this.bx=3*(i-t)-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=t,this.p1y=e,this.p2x=i,this.p2y=r}return ui=1,hi=t,t.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var n=this.sampleCurveX(i)-t;if(Math.abs(n)<e)return i;var a=this.sampleCurveDerivativeX(i);if(Math.abs(a)<1e-6)break;i-=n/a}var o=0,s=1;for(i=t,r=0;r<20&&(n=this.sampleCurveX(i),!(Math.abs(n-t)<e));r++)t>n?o=i:s=i,i=.5*(s-o)+o;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},hi}(),pi=ci(di);class mi{constructor(t,e,i,r,n){this.type=t,this.operator=e,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(const[t,e]of n)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,i,r){let n=0;if("exponential"===t.name)n=fi(e,t.base,i,r);else if("linear"===t.name)n=fi(e,1,i,r);else if("cubic-bezier"===t.name){const a=t.controlPoints;n=new pi(a[0],a[1],a[2],a[3]).solve(fi(e,1,i,r))}return n}static parse(t,e){let[i,r,n,...a]=t;if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){const t=r[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:t}}else{if("cubic-bezier"!==r[0])return e.error(`Unknown interpolation type ${String(r[0])}`,1,0);{const t=r.slice(1);if(4!==t.length||t.some(t=>"number"!=typeof t||t<0||t>1))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(n=e.parse(n,2,Dt),!n)return null;const o=[];let s=null;"interpolate-hcl"!==i&&"interpolate-lab"!==i||e.expectedType==Qt?e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType):s=Pt;for(let t=0;t<a.length;t+=2){const i=a[t],r=a[t+1],n=t+3,l=t+4;if("number"!=typeof i)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(o.length&&o[o.length-1][0]>=i)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=e.parse(r,l,s);if(!c)return null;s=s||c.type,o.push([i,c])}return re(s,Dt)||re(s,Ot)||re(s,Pt)||re(s,Yt)||re(s,Jt)||re(s,Qt)||re(s,Ht)||re(s,qt(Dt))?new mi(s,i,r,n,o):e.error(`Type ${Kt(s)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);const n=e.length;if(r>=e[n-1])return i[n-1].evaluate(t);const a=si(e,r),o=mi.interpolationFactor(this.interpolation,r,e[a],e[a+1]),s=i[a].evaluate(t),l=i[a+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Me(s,l,o);case"color":return Se.interpolate(s,l,o);case"padding":return ke.interpolate(s,l,o);case"colorArray":return We.interpolate(s,l,o);case"numberArray":return ze.interpolate(s,l,o);case"variableAnchorOffsetCollection":return Ce.interpolate(s,l,o);case"array":return Ue(s,l,o);case"projectionDefinition":return Pe.interpolate(s,l,o)}case"interpolate-hcl":switch(this.type.kind){case"color":return Se.interpolate(s,l,o,"hcl");case"colorArray":return We.interpolate(s,l,o,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Se.interpolate(s,l,o,"lab");case"colorArray":return We.interpolate(s,l,o,"lab")}}}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function fi(t,e,i,r){const n=r-i,a=t-i;return 0===n?0:1===e?a/n:(Math.pow(e,a)-1)/(Math.pow(e,n)-1)}const gi={color:Se.interpolate,number:Me,padding:ke.interpolate,numberArray:ze.interpolate,colorArray:We.interpolate,variableAnchorOffsetCollection:Ce.interpolate,array:Ue};class _i{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i=null;const r=e.expectedType;r&&"value"!==r.kind&&(i=r);const n=[];for(const r of t.slice(1)){const t=e.parse(r,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,n.push(t)}if(!i)throw new Error("No output type");const a=r&&n.some(t=>te(r,t.type));return new _i(a?jt:i,n)}evaluate(t){let e,i=null,r=0;for(const n of this.args)if(r++,i=n.evaluate(t),i&&i instanceof Be&&!i.available&&(e||(e=i.name),i=null,r===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function yi(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function xi(t,e,i,r){return 0===r.compare(e,i)}function bi(t,e,i){const r="=="!==t&&"!="!==t;return class n{constructor(t,e,i){this.type=Bt,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let a=e.parse(t[1],1,jt);if(!a)return null;if(!yi(i,a.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${Kt(a.type)}'.`);let o=e.parse(t[2],2,jt);if(!o)return null;if(!yi(i,o.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${Kt(o.type)}'.`);if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error(`Cannot compare types '${Kt(a.type)}' and '${Kt(o.type)}'.`);r&&("value"===a.type.kind&&"value"!==o.type.kind?a=new Qe(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new Qe(a.type,[o])));let s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,At),!s)return null}return new n(a,o,s)}evaluate(n){const a=this.lhs.evaluate(n),o=this.rhs.evaluate(n);if(r&&this.hasUntypedArgument){const e=je(a),i=je(o);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new Ie(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){const t=je(a),i=je(o);if("string"!==t.kind||"string"!==i.kind)return e(n,a,o)}return this.collator?i(n,a,o,this.collator.evaluate(n)):e(n,a,o)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}}}const vi=bi("==",function(t,e,i){return e===i},xi),Ti=bi("!=",function(t,e,i){return e!==i},function(t,e,i,r){return!xi(0,e,i,r)}),wi=bi("<",function(t,e,i){return e<i},function(t,e,i,r){return r.compare(e,i)<0}),Vi=bi(">",function(t,e,i){return e>i},function(t,e,i,r){return r.compare(e,i)>0}),Ri=bi("<=",function(t,e,i){return e<=i},function(t,e,i,r){return r.compare(e,i)<=0}),Mi=bi(">=",function(t,e,i){return e>=i},function(t,e,i,r){return r.compare(e,i)>=0});class Ui{constructor(t,e,i){this.type=At,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const r=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Bt);if(!r)return null;const n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Bt);if(!n)return null;let a=null;return i.locale&&(a=e.parse(i.locale,1,Ct),!a)?null:new Ui(r,n,a)}evaluate(t){return new Ne(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class Si{constructor(t,e,i,r,n,a){this.type=Ct,this.number=t,this.locale=e,this.currency=i,this.unit=r,this.minFractionDigits=n,this.maxFractionDigits=a}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Dt);if(!i)return null;const r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");let n=null;if(r.locale&&(n=e.parse(r.locale,1,Ct),!n))return null;let a=null;if(r.currency&&(a=e.parse(r.currency,1,Ct),!a))return null;let o=null;if(r.unit&&(o=e.parse(r.unit,1,Ct),!o))return null;if(a&&o)return e.error("NumberFormat options `currency` and `unit` are mutually exclusive");let s=null;if(r["min-fraction-digits"]&&(s=e.parse(r["min-fraction-digits"],1,Dt),!s))return null;let l=null;return r["max-fraction-digits"]&&(l=e.parse(r["max-fraction-digits"],1,Dt),!l)?null:new Si(i,n,a,o,s,l)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class Ni{constructor(t){this.type=Gt,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const r=[];let n=!1;for(let i=1;i<=t.length-1;++i){const a=t[i];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;let t=null;if(a["font-scale"]&&(t=e.parse(a["font-scale"],1,Dt),!t))return null;let i=null;if(a["text-font"]&&(i=e.parse(a["text-font"],1,qt(Ct)),!i))return null;let o=null;if(a["text-color"]&&(o=e.parse(a["text-color"],1,Pt),!o))return null;let s=null;if(a["vertical-align"]){if("string"==typeof a["vertical-align"]&&!Ee.includes(a["vertical-align"]))return e.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(s=e.parse(a["vertical-align"],1,Ct),!s)return null}const l=r[r.length-1];l.scale=t,l.font=i,l.textColor=o,l.verticalAlign=s}else{const a=e.parse(t[i],1,jt);if(!a)return null;const o=a.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,r.push({content:a,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Ni(r)}evaluate(t){return new Ze(this.sections.map(e=>{const i=e.content.evaluate(t);return je(i)===Xt?new Fe("",i,null,null,null,e.verticalAlign?e.verticalAlign.evaluate(t):null):new Fe(Ae(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null,e.verticalAlign?e.verticalAlign.evaluate(t):null)}))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor),e.verticalAlign&&t(e.verticalAlign)}outputDefined(){return!1}}class Ei{constructor(t){this.type=Xt,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Ct);return i?new Ei(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=Be.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}}class Fi{constructor(t){this.type=Dt,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${Kt(i.type)} instead.`):new Fi(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return[...e].length;if(Array.isArray(e))return e.length;throw new Ie(`Expected value to be of type string or array, but found ${Kt(je(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const Zi=8192;function ki(t,e){const i=(180+t[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,n=Math.pow(2,e.z);return[Math.round(i*n*Zi),Math.round(r*n*Zi)]}function zi(t,e){const i=Math.pow(2,e.z);return[(n=(t[0]/Zi+e.x)/i,360*n-180),(r=(t[1]/Zi+e.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90)];var r,n}function Wi(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Ii(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Di(t,e,i){const r=t[0]-e[0],n=t[1]-e[1],a=t[0]-i[0],o=t[1]-i[1];return r*o-a*n==0&&r*a<=0&&n*o<=0}function Ci(t,e,i,r){return 0!=(n=[r[0]-i[0],r[1]-i[1]])[0]*(a=[e[0]-t[0],e[1]-t[1]])[1]-n[1]*a[0]&&!(!Ai(t,e,i,r)||!Ai(i,r,t,e));var n,a}function Bi(t,e,i){for(const r of i)for(let i=0;i<r.length-1;++i)if(Ci(t,e,r[i],r[i+1]))return!0;return!1}function Pi(t,e,i=!1){let r=!1;for(const s of e)for(let e=0;e<s.length-1;e++){if(Di(t,s[e],s[e+1]))return i;(a=s[e])[1]>(n=t)[1]!=(o=s[e+1])[1]>n[1]&&n[0]<(o[0]-a[0])*(n[1]-a[1])/(o[1]-a[1])+a[0]&&(r=!r)}var n,a,o;return r}function Oi(t,e){for(const i of e)if(Pi(t,i))return!0;return!1}function Li(t,e){for(const i of t)if(!Pi(i,e))return!1;for(let i=0;i<t.length-1;++i)if(Bi(t[i],t[i+1],e))return!1;return!0}function ji(t,e){for(const i of e)if(Li(t,i))return!0;return!1}function Ai(t,e,i,r){const n=r[0]-i[0],a=r[1]-i[1],o=(t[0]-i[0])*a-n*(t[1]-i[1]),s=(e[0]-i[0])*a-n*(e[1]-i[1]);return o>0&&s<0||o<0&&s>0}function Gi(t,e,i){const r=[];for(let n=0;n<t.length;n++){const a=[];for(let r=0;r<t[n].length;r++){const o=ki(t[n][r],i);Wi(e,o),a.push(o)}r.push(a)}return r}function Yi(t,e,i){const r=[];for(let n=0;n<t.length;n++){const a=Gi(t[n],e,i);r.push(a)}return r}function Qi(t,e,i,r){if(t[0]<i[0]||t[0]>i[2]){const e=.5*r;let n=t[0]-i[0]>e?-r:i[0]-t[0]>e?r:0;0===n&&(n=t[0]-i[2]>e?-r:i[2]-t[0]>e?r:0),t[0]+=n}Wi(e,t)}function Ji(t,e,i,r){const n=Math.pow(2,r.z)*Zi,a=[r.x*Zi,r.y*Zi],o=[];for(const r of t)for(const t of r){const r=[t.x+a[0],t.y+a[1]];Qi(r,e,i,n),o.push(r)}return o}function Xi(t,e,i,r){const n=Math.pow(2,r.z)*Zi,a=[r.x*Zi,r.y*Zi],o=[];for(const i of t){const t=[];for(const r of i){const i=[r.x+a[0],r.y+a[1]];Wi(e,i),t.push(i)}o.push(t)}if(e[2]-e[0]<=n/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const t of o)for(const r of t)Qi(r,e,i,n)}var s;return o}class Hi{constructor(t,e){this.type=Bt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Le(t[1])){const e=t[1];if("FeatureCollection"===e.type){const t=[];for(const i of e.features){const{type:e,coordinates:r}=i.geometry;"Polygon"===e&&t.push(r),"MultiPolygon"===e&&t.push(...r)}if(t.length)return new Hi(e,{type:"MultiPolygon",coordinates:t})}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new Hi(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new Hi(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const a=Gi(e.coordinates,r,n),o=Ji(t.geometry(),i,r,n);if(!Ii(i,r))return!1;for(const t of o)if(!Pi(t,a))return!1}if("MultiPolygon"===e.type){const a=Yi(e.coordinates,r,n),o=Ji(t.geometry(),i,r,n);if(!Ii(i,r))return!1;for(const t of o)if(!Oi(t,a))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const a=Gi(e.coordinates,r,n),o=Xi(t.geometry(),i,r,n);if(!Ii(i,r))return!1;for(const t of o)if(!Li(t,a))return!1}if("MultiPolygon"===e.type){const a=Yi(e.coordinates,r,n),o=Xi(t.geometry(),i,r,n);if(!Ii(i,r))return!1;for(const t of o)if(!ji(t,a))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let qi=class{constructor(t=[],e=(t,e)=>t<e?-1:t>e?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,r=e[t];for(;t>0;){const n=t-1>>1,a=e[n];if(i(r,a)>=0)break;e[t]=a,t=n}e[t]=r}_down(t){const{data:e,compare:i}=this,r=this.length>>1,n=e[t];for(;t<r;){let r=1+(t<<1);const a=r+1;if(a<this.length&&i(e[a],e[r])<0&&(r=a),i(e[r],n)>=0)break;e[t]=e[r],t=r}e[t]=n}};function Ki(t,e,i=0,r=t.length-1,n=tr){for(;r>i;){if(r-i>600){const a=r-i+1,o=e-i+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Ki(t,e,Math.max(i,Math.floor(e-o*l/a+c)),Math.min(r,Math.floor(e+(a-o)*l/a+c)),n)}const a=t[e];let o=i,s=r;for($i(t,i,e),n(t[r],a)>0&&$i(t,i,r);o<s;){for($i(t,o,s),o++,s--;n(t[o],a)<0;)o++;for(;n(t[s],a)>0;)s--}0===n(t[i],a)?$i(t,i,s):(s++,$i(t,s,r)),s<=e&&(i=s+1),e<=s&&(r=s-1)}}function $i(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}function tr(t,e){return t<e?-1:t>e?1:0}function er(t,e){if(t.length<=1)return[t];const i=[];let r,n;for(const e of t){const t=rr(e);0!==t&&(e.area=Math.abs(t),void 0===n&&(n=t<0),n===t<0?(r&&i.push(r),r=[e]):r.push(e))}if(r&&i.push(r),e>1)for(let t=0;t<i.length;t++)i[t].length<=e||(Ki(i[t],e,1,i[t].length-1,ir),i[t]=i[t].slice(0,e));return i}function ir(t,e){return e.area-t.area}function rr(t){let e=0;for(let i,r,n=0,a=t.length,o=a-1;n<a;o=n++)i=t[n],r=t[o],e+=(r.x-i.x)*(i.y+r.y);return e}const nr=1/298.257223563,ar=nr*(2-nr),or=Math.PI/180;class sr{constructor(t){const e=6378.137*or*1e3,i=Math.cos(t*or),r=1/(1-ar*(1-i*i)),n=Math.sqrt(r);this.kx=e*n*i,this.ky=e*n*r*(1-ar)}distance(t,e){const i=this.wrap(t[0]-e[0])*this.kx,r=(t[1]-e[1])*this.ky;return Math.sqrt(i*i+r*r)}pointOnLine(t,e){let i,r,n,a,o=1/0;for(let s=0;s<t.length-1;s++){let l=t[s][0],c=t[s][1],h=this.wrap(t[s+1][0]-l)*this.kx,u=(t[s+1][1]-c)*this.ky,d=0;0===h&&0===u||(d=(this.wrap(e[0]-l)*this.kx*h+(e[1]-c)*this.ky*u)/(h*h+u*u),d>1?(l=t[s+1][0],c=t[s+1][1]):d>0&&(l+=h/this.kx*d,c+=u/this.ky*d)),h=this.wrap(e[0]-l)*this.kx,u=(e[1]-c)*this.ky;const p=h*h+u*u;p<o&&(o=p,i=l,r=c,n=s,a=d)}return{point:[i,r],index:n,t:Math.max(0,Math.min(1,a))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function lr(t,e){return e[0]-t[0]}function cr(t){return t[1]-t[0]+1}function hr(t,e){return t[1]>=t[0]&&t[1]<e}function ur(t,e){if(t[0]>t[1])return[null,null];const i=cr(t);if(e){if(2===i)return[t,null];const e=Math.floor(i/2);return[[t[0],t[0]+e],[t[0]+e,t[1]]]}if(1===i)return[t,null];const r=Math.floor(i/2)-1;return[[t[0],t[0]+r],[t[0]+r+1,t[1]]]}function dr(t,e){if(!hr(e,t.length))return[1/0,1/0,-1/0,-1/0];const i=[1/0,1/0,-1/0,-1/0];for(let r=e[0];r<=e[1];++r)Wi(i,t[r]);return i}function pr(t){const e=[1/0,1/0,-1/0,-1/0];for(const i of t)for(const t of i)Wi(e,t);return e}function mr(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function fr(t,e,i){if(!mr(t)||!mr(e))return NaN;let r=0,n=0;return t[2]<e[0]&&(r=e[0]-t[2]),t[0]>e[2]&&(r=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]<e[1]&&(n=e[1]-t[3]),i.distance([0,0],[r,n])}function gr(t,e,i){const r=i.pointOnLine(e,t);return i.distance(t,r.point)}function _r(t,e,i,r,n){const a=Math.min(gr(t,[i,r],n),gr(e,[i,r],n)),o=Math.min(gr(i,[t,e],n),gr(r,[t,e],n));return Math.min(a,o)}function yr(t,e,i,r,n){if(!hr(e,t.length)||!hr(r,i.length))return 1/0;let a=1/0;for(let o=e[0];o<e[1];++o){const e=t[o],s=t[o+1];for(let t=r[0];t<r[1];++t){const r=i[t],o=i[t+1];if(Ci(e,s,r,o))return 0;a=Math.min(a,_r(e,s,r,o,n))}}return a}function xr(t,e,i,r,n){if(!hr(e,t.length)||!hr(r,i.length))return NaN;let a=1/0;for(let o=e[0];o<=e[1];++o)for(let e=r[0];e<=r[1];++e)if(a=Math.min(a,n.distance(t[o],i[e])),0===a)return a;return a}function br(t,e,i){if(Pi(t,e,!0))return 0;let r=1/0;for(const n of e){const e=n[0],a=n[n.length-1];if(e!==a&&(r=Math.min(r,gr(t,[a,e],i)),0===r))return r;const o=i.pointOnLine(n,t);if(r=Math.min(r,i.distance(t,o.point)),0===r)return r}return r}function vr(t,e,i,r){if(!hr(e,t.length))return NaN;for(let r=e[0];r<=e[1];++r)if(Pi(t[r],i,!0))return 0;let n=1/0;for(let a=e[0];a<e[1];++a){const e=t[a],o=t[a+1];for(const t of i)for(let i=0,a=t.length,s=a-1;i<a;s=i++){const a=t[s],l=t[i];if(Ci(e,o,a,l))return 0;n=Math.min(n,_r(e,o,a,l,r))}}return n}function Tr(t,e){for(const i of t)for(const t of i)if(Pi(t,e,!0))return!0;return!1}function wr(t,e,i,r=1/0){const n=pr(t),a=pr(e);if(r!==1/0&&fr(n,a,i)>=r)return r;if(Ii(n,a)){if(Tr(t,e))return 0}else if(Tr(e,t))return 0;let o=1/0;for(const r of t)for(let t=0,n=r.length,a=n-1;t<n;a=t++){const n=r[a],s=r[t];for(const t of e)for(let e=0,r=t.length,a=r-1;e<r;a=e++){const r=t[a],l=t[e];if(Ci(n,s,r,l))return 0;o=Math.min(o,_r(n,s,r,l,i))}}return o}function Vr(t,e,i,r,n,a){if(!a)return;const o=fr(dr(r,a),n,i);o<e&&t.push([o,a,[0,0]])}function Rr(t,e,i,r,n,a,o){if(!a||!o)return;const s=fr(dr(r,a),dr(n,o),i);s<e&&t.push([s,a,o])}function Mr(t,e,i,r,n=1/0){let a=Math.min(r.distance(t[0],i[0][0]),n);if(0===a)return a;const o=new qi([[0,[0,t.length-1],[0,0]]],lr),s=pr(i);for(;o.length>0;){const n=o.pop();if(n[0]>=a)continue;const l=n[1],c=e?50:100;if(cr(l)<=c){if(!hr(l,t.length))return NaN;if(e){const e=vr(t,l,i,r);if(isNaN(e)||0===e)return e;a=Math.min(a,e)}else for(let e=l[0];e<=l[1];++e){const n=br(t[e],i,r);if(a=Math.min(a,n),0===a)return 0}}else{const i=ur(l,e);Vr(o,a,r,t,s,i[0]),Vr(o,a,r,t,s,i[1])}}return a}function Ur(t,e,i,r,n,a=1/0){let o=Math.min(a,n.distance(t[0],i[0]));if(0===o)return o;const s=new qi([[0,[0,t.length-1],[0,i.length-1]]],lr);for(;s.length>0;){const a=s.pop();if(a[0]>=o)continue;const l=a[1],c=a[2],h=e?50:100,u=r?50:100;if(cr(l)<=h&&cr(c)<=u){if(!hr(l,t.length)&&hr(c,i.length))return NaN;let a;if(e&&r)a=yr(t,l,i,c,n),o=Math.min(o,a);else if(e&&!r){const e=t.slice(l[0],l[1]+1);for(let t=c[0];t<=c[1];++t)if(a=gr(i[t],e,n),o=Math.min(o,a),0===o)return o}else if(!e&&r){const e=i.slice(c[0],c[1]+1);for(let i=l[0];i<=l[1];++i)if(a=gr(t[i],e,n),o=Math.min(o,a),0===o)return o}else a=xr(t,l,i,c,n),o=Math.min(o,a)}else{const a=ur(l,e),h=ur(c,r);Rr(s,o,n,t,i,a[0],h[0]),Rr(s,o,n,t,i,a[0],h[1]),Rr(s,o,n,t,i,a[1],h[0]),Rr(s,o,n,t,i,a[1],h[1])}}return o}function Sr(t){return"MultiPolygon"===t.type?t.coordinates.map(t=>({type:"Polygon",coordinates:t})):"MultiLineString"===t.type?t.coordinates.map(t=>({type:"LineString",coordinates:t})):"MultiPoint"===t.type?t.coordinates.map(t=>({type:"Point",coordinates:t})):[t]}class Nr{constructor(t,e){this.type=Dt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Le(t[1])){const e=t[1];if("FeatureCollection"===e.type)return new Nr(e,e.features.map(t=>Sr(t.geometry)).flat());if("Feature"===e.type)return new Nr(e,Sr(e.geometry));if("type"in e&&"coordinates"in e)return new Nr(e,Sr(e))}return e.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=t.geometry(),r=i.flat().map(e=>zi([e.x,e.y],t.canonical));if(0===i.length)return NaN;const n=new sr(r[0][1]);let a=1/0;for(const t of e){switch(t.type){case"Point":a=Math.min(a,Ur(r,!1,[t.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,Ur(r,!1,t.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,Mr(r,!1,t.coordinates,n,a))}if(0===a)return a}return a}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=t.geometry(),r=i.flat().map(e=>zi([e.x,e.y],t.canonical));if(0===i.length)return NaN;const n=new sr(r[0][1]);let a=1/0;for(const t of e){switch(t.type){case"Point":a=Math.min(a,Ur(r,!0,[t.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,Ur(r,!0,t.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,Mr(r,!0,t.coordinates,n,a))}if(0===a)return a}return a}(t,this.geometries);if("Polygon"===t.geometryType())return function(t,e){const i=t.geometry();if(0===i.length||0===i[0].length)return NaN;const r=er(i,0).map(e=>e.map(e=>e.map(e=>zi([e.x,e.y],t.canonical)))),n=new sr(r[0][0][0][1]);let a=1/0;for(const t of e)for(const e of r){switch(t.type){case"Point":a=Math.min(a,Mr([t.coordinates],!1,e,n,a));break;case"LineString":a=Math.min(a,Mr(t.coordinates,!0,e,n,a));break;case"Polygon":a=Math.min(a,wr(e,t.coordinates,n,a))}if(0===a)return a}return a}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Er{constructor(t){this.type=jt,this.key=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=t[1];return null==i?e.error("Global state property must be defined."):"string"!=typeof i?e.error(`Global state property must be string, but found ${typeof t[1]} instead.`):new Er(i)}evaluate(t){var e;const i=null===(e=t.globals)||void 0===e?void 0:e.globalState;return i&&0!==Object.keys(i).length?be(i,this.key):null}eachChild(){}outputDefined(){return!1}}const Fr={"==":vi,"!=":Ti,">":Vi,"<":wi,">=":Mi,"<=":Ri,array:Qe,at:ei,boolean:Qe,case:ai,coalesce:_i,collator:Ui,format:Ni,image:Ei,in:ii,"index-of":ri,interpolate:mi,"interpolate-hcl":mi,"interpolate-lab":mi,length:Fi,let:$e,literal:Ge,match:ni,number:Qe,"number-format":Si,object:Qe,slice:oi,step:li,string:Qe,"to-boolean":Xe,"to-color":Xe,"to-number":Xe,"to-string":Xe,var:ti,within:Hi,distance:Nr,"global-state":Er};class Zr{constructor(t,e,i,r){this.name=t,this.type=e,this._evaluate=i,this.args=r}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,e){const i=t[0],r=Zr.definitions[i];if(!r)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(r)?r[0]:r.type,a=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,o=a.filter(([e])=>!Array.isArray(e)||e.length===t.length-1);let s=null;for(const[r,a]of o){s=new Ke(e.registry,Dr,e.path,null,e.scope);const o=[];let l=!1;for(let e=1;e<t.length;e++){const i=t[e],n=Array.isArray(r)?r[e-1]:r.type,a=s.parse(i,1+o.length,n);if(!a){l=!0;break}o.push(a)}if(!l)if(Array.isArray(r)&&r.length!==o.length)s.error(`Expected ${r.length} arguments, but found ${o.length} instead.`);else{for(let t=0;t<o.length;t++){const e=Array.isArray(r)?r[t]:r.type,i=o[t];s.concat(t+1).checkSubtype(e,i.type)}if(0===s.errors.length)return new Zr(i,n,a,o)}}if(1===o.length)e.errors.push(...s.errors);else{const i=(o.length?o:a).map(([t])=>{return e=t,Array.isArray(e)?`(${e.map(Kt).join(", ")})`:`(${Kt(e.type)}...)`;var e}).join(" | "),r=[];for(let i=1;i<t.length;i++){const n=e.parse(t[i],1+r.length);if(!n)return null;r.push(Kt(n.type))}e.error(`Expected arguments of type ${i}, but found (${r.join(", ")}) instead.`)}return null}static register(t,e){Zr.definitions=e;for(const i in e)t[i]=Zr}}function kr(t,[e,i,r,n]){e=e.evaluate(t),i=i.evaluate(t),r=r.evaluate(t);const a=n?n.evaluate(t):1,o=Oe(e,i,r,a);if(o)throw new Ie(o);return new Se(e/255,i/255,r/255,a,!1)}function zr(t,e){return t in e}function Wr(t,e){const i=e[t];return void 0===i?null:i}function Ir(t){return{type:t}}function Dr(t){if(t instanceof ti)return Dr(t.boundExpression);if(t instanceof Zr&&"error"===t.name)return!1;if(t instanceof Ui)return!1;if(t instanceof Hi)return!1;if(t instanceof Nr)return!1;if(t instanceof Er)return!1;const e=t instanceof Xe||t instanceof Qe;let i=!0;return t.eachChild(t=>{i=e?i&&Dr(t):i&&t instanceof Ge}),!!i&&Cr(t)&&Pr(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function Cr(t){if(t instanceof Zr){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Hi)return!1;if(t instanceof Nr)return!1;let e=!0;return t.eachChild(t=>{e&&!Cr(t)&&(e=!1)}),e}function Br(t){if(t instanceof Zr&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild(t=>{e&&!Br(t)&&(e=!1)}),e}function Pr(t,e){if(t instanceof Zr&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(t=>{i&&!Pr(t,e)&&(i=!1)}),i}function Or(t){return{result:"success",value:t}}function Lr(t){return{result:"error",value:t}}function jr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Ar(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Gr(t){return!!t.expression&&t.expression.interpolated}function Yr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Qr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&je(t)===Lt}function Jr(t){return t}function Xr(t,e){const i=t.stops&&"object"==typeof t.stops[0][0],r=i||!(i||void 0!==t.property),n=t.type||(Gr(e)?"exponential":"interval"),a=function(t){switch(t.type){case"color":return Se.parse;case"padding":return ke.parse;case"numberArray":return ze.parse;case"colorArray":return We.parse;default:return null}}(e);if(a&&((t=kt({},t)).stops&&(t.stops=t.stops.map(t=>[t[0],a(t[1])])),t.default=a(t.default?t.default:e.default)),t.colorSpace&&"rgb"!==(o=t.colorSpace)&&"hcl"!==o&&"lab"!==o)throw new Error(`Unknown color space: "${t.colorSpace}"`);var o;const s=function(t){switch(t){case"exponential":return $r;case"interval":return Kr;case"categorical":return qr;case"identity":return tn;default:throw new Error(`Unknown function type "${t}"`)}}(n);let l,c;if("categorical"===n){l=Object.create(null);for(const e of t.stops)l[e[0]]=e[1];c=typeof t.stops[0][0]}if(i){const i={},r=[];for(let e=0;e<t.stops.length;e++){const n=t.stops[e],a=n[0].zoom;void 0===i[a]&&(i[a]={zoom:a,type:t.type,property:t.property,default:t.default,stops:[]},r.push(a)),i[a].stops.push([n[0].value,n[1]])}const n=[];for(const t of r)n.push([i[t].zoom,Xr(i[t],e)]);const a={name:"linear"};return{kind:"composite",interpolationType:a,interpolationFactor:mi.interpolationFactor.bind(void 0,a),zoomStops:n.map(t=>t[0]),evaluate:({zoom:i},r)=>$r({stops:n,base:t.base},e,i).evaluate(i,r)}}if(r){const i="exponential"===n?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:mi.interpolationFactor.bind(void 0,i),zoomStops:t.stops.map(t=>t[0]),evaluate:({zoom:i})=>s(t,e,i,l,c)}}return{kind:"source",evaluate(i,r){const n=r&&r.properties?r.properties[t.property]:void 0;return void 0===n?Hr(t.default,e.default):s(t,e,n,l,c)}}}function Hr(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function qr(t,e,i,r,n){return Hr(typeof i===n?r[i]:void 0,t.default,e.default)}function Kr(t,e,i){if("number"!==Yr(i))return Hr(t.default,e.default);const r=t.stops.length;if(1===r)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];const n=si(t.stops.map(t=>t[0]),i);return t.stops[n][1]}function $r(t,e,i){const r=void 0!==t.base?t.base:1;if("number"!==Yr(i))return Hr(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];const a=si(t.stops.map(t=>t[0]),i),o=function(t,e,i,r){const n=r-i,a=t-i;return 0===n?0:1===e?a/n:(Math.pow(e,a)-1)/(Math.pow(e,n)-1)}(i,r,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],l=t.stops[a+1][1],c=gi[e.type]||Jr;return"function"==typeof s.evaluate?{evaluate(...e){const i=s.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==i&&void 0!==r)return c(i,r,o,t.colorSpace)}}:c(s,l,o,t.colorSpace)}function tn(t,e,i){switch(e.type){case"color":i=Se.parse(i);break;case"formatted":i=Ze.fromString(i.toString());break;case"resolvedImage":i=Be.fromString(i.toString());break;case"padding":i=ke.parse(i);break;case"colorArray":i=We.parse(i);break;case"numberArray":i=ze.parse(i);break;default:Yr(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0)}return Hr(i,t.default,e.default)}Zr.register(Fr,{error:[{kind:"error"},[Ct],(t,[e])=>{throw new Ie(e.evaluate(t))}],typeof:[Ct,[jt],(t,[e])=>Kt(je(e.evaluate(t)))],"to-rgba":[qt(Dt,4),[Pt],(t,[e])=>{const[i,r,n,a]=e.evaluate(t).rgb;return[255*i,255*r,255*n,a]}],rgb:[Pt,[Dt,Dt,Dt],kr],rgba:[Pt,[Dt,Dt,Dt,Dt],kr],has:{type:Bt,overloads:[[[Ct],(t,[e])=>zr(e.evaluate(t),t.properties())],[[Ct,Lt],(t,[e,i])=>zr(e.evaluate(t),i.evaluate(t))]]},get:{type:jt,overloads:[[[Ct],(t,[e])=>Wr(e.evaluate(t),t.properties())],[[Ct,Lt],(t,[e,i])=>Wr(e.evaluate(t),i.evaluate(t))]]},"feature-state":[jt,[Ct],(t,[e])=>Wr(e.evaluate(t),t.featureState||{})],properties:[Lt,[],t=>t.properties()],"geometry-type":[Ct,[],t=>t.geometryType()],id:[jt,[],t=>t.id()],zoom:[Dt,[],t=>t.globals.zoom],"heatmap-density":[Dt,[],t=>t.globals.heatmapDensity||0],elevation:[Dt,[],t=>t.globals.elevation||0],"line-progress":[Dt,[],t=>t.globals.lineProgress||0],accumulated:[jt,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[Dt,Ir(Dt),(t,e)=>{let i=0;for(const r of e)i+=r.evaluate(t);return i}],"*":[Dt,Ir(Dt),(t,e)=>{let i=1;for(const r of e)i*=r.evaluate(t);return i}],"-":{type:Dt,overloads:[[[Dt,Dt],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[Dt],(t,[e])=>-e.evaluate(t)]]},"/":[Dt,[Dt,Dt],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[Dt,[Dt,Dt],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[Dt,[],()=>Math.LN2],pi:[Dt,[],()=>Math.PI],e:[Dt,[],()=>Math.E],"^":[Dt,[Dt,Dt],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[Dt,[Dt],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[Dt,[Dt],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[Dt,[Dt],(t,[e])=>Math.log(e.evaluate(t))],log2:[Dt,[Dt],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[Dt,[Dt],(t,[e])=>Math.sin(e.evaluate(t))],cos:[Dt,[Dt],(t,[e])=>Math.cos(e.evaluate(t))],tan:[Dt,[Dt],(t,[e])=>Math.tan(e.evaluate(t))],asin:[Dt,[Dt],(t,[e])=>Math.asin(e.evaluate(t))],acos:[Dt,[Dt],(t,[e])=>Math.acos(e.evaluate(t))],atan:[Dt,[Dt],(t,[e])=>Math.atan(e.evaluate(t))],min:[Dt,Ir(Dt),(t,e)=>Math.min(...e.map(e=>e.evaluate(t)))],max:[Dt,Ir(Dt),(t,e)=>Math.max(...e.map(e=>e.evaluate(t)))],abs:[Dt,[Dt],(t,[e])=>Math.abs(e.evaluate(t))],round:[Dt,[Dt],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[Dt,[Dt],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[Dt,[Dt],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Bt,[Ct,jt],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Bt,[jt],(t,[e])=>t.id()===e.value],"filter-type-==":[Bt,[Ct],(t,[e])=>t.geometryType()===e.value],"filter-<":[Bt,[Ct,jt],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r<n}],"filter-id-<":[Bt,[jt],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i<r}],"filter->":[Bt,[Ct,jt],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r>n}],"filter-id->":[Bt,[jt],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i>r}],"filter-<=":[Bt,[Ct,jt],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r<=n}],"filter-id-<=":[Bt,[jt],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i<=r}],"filter->=":[Bt,[Ct,jt],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r>=n}],"filter-id->=":[Bt,[jt],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i>=r}],"filter-has":[Bt,[jt],(t,[e])=>e.value in t.properties()],"filter-has-id":[Bt,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Bt,[qt(Ct)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Bt,[qt(jt)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Bt,[Ct,qt(jt)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Bt,[Ct,qt(jt)],(t,[e,i])=>function(t,e,i,r){for(;i<=r;){const n=i+r>>1;if(e[n]===t)return!0;e[n]>t?r=n-1:i=n+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Bt,overloads:[[[Bt,Bt],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Ir(Bt),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Bt,overloads:[[[Bt,Bt],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Ir(Bt),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Bt,[Bt],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Bt,[Ct],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Ct,[Ct],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Ct,[Ct],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Ct,Ir(jt),(t,e)=>e.map(e=>Ae(e.evaluate(t))).join("")],split:[qt(Ct),[Ct,Ct],(t,[e,i])=>e.evaluate(t).split(i.evaluate(t))],join:[Ct,[qt(Ct),Ct],(t,[e,i])=>e.evaluate(t).join(i.evaluate(t))],"resolved-locale":[Ct,[At],(t,[e])=>e.evaluate(t).resolvedLocale()]});class en{constructor(t,e,i){this.expression=t,this._warningHistory={},this._evaluator=new qe,this._defaultValue=e?function(t){if("color"===t.type&&Qr(t.default))return new Se(0,0,0,0);switch(t.type){case"color":return Se.parse(t.default)||null;case"padding":return ke.parse(t.default)||null;case"numberArray":return ze.parse(t.default)||null;case"colorArray":return We.parse(t.default)||null;case"variableAnchorOffsetCollection":return Ce.parse(t.default)||null;case"projectionDefinition":return Pe.parse(t.default)||null;default:return void 0===t.default?null:t.default}}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null,this._globalState=i}evaluateWithoutErrorHandling(t,e,i,r,n,a){return this._globalState&&(t=un(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,r,n,a){this._globalState&&(t=un(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new Ie(`Expected value to be one of ${Object.keys(this._enumValues).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function rn(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Fr}function nn(t,e,i){const r=new Ke(Fr,Dr,[],e?function(t){const e={color:Pt,string:Ct,number:Dt,enum:Ct,boolean:Bt,formatted:Gt,padding:Yt,numberArray:Jt,colorArray:Qt,projectionDefinition:Ot,resolvedImage:Xt,variableAnchorOffsetCollection:Ht};return"array"===t.type?qt(e[t.value]||jt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Or(new en(n,e,i)):Lr(r.errors)}class an{constructor(t,e,i){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Br(e.expression),this.globalStateRefs=hn(e.expression),this._globalState=i}evaluateWithoutErrorHandling(t,e,i,r,n,a){return this._globalState&&(t=un(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,a)}evaluate(t,e,i,r,n,a){return this._globalState&&(t=un(t,this._globalState)),this._styleExpression.evaluate(t,e,i,r,n,a)}}class on{constructor(t,e,i,r,n){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Br(e.expression),this.globalStateRefs=hn(e.expression),this.interpolationType=r,this._globalState=n}evaluateWithoutErrorHandling(t,e,i,r,n,a){return this._globalState&&(t=un(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,a)}evaluate(t,e,i,r,n,a){return this._globalState&&(t=un(t,this._globalState)),this._styleExpression.evaluate(t,e,i,r,n,a)}interpolationFactor(t,e,i){return this.interpolationType?mi.interpolationFactor(this.interpolationType,t,e,i):0}}function sn(t,e,i){const r=nn(t,e,i);if("error"===r.result)return r;const n=r.value.expression,a=Cr(n);if(!a&&!jr(e))return Lr([new zt("","data expressions not supported")]);const o=Pr(n,["zoom"]);if(!o&&!Ar(e))return Lr([new zt("","zoom expressions not supported")]);const s=cn(n);return s||o?s instanceof zt?Lr([s]):s instanceof mi&&!Gr(e)?Lr([new zt("",'"interpolate" expressions cannot be used with this property')]):Or(s?new on(a?"camera":"composite",r.value,s.labels,s instanceof mi?s.interpolation:void 0,i):new an(a?"constant":"source",r.value,i)):Lr([new zt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class ln{constructor(t,e){this._parameters=t,this._specification=e,kt(this,Xr(this._parameters,this._specification))}static deserialize(t){return new ln(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function cn(t){let e=null;if(t instanceof $e)e=cn(t.result);else if(t instanceof _i){for(const i of t.args)if(e=cn(i),e)break}else(t instanceof li||t instanceof mi)&&t.input instanceof Zr&&"zoom"===t.input.name&&(e=t);return e instanceof zt||t.eachChild(t=>{const i=cn(t);i instanceof zt?e=i:!e&&i?e=new zt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new zt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function hn(t,e=new Set){return t instanceof Er&&e.add(t.key),t.eachChild(t=>{hn(t,e)}),e}function un(t,e){const{zoom:i,heatmapDensity:r,elevation:n,lineProgress:a,isSupportedScript:o,accumulated:s}=null!=t?t:{};return{zoom:i,heatmapDensity:r,elevation:n,lineProgress:a,isSupportedScript:o,accumulated:s,globalState:e}}function dn(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!dn(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const pn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function mn(t,e){if(null==t)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};dn(t)||(t=_n(t));const i=nn(t,pn,e);if("error"===i.result)throw new Error(i.value.map(t=>`${t.key}: ${t.message}`).join(", "));return{filter:(t,e,r)=>i.value.evaluate(t,e,{},r),needGeometry:gn(t),getGlobalStateRefs:()=>hn(i.value.expression)}}function fn(t,e){return t<e?-1:t>e?1:0}function gn(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let e=1;e<t.length;e++)if(gn(t[e]))return!0;return!1}function _n(t){if(!t)return!0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?yn(t[1],t[2],"=="):"!="===e?vn(yn(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?yn(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(_n))):"all"===e?["all"].concat(t.slice(1).map(_n)):"none"===e?["all"].concat(t.slice(1).map(_n).map(vn)):"in"===e?xn(t[1],t.slice(2)):"!in"===e?vn(xn(t[1],t.slice(2))):"has"===e?bn(t[1]):"!has"!==e||vn(bn(t[1]));var i}function yn(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function xn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",t,["literal",e.sort(fn)]]:["filter-in-small",t,["literal",e]]}}function bn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function vn(t){return["!",t]}function Tn(t){const e=typeof t;if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){let e="[";for(const i of t)e+=`${Tn(i)},`;return`${e}]`}const i=Object.keys(t).sort();let r="{";for(let e=0;e<i.length;e++)r+=`${JSON.stringify(i[e])}:${Tn(t[i[e]])},`;return`${r}}`}function wn(t){let e="";for(const i of vt)e+=`/${Tn(t[i])}`;return e}function Vn(t){const e=t.value;return e?[new Zt(t.key,e,"constants have been deprecated as of v8")]:[]}function Rn(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Mn(t){if(Array.isArray(t))return t.map(Mn);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=Mn(t[i]);return e}return Rn(t)}function Un(t){const e=t.key,i=t.value,r=t.valueSpec||{},n=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=t.validateSpec;let l=[];const c=Yr(i);if("object"!==c)return[new Zt(e,i,`object expected, ${c} found`)];for(const t in i){const c=t.split(".")[0],h=be(r,c)||r["*"];let u;if(be(n,c))u=n[c];else if(be(r,c)){if(void 0===i[t])continue;u=s}else if(n["*"])u=n["*"];else{if(!r["*"]){l.push(new Zt(e,i[t],`unknown property "${t}"`));continue}u=s}l=l.concat(u({key:(e?`${e}.`:e)+t,value:i[t],valueSpec:h,style:a,styleSpec:o,object:i,objectKey:t,validateSpec:s},i))}for(const t in r)n[t]||r[t].required&&void 0===r[t].default&&void 0===i[t]&&l.push(new Zt(e,i,`missing required property "${t}"`));return l}function Sn(t){const e=t.value,i=t.valueSpec,r=t.style,n=t.styleSpec,a=t.key,o=t.arrayElementValidator||t.validateSpec;if("array"!==Yr(e))return[new Zt(a,e,`array expected, ${Yr(e)} found`)];if(i.length&&e.length!==i.length)return[new Zt(a,e,`array length ${i.length} expected, length ${e.length} found`)];let s={type:i.value,values:i.values};n.$version<7&&(s.function=i.function),"object"===Yr(i.value)&&(s=i.value);let l=[];for(let i=0;i<e.length;i++)l=l.concat(o({array:e,arrayIndex:i,value:e[i],valueSpec:s,validateSpec:t.validateSpec,style:r,styleSpec:n,key:`${a}[${i}]`}));return l}function Nn(t){const e=t.key,i=t.value,r=t.valueSpec;let n=Yr(i);return"number"===n&&i!=i&&(n="NaN"),"number"!==n?[new Zt(e,i,`number expected, ${n} found`)]:"minimum"in r&&i<r.minimum?[new Zt(e,i,`${i} is less than the minimum value ${r.minimum}`)]:"maximum"in r&&i>r.maximum?[new Zt(e,i,`${i} is greater than the maximum value ${r.maximum}`)]:[]}function En(t){const e=t.valueSpec,i=Rn(t.value.type);let r,n,a,o={};const s="categorical"!==i&&void 0===t.value.property,l=!s,c="array"===Yr(t.value.stops)&&"array"===Yr(t.value.stops[0])&&"object"===Yr(t.value.stops[0][0]),h=Un({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new Zt(t.key,t.value,'identity function may not have a "stops" property')];let e=[];const r=t.value;return e=e.concat(Sn({key:t.key,value:r,valueSpec:t.valueSpec,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:u})),"array"===Yr(r)&&0===r.length&&e.push(new Zt(t.key,r,"array must have at least one stop")),e},default:function(t){return t.validateSpec({key:t.key,value:t.value,valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&s&&h.push(new Zt(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||h.push(new Zt(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!Gr(t.valueSpec)&&h.push(new Zt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!jr(t.valueSpec)?h.push(new Zt(t.key,t.value,"property functions not supported")):s&&!Ar(t.valueSpec)&&h.push(new Zt(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!c||void 0!==t.value.property||h.push(new Zt(t.key,t.value,'"property" property is required')),h;function u(t){let i=[];const r=t.value,s=t.key;if("array"!==Yr(r))return[new Zt(s,r,`array expected, ${Yr(r)} found`)];if(2!==r.length)return[new Zt(s,r,`array length 2 expected, length ${r.length} found`)];if(c){if("object"!==Yr(r[0]))return[new Zt(s,r,`object expected, ${Yr(r[0])} found`)];if(void 0===r[0].zoom)return[new Zt(s,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new Zt(s,r,"object stop key must have value")];if(a&&a>Rn(r[0].zoom))return[new Zt(s,r[0].zoom,"stop zoom values must appear in ascending order")];Rn(r[0].zoom)!==a&&(a=Rn(r[0].zoom),n=void 0,o={}),i=i.concat(Un({key:`${s}[0]`,value:r[0],valueSpec:{zoom:{}},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Nn,value:d}}))}else i=i.concat(d({key:`${s}[0]`,value:r[0],validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec},r));return rn(Mn(r[1]))?i.concat([new Zt(`${s}[1]`,r[1],"expressions are not allowed in function stops.")]):i.concat(t.validateSpec({key:`${s}[1]`,value:r[1],valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec}))}function d(t,a){const s=Yr(t.value),l=Rn(t.value),c=null!==t.value?t.value:a;if(r){if(s!==r)return[new Zt(t.key,c,`${s} stop domain type must match previous stop domain type ${r}`)]}else r=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Zt(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==i){let r=`number expected, ${s} found`;return jr(e)&&void 0===i&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Zt(t.key,c,r)]}return"categorical"!==i||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===s&&void 0!==n&&l<n?[new Zt(t.key,c,"stop domain values must appear in ascending order")]:(n=l,"categorical"===i&&l in o?[new Zt(t.key,c,"stop domain values must be unique")]:(o[l]=!0,[])):[new Zt(t.key,c,`integer expected, found ${l}`)]}}function Fn(t){const e=("property"===t.expressionContext?sn:nn)(Mn(t.value),t.valueSpec);if("error"===e.result)return e.value.map(e=>new Zt(`${t.key}${e.key}`,t.value,e.message));const i=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new Zt(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!Br(i))return[new Zt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Br(i))return[new Zt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Pr(i,["zoom","feature-state"]))return[new Zt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Cr(i))return[new Zt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Zn(t){const e=t.key,i=t.value,r=Yr(i);return"string"!==r?[new Zt(e,i,`color expected, ${r} found`)]:Se.parse(String(i))?[]:[new Zt(e,i,`color expected, "${i}" found`)]}function kn(t){const e=t.key,i=t.value,r=t.valueSpec,n=[];return Array.isArray(r.values)?-1===r.values.indexOf(Rn(i))&&n.push(new Zt(e,i,`expected one of [${r.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(r.values).indexOf(Rn(i))&&n.push(new Zt(e,i,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(i)} found`)),n}function zn(t){return dn(Mn(t.value))?Fn(kt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Wn(t)}function Wn(t){const e=t.value,i=t.key;if("array"!==Yr(e))return[new Zt(i,e,`array expected, ${Yr(e)} found`)];const r=t.styleSpec;let n,a=[];if(e.length<1)return[new Zt(i,e,"filter array must have at least 1 element")];switch(a=a.concat(kn({key:`${i}[0]`,value:e[0],valueSpec:r.filter_operator,style:t.style,styleSpec:t.styleSpec})),Rn(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Rn(e[1])&&a.push(new Zt(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&a.push(new Zt(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(n=Yr(e[1]),"string"!==n&&a.push(new Zt(`${i}[1]`,e[1],`string expected, ${n} found`)));for(let o=2;o<e.length;o++)n=Yr(e[o]),"$type"===Rn(e[1])?a=a.concat(kn({key:`${i}[${o}]`,value:e[o],valueSpec:r.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&a.push(new Zt(`${i}[${o}]`,e[o],`string, number, or boolean expected, ${n} found`));break;case"any":case"all":case"none":for(let r=1;r<e.length;r++)a=a.concat(Wn({key:`${i}[${r}]`,value:e[r],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":n=Yr(e[1]),2!==e.length?a.push(new Zt(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):"string"!==n&&a.push(new Zt(`${i}[1]`,e[1],`string expected, ${n} found`))}return a}function In(t,e){const i=t.key,r=t.validateSpec,n=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a[`${e}_${t.layerType}`];if(!l)return[];const c=s.match(/^(.*)-transition$/);if("paint"===e&&c&&l[c[1]]&&l[c[1]].transition)return r({key:i,value:o,valueSpec:a.transition,style:n,styleSpec:a});const h=t.valueSpec||l[s];if(!h)return[new Zt(i,o,`unknown property "${s}"`)];let u;if("string"===Yr(o)&&jr(h)&&!h.tokens&&(u=/^{([^}]+)}$/.exec(o)))return[new Zt(i,o,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(u[1])} }\`.`)];const d=[];return"symbol"===t.layerType&&"text-font"===s&&Qr(Mn(o))&&"identity"===Rn(o.type)&&d.push(new Zt(i,o,'"text-font" does not support identity functions')),d.concat(r({key:t.key,value:o,valueSpec:h,style:n,styleSpec:a,expressionContext:"property",propertyType:e,propertyKey:s}))}function Dn(t){return In(t,"paint")}function Cn(t){return In(t,"layout")}function Bn(t){var e,i;let r=[];const n=t.value,a=t.key,o=t.style,s=t.styleSpec;if("object"!==Yr(n))return[new Zt(a,n,`object expected, ${Yr(n)} found`)];n.type||n.ref||r.push(new Zt(a,n,'either "type" or "ref" is required'));let l=Rn(n.type);const c=Rn(n.ref);if(n.id){const e=Rn(n.id);for(let i=0;i<t.arrayIndex;i++){const t=o.layers[i];Rn(t.id)===e&&r.push(new Zt(a,n.id,`duplicate layer id "${n.id}", previously used at line ${t.id.__line__}`))}}if("ref"in n){let t;["type","source","source-layer","filter","layout"].forEach(t=>{t in n&&r.push(new Zt(a,n[t],`"${t}" is prohibited for ref layers`))}),o.layers.forEach(e=>{Rn(e.id)===c&&(t=e)}),t?t.ref?r.push(new Zt(a,n.ref,"ref cannot reference another ref layer")):l=Rn(t.type):r.push(new Zt(a,n.ref,`ref layer "${c}" not found`))}else if("background"!==l)if(n.source){const t=o.sources&&o.sources[n.source],e=t&&Rn(t.type);t?"vector"===e&&"raster"===l?r.push(new Zt(a,n.source,`layer "${n.id}" requires a raster source`)):"raster-dem"!==e&&"hillshade"===l||"raster-dem"!==e&&"color-relief"===l?r.push(new Zt(a,n.source,`layer "${n.id}" requires a raster-dem source`)):"raster"===e&&"raster"!==l?r.push(new Zt(a,n.source,`layer "${n.id}" requires a vector source`)):"vector"!==e||n["source-layer"]?"raster-dem"===e&&"hillshade"!==l&&"color-relief"!==l?r.push(new Zt(a,n.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):"line"!==l||!n.paint||!n.paint["line-gradient"]||"geojson"===e&&t.lineMetrics||r.push(new Zt(a,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):r.push(new Zt(a,n,`layer "${n.id}" must specify a "source-layer"`)):r.push(new Zt(a,n.source,`source "${n.source}" not found`))}else r.push(new Zt(a,n,'missing required property "source"'));return"raster"===l&&(null===(e=n.paint)||void 0===e?void 0:e.resampling)&&(null===(i=n.paint)||void 0===i?void 0:i["raster-resampling"])&&r.push(new Zt(a,n.paint,`layer "${n.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),r=r.concat(Un({key:a,value:n,valueSpec:s.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":()=>[],type:()=>t.validateSpec({key:`${a}.type`,value:n.type,valueSpec:s.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:n,objectKey:"type"}),filter:zn,layout:t=>Un({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>Cn(kt({layerType:l},t))}}),paint:t=>Un({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>Dn(kt({layerType:l},t))}})}})),r}function Pn(t){const e=t.value,i=t.key,r=Yr(e);return"string"!==r?[new Zt(i,e,`string expected, ${r} found`)]:[]}const On={promoteId:function({key:t,value:e}){if("string"===Yr(e))return Pn({key:t,value:e});{const i=[];for(const r in e)i.push(...Pn({key:`${t}.${r}`,value:e[r]}));return i}}};function Ln(t){const e=t.value,i=t.key,r=t.styleSpec,n=t.style,a=t.validateSpec;if(!e.type)return[new Zt(i,e,'"type" is required')];const o=Rn(e.type);let s;switch(o){case"vector":case"raster":return s=Un({key:i,value:e,valueSpec:r[`source_${o.replace("-","_")}`],style:t.style,styleSpec:r,objectElementValidators:On,validateSpec:a}),s;case"raster-dem":return s=function(t){var e;const i=null!==(e=t.sourceName)&&void 0!==e?e:"",r=t.value,n=t.styleSpec,a=n.source_raster_dem,o=t.style;let s=[];const l=Yr(r);if(void 0===r)return s;if("object"!==l)return s.push(new Zt("source_raster_dem",r,`object expected, ${l} found`)),s;const c="custom"===Rn(r.encoding),h=["redFactor","greenFactor","blueFactor","baseShift"],u=t.value.encoding?`"${t.value.encoding}"`:"Default";for(const e in r)!c&&h.includes(e)?s.push(new Zt(e,r[e],`In "${i}": "${e}" is only valid when "encoding" is set to "custom". ${u} encoding found`)):a[e]?s=s.concat(t.validateSpec({key:e,value:r[e],valueSpec:a[e],validateSpec:t.validateSpec,style:o,styleSpec:n})):s.push(new Zt(e,r[e],`unknown property "${e}"`));return s}({sourceName:i,value:e,style:t.style,styleSpec:r,validateSpec:a}),s;case"geojson":if(s=Un({key:i,value:e,valueSpec:r.source_geojson,style:n,styleSpec:r,validateSpec:a,objectElementValidators:On}),e.cluster)for(const t in e.clusterProperties){const[r,n]=e.clusterProperties[t],a="string"==typeof r?[r,["accumulated"],["get",t]]:r;s.push(...Fn({key:`${i}.${t}.map`,value:n,expressionContext:"cluster-map"})),s.push(...Fn({key:`${i}.${t}.reduce`,value:a,expressionContext:"cluster-reduce"}))}return s;case"video":return Un({key:i,value:e,valueSpec:r.source_video,style:n,validateSpec:a,styleSpec:r});case"image":return Un({key:i,value:e,valueSpec:r.source_image,style:n,validateSpec:a,styleSpec:r});case"canvas":return[new Zt(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return kn({key:`${i}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function jn(t){const e=t.value,i=t.styleSpec,r=i.light,n=t.style;let a=[];const o=Yr(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new Zt("light",e,`object expected, ${o} found`)]),a;for(const o in e){const s=o.match(/^(.*)-transition$/);a=a.concat(s&&r[s[1]]&&r[s[1]].transition?t.validateSpec({key:o,value:e[o],valueSpec:i.transition,validateSpec:t.validateSpec,style:n,styleSpec:i}):r[o]?t.validateSpec({key:o,value:e[o],valueSpec:r[o],validateSpec:t.validateSpec,style:n,styleSpec:i}):[new Zt(o,e[o],`unknown property "${o}"`)])}return a}function An(t){const e=t.value,i=t.styleSpec,r=i.sky,n=t.style,a=Yr(e);if(void 0===e)return[];if("object"!==a)return[new Zt("sky",e,`object expected, ${a} found`)];let o=[];for(const a in e)o=o.concat(r[a]?t.validateSpec({key:a,value:e[a],valueSpec:r[a],style:n,styleSpec:i}):[new Zt(a,e[a],`unknown property "${a}"`)]);return o}function Gn(t){const e=t.value,i=t.styleSpec,r=i.terrain,n=t.style;let a=[];const o=Yr(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new Zt("terrain",e,`object expected, ${o} found`)]),a;for(const o in e)a=a.concat(r[o]?t.validateSpec({key:o,value:e[o],valueSpec:r[o],validateSpec:t.validateSpec,style:n,styleSpec:i}):[new Zt(o,e[o],`unknown property "${o}"`)]);return a}function Yn(t){let e=[];const i=t.value,r=t.key;if(Array.isArray(i)){const n=[],a=[];for(const o in i)i[o].id&&n.includes(i[o].id)&&e.push(new Zt(r,i,`all the sprites' ids must be unique, but ${i[o].id} is duplicated`)),n.push(i[o].id),i[o].url&&a.includes(i[o].url)&&e.push(new Zt(r,i,`all the sprites' URLs must be unique, but ${i[o].url} is duplicated`)),a.push(i[o].url),e=e.concat(Un({key:`${r}[${o}]`,value:i[o],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:t.validateSpec}));return e}return Pn({key:r,value:i})}function Qn(t){return Boolean(t)&&t.constructor===Object}function Jn(t){return Qn(t.value)?[]:[new Zt(t.key,t.value,`object expected, ${Yr(t.value)} found`)]}const Xn={"*":()=>[],array:Sn,boolean:function(t){const e=t.value,i=t.key,r=Yr(e);return"boolean"!==r?[new Zt(i,e,`boolean expected, ${r} found`)]:[]},number:Nn,color:Zn,constants:Vn,enum:kn,filter:zn,function:En,layer:Bn,object:Un,source:Ln,light:jn,sky:An,terrain:Gn,projection:function(t){const e=t.value,i=t.styleSpec,r=i.projection,n=t.style,a=Yr(e);if(void 0===e)return[];if("object"!==a)return[new Zt("projection",e,`object expected, ${a} found`)];let o=[];for(const a in e)o=o.concat(r[a]?t.validateSpec({key:a,value:e[a],valueSpec:r[a],style:n,styleSpec:i}):[new Zt(a,e[a],`unknown property "${a}"`)]);return o},projectionDefinition:function(t){const e=t.key;let i=t.value;i=i instanceof String?i.valueOf():i;const r=Yr(i);return"array"!==r||function(t){return Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]}(i)||function(t){return!!["interpolate","step","literal"].includes(t[0])}(i)?["array","string"].includes(r)?[]:[new Zt(e,i,`projection expected, invalid type "${r}" found`)]:[new Zt(e,i,`projection expected, invalid array ${JSON.stringify(i)} found`)]},string:Pn,formatted:function(t){return 0===Pn(t).length?[]:Fn(t)},resolvedImage:function(t){return 0===Pn(t).length?[]:Fn(t)},padding:function(t){const e=t.key,i=t.value;if("array"===Yr(i)){if(i.length<1||i.length>4)return[new Zt(e,i,`padding requires 1 to 4 values; ${i.length} values found`)];const r={type:"number"};let n=[];for(let a=0;a<i.length;a++)n=n.concat(t.validateSpec({key:`${e}[${a}]`,value:i[a],validateSpec:t.validateSpec,valueSpec:r}));return n}return Nn({key:e,value:i,valueSpec:{}})},numberArray:function(t){const e=t.key,i=t.value;if("array"===Yr(i)){const r={type:"number"};if(i.length<1)return[new Zt(e,i,"array length at least 1 expected, length 0 found")];let n=[];for(let a=0;a<i.length;a++)n=n.concat(t.validateSpec({key:`${e}[${a}]`,value:i[a],validateSpec:t.validateSpec,valueSpec:r}));return n}return Nn({key:e,value:i,valueSpec:{}})},colorArray:function(t){const e=t.key,i=t.value;if("array"===Yr(i)){if(i.length<1)return[new Zt(e,i,"array length at least 1 expected, length 0 found")];let t=[];for(let r=0;r<i.length;r++)t=t.concat(Zn({key:`${e}[${r}]`,value:i[r]}));return t}return Zn({key:e,value:i})},variableAnchorOffsetCollection:function(t){const e=t.key,i=t.value,r=Yr(i),n=t.styleSpec;if("array"!==r||i.length<1||i.length%2!=0)return[new Zt(e,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let r=0;r<i.length;r+=2)a=a.concat(kn({key:`${e}[${r}]`,value:i[r],valueSpec:n.layout_symbol["text-anchor"]})),a=a.concat(Sn({key:`${e}[${r+1}]`,value:i[r+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:n}));return a},sprite:Yn,state:Jn,fontFaces:function(t){const e=t.key,i=t.value,r=t.validateSpec,n=t.styleSpec,a=t.style;if(!Qn(i))return[new Zt(e,i,`object expected, ${Yr(i)} found`)];const o=[];for(const t in i){const s=i[t],l=Yr(s);if("string"===l)o.push(...Pn({key:`${e}.${t}`,value:s}));else if("array"===l){const i={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(const[l,c]of s.entries())o.push(...Un({key:`${e}.${t}[${l}]`,value:c,valueSpec:i,styleSpec:n,style:a,validateSpec:r}))}else o.push(new Zt(`${e}.${t}`,s,`string or array expected, ${l} found`))}return o}};function Hn(t){const e=t.value,i=t.valueSpec,r=t.styleSpec;return t.validateSpec=Hn,i.expression&&Qr(Rn(e))?En(t):i.expression&&rn(Mn(e))?Fn(t):i.type&&Xn[i.type]?Xn[i.type](t):Un(kt({},t,{valueSpec:i.type?r[i.type]:i}))}function qn(t){const e=t.value,i=t.key,r=Pn(t);return r.length||(-1===e.indexOf("{fontstack}")&&r.push(new Zt(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&r.push(new Zt(i,e,'"glyphs" url must include a "{range}" token'))),r}function Kn(t,e=bt){let i=[];return i=i.concat(Hn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:Hn,objectElementValidators:{glyphs:qn,"*":()=>[]}})),t.constants&&(i=i.concat(Vn({key:"constants",value:t.constants}))),ta(i)}function $n(t){return function(e){return t(Object.assign({},e,{validateSpec:Hn}))}}function ta(t){return[].concat(t).sort((t,e)=>t.line-e.line)}function ea(t){return function(...e){return ta(t.apply(this,e))}}Kn.source=ea($n(Ln)),Kn.sprite=ea($n(Yn)),Kn.glyphs=ea($n(qn)),Kn.light=ea($n(jn)),Kn.sky=ea($n(An)),Kn.terrain=ea($n(Gn)),Kn.state=ea($n(Jn)),Kn.layer=ea($n(Bn)),Kn.filter=ea($n(zn)),Kn.paintProperty=ea($n(Dn)),Kn.layoutProperty=ea($n(Cn));const ia={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};class ra{constructor(t,e){this._globalState=e,this.setValue(t)}evaluate(){var t;return null!==(t=this._literalValue)&&void 0!==t?t:this._compiledValue.evaluate({})}setValue(t){if(null==t||"visible"===t||"none"===t)return this._literalValue="none"===t?"none":"visible",this._compiledValue=void 0,void(this._globalStateRefs=new Set);const e=nn(t,ia,this._globalState);if("error"===e.result)throw this._literalValue="visible",this._compiledValue=void 0,new Error(e.value.map(t=>`${t.key}: ${t.message}`).join(", "));this._literalValue=void 0,this._compiledValue=e.value,this._globalStateRefs=hn(e.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}}const na=bt,aa=Kn,oa=aa.light,sa=aa.sky,la=aa.paintProperty,ca=aa.layoutProperty;function ha(t,e){let i=!1;if(e&&e.length)for(const r of e)t.fire(new yt(new Error(r.message))),i=!0;return i}class ua{constructor(t,e,i){const r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const n=new Int32Array(this.arrayBuffer);t=n[0],this.d=(e=n[1])+2*(i=n[2]);for(let t=0;t<this.d*this.d;t++){const e=n[3+t],i=n[3+t+1];r.push(e===i?null:n.subarray(e,i))}const a=n[3+r.length+1];this.keys=n.subarray(n[3+r.length],a),this.bboxes=n.subarray(a),this.insert=this._insertReadonly}else{this.d=e+2*i;for(let t=0;t<this.d*this.d;t++)r.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;const n=i/e*t;this.min=-n,this.max=t+n}insert(t,e,i,r,n){this._forEachCell(e,i,r,n,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,e,i,r,n,a){this.cells[n].push(a)}query(t,e,i,r,n){const a=this.min,o=this.max;if(t<=a&&e<=a&&o<=i&&o<=r&&!n)return[...this.keys];{const a=[];return this._forEachCell(t,e,i,r,this._queryCell,a,{},n),a}}_queryCell(t,e,i,r,n,a,o,s){const l=this.cells[n];if(null!==l){const n=this.keys,c=this.bboxes;for(let h=0;h<l.length;h++){const u=l[h];if(void 0===o[u]){const l=4*u;(s?s(c[l+0],c[l+1],c[l+2],c[l+3]):t<=c[l+2]&&e<=c[l+3]&&i>=c[l+0]&&r>=c[l+1])?(o[u]=!0,a.push(n[u])):o[u]=!1}}}}_forEachCell(t,e,i,r,n,a,o,s){const l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),h=this._convertToCellCoord(i),u=this._convertToCellCoord(r);for(let d=l;d<=h;d++)for(let l=c;l<=u;l++){const c=this.d*l+d;if((!s||s(this._convertFromCellCoord(d),this._convertFromCellCoord(l),this._convertFromCellCoord(d+1),this._convertFromCellCoord(l+1)))&&n.call(this,t,e,i,r,c,a,o,s))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,e=3+this.cells.length+1+1;let i=0;for(let t=0;t<this.cells.length;t++)i+=this.cells[t].length;const r=new Int32Array(e+i+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;let n=e;for(let e=0;e<t.length;e++){const i=t[e];r[3+e]=n,r.set(i,n),n+=i.length}return r[3+t.length]=n,r.set(this.keys,n),n+=this.keys.length,r[3+t.length+1]=n,r.set(this.bboxes,n),n+=this.bboxes.length,r.buffer}static serialize(t,e){const i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}}static deserialize(t){return new ua(t.buffer)}}const da={};function pa(t,e,i={}){if(da[t])throw new Error(`${t} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),da[t]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}pa("Object",Object),pa("Set",Set),pa("TransferableGridIndex",ua),pa("Color",Se),pa("Error",Error),pa("AJAXError",ut),pa("ResolvedImage",Be),pa("StylePropertyFunction",ln),pa("StyleExpression",en,{omit:["_evaluator"]}),pa("ZoomDependentExpression",on),pa("ZoomConstantExpression",an),pa("CompoundExpression",Zr,{omit:["_evaluate"]});for(const t in Fr)Fr[t]._classRegistryKey||pa(`Expression_${t}`,Fr[t]);function ma(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function fa(t){return t.$name||t.constructor._classRegistryKey}function ga(t){return!function(t){if(null===t||"object"!=typeof t)return!1;const e=fa(t);return!(!e||"Object"===e)}(t)&&(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||ma(t)||J(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function _a(t,e){if(ga(t))return(ma(t)||J(t))&&e&&e.push(t),ArrayBuffer.isView(t)&&e&&e.push(t.buffer),t instanceof ImageData&&e&&e.push(t.data.buffer),t;if(Array.isArray(t)){const i=[];for(const r of t)i.push(_a(r,e));return i}if("object"!=typeof t)throw new Error("can't serialize object of type "+typeof t);const i=fa(t);if(!i)throw new Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!da[i])throw new Error(`${i} is not registered.`);const{klass:r}=da[i],n=r.serialize?r.serialize(t,e):{};if(r.serialize){if(e&&n===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const r in t){if(!t.hasOwnProperty(r))continue;if(da[i].omit.indexOf(r)>=0)continue;const a=t[r];n[r]=da[i].shallow.indexOf(r)>=0?a:_a(a,e)}t instanceof Error&&(n.message=t.message)}if(n.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(n.$name=i),n}function ya(t){if(ga(t))return t;if(Array.isArray(t))return t.map(ya);if("object"!=typeof t)throw new Error("can't deserialize object of type "+typeof t);const e=fa(t)||"Object";if(!da[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:i}=da[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);const r=Object.create(i.prototype);for(const i of Object.keys(t)){if("$name"===i)continue;const n=t[i];r[i]=da[e].shallow.indexOf(i)>=0?n:ya(n)}return r}class xa{constructor(){this.first=!0}update(t,e){const i=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=i,!0))}}function ba(t){return/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(t))}function va(t){return/[\u02EA\u02EB\u1100-\u11FF\u1400-\u167F\u18B0-\u18F5\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303F\u3041-\u3096\u309D-\u30FB\u30FD-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFE4\uDFF0-\uDFF6]|[\uD81C-\uD822\uD83D\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD30-\uDEFB]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83C[\uDC00-\uDE00\uDF00-\uDFFF]|\uD83E[\uDD00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(t))}function Ta(t){return/\s/u.test(String.fromCodePoint(t))}function wa(t){for(const e of t)if(va(e.codePointAt(0)))return!0;return!1}function Va(t){for(const e of t)if(!Ua(e.codePointAt(0)))return!1;return!0}function Ra(t){const e=t.map(t=>{try{return new RegExp(`\\p{sc=${t}}`,"u").source}catch(t){return null}}).filter(t=>t);return new RegExp(e.join("|"),"u")}const Ma=Ra(["Arab","Dupl","Mong","Ougr","Syrc"]);function Ua(t){return!Ma.test(String.fromCodePoint(t))}function Sa(t){return!(va(t)||(e=t,/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(e))));var e}const Na=Ra(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Ea(t){return Na.test(String.fromCodePoint(t))}function Fa(t,e){return!(!e&&Ea(t)||/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(t)))}function Za(t){for(const e of t)if(Ea(e.codePointAt(0)))return!0;return!1}const ka=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(ka.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getRTLTextPluginStatus(){return this.pluginStatus}syncState(t,i){return e(this,void 0,void 0,function*(){if(this.isParsed())return this.getState();if("loading"!==t.pluginStatus)return this.setState(t),t;const e=t.pluginURL,r=new Promise(t=>{this.loadScriptResolve=t});i(e);const n=new Promise(t=>setTimeout(()=>t(),this.TIMEOUT));if(yield Promise.race([r,n]),this.isParsed()){const t={pluginStatus:"loaded",pluginURL:e};return this.setState(t),t}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${e}`)})}};class za{constructor(t,e){this.isSupportedScript=Wa,this.zoom=t,e?(this.now=e.now||0,this.fadeDuration=e.fadeDuration||0,this.zoomHistory=e.zoomHistory||new xa,this.transition=e.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new xa,this.transition={})}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,e=t-Math.floor(t),i=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*e}}}function Wa(t){return function(t,e){for(const i of t)if(!Fa(i.codePointAt(0),e))return!1;return!0}(t,"loaded"===ka.getRTLTextPluginStatus())}const Ia="-transition";class Da{constructor(t,e,i){this.property=t,this.value=e,this.expression=function(t,e,i){if(Qr(t))return new ln(t,e);if(rn(t)){const r=sn(t,e,i);if("error"===r.result)throw new Error(r.value.map(t=>`${t.key}: ${t.message}`).join(", "));return r.value}{let i=t;return"color"===e.type&&"string"==typeof t?i=Se.parse(t):"padding"!==e.type||"number"!=typeof t&&!Array.isArray(t)?"numberArray"!==e.type||"number"!=typeof t&&!Array.isArray(t)?"colorArray"!==e.type||"string"!=typeof t&&!Array.isArray(t)?"variableAnchorOffsetCollection"===e.type&&Array.isArray(t)?i=Ce.parse(t):"projectionDefinition"===e.type&&"string"==typeof t&&(i=Pe.parse(t)):i=We.parse(t):i=ze.parse(t):i=ke.parse(t),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>i}}}(void 0===e?t.specification.default:e,t.specification,i)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)}}class Ca{constructor(t,e){this.property=t,this.value=new Da(t,void 0,e)}transitioned(t,e){return new Pa(this.property,this.value,e,C({},t.transition,this.transition),t.now)}untransitioned(){return new Pa(this.property,this.value,null,{},0)}}class Ba{constructor(t,e){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=e}hasProperty(t){return t in this._properties.defaultTransitionablePropertyValues}getValue(t){return L(this._values[t].value.value)}setValue(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new Ca(this._values[t].property,this._globalState)),this._values[t].value=new Da(this._values[t].property,null===e?void 0:L(e),this._globalState)}getTransition(t){return L(this._values[t].transition)}setTransition(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new Ca(this._values[t].property,this._globalState)),this._values[t].transition=L(e)||void 0}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i);const r=this.getTransition(e);void 0!==r&&(t[`${e}${Ia}`]=r)}return t}transitioned(t,e){const i=new Oa(this._properties);for(const r of Object.keys(this._values))i._values[r]=this._values[r].transitioned(t,e._values[r]);return i}untransitioned(){const t=new Oa(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class Pa{constructor(t,e,i,r,n){this.property=t,this.value=e,this.begin=n+r.delay||0,this.end=this.begin+r.duration||0,t.specification.transition&&(r.delay||r.duration)&&(this.prior=i)}possiblyEvaluate(t,e,i){const r=t.now||0,n=this.value.possiblyEvaluate(t,e,i),a=this.prior;if(a){if(r>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(r<this.begin)return a.possiblyEvaluate(t,e,i);{const o=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,e,i),n,k(o))}}return n}}class Oa{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,i){const r=new Aa(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].possiblyEvaluate(t,e,i);return r}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class La{constructor(t,e){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._globalState=e}hasValue(t){return void 0!==this._values[t].value}hasProperty(t){return t in this._properties.defaultPropertyValues}getValue(t){return L(this._values[t].value)}setValue(t,e){this._values[t]=new Da(this._values[t].property,null===e?void 0:L(e),this._globalState)}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i)}return t}possiblyEvaluate(t,e,i){const r=new Aa(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].possiblyEvaluate(t,e,i);return r}}class ja{constructor(t,e,i){this.property=t,this.value=e,this.parameters=i}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,e,i,r){return this.property.evaluate(this.value,this.parameters,t,e,i,r)}}class Aa{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class Ga{constructor(t){this.specification=t}possiblyEvaluate(t,e){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(e)}interpolate(t,e,i){const r=gi[this.specification.type];return r?r(t,e,i):t}}class Ya{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,i,r){return new ja(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},i,r)}:t.expression,e)}interpolate(t,e,i){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new ja(this,{kind:"constant",value:void 0},t.parameters);const r=gi[this.specification.type];if(r){const n=r(t.value.value,e.value.value,i);return new ja(this,{kind:"constant",value:n},t.parameters)}return t}evaluate(t,e,i,r,n,a){return"constant"===t.kind?t.value:t.evaluate(e,i,r,n,a)}}class Qa extends Ya{possiblyEvaluate(t,e,i,r){if(void 0===t.value)return new ja(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){const n=t.expression.evaluate(e,null,{},i,r),a="resolvedImage"===t.property.specification.type&&"string"!=typeof n?n.name:n,o=this._calculate(a,a,a,e);return new ja(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){const i=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new ja(this,{kind:"constant",value:i},e)}return new ja(this,t.expression,e)}evaluate(t,e,i,r,n,a){if("source"===t.kind){const o=t.evaluate(e,i,r,n,a);return this._calculate(o,o,o,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},i,r),t.evaluate({zoom:Math.floor(e.zoom)},i,r),t.evaluate({zoom:Math.floor(e.zoom)+1},i,r),e):t.value}_calculate(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}}interpolate(t){return t}}class Ja{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,r){if(void 0!==t.value){if("constant"===t.expression.kind){const n=t.expression.evaluate(e,null,{},i,r);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new za(Math.floor(e.zoom-1),e)),t.expression.evaluate(new za(Math.floor(e.zoom),e)),t.expression.evaluate(new za(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}}interpolate(t){return t}}class Xa{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,r){return!!t.expression.evaluate(e,null,{},i,r)}interpolate(){return!1}}class Ha{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const e in t){const i=t[e];i.specification.overridable&&this.overridableProperties.push(e);const r=this.defaultPropertyValues[e]=new Da(i,void 0,void 0),n=this.defaultTransitionablePropertyValues[e]=new Ca(i,void 0);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}}}pa("DataDrivenProperty",Ya),pa("DataConstantProperty",Ga),pa("CrossFadedDataDrivenProperty",Qa),pa("CrossFadedProperty",Ja),pa("ColorRampProperty",Xa);const qa=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",Ka=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?";class $a extends xt{constructor(t,e,i){if(super(),this.id=t.id,this.type=t.type,this._globalState=i,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=function(t,e){return new ra(t,e)}(this.visibility,i),"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=mn(t.filter,i)),e.layout&&(this._unevaluatedLayout=new La(e.layout,i)),e.paint)){this._transitionablePaint=new Ba(e.paint,i);for(const e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(const e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Aa(e.paint)}}setFilter(t){this.filter=t,this._featureFilter=mn(t,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){var e;if("visibility"===t)return this.visibility;if(null===(e=this._transitionablePaint)||void 0===e?void 0:e.hasProperty(t))throw new Error(t+qa);if(!this._unevaluatedLayout)throw new Error(`Cannot get layout property "${t}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){const t=new Set;for(const e of this._visibilityExpression.getGlobalStateRefs())t.add(e);if(this._unevaluatedLayout)for(const e in this._unevaluatedLayout._values){const i=this._unevaluatedLayout._values[e];for(const e of i.getGlobalStateRefs())t.add(e)}for(const e of this._featureFilter.getGlobalStateRefs())t.add(e);return t}getPaintAffectingGlobalStateRefs(){var t;const e=new globalThis.Map;if(this._transitionablePaint)for(const i in this._transitionablePaint._values){const r=this._transitionablePaint._values[i].value;for(const n of r.getGlobalStateRefs()){const a=null!==(t=e.get(n))&&void 0!==t?t:[];a.push({name:i,value:r.value}),e.set(n,a)}}return e}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,e,i={}){var r;if("visibility"===t)return this.visibility=e,this._visibilityExpression.setValue(e),void this.recalculateVisibility();(null===(r=this._transitionablePaint)||void 0===r?void 0:r.hasProperty(t))?this.fire(new yt(new Error(t+qa))):null!=e&&this._validate(ca,`layers.${this.id}.layout.${t}`,t,e,i)||this._unevaluatedLayout.setValue(t,e)}getPaintProperty(t){var e,i;if(t.endsWith(Ia)){const i=t.slice(0,-11);if("visibility"===i||(null===(e=this._unevaluatedLayout)||void 0===e?void 0:e.hasProperty(i)))throw new Error(t+Ka);return this._transitionablePaint.getTransition(i)}if("visibility"===t||(null===(i=this._unevaluatedLayout)||void 0===i?void 0:i.hasProperty(t)))throw new Error(t+Ka);return this._transitionablePaint.getValue(t)}setPaintProperty(t,e,i={}){var r;if("visibility"===t||(null===(r=this._unevaluatedLayout)||void 0===r?void 0:r.hasProperty(t)))return this.fire(new yt(new Error(t+Ka))),!1;if(null!=e&&this._validate(la,`layers.${this.id}.paint.${t}`,t,e,i))return!1;if(t.endsWith(Ia))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{const i=this._transitionablePaint._values[t],r="cross-faded-data-driven"===i.property.specification["property-type"],n=i.value.isDataDriven(),a=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);const o=this._transitionablePaint._values[t].value;return o.isDataDriven()||n||r||this._handleOverridablePaintPropertyUpdate(t,a,o)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,i){return!1}isHidden(t=this.minzoom,e=!1){return!!(this.minzoom&&t<(e?Math.floor(this.minzoom):this.minzoom))||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this._evaluatedVisibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){var t,e;const i={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:null===(t=this._unevaluatedLayout)||void 0===t?void 0:t.serialize(),paint:null===(e=this._transitionablePaint)||void 0===e?void 0:e.serialize()};return this.visibility&&(i.layout=i.layout||{},i.layout.visibility=this.visibility),O(i,(t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length))}_validate(t,e,i,r,n={}){return!1!==(null==n?void 0:n.validate)&&ha(this,t.call(aa,{key:e,layerType:this.type,objectKey:i,value:r,styleSpec:bt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof ja&&jr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}}let to;var eo={get paint(){return to=to||new Ha({"raster-opacity":new Ga(bt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ga(bt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ga(bt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ga(bt.paint_raster["raster-brightness-max"]),"raster-saturation":new Ga(bt.paint_raster["raster-saturation"]),"raster-contrast":new Ga(bt.paint_raster["raster-contrast"]),resampling:new Ga(bt.paint_raster.resampling),"raster-resampling":new Ga(bt.paint_raster["raster-resampling"]),"raster-fade-duration":new Ga(bt.paint_raster["raster-fade-duration"])})}};class io extends $a{constructor(t,e){super(t,eo,e)}}const ro={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class no{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ao{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_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(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}}function oo(t,e=1){let i=0,r=0;return{members:t.map(t=>{const n=ro[t.type].BYTES_PER_ELEMENT,a=i=so(i,Math.max(e,n)),o=t.components||1;return r=Math.max(r,n),i+=n*o,{name:t.name,type:t.type,components:o,offset:a}}),size:so(i,Math.max(r,e)),alignment:e}}function so(t,e){return Math.ceil(t/e)*e}class lo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.int16[r+0]=e,this.int16[r+1]=i,t}}lo.prototype.bytesPerElement=4,pa("StructArrayLayout2i4",lo);class co extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.int16[n+0]=e,this.int16[n+1]=i,this.int16[n+2]=r,t}}co.prototype.bytesPerElement=6,pa("StructArrayLayout3i6",co);class ho extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)}emplace(t,e,i,r,n){const a=4*t;return this.int16[a+0]=e,this.int16[a+1]=i,this.int16[a+2]=r,this.int16[a+3]=n,t}}ho.prototype.bytesPerElement=8,pa("StructArrayLayout4i8",ho);class uo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,r,n,a)}emplace(t,e,i,r,n,a,o){const s=6*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=a,this.int16[s+5]=o,t}}uo.prototype.bytesPerElement=12,pa("StructArrayLayout2i4i12",uo);class po extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,r,n,a)}emplace(t,e,i,r,n,a,o){const s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.uint8[l+4]=r,this.uint8[l+5]=n,this.uint8[l+6]=a,this.uint8[l+7]=o,t}}po.prototype.bytesPerElement=8,pa("StructArrayLayout2i4ub8",po);class mo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.float32[r+0]=e,this.float32[r+1]=i,t}}mo.prototype.bytesPerElement=8,pa("StructArrayLayout2f8",mo);class fo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,a,o,s,l,c){const h=this.length;return this.resize(h+1),this.emplace(h,t,e,i,r,n,a,o,s,l,c)}emplace(t,e,i,r,n,a,o,s,l,c,h){const u=10*t;return this.uint16[u+0]=e,this.uint16[u+1]=i,this.uint16[u+2]=r,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=o,this.uint16[u+6]=s,this.uint16[u+7]=l,this.uint16[u+8]=c,this.uint16[u+9]=h,t}}fo.prototype.bytesPerElement=20,pa("StructArrayLayout10ui20",fo);class go extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,a,o,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,e,i,r,n,a,o,s)}emplace(t,e,i,r,n,a,o,s,l){const c=8*t;return this.uint16[c+0]=e,this.uint16[c+1]=i,this.uint16[c+2]=r,this.uint16[c+3]=n,this.uint16[c+4]=a,this.uint16[c+5]=o,this.uint16[c+6]=s,this.uint16[c+7]=l,t}}go.prototype.bytesPerElement=16,pa("StructArrayLayout8ui16",go);class _o extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,a,o,s,l,c,h,u){const d=this.length;return this.resize(d+1),this.emplace(d,t,e,i,r,n,a,o,s,l,c,h,u)}emplace(t,e,i,r,n,a,o,s,l,c,h,u,d){const p=12*t;return this.int16[p+0]=e,this.int16[p+1]=i,this.int16[p+2]=r,this.int16[p+3]=n,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=h,this.int16[p+10]=u,this.int16[p+11]=d,t}}_o.prototype.bytesPerElement=24,pa("StructArrayLayout4i4ui4i24",_o);class yo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.float32[n+0]=e,this.float32[n+1]=i,this.float32[n+2]=r,t}}yo.prototype.bytesPerElement=12,pa("StructArrayLayout3f12",yo);class xo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}xo.prototype.bytesPerElement=4,pa("StructArrayLayout1ul4",xo);class bo extends ao{_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(t,e,i,r,n,a,o,s,l){const c=this.length;return this.resize(c+1),this.emplace(c,t,e,i,r,n,a,o,s,l)}emplace(t,e,i,r,n,a,o,s,l,c){const h=10*t,u=5*t;return this.int16[h+0]=e,this.int16[h+1]=i,this.int16[h+2]=r,this.int16[h+3]=n,this.int16[h+4]=a,this.int16[h+5]=o,this.uint32[u+3]=s,this.uint16[h+8]=l,this.uint16[h+9]=c,t}}bo.prototype.bytesPerElement=20,pa("StructArrayLayout6i1ul2ui20",bo);class vo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,r,n,a)}emplace(t,e,i,r,n,a,o){const s=6*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=a,this.int16[s+5]=o,t}}vo.prototype.bytesPerElement=12,pa("StructArrayLayout2i2i2i12",vo);class To extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n)}emplace(t,e,i,r,n,a){const o=4*t,s=8*t;return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=r,this.int16[s+6]=n,this.int16[s+7]=a,t}}To.prototype.bytesPerElement=16,pa("StructArrayLayout2f1f2i16",To);class wo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,a){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,r,n,a)}emplace(t,e,i,r,n,a,o){const s=16*t,l=4*t,c=8*t;return this.uint8[s+0]=e,this.uint8[s+1]=i,this.float32[l+1]=r,this.float32[l+2]=n,this.int16[c+6]=a,this.int16[c+7]=o,t}}wo.prototype.bytesPerElement=16,pa("StructArrayLayout2ub2f2i16",wo);class Vo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.uint16[n+0]=e,this.uint16[n+1]=i,this.uint16[n+2]=r,t}}Vo.prototype.bytesPerElement=6,pa("StructArrayLayout3ui6",Vo);class Ro extends ao{_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(t,e,i,r,n,a,o,s,l,c,h,u,d,p,m,f,g){const _=this.length;return this.resize(_+1),this.emplace(_,t,e,i,r,n,a,o,s,l,c,h,u,d,p,m,f,g)}emplace(t,e,i,r,n,a,o,s,l,c,h,u,d,p,m,f,g,_){const y=24*t,x=12*t,b=48*t;return this.int16[y+0]=e,this.int16[y+1]=i,this.uint16[y+2]=r,this.uint16[y+3]=n,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[y+10]=l,this.uint16[y+11]=c,this.uint16[y+12]=h,this.float32[x+7]=u,this.float32[x+8]=d,this.uint8[b+36]=p,this.uint8[b+37]=m,this.uint8[b+38]=f,this.uint32[x+10]=g,this.int16[y+22]=_,t}}Ro.prototype.bytesPerElement=48,pa("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ro);class Mo extends ao{_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(t,e,i,r,n,a,o,s,l,c,h,u,d,p,m,f,g,_,y,x,b,v,T,w,V,R,M,U){const S=this.length;return this.resize(S+1),this.emplace(S,t,e,i,r,n,a,o,s,l,c,h,u,d,p,m,f,g,_,y,x,b,v,T,w,V,R,M,U)}emplace(t,e,i,r,n,a,o,s,l,c,h,u,d,p,m,f,g,_,y,x,b,v,T,w,V,R,M,U,S){const N=32*t,E=16*t;return this.int16[N+0]=e,this.int16[N+1]=i,this.int16[N+2]=r,this.int16[N+3]=n,this.int16[N+4]=a,this.int16[N+5]=o,this.int16[N+6]=s,this.int16[N+7]=l,this.uint16[N+8]=c,this.uint16[N+9]=h,this.uint16[N+10]=u,this.uint16[N+11]=d,this.uint16[N+12]=p,this.uint16[N+13]=m,this.uint16[N+14]=f,this.uint16[N+15]=g,this.uint16[N+16]=_,this.uint16[N+17]=y,this.uint16[N+18]=x,this.uint16[N+19]=b,this.uint16[N+20]=v,this.uint16[N+21]=T,this.uint16[N+22]=w,this.uint32[E+12]=V,this.float32[E+13]=R,this.float32[E+14]=M,this.uint16[N+30]=U,this.uint16[N+31]=S,t}}Mo.prototype.bytesPerElement=64,pa("StructArrayLayout8i15ui1ul2f2ui64",Mo);class Uo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}Uo.prototype.bytesPerElement=4,pa("StructArrayLayout1f4",Uo);class So extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.uint16[6*t+0]=e,this.float32[n+1]=i,this.float32[n+2]=r,t}}So.prototype.bytesPerElement=12,pa("StructArrayLayout1ui2f12",So);class No extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=4*t;return this.uint32[2*t+0]=e,this.uint16[n+2]=i,this.uint16[n+3]=r,t}}No.prototype.bytesPerElement=8,pa("StructArrayLayout1ul2ui8",No);class Eo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.uint16[r+0]=e,this.uint16[r+1]=i,t}}Eo.prototype.bytesPerElement=4,pa("StructArrayLayout2ui4",Eo);class Fo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}Fo.prototype.bytesPerElement=2,pa("StructArrayLayout1ui2",Fo);class Zo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)}emplace(t,e,i,r,n){const a=4*t;return this.float32[a+0]=e,this.float32[a+1]=i,this.float32[a+2]=r,this.float32[a+3]=n,t}}Zo.prototype.bytesPerElement=16,pa("StructArrayLayout4f16",Zo);class ko extends no{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 i(this.anchorPointX,this.anchorPointY)}}ko.prototype.size=20;class zo extends bo{get(t){return new ko(this,t)}}pa("CollisionBoxArray",zo);class Wo extends no{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(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Wo.prototype.size=48;class Io extends Ro{get(t){return new Wo(this,t)}}pa("PlacedSymbolArray",Io);class Do extends no{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(t){this._structArray.uint32[this._pos4+12]=t}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]}}Do.prototype.size=64;class Co extends Mo{get(t){return new Do(this,t)}}pa("SymbolInstanceArray",Co);class Bo extends Uo{getoffsetX(t){return this.float32[1*t+0]}}pa("GlyphOffsetArray",Bo);class Po extends co{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}pa("SymbolLineVertexArray",Po);class Oo extends no{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]}}Oo.prototype.size=12;class Lo extends So{get(t){return new Oo(this,t)}}pa("TextAnchorOffsetArray",Lo);class jo extends no{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]}}jo.prototype.size=8;class Ao extends No{get(t){return new jo(this,t)}}pa("FeatureIndexArray",Ao);class Go extends lo{}class Yo extends lo{}class Qo extends lo{}class Jo extends uo{}class Xo extends po{}class Ho extends mo{}class qo extends fo{}class Ko extends go{}class $o extends _o{}class ts extends yo{}class es extends xo{}class is extends vo{}class rs extends wo{}class ns extends Vo{}class as extends Eo{}const os=oo([{name:"a_pos",components:2,type:"Int16"}],4),{members:ss}=os;class ls{constructor(t=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=t}prepareSegment(t,e,i,r){const n=this.segments[this.segments.length-1];return t>ls.MAX_VERTEX_ARRAY_LENGTH&&A(`Max vertices per segment is ${ls.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${ls.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!n||n.vertexLength+t>ls.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==r?this.createNewSegment(e,i,r):n}createNewSegment(t,e,i){const r={vertexOffset:t.length,primitiveOffset:e.length,vertexLength:0,primitiveLength:0,vaos:{}};return void 0!==i&&(r.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(r),r}getOrCreateLatestSegment(t,e,i){return this.prepareSegment(0,t,e,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(const t of this.segments)for(const e in t.vaos)t.vaos[e].destroy()}static simpleSegment(t,e,i,r){return new ls([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:r,vaos:{},sortKey:0}])}}function cs(t,e){return 256*(t=I(Math.floor(t),0,255))+I(Math.floor(e),0,255)}ls.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,pa("SegmentVector",ls);const hs=oo([{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"}]),us=oo([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var ds,ps,ms,fs={exports:{}},gs={exports:{}},_s={exports:{}},ys=function(){if(ms)return fs.exports;ms=1;var t=(ds||(ds=1,gs.exports=function(t,e){var i,r,n,a,o,s,l,c;for(r=t.length-(i=3&t.length),n=e,o=3432918353,s=461845907,c=0;c<r;)l=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,n=27492+(65535&(a=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return n^=t.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0}),gs.exports),e=(ps||(ps=1,_s.exports=function(t,e){for(var i,r=t.length,n=e^r,a=0;r>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(i>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),r-=4,++a;switch(r){case 3:n^=(255&t.charCodeAt(a+2))<<16;case 2:n^=(255&t.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(a)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}),_s.exports);return fs.exports=t,fs.exports.murmur3=t,fs.exports.murmur2=e,fs.exports}(),xs=r(ys);class bs{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,e,i,r){this.ids.push(vs(t)),this.positions.push(e,i,r)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const e=vs(t);let i=0,r=this.ids.length-1;for(;i<r;){const t=i+r>>1;this.ids[t]>=e?r=t:i=t+1}const n=[];for(;this.ids[i]===e;)n.push({index:this.positions[3*i],start:this.positions[3*i+1],end:this.positions[3*i+2]}),i++;return n}static serialize(t,e){const i=new Float64Array(t.ids),r=new Uint32Array(t.positions);return Ts(i,r,0,i.length-1),e&&e.push(i.buffer,r.buffer),{ids:i,positions:r}}static deserialize(t){const e=new bs;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e}}function vs(t){const e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:xs(String(t))}function Ts(t,e,i,r){for(;i<r;){const n=t[i+r>>1];let a=i-1,o=r+1;for(;;){do{a++}while(t[a]<n);do{o--}while(t[o]>n);if(a>=o)break;ws(t,a,o),ws(e,3*a,3*o),ws(e,3*a+1,3*o+1),ws(e,3*a+2,3*o+2)}o-i<r-o?(Ts(t,e,i,o),i=o+1):(Ts(t,e,o+1,r),r=o)}}function ws(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}pa("FeaturePositionMap",bs);class Vs{constructor(t,e){this.gl=t.gl,this.location=e}}class Rs extends Vs{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class Ms extends Vs{constructor(t,e){super(t,e),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class Us extends Vs{constructor(t,e){super(t,e),this.current=Se.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}const Ss=new Float32Array(16);function Ns(t){return[cs(255*t.r,255*t.g),cs(255*t.b,255*t.a)]}class Es{constructor(t,e,i){this.value=t,this.uniformNames=e.map(t=>`u_${t}`),this.type=i}setUniform(t,e,i){t.set(i.constantOr(this.value))}getBinding(t,e,i){return"color"===this.type?new Us(t,e):new Rs(t,e)}}class Fs{constructor(t,e){this.uniformNames=e.map(t=>`u_${t}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,e){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,e.y,e.height,e.width]}setUniform(t,e,i,r){let n=null;"u_pattern_to"===r?n=this.patternTo:"u_pattern_from"===r?n=this.patternFrom:"u_dasharray_to"===r?n=this.dashTo:"u_dasharray_from"===r?n=this.dashFrom:"u_pixel_ratio_to"===r?n=this.pixelRatioTo:"u_pixel_ratio_from"===r&&(n=this.pixelRatioFrom),null!==n&&t.set(n)}getBinding(t,e,i){return i.startsWith("u_pattern")||i.startsWith("u_dasharray_")?new Ms(t,e):new Rs(t,e)}}class Zs{constructor(t,e,i,r){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=e.map(t=>({name:`a_${t}`,type:"Float32",components:"color"===i?2:1,offset:0})),this.paintVertexArray=new r}populatePaintArray(t,e,i){const r=this.paintVertexArray.length,n=this.expression.evaluate(new za(0,i),e,{},i.canonical,[],i.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(r,t,n)}updatePaintArray(t,e,i,r,n){const a=this.expression.evaluate(new za(0,n),i,r);this._setPaintValue(t,e,a)}_setPaintValue(t,e,i){if("color"===this.type){const r=Ns(i);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r[0],r[1])}else{for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(t){var e;(null===(e=this.paintVertexArray)||void 0===e?void 0:e.arrayBuffer.byteLength)&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class ks{constructor(t,e,i,r,n,a){this.expression=t,this.uniformNames=e.map(t=>`u_${t}_t`),this.type=i,this.useIntegerZoom=r,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map(t=>({name:`a_${t}`,type:"Float32",components:"color"===i?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,e,i){const r=this.expression.evaluate(new za(this.zoom,i),e,{},i.canonical,[],i.formattedSection),n=this.expression.evaluate(new za(this.zoom+1,i),e,{},i.canonical,[],i.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,r,n)}updatePaintArray(t,e,i,r,n){const a=this.expression.evaluate(new za(this.zoom,n),i,r),o=this.expression.evaluate(new za(this.zoom+1,n),i,r);this._setPaintValue(t,e,a,o)}_setPaintValue(t,e,i,r){if("color"===this.type){const n=Ns(i),a=Ns(r);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1],a[0],a[1])}else{for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,i,r);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(r))}}upload(t){var e;(null===(e=this.paintVertexArray)||void 0===e?void 0:e.arrayBuffer.byteLength)&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e){const i=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,r=I(this.expression.interpolationFactor(i,this.zoom,this.zoom+1),0,1);t.set(r)}getBinding(t,e,i){return new Rs(t,e)}}class zs{constructor(t,e,i,r,n,a){this.expression=t,this.type=e,this.useIntegerZoom=i,this.zoom=r,this.layerId=a,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(t,e,i){const r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(r,t,this.getPositionIds(e),i)}updatePaintArray(t,e,i,r,n){this._setPaintValues(t,e,this.getPositionIds(i),n)}_setPaintValues(t,e,i,r){const n=this.getPositions(r);if(!n||!i)return;const a=n[i.min],o=n[i.mid],s=n[i.max];if(a&&o&&s)for(let i=t;i<e;i++)this.emplace(this.zoomInPaintVertexArray,i,o,a),this.emplace(this.zoomOutPaintVertexArray,i,o,s)}upload(t){var e,i;if((null===(e=this.zoomInPaintVertexArray)||void 0===e?void 0:e.arrayBuffer.byteLength)&&(null===(i=this.zoomOutPaintVertexArray)||void 0===i?void 0:i.arrayBuffer.byteLength)){const e=this.getVertexAttributes();this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,e,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,e,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Ws extends zs{getPositions(t){return t.imagePositions}getPositionIds(t){return t.patterns&&t.patterns[this.layerId]}getVertexAttributes(){return hs.members}emplace(t,e,i,r){t.emplace(e,i.tlbr[0],i.tlbr[1],i.tlbr[2],i.tlbr[3],r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],i.pixelRatio,r.pixelRatio)}}class Is extends zs{getPositions(t){return t.dashPositions}getPositionIds(t){return t.dashes&&t.dashes[this.layerId]}getVertexAttributes(){return us.members}emplace(t,e,i,r){t.emplace(e,0,i.y,i.height,i.width,0,r.y,r.height,r.width)}}class Ds{constructor(t,e,i){this.binders={},this._buffers=[];const r=[];for(const n in t.paint._values){if(!i(n))continue;const a=t.paint.get(n);if(!(a instanceof ja&&jr(a.property.specification)))continue;const o=Bs(n,t.type),s=a.value,l=a.property.specification.type,c=a.property.useIntegerZoom,h=a.property.specification["property-type"],u="cross-faded"===h||"cross-faded-data-driven"===h;if("constant"===s.kind)this.binders[n]=u?new Fs(s.value,o):new Es(s.value,o,l),r.push(`/u_${n}`);else if("source"===s.kind||u){const i=Ps(n,l,"source");this.binders[n]=u?"line-dasharray"===n?new Is(s,l,c,e,i,t.id):new Ws(s,l,c,e,i,t.id):new Zs(s,o,l,i),r.push(`/a_${n}`)}else{const t=Ps(n,l,"composite");this.binders[n]=new ks(s,o,l,c,e,t),r.push(`/z_${n}`)}}this.cacheKey=r.sort().join("")}getMaxValue(t){const e=this.binders[t];return e instanceof Zs||e instanceof ks?e.maxValue:0}populatePaintArrays(t,e,i){for(const r in this.binders){const n=this.binders[r];(n instanceof Zs||n instanceof ks||n instanceof zs)&&n.populatePaintArray(t,e,i)}}setConstantPatternPositions(t,e){for(const i in this.binders){const r=this.binders[i];r instanceof Fs&&r.setConstantPatternPositions(t,e)}}setConstantDashPositions(t,e){for(const i in this.binders){const r=this.binders[i];r instanceof Fs&&r.setConstantDashPositions(t,e)}}updatePaintArrays(t,e,i,r,n){let a=!1;for(const o in t){const s=e.getPositions(o);for(const e of s){const s=i.feature(e.index);for(const i in this.binders){const l=this.binders[i];if((l instanceof Zs||l instanceof ks||l instanceof zs)&&!0===l.expression.isStateDependent){const c=r.paint.get(i);l.expression=c.value,l.updatePaintArray(e.start,e.end,s,t[o],n),a=!0}}}}return a}defines(){const t=[];for(const e in this.binders){const i=this.binders[e];(i instanceof Es||i instanceof Fs)&&t.push(...i.uniformNames.map(t=>`#define HAS_UNIFORM_${t}`))}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof Zs||i instanceof ks)for(let e=0;e<i.paintVertexAttributes.length;e++)t.push(i.paintVertexAttributes[e].name);else if(i instanceof zs){const e=i.getVertexAttributes();for(const i of e)t.push(i.name)}}return t}getBinderUniforms(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof Es||i instanceof Fs||i instanceof ks)for(const e of i.uniformNames)t.push(e)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){const i=[];for(const r in this.binders){const n=this.binders[r];if(n instanceof Es||n instanceof Fs||n instanceof ks)for(const a of n.uniformNames)if(e[a]){const o=n.getBinding(t,e[a],a);i.push({name:a,property:r,binding:o})}}return i}setUniforms(t,e,i,r){for(const{name:t,property:n,binding:a}of e)this.binders[n].setUniform(a,r,i.get(n),t)}updatePaintBuffers(t){this._buffers=[];for(const e in this.binders){const i=this.binders[e];if(t&&i instanceof zs){const e=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;e&&this._buffers.push(e)}else(i instanceof Zs||i instanceof ks)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(t){for(const e in this.binders){const i=this.binders[e];(i instanceof Zs||i instanceof ks||i instanceof zs)&&i.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const e=this.binders[t];(e instanceof Zs||e instanceof ks||e instanceof zs)&&e.destroy()}}}class Cs{constructor(t,e,i=()=>!0){this.programConfigurations={};for(const r of t)this.programConfigurations[r.id]=new Ds(r,e,i);this.needsUpload=!1,this._featureMap=new bs,this._bufferOffset=0}populatePaintArrays(t,e,i,r){for(const i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(t,e,r);void 0!==e.id&&this._featureMap.add(e.id,i,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,i,r){for(const n of i)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(t,this._featureMap,e,n,r)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function Bs(t,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-dasharray":["dasharray_to","dasharray_from"],"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"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function Ps(t,e,i){const r={color:{source:mo,composite:Zo},number:{source:Uo,composite:mo}},n=function(t){return{"line-pattern":{source:qo,composite:qo},"fill-pattern":{source:qo,composite:qo},"fill-extrusion-pattern":{source:qo,composite:qo},"line-dasharray":{source:Ko,composite:Ko}}[t]}(t);return n&&n[i]||r[e][i]}pa("ConstantBinder",Es),pa("CrossFadedConstantBinder",Fs),pa("SourceExpressionBinder",Zs),pa("CrossFadedPatternBinder",Ws),pa("CrossFadedDasharrayBinder",Is),pa("CompositeExpressionBinder",ks),pa("ProgramConfiguration",Ds,{omit:["_buffers"]}),pa("ProgramConfigurationSet",Cs);const Os=Math.pow(2,14)-1,Ls=-Os-1;function js(t){const e=N/t.extent,i=t.loadGeometry();for(let t=0;t<i.length;t++){const r=i[t];for(let t=0;t<r.length;t++){const i=r[t],n=Math.round(i.x*e),a=Math.round(i.y*e);i.x=I(n,Ls,Os),i.y=I(a,Ls,Os),(n<i.x||n>i.x+1||a<i.y||a>i.y+1)&&A("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return i}function As(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?js(t):[]}}const Gs=-32768;function Ys(t,e,i,r,n){t.emplaceBack(Gs+8*e+r,Gs+8*i+n)}class Qs{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Yo,this.indexArray=new ns,this.segments=new ls,this.programConfigurations=new Cs(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,e,i){const r=this.layers[0],n=[];let a=null,o=!1,s="heatmap"===r.type;if("circle"===r.type){const t=r;a=t.layout.get("circle-sort-key"),o=!a.isConstant(),s=s||"map"===t.paint.get("circle-pitch-alignment")}const l=s?e.subdivisionGranularity.circle:1;for(const{feature:e,id:r,index:s,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=As(e,t);if(!this.layers[0]._featureFilter.filter(new za(this.zoom),c,i))continue;const h=o?a.evaluate(c,{},i):void 0,u={id:r,properties:e.properties,type:e.type,sourceLayerIndex:l,index:s,geometry:t?c.geometry:js(e),patterns:{},sortKey:h};n.push(u)}o&&n.sort((t,e)=>t.sortKey-e.sortKey);for(const r of n){const{geometry:n,index:a,sourceLayerIndex:o}=r,s=t[a].feature;this.addFeature(r,n,a,i,l),e.featureIndex.insert(s,n,a,o,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:i})}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ss),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,i,r,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}const o=a.length;for(const i of e)for(const e of i){const i=e.x,r=e.y;if(i<0||i>=N||r<0||r>=N)continue;const n=this.segments.prepareSegment(o*o,this.layoutVertexArray,this.indexArray,t.sortKey),s=n.vertexLength;for(let t=0;t<o;t++)for(let e=0;e<o;e++)Ys(this.layoutVertexArray,i,r,a[e],a[t]);for(let t=0;t<o-1;t++)for(let e=0;e<o-1;e++){const i=s+t*o+e,r=s+(t+1)*o+e;this.indexArray.emplaceBack(i,r+1,i+1),this.indexArray.emplaceBack(i,r,r+1)}n.vertexLength+=o*o,n.primitiveLength+=(o-1)*(o-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:{},canonical:r})}}function Js(t,e){for(let i=0;i<t.length;i++)if(rl(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(rl(t,e[i]))return!0;return!!Ks(t,e)}function Xs(t,e,i){return!!rl(t,e)||!!tl(e,t,i)}function Hs(t,e){if(1===t.length)return il(e,t[0]);for(let i=0;i<e.length;i++){const r=e[i];for(let e=0;e<r.length;e++)if(rl(t,r[e]))return!0}for(let i=0;i<t.length;i++)if(il(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(Ks(t,e[i]))return!0;return!1}function qs(t,e,i){if(t.length>1){if(Ks(t,e))return!0;for(let r=0;r<e.length;r++)if(tl(e[r],t,i))return!0}for(let r=0;r<t.length;r++)if(tl(t[r],e,i))return!0;return!1}function Ks(t,e){if(0===t.length||0===e.length)return!1;for(let i=0;i<t.length-1;i++){const r=t[i],n=t[i+1];for(let t=0;t<e.length-1;t++)if($s(r,n,e[t],e[t+1]))return!0}return!1}function $s(t,e,i,r){return G(t,i,r)!==G(e,i,r)&&G(t,e,i)!==G(t,e,r)}function tl(t,e,i){const r=i*i;if(1===e.length)return t.distSqr(e[0])<r;for(let i=1;i<e.length;i++)if(el(t,e[i-1],e[i])<r)return!0;return!1}function el(t,e,i){const r=e.distSqr(i);if(0===r)return t.distSqr(e);const n=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/r;return t.distSqr(n<0?e:n>1?i:i.sub(e)._mult(n)._add(e))}function il(t,e){let i,r,n,a=!1;for(let o=0;o<t.length;o++){i=t[o];for(let t=0,o=i.length-1;t<i.length;o=t++)r=i[t],n=i[o],r.y>e.y!=n.y>e.y&&e.x<(n.x-r.x)*(e.y-r.y)/(n.y-r.y)+r.x&&(a=!a)}return a}function rl(t,e){let i=!1;for(let r=0,n=t.length-1;r<t.length;n=r++){const a=t[r],o=t[n];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(i=!i)}return i}function nl(t,e,i){const r=i[0],n=i[2];if(t.x<r.x&&e.x<r.x||t.x>n.x&&e.x>n.x||t.y<r.y&&e.y<r.y||t.y>n.y&&e.y>n.y)return!1;const a=G(t,e,i[0]);return a!==G(t,e,i[1])||a!==G(t,e,i[2])||a!==G(t,e,i[3])}function al(t,e,i){const r=e.paint.get(t).value;return"constant"===r.kind?r.value:i.programConfigurations.get(e.id).getMaxValue(t)}function ol(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function sl(t,e,r,n,a){if(!e[0]&&!e[1])return t;const o=i.convert(e)._mult(a);"viewport"===r&&o._rotate(-n);const s=[];for(let e=0;e<t.length;e++)s.push(t[e].sub(o));return s}function ll(t){const e=[];for(let i=0;i<t.length;i++){const r=t[i],n=e.at(-1);(0===i||n&&!r.equals(n))&&e.push(r)}return e}function cl({queryGeometry:t,size:e},i){return Xs(t,i,e)}function hl({queryGeometry:t,size:e,transform:i,unwrappedTileID:r,getElevation:n},a){return Xs(t,a,e*(i.projectTileCoordinates(a.x,a.y,r,n).signedDistanceFromCamera/i.cameraToCenterDistance))}function ul({queryGeometry:t,size:e,transform:i,unwrappedTileID:r,getElevation:n},a){const o=i.projectTileCoordinates(a.x,a.y,r,n).signedDistanceFromCamera,s=e*(i.cameraToCenterDistance/o);return Xs(t,ml(a,i,r,n),s)}function dl({queryGeometry:t,size:e,transform:i,unwrappedTileID:r,getElevation:n},a){return Xs(t,ml(a,i,r,n),e)}function pl({queryGeometry:t,size:e,transform:i,unwrappedTileID:r,getElevation:n,pitchAlignment:a="map",pitchScale:o="map"},s){const l="map"===a?"map"===o?cl:hl:"map"===o?ul:dl,c={queryGeometry:t,size:e,transform:i,unwrappedTileID:r,getElevation:n};for(const t of s)for(const e of t)if(l(c,e))return!0;return!1}function ml(t,e,r,n){const a=e.projectTileCoordinates(t.x,t.y,r,n).point;return new i((.5*a.x+.5)*e.width,(.5*-a.y+.5)*e.height)}let fl,gl;pa("CircleBucket",Qs,{omit:["layers"]});var _l={get paint(){return gl=gl||new Ha({"circle-radius":new Ya(bt.paint_circle["circle-radius"]),"circle-color":new Ya(bt.paint_circle["circle-color"]),"circle-blur":new Ya(bt.paint_circle["circle-blur"]),"circle-opacity":new Ya(bt.paint_circle["circle-opacity"]),"circle-translate":new Ga(bt.paint_circle["circle-translate"]),"circle-translate-anchor":new Ga(bt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ga(bt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ga(bt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ya(bt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ya(bt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ya(bt.paint_circle["circle-stroke-opacity"])})},get layout(){return fl=fl||new Ha({"circle-sort-key":new Ya(bt.layout_circle["circle-sort-key"])})}};class yl extends $a{constructor(t,e){super(t,_l,e)}createBucket(t){return new Qs(t)}queryRadius(t){const e=t;return al("circle-radius",this,e)+al("circle-stroke-width",this,e)+ol(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:i,geometry:r,transform:n,pixelsToTileUnits:a,unwrappedTileID:o,getElevation:s}){const l=sl(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-n.bearingInRadians,a),c=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i),h=this.paint.get("circle-pitch-scale"),u=this.paint.get("circle-pitch-alignment");let d,p;return"map"===u?(d=l,p=c*a):(d=function(t,e,i,r){return t.map(t=>ml(t,e,i,r))}(l,n,o,s),p=c),pl({queryGeometry:d,size:p,transform:n,unwrappedTileID:o,getElevation:s,pitchAlignment:u,pitchScale:h},r)}}class xl extends Qs{}let bl;pa("HeatmapBucket",xl,{omit:["layers"]});var vl={get paint(){return bl=bl||new Ha({"heatmap-radius":new Ya(bt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ya(bt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ga(bt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Xa(bt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ga(bt.paint_heatmap["heatmap-opacity"])})}};function Tl(t,{width:e,height:i},r,n){if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*i*r)throw new RangeError(`mismatched image size. expected: ${n.length} but got: ${e*i*r}`)}else n=new Uint8Array(e*i*r);return t.width=e,t.height=i,t.data=n,t}function wl(t,{width:e,height:i},r){if(e===t.width&&i===t.height)return;const n=Tl({},{width:e,height:i},r);Vl(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,i)},r),t.width=e,t.height=i,t.data=n.data}function Vl(t,e,i,r,n,a){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");const o=t.data,s=e.data;if(o===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<n.height;l++){const c=((i.y+l)*t.width+i.x)*a,h=((r.y+l)*e.width+r.x)*a;for(let t=0;t<n.width*a;t++)s[h+t]=o[c+t]}return e}class Rl{constructor(t,e){Tl(this,t,1,e)}resize(t){wl(this,t,1)}clone(){return new Rl({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,r,n){Vl(t,e,i,r,n,1)}}class Ml{constructor(t,e){Tl(this,t,4,e)}resize(t){wl(this,t,4)}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new Ml({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,r,n){Vl(t,e,i,r,n,4)}setPixel(t,e,i){const r=4*(t*this.width+e);this.data[r+0]=Math.round(255*i.r/i.a),this.data[r+1]=Math.round(255*i.g/i.a),this.data[r+2]=Math.round(255*i.b/i.a),this.data[r+3]=Math.round(255*i.a)}}function Ul(t){const e=new Uint8Array(t.length);for(let i=0;i<t.length;i+=4){const r=t[i+3];e[i+0]=Math.round(t[i+0]*r/255),e[i+1]=Math.round(t[i+1]*r/255),e[i+2]=Math.round(t[i+2]*r/255),e[i+3]=r}return e}function Sl(t){const e={},i=t.resolution||256,r=t.clips?t.clips.length:1,n=t.image||new Ml({width:i,height:r});if(Math.log(i)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${i}`);const a=(r,a,o)=>{e[t.evaluationKey]=o;const s=t.expression.evaluate(e);n.setPixel(r/4/i,a/4,s)};if(t.clips)for(let e=0,n=0;e<r;++e,n+=4*i)for(let r=0,o=0;r<i;r++,o+=4){const s=r/(i-1),{start:l,end:c}=t.clips[e];a(n,o,l*(1-s)+c*s)}else for(let t=0,e=0;t<i;t++,e+=4)a(0,e,t/(i-1));return n}pa("AlphaImage",Rl),pa("RGBAImage",Ml);const Nl="big-fb";class El extends $a{createBucket(t){return new xl(t)}constructor(t,e){super(t,vl,e),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Sl({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Nl)&&this.heatmapFbos.delete(Nl)}queryRadius(t){return al("heatmap-radius",this,t)}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:i,geometry:r,transform:n,pixelsToTileUnits:a,unwrappedTileID:o,getElevation:s}){return pl({queryGeometry:t,size:this.paint.get("heatmap-radius").evaluate(e,i)*a,transform:n,unwrappedTileID:o,getElevation:s},r)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&!this.isHidden()}}let Fl;var Zl={get paint(){return Fl=Fl||new Ha({"hillshade-illumination-direction":new Ga(bt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new Ga(bt.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new Ga(bt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ga(bt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ga(bt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ga(bt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ga(bt.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new Ga(bt.paint_hillshade["hillshade-method"]),resampling:new Ga(bt.paint_hillshade.resampling)})}};class kl extends $a{constructor(t,e){super(t,Zl,e),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,e=this.paint.get("hillshade-illumination-altitude").values,i=this.paint.get("hillshade-highlight-color").values,r=this.paint.get("hillshade-shadow-color").values;const n=Math.max(t.length,e.length,i.length,r.length);t=t.concat(Array(n-t.length).fill(t.at(-1))),e=e.concat(Array(n-e.length).fill(e.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1)));const a=e.map(tt);return{directionRadians:t.map(tt),altitudeRadians:a,shadowColor:r,highlightColor:i}}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&!this.isHidden()}}let zl;var Wl={get paint(){return zl=zl||new Ha({"color-relief-opacity":new Ga(bt["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new Xa(bt["paint_color-relief"]["color-relief-color"]),resampling:new Ga(bt["paint_color-relief"].resampling)})}};function Il(t){return"data"in t}class Dl{constructor(t,e,i,r){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(e,r)}update(t,e,i){const{width:r,height:n}=t,a=!(this.size&&this.size[0]===r&&this.size[1]===n||i),{context:o}=this,{gl:s}=o;this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1);const l=this.format===s.RGBA&&(!e||!1!==e.premultiply);if(a)this.size=[r,n],Il(t)?(o.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,l,r,n,s)):(o.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(t,s));else{const{x:e,y:a}=i||{x:0,y:0};Il(t)?(o.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,l,e,a,r,n,s)):(o.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(t,e,a,s))}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D),o.pixelStoreUnpackFlipY.setDefault(),o.pixelStoreUnpack.setDefault(),o.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,e){e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t)}_uploadRawData(t,e,i,r,n){let{data:a}=t;e&&a&&(a=Ul(a)),n.texImage2D(n.TEXTURE_2D,0,this.format,i,r,0,this.format,n.UNSIGNED_BYTE,a)}_updateDomImage(t,e,i,r){r.texSubImage2D(r.TEXTURE_2D,0,e,i,r.RGBA,r.UNSIGNED_BYTE,t)}_updateRawData(t,e,i,r,n,a,o){let{data:s}=t;e&&s&&(s=Ul(s)),o.texSubImage2D(o.TEXTURE_2D,0,i,r,n,a,o.RGBA,o.UNSIGNED_BYTE,s)}bind(t,e,i){const{context:r}=this,{gl:n}=r;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),i!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(i=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,i||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}}class Cl{constructor(t,e,i,r=1,n=1,a=1,o=0){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i))return void A(`"${i}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=e.height;const s=this.dim=e.height-2;switch(this.data=new Uint32Array(e.data.buffer),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=r,this.greenFactor=n,this.blueFactor=a,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let t=0;t<s;t++)this.data[this._idx(-1,t)]=this.data[this._idx(0,t)],this.data[this._idx(s,t)]=this.data[this._idx(s-1,t)],this.data[this._idx(t,-1)]=this.data[this._idx(t,0)],this.data[this._idx(t,s)]=this.data[this._idx(t,s-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(s,-1)]=this.data[this._idx(s-1,0)],this.data[this._idx(-1,s)]=this.data[this._idx(0,s-1)],this.data[this._idx(s,s)]=this.data[this._idx(s-1,s-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let t=0;t<s;t++)for(let e=0;e<s;e++){const i=this.get(t,e);i>this.max&&(this.max=i),i<this.min&&(this.min=i)}}get(t,e){const i=new Uint8Array(this.data.buffer),r=4*this._idx(t,e);return this.unpack(i[r],i[r+1],i[r+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError(`Out of range source coordinates for DEM data. x: ${t}, y: ${e}, dim: ${this.dim}`);return(e+1)*this.stride+(t+1)}unpack(t,e,i){return t*this.redFactor+e*this.greenFactor+i*this.blueFactor-this.baseShift}pack(t){return Bl(t,this.getUnpackVector())}getPixels(){return new Ml({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,e,i){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let r=e*this.dim,n=e*this.dim+this.dim,a=i*this.dim,o=i*this.dim+this.dim;switch(e){case-1:r=n-1;break;case 1:n=r+1}switch(i){case-1:a=o-1;break;case 1:o=a+1}const s=-e*this.dim,l=-i*this.dim;for(let e=a;e<o;e++)for(let i=r;i<n;i++)this.data[this._idx(i,e)]=t.data[this._idx(i+s,e+l)]}}function Bl(t,e){const i=e[0],r=e[1],n=e[2],a=e[3],o=Math.min(i,r,n),s=Math.round((t+a)/o);return{r:Math.floor(s*o/i)%256,g:Math.floor(s*o/r)%256,b:Math.floor(s*o/n)%256}}pa("DEMData",Cl);class Pl extends $a{constructor(t,e){super(t,Wl,e)}_createColorRamp(t){const e={elevationStops:[],colorStops:[]},i=this._transitionablePaint._values["color-relief-color"].value.expression;if(i instanceof an&&i._styleExpression.expression instanceof mi){this.colorRampExpression=i;const t=i._styleExpression.expression;e.elevationStops=t.labels,e.colorStops=[];for(const i of e.elevationStops)e.colorStops.push(t.evaluate({globals:{elevation:i}}))}if(e.elevationStops.length<1&&(e.elevationStops=[0],e.colorStops=[Se.transparent]),e.elevationStops.length<2&&(e.elevationStops.push(e.elevationStops[0]+1),e.colorStops.push(e.colorStops[0])),e.elevationStops.length<=t)return e;const r={elevationStops:[],colorStops:[]},n=(e.elevationStops.length-1)/(t-1);for(let t=0;t<e.elevationStops.length-.5;t+=n)r.elevationStops.push(e.elevationStops[Math.round(t)]),r.colorStops.push(e.colorStops[Math.round(t)]);return A(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${t}, provided: ${e.elevationStops.length}`),r}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(t,e,i){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;const r=this._createColorRamp(e),n=new Ml({width:r.colorStops.length,height:1}),a=new Ml({width:r.colorStops.length,height:1});for(let t=0;t<r.elevationStops.length;t++){const e=Bl(r.elevationStops[t],i);a.setPixel(0,t,new Se(e.r/255,e.g/255,e.b/255,1)),n.setPixel(0,t,r.colorStops[t])}return this.colorRampTextures={elevationTexture:new Dl(t,a,t.gl.RGBA),colorTexture:new Dl(t,n,t.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}}const Ol=oo([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ll}=Ol;function jl(t,e,i){const r=i.patternDependencies;let n=!1;for(const i of e){const e=i.paint.get(`${t}-pattern`);e.isConstant()||(n=!0);const a=e.constantOr(null);a&&(n=!0,r[a.to]=!0,r[a.from]=!0)}return n}function Al(t,e,i,r,n){const{zoom:a}=r,o=n.patternDependencies;for(const r of e){const e=r.paint.get(`${t}-pattern`).value;if("constant"!==e.kind){let t=e.evaluate({zoom:a-1},i,{},n.availableImages),s=e.evaluate({zoom:a},i,{},n.availableImages),l=e.evaluate({zoom:a+1},i,{},n.availableImages);t=t&&t.name?t.name:t,s=s&&s.name?s.name:s,l=l&&l.name?l.name:l,o[t]=!0,o[s]=!0,o[l]=!0,i.patterns[r.id]={min:t,mid:s,max:l}}}return i}function Gl(t,e,i,r,n){let a;if(n===function(t,e,i,r){let n=0;for(let a=e,o=i-r;a<i;a+=r)n+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return n}(t,e,i,r)>0)for(let n=e;n<i;n+=r)a=pc(n/r|0,t[n],t[n+1],a);else for(let n=i-r;n>=e;n-=r)a=pc(n/r|0,t[n],t[n+1],a);return a&&sc(a,a.next)&&(mc(a),a=a.next),a}function Yl(t,e){if(!t)return t;e||(e=t);let i,r=t;do{if(i=!1,r.steiner||!sc(r,r.next)&&0!==oc(r.prev,r,r.next))r=r.next;else{if(mc(r),r=e=r.prev,r===r.next)break;i=!0}}while(i||r!==e);return e}function Ql(t,e,i,r,n,a,o){if(!t)return;!o&&a&&function(t,e,i,r){let n=t;do{0===n.z&&(n.z=ec(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){let e,i=1;do{let r,n=t;t=null;let a=null;for(e=0;n;){e++;let o=n,s=0;for(let t=0;t<i&&(s++,o=o.nextZ,o);t++);let l=i;for(;s>0||l>0&&o;)0!==s&&(0===l||!o||n.z<=o.z)?(r=n,n=n.nextZ,s--):(r=o,o=o.nextZ,l--),a?a.nextZ=r:t=r,r.prevZ=a,a=r;n=o}a.nextZ=null,i*=2}while(e>1)}(n)}(t,r,n,a);let s=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(a?Xl(t,r,n,a):Jl(t))e.push(l.i,t.i,c.i),mc(t),t=c.next,s=c.next;else if((t=c)===s){o?1===o?Ql(t=Hl(Yl(t),e),e,i,r,n,a,2):2===o&&ql(t,e,i,r,n,a):Ql(Yl(t),e,i,r,n,a,1);break}}}function Jl(t){const e=t.prev,i=t,r=t.next;if(oc(e,i,r)>=0)return!1;const n=e.x,a=i.x,o=r.x,s=e.y,l=i.y,c=r.y,h=Math.min(n,a,o),u=Math.min(s,l,c),d=Math.max(n,a,o),p=Math.max(s,l,c);let m=r.next;for(;m!==e;){if(m.x>=h&&m.x<=d&&m.y>=u&&m.y<=p&&nc(n,s,a,l,o,c,m.x,m.y)&&oc(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Xl(t,e,i,r){const n=t.prev,a=t,o=t.next;if(oc(n,a,o)>=0)return!1;const s=n.x,l=a.x,c=o.x,h=n.y,u=a.y,d=o.y,p=Math.min(s,l,c),m=Math.min(h,u,d),f=Math.max(s,l,c),g=Math.max(h,u,d),_=ec(p,m,e,i,r),y=ec(f,g,e,i,r);let x=t.prevZ,b=t.nextZ;for(;x&&x.z>=_&&b&&b.z<=y;){if(x.x>=p&&x.x<=f&&x.y>=m&&x.y<=g&&x!==n&&x!==o&&nc(s,h,l,u,c,d,x.x,x.y)&&oc(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,b.x>=p&&b.x<=f&&b.y>=m&&b.y<=g&&b!==n&&b!==o&&nc(s,h,l,u,c,d,b.x,b.y)&&oc(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;x&&x.z>=_;){if(x.x>=p&&x.x<=f&&x.y>=m&&x.y<=g&&x!==n&&x!==o&&nc(s,h,l,u,c,d,x.x,x.y)&&oc(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;b&&b.z<=y;){if(b.x>=p&&b.x<=f&&b.y>=m&&b.y<=g&&b!==n&&b!==o&&nc(s,h,l,u,c,d,b.x,b.y)&&oc(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Hl(t,e){let i=t;do{const r=i.prev,n=i.next.next;!sc(r,n)&&lc(r,i,i.next,n)&&uc(r,n)&&uc(n,r)&&(e.push(r.i,i.i,n.i),mc(i),mc(i.next),i=t=n),i=i.next}while(i!==t);return Yl(i)}function ql(t,e,i,r,n,a){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&ac(o,t)){let s=dc(o,t);return o=Yl(o,o.next),s=Yl(s,s.next),Ql(o,e,i,r,n,a,0),void Ql(s,e,i,r,n,a,0)}t=t.next}o=o.next}while(o!==t)}function Kl(t,e){let i=t.x-e.x;return 0===i&&(i=t.y-e.y,0===i)&&(i=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)),i}function $l(t,e){const i=function(t,e){let i=e;const r=t.x,n=t.y;let a,o=-1/0;if(sc(t,i))return i;do{if(sc(t,i.next))return i.next;if(n<=i.y&&n>=i.next.y&&i.next.y!==i.y){const t=i.x+(n-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=r&&t>o&&(o=t,a=i.x<i.next.x?i:i.next,t===r))return a}i=i.next}while(i!==e);if(!a)return null;const s=a,l=a.x,c=a.y;let h=1/0;i=a;do{if(r>=i.x&&i.x>=l&&r!==i.x&&rc(n<c?r:o,n,l,c,n<c?o:r,n,i.x,i.y)){const e=Math.abs(n-i.y)/(r-i.x);uc(i,t)&&(e<h||e===h&&(i.x>a.x||i.x===a.x&&tc(a,i)))&&(a=i,h=e)}i=i.next}while(i!==s);return a}(t,e);if(!i)return e;const r=dc(i,t);return Yl(r,r.next),Yl(i,i.next)}function tc(t,e){return oc(t.prev,t,e.prev)<0&&oc(e.next,t,t.next)<0}function ec(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ic(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function rc(t,e,i,r,n,a,o,s){return(n-o)*(e-s)>=(t-o)*(a-s)&&(t-o)*(r-s)>=(i-o)*(e-s)&&(i-o)*(a-s)>=(n-o)*(r-s)}function nc(t,e,i,r,n,a,o,s){return!(t===o&&e===s)&&rc(t,e,i,r,n,a,o,s)}function ac(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&lc(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(uc(t,e)&&uc(e,t)&&function(t,e){let i=t,r=!1;const n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{i.y>a!=i.next.y>a&&i.next.y!==i.y&&n<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(oc(t.prev,t,e.prev)||oc(t,e.prev,e))||sc(t,e)&&oc(t.prev,t,t.next)>0&&oc(e.prev,e,e.next)>0)}function oc(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function sc(t,e){return t.x===e.x&&t.y===e.y}function lc(t,e,i,r){const n=hc(oc(t,e,i)),a=hc(oc(t,e,r)),o=hc(oc(i,r,t)),s=hc(oc(i,r,e));return n!==a&&o!==s||!(0!==n||!cc(t,i,e))||!(0!==a||!cc(t,r,e))||!(0!==o||!cc(i,t,r))||!(0!==s||!cc(i,e,r))}function cc(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function hc(t){return t>0?1:t<0?-1:0}function uc(t,e){return oc(t.prev,t,t.next)<0?oc(t,e,t.next)>=0&&oc(t,t.prev,e)>=0:oc(t,e,t.prev)<0||oc(t,t.next,e)<0}function dc(t,e){const i=fc(t.i,t.x,t.y),r=fc(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,a.next=r,r.prev=a,r}function pc(t,e,i,r){const n=fc(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function mc(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function fc(t,e,i){return{i:t,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class gc{constructor(t,e){if(e>t)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){return Math.max(Math.floor(this._baseZoomGranularity/(1<<t)),this._minGranularity,1)}}class _c{constructor(t){this.fill=t.fill,this.line=t.line,this.tile=t.tile,this.stencil=t.stencil,this.circle=t.circle}}_c.noSubdivision=new _c({fill:new gc(0,0),line:new gc(0,0),tile:new gc(0,0),stencil:new gc(0,0),circle:1}),pa("SubdivisionGranularityExpression",gc),pa("SubdivisionGranularitySetting",_c);const yc=-32768,xc=32767;class bc{constructor(t,e){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=t,this._granularityCellSize=N/t,this._canonical=e}_getKey(t,e){return(t+=32768)<<16|e+32768}_vertexToIndex(t,e){if(t<-32768||e<-32768||t>32767||e>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");const i=0|Math.round(t),r=0|Math.round(e),n=this._getKey(i,r);if(this._vertexDictionary.has(n))return this._vertexDictionary.get(n);const a=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,a),this._vertexBuffer.push(i,r),a}_subdivideTrianglesScanline(t){if(this._granularity<2)return function(t,e){const i=[];for(let r=0;r<e.length;r+=3){const n=e[r],a=e[r+1],o=e[r+2],s=t[2*n],l=t[2*n+1];(t[2*a]-s)*(t[2*o+1]-l)-(t[2*a+1]-l)*(t[2*o]-s)>0?(i.push(n),i.push(o),i.push(a)):(i.push(n),i.push(a),i.push(o))}return i}(this._vertexBuffer,t);const e=[],i=t.length;for(let r=0;r<i;r+=3){const i=[t[r+0],t[r+1],t[r+2]],n=[this._vertexBuffer[2*t[r+0]+0],this._vertexBuffer[2*t[r+0]+1],this._vertexBuffer[2*t[r+1]+0],this._vertexBuffer[2*t[r+1]+1],this._vertexBuffer[2*t[r+2]+0],this._vertexBuffer[2*t[r+2]+1]];let a=1/0,o=1/0,s=-1/0,l=-1/0;for(let t=0;t<3;t++){const e=n[2*t],i=n[2*t+1];a=Math.min(a,e),s=Math.max(s,e),o=Math.min(o,i),l=Math.max(l,i)}if(a===s||o===l)continue;const c=Math.floor(a/this._granularityCellSize),h=Math.ceil(s/this._granularityCellSize),u=Math.floor(o/this._granularityCellSize),d=Math.ceil(l/this._granularityCellSize);if(c!==h||u!==d)for(let t=u;t<d;t++){const r=this._scanlineGenerateVertexRingForCellRow(t,n,i);wc(this._vertexBuffer,r,e)}else e.push(...i)}return e}_scanlineGenerateVertexRingForCellRow(t,e,i){const r=t*this._granularityCellSize,n=r+this._granularityCellSize,a=[];for(let t=0;t<3;t++){const o=e[2*t],s=e[2*t+1],l=e[2*(t+1)%6],c=e[(2*(t+1)+1)%6],h=e[2*(t+2)%6],u=e[(2*(t+2)+1)%6],d=l-o,p=c-s,m=0===d,f=0===p,g=(r-s)/p,_=(n-s)/p,y=Math.min(g,_),x=Math.max(g,_);if(!f&&(y>=1||x<=0)||f&&(s<r||s>n)){c>=r&&c<=n&&a.push(i[(t+1)%3]);continue}!f&&y>0&&a.push(this._vertexToIndex(o+d*y,s+p*y));const b=o+d*Math.max(y,0),v=o+d*Math.min(x,1);m||this._generateIntraEdgeVertices(a,o,s,l,c,b,v),!f&&x<1&&a.push(this._vertexToIndex(o+d*x,s+p*x)),(f||c>=r&&c<=n)&&a.push(i[(t+1)%3]),!f&&(c<=r||c>=n)&&this._generateInterEdgeVertices(a,o,s,l,c,h,u,v,r,n)}return a}_generateIntraEdgeVertices(t,e,i,r,n,a,o){const s=r-e,l=n-i,c=0===l,h=c?Math.min(e,r):Math.min(a,o),u=c?Math.max(e,r):Math.max(a,o),d=Math.floor(h/this._granularityCellSize)+1,p=Math.ceil(u/this._granularityCellSize)-1;if(c?e<r:a<o)for(let r=d;r<=p;r++){const n=r*this._granularityCellSize;t.push(this._vertexToIndex(n,i+l*(n-e)/s))}else for(let r=p;r>=d;r--){const n=r*this._granularityCellSize;t.push(this._vertexToIndex(n,i+l*(n-e)/s))}}_generateInterEdgeVertices(t,e,i,r,n,a,o,s,l,c){const h=n-i,u=a-r,d=o-n,p=(l-n)/d,m=(c-n)/d,f=Math.min(p,m),g=Math.max(p,m),_=r+u*f;let y=Math.floor(Math.min(_,s)/this._granularityCellSize)+1,x=Math.ceil(Math.max(_,s)/this._granularityCellSize)-1,b=s<_;const v=0===d;if(v&&(o===l||o===c))return;if(v||f>=1||g<=0){const t=i-o,r=a+(e-a)*Math.min((l-o)/t,(c-o)/t);y=Math.floor(Math.min(r,s)/this._granularityCellSize)+1,x=Math.ceil(Math.max(r,s)/this._granularityCellSize)-1,b=s<r}const T=h>0?c:l;if(b)for(let e=y;e<=x;e++)t.push(this._vertexToIndex(e*this._granularityCellSize,T));else for(let e=x;e>=y;e--)t.push(this._vertexToIndex(e*this._granularityCellSize,T))}_generateOutline(t){const e=[];for(const i of t){const t=Tc(i,this._granularity,!0),r=this._pointArrayToIndices(t),n=[];for(let t=1;t<r.length;t++)n.push(r[t-1]),n.push(r[t]);e.push(n)}return e}_handlePoles(t){let e=!1,i=!1;this._canonical&&(0===this._canonical.y&&(e=!0),this._canonical.y===(1<<this._canonical.z)-1&&(i=!0)),(e||i)&&this._fillPoles(t,e,i)}_ensureNoPoleVertices(){const t=this._vertexBuffer;for(let e=0;e<t.length;e+=2){const i=t[e+1];i===yc&&(t[e+1]=-32767),i===xc&&(t[e+1]=32766)}}_generatePoleQuad(t,e,i,r,n,a){r>n!=(a===yc)?(t.push(e),t.push(i),t.push(this._vertexToIndex(r,a)),t.push(i),t.push(this._vertexToIndex(n,a)),t.push(this._vertexToIndex(r,a))):(t.push(i),t.push(e),t.push(this._vertexToIndex(r,a)),t.push(this._vertexToIndex(n,a)),t.push(i),t.push(this._vertexToIndex(r,a)))}_fillPoles(t,e,i){const r=this._vertexBuffer,n=N,a=t.length;for(let o=2;o<a;o+=3){const a=t[o-2],s=t[o-1],l=t[o],c=r[2*a],h=r[2*a+1],u=r[2*s],d=r[2*s+1],p=r[2*l],m=r[2*l+1];e&&(0===h&&0===d&&this._generatePoleQuad(t,a,s,c,u,yc),0===d&&0===m&&this._generatePoleQuad(t,s,l,u,p,yc),0===m&&0===h&&this._generatePoleQuad(t,l,a,p,c,yc)),i&&(h===n&&d===n&&this._generatePoleQuad(t,a,s,c,u,xc),d===n&&m===n&&this._generatePoleQuad(t,s,l,u,p,xc),m===n&&h===n&&this._generatePoleQuad(t,l,a,p,c,xc))}}_initializeVertices(t){for(let e=0;e<t.length;e+=2)this._vertexToIndex(t[e],t[e+1])}subdividePolygonInternal(t,e){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;const{flattened:i,holeIndices:r}=function(t){const e=[],i=[];for(const r of t)if(0!==r.length){r!==t[0]&&e.push(i.length/2);for(let t=0;t<r.length;t++)i.push(r[t].x),i.push(r[t].y)}return{flattened:i,holeIndices:e}}(t);let n;this._initializeVertices(i);try{const t=function(t,e,i=2){const r=e&&e.length,n=r?e[0]*i:t.length;let a=Gl(t,0,n,i,!0);const o=[];if(!a||a.next===a.prev)return o;let s,l,c;if(r&&(a=function(t,e,i,r){const n=[];for(let i=0,a=e.length;i<a;i++){const o=Gl(t,e[i]*r,i<a-1?e[i+1]*r:t.length,r,!1);o===o.next&&(o.steiner=!0),n.push(ic(o))}n.sort(Kl);for(let t=0;t<n.length;t++)i=$l(n[t],i);return i}(t,e,a,i)),t.length>80*i){s=t[0],l=t[1];let e=s,r=l;for(let a=i;a<n;a+=i){const i=t[a],n=t[a+1];i<s&&(s=i),n<l&&(l=n),i>e&&(e=i),n>r&&(r=n)}c=Math.max(e-s,r-l),c=0!==c?32767/c:0}return Ql(a,o,i,s,l,c,0),o}(i,r),e=this._convertIndices(i,t);n=this._subdivideTrianglesScanline(e)}catch(t){console.error(t)}let a=[];return e&&(a=this._generateOutline(t)),this._ensureNoPoleVertices(),this._handlePoles(n),{verticesFlattened:this._vertexBuffer,indicesTriangles:n,indicesLineList:a}}_convertIndices(t,e){const i=[];for(let r=0;r<e.length;r++)i.push(this._vertexToIndex(t[2*e[r]],t[2*e[r]+1]));return i}_pointArrayToIndices(t){const e=[];for(let i=0;i<t.length;i++){const r=t[i];e.push(this._vertexToIndex(r.x,r.y))}return e}}function vc(t,e,i,r=!0){return new bc(i,e).subdividePolygonInternal(t,r)}function Tc(t,e,r=!1){if(!t||t.length<1)return[];if(t.length<2)return[];const n=t[0],a=t[t.length-1],o=r&&(n.x!==a.x||n.y!==a.y);if(e<2)return o?[...t,t[0]]:[...t];const s=Math.floor(N/e),l=[];l.push(new i(t[0].x,t[0].y));const c=t.length,h=o?c:c-1;for(let e=0;e<h;e++){const r=t[e],n=e<c-1?t[e+1]:t[0],a=r.x,o=r.y,h=n.x,u=n.y,d=a!==h,p=o!==u;if(!d&&!p)continue;const m=h-a,f=u-o,g=Math.abs(m),_=Math.abs(f);let y=a,x=o;for(;;){const t=m>0?(Math.floor(y/s)+1)*s:(Math.ceil(y/s)-1)*s,e=f>0?(Math.floor(x/s)+1)*s:(Math.ceil(x/s)-1)*s,r=Math.abs(y-t),n=Math.abs(x-e),a=Math.abs(y-h),o=Math.abs(x-u),c=d?r/g:Number.POSITIVE_INFINITY,b=p?n/_:Number.POSITIVE_INFINITY;if((a<=r||!d)&&(o<=n||!p))break;if(c<b&&d||!p){y=t,x+=f*c;const e=new i(y,Math.round(x));l[l.length-1].x===e.x&&l[l.length-1].y===e.y||l.push(e)}else{y+=m*b,x=e;const t=new i(Math.round(y),x);l[l.length-1].x===t.x&&l[l.length-1].y===t.y||l.push(t)}}const b=new i(h,u);l[l.length-1].x===b.x&&l[l.length-1].y===b.y||l.push(b)}return l}function wc(t,e,i){if(0===e.length)throw new Error("Subdivision vertex ring is empty.");let r=0,n=t[2*e[0]];for(let i=1;i<e.length;i++){const a=t[2*e[i]];a<n&&(n=a,r=i)}const a=e.length;let o=r,s=(o+1)%a;for(;;){const r=o-1>=0?o-1:a-1,n=(s+1)%a,l=t[2*e[r]],c=t[2*e[n]],h=t[2*e[o]],u=t[2*e[o]+1],d=t[2*e[s]+1];let p=!1;if(l<c)p=!0;else if(l>c)p=!1;else{const i=d-u,a=-(t[2*e[s]]-h),o=u<d?1:-1;((l-h)*i+(t[2*e[r]+1]-u)*a)*o>((c-h)*i+(t[2*e[n]+1]-u)*a)*o&&(p=!0)}if(p){const t=e[r],n=e[o],l=e[s];t!==n&&t!==l&&n!==l&&i.push(l,n,t),o--,o<0&&(o=a-1)}else{const t=e[n],r=e[o],l=e[s];t!==r&&t!==l&&r!==l&&i.push(l,r,t),s++,s>=a&&(s=0)}if(r===n)break}}function Vc(t,e,i,r,n,a,o,s,l){const c=n.length/2,h=o&&s&&l;if(c<ls.MAX_VERTEX_ARRAY_LENGTH){const u=e.prepareSegment(c,i,r),d=u.vertexLength;for(let t=0;t<a.length;t+=3)r.emplaceBack(d+a[t],d+a[t+1],d+a[t+2]);let p,m;u.vertexLength+=c,u.primitiveLength+=a.length/3,h&&(m=o.prepareSegment(c,i,s),p=m.vertexLength,m.vertexLength+=c);for(let e=0;e<n.length;e+=2)t(n[e],n[e+1]);if(h)for(let t=0;t<l.length;t++){const e=l[t];for(let t=1;t<e.length;t+=2)s.emplaceBack(p+e[t-1],p+e[t]);m.primitiveLength+=e.length/2}}else!function(t,e,i,r,n,a){const o=[];for(let t=0;t<r.length/2;t++)o.push(-1);const s={count:0};let l=0,c=t.getOrCreateLatestSegment(e,i),h=c.vertexLength;for(let u=2;u<n.length;u+=3){const d=n[u-2],p=n[u-1],m=n[u];let f=o[d]<l,g=o[p]<l,_=o[m]<l;c.vertexLength+((f?1:0)+(g?1:0)+(_?1:0))>ls.MAX_VERTEX_ARRAY_LENGTH&&(c=t.createNewSegment(e,i),l=s.count,f=!0,g=!0,_=!0,h=0);const y=Rc(o,r,a,s,d,f,c),x=Rc(o,r,a,s,p,g,c),b=Rc(o,r,a,s,m,_,c);i.emplaceBack(h+y-l,h+x-l,h+b-l),c.primitiveLength++}}(e,i,r,n,a,t),h&&function(t,e,i,r,n,a){const o=[];for(let t=0;t<r.length/2;t++)o.push(-1);const s={count:0};let l=0,c=t.getOrCreateLatestSegment(e,i),h=c.vertexLength;for(let u=0;u<n.length;u++){const d=n[u];for(let p=1;p<n[u].length;p+=2){const n=d[p-1],u=d[p];let m=o[n]<l,f=o[u]<l;c.vertexLength+((m?1:0)+(f?1:0))>ls.MAX_VERTEX_ARRAY_LENGTH&&(c=t.createNewSegment(e,i),l=s.count,m=!0,f=!0,h=0);const g=Rc(o,r,a,s,n,m,c),_=Rc(o,r,a,s,u,f,c);i.emplaceBack(h+g-l,h+_-l),c.primitiveLength++}}}(o,i,s,n,l,t),e.forceNewSegmentOnNextPrepare(),null==o||o.forceNewSegmentOnNextPrepare()}function Rc(t,e,i,r,n,a,o){if(a){const a=r.count;return i(e[2*n],e[2*n+1]),t[n]=r.count,r.count++,o.vertexLength++,a}return t[n]}class Mc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new Qo,this.indexArray=new ns,this.indexArray2=new as,this.programConfigurations=new Cs(t.layers,t.zoom),this.segments=new ls,this.segments2=new ls,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,e,i){this.hasDependencies=jl("fill",this.layers,e);const r=this.layers[0].layout.get("fill-sort-key"),n=!r.isConstant(),a=[];for(const{feature:o,id:s,index:l,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,h=As(o,t);if(!this.layers[0]._featureFilter.filter(new za(this.zoom),h,i))continue;const u=n?r.evaluate(h,{},i,e.availableImages):void 0,d={id:s,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:t?h.geometry:js(o),patterns:{},sortKey:u};a.push(d)}n&&a.sort((t,e)=>t.sortKey-e.sortKey);for(const r of a){const{geometry:n,index:a,sourceLayerIndex:o}=r;if(this.hasDependencies){const t=Al("fill",this.layers,r,{zoom:this.zoom},e);this.patternFeatures.push(t)}else this.addFeature(r,n,a,i,{},e.subdivisionGranularity);e.featureIndex.insert(t[a].feature,n,a,o,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:i})}addFeatures(t,e,i){for(const r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,e,i,t.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ll),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),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(t,e,i,r,n,a){for(const t of er(e,500)){const e=vc(t,r,a.fill.getGranularityForZoomLevel(r.z)),i=this.layoutVertexArray;Vc((t,e)=>{i.emplaceBack(t,e)},this.segments,this.layoutVertexArray,this.indexArray,e.verticesFlattened,e.indicesTriangles,this.segments2,this.indexArray2,e.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:n,canonical:r})}}let Uc,Sc;pa("FillBucket",Mc,{omit:["layers","patternFeatures"]});var Nc={get paint(){return Sc=Sc||new Ha({"fill-antialias":new Ga(bt.paint_fill["fill-antialias"]),"fill-opacity":new Ya(bt.paint_fill["fill-opacity"]),"fill-color":new Ya(bt.paint_fill["fill-color"]),"fill-outline-color":new Ya(bt.paint_fill["fill-outline-color"]),"fill-translate":new Ga(bt.paint_fill["fill-translate"]),"fill-translate-anchor":new Ga(bt.paint_fill["fill-translate-anchor"]),"fill-pattern":new Qa(bt.paint_fill["fill-pattern"])})},get layout(){return Uc=Uc||new Ha({"fill-sort-key":new Ya(bt.layout_fill["fill-sort-key"])})}};class Ec extends $a{constructor(t,e){super(t,Nc,e)}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Mc(t)}queryRadius(){return ol(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:t,geometry:e,transform:i,pixelsToTileUnits:r}){return Hs(sl(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-i.bearingInRadians,r),e)}isTileClipped(){return!0}}const Fc=oo([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Zc=oo([{name:"a_centroid",components:2,type:"Int16"}],4),{members:kc}=Fc;class zc{constructor(t,e,i,r,n){this.properties={},this.extent=i,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=n,t.readFields(Wc,this,e)}loadGeometry(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos,r=[];let n,a=1,o=0,s=0,l=0;for(;t.pos<e;){if(o<=0){const e=t.readVarint();a=7&e,o=e>>3}if(o--,1===a||2===a)s+=t.readSVarint(),l+=t.readSVarint(),1===a&&(n&&r.push(n),n=[]),n&&n.push(new i(s,l));else{if(7!==a)throw new Error(`unknown command ${a}`);n&&n.push(n[0].clone())}}return n&&r.push(n),r}bbox(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos;let i=1,r=0,n=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;for(;t.pos<e;){if(r<=0){const e=t.readVarint();i=7&e,r=e>>3}if(r--,1===i||2===i)n+=t.readSVarint(),a+=t.readSVarint(),n<o&&(o=n),n>s&&(s=n),a<l&&(l=a),a>c&&(c=a);else if(7!==i)throw new Error(`unknown command ${i}`)}return[o,l,s,c]}toGeoJSON(t,e,i){const r=this.extent*Math.pow(2,i),n=this.extent*t,a=this.extent*e,o=this.loadGeometry();function s(t){return[360*(t.x+n)/r-180,360/Math.PI*Math.atan(Math.exp((1-2*(t.y+a)/r)*Math.PI))-90]}function l(t){return t.map(s)}let c;if(1===this.type){const t=[];for(const e of o)t.push(e[0]);const e=l(t);c=1===t.length?{type:"Point",coordinates:e[0]}:{type:"MultiPoint",coordinates:e}}else if(2===this.type){const t=o.map(l);c=1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}}else{if(3!==this.type)throw new Error("unknown feature type");{const t=Ic(o),e=[];for(const i of t)e.push(i.map(l));c=1===e.length?{type:"Polygon",coordinates:e[0]}:{type:"MultiPolygon",coordinates:e}}}const h={type:"Feature",geometry:c,properties:this.properties};return null!=this.id&&(h.id=this.id),h}}function Wc(t,e,i){1===t?e.id=i.readVarint():2===t?function(t,e){const i=t.readVarint()+t.pos;for(;t.pos<i;){const i=e._keys[t.readVarint()],r=e._values[t.readVarint()];e.properties[i]=r}}(i,e):3===t?e.type=i.readVarint():4===t&&(e._geometry=i.pos)}function Ic(t){const e=t.length;if(e<=1)return[t];const i=[];let r,n;for(let a=0;a<e;a++){const e=Dc(t[a]);0!==e&&(void 0===n&&(n=e<0),n===e<0?(r&&i.push(r),r=[t[a]]):r&&r.push(t[a]))}return r&&i.push(r),i}function Dc(t){let e=0;for(let i,r,n=0,a=t.length,o=a-1;n<a;o=n++)i=t[n],r=t[o],e+=(r.x-i.x)*(i.y+r.y);return e}zc.types=["Unknown","Point","LineString","Polygon"];class Cc{constructor(t,e){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Bc,this,e),this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const e=this._pbf.readVarint()+this._pbf.pos;return new zc(this._pbf,e,this.extent,this._keys,this._values)}}function Bc(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){let e=null;const i=t.readVarint()+t.pos;for(;t.pos<i;){const i=t.readVarint()>>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}if(null==e)throw new Error("unknown feature value");return e}(i))}class Pc{constructor(t,e){this.layers=t.readFields(Oc,{},e)}}function Oc(t,e,i){if(3===t){const t=new Cc(i,i.readVarint()+i.pos);t.length&&(e[t.name]=t)}}const Lc=Math.pow(2,13);function jc(t,e,i,r,n,a,o,s){t.emplaceBack(e,i,2*Math.floor(r*Lc)+o,n*Lc*2,a*Lc*2,Math.round(s))}class Ac{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Jo,this.centroidVertexArray=new Go,this.indexArray=new ns,this.programConfigurations=new Cs(t.layers,t.zoom),this.segments=new ls,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,e,i){this.features=[],this.hasDependencies=jl("fill-extrusion",this.layers,e);for(const{feature:r,id:n,index:a,sourceLayerIndex:o}of t){const t=this.layers[0]._featureFilter.needGeometry,s=As(r,t);if(!this.layers[0]._featureFilter.filter(new za(this.zoom),s,i))continue;const l={id:n,sourceLayerIndex:o,index:a,geometry:t?s.geometry:js(r),properties:r.properties,type:r.type,patterns:{}};this.hasDependencies?this.features.push(Al("fill-extrusion",this.layers,l,{zoom:this.zoom},e)):this.addFeature(l,l.geometry,a,i,{},e.subdivisionGranularity),e.featureIndex.insert(r,l.geometry,a,o,this.index,!0)}}addFeatures(t,e,i){for(const r of this.features){const{geometry:n}=r;this.addFeature(r,n,r.index,e,i,t.subdivisionGranularity)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:i})}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,kc),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Zc.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,i,r,n,a){for(const i of er(e,500)){const e={x:0,y:0,sampleCount:0},n=this.layoutVertexArray.length;this.processPolygon(e,r,t,i,a);const o=this.layoutVertexArray.length-n,s=Math.floor(e.x/e.sampleCount),l=Math.floor(e.y/e.sampleCount);for(let t=0;t<o;t++)this.centroidVertexArray.emplaceBack(s,l)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:n,canonical:r})}processPolygon(t,e,i,r,n){if(r.length<1)return;if(Qc(r[0]))return;for(const e of r)0!==e.length&&Gc(t,e);const a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},o=n.fill.getGranularityForZoomLevel(e.z),s="Polygon"===zc.types[i.type];for(const t of r){if(0===t.length)continue;if(Qc(t))continue;const e=Tc(t,o,s);this._generateSideFaces(e,a)}if(!s)return;const l=vc(r,e,o,!1),c=this.layoutVertexArray;Vc((t,e)=>{jc(c,t,e,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(t,e){let i=0;for(let r=1;r<t.length;r++){const n=t[r],a=t[r-1];if(Yc(n,a))continue;e.segment.vertexLength+4>ls.MAX_VERTEX_ARRAY_LENGTH&&(e.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const o=n.sub(a)._perp()._unit(),s=a.dist(n);i+s>32768&&(i=0),jc(this.layoutVertexArray,n.x,n.y,o.x,o.y,0,0,i),jc(this.layoutVertexArray,n.x,n.y,o.x,o.y,0,1,i),i+=s,jc(this.layoutVertexArray,a.x,a.y,o.x,o.y,0,0,i),jc(this.layoutVertexArray,a.x,a.y,o.x,o.y,0,1,i);const l=e.segment.vertexLength;this.indexArray.emplaceBack(l,l+2,l+1),this.indexArray.emplaceBack(l+1,l+2,l+3),e.segment.vertexLength+=4,e.segment.primitiveLength+=2}}}function Gc(t,e){for(let i=0;i<e.length;i++){const r=e[i];i===e.length-1&&e[0].x===r.x&&e[0].y===r.y||(t.x+=r.x,t.y+=r.y,t.sampleCount++)}}function Yc(t,e){return t.x===e.x&&(t.x<0||t.x>N)||t.y===e.y&&(t.y<0||t.y>N)}function Qc(t){return t.every(t=>t.x<0)||t.every(t=>t.x>N)||t.every(t=>t.y<0)||t.every(t=>t.y>N)}let Jc;pa("FillExtrusionBucket",Ac,{omit:["layers","features"]});var Xc={get paint(){return Jc=Jc||new Ha({"fill-extrusion-opacity":new Ga(bt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ya(bt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ga(bt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ga(bt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Qa(bt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ya(bt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ya(bt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ga(bt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Hc extends $a{constructor(t,e){super(t,Xc,e)}createBucket(t){return new Ac(t)}queryRadius(){return ol(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:n,transform:a,pixelsToTileUnits:o,pixelPosMatrix:s}){const l=sl(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-a.bearingInRadians,o),c=this.paint.get("fill-extrusion-height").evaluate(e,r),h=this.paint.get("fill-extrusion-base").evaluate(e,r),u=function(t,e){const r=[];for(const n of t){const t=[n.x,n.y,0,1];V(t,t,e),r.push(new i(t[0]/t[3],t[1]/t[3]))}return r}(l,s),d=function(t,e,r,n){const a=[],o=[],s=n[8]*e,l=n[9]*e,c=n[10]*e,h=n[11]*e,u=n[8]*r,d=n[9]*r,p=n[10]*r,m=n[11]*r;for(const e of t){const t=[],r=[];for(const a of e){const e=a.x,o=a.y,f=n[0]*e+n[4]*o+n[12],g=n[1]*e+n[5]*o+n[13],_=n[2]*e+n[6]*o+n[14],y=n[3]*e+n[7]*o+n[15],x=_+c,b=y+h,v=f+u,T=g+d,w=_+p,V=y+m,R=new i((f+s)/b,(g+l)/b);R.z=x/b,t.push(R);const M=new i(v/V,T/V);M.z=w/V,r.push(M)}a.push(t),o.push(r)}return[a,o]}(n,h,c,s);return function(t,e,i){let r=1/0;Hs(i,e)&&(r=Kc(i,e[0]));for(let n=0;n<e.length;n++){const a=e[n],o=t[n];for(let t=0;t<a.length-1;t++){const e=a[t],n=[e,a[t+1],o[t+1],o[t],e];Js(i,n)&&(r=Math.min(r,Kc(i,n)))}}return r!==1/0&&r}(d[0],d[1],u)}}function qc(t,e){return t.x*e.x+t.y*e.y}function Kc(t,e){if(1===t.length){let i=0;const r=e[i++];let n;for(;!n||r.equals(n);)if(n=e[i++],!n)return 1/0;for(;i<e.length;i++){const a=e[i],o=t[0],s=n.sub(r),l=a.sub(r),c=o.sub(r),h=qc(s,s),u=qc(s,l),d=qc(l,l),p=qc(c,s),m=qc(c,l),f=h*d-u*u,g=(d*p-u*m)/f,_=(h*m-u*p)/f,y=r.z*(1-g-_)+n.z*g+a.z*_;if(isFinite(y))return y}return 1/0}{let t=1/0;for(const i of e)t=Math.min(t,i.z);return t}}const $c=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class th{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,i]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const r=i>>4;if(1!==r)throw new Error(`Got v${r} data when expected v1.`);const n=$c[15&i];if(!n)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(t,2,1),[o]=new Uint32Array(t,4,1);return new th(o,a,n,t)}constructor(t,e=64,i=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const n=$c.indexOf(this.ArrayType),a=2*t*this.ArrayType.BYTES_PER_ELEMENT,o=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-o%8)%8;if(n<0)throw new Error(`Unexpected typed array class: ${i}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+a+o+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+o+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+n]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=e,i}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return eh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:a,nodeSize:o}=this,s=[0,n.length-1,0],l=[];for(;s.length;){const c=s.pop()||0,h=s.pop()||0,u=s.pop()||0;if(h-u<=o){for(let o=u;o<=h;o++){const s=a[2*o],c=a[2*o+1];s>=t&&s<=i&&c>=e&&c<=r&&l.push(n[o])}continue}const d=u+h>>1,p=a[2*d],m=a[2*d+1];p>=t&&p<=i&&m>=e&&m<=r&&l.push(n[d]),(0===c?t<=p:e<=m)&&(s.push(u),s.push(d-1),s.push(1-c)),(0===c?i>=p:r>=m)&&(s.push(d+1),s.push(h),s.push(1-c))}return l}within(t,e,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:n,nodeSize:a}=this,o=[0,r.length-1,0],s=[],l=i*i;for(;o.length;){const c=o.pop()||0,h=o.pop()||0,u=o.pop()||0;if(h-u<=a){for(let i=u;i<=h;i++)ah(n[2*i],n[2*i+1],t,e)<=l&&s.push(r[i]);continue}const d=u+h>>1,p=n[2*d],m=n[2*d+1];ah(p,m,t,e)<=l&&s.push(r[d]),(0===c?t-i<=p:e-i<=m)&&(o.push(u),o.push(d-1),o.push(1-c)),(0===c?t+i>=p:e+i>=m)&&(o.push(d+1),o.push(h),o.push(1-c))}return s}}function eh(t,e,i,r,n,a){if(n-r<=i)return;const o=r+n>>1;ih(t,e,o,r,n,a),eh(t,e,i,r,o-1,1-a),eh(t,e,i,o+1,n,1-a)}function ih(t,e,i,r,n,a){for(;n>r;){if(n-r>600){const o=n-r+1,s=i-r+1,l=Math.log(o),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);ih(t,e,i,Math.max(r,Math.floor(i-s*c/o+h)),Math.min(n,Math.floor(i+(o-s)*c/o+h)),a)}const o=e[2*i+a];let s=r,l=n;for(rh(t,e,r,i),e[2*n+a]>o&&rh(t,e,r,n);s<l;){for(rh(t,e,s,l),s++,l--;e[2*s+a]<o;)s++;for(;e[2*l+a]>o;)l--}e[2*r+a]===o?rh(t,e,r,l):(l++,rh(t,e,l,n)),l<=i&&(r=l+1),i<=l&&(n=l-1)}}function rh(t,e,i,r){nh(t,i,r),nh(e,2*i,2*r),nh(e,2*i+1,2*r+1)}function nh(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}function ah(t,e,i,r){const n=t-i,a=e-r;return n*n+a*a}function oh(t,e,i,r){let n=r;const a=e+(i-e>>1);let o,s=i-e;const l=t[e],c=t[e+1],h=t[i],u=t[i+1];for(let r=e+3;r<i;r+=3){const e=sh(t[r],t[r+1],l,c,h,u);if(e>n)o=r,n=e;else if(e===n){const t=Math.abs(r-a);t<s&&(o=r,s=t)}}n>r&&(o-e>3&&oh(t,e,o,r),t[o+2]=n,i-o>3&&oh(t,o,i,r))}function sh(t,e,i,r,n,a){let o=n-i,s=a-r;if(0!==o||0!==s){const l=((t-i)*o+(e-r)*s)/(o*o+s*s);l>1?(i=n,r=a):l>0&&(i+=o*l,r+=s*l)}return o=t-i,s=e-r,o*o+s*s}function lh(t,e,i,r){const n={type:e,geom:i},a={id:null==t?null:t,type:n.type,geometry:n.geom,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(n.type){case"Point":case"MultiPoint":case"LineString":ch(a,n.geom);break;case"Polygon":ch(a,n.geom[0]);break;case"MultiLineString":for(const t of n.geom)ch(a,t);break;case"MultiPolygon":for(const t of n.geom)ch(a,t[0])}return a}function ch(t,e){for(let i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function hh(t,e){const i=[];switch(t.type){case"FeatureCollection":for(let r=0;r<t.features.length;r++)uh(i,t.features[r],e,r);break;case"Feature":uh(i,t,e);break;default:uh(i,{geometry:t,properties:void 0},e)}return i}function uh(t,e,i,r){if(!e.geometry)return;if("GeometryCollection"===e.geometry.type)return void function(t,e,i,r,n){for(const a of i.geometries)uh(t,{id:e.id,geometry:a,properties:e.properties},r,n)}(t,e,e.geometry,i,r);const n=e.geometry.coordinates;if(!n?.length)return;const a=function(t,e,i){return e.promoteId?t.properties?.[e.promoteId]:e.generateId?i||0:t.id}(e,i,r),o=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);switch(e.geometry.type){case"Point":return void function(t,e,i,r){const n=[];n.push(mh(i.coordinates[0]),fh(i.coordinates[1]),0),t.push(lh(e,"Point",n,r))}(t,a,e.geometry,e.properties);case"MultiPoint":return void function(t,e,i,r){const n=[];for(const t of i.coordinates)n.push(mh(t[0]),fh(t[1]),0);t.push(lh(e,"MultiPoint",n,r))}(t,a,e.geometry,e.properties);case"LineString":return void function(t,e,i,r,n){const a=[];dh(i.coordinates,a,r,!1),t.push(lh(e,"LineString",a,n))}(t,a,e.geometry,o,e.properties);case"MultiLineString":return void function(t,e,i,r,n,a){if(n.lineMetrics)for(const n of i.coordinates){const i=[];dh(n,i,r,!1),t.push(lh(e,"LineString",i,a))}else{const n=[];ph(i.coordinates,n,r,!1),t.push(lh(e,"MultiLineString",n,a))}}(t,a,e.geometry,o,i,e.properties);case"Polygon":return void function(t,e,i,r,n){const a=[];ph(i.coordinates,a,r,!0),t.push(lh(e,"Polygon",a,n))}(t,a,e.geometry,o,e.properties);case"MultiPolygon":return void function(t,e,i,r,n){const a=[];for(const t of i.coordinates){const e=[];ph(t,e,r,!0),a.push(e)}t.push(lh(e,"MultiPolygon",a,n))}(t,a,e.geometry,o,e.properties);default:throw new Error("Input data is not a valid GeoJSON object.")}}function dh(t,e,i,r){let n,a,o=0;for(let i=0;i<t.length;i++){const s=mh(t[i][0]),l=fh(t[i][1]);e.push(s,l,0),i>0&&(o+=r?(n*l-s*a)/2:Math.sqrt(Math.pow(s-n,2)+Math.pow(l-a,2))),n=s,a=l}const s=e.length-3;e[2]=1,i>0&&oh(e,0,s,i),e[s+2]=1,e.size=Math.abs(o),e.start=0,e.end=e.size}function ph(t,e,i,r){for(let n=0;n<t.length;n++){const a=[];dh(t[n],a,i,r),e.push(a)}}function mh(t){return t/360+.5}function fh(t){const e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function gh(t){const e={type:"Feature",geometry:_h(t),properties:t.tags};return null!=t.id&&(e.id=t.id),e}function _h(t){const{type:e,geometry:i}=t;switch(e){case"Point":return{type:e,coordinates:xh(i[0],i[1])};case"MultiPoint":case"LineString":return{type:e,coordinates:yh(i)};case"MultiLineString":case"Polygon":return{type:e,coordinates:i.map(t=>yh(t))};case"MultiPolygon":return{type:e,coordinates:i.map(t=>t.map(t=>yh(t)))}}}function yh(t){const e=[];for(let i=0;i<t.length;i+=3)e.push(xh(t[i],t[i+1]));return e}function xh(t,e){return[bh(t),vh(e)]}function bh(t){return 360*(t-.5)}function vh(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var Th;function wh(t,e,i,r,n,a,o,s){if(r/=e,a>=(i/=e)&&o<r)return t;if(o<i||a>=r)return null;const l=[];for(const e of t){const t=n===Th.X?e.minX:e.minY,a=n===Th.X?e.maxX:e.maxY;if(t>=i&&a<r)l.push(e);else if(!(a<i||t>=r))switch(e.type){case"Point":case"MultiPoint":Vh(e,l,i,r,n);continue;case"LineString":Rh(e,l,i,r,n,s);continue;case"MultiLineString":Mh(e,l,i,r,n);continue;case"Polygon":Uh(e,l,i,r,n);continue;case"MultiPolygon":Sh(e,l,i,r,n);continue}}return l.length?l:null}function Vh(t,e,i,r,n){const a=[];(function(t,e,i,r,n){for(let a=0;a<t.length;a+=3){const o=t[a+n];o>=i&&o<=r&&Zh(e,t[a],t[a+1],t[a+2])}})(t.geometry,a,i,r,n),a.length&&e.push(lh(t.id,3===a.length?"Point":"MultiPoint",a,t.tags))}function Rh(t,e,i,r,n,a){const o=[];if(Nh(t.geometry,o,i,r,n,!1,a.lineMetrics),o.length)if(a.lineMetrics)for(const i of o)e.push(lh(t.id,"LineString",i,t.tags));else e.push(o.length>1?lh(t.id,"MultiLineString",o,t.tags):lh(t.id,"LineString",o[0],t.tags))}function Mh(t,e,i,r,n){const a=[];Fh(t.geometry,a,i,r,n,!1),a.length&&e.push(1!==a.length?lh(t.id,"MultiLineString",a,t.tags):lh(t.id,"LineString",a[0],t.tags))}function Uh(t,e,i,r,n){const a=[];Fh(t.geometry,a,i,r,n,!0),a.length&&e.push(lh(t.id,"Polygon",a,t.tags))}function Sh(t,e,i,r,n){const a=[];for(const e of t.geometry){const t=[];Fh(e,t,i,r,n,!0),t.length&&a.push(t)}a.length&&e.push(lh(t.id,"MultiPolygon",a,t.tags))}function Nh(t,e,i,r,n,a,o){let s=Eh(t);const l=n===Th.X?kh:zh;let c,h,u=t.start;for(let d=0;d<t.length-3;d+=3){const p=t[d],m=t[d+1],f=t[d+2],g=t[d+3],_=t[d+4],y=n===Th.X?p:m,x=n===Th.X?g:_;let b=!1;o&&(c=Math.sqrt(Math.pow(p-g,2)+Math.pow(m-_,2))),y<i?x>i&&(h=l(s,p,m,g,_,i),o&&(s.start=u+c*h)):y>r?x<r&&(h=l(s,p,m,g,_,r),o&&(s.start=u+c*h)):Zh(s,p,m,f),x<i&&y>=i&&(h=l(s,p,m,g,_,i),b=!0),x>r&&y<=r&&(h=l(s,p,m,g,_,r),b=!0),!a&&b&&(o&&(s.end=u+c*h),e.push(s),s=Eh(t)),o&&(u+=c)}let d=t.length-3;const p=t[d],m=t[d+1],f=n===Th.X?p:m;f>=i&&f<=r&&Zh(s,p,m,t[d+2]),d=s.length-3,a&&d>=3&&(s[d]!==s[0]||s[d+1]!==s[1])&&Zh(s,s[0],s[1],s[2]),s.length&&e.push(s)}function Eh(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Fh(t,e,i,r,n,a){for(const o of t)Nh(o,e,i,r,n,a,!1)}function Zh(t,e,i,r){t.push(e,i,r)}function kh(t,e,i,r,n,a){const o=(a-e)/(r-e);return Zh(t,a,i+(n-i)*o,1),o}function zh(t,e,i,r,n,a){const o=(a-i)/(n-i);return Zh(t,e+(r-e)*o,a,1),o}function Wh(t,e){const i=e.buffer/e.extent;let r=t;const n=wh(t,1,-1-i,i,Th.X,-1,2,e),a=wh(t,1,1-i,2+i,Th.X,-1,2,e);return n||a?(r=wh(t,1,-i,1+i,Th.X,-1,2,e)||[],n&&(r=Ih(n,1).concat(r)),a&&(r=r.concat(Ih(a,-1))),r):r}function Ih(t,e){const i=[];for(const r of t)switch(r.type){case"Point":case"MultiPoint":case"LineString":{const t=Dh(r.geometry,e);i.push(lh(r.id,r.type,t,r.tags));continue}case"MultiLineString":case"Polygon":{const t=[];for(const i of r.geometry)t.push(Dh(i,e));i.push(lh(r.id,r.type,t,r.tags));continue}case"MultiPolygon":{const t=[];for(const i of r.geometry){const r=[];for(const t of i)r.push(Dh(t,e));t.push(r)}i.push(lh(r.id,r.type,t,r.tags));continue}}return i}function Dh(t,e){const i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(let r=0;r<t.length;r+=3)i.push(t[r]+e,t[r+1],t[r+2]);return i}function Ch(t,e,i){const r=!!e.newGeometry,n=e.removeAllProperties||e.removeProperties?.length>0||e.addOrUpdateProperties?.length>0;if(r){const r=t[0];let a=hh({type:"FeatureCollection",features:[{type:"Feature",id:r.id,geometry:e.newGeometry,properties:n?Bh(r.tags,e):r.tags}]},i);return a=Wh(a,i),a}if(n){const i=[];for(const r of t){const t={...r};t.tags=Bh(t.tags,e),i.push(t)}return i}return[]}function Bh(t,e){if(e.removeAllProperties)return{};const i={...t||{}};if(e.removeProperties)for(const t of e.removeProperties)delete i[t];if(e.addOrUpdateProperties)for(const{key:t,value:r}of e.addOrUpdateProperties)i[t]=r;return i}!function(t){t[t.X=0]="X",t[t.Y=1]="Y"}(Th||(Th={}));const Ph={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t};class Oh{constructor(t){this.options=Object.assign(Object.create(Ph),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(t){const e=[];for(const i of t){if(!i.geometry)continue;const[t,r]=i.geometry.coordinates,[n,a]=[mh(t),fh(r)];e.push({id:i.id,type:"Point",geometry:[n,a],tags:i.properties})}this.createIndex(e)}initialize(t){const e=[];for(const i of t)"Point"===i.type&&e.push(i);this.createIndex(e)}updateIndex(t,e,i){this.options=Object.assign(Object.create(Ph),i.clusterOptions),this.initialize(t)}createIndex(t){const{log:e,minZoom:i,maxZoom:r}=this.options;e&&console.time("total time");const n=`prepare ${t.length} points`;e&&console.time(n),this.points=t;const a=[];for(let e=0;e<t.length;e++){const i=t[e];if(!i?.geometry)continue;let[r,n]=i.geometry;r=Math.fround(r),n=Math.fround(n),a.push(r,n,1/0,e,-1,1),this.options.reduce&&a.push(0)}let o=this.trees[r+1]=this.createTree(a);e&&console.timeEnd(n);for(let t=r;t>=i;t--){const i=Date.now();o=this.trees[t]=this.createTree(this.cluster(o,t)),e&&console.log("z%d: %d clusters in %dms",t,o.numItems,Date.now()-i)}e&&console.timeEnd("total time")}getClusters(t,e){return this.getClustersInternal(t,e).map(t=>gh(t))}getClustersInternal(t,e){let i=((t[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,t[1]));let n=180===t[2]?180:((t[2]+180)%360+360)%360-180;const a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)i=-180,n=180;else if(i>n){const t=this.getClustersInternal([i,r,180,a],e),o=this.getClustersInternal([-180,r,n,a],e);return t.concat(o)}const o=this.trees[this.limitZoom(e)],s=o.range(mh(i),fh(a),mh(n),fh(r)),l=o.flatData,c=[];for(const t of s){const e=this.stride*t;c.push(l[e+5]>1?Lh(l,e,this.clusterProps):this.points[l[e+3]])}return c}getChildren(t){const e=this.getOriginId(t),i=this.getOriginZoom(t),r=new Error("No cluster with the specified id: "+t),n=this.trees[i];if(!n)throw r;const a=n.flatData;if(e*this.stride>=a.length)throw r;const o=this.options.radius/(this.options.extent*Math.pow(2,i-1)),s=n.within(a[e*this.stride],a[e*this.stride+1],o),l=[];for(const e of s){const i=e*this.stride;a[i+4]===t&&l.push(a[i+5]>1?jh(a,i,this.clusterProps):gh(this.points[a[i+3]]))}if(0===l.length)throw r;return l}getLeaves(t,e,i){const r=[];return this.appendLeaves(r,t,e=e||10,i=i||0,0),r}getTile(t,e,i){const r=this.trees[this.limitZoom(t)];if(!r)return null;const n=Math.pow(2,t),{extent:a,radius:o}=this.options,s=o/a,l=(i-s)/n,c=(i+1+s)/n,h={transformed:!0,features:[],source:null,x:e,y:i,z:t};return this.addTileFeatures(r.range((e-s)/n,l,(e+1+s)/n,c),r.flatData,e,i,n,h),0===e&&this.addTileFeatures(r.range(1-s/n,l,1,c),r.flatData,n,i,n,h),e===n-1&&this.addTileFeatures(r.range(0,l,s/n,c),r.flatData,-1,i,n,h),h}getClusterExpansionZoom(t){return this.getOriginZoom(t)}appendLeaves(t,e,i,r,n){const a=this.getChildren(e);for(const e of a){const a=e.properties;if(a?.cluster?n+a.point_count<=r?n+=a.point_count:n=this.appendLeaves(t,a.cluster_id,i,r,n):n<r?n++:t.push(e),t.length===i)break}return n}createTree(t){const e=new th(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let i=0;i<t.length;i+=this.stride)e.add(t[i],t[i+1]);return e.finish(),e.flatData=t,e.data=null,e}addTileFeatures(t,e,i,r,n,a){for(const o of t){const t=o*this.stride,s=e[t+5]>1;let l,c,h;if(s)l=Ah(e,t,this.clusterProps),c=e[t],h=e[t+1];else{const i=this.points[e[t+3]];l=i.tags,[c,h]=i.geometry}const u={type:1,geometry:[[Math.round(this.options.extent*(c*n-i)),Math.round(this.options.extent*(h*n-r))]],tags:l};let d;d=s||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==d&&(u.id=d),a.features.push(u)}}limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}cluster(t,e){const{radius:i,extent:r,reduce:n,minPoints:a}=this.options,o=i/(r*Math.pow(2,e)),s=t.flatData,l=[],c=this.stride;for(let i=0;i<s.length;i+=c){if(s[i+2]<=e)continue;s[i+2]=e;const r=s[i],h=s[i+1],u=t.within(s[i],s[i+1],o),d=s[i+5];let p=d;for(const t of u){const i=t*c;s[i+2]>e&&(p+=s[i+5])}if(p>d&&p>=a){let t,a=r*d,o=h*d,m=-1;const f=(i/c<<5)+(e+1)+this.points.length;for(const r of u){const l=r*c;if(s[l+2]<=e)continue;s[l+2]=e;const h=s[l+5];a+=s[l]*h,o+=s[l+1]*h,s[l+4]=f,n&&(t||(t=this.map(s,i,!0),m=this.clusterProps.length,this.clusterProps.push(t)),n(t,this.map(s,l)))}s[i+4]=f,l.push(a/p,o/p,1/0,f,-1,p),n&&l.push(m)}else{for(let t=0;t<c;t++)l.push(s[i+t]);if(p>1)for(const t of u){const i=t*c;if(!(s[i+2]<=e)){s[i+2]=e;for(let t=0;t<c;t++)l.push(s[i+t])}}}}return l}getOriginId(t){return t-this.points.length>>5}getOriginZoom(t){return(t-this.points.length)%32}map(t,e,i){if(t[e+5]>1){const r=this.clusterProps[t[e+6]];return i?Object.assign({},r):r}const r=this.points[t[e+3]].tags,n=this.options.map(r);return i&&n===r?Object.assign({},n):n}}function Lh(t,e,i){return{id:t[e+3],type:"Point",tags:Ah(t,e,i),geometry:[t[e],t[e+1]]}}function jh(t,e,i){return{type:"Feature",id:t[e+3],properties:Ah(t,e,i),geometry:{type:"Point",coordinates:[bh(t[e]),vh(t[e+1])]}}}function Ah(t,e,i){const r=t[e+5],n=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?Math.round(r/100)/10+"k":r,a=t[e+6],o=-1===a?{}:Object.assign({},i[a]);return Object.assign(o,{cluster:!0,cluster_id:t[e+3],point_count:r,point_count_abbreviated:n})}const Gh="geojsonvt_clip_start",Yh="geojsonvt_clip_end";function Qh(t,e,i,r,n){const a=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),o={transformed:!1,features:[],source:null,x:i,y:r,z:e,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:t.length};for(const e of t)Jh(o,e,a,n);return o}function Jh(t,e,i,r){switch(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),e.type){case"Point":case"MultiPoint":return void function(t,e){const i=[];for(let r=0;r<e.geometry.length;r+=3)i.push(e.geometry[r],e.geometry[r+1]),t.numPoints++,t.numSimplified++;if(!i.length)return;const r={type:1,tags:e.tags||null,geometry:i};null!==e.id&&(r.id=e.id),t.features.push(r)}(t,e);case"LineString":return void function(t,e,i,r){const n=[];if(Xh(n,e.geometry,t,i,!1,!1),!n.length)return;let a=e.tags||null;if(r.lineMetrics){a={};for(const t in e.tags)a[t]=e.tags[t];a[Gh]=e.geometry.start/e.geometry.size,a[Yh]=e.geometry.end/e.geometry.size}const o={type:2,tags:a,geometry:n};null!==e.id&&(o.id=e.id),t.features.push(o)}(t,e,i,r);case"MultiLineString":case"Polygon":return void function(t,e,i){const r=[];for(let n=0;n<e.geometry.length;n++)Xh(r,e.geometry[n],t,i,"Polygon"===e.type,0===n);if(!r.length)return;const n={type:"Polygon"===e.type?3:2,tags:e.tags||null,geometry:r};null!==e.id&&(n.id=e.id),t.features.push(n)}(t,e,i);case"MultiPolygon":return void function(t,e,i){const r=[];for(let n=0;n<e.geometry.length;n++){const a=e.geometry[n];for(let e=0;e<a.length;e++)Xh(r,a[e],t,i,!0,0===e)}if(!r.length)return;const n={type:3,tags:e.tags||null,geometry:r};null!==e.id&&(n.id=e.id),t.features.push(n)}(t,e,i)}}function Xh(t,e,i,r,n,a){const o=r*r;if(r>0&&e.size<(n?o:r))return void(i.numPoints+=e.length/3);const s=[];for(let t=0;t<e.length;t+=3)(0===r||e[t+2]>o)&&(i.numSimplified++,s.push(e[t],e[t+1])),i.numPoints++;n&&function(t,e){let i=0;for(let e=0,r=t.length,n=r-2;e<r;n=e,e+=2)i+=(t[e]-t[n])*(t[e+1]+t[n+1]);if(i>0===e)for(let e=0,i=t.length;e<i/2;e+=2){const r=t[e],n=t[e+1];t[e]=t[i-2-e],t[e+1]=t[i-1-e],t[i-2-e]=r,t[i-1-e]=n}}(s,a),t.push(s)}function Hh(t,e){if(t.transformed)return t;const i=1<<t.z,r=t.x,n=t.y;for(const a of t.features)1===a.type?qh(a,e,i,r,n):Kh(a,e,i,r,n);return t.transformed=!0,t}function qh(t,e,i,r,n){const a=t,o=t.geometry,s=[];for(let t=0;t<o.length;t+=2)s.push($h(o[t],o[t+1],e,i,r,n));return a.geometry=s,a}function Kh(t,e,i,r,n){const a=t,o=t.geometry,s=[];for(const t of o){const a=[];for(let o=0;o<t.length;o+=2)a.push($h(t[o],t[o+1],e,i,r,n));s.push(a)}return a.geometry=s,a}function $h(t,e,i,r,n,a){return[Math.round(i*(t*r-n)),Math.round(i*(e*r-a))]}class tu{constructor(t){this.options=t,this.stats={},this.total=0,this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(t){this.splitTile(t,0,0,0),this.options.debug&&(t.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}updateIndex(t,e,i){i.debug>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(e),i.debug>1&&console.timeEnd("invalidating");const[r,n,a]=[0,0,0],o=Qh(t,r,n,a,i);o.source=t;const s=eu(r,n,a);if(this.tiles[s]=o,this.tileCoords.push({z:r,x:n,y:a,id:s}),i.debug){const t=`z${r}`;this.stats[t]=(this.stats[t]||0)+1,this.total++}}getClusterExpansionZoom(t){return null}getChildren(t){return null}getLeaves(t,e,i){return null}getTile(t,e,i){const{extent:r,debug:n}=this.options,a=1<<t,o=eu(t,e=e+a&a-1,i);if(this.tiles[o])return Hh(this.tiles[o],r);n>1&&console.log("drilling down to z%d-%d-%d",t,e,i);let s,l=t,c=e,h=i;for(;!s&&l>0;)l--,c>>=1,h>>=1,s=this.tiles[eu(l,c,h)];return s?.source?(n>1&&(console.log("found parent tile z%d-%d-%d",l,c,h),console.time("drilling down")),this.splitTile(s.source,l,c,h,t,e,i),n>1&&console.timeEnd("drilling down"),this.tiles[o]?Hh(this.tiles[o],r):null):null}splitTile(t,e,i,r,n,a,o){const s=[t,e,i,r],l=this.options,c=l.debug;for(;s.length;){r=s.pop(),i=s.pop(),e=s.pop(),t=s.pop();const h=1<<e,u=eu(e,i,r);let d=this.tiles[u];if(!d&&(c>1&&console.time("creation"),d=this.tiles[u]=Qh(t,e,i,r,l),this.tileCoords.push({z:e,x:i,y:r,id:u}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,r,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));const t=`z${e}`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(d.source=t,null==n){if(e===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(null!=n){const t=n-e;if(i!==a>>t||r!==o>>t)continue}}if(d.source=null,!t.length)continue;c>1&&console.time("clipping");const p=.5*l.buffer/l.extent,m=.5-p,f=.5+p,g=1+p;let _=null,y=null,x=null,b=null;const v=wh(t,h,i-p,i+f,Th.X,d.minX,d.maxX,l),T=wh(t,h,i+m,i+g,Th.X,d.minX,d.maxX,l);v&&(_=wh(v,h,r-p,r+f,Th.Y,d.minY,d.maxY,l),y=wh(v,h,r+m,r+g,Th.Y,d.minY,d.maxY,l)),T&&(x=wh(T,h,r-p,r+f,Th.Y,d.minY,d.maxY,l),b=wh(T,h,r+m,r+g,Th.Y,d.minY,d.maxY,l)),c>1&&console.timeEnd("clipping"),s.push(_||[],e+1,2*i,2*r),s.push(y||[],e+1,2*i,2*r+1),s.push(x||[],e+1,2*i+1,2*r),s.push(b||[],e+1,2*i+1,2*r+1)}}invalidateTiles(t){if(!t.length)return;const e=this.options,{debug:i}=e;let r=1/0,n=-1/0,a=1/0,o=-1/0;for(const e of t)r=Math.min(r,e.minX),n=Math.max(n,e.maxX),a=Math.min(a,e.minY),o=Math.max(o,e.maxY);const s=e.buffer/e.extent,l=new Set;for(const e in this.tiles){const c=this.tiles[e],h=1<<c.z,u=(c.x-s)/h,d=(c.x+1+s)/h,p=(c.y-s)/h,m=(c.y+1+s)/h;if(n<u||r>=d||o<p||a>=m)continue;let f=!1;for(const e of t)if(e.maxX>=u&&e.minX<d&&e.maxY>=p&&e.minY<m){f=!0;break}if(f){if(i){i>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",c.z,c.x,c.y,c.numFeatures,c.numPoints,c.numSimplified);const t=`z${c.z}`;this.stats[t]=(this.stats[t]||0)-1,this.total--}delete this.tiles[e],l.add(e)}}l.size&&(this.tileCoords=this.tileCoords.filter(t=>!l.has(t.id)))}}function eu(t,e,i){return 32*((1<<t)*i+e)+t}const iu={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:Ph,debug:0},ru=oo([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:nu}=ru,au=oo([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:ou}=au,su=Math.cos(Math.PI/180*37.5),lu=Math.pow(2,14)/.5;class cu{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(t=>{this.gradients[t.id]={}}),this.layoutVertexArray=new Xo,this.layoutVertexArray2=new Ho,this.indexArray=new ns,this.programConfigurations=new Cs(t.layers,t.zoom),this.segments=new ls,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,e,i){this.hasDependencies=jl("line",this.layers,e)||this.hasLineDasharray(this.layers);const r=this.layers[0].layout.get("line-sort-key"),n=!r.isConstant(),a=[];for(const{feature:e,id:o,index:s,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=As(e,t);if(!this.layers[0]._featureFilter.filter(new za(this.zoom),c,i))continue;const h=n?r.evaluate(c,{},i):void 0,u={id:o,properties:e.properties,type:e.type,sourceLayerIndex:l,index:s,geometry:t?c.geometry:js(e),patterns:{},dashes:{},sortKey:h};a.push(u)}n&&a.sort((t,e)=>t.sortKey-e.sortKey);for(const r of a){const{geometry:n,index:a,sourceLayerIndex:o}=r;this.hasDependencies?(jl("line",this.layers,e)?Al("line",this.layers,r,{zoom:this.zoom},e):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,r,this.zoom,e),this.patternFeatures.push(r)):this.addFeature(r,n,a,i,{},{},e.subdivisionGranularity),e.featureIndex.insert(t[a].feature,n,a,o,this.index)}}update(t,e,i,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:i,dashPositions:r})}addFeatures(t,e,i,r){for(const n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,i,r,t.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,ou)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,nu),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,Gh)&&Object.prototype.hasOwnProperty.call(t.properties,Yh))return{start:+t.properties[Gh],end:+t.properties[Yh]}}addFeature(t,e,i,r,n,a,o){const s=this.layers[0].layout,l=s.get("line-join").evaluate(t,{}),c=s.get("line-cap").evaluate(t,{}),h=s.get("line-miter-limit").evaluate(t,{}),u=s.get("line-round-limit").evaluate(t,{});this.lineClips=this.lineFeatureClips(t);for(const i of e)this.addLine(i,t,l,c,h,u,r,o);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:n,dashPositions:a,canonical:r})}addLine(t,e,i,r,n,a,o,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,t=Tc(t,o?s.line.getGranularityForZoomLevel(o.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const l="Polygon"===zc.types[e.type];let c=t.length;for(;c>=2&&t[c-1].equals(t[c-2]);)c--;let h=0;for(;h<c-1&&t[h].equals(t[h+1]);)h++;if(c<(l?3:2))return;"bevel"===i&&(n=1.05);const u=this.overscaling<=16?122880/(512*this.overscaling):0,d=this.segments.prepareSegment(10*c,this.layoutVertexArray,this.indexArray);let p,m,f,g,_;this.e1=this.e2=-1,l&&(p=t[c-2],_=t[h].sub(p)._unit()._perp());for(let e=h;e<c;e++){if(f=e===c-1?l?t[h+1]:void 0:t[e+1],f&&t[e].equals(f))continue;_&&(g=_),p&&(m=p),p=t[e],_=f?f.sub(p)._unit()._perp():g,g=g||_;let o=g.add(_);0===o.x&&0===o.y||o._unit();const s=g.x*_.x+g.y*_.y,y=o.x*_.x+o.y*_.y,x=0!==y?1/y:1/0,b=2*Math.sqrt(2-2*y),v=y<su&&m&&f,T=g.x*_.y-g.y*_.x>0;if(v&&e>h){const t=p.dist(m);if(t>2*u){const e=p.sub(p.sub(m)._mult(u/t)._round());this.updateDistance(m,e),this.addCurrentVertex(e,g,0,0,d),m=e}}const w=m&&f;let V=w?i:l?"butt":r;if(w&&"round"===V&&(x<a?V="miter":x<=2&&(V="fakeround")),"miter"===V&&x>n&&(V="bevel"),"bevel"===V&&(x>2&&(V="flipbevel"),x<n&&(V="miter")),m&&this.updateDistance(m,p),"miter"===V)o._mult(x),this.addCurrentVertex(p,o,0,0,d);else if("flipbevel"===V){if(x>100)o=_.mult(-1);else{const t=x*g.add(_).mag()/g.sub(_).mag();o._perp()._mult(t*(T?-1:1))}this.addCurrentVertex(p,o,0,0,d),this.addCurrentVertex(p,o.mult(-1),0,0,d)}else if("bevel"===V||"fakeround"===V){const t=-Math.sqrt(x*x-1),e=T?t:0,i=T?0:t;if(m&&this.addCurrentVertex(p,g,e,i,d),"fakeround"===V){const t=Math.round(180*b/Math.PI/20);for(let e=1;e<t;e++){let i=e/t;if(.5!==i){const t=i-.5;i+=i*t*(i-1)*((1.0904+s*(s*(3.55645-1.43519*s)-3.2452))*t*t+(.848013+s*(.215638*s-1.06021)))}const r=_.sub(g)._mult(i)._add(g)._unit()._mult(T?-1:1);this.addHalfVertex(p,r.x,r.y,!1,T,0,d)}}f&&this.addCurrentVertex(p,_,-e,-i,d)}else if("butt"===V)this.addCurrentVertex(p,o,0,0,d);else if("square"===V){const t=m?1:-1;this.addCurrentVertex(p,o,t,t,d)}else"round"===V&&(m&&(this.addCurrentVertex(p,g,0,0,d),this.addCurrentVertex(p,g,1,1,d,!0)),f&&(this.addCurrentVertex(p,_,-1,-1,d,!0),this.addCurrentVertex(p,_,0,0,d)));if(v&&e<c-1){const t=p.dist(f);if(t>2*u){const e=p.add(f.sub(p)._mult(u/t)._round());this.updateDistance(p,e),this.addCurrentVertex(e,_,0,0,d),p=e}}}}addCurrentVertex(t,e,i,r,n,a=!1){const o=e.y*r-e.x,s=-e.y-e.x*r;this.addHalfVertex(t,e.x+e.y*i,e.y-e.x*i,a,!1,i,n),this.addHalfVertex(t,o,s,a,!0,-r,n),this.distance>lu/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,i,r,n,a))}addHalfVertex({x:t,y:e},i,r,n,a,o,s){const l=.5*(this.lineClips?this.scaledDistance*(lu-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(n?1:0),(e<<1)+(a?1:0),Math.round(63*i)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&l)<<2,l>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const c=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,c,this.e2),s.primitiveLength++),a?this.e2=c:this.e1=c}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}hasLineDasharray(t){for(const e of t){const t=e.paint.get("line-dasharray");if(t&&!t.isConstant())return!0}return!1}addLineDashDependencies(t,e,i,r){for(const n of t){const t=n.paint.get("line-dasharray");if(!t||"constant"===t.value.kind)continue;const a="round"===n.layout.get("line-cap").evaluate(e,{}),o={dasharray:t.value.evaluate({zoom:i-1},e,{}),round:a},s={dasharray:t.value.evaluate({zoom:i},e,{}),round:a},l={dasharray:t.value.evaluate({zoom:i+1},e,{}),round:a},c=`${o.dasharray.join(",")},${o.round}`,h=`${s.dasharray.join(",")},${s.round}`,u=`${l.dasharray.join(",")},${l.round}`;r.dashDependencies[c]=o,r.dashDependencies[h]=s,r.dashDependencies[u]=l,e.dashes[n.id]={min:c,mid:h,max:u}}}}let hu,uu;pa("LineBucket",cu,{omit:["layers","patternFeatures"]});var du={get paint(){return uu=uu||new Ha({"line-opacity":new Ya(bt.paint_line["line-opacity"]),"line-color":new Ya(bt.paint_line["line-color"]),"line-translate":new Ga(bt.paint_line["line-translate"]),"line-translate-anchor":new Ga(bt.paint_line["line-translate-anchor"]),"line-width":new Ya(bt.paint_line["line-width"]),"line-gap-width":new Ya(bt.paint_line["line-gap-width"]),"line-offset":new Ya(bt.paint_line["line-offset"]),"line-blur":new Ya(bt.paint_line["line-blur"]),"line-dasharray":new Qa(bt.paint_line["line-dasharray"]),"line-pattern":new Qa(bt.paint_line["line-pattern"]),"line-gradient":new Xa(bt.paint_line["line-gradient"])})},get layout(){return hu=hu||new Ha({"line-cap":new Ya(bt.layout_line["line-cap"]),"line-join":new Ya(bt.layout_line["line-join"]),"line-miter-limit":new Ya(bt.layout_line["line-miter-limit"]),"line-round-limit":new Ya(bt.layout_line["line-round-limit"]),"line-sort-key":new Ya(bt.layout_line["line-sort-key"])})}};class pu extends Ya{possiblyEvaluate(t,e){return e=new za(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,r){return e=C({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,r)}}let mu;class fu extends $a{constructor(t,e){super(t,du,e),this.gradientVersion=0,mu||(mu=new pu(du.paint.properties["line-width"].specification),mu.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const t=this.gradientExpression();this.stepInterpolant=!!function(t){return void 0!==t._styleExpression}(t)&&t._styleExpression.expression instanceof li,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=mu.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new cu(t)}queryRadius(t){const e=t,i=gu(al("line-width",this,e),al("line-gap-width",this,e)),r=al("line-offset",this,e);return i/2+Math.abs(r)+ol(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:t,feature:e,featureState:r,geometry:n,transform:a,pixelsToTileUnits:o}){const s=sl(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-a.bearingInRadians,o),l=o/2*gu(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);return c&&(n=function(t,e){const r=[];for(let n=0;n<t.length;n++){const a=ll(t[n]),o=[];for(let t=0;t<a.length;t++){const r=a[t],n=a[t-1],s=a[t+1],l=0===t?new i(0,0):r.sub(n)._unit()._perp(),c=t===a.length-1?new i(0,0):s.sub(r)._unit()._perp(),h=l._add(c)._unit(),u=h.x*c.x+h.y*c.y;0!==u&&h._mult(1/u),o.push(h._mult(e)._add(r))}r.push(o)}return r}(n,c*o)),function(t,e,i){for(let r=0;r<e.length;r++){const n=e[r];if(t.length>=3)for(let e=0;e<n.length;e++)if(rl(t,n[e]))return!0;if(qs(t,n,i))return!0}return!1}(s,n,l)}isTileClipped(){return!0}}function gu(t,e){return e>0?e+2*t:t}const _u=oo([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),yu=oo([{name:"a_projected_pos",components:3,type:"Float32"}],4);oo([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const xu=oo([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);oo([{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"}]);const bu=oo([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),vu=oo([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Tu(t,e,i){return t.sections.forEach(t=>{t.text=function(t,e,i){const r=e.layout.get("text-transform").evaluate(i,{});return"uppercase"===r?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),ka.applyArabicShaping&&(t=ka.applyArabicShaping(t)),t}(t.text,e,i)}),t}oo([{name:"triangle",components:3,type:"Uint16"}]),oo([{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"}]),oo([{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"}]),oo([{type:"Float32",name:"offsetX"}]),oo([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),oo([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var wu=24;const Vu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","⋯":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Ru={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Mu={40:!0};function Uu(t,e,i,r,n,a){if("fontStack"in e){const r=i[e.fontStack],a=r&&r[t];return a?a.metrics.advance*e.scale+n:0}{const t=r[e.imageName];return t?t.displaySize[0]*e.scale*wu/a+n:0}}function Su(t,e,i,r){const n=Math.pow(t-e,2);return r?t<e?n/2:2*n:n+Math.abs(i)*i}function Nu(t,e,i){let r=0;return 10===t&&(r-=1e4),i&&(r+=150),40!==t&&65288!==t||(r+=50),41!==e&&65289!==e||(r+=50),r}function Eu(t,e,i,r,n,a){let o=null,s=Su(e,i,n,a);for(const t of r){const r=Su(e-t.x,i,n,a)+t.badness;r<=s&&(o=t,s=r)}return{index:t,x:e,priorBreak:o,badness:s}}function Fu(t){return t?Fu(t.priorBreak).concat(t.index):[]}class Zu{constructor(t="",e=[],i=[]){this.text=t,this.sections=e,this.sectionIndex=i,this.imageSectionID=null}static fromFeature(t,e){const i=new Zu;for(let r=0;r<t.sections.length;r++){const n=t.sections[r];n.image?i.addImageSection(n):i.addTextSection(n,e)}return i}length(){return[...this.text].length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}verticalizePunctuation(){this.text=function(t){let e="",i={premature:!0,value:void 0};const r=t[Symbol.iterator]();let n=r.next();const a=t[Symbol.iterator]();a.next();let o=a.next();for(;!n.done;)e+=!o.done&&Sa(o.value.codePointAt(0))&&!Vu[o.value]||!i.premature&&Sa(i.value.codePointAt(0))&&!Vu[i.value]||!Vu[n.value]?n.value:Vu[n.value],i={value:n.value,premature:!1},n=r.next(),o=a.next();return e}(this.text)}hasZeroWidthSpaces(){return this.text.includes("")}trim(){const t=this.text.match(/^\s*/),e=t?t[0].length:0,i=this.text.match(/\S\s*$/),r=i?i[0].length-1:0;this.text=this.text.substring(e,this.text.length-r),this.sectionIndex=this.sectionIndex.slice(e,this.sectionIndex.length-r)}substring(t,e){const i=[...this.text].slice(t,e).join(""),r=this.sectionIndex.slice(t,e);return new Zu(i,this.sections,r)}toCodeUnitIndex(t){return[...this.text].slice(0,t).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,e)=>Math.max(t,this.sections[e].scale),0)}getMaxImageSize(t){let e=0,i=0;for(let r=0;r<this.length();r++){const n=this.getSection(r);if("imageName"in n){const r=t[n.imageName];if(!r)continue;const a=r.displaySize;e=Math.max(e,a[0]),i=Math.max(i,a[1])}}return{maxImageWidth:e,maxImageHeight:i}}addTextSection(t,e){this.text+=t.text,this.sections.push({scale:t.scale||1,verticalAlign:t.verticalAlign||"bottom",fontStack:t.fontStack||e});const i=this.sections.length-1;this.sectionIndex.push(...[...t.text].map(()=>i))}addImageSection(t){const e=t.image?t.image.name:"";if(0===e.length)return void A("Can't add FormattedSection with an empty image.");const i=this.getNextImageSectionCharCode();i?(this.text+=String.fromCharCode(i),this.sections.push({scale:1,verticalAlign:t.verticalAlign||"bottom",imageName:e}),this.sectionIndex.push(this.sections.length-1)):A("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(t,e,i,r,n){const a=[],o=this.determineAverageLineWidth(t,e,i,r,n),s=this.hasZeroWidthSpaces();let l=0,c=0;const h=this.text[Symbol.iterator]();let u=h.next();const d=this.text[Symbol.iterator]();d.next();let p=d.next();const m=this.text[Symbol.iterator]();m.next(),m.next();let f=m.next();for(;!u.done;){const e=this.getSection(c),g=u.value.codePointAt(0);if(Ta(g)||(l+=Uu(g,e,i,r,t,n)),!p.done){const t=ba(g),i=p.value.codePointAt(0);(Ru[g]||t||"imageName"in e||!f.done&&Mu[i])&&a.push(Eu(c+1,l,o,a,Nu(g,i,t&&s),!1))}c++,u=h.next(),p=d.next(),f=m.next()}return Fu(Eu(this.length(),l,o,a,0,!0))}determineAverageLineWidth(t,e,i,r,n){let a=0,o=0;for(const e of this.text){const s=this.getSection(o);a+=Uu(e.codePointAt(0),s,i,r,t,n),o++}return a/Math.max(1,Math.ceil(a/e))}}const ku=4294967296,zu=1/ku,Wu="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");class Iu{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,e,i=this.length){for(;this.pos<i;){const i=this.readVarint(),r=i>>3,n=this.pos;this.type=7&i,t(r,e,this),this.pos===n&&this.skip(i)}return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){const t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){const t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*ku;return this.pos+=8,t}readSFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*ku;return this.pos+=8,t}readFloat(){const t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){const t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){const e=this.buf;let i,r;return r=e[this.pos++],i=127&r,r<128?i:(r=e[this.pos++],i|=(127&r)<<7,r<128?i:(r=e[this.pos++],i|=(127&r)<<14,r<128?i:(r=e[this.pos++],i|=(127&r)<<21,r<128?i:(r=e[this.pos],i|=(15&r)<<28,function(t,e,i){const r=i.buf;let n,a;if(a=r[i.pos++],n=(112&a)>>4,a<128)return Du(t,n,e);if(a=r[i.pos++],n|=(127&a)<<3,a<128)return Du(t,n,e);if(a=r[i.pos++],n|=(127&a)<<10,a<128)return Du(t,n,e);if(a=r[i.pos++],n|=(127&a)<<17,a<128)return Du(t,n,e);if(a=r[i.pos++],n|=(127&a)<<24,a<128)return Du(t,n,e);if(a=r[i.pos++],n|=(1&a)<<31,a<128)return Du(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(i,t,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return Boolean(this.readVarint())}readString(){const t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Wu?Wu.decode(this.buf.subarray(e,t)):function(t,e,i){let r="",n=e;for(;n<i;){const e=t[n];let a,o,s,l=null,c=e>239?4:e>223?3:e>191?2:1;if(n+c>i)break;1===c?e<128&&(l=e):2===c?(a=t[n+1],128==(192&a)&&(l=(31&e)<<6|63&a,l<=127&&(l=null))):3===c?(a=t[n+1],o=t[n+2],128==(192&a)&&128==(192&o)&&(l=(15&e)<<12|(63&a)<<6|63&o,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===c&&(a=t[n+1],o=t[n+2],s=t[n+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&e)<<18|(63&a)<<12|(63&o)<<6|63&s,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),n+=c}return r}(this.buf,e,t)}readBytes(){const t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readVarint(e));return t}readPackedSVarint(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFloat());return t}readPackedDouble(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed64());return t}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}skip(t){const e=7&t;if(0===e)for(;this.buf[this.pos++]>127;);else if(2===e)this.pos=this.readVarint()+this.pos;else if(5===e)this.pos+=4;else{if(1!==e)throw new Error(`Unimplemented type: ${e}`);this.pos+=8}}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e<this.pos+t;)e*=2;if(e!==this.length){const t=new Uint8Array(e);t.set(this.buf),this.buf=t,this.dataView=new DataView(t.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*zu),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*zu),!0),this.pos+=8}writeVarint(t){(t=+t||0)>268435455||t<0?function(t,e){let i,r;if(t>=0?(i=t%4294967296|0,r=t/4294967296|0):(i=~(-t%4294967296),r=~(-t/4294967296),4294967295^i?i=i+1|0:(i=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){const i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))}writeSVarint(t){this.writeVarint(t<0?2*-t-1:2*t)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(4*t.length),this.pos++;const e=this.pos;this.pos=function(t,e,i){for(let r,n,a=0;a<e.length;a++){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!n){r>56319||a+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);const i=this.pos-e;i>=128&&Cu(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){const e=t.length;this.writeVarint(e),this.realloc(e);for(let i=0;i<e;i++)this.buf[this.pos++]=t[i]}writeRawMessage(t,e){this.pos++;const i=this.pos;t(e,this);const r=this.pos-i;r>=128&&Cu(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r}writeMessage(t,e,i){this.writeTag(t,2),this.writeRawMessage(e,i)}writePackedVarint(t,e){e.length&&this.writeMessage(t,Bu,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,Pu,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,ju,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,Ou,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,Lu,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,Au,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,Gu,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,Yu,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,Qu,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}}function Du(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Cu(t,e,i){const r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(let e=i.pos-1;e>=t;e--)i.buf[e+r]=i.buf[e]}function Bu(t,e){for(let i=0;i<t.length;i++)e.writeVarint(t[i])}function Pu(t,e){for(let i=0;i<t.length;i++)e.writeSVarint(t[i])}function Ou(t,e){for(let i=0;i<t.length;i++)e.writeFloat(t[i])}function Lu(t,e){for(let i=0;i<t.length;i++)e.writeDouble(t[i])}function ju(t,e){for(let i=0;i<t.length;i++)e.writeBoolean(t[i])}function Au(t,e){for(let i=0;i<t.length;i++)e.writeFixed32(t[i])}function Gu(t,e){for(let i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Yu(t,e){for(let i=0;i<t.length;i++)e.writeFixed64(t[i])}function Qu(t,e){for(let i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Ju(t,e,i){1===t&&i.readMessage(Xu,e)}function Xu(t,e,i){if(3===t){const{id:t,bitmap:r,width:n,height:a,left:o,top:s,advance:l}=i.readMessage(Hu,{});e.push({id:t,bitmap:new Rl({width:n+6,height:a+6},r),metrics:{width:n,height:a,left:o,top:s,advance:l}})}}function Hu(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}function qu(t){let e=0,i=0;for(const r of t)e+=r.w*r.h,i=Math.max(i,r.w);t.sort((t,e)=>e.h-t.h);const r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let n=0,a=0;for(const e of t)for(let t=r.length-1;t>=0;t--){const i=r[t];if(!(e.w>i.w||e.h>i.h)){if(e.x=i.x,e.y=i.y,a=Math.max(a,e.y+e.h),n=Math.max(n,e.x+e.w),e.w===i.w&&e.h===i.h){const e=r.pop();e&&t<r.length&&(r[t]=e)}else e.h===i.h?(i.x+=e.w,i.w-=e.w):e.w===i.w?(i.y+=e.h,i.h-=e.h):(r.push({x:i.x+e.w,y:i.y,w:i.w-e.w,h:e.h}),i.y+=e.h,i.h-=e.h);break}}return{w:n,h:a,fill:e/(n*a)||0}}class Ku{constructor(t,{pixelRatio:e,version:i,stretchX:r,stretchY:n,content:a,textFitWidth:o,textFitHeight:s}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=r,this.stretchY=n,this.content=a,this.version=i,this.textFitWidth=o,this.textFitHeight=s}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class $u{constructor(t,e){const i={},r={};this.haveRenderCallbacks=[];const n=[];this.addImages(t,i,n),this.addImages(e,r,n);const{w:a,h:o}=qu(n),s=new Ml({width:a||1,height:o||1});for(const e in t){const r=t[e],n=i[e].paddedRect;Ml.copy(r.data,s,{x:0,y:0},{x:n.x+1,y:n.y+1},r.data)}for(const t in e){const i=e[t],n=r[t].paddedRect,a=n.x+1,o=n.y+1,l=i.data.width,c=i.data.height;Ml.copy(i.data,s,{x:0,y:0},{x:a,y:o},i.data),Ml.copy(i.data,s,{x:0,y:c-1},{x:a,y:o-1},{width:l,height:1}),Ml.copy(i.data,s,{x:0,y:0},{x:a,y:o+c},{width:l,height:1}),Ml.copy(i.data,s,{x:l-1,y:0},{x:a-1,y:o},{width:1,height:c}),Ml.copy(i.data,s,{x:0,y:0},{x:a+l,y:o},{width:1,height:c})}this.image=s,this.iconPositions=i,this.patternPositions=r}addImages(t,e,i){for(const r in t){const n=t[r],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};i.push(a),e[r]=new Ku(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(r)}}patchUpdatedImages(t,e){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const i in t.updatedImages)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),e),this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),e)}patchUpdatedImage(t,e,i){if(!t||!e)return;if(t.version===e.version)return;t.version=e.version;const[r,n]=t.tl;i.update(e.data,void 0,{x:r,y:n})}}var td;function ed(e,i,r,n,a,o,s,l,c,h,u,d,p,m,f){const g=Zu.fromFeature(e,a);let _;d===t.aw.vertical&&g.verticalizePunctuation();let y=g.determineLineBreaks(h,o,i,n,m);const{processBidirectionalText:x,processStyledBidirectionalText:b}=ka;if(x&&1===g.sections.length){_=[],y=y.map(t=>g.toCodeUnitIndex(t));const t=x(g.toString(),y);for(const e of t){const t=[...e].map(()=>0);_.push(new Zu(e,g.sections,t))}}else if(b){_=[],y=y.map(t=>g.toCodeUnitIndex(t));let t=0;const e=[];for(const i of g.text)e.push(...Array(i.length).fill(g.sectionIndex[t])),t++;const i=b(g.text,e,y);for(const t of i){const e=[];let i="";for(const r of t[0])e.push(t[1][i.length]),i+=r;_.push(new Zu(t[0],g.sections,e))}}else _=function(t,e){const i=[];let r=0;for(const n of e)i.push(t.substring(r,n)),r=n;return r<t.length()&&i.push(t.substring(r,t.length())),i}(g,y);const v=[],T={positionedLines:v,text:g.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:d,iconsInText:!1,verticalizable:!1};return function(t,e,i,r,n,a,o,s,l,c,h,u){let d=0,p=0,m=0,f=0;const g="right"===s?1:"left"===s?0:.5,_=wu/u;let y=0;for(const o of n){o.trim();const n=o.getMaxScale(),s={positionedGlyphs:[],lineOffset:0};t.positionedLines[y]=s;const u=s.positionedGlyphs;let x=0;if(!o.length()){p+=a,++y;continue}const b=rd(r,o,_);let v=0;for(const a of o.text){const s=o.getSection(v),m=a.codePointAt(0),f=ad(l,h,m),g={glyph:m,imageName:null,x:d,y:p+-17,vertical:f,scale:1,fontStack:"",sectionIndex:o.getSectionIndex(v),metrics:null,rect:null};let y;if("fontStack"in s){if(y=od(s,m,f,b,e,i),!y)continue;g.fontStack=s.fontStack}else{if(t.iconsInText=!0,s.scale*=_,y=sd(s,f,n,b,r),!y)continue;x=Math.max(x,y.imageOffset),g.imageName=s.imageName}const{rect:T,metrics:w,baselineOffset:V}=y;g.y+=V,g.scale=s.scale,g.metrics=w,g.rect=T,u.push(g),f?(t.verticalizable=!0,d+=("imageName"in s?w.advance:wu)*s.scale+c):d+=w.advance*s.scale+c,v++}0!==u.length&&(m=Math.max(d-c,m),ld(u,0,u.length-1,g)),d=0,s.lineOffset=Math.max(x,(n-1)*wu);const T=a*n+x;p+=T,f=Math.max(T,f),++y}const{horizontalAlign:x,verticalAlign:b}=id(o);(function(t,e,i,r,n,a,o,s,l){const c=(e-i)*n;let h=0;h=a!==o?-s*r- -17:-r*l*o+.5*o;for(const e of t)for(const t of e.positionedGlyphs)t.x+=c,t.y+=h})(t.positionedLines,g,x,b,m,f,a,p,n.length),t.top+=-b*p,t.bottom=t.top+p,t.left+=-x*m,t.right=t.left+m}(T,i,r,n,_,s,l,c,d,h,p,f),!function(t){for(const e of t)if(0!==e.positionedGlyphs.length)return!1;return!0}(v)&&T}function id(t){let e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function rd(t,e,i){const r=e.getMaxScale()*wu,{maxImageWidth:n,maxImageHeight:a}=e.getMaxImageSize(t),o=Math.max(r,a*i);return{verticalLineContentWidth:Math.max(r,n*i),horizontalLineContentHeight:o}}function nd(t){switch(t){case"top":return 0;case"center":return.5;default:return 1}}function ad(e,i,r){return!(e===t.aw.horizontal||!i&&!va(r)||i&&(Ta(r)||(n=r,/\p{sc=Arab}/u.test(String.fromCodePoint(n)))));var n}function od(t,e,i,r,n,a){const o=a[t.fontStack],s=function(t,e,i,r){if(t&&t.rect)return t;const n=e[i.fontStack],a=n&&n[r];return a?{rect:null,metrics:a.metrics}:null}(o&&o[e],n,t,e);if(null===s)return null;let l;if(i)l=r.verticalLineContentWidth-t.scale*wu;else{const e=nd(t.verticalAlign);l=(r.horizontalLineContentHeight-t.scale*wu)*e}return{rect:s.rect,metrics:s.metrics,baselineOffset:l}}function sd(t,e,i,r,n){const a=n[t.imageName];if(!a)return null;const o=a.paddedRect,s=a.displaySize,l={width:s[0],height:s[1],left:1,top:-3,advance:e?s[1]:s[0]};let c;if(e)c=r.verticalLineContentWidth-s[1]*t.scale;else{const e=nd(t.verticalAlign);c=(r.horizontalLineContentHeight-s[1]*t.scale)*e}return{rect:o,metrics:l,baselineOffset:c,imageOffset:(e?s[0]:s[1])*t.scale-wu*i}}function ld(t,e,i,r){if(0===r)return;const n=t[i],a=(t[i].x+n.metrics.advance*n.scale)*r;for(let r=e;r<=i;r++)t[r].x-=a}function cd(t,e,i){const{horizontalAlign:r,verticalAlign:n}=id(i),a=e[0]-t.displaySize[0]*r,o=e[1]-t.displaySize[1]*n;return{image:t,top:o,bottom:o+t.displaySize[1],left:a,right:a+t.displaySize[0]}}function hd(t){var e,i;let r=t.left,n=t.top,a=t.right-r,o=t.bottom-n;const s=null!==(e=t.image.textFitWidth)&&void 0!==e?e:"stretchOrShrink",l=null!==(i=t.image.textFitHeight)&&void 0!==i?i:"stretchOrShrink",c=(t.image.content[2]-t.image.content[0])/(t.image.content[3]-t.image.content[1]);if("proportional"===l){if("stretchOnly"===s&&a/o<c||"proportional"===s){const t=Math.ceil(o*c);r*=t/a,a=t}}else if("proportional"===s&&"stretchOnly"===l&&0!==c&&a/o>c){const t=Math.ceil(a/c);n*=t/o,o=t}return{x1:r,y1:n,x2:r+a,y2:n+o}}function ud(t,e,i,r,n,a){const o=t.image;let s;if(o.content){const t=o.content,e=o.pixelRatio||1;s=[t[0]/e,t[1]/e,o.displaySize[0]-t[2]/e,o.displaySize[1]-t[3]/e]}const l=e.left*a,c=e.right*a;let h,u,d,p;"width"===i||"both"===i?(p=n[0]+l-r[3],u=n[0]+c+r[1]):(p=n[0]+(l+c-o.displaySize[0])/2,u=p+o.displaySize[0]);const m=e.top*a,f=e.bottom*a;return"height"===i||"both"===i?(h=n[1]+m-r[0],d=n[1]+f+r[2]):(h=n[1]+(m+f-o.displaySize[1])/2,d=h+o.displaySize[1]),{image:o,top:h,right:u,bottom:d,left:p,collisionPadding:s}}pa("ImagePosition",Ku),pa("ImageAtlas",$u),t.aw=void 0,(td=t.aw||(t.aw={}))[td.none=0]="none",td[td.horizontal=1]="horizontal",td[td.vertical=2]="vertical",td[td.horizontalOnly=3]="horizontalOnly";const dd=128,pd=32640;function md(t,e){const{expression:i}=e;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new za(t+1))};if("source"===i.kind)return{kind:"source"};{const{zoomStops:e,interpolationType:r}=i;let n=0;for(;n<e.length&&e[n]<=t;)n++;n=Math.max(0,n-1);let a=n;for(;a<e.length&&e[a]<t+1;)a++;a=Math.min(e.length-1,a);const o=e[n],s=e[a];return"composite"===i.kind?{kind:"composite",minZoom:o,maxZoom:s,interpolationType:r}:{kind:"camera",minZoom:o,maxZoom:s,minSize:i.evaluate(new za(o)),maxSize:i.evaluate(new za(s)),interpolationType:r}}}function fd(t,e,i){let r="never";const n=t.get(e);return n?r=n:t.get(i)&&(r="always"),r}const gd=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function _d(t,e,i,r,n,a,o,s,l,c,h,u,d){const p=s?Math.min(pd,Math.round(s[0])):0,m=s?Math.min(pd,Math.round(s[1])):0;t.emplaceBack(e,i,Math.round(32*r),Math.round(32*n),a,o,(p<<1)+(l?1:0),m,16*c,16*h,256*u,256*d)}function yd(t,e,i){t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i)}function xd(t){for(const e of t.sections)if(Za(e.text))return!0;return!1}class bd{constructor(t){this.layoutVertexArray=new $o,this.indexArray=new ns,this.programConfigurations=t,this.segments=new ls,this.dynamicLayoutVertexArray=new ts,this.opacityVertexArray=new es,this.hasVisibleVertices=!1,this.placedSymbolArray=new Io}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(t,e,i,r){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,_u.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,yu.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,gd,!0),this.opacityVertexBuffer.itemSize=1),(i||r)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}pa("SymbolBuffers",bd);class vd{constructor(t,e,i){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new i,this.segments=new ls,this.collisionVertexArray=new rs}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,xu.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}pa("CollisionBuffers",vd);class Td{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=md(this.zoom,i["text-size"]),this.iconSizeData=md(this.zoom,i["icon-size"]);const r=this.layers[0].layout,n=r.get("symbol-sort-key"),a=r.get("symbol-z-order");this.canOverlap="never"!==fd(r,"text-overlap","text-allow-overlap")||"never"!==fd(r,"icon-overlap","icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&!n.isConstant(),this.sortFeaturesByY=("viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map(e=>t.aw[e])),this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id),this.sourceID=e.sourceID}createArrays(){this.text=new bd(new Cs(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new bd(new Cs(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new Bo,this.lineVertexArray=new Po,this.symbolInstances=new Co,this.textAnchorOffsets=new Lo}calculateGlyphDependencies(t,e,i,r,n){for(const a of t)if(e[a.codePointAt(0)]=!0,(i||r)&&n){const t=Vu[a];t&&(e[t.codePointAt(0)]=!0)}}populate(e,i,r){const n=this.layers[0],a=n.layout,o=a.get("text-font"),s=a.get("text-field"),l=a.get("icon-image"),c=("constant"!==s.value.kind||s.value.value instanceof Ze&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),h="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,u=a.get("symbol-sort-key");if(this.features=[],!c&&!h)return;const d=i.iconDependencies,p=i.glyphDependencies,m=i.availableImages,f=new za(this.zoom);for(const{feature:i,id:s,index:l,sourceLayerIndex:g}of e){const e=n._featureFilter.needGeometry,_=As(i,e);if(!n._featureFilter.filter(f,_,r))continue;let y,x;if(e||(_.geometry=js(i)),c){const t=n.getValueAndResolveTokens("text-field",_,r,m),e=Ze.factory(t),i=this.hasRTLText=this.hasRTLText||xd(e);(!i||"unavailable"===ka.getRTLTextPluginStatus()||i&&ka.isParsed())&&(y=Tu(e,n,_))}if(h){const t=n.getValueAndResolveTokens("icon-image",_,r,m);x=t instanceof Be?t:Be.fromString(t)}if(!y&&!x)continue;const b=this.sortFeaturesByKey?u.evaluate(_,{},r):void 0;if(this.features.push({id:s,text:y,icon:x,index:l,sourceLayerIndex:g,geometry:_.geometry,properties:i.properties,type:zc.types[i.type],sortKey:b}),x&&(d[x.name]=!0),y){const e=o.evaluate(_,{},r).join(","),i="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.aw.vertical)>=0;for(const t of y.sections)if(t.image)d[t.image.name]=!0;else{const r=wa(y.toString()),n=t.fontStack||e,a=p[n]=p[n]||{};this.calculateGlyphDependencies(t.text,a,i,this.allowVerticalPlacement,r)}}}"line"===a.get("symbol-placement")&&(this.features=function(t){const e={},i={},r=[];let n=0;function a(e){r.push(t[e]),n++}function o(t,e,n){const a=i[t];return delete i[t],i[e]=a,r[a].geometry[0].pop(),r[a].geometry[0]=r[a].geometry[0].concat(n[0]),a}function s(t,i,n){const a=e[i];return delete e[i],e[t]=a,r[a].geometry[0].shift(),r[a].geometry[0]=n[0].concat(r[a].geometry[0]),a}function l(t,e,i){const r=i?e[0][e[0].length-1]:e[0][0];return`${t}:${r.x}:${r.y}`}for(let c=0;c<t.length;c++){const h=t[c],u=h.geometry,d=h.text?h.text.toString():null;if(!d){a(c);continue}const p=l(d,u),m=l(d,u,!0);if(p in i&&m in e&&i[p]!==e[m]){const t=s(p,m,u),n=o(p,m,r[t].geometry);delete e[p],delete i[m],i[l(d,r[n].geometry,!0)]=n,r[t].geometry=null}else p in i?o(p,m,u):m in e?s(p,m,u):(a(c),e[p]=n-1,i[m]=n-1)}return r.filter(t=>t.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((t,e)=>t.sortKey-e.sortKey)}update(t,e,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:i}),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:i}))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,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(t,e){const i=this.lineVertexArray.length;if(void 0!==t.segment){let i=t.dist(e[t.segment+1]),r=t.dist(e[t.segment]);const n={};for(let r=t.segment+1;r<e.length;r++)n[r]={x:e[r].x,y:e[r].y,tileUnitDistanceFromAnchor:i},r<e.length-1&&(i+=e[r+1].dist(e[r]));for(let i=t.segment||0;i>=0;i--)n[i]={x:e[i].x,y:e[i].y,tileUnitDistanceFromAnchor:r},i>0&&(r+=e[i-1].dist(e[i]));for(let t=0;t<e.length;t++){const e=n[t];this.lineVertexArray.emplaceBack(e.x,e.y,e.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(e,i,r,n,a,o,s,l,c,h,u,d){const p=e.indexArray,m=e.layoutVertexArray,f=e.segments.prepareSegment(4*i.length,m,p,this.canOverlap?o.sortKey:void 0),g=this.glyphOffsetArray.length,_=f.vertexLength,y=this.allowVerticalPlacement&&s===t.aw.vertical?Math.PI/2:0,x=o.text&&o.text.sections;for(let t=0;t<i.length;t++){const{tl:n,tr:a,bl:s,br:c,tex:h,pixelOffsetTL:u,pixelOffsetBR:g,minFontScaleX:_,minFontScaleY:b,glyphOffset:v,isSDF:T,sectionIndex:w}=i[t],V=f.vertexLength,R=v[1];_d(m,l.x,l.y,n.x,R+n.y,h.x,h.y,r,T,u.x,u.y,_,b),_d(m,l.x,l.y,a.x,R+a.y,h.x+h.w,h.y,r,T,g.x,u.y,_,b),_d(m,l.x,l.y,s.x,R+s.y,h.x,h.y+h.h,r,T,u.x,g.y,_,b),_d(m,l.x,l.y,c.x,R+c.y,h.x+h.w,h.y+h.h,r,T,g.x,g.y,_,b),yd(e.dynamicLayoutVertexArray,l,y),p.emplaceBack(V,V+2,V+1),p.emplaceBack(V+1,V+2,V+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(v[0]),t!==i.length-1&&w===i[t+1].sectionIndex||e.programConfigurations.populatePaintArrays(m.length,o,o.index,{imagePositions:{},canonical:d,formattedSection:x&&x[w]})}e.placedSymbolArray.emplaceBack(l.x,l.y,g,this.glyphOffsetArray.length-g,_,c,h,l.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],s,0,!1,0,u)}_addCollisionDebugVertex(t,e,i,r,n,a){return e.emplaceBack(0,0),t.emplaceBack(i.x,i.y,r,n,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(t,e,r,n,a,o,s){const l=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),c=l.vertexLength,h=a.layoutVertexArray,u=a.collisionVertexArray,d=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(h,u,o,d,p,new i(t,e)),this._addCollisionDebugVertex(h,u,o,d,p,new i(r,e)),this._addCollisionDebugVertex(h,u,o,d,p,new i(r,n)),this._addCollisionDebugVertex(h,u,o,d,p,new i(t,n)),l.vertexLength+=4;const m=a.indexArray;m.emplaceBack(c,c+1),m.emplaceBack(c+1,c+2),m.emplaceBack(c+2,c+3),m.emplaceBack(c+3,c),l.primitiveLength+=4}addDebugCollisionBoxes(t,e,i,r){for(let n=t;n<e;n++){const t=this.collisionBoxArray.get(n);this.addCollisionDebugVertices(t.x1,t.y1,t.x2,t.y2,r?this.textCollisionBox:this.iconCollisionBox,t.anchorPoint,i)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new vd(is,bu.members,as),this.iconCollisionBox=new vd(is,bu.members,as);for(let t=0;t<this.symbolInstances.length;t++){const e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}}_deserializeCollisionBoxesForSymbol(t,e,i,r,n,a,o,s,l){const c={};for(let r=e;r<i;r++){const e=t.get(r);c.textBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.textFeatureIndex=e.featureIndex;break}for(let e=r;e<n;e++){const i=t.get(e);c.verticalTextBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},c.verticalTextFeatureIndex=i.featureIndex;break}for(let e=a;e<o;e++){const i=t.get(e);c.iconBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},c.iconFeatureIndex=i.featureIndex;break}for(let e=s;e<l;e++){const i=t.get(e);c.verticalIconBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},c.verticalIconFeatureIndex=i.featureIndex;break}return c}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){const i=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,e){const i=t.placedSymbolArray.get(e),r=i.vertexStartIndex+4*i.numGlyphs;for(let e=i.vertexStartIndex;e<r;e+=4)t.indexArray.emplaceBack(e,e+2,e+1),t.indexArray.emplaceBack(e+1,e+2,e+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const e=Math.sin(t),i=Math.cos(t),r=[],n=[],a=[];for(let t=0;t<this.symbolInstances.length;++t){a.push(t);const o=this.symbolInstances.get(t);r.push(0|Math.round(e*o.anchorX+i*o.anchorY)),n.push(o.featureIndex)}return a.sort((t,e)=>r[t]-r[e]||n[e]-n[t]),a}addToSortKeyRanges(t,e){const i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===e?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex),[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex].forEach((t,e,i)=>{t>=0&&i.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)}),e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let wd,Vd;pa("SymbolBucket",Td,{omit:["layers","collisionBoxArray","features","compareText"]}),Td.MAX_GLYPHS=65535,Td.addDynamicAttributes=yd;var Rd={get paint(){return Vd=Vd||new Ha({"icon-opacity":new Ya(bt.paint_symbol["icon-opacity"]),"icon-color":new Ya(bt.paint_symbol["icon-color"]),"icon-halo-color":new Ya(bt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ya(bt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ya(bt.paint_symbol["icon-halo-blur"]),"icon-translate":new Ga(bt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ga(bt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ya(bt.paint_symbol["text-opacity"]),"text-color":new Ya(bt.paint_symbol["text-color"],{runtimeType:Pt,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new Ya(bt.paint_symbol["text-halo-color"]),"text-halo-width":new Ya(bt.paint_symbol["text-halo-width"]),"text-halo-blur":new Ya(bt.paint_symbol["text-halo-blur"]),"text-translate":new Ga(bt.paint_symbol["text-translate"]),"text-translate-anchor":new Ga(bt.paint_symbol["text-translate-anchor"])})},get layout(){return wd=wd||new Ha({"symbol-placement":new Ga(bt.layout_symbol["symbol-placement"]),"symbol-spacing":new Ga(bt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ga(bt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ya(bt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ga(bt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ga(bt.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ga(bt.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ga(bt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ga(bt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ga(bt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ya(bt.layout_symbol["icon-size"]),"icon-text-fit":new Ga(bt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ga(bt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ya(bt.layout_symbol["icon-image"]),"icon-rotate":new Ya(bt.layout_symbol["icon-rotate"]),"icon-padding":new Ya(bt.layout_symbol["icon-padding"]),"icon-keep-upright":new Ga(bt.layout_symbol["icon-keep-upright"]),"icon-offset":new Ya(bt.layout_symbol["icon-offset"]),"icon-anchor":new Ya(bt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ga(bt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ga(bt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ga(bt.layout_symbol["text-rotation-alignment"]),"text-field":new Ya(bt.layout_symbol["text-field"]),"text-font":new Ya(bt.layout_symbol["text-font"]),"text-size":new Ya(bt.layout_symbol["text-size"]),"text-max-width":new Ya(bt.layout_symbol["text-max-width"]),"text-line-height":new Ga(bt.layout_symbol["text-line-height"]),"text-letter-spacing":new Ya(bt.layout_symbol["text-letter-spacing"]),"text-justify":new Ya(bt.layout_symbol["text-justify"]),"text-radial-offset":new Ya(bt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ga(bt.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ya(bt.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ya(bt.layout_symbol["text-anchor"]),"text-max-angle":new Ga(bt.layout_symbol["text-max-angle"]),"text-writing-mode":new Ga(bt.layout_symbol["text-writing-mode"]),"text-rotate":new Ya(bt.layout_symbol["text-rotate"]),"text-padding":new Ga(bt.layout_symbol["text-padding"]),"text-keep-upright":new Ga(bt.layout_symbol["text-keep-upright"]),"text-transform":new Ya(bt.layout_symbol["text-transform"]),"text-offset":new Ya(bt.layout_symbol["text-offset"]),"text-allow-overlap":new Ga(bt.layout_symbol["text-allow-overlap"]),"text-overlap":new Ga(bt.layout_symbol["text-overlap"]),"text-ignore-placement":new Ga(bt.layout_symbol["text-ignore-placement"]),"text-optional":new Ga(bt.layout_symbol["text-optional"])})}};class Md{constructor(t){if(void 0===t.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:It,this.defaultValue=t}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}pa("FormatSectionOverride",Md,{omit:["defaultValue"]});class Ud extends $a{constructor(t,e){super(t,Rd,e)}recalculate(t,e){if(super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const t=this.layout.get("text-writing-mode");if(t){const e=[];for(const i of t)e.indexOf(i)<0&&e.push(i);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,e,i,r){const n=this.layout.get(t).evaluate(e,{},i,r),a=this._unevaluatedLayout._values[t];return a.isDataDriven()||rn(a.value)||!n?n:function(t,e){return e.replace(/{([^{}]+)}/g,(e,i)=>t&&i in t?String(t[i]):"")}(e.properties,n)}createBucket(t){return new Td(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of Rd.paint.overridableProperties){if(!Ud.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),i=new Md(e),r=new en(i,e.property.specification);let n=null;n="constant"===e.value.kind||"source"===e.value.kind?new an("source",r):new on("composite",r,e.value.zoomStops),this.paint._values[t]=new ja(e.property,n,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,i){return!(!this.layout||e.isDataDriven()||i.isDataDriven())&&Ud.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const i=t.get("text-field"),r=Rd.paint.properties[e];let n=!1;const a=t=>{for(const e of t)if(r.overrides&&r.overrides.hasOverride(e))return void(n=!0)};if("constant"===i.value.kind&&i.value.value instanceof Ze)a(i.value.value.sections);else if("source"===i.value.kind||"composite"===i.value.kind){const t=e=>{n||(e instanceof Ge&&je(e.value)===Gt?a(e.value.sections):e instanceof Ni?a(e.sections):e.eachChild(t))},e=i.value;e._styleExpression&&t(e._styleExpression.expression)}return n}}let Sd;var Nd={get paint(){return Sd=Sd||new Ha({"background-color":new Ga(bt.paint_background["background-color"]),"background-pattern":new Ja(bt.paint_background["background-pattern"]),"background-opacity":new Ga(bt.paint_background["background-opacity"])})}};class Ed extends $a{constructor(t,e){super(t,Nd,e)}}class Fd extends $a{constructor(t,e){super(t,{},e),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Zd{constructor(t){this._methodToThrottle=t,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var t;this._triggered||(this._triggered=!0,null===(t=this._channel)||void 0===t||t.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const kd={once:!0},zd=6371008.8;class Wd{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Wd(D(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const e=Math.PI/180,i=this.lat*e,r=t.lat*e,n=Math.sin(i)*Math.sin(r)+Math.cos(i)*Math.cos(r)*Math.cos((t.lng-this.lng)*e);return zd*Math.acos(Math.min(n,1))}static convert(t){if(t instanceof Wd)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Wd(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Wd(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const Id=2*Math.PI*zd;function Dd(t){return Id*Math.cos(t*Math.PI/180)}function Cd(t){return(180+t)/360}function Bd(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Pd(t,e){return t/Dd(e)}function Od(t){return 360*t-180}function Ld(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function jd(t,e){return t*Dd(Ld(e))}class Ad{constructor(t,e,i=0){this.x=+t,this.y=+e,this.z=+i}static fromLngLat(t,e=0){const i=Wd.convert(t);return new Ad(Cd(i.lng),Bd(i.lat),Pd(e,i.lat))}toLngLat(){return new Wd(Od(this.x),Ld(this.y))}toAltitude(){return jd(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Id*(t=Ld(this.y),1/Math.cos(t*Math.PI/180));var t}}function Gd(t,e,i){var r=2*Math.PI*6378137/256/Math.pow(2,i);return[t*r-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}class Yd{constructor(t,e,i){if(!function(t,e,i){return!(t<0||t>25||i<0||i>=Math.pow(2,t)||e<0||e>=Math.pow(2,t))}(t,e,i))throw new Error(`x=${e}, y=${i}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);this.z=t,this.x=e,this.y=i,this.key=Xd(0,t,t,e,i)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,i){const r=(a=this.y,o=this.z,s=Gd(256*(n=this.x),256*(a=Math.pow(2,o)-a-1),o),l=Gd(256*(n+1),256*(a+1),o),s[0]+","+s[1]+","+l[0]+","+l[1]);var n,a,o,s,l;const c=function(t,e,i){let r,n="";for(let a=t;a>0;a--)r=1<<a-1,n+=(e&r?1:0)+(i&r?2:0);return n}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===i?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,e>1?"@2x":"").replace(/{quadkey}/g,c).replace(/{bbox-epsg-3857}/g,r)}isChildOf(t){const e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){const e=Math.pow(2,this.z);return new i((t.x*e-this.x)*N,(t.y*e-this.y)*N)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Qd{constructor(t,e){this.wrap=t,this.canonical=e,this.key=Xd(t,e.z,e.z,e.x,e.y)}}class Jd{constructor(t,e,i,r,n){if(this.terrainRttPosMatrix32f=null,t<i)throw new Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${i}`);this.overscaledZ=t,this.wrap=e,this.canonical=new Yd(i,+r,+n),this.key=Xd(e,t,i,r,n)}clone(){return new Jd(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const e=this.canonical.z-t;return t>this.canonical.z?new Jd(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Jd(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(t,e){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const i=this.canonical.z-t;return t>this.canonical.z?Xd(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Xd(this.wrap*+e,t,t,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(t){if(t.wrap!==this.wrap)return!1;if(this.overscaledZ-t.overscaledZ<=0)return!1;if(0===t.overscaledZ)return this.overscaledZ>0;const e=this.canonical.z-t.canonical.z;return!(e<0)&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new Jd(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const e=this.canonical.z+1,i=2*this.canonical.x,r=2*this.canonical.y;return[new Jd(e,this.wrap,e,i,r),new Jd(e,this.wrap,e,i+1,r),new Jd(e,this.wrap,e,i,r+1),new Jd(e,this.wrap,e,i+1,r+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new Jd(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new Jd(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Qd(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new Ad(t.x-this.wrap,t.y))}normalizeCoordinates(t,e,i=8192){if(t>=0&&t<i&&e>=0&&e<i)return{tileID:this,x:t,y:e};const r=Math.floor(t/i),n=Math.floor(e/i),a=t-r*i,o=e-n*i,s=this.canonical.z,l=1<<s,c=this.canonical.y+n;if(c<0||c>=l)return null;let h=this.canonical.x+r,u=this.wrap;return h<0?(u-=Math.ceil(-h/l),h=(h%l+l)%l):h>=l&&(u+=Math.floor(h/l),h%=l),{tileID:new Jd(this.overscaledZ,u,s,h,c),x:a,y:o}}}function Xd(t,e,i,r,n){(t*=2)<0&&(t=-1*t-1);const a=1<<i;return(a*a*t+a*n+r).toString(36)+i.toString(36)+e.toString(36)}pa("CanonicalTileID",Yd),pa("OverscaledTileID",Jd,{omit:["terrainRttPosMatrix32f"]});class Hd{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(t){return this.minX=Math.min(this.minX,t.x),this.minY=Math.min(this.minY,t.y),this.maxX=Math.max(this.maxX,t.x),this.maxY=Math.max(this.maxY,t.y),this}expandBy(t){return this.minX-=t,this.minY-=t,this.maxX+=t,this.maxY+=t,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(t){return this.expandBy(-t)}map(t){const e=new Hd;return e.extend(t(new i(this.minX,this.minY))),e.extend(t(new i(this.maxX,this.minY))),e.extend(t(new i(this.minX,this.maxY))),e.extend(t(new i(this.maxX,this.maxY))),e}static fromPoints(t){const e=new Hd;for(const i of t)e.extend(i);return e}contains(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(t){return!this.empty()&&!t.empty()&&t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY}intersects(t){return!this.empty()&&!t.empty()&&t.minX<=this.maxX&&t.maxX>=this.minX&&t.minY<=this.maxY&&t.maxY>=this.minY}}class qd{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){const i=t[e];this._stringToNumber[i]=e,this._numberToString[e]=i}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class Kd{constructor(t,e,i,r,n){this.type="Feature",this._vectorTileFeature=t,this._x=i,this._y=r,this._z=e,this.properties=t.properties,this.id=n}projectPoint(t,e,i,r){return[360*(t.x+e)/r-180,360/Math.PI*Math.atan(Math.exp((1-2*(t.y+i)/r)*Math.PI))-90]}projectLine(t,e,i,r){return t.map(t=>this.projectPoint(t,e,i,r))}get geometry(){if(this._geometry)return this._geometry;const t=this._vectorTileFeature,e=t.extent*Math.pow(2,this._z),i=t.extent*this._x,r=t.extent*this._y,n=t.loadGeometry();switch(t.type){case 1:{const t=[];for(const e of n)t.push(e[0]);const a=this.projectLine(t,i,r,e);this._geometry=1===t.length?{type:"Point",coordinates:a[0]}:{type:"MultiPoint",coordinates:a};break}case 2:{const t=n.map(t=>this.projectLine(t,i,r,e));this._geometry=1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t};break}case 3:{const t=Ic(n),a=[];for(const n of t)a.push(n.map(t=>this.projectLine(t,i,r,e)));this._geometry=1===a.length?{type:"Polygon",coordinates:a[0]}:{type:"MultiPolygon",coordinates:a};break}default:throw new Error(`unknown feature type: ${t.type}`)}return this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"_x"!==e&&"_y"!==e&&"_z"!==e&&(t[e]=this[e]);return t}}class $d{constructor(t,e,i){this._name=t,this.dataBuffer=e,"number"==typeof i?this._size=i:(this.nullabilityBuffer=i,this._size=i.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){return this.nullabilityBuffer?.get(t)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class tp extends $d{}class ep extends tp{getValueFromBuffer(t){return this.dataBuffer[t]}}class ip extends tp{getValueFromBuffer(t){return this.dataBuffer[t]}}class rp extends $d{constructor(t,e,i,r){super(t,e,r),this.delta=i}}class np extends rp{constructor(t,e,i,r){super(t,Int32Array.of(e),i,r)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}}class ap extends $d{constructor(t,e,i,r){super(t,r?Int32Array.of(e):Uint32Array.of(e),i)}getValueFromBuffer(t){return this.dataBuffer[0]}}class op{constructor(t,e,i,r,n=4096){this._name=t,this._geometryVector=e,this._idVector=i,this._propertyVectors=r,this._extent=n}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this._propertyVectors.map(t=>[t.name,t]))),this.propertyVectorsMap.get(t)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){const t=[],e=this.geometryVector.getGeometries();for(let i=0;i<this.numFeatures;i++){let r;if(this.idVector){const t=this.idVector.getValue(i);r=this.containsMaxSafeIntegerValues(this.idVector)&&null!==t?Number(t):t}const n={coordinates:e[i],type:this.geometryVector.geometryType(i)},a={};for(const t of this.propertyVectors){if(!t)continue;const e=t.name,r=t.getValue(i);null!==r&&(a[e]=r)}t.push({id:r,geometry:n,properties:a})}return t}containsMaxSafeIntegerValues(t){return t instanceof ep||t instanceof ap||t instanceof np||t instanceof ip}}class sp{constructor(t){this.value=t}get(){return this.value}set(t){this.value=t}increment(){return this.value++}add(t){this.value+=t}}var lp,cp;!function(t){t.NONE="NONE",t.DELTA="DELTA",t.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",t.RLE="RLE",t.MORTON="MORTON",t.PDE="PDE"}(lp||(lp={})),function(t){t.NONE="NONE",t.FAST_PFOR="FAST_PFOR",t.VARINT="VARINT",t.ALP="ALP"}(cp||(cp={}));const hp=new Uint32Array(33);hp[0]=0;for(let t=1;t<=32;t++)hp[t]=32===t?4294967295:4294967295>>>32-t;const up=hp,dp=256;function pp(t,e){return t-t%e}function mp(t){const e=t>>>0;return((255&e)<<24|(65280&e)<<8|e>>>8&65280|e>>>24&255)>>>0}const fp=function(){if(!Number.isFinite(65536))return 65536;const t=pp(Math.floor(65536),dp);return 0===t?dp:t}(),gp=3*fp/dp+fp|0;function _p(){const t=new Uint8Array(gp);return{dataToBePacked:new Array(33),dataPointers:new Int32Array(33),byteContainer:t,byteContainerI32:new Int32Array(t.buffer,t.byteOffset,t.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function yp(t,e,i,r,n){switch(n){case 1:!function(t,e,i,r){let n=r,a=e;for(let e=0;e<8;e++){const e=t[a++]>>>0;i[n++]=e>>>0&1,i[n++]=e>>>1&1,i[n++]=e>>>2&1,i[n++]=e>>>3&1,i[n++]=e>>>4&1,i[n++]=e>>>5&1,i[n++]=e>>>6&1,i[n++]=e>>>7&1,i[n++]=e>>>8&1,i[n++]=e>>>9&1,i[n++]=e>>>10&1,i[n++]=e>>>11&1,i[n++]=e>>>12&1,i[n++]=e>>>13&1,i[n++]=e>>>14&1,i[n++]=e>>>15&1,i[n++]=e>>>16&1,i[n++]=e>>>17&1,i[n++]=e>>>18&1,i[n++]=e>>>19&1,i[n++]=e>>>20&1,i[n++]=e>>>21&1,i[n++]=e>>>22&1,i[n++]=e>>>23&1,i[n++]=e>>>24&1,i[n++]=e>>>25&1,i[n++]=e>>>26&1,i[n++]=e>>>27&1,i[n++]=e>>>28&1,i[n++]=e>>>29&1,i[n++]=e>>>30&1,i[n++]=e>>>31&1}}(t,e,i,r);break;case 2:!function(t,e,i,r){let n=r,a=e;for(let e=0;e<8;e++){const e=t[a++]>>>0,r=t[a++]>>>0;i[n++]=e>>>0&3,i[n++]=e>>>2&3,i[n++]=e>>>4&3,i[n++]=e>>>6&3,i[n++]=e>>>8&3,i[n++]=e>>>10&3,i[n++]=e>>>12&3,i[n++]=e>>>14&3,i[n++]=e>>>16&3,i[n++]=e>>>18&3,i[n++]=e>>>20&3,i[n++]=e>>>22&3,i[n++]=e>>>24&3,i[n++]=e>>>26&3,i[n++]=e>>>28&3,i[n++]=e>>>30&3,i[n++]=r>>>0&3,i[n++]=r>>>2&3,i[n++]=r>>>4&3,i[n++]=r>>>6&3,i[n++]=r>>>8&3,i[n++]=r>>>10&3,i[n++]=r>>>12&3,i[n++]=r>>>14&3,i[n++]=r>>>16&3,i[n++]=r>>>18&3,i[n++]=r>>>20&3,i[n++]=r>>>22&3,i[n++]=r>>>24&3,i[n++]=r>>>26&3,i[n++]=r>>>28&3,i[n++]=r>>>30&3}}(t,e,i,r);break;case 3:!function(t,e,i,r){let n=r,a=e;for(let e=0;e<8;e++){const e=t[a++]>>>0,r=t[a++]>>>0,o=t[a++]>>>0;i[n++]=e>>>0&7,i[n++]=e>>>3&7,i[n++]=e>>>6&7,i[n++]=e>>>9&7,i[n++]=e>>>12&7,i[n++]=e>>>15&7,i[n++]=e>>>18&7,i[n++]=e>>>21&7,i[n++]=e>>>24&7,i[n++]=e>>>27&7,i[n++]=7&(e>>>30|(1&r)<<2),i[n++]=r>>>1&7,i[n++]=r>>>4&7,i[n++]=r>>>7&7,i[n++]=r>>>10&7,i[n++]=r>>>13&7,i[n++]=r>>>16&7,i[n++]=r>>>19&7,i[n++]=r>>>22&7,i[n++]=r>>>25&7,i[n++]=r>>>28&7,i[n++]=7&(r>>>31|(3&o)<<1),i[n++]=o>>>2&7,i[n++]=o>>>5&7,i[n++]=o>>>8&7,i[n++]=o>>>11&7,i[n++]=o>>>14&7,i[n++]=o>>>17&7,i[n++]=o>>>20&7,i[n++]=o>>>23&7,i[n++]=o>>>26&7,i[n++]=o>>>29&7}}(t,e,i,r);break;case 4:!function(t,e,i,r){let n=r,a=e;for(let e=0;e<8;e++){const e=t[a++]>>>0,r=t[a++]>>>0,o=t[a++]>>>0,s=t[a++]>>>0;i[n++]=e>>>0&15,i[n++]=e>>>4&15,i[n++]=e>>>8&15,i[n++]=e>>>12&15,i[n++]=e>>>16&15,i[n++]=e>>>20&15,i[n++]=e>>>24&15,i[n++]=e>>>28&15,i[n++]=r>>>0&15,i[n++]=r>>>4&15,i[n++]=r>>>8&15,i[n++]=r>>>12&15,i[n++]=r>>>16&15,i[n++]=r>>>20&15,i[n++]=r>>>24&15,i[n++]=r>>>28&15,i[n++]=o>>>0&15,i[n++]=o>>>4&15,i[n++]=o>>>8&15,i[n++]=o>>>12&15,i[n++]=o>>>16&15,i[n++]=o>>>20&15,i[n++]=o>>>24&15,i[n++]=o>>>28&15,i[n++]=s>>>0&15,i[n++]=s>>>4&15,i[n++]=s>>>8&15,i[n++]=s>>>12&15,i[n++]=s>>>16&15,i[n++]=s>>>20&15,i[n++]=s>>>24&15,i[n++]=s>>>28&15}}(t,e,i,r);break;case 5:!function(t,e,i,r){let n=r,a=e;for(let e=0;e<8;e++){const e=t[a++]>>>0,r=t[a++]>>>0,o=t[a++]>>>0,s=t[a++]>>>0,l=t[a++]>>>0;i[n++]=e>>>0&31,i[n++]=e>>>5&31,i[n++]=e>>>10&31,i[n++]=e>>>15&31,i[n++]=e>>>20&31,i[n++]=e>>>25&31,i[n++]=31&(e>>>30|(7&r)<<2),i[n++]=r>>>3&31,i[n++]=r>>>8&31,i[n++]=r>>>13&31,i[n++]=r>>>18&31,i[n++]=r>>>23&31,i[n++]=31&(r>>>28|(1&o)<<4),i[n++]=o>>>1&31,i[n++]=o>>>6&31,i[n++]=o>>>11&31,i[n++]=o>>>16&31,i[n++]=o>>>21&31,i[n++]=o>>>26&31,i[n++]=31&(o>>>31|(15&s)<<1),i[n++]=s>>>4&31,i[n++]=s>>>9&31,i[n++]=s>>>14&31,i[n++]=s>>>19&31,i[n++]=s>>>24&31,i[n++]=31&(s>>>29|(3&l)<<3),i[n++]=l>>>2&31,i[n++]=l>>>7&31,i[n++]=l>>>12&31,i[n++]=l>>>17&31,i[n++]=l>>>22&31,i[n++]=l>>>27&31}}(t,e,i,r);break;case 6:!function(t,e,i,r){let n=r,a=e;for(let e=0;e<8;e++){const e=t[a++]>>>0,r=t[a++]>>>0,o=t[a++]>>>0,s=t[a++]>>>0,l=t[a++]>>>0,c=t[a++]>>>0;i[n++]=e>>>0&63,i[n++]=e>>>6&63,i[n++]=e>>>12&63,i[n++]=e>>>18&63,i[n++]=e>>>24&63,i[n++]=63&(e>>>30|(15&r)<<2),i[n++]=r>>>4&63,i[n++]=r>>>10&63,i[n++]=r>>>16&63,i[n++]=r>>>22&63,i[n++]=63&(r>>>28|(3&o)<<4),i[n++]=o>>>2&63,i[n++]=o>>>8&63,i[n++]=o>>>14&63,i[n++]=o>>>20&63,i[n++]=o>>>26&63,i[n++]=s>>>0&63,i[n++]=s>>>6&63,i[n++]=s>>>12&63,i[n++]=s>>>18&63,i[n++]=s>>>24&63,i[n++]=63&(s>>>30|(15&l)<<2),i[n++]=l>>>4&63,i[n++]=l>>>10&63,i[n++]=l>>>16&63,i[n++]=l>>>22&63,i[n++]=63&(l>>>28|(3&c)<<4),i[n++]=c>>>2&63,i[n++]=c>>>8&63,i[n++]=c>>>14&63,i[n++]=c>>>20&63,i[n++]=c>>>26&63}}(t,e,i,r);break;case 7:!function(t,e,i,r){let n=r,a=e;for(let e=0;e<8;e++){const e=t[a++]>>>0,r=t[a++]>>>0,o=t[a++]>>>0,s=t[a++]>>>0,l=t[a++]>>>0,c=t[a++]>>>0,h=t[a++]>>>0;i[n++]=e>>>0&127,i[n++]=e>>>7&127,i[n++]=e>>>14&127,i[n++]=e>>>21&127,i[n++]=127&(e>>>28|(7&r)<<4),i[n++]=r>>>3&127,i[n++]=r>>>10&127,i[n++]=r>>>17&127,i[n++]=r>>>24&127,i[n++]=127&(r>>>31|(63&o)<<1),i[n++]=o>>>6&127,i[n++]=o>>>13&127,i[n++]=o>>>20&127,i[n++]=127&(o>>>27|(3&s)<<5),i[n++]=s>>>2&127,i[n++]=s>>>9&127,i[n++]=s>>>16&127,i[n++]=s>>>23&127,i[n++]=127&(s>>>30|(31&l)<<2),i[n++]=l>>>5&127,i[n++]=l>>>12&127,i[n++]=l>>>19&127,i[n++]=127&(l>>>26|(1&c)<<6),i[n++]=c>>>1&127,i[n++]=c>>>8&127,i[n++]=c>>>15&127,i[n++]=c>>>22&127,i[n++]=127&(c>>>29|(15&h)<<3),i[n++]=h>>>4&127,i[n++]=h>>>11&127,i[n++]=h>>>18&127,i[n++]=h>>>25&127}}(t,e,i,r);break;case 8:!function(t,e,i,r){let n=r,a=e;for(let e=0;e<8;e++){const e=t[a++]>>>0,r=t[a++]>>>0,o=t[a++]>>>0,s=t[a++]>>>0,l=t[a++]>>>0,c=t[a++]>>>0,h=t[a++]>>>0,u=t[a++]>>>0;i[n++]=e>>>0&255,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=r>>>0&255,i[n++]=r>>>8&255,i[n++]=r>>>16&255,i[n++]=r>>>24&255,i[n++]=o>>>0&255,i[n++]=o>>>8&255,i[n++]=o>>>16&255,i[n++]=o>>>24&255,i[n++]=s>>>0&255,i[n++]=s>>>8&255,i[n++]=s>>>16&255,i[n++]=s>>>24&255,i[n++]=l>>>0&255,i[n++]=l>>>8&255,i[n++]=l>>>16&255,i[n++]=l>>>24&255,i[n++]=c>>>0&255,i[n++]=c>>>8&255,i[n++]=c>>>16&255,i[n++]=c>>>24&255,i[n++]=h>>>0&255,i[n++]=h>>>8&255,i[n++]=h>>>16&255,i[n++]=h>>>24&255,i[n++]=u>>>0&255,i[n++]=u>>>8&255,i[n++]=u>>>16&255,i[n++]=u>>>24&255}}(t,e,i,r);break;case 16:!function(t,e,i,r){let n=r,a=e;for(let e=0;e<128;e++){const e=t[a++]>>>0;i[n++]=65535&e,i[n++]=e>>>16&65535}}(t,e,i,r);break;default:!function(t,e,i,r,n){const a=up[n]>>>0;let o=e,s=0,l=t[o]>>>0,c=r;for(let e=0;e<8;e++){for(let e=0;e<32;e++)if(s+n<=32)i[c+e]=l>>>s&a,s+=n,32===s&&(s=0,o++,31!==e&&(l=t[o]>>>0));else{const r=32-s,h=l>>>s;o++,l=t[o]>>>0;const u=n-r;i[c+e]=(h|(l&-1>>>32-u>>>0)<<r)&a,s=u}c+=32,s=0,e<7&&(l=t[o]>>>0)}}(t,e,i,r,n)}return e+(n<<3)|0}function xp(t,e,i,r){if(i+2>e)throw new Error(`FastPFOR decode: byteContainer underflow at block=${r} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${i}, byteSize=${e})`);const n=t[i++],a=t[i++];if(n>32)throw new Error(`FastPFOR decode: invalid bitWidth=${n} at block=${r} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:n,exceptionCount:a,bytePosIn:i}}function bp(t,e,i,r,n,a,o,s,l){const{maxBits:c,exceptionBitWidth:h,bytePosIn:u}=function(t,e,i,r,n,a){if(i+1>e)throw new Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${i}, byteSize=${e})`);const o=t[i++];if(o<r||o>32)throw new Error(`FastPFOR decode: invalid maxBits=${o} at block=${a} (bitWidth=${r}, expected ${r}..32)`);const s=o-r|0;if(s<1||s>32)throw new Error(`FastPFOR decode: invalid exceptionBitWidth=${s} at block=${a} (bitWidth=${r}, maxBits=${o})`);if(i+n>e)throw new Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${n}, have=${e-i})`);return{maxBits:o,exceptionBitWidth:s,bytePosIn:i}}(n,a,o,i,r,l);if(o=u,1===h){const a=1<<i;for(let i=0;i<r;i=i+1|0)t[n[o++]+e|0]|=a;return o}const d=s.dataToBePacked[h];if(!d)throw new Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${h} (bitWidth=${i}, maxBits=${c}) at block ${l}`);const p=s.dataPointers;let m=0|p[h];const f=0|s.exceptionSizes[h];if(m+r>f)throw new Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${h} (ptr=${m}, need ${r}, size=${f}) at block ${l}`);for(let a=0;a<r;a=a+1|0){const r=n[o++],a=0|d[m++];t[r+e|0]|=a<<i}return p[h]=m,o}function vp(t,e,i,r,n,a){const o=0|i,s=0|t[o];if(s<=0||o+s>t.length-1)throw new Error(`FastPFOR decode: invalid whereMeta=${s} at pageStart=${o} (expected > 0 and pageStart+whereMeta < encoded.length=${t.length})`);const l=o+1|0,c=o+s|0,h=t[c]>>>0,u=h+3>>>2,d=c+1,p=d+u;if(p>=t.length)throw new Error(`FastPFOR decode: invalid byteSize=${h} (metaInts=${u}, pageStart=${o}, packedEnd=${c}, byteContainerStart=${d}) causes bitmapPos=${p} out of bounds (encoded.length=${t.length})`);const m=function(t,e,i,r){r.byteContainer.length<i&&(r.byteContainer=new Uint8Array(2*i),r.byteContainerI32=void 0);const n=r.byteContainer,a=i>>>2;if(3&n.byteOffset)for(let i=0;i<a;i=i+1|0){const r=0|t[e+i|0],a=i<<2;n[a]=255&r,n[a+1|0]=r>>>8&255,n[a+2|0]=r>>>16&255,n[a+3|0]=r>>>24&255}else{let i=r.byteContainerI32;(!i||i.buffer!==n.buffer||i.byteOffset!==n.byteOffset||i.length<a)&&(i=r.byteContainerI32=new Int32Array(n.buffer,n.byteOffset,n.byteLength>>>2)),i.set(t.subarray(e,e+a))}const o=3&i;if(o>0){const i=0|t[e+a|0],r=a<<2;for(let t=0;t<o;t=t+1|0)n[r+t|0]=i>>>(t<<3)&255}return n}(t,d,h,a),f=h,g=function(t,e,i){const r=0|t[e++],n=i.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(r>>>a-1&1))continue;if(e>=t.length)throw new Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${e}, needWords=1, availableWords=${t.length-e}, encodedWords=${t.length})`);const o=t[e++]>>>0,s=pp(o+31,32),l=o*a+31>>>5;if(e+l>t.length)throw new Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${o}, streamWordIndex=${e}, needWords=${l}, availableWords=${t.length-e}, encodedWords=${t.length})`);let c=n[a];(!c||c.length<s)&&(c=n[a]=new Uint32Array(s));let h=0;for(;h<o;h=h+32|0)Tp(t,e,c,h,a),e=e+a|0;e=e-((h-o|0)*a>>>5)|0,i.exceptionSizes[a]=o}return e}(t,p,a);return a.dataPointers.fill(0),function(t,e,i,r,n,a,o,s,l,c){let h=0|i,u=0;for(let e=0;e<o;e=e+1|0){const i=xp(s,l,u,e);u=i.bytePosIn;const r=i.bitWidth,o=i.exceptionCount,d=a+e*dp|0;switch(r){case 0:n.fill(0,d,d+dp);break;case 32:for(let e=0;e<dp;e=e+1|0)n[d+e|0]=0|t[h+e|0];h=h+dp|0;break;default:h=yp(t,h,n,d,r)}o>0&&(u=bp(n,d,r,o,s,l,u,c,e))}if(h!==r)throw new Error(`FastPFOR decode: packed region mismatch (pageStart=${e}, packedStart=${i}, consumedPackedEnd=${h}, expectedPackedEnd=${r}, packedWords=${r-i}, encoded.length=${t.length})`)}(t,o,l,c,e,0|r,n/dp|0,m,f,a),g}function Tp(t,e,i,r,n){switch(n){case 2:return void function(t,e,i,r){let n=r;const a=t[e]>>>0,o=t[e+1]>>>0;i[n++]=a>>>0&3,i[n++]=a>>>2&3,i[n++]=a>>>4&3,i[n++]=a>>>6&3,i[n++]=a>>>8&3,i[n++]=a>>>10&3,i[n++]=a>>>12&3,i[n++]=a>>>14&3,i[n++]=a>>>16&3,i[n++]=a>>>18&3,i[n++]=a>>>20&3,i[n++]=a>>>22&3,i[n++]=a>>>24&3,i[n++]=a>>>26&3,i[n++]=a>>>28&3,i[n++]=a>>>30&3,i[n++]=o>>>0&3,i[n++]=o>>>2&3,i[n++]=o>>>4&3,i[n++]=o>>>6&3,i[n++]=o>>>8&3,i[n++]=o>>>10&3,i[n++]=o>>>12&3,i[n++]=o>>>14&3,i[n++]=o>>>16&3,i[n++]=o>>>18&3,i[n++]=o>>>20&3,i[n++]=o>>>22&3,i[n++]=o>>>24&3,i[n++]=o>>>26&3,i[n++]=o>>>28&3,i[n]=o>>>30&3}(t,e,i,r);case 3:return void function(t,e,i,r){let n=r;const a=t[e]>>>0,o=t[e+1]>>>0,s=t[e+2]>>>0;i[n++]=a>>>0&7,i[n++]=a>>>3&7,i[n++]=a>>>6&7,i[n++]=a>>>9&7,i[n++]=a>>>12&7,i[n++]=a>>>15&7,i[n++]=a>>>18&7,i[n++]=a>>>21&7,i[n++]=a>>>24&7,i[n++]=a>>>27&7,i[n++]=7&(a>>>30|(1&o)<<2),i[n++]=o>>>1&7,i[n++]=o>>>4&7,i[n++]=o>>>7&7,i[n++]=o>>>10&7,i[n++]=o>>>13&7,i[n++]=o>>>16&7,i[n++]=o>>>19&7,i[n++]=o>>>22&7,i[n++]=o>>>25&7,i[n++]=o>>>28&7,i[n++]=7&(o>>>31|(3&s)<<1),i[n++]=s>>>2&7,i[n++]=s>>>5&7,i[n++]=s>>>8&7,i[n++]=s>>>11&7,i[n++]=s>>>14&7,i[n++]=s>>>17&7,i[n++]=s>>>20&7,i[n++]=s>>>23&7,i[n++]=s>>>26&7,i[n]=s>>>29&7}(t,e,i,r);case 4:return void function(t,e,i,r){let n=r;const a=t[e]>>>0,o=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0;i[n++]=a>>>0&15,i[n++]=a>>>4&15,i[n++]=a>>>8&15,i[n++]=a>>>12&15,i[n++]=a>>>16&15,i[n++]=a>>>20&15,i[n++]=a>>>24&15,i[n++]=a>>>28&15,i[n++]=o>>>0&15,i[n++]=o>>>4&15,i[n++]=o>>>8&15,i[n++]=o>>>12&15,i[n++]=o>>>16&15,i[n++]=o>>>20&15,i[n++]=o>>>24&15,i[n++]=o>>>28&15,i[n++]=s>>>0&15,i[n++]=s>>>4&15,i[n++]=s>>>8&15,i[n++]=s>>>12&15,i[n++]=s>>>16&15,i[n++]=s>>>20&15,i[n++]=s>>>24&15,i[n++]=s>>>28&15,i[n++]=l>>>0&15,i[n++]=l>>>4&15,i[n++]=l>>>8&15,i[n++]=l>>>12&15,i[n++]=l>>>16&15,i[n++]=l>>>20&15,i[n++]=l>>>24&15,i[n]=l>>>28&15}(t,e,i,r);case 5:return void function(t,e,i,r){let n=r;const a=t[e]>>>0,o=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0;i[n++]=a>>>0&31,i[n++]=a>>>5&31,i[n++]=a>>>10&31,i[n++]=a>>>15&31,i[n++]=a>>>20&31,i[n++]=a>>>25&31,i[n++]=31&(a>>>30|(7&o)<<2),i[n++]=o>>>3&31,i[n++]=o>>>8&31,i[n++]=o>>>13&31,i[n++]=o>>>18&31,i[n++]=o>>>23&31,i[n++]=31&(o>>>28|(1&s)<<4),i[n++]=s>>>1&31,i[n++]=s>>>6&31,i[n++]=s>>>11&31,i[n++]=s>>>16&31,i[n++]=s>>>21&31,i[n++]=s>>>26&31,i[n++]=31&(s>>>31|(15&l)<<1),i[n++]=l>>>4&31,i[n++]=l>>>9&31,i[n++]=l>>>14&31,i[n++]=l>>>19&31,i[n++]=l>>>24&31,i[n++]=31&(l>>>29|(3&c)<<3),i[n++]=c>>>2&31,i[n++]=c>>>7&31,i[n++]=c>>>12&31,i[n++]=c>>>17&31,i[n++]=c>>>22&31,i[n]=c>>>27&31}(t,e,i,r);case 6:return void function(t,e,i,r){let n=r;const a=t[e]>>>0,o=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0;i[n++]=a>>>0&63,i[n++]=a>>>6&63,i[n++]=a>>>12&63,i[n++]=a>>>18&63,i[n++]=a>>>24&63,i[n++]=63&(a>>>30|(15&o)<<2),i[n++]=o>>>4&63,i[n++]=o>>>10&63,i[n++]=o>>>16&63,i[n++]=o>>>22&63,i[n++]=63&(o>>>28|(3&s)<<4),i[n++]=s>>>2&63,i[n++]=s>>>8&63,i[n++]=s>>>14&63,i[n++]=s>>>20&63,i[n++]=s>>>26&63,i[n++]=l>>>0&63,i[n++]=l>>>6&63,i[n++]=l>>>12&63,i[n++]=l>>>18&63,i[n++]=l>>>24&63,i[n++]=63&(l>>>30|(15&c)<<2),i[n++]=c>>>4&63,i[n++]=c>>>10&63,i[n++]=c>>>16&63,i[n++]=c>>>22&63,i[n++]=63&(c>>>28|(3&h)<<4),i[n++]=h>>>2&63,i[n++]=h>>>8&63,i[n++]=h>>>14&63,i[n++]=h>>>20&63,i[n]=h>>>26&63}(t,e,i,r);case 7:return void function(t,e,i,r){let n=r;const a=t[e]>>>0,o=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0,u=t[e+6]>>>0;i[n++]=a>>>0&127,i[n++]=a>>>7&127,i[n++]=a>>>14&127,i[n++]=a>>>21&127,i[n++]=127&(a>>>28|(7&o)<<4),i[n++]=o>>>3&127,i[n++]=o>>>10&127,i[n++]=o>>>17&127,i[n++]=o>>>24&127,i[n++]=127&(o>>>31|(63&s)<<1),i[n++]=s>>>6&127,i[n++]=s>>>13&127,i[n++]=s>>>20&127,i[n++]=127&(s>>>27|(3&l)<<5),i[n++]=l>>>2&127,i[n++]=l>>>9&127,i[n++]=l>>>16&127,i[n++]=l>>>23&127,i[n++]=127&(l>>>30|(31&c)<<2),i[n++]=c>>>5&127,i[n++]=c>>>12&127,i[n++]=c>>>19&127,i[n++]=127&(c>>>26|(1&h)<<6),i[n++]=h>>>1&127,i[n++]=h>>>8&127,i[n++]=h>>>15&127,i[n++]=h>>>22&127,i[n++]=127&(h>>>29|(15&u)<<3),i[n++]=u>>>4&127,i[n++]=u>>>11&127,i[n++]=u>>>18&127,i[n]=u>>>25&127}(t,e,i,r);case 8:return void function(t,e,i,r){let n=r;const a=t[e]>>>0,o=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0,u=t[e+6]>>>0,d=t[e+7]>>>0;i[n++]=a>>>0&255,i[n++]=a>>>8&255,i[n++]=a>>>16&255,i[n++]=a>>>24&255,i[n++]=o>>>0&255,i[n++]=o>>>8&255,i[n++]=o>>>16&255,i[n++]=o>>>24&255,i[n++]=s>>>0&255,i[n++]=s>>>8&255,i[n++]=s>>>16&255,i[n++]=s>>>24&255,i[n++]=l>>>0&255,i[n++]=l>>>8&255,i[n++]=l>>>16&255,i[n++]=l>>>24&255,i[n++]=c>>>0&255,i[n++]=c>>>8&255,i[n++]=c>>>16&255,i[n++]=c>>>24&255,i[n++]=h>>>0&255,i[n++]=h>>>8&255,i[n++]=h>>>16&255,i[n++]=h>>>24&255,i[n++]=u>>>0&255,i[n++]=u>>>8&255,i[n++]=u>>>16&255,i[n++]=u>>>24&255,i[n++]=d>>>0&255,i[n++]=d>>>8&255,i[n++]=d>>>16&255,i[n]=d>>>24&255}(t,e,i,r);case 9:return void function(t,e,i,r){let n=r;const a=t[e]>>>0,o=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0,u=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0;i[n++]=a>>>0&511,i[n++]=a>>>9&511,i[n++]=a>>>18&511,i[n++]=511&(a>>>27|(15&o)<<5),i[n++]=o>>>4&511,i[n++]=o>>>13&511,i[n++]=o>>>22&511,i[n++]=511&(o>>>31|(255&s)<<1),i[n++]=s>>>8&511,i[n++]=s>>>17&511,i[n++]=511&(s>>>26|(7&l)<<6),i[n++]=l>>>3&511,i[n++]=l>>>12&511,i[n++]=l>>>21&511,i[n++]=511&(l>>>30|(127&c)<<2),i[n++]=c>>>7&511,i[n++]=c>>>16&511,i[n++]=511&(c>>>25|(3&h)<<7),i[n++]=h>>>2&511,i[n++]=h>>>11&511,i[n++]=h>>>20&511,i[n++]=511&(h>>>29|(63&u)<<3),i[n++]=u>>>6&511,i[n++]=u>>>15&511,i[n++]=511&(u>>>24|(1&d)<<8),i[n++]=d>>>1&511,i[n++]=d>>>10&511,i[n++]=d>>>19&511,i[n++]=511&(d>>>28|(31&p)<<4),i[n++]=p>>>5&511,i[n++]=p>>>14&511,i[n]=p>>>23&511}(t,e,i,r);case 10:return void function(t,e,i,r){let n=r;const a=t[e]>>>0,o=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0,u=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0,m=t[e+9]>>>0;i[n++]=a>>>0&1023,i[n++]=a>>>10&1023,i[n++]=a>>>20&1023,i[n++]=1023&(a>>>30|(255&o)<<2),i[n++]=o>>>8&1023,i[n++]=o>>>18&1023,i[n++]=1023&(o>>>28|(63&s)<<4),i[n++]=s>>>6&1023,i[n++]=s>>>16&1023,i[n++]=1023&(s>>>26|(15&l)<<6),i[n++]=l>>>4&1023,i[n++]=l>>>14&1023,i[n++]=1023&(l>>>24|(3&c)<<8),i[n++]=c>>>2&1023,i[n++]=c>>>12&1023,i[n++]=c>>>22&1023,i[n++]=h>>>0&1023,i[n++]=h>>>10&1023,i[n++]=h>>>20&1023,i[n++]=1023&(h>>>30|(255&u)<<2),i[n++]=u>>>8&1023,i[n++]=u>>>18&1023,i[n++]=1023&(u>>>28|(63&d)<<4),i[n++]=d>>>6&1023,i[n++]=d>>>16&1023,i[n++]=1023&(d>>>26|(15&p)<<6),i[n++]=p>>>4&1023,i[n++]=p>>>14&1023,i[n++]=1023&(p>>>24|(3&m)<<8),i[n++]=m>>>2&1023,i[n++]=m>>>12&1023,i[n]=m>>>22&1023}(t,e,i,r);case 11:return void function(t,e,i,r){let n=r;const a=t[e]>>>0,o=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0,u=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0,m=t[e+9]>>>0,f=t[e+10]>>>0;i[n++]=a>>>0&2047,i[n++]=a>>>11&2047,i[n++]=2047&(a>>>22|(1&o)<<10),i[n++]=o>>>1&2047,i[n++]=o>>>12&2047,i[n++]=2047&(o>>>23|(3&s)<<9),i[n++]=s>>>2&2047,i[n++]=s>>>13&2047,i[n++]=2047&(s>>>24|(7&l)<<8),i[n++]=l>>>3&2047,i[n++]=l>>>14&2047,i[n++]=2047&(l>>>25|(15&c)<<7),i[n++]=c>>>4&2047,i[n++]=c>>>15&2047,i[n++]=2047&(c>>>26|(31&h)<<6),i[n++]=h>>>5&2047,i[n++]=h>>>16&2047,i[n++]=2047&(h>>>27|(63&u)<<5),i[n++]=u>>>6&2047,i[n++]=u>>>17&2047,i[n++]=2047&(u>>>28|(127&d)<<4),i[n++]=d>>>7&2047,i[n++]=d>>>18&2047,i[n++]=2047&(d>>>29|(255&p)<<3),i[n++]=p>>>8&2047,i[n++]=p>>>19&2047,i[n++]=2047&(p>>>30|(511&m)<<2),i[n++]=m>>>9&2047,i[n++]=m>>>20&2047,i[n++]=2047&(m>>>31|(1023&f)<<1),i[n++]=f>>>10&2047,i[n]=f>>>21&2047}(t,e,i,r);case 12:return void function(t,e,i,r){let n=r;const a=t[e]>>>0,o=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0,u=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0,m=t[e+9]>>>0,f=t[e+10]>>>0,g=t[e+11]>>>0;i[n++]=a>>>0&4095,i[n++]=a>>>12&4095,i[n++]=4095&(a>>>24|(15&o)<<8),i[n++]=o>>>4&4095,i[n++]=o>>>16&4095,i[n++]=4095&(o>>>28|(255&s)<<4),i[n++]=s>>>8&4095,i[n++]=s>>>20&4095,i[n++]=l>>>0&4095,i[n++]=l>>>12&4095,i[n++]=4095&(l>>>24|(15&c)<<8),i[n++]=c>>>4&4095,i[n++]=c>>>16&4095,i[n++]=4095&(c>>>28|(255&h)<<4),i[n++]=h>>>8&4095,i[n++]=h>>>20&4095,i[n++]=u>>>0&4095,i[n++]=u>>>12&4095,i[n++]=4095&(u>>>24|(15&d)<<8),i[n++]=d>>>4&4095,i[n++]=d>>>16&4095,i[n++]=4095&(d>>>28|(255&p)<<4),i[n++]=p>>>8&4095,i[n++]=p>>>20&4095,i[n++]=m>>>0&4095,i[n++]=m>>>12&4095,i[n++]=4095&(m>>>24|(15&f)<<8),i[n++]=f>>>4&4095,i[n++]=f>>>16&4095,i[n++]=4095&(f>>>28|(255&g)<<4),i[n++]=g>>>8&4095,i[n]=g>>>20&4095}(t,e,i,r);case 16:return void function(t,e,i,r){let n=r;const a=t[e]>>>0,o=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0,u=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0,m=t[e+9]>>>0,f=t[e+10]>>>0,g=t[e+11]>>>0,_=t[e+12]>>>0,y=t[e+13]>>>0,x=t[e+14]>>>0,b=t[e+15]>>>0;i[n++]=a>>>0&65535,i[n++]=a>>>16&65535,i[n++]=o>>>0&65535,i[n++]=o>>>16&65535,i[n++]=s>>>0&65535,i[n++]=s>>>16&65535,i[n++]=l>>>0&65535,i[n++]=l>>>16&65535,i[n++]=c>>>0&65535,i[n++]=c>>>16&65535,i[n++]=h>>>0&65535,i[n++]=h>>>16&65535,i[n++]=u>>>0&65535,i[n++]=u>>>16&65535,i[n++]=d>>>0&65535,i[n++]=d>>>16&65535,i[n++]=p>>>0&65535,i[n++]=p>>>16&65535,i[n++]=m>>>0&65535,i[n++]=m>>>16&65535,i[n++]=f>>>0&65535,i[n++]=f>>>16&65535,i[n++]=g>>>0&65535,i[n++]=g>>>16&65535,i[n++]=_>>>0&65535,i[n++]=_>>>16&65535,i[n++]=y>>>0&65535,i[n++]=y>>>16&65535,i[n++]=x>>>0&65535,i[n++]=x>>>16&65535,i[n++]=b>>>0&65535,i[n]=b>>>16&65535}(t,e,i,r);case 32:for(let n=0;n<32;n=n+1|0)i[r+n|0]=0|t[e+n|0];return}const a=up[n]>>>0;let o=e,s=0,l=t[o]>>>0;for(let e=0;e<32;e++)if(s+n<=32)i[r+e]=l>>>s&a,s+=n,32===s&&(s=0,o++,31!==e&&(l=t[o]>>>0));else{const c=32-s,h=l>>>s;o++,l=t[o]>>>0,i[r+e]=(h|(l&up[n-c]>>>0)<<c)&a,s=n-c}}function wp(t,e,i){const r=new Uint32Array(i);let n=0,a=e.get();for(let e=0;e<r.length;e++){let e=t[a++],i=127&e;e<128||(e=t[a++],i|=(127&e)<<7,e<128||(e=t[a++],i|=(127&e)<<14,e<128||(e=t[a++],i|=(127&e)<<21,e<128||(e=t[a++],i|=(15&e)<<28)))),r[n++]=i}return e.set(a),r}function Vp(t,e,i){const r=new BigUint64Array(i);for(let i=0;i<r.length;i++)r[i]=Rp(t,e);return r}function Rp(t,e){let i=0n,r=0,n=e.get();for(;n<t.length;){const e=t[n++];if(i|=BigInt(127&e)<<BigInt(r),!(128&e))break;if(r+=7,r>=64)throw new Error("Varint too long")}return e.set(n),i}function Mp(t,e){let i,r;return r=t[e.get()],e.increment(),i=127&r,r<128?i:(r=t[e.get()],e.increment(),i|=(127&r)<<7,r<128?i:(r=t[e.get()],e.increment(),i|=(127&r)<<14,r<128?i:(r=t[e.get()],e.increment(),i|=(127&r)<<21,r<128?i:(r=t[e.get()],i|=(15&r)<<28,function(t,e,i){let r,n;if(n=e[i.get()],i.increment(),r=(112&n)>>4,n<128)return 4294967296*r+(t>>>0);if(n=e[i.get()],i.increment(),r|=(127&n)<<3,n<128)return 4294967296*r+(t>>>0);if(n=e[i.get()],i.increment(),r|=(127&n)<<10,n<128)return 4294967296*r+(t>>>0);if(n=e[i.get()],i.increment(),r|=(127&n)<<17,n<128)return 4294967296*r+(t>>>0);if(n=e[i.get()],i.increment(),r|=(127&n)<<24,n<128)return 4294967296*r+(t>>>0);if(n=e[i.get()],i.increment(),r|=(1&n)<<31,n<128)return 4294967296*r+(t>>>0);throw new Error("Expected varint not more than 10 bytes")}(i,t,e)))))}function Up(t){return t>>>1^-(1&t)}function Sp(t){return t>>1n^-(1n&t)}function Np(t){return t%2==1?(t+1)/-2:t/2}function Ep(t,e,i){if(void 0===i){i=0;for(let r=0;r<e;r++)i+=t[r]}const r=new Uint32Array(i);let n=0;for(let i=0;i<e;i++){const a=t[i];r.fill(t[i+e],n,n+a),n+=a}return r}function Fp(t,e,i){if(void 0===i){i=0;for(let r=0;r<e;r++)i+=Number(t[r])}const r=new BigUint64Array(i);let n=0;for(let i=0;i<e;i++){const a=Number(t[i]);r.fill(t[i+e],n,n+a),n+=a}return r}function Zp(t,e,i){const r=new Float64Array(i);let n=0;for(let i=0;i<e;i++){const a=t[i];r.fill(t[i+e],n,n+a),n+=a}return r}function kp(t){const e=new Int32Array(t.length);e[0]=Up(t[0]);const i=t.length/4*4;let r=1;if(i>=4)for(;r<i-4;r+=4){const i=t[r+1],n=t[r+2],a=t[r+3];e[r]=Up(t[r])+e[r-1],e[r+1]=Up(i)+e[r],e[r+2]=Up(n)+e[r+1],e[r+3]=Up(a)+e[r+2]}for(;r!==t.length;++r)e[r]=Up(t[r])+e[r-1];return e}function zp(t){const e=new BigInt64Array(t.length);e[0]=Sp(t[0]);const i=t.length/4*4;let r=1;if(i>=4)for(;r<i-4;r+=4){const i=t[r+1],n=t[r+2],a=t[r+3];e[r]=Sp(t[r])+e[r-1],e[r+1]=Sp(i)+e[r],e[r+2]=Sp(n)+e[r+1],e[r+3]=Sp(a)+e[r+2]}for(;r!==e.length;++r)e[r]=Sp(t[r])+e[r-1];return e}function Wp(t){const e=t.length/4*4;let i=1;if(e>=4)for(let r=t[0];i<e-4;i+=4)r=t[i]+=r,r=t[i+1]+=r,r=t[i+2]+=r,r=t[i+3]+=r;for(;i!==t.length;)t[i]+=t[i-1],++i}var Ip,Dp,Cp,Bp,Pp,Op,Lp,jp;function Ap(t,e){const i=function(t,e){const i=t[e.get()],r=Object.values(Ip)[i>>4];let n=null;switch(r){case Ip.DATA:n={dictionaryType:Object.values(Dp)[15&i]};break;case Ip.OFFSET:n={offsetType:Object.values(Cp)[15&i]};break;case Ip.LENGTH:n={lengthType:Object.values(Bp)[15&i]}}e.increment();const a=t[e.get()],o=Object.values(lp)[a>>5],s=Object.values(lp)[a>>2&7],l=Object.values(cp)[3&a];e.increment();const c=wp(t,e,2),h=c[0];return{physicalStreamType:r,logicalStreamType:n,logicalLevelTechnique1:o,logicalLevelTechnique2:s,physicalLevelTechnique:l,numValues:h,byteLength:c[1],decompressedCount:h}}(t,e);return i.logicalLevelTechnique1===lp.MORTON?function(t,e,i){const r=wp(e,i,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:t.decompressedCount,numBits:r[0],coordinateShift:r[1]}}(i,t,e):lp.RLE!==i.logicalLevelTechnique1&&lp.RLE!==i.logicalLevelTechnique2||cp.NONE===i.physicalLevelTechnique?i:function(t,e,i){const r=wp(e,i,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:r[1],runs:r[0],numRleValues:r[1]}}(i,t,e)}!function(t){t.PRESENT="PRESENT",t.DATA="DATA",t.OFFSET="OFFSET",t.LENGTH="LENGTH"}(Ip||(Ip={})),function(t){t.NONE="NONE",t.SINGLE="SINGLE",t.SHARED="SHARED",t.VERTEX="VERTEX",t.MORTON="MORTON",t.FSST="FSST"}(Dp||(Dp={})),function(t){t.VERTEX="VERTEX",t.INDEX="INDEX",t.STRING="STRING",t.KEY="KEY"}(Cp||(Cp={})),function(t){t.VAR_BINARY="VAR_BINARY",t.GEOMETRIES="GEOMETRIES",t.PARTS="PARTS",t.RINGS="RINGS",t.TRIANGLES="TRIANGLES",t.SYMBOL="SYMBOL",t.DICTIONARY="DICTIONARY"}(Bp||(Bp={})),function(t){t[t.FLAT=0]="FLAT",t[t.CONST=1]="CONST",t[t.SEQUENCE=2]="SEQUENCE",t[t.DICTIONARY=3]="DICTIONARY",t[t.FSST_DICTIONARY=4]="FSST_DICTIONARY"}(Pp||(Pp={}));class Gp{constructor(t,e){this.values=t,this._size=e}get(t){const e=Math.floor(t/8);return 1==(this.values[e]>>t%8&1)}set(t,e){const i=Math.floor(t/8);this.values[i]=this.values[i]|(e?1:0)<<t%8}getInt(t){const e=Math.floor(t/8);return this.values[e]>>t%8&1}size(){return this._size}getBuffer(){return this.values}}function Yp(t,e,i){if(!e)return t;const r=e.size(),n=new t.constructor(r);let a=0;for(let o=0;o<r;o++)n[o]=e.get(o)?t[a++]:i;return n}function Qp(t,e,i,r,n){return function(t,e,i,r){let n;switch(e.logicalLevelTechnique1){case lp.DELTA:if(e.logicalLevelTechnique2===lp.RLE){const i=e;if(!r)return function(t,e,i){const r=new Int32Array(i);let n=0,a=0;for(let i=0;i<e;i++){const o=t[i],s=Up(t[i+e]);for(let t=0;t<o;t++)a+=s,r[n++]=a}return r}(t,i.runs,i.numRleValues);n=kp(t=Ep(t,i.runs,i.numRleValues))}else n=kp(t);break;case lp.RLE:n=function(t,e,i){if(void 0===i){i=0;for(let r=0;r<e;r++)i+=t[r]}const r=new Int32Array(i);let n=0;for(let i=0;i<e;i++){const a=t[i];let o=t[i+e];o=Up(o),r.fill(o,n,n+a),n+=a}return r}(t,e.runs,e.numRleValues);break;case lp.MORTON:Wp(t),n=new Int32Array(t);break;case lp.COMPONENTWISE_DELTA:n=function(t){if(t.length<2)return new Int32Array(t);const e=new Int32Array(t.length);e[0]=Up(t[0]),e[1]=Up(t[1]);const i=t.length/4*4;let r=2;if(i>=4)for(;r<i-4;r+=4){const i=t[r+1],n=t[r+2],a=t[r+3];e[r]=Up(t[r])+e[r-2],e[r+1]=Up(i)+e[r-1],e[r+2]=Up(n)+e[r],e[r+3]=Up(a)+e[r+1]}for(;r!==t.length;r+=2)e[r]=Up(t[r])+e[r-2],e[r+1]=Up(t[r+1])+e[r-1];return e}(t);break;case lp.NONE:n=function(t){const e=new Int32Array(t.length);for(let i=0;i<t.length;i++)e[i]=Up(t[i]);return e}(t);break;default:throw new Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Yp(n,r,0):n}(Hp(t,e,i),i,0,n)}function Jp(t,e,i,r,n){return function(t,e,i,r){let n;switch(e.logicalLevelTechnique1){case lp.DELTA:n=function(t){const e=new Uint32Array(t.length);e[0]=Up(t[0])>>>0;for(let i=1;i<t.length;i++)e[i]=e[i-1]+Up(t[i])>>>0;return e}(e.logicalLevelTechnique2===lp.RLE?Ep(t,e.runs,e.numRleValues):t);break;case lp.RLE:n=Ep(t,e.runs,e.numRleValues);break;case lp.MORTON:Wp(t),n=t;break;case lp.COMPONENTWISE_DELTA:n=function(t){if(t.length<2)return new Uint32Array(t);const e=new Uint32Array(t.length);e[0]=Up(t[0])>>>0,e[1]=Up(t[1])>>>0;for(let i=2;i<t.length;i+=2)e[i]=e[i-2]+Up(t[i])>>>0,e[i+1]=e[i-1]+Up(t[i+1])>>>0;return e}(t);break;case lp.NONE:n=t;break;default:throw new Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return r?Yp(n,r,0):n}(Hp(t,e,i),i,0,n)}function Xp(t,e,i){return function(t,e){if(e.logicalLevelTechnique1===lp.DELTA&&e.logicalLevelTechnique2===lp.NONE)return function(t){const e=new Int32Array(t.length+1);e[0]=0,e[1]=Up(t[0]);let i=e[1];for(let r=2;r!==e.length;++r)i+=Up(t[r-1]),e[r]=e[r-1]+i;return new Uint32Array(e)}(t);if(e.logicalLevelTechnique1===lp.RLE&&e.logicalLevelTechnique2===lp.NONE)return function(t,e,i){const r=new Uint32Array(i+1);r[0]=0;let n=1,a=r[0];for(let i=0;i<e;i++){const o=t[i],s=t[i+e];for(let t=n;t<n+o;t++)r[t]=s+a,a=r[t];n+=o}return r}(t,e.runs,e.numRleValues);if(e.logicalLevelTechnique1===lp.NONE&&e.logicalLevelTechnique2===lp.NONE){!function(t){let e=0;for(let i=0;i<t.length;i++)t[i]+=e,e=t[i]}(t);const i=new Uint32Array(e.numValues+1);return i[0]=0,i.set(t,1),i}if(e.logicalLevelTechnique1===lp.DELTA&&e.logicalLevelTechnique2===lp.RLE){const i=function(t,e,i){const r=new Int32Array(i+1);r[0]=0;let n=1,a=r[0];for(let i=0;i<e;i++){const o=t[i];let s=t[i+e];s=Up(s);for(let t=n;t<n+o;t++)r[t]=s+a,a=r[t];n+=o}return r}(t,e.runs,e.numRleValues);return Wp(i),new Uint32Array(i)}throw new Error("Only delta encoding is supported for transforming length to offset streams yet.")}(Hp(t,e,i),i)}function Hp(t,e,i){const r=i.physicalLevelTechnique;switch(r){case cp.FAST_PFOR:return function(t,e,i,r){return function(t,e,i,r,n){const a=r.get();if(3&i)throw new Error(`FastPFOR: invalid encodedByteLength=${i} at offset=${a} (encodedBytes.length=${t.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);const o=i>>>2,s=function(t,e){if(e<=t.encodedWords.length)return t.encodedWords;const i=new Uint32Array(Math.max(16,2*e));return t.encodedWords=i,i}(n,o);!function(t,e,i,r){if(e<0||i<0||e+i>t.length)throw new RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${e}, byteLength=${i}, bytes.length=${t.length})`);const n=Math.floor(i/4),a=i%4!=0,o=a?n+1:n;if(r.length<o)throw new RangeError(`decodeBigEndianInt32sInto: out.length=${r.length} < ${o}`);if(n>0){const i=t.byteOffset+e;if(3&i)for(let i=0;i<n;i++){const n=e+4*i;r[i]=t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]}else{const e=new Uint32Array(t.buffer,i,n);for(let t=0;t<n;t++)r[t]=0|mp(e[t])}}if(a){const a=e+4*n,o=i-4*n;let s=0;for(let e=0;e<o;e++)s|=t[a+e]<<24-8*e;r[n]=0|s}}(t,a,i,s);const l=function(t,e,i){let r=0,n=0;const a=new Uint32Array(e),o=i??_p();if(t.length>0){const e=0|t[r];if(r=r+1|0,255&e)throw new Error(`FastPFOR decode: invalid alignedLength=${e} (expected multiple of 256)`);if(n+e>a.length)throw new Error(`FastPFOR decode: output buffer too small (outPos=${n}, alignedLength=${e}, out.length=${a.length})`);r=function(t,e,i,r,n,a){const o=r+pp(n,dp);let s=r,l=i;for(;s!==o;){const i=Math.min(fp,o-s);l=vp(t,e,l,s,i,a),s=s+i|0}return l}(t,a,r,n,e,o),n=n+e|0}return function(t,e,i,r,n,a){if(0===a)return e;let o=0,s=e;const l=e+i,c=n;let h=n;const u=n+a;let d=0,p=0;for(;s<l&&h<u;){const e=t[s]>>>o&255;if(o+=8,s+=o>>>5,o&=31,d|=(127&e)<<p,128&e)r[h++]=0|d,d=0,p=0;else if(p+=7,p>28)throw new Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${p}, partial=${d}, decoded=${h-c}/${a}, inPos=${s}, inEnd=${l})`)}if(h!==u)throw new Error(`FastPFOR VByte: truncated stream (decoded=${h-c}, expected=${a}, consumedWords=${s-e}/${i}, vbyteStart=${e}, vbyteEnd=${l})`)}(t,r,t.length-r|0,a,n,e-n|0),a}(s.subarray(0,o),e,n.decoderWorkspace);return r.add(i),l}(t,e,i,r,function(t=16){if(t<0)throw new RangeError(`initialEncodedWordCapacity must be >= 0, got ${t}`);const e=Math.max(16,0|t);return{encodedWords:new Uint32Array(e),decoderWorkspace:_p()}}(i>>>2))}(t,i.numValues,i.byteLength,e);case cp.VARINT:return wp(t,e,i.numValues);case cp.NONE:{const r=e.get();e.add(i.byteLength);const n=t.subarray(r,e.get());return new Uint32Array(n)}default:throw new Error(`Specified physicalLevelTechnique ${r} is not supported (yet).`)}}function qp(t,e,i){const r=Hp(t,e,i);return 1===r.length?r[0]:function(t){return t[1]}(r)}function Kp(t,e,i){return function(t){if(2===t.length){const e=Up(t[1]);return[e,e]}return[Up(t[2]),Up(t[3])]}(Hp(t,e,i))}function $p(t,e,i){return function(t){if(2===t.length){const e=Sp(t[1]);return[e,e]}return[Sp(t[2]),Sp(t[3])]}(Vp(t,e,i.numValues))}function tm(t,e,i,r){return function(t,e,i){let r;switch(e.logicalLevelTechnique1){case lp.DELTA:r=function(t){const e=new BigUint64Array(t.length);e[0]=BigInt.asUintN(64,Sp(t[0]));for(let i=1;i<t.length;i++)e[i]=BigInt.asUintN(64,e[i-1]+Sp(t[i]));return e}(e.logicalLevelTechnique2===lp.RLE?Fp(t,e.runs,e.numRleValues):t);break;case lp.RLE:r=Fp(t,e.runs,e.numRleValues);break;case lp.NONE:r=t;break;default:throw new Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Yp(r,i,0n):r}(Vp(t,e,i.numValues),i,r)}function em(t,e,i){const r=Vp(t,e,i.numValues);return 1===r.length?r[0]:function(t){return t[1]}(r)}function im(t,e,i,r,n="int32"){const a=t.logicalLevelTechnique1;if(a===lp.RLE)return 1===t.runs?Pp.CONST:Pp.FLAT;if(a!==lp.DELTA||t.logicalLevelTechnique2!==lp.RLE)return 1===t.numValues?Pp.CONST:Pp.FLAT;const o=e instanceof Gp?e.size():e;if(t.numRleValues!==o)return Pp.FLAT;if(1===t.runs)return Pp.SEQUENCE;if(2!==t.runs)return 1===t.numValues?Pp.CONST:Pp.FLAT;const s=r.get();if(t.physicalLevelTechnique===cp.VARINT)return function(t,e,i){const r=new sp(e.get());if("int64"===i){const e=Vp(t,r,4);return 2n===e[2]&&2n===e[3]}const n=wp(t,r,4);return 2===n[2]&&2===n[3]}(i,r,n)?Pp.SEQUENCE:1===t.numValues?Pp.CONST:Pp.FLAT;const l=r.get(),c=new Int32Array(i.buffer,i.byteOffset+l,4);return r.set(s),2===c[2]&&2===c[3]?Pp.SEQUENCE:1===t.numValues?Pp.CONST:Pp.FLAT}class rm extends tp{getValueFromBuffer(t){return this.dataBuffer[t]}}class nm extends rp{constructor(t,e,i,r){super(t,BigInt64Array.of(e),i,r)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}}function am(t,e,i){return{x:om(t,e)-i,y:om(t>>1,e)-i}}function om(t,e){let i=0;for(let r=0;r<e;r++)i|=(t&1<<2*r)>>r;return i}function sm(t,e,r,n,a,o,s){return t===jp.MORTON?function(t,e,r,n,a,o){const s=new Array(a?n+1:n);for(let a=0;a<n;a++){const n=am(t[e[r+a]],o.numBits,o.coordinateShift);s[a]=new i(n.x,n.y)}return a&&(s[s.length-1]=s[0]),s}(e,r,n,a,o,s):function(t,e,r,n,a){const o=new Array(a?n+1:n);for(let a=0;a<2*n;a+=2){const n=2*e[r+a/2];o[a/2]=new i(t[n],t[n+1])}return a&&(o[o.length-1]=o[0]),o}(e,r,n,a,o)}function lm(t,e,r,n){const a=new Array(n?r+1:r);for(let n=0;n<2*r;n+=2)a[n/2]=new i(t[e+n],t[e+n+1]);return n&&(a[a.length-1]=a[0]),a}!function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON",t[t.MULTIPOINT=3]="MULTIPOINT",t[t.MULTILINESTRING=4]="MULTILINESTRING",t[t.MULTIPOLYGON=5]="MULTIPOLYGON"}(Op||(Op={})),function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON"}(Lp||(Lp={})),function(t){t[t.MORTON=0]="MORTON",t[t.VEC_2=1]="VEC_2",t[t.VEC_3=2]="VEC_3"}(jp||(jp={}));class cm{constructor(t,e,i,r,n){this._vertexBufferType=t,this._topologyVector=e,this._vertexOffsets=i,this._vertexBuffer=r,this._mortonSettings=n}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(t){const e=this.vertexOffsets?2*this.vertexOffsets[t]:2*t;return[this.vertexBuffer[e],this.vertexBuffer[e+1]]}getVertex(t){if(this.vertexOffsets&&this.mortonSettings){const e=am(this.vertexBuffer[this.vertexOffsets[t]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[e.x,e.y]}const e=this.vertexOffsets?2*this.vertexOffsets[t]:2*t;return[this.vertexBuffer[e],this.vertexBuffer[e+1]]}getGeometries(){return function(t){const e=new Array(t.numGeometries);let r=1,n=1,a=1,o=0,s=0,l=0;const c=t.mortonSettings,h=t.topologyVector,u=h.geometryOffsets,d=h.partOffsets,p=h.ringOffsets,m=t.vertexOffsets,f=!m||0===m.length,g=t.containsPolygonGeometry(),_=t.vertexBuffer;for(let h=0;h<t.numGeometries;h++)switch(t.geometryType(h)){case Op.POINT:{let h,g;if(f)h=_[s++],g=_[s++];else if(t.vertexBufferType===jp.MORTON){const t=am(_[m[l++]],c.numBits,c.coordinateShift);h=t.x,g=t.y}else{const t=2*m[l++];h=_[t],g=_[t+1]}e[o++]=[[new i(h,g)]],u&&a++,d&&r++,p&&n++}break;case Op.MULTIPOINT:{const t=u[a]-u[a-1];a++;const c=new Array(t);if(f)for(let e=0;e<t;e++){const t=_[s++],r=_[s++];c[e]=new i(t,r)}else for(let e=0;e<t;e++){const t=2*m[l++];c[e]=new i(_[t],_[t+1])}e[o++]=c.map(t=>[t]),r+=t,n+=t}break;case Op.LINESTRING:{let i,h;g?(i=p[n]-p[n-1],n++):i=d[r]-d[r-1],r++,f?(h=lm(_,s,i,!1),s+=2*i):(h=sm(t.vertexBufferType,_,m,l,i,!1,c),l+=i),e[o++]=[h],u&&a++}break;case Op.POLYGON:{const i=d[r]-d[r-1];r++;const h=new Array(i-1);let g,y=p[n]-p[n-1];if(n++,f){g=lm(_,s,y,!0),s+=2*y;for(let t=0;t<h.length;t++)y=p[n]-p[n-1],n++,h[t]=lm(_,s,y,!0),s+=2*y}else{g=sm(t.vertexBufferType,_,m,l,y,!0,c),l+=y;for(let e=0;e<h.length;e++)y=p[n]-p[n-1],n++,h[e]=sm(t.vertexBufferType,_,m,l,y,!0,c),l+=y}e[o++]=[g].concat(h),u&&a++}break;case Op.MULTILINESTRING:{const i=u[a]-u[a-1];a++;const h=new Array(i);for(let e=0;e<i;e++){let i;if(g?(i=p[n]-p[n-1],n++):i=d[r]-d[r-1],r++,f)h[e]=lm(_,s,i,!1),s+=2*i;else{const r=sm(t.vertexBufferType,_,m,l,i,!1,c);h[e]=r,l+=i}}e[o++]=h}break;case Op.MULTIPOLYGON:{const i=u[a]-u[a-1];a++;const h=new Array(i);for(let e=0;e<i;e++){const i=d[r]-d[r-1];let a;r++;const o=new Array(i-1),u=p[n]-p[n-1];n++,f?(a=lm(_,s,u,!0),s+=2*u):(a=sm(t.vertexBufferType,_,m,l,u,!0,c),l+=u);for(let e=0;e<o.length;e++){const i=p[n]-p[n-1];n++,f?(o[e]=lm(_,s,i,!0),s+=2*i):(o[e]=sm(t.vertexBufferType,_,m,l,i,!0,c),l+=i)}h[e]=[a].concat(o)}e[o++]=h.flat()}break;default:throw new Error("The specified geometry type is currently not supported.")}return e}(this)}get mortonSettings(){return this._mortonSettings}}class hm extends cm{constructor(t,e,i,r,n,a,o){super(i,r,n,a,o),this._numGeometries=t,this._geometryType=e}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Op.POLYGON||this._geometryType===Op.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class um extends cm{constructor(t,e,i,r,n,a){super(t,i,r,n,a),this._geometryTypes=e}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let t=0;t<this.numGeometries;t++)if(this.geometryType(t)===Op.POLYGON||this.geometryType(t)===Op.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class dm{constructor(t,e,i,r){this._triangleOffsets=t,this._indexBuffer=e,this._vertexBuffer=i,this._topologyVector=r}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw new Error("Cannot convert GpuVector to coordinates without topology information");const t=new Array(this.numGeometries),e=this._topologyVector,r=e.partOffsets,n=e.ringOffsets,a=e.geometryOffsets;let o=0,s=1,l=1,c=1;for(let e=0;e<this.numGeometries;e++)switch(this.geometryType(e)){case Op.POLYGON:{const h=r[s]-r[s-1];s++;const u=[];for(let t=0;t<h;t++){const t=n[l]-n[l-1];l++;const e=[];for(let r=0;r<t;r++){const t=this._vertexBuffer[o++],r=this._vertexBuffer[o++];e.push(new i(t,r))}e.length>0&&e.push(e[0]),u.push(e)}t[e]=u,a&&c++}break;case Op.MULTIPOLYGON:{const h=a[c]-a[c-1];c++;const u=[];for(let t=0;t<h;t++){const t=r[s]-r[s-1];s++;for(let e=0;e<t;e++){const t=n[l]-n[l-1];l++;const e=[];for(let r=0;r<t;r++){const t=this._vertexBuffer[o++],r=this._vertexBuffer[o++];e.push(new i(t,r))}e.length>0&&e.push(e[0]),u.push(e)}}t[e]=u}}return t}[Symbol.iterator](){return null}}function pm(t,e,i,r,n,a){return new mm(t,e,i,r,n,a)}class mm extends dm{constructor(t,e,i,r,n,a){super(i,r,n,a),this._numGeometries=t,this._geometryType=e}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}function fm(t,e,i,r,n){return new gm(t,e,i,r,n)}class gm extends dm{constructor(t,e,i,r,n){super(e,i,r,n),this._geometryTypes=t}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function _m(t,e,i,r,n){const a=Ap(t,i);let o,s,l,c;if(im(a,r,t,i)===Pp.CONST){const n=qp(t,i,a);let h,u,d,p;for(let r=0;r<e-1;r++){const e=Ap(t,i);switch(e.physicalStreamType){case Ip.LENGTH:switch(e.logicalStreamType.lengthType){case Bp.GEOMETRIES:h=Xp(t,i,e);break;case Bp.PARTS:u=Xp(t,i,e);break;case Bp.RINGS:d=Xp(t,i,e);break;case Bp.TRIANGLES:p=Xp(t,i,e)}break;case Ip.OFFSET:switch(e.logicalStreamType.offsetType){case Cp.VERTEX:o=Jp(t,i,e);break;case Cp.INDEX:c=Jp(t,i,e)}break;case Ip.DATA:Dp.VERTEX===e.logicalStreamType.dictionaryType?s=Qp(t,i,e):(l={numBits:e.numBits,coordinateShift:e.coordinateShift},s=Jp(t,i,e))}}return c?void 0!==h||void 0!==u?pm(r,n,p,c,s,{geometryOffsets:h,partOffsets:u,ringOffsets:d}):pm(r,n,p,c,s):void 0===l?function(t,e,i,r,n){return new hm(t,e,jp.VEC_2,i,r,n)}(r,n,{geometryOffsets:h,partOffsets:u,ringOffsets:d},o,s):function(t,e,i,r,n,a){return new hm(t,e,jp.MORTON,i,r,n,a)}(r,n,{geometryOffsets:h,partOffsets:u,ringOffsets:d},o,s,l)}const h=Jp(t,i,a);let u,d,p,m,f,g,_;for(let r=0;r<e-1;r++){const e=Ap(t,i);switch(e.physicalStreamType){case Ip.LENGTH:switch(e.logicalStreamType.lengthType){case Bp.GEOMETRIES:u=Jp(t,i,e);break;case Bp.PARTS:d=Jp(t,i,e);break;case Bp.RINGS:p=Jp(t,i,e);break;case Bp.TRIANGLES:m=Xp(t,i,e)}break;case Ip.OFFSET:switch(e.logicalStreamType.offsetType){case Cp.VERTEX:o=Jp(t,i,e);break;case Cp.INDEX:c=Jp(t,i,e)}break;case Ip.DATA:Dp.VERTEX===e.logicalStreamType.dictionaryType?s=Qp(t,i,e):(l={numBits:e.numBits,coordinateShift:e.coordinateShift},s=Jp(t,i,e))}}return u?(f=ym(h,u,2),d&&p?(g=xm(h,f,d,!1),_=function(t,e,i,r){const n=new Uint32Array(i[i.length-1]+1);let a=0;n[0]=a;let o=1,s=1,l=0;for(let c=0;c<t.length;c++){const h=t[c],u=e[c+1]-e[c];if(0!==h&&3!==h)for(let t=0;t<u;t++){const t=i[o]-i[o-1];o++;for(let e=0;e<t;e++)a=n[s++]=a+r[l++]}else for(let t=0;t<u;t++)n[s++]=++a,o++}return n}(h,f,g,p)):d&&(g=function(t,e,i){const r=new Uint32Array(e[e.length-1]+1);let n=0;r[0]=n;let a=1,o=0;for(let s=0;s<t.length;s++){const l=t[s],c=e[s+1]-e[s];if(4===l||1===l)for(let t=0;t<c;t++)n=r[a++]=n+i[o++];else for(let t=0;t<c;t++)r[a++]=++n}return r}(h,f,d))):d&&p?(g=ym(h,d,1),_=xm(h,g,p,!0)):d&&(g=ym(h,d,0)),c&&!g?fm(h,m,c,s):c?fm(h,m,c,s,{geometryOffsets:f,partOffsets:g,ringOffsets:_}):void 0===l?function(t,e,i,r){return new um(jp.VEC_2,t,e,i,r)}(h,{geometryOffsets:f,partOffsets:g,ringOffsets:_},o,s):function(t,e,i,r,n){return new um(jp.MORTON,t,e,i,r,n)}(h,{geometryOffsets:f,partOffsets:g,ringOffsets:_},o,s,l)}function ym(t,e,i){const r=new Uint32Array(t.length+1);let n=0;r[0]=n;let a=0;for(let o=0;o<t.length;o++)n=r[o+1]=n+(t[o]>i?e[a++]:1);return r}function xm(t,e,i,r){const n=new Uint32Array(e[e.length-1]+1);let a=0;n[0]=a;let o=1,s=0;for(let l=0;l<t.length;l++){const c=t[l],h=e[l+1]-e[l];if(5===c||2===c||r&&(4===c||1===c))for(let t=0;t<h;t++)a=n[o++]=a+i[s++];else for(let t=0;t<h;t++)n[o++]=++a}return n}class bm extends $d{constructor(t,e,i){super(t,e.getBuffer(),i),this.dataVector=e}getValueFromBuffer(t){return this.dataVector.get(t)}}class vm extends tp{getValueFromBuffer(t){return this.dataBuffer[t]}}class Tm extends $d{constructor(t,e,i,r){super(t,r?BigInt64Array.of(e):BigUint64Array.of(e),i)}getValueFromBuffer(t){return this.dataBuffer[0]}}function wm(t,e,i,r,n){const a=function(t,e,i,r){const n=new Uint8Array(e);let a=0;const o=r.get()+i;for(;a<e&&!(r.get()>=o);){const i=t[r.increment()];if(i<=127){const o=i+3,s=t[r.increment()],l=Math.min(a+o,e);n.fill(s,a,l),a=l}else{const o=256-i;for(let i=0;i<o&&a<e;i++)n[a++]=t[r.increment()]}}return r.set(o),n}(t,Math.ceil(e/8),i,r);return n?function(t,e,i){if(!i)return t;const r=i.size(),n=new Gp(t,e),a=new Gp(new Uint8Array(Math.ceil(r/8)),r);let o=0;for(let t=0;t<r;t++){const e=!!i.get(t)&&n.get(o++);a.set(t,e)}return a.getBuffer()}(a,e,n):a}const Vm=new TextDecoder;function Rm(t,e,i){return i-e>=12?Vm.decode(t.subarray(e,i)):function(t,e,i){let r="",n=e;for(;n<i;){const e=t[n];let a,o,s,l=null,c=e>239?4:e>223?3:e>191?2:1;if(n+c>i)break;1===c?e<128&&(l=e):2===c?(a=t[n+1],128==(192&a)&&(l=(31&e)<<6|63&a,l<=127&&(l=null))):3===c?(a=t[n+1],o=t[n+2],128==(192&a)&&128==(192&o)&&(l=(15&e)<<12|(63&a)<<6|63&o,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===c&&(a=t[n+1],o=t[n+2],s=t[n+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&e)<<18|(63&a)<<12|(63&o)<<6|63&s,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),n+=c}return r}(t,e,i)}class Mm extends $d{constructor(t,e,i,r){super(t,i,r),this.offsetBuffer=e}}class Um extends Mm{constructor(t,e,i,r){super(t,e,i,r??e.length-1)}getValueFromBuffer(t){return Rm(this.dataBuffer,this.offsetBuffer[t],this.offsetBuffer[t+1])}}class Sm extends Mm{constructor(t,e,i,r,n){super(t,i,r,n??e.length),this.indexBuffer=e,this.indexBuffer=e}getValueFromBuffer(t){const e=this.indexBuffer[t];return Rm(this.dataBuffer,this.offsetBuffer[e],this.offsetBuffer[e+1])}}class Nm extends Mm{constructor(t,e,i,r,n,a,o){super(t,i,r,o),this.indexBuffer=e,this.symbolOffsetBuffer=n,this.symbolTableBuffer=a}getValueFromBuffer(t){null==this.decodedDictionary&&(null==this.symbolLengthBuffer&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),this.decodedDictionary=function(t,e,i){const r=[],n=new Array(e.length).fill(0);for(let t=1;t<e.length;t++)n[t]=n[t-1]+e[t-1];for(let a=0;a<i.length;a++)if(255===i[a])r.push(i[++a]);else{const o=e[i[a]],s=n[i[a]];for(let e=0;e<o;e++)r.push(t[s+e])}return new Uint8Array(r)}(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));const e=this.indexBuffer[t];return Rm(this.decodedDictionary,this.offsetBuffer[e],this.offsetBuffer[e+1])}offsetToLengthBuffer(t){const e=new Uint32Array(t.length-1);let i=t[0];for(let r=1;r<t.length;r++){const n=t[r];e[r-1]=n-i,i=n}return e}}function Em(t,e,i,r,n,a){return"scalarType"===i.type?function(t,e,i,r,n,a){let o=null;if(0===t)return null;if(a.nullable){const t=Ap(e,i),r=t.numValues,n=i.get(),a=wm(e,r,t.byteLength,i);i.set(n+t.byteLength),o=new Gp(a,t.numValues)}const s=o??r;switch(n.physicalType){case 4:case 3:return function(t,e,i,r,n){const a=Ap(t,e),o=im(a,n,t,e),s=3===r.physicalType;if(o===Pp.FLAT){const r=Fm(n)?n:void 0,o=s?Qp(t,e,a,0,r):Jp(t,e,a,0,r);return new ep(i.name,o,n)}if(o===Pp.SEQUENCE){const r=Kp(t,e,a);return new np(i.name,r[0],r[1],a.numRleValues)}const l=s?function(t,e,i){const r=Hp(t,e,i);return 1===r.length?Up(r[0]):function(t){return Up(t[1])}(r)}(t,e,a):qp(t,e,a);return new ap(i.name,l,n,s)}(e,i,a,n,s);case 9:return function(t,e,i,r,n){let a=null,o=null,s=null,l=null,c=null,h=n??null,u=null,d=null;for(let t=0;t<r;t++){const t=Ap(e,i);switch(t.physicalStreamType){case Ip.PRESENT:{const r=wm(e,t.numValues,t.byteLength,i),a=new Gp(r,t.numValues);h=n??a;break}case Ip.OFFSET:o=Jp(e,i,t,0,h);break;case Ip.LENGTH:{const r=Xp(e,i,t);Bp.DICTIONARY===t.logicalStreamType.lengthType?a=r:Bp.SYMBOL===t.logicalStreamType.lengthType?l=r:u=r;break}case Ip.DATA:{const r=e.subarray(i.get(),i.get()+t.byteLength);i.add(t.byteLength);const n=t.logicalStreamType.dictionaryType;Dp.FSST===n?c=r:Dp.SINGLE===n||Dp.SHARED===n?s=r:Dp.NONE===n&&(d=r);break}}}return function(t,e,i,r,n,a,o){return e?new Nm(t,i,r,n,a,e,o):null}(t,c,o,a,s,l,h)??function(t,e,i,r,n){return e?n?new Sm(t,i,r,e,n):new Sm(t,i,r,e):null}(t,s,o,a,h)??function(t,e,i,r,n){if(!e||!i)return null;if(r)return n?new Sm(t,r,e,i,n):new Sm(t,r,e,i);if(n&&n.size()!==e.length-1){const r=new Uint32Array(n.size());let a=0;for(let t=0;t<n.size();t++)r[t]=n.get(t)?a++:0;return new Sm(t,r,e,i,n)}return n?new Um(t,e,i,n):new Um(t,e,i)}(t,u,d,o,h)}(a.name,e,i,a.nullable?t-1:t,o);case 0:return function(t,e,i,r,n){const a=Ap(t,e),o=a.numValues,s=e.get(),l=Fm(n)?n:void 0,c=wm(t,o,a.byteLength,e,l);e.set(s+a.byteLength);const h=new Gp(c,o);return new bm(i.name,h,n)}(e,i,a,0,s);case 6:case 5:return function(t,e,i,r,n){const a=Ap(t,e),o=im(a,r,t,e,"int64"),s=5===n.physicalType;if(o===Pp.FLAT){const n=Fm(r)?r:void 0,o=s?function(t,e,i,r){return function(t,e,i){let r;switch(e.logicalLevelTechnique1){case lp.DELTA:if(e.logicalLevelTechnique2===lp.RLE){const n=e;if(!i)return function(t,e,i){const r=new BigInt64Array(i);let n=0,a=0n;for(let i=0;i<e;i++){const o=Number(t[i]),s=Sp(t[i+e]);for(let t=0;t<o;t++)a+=s,r[n++]=a}return r}(t,n.runs,n.numRleValues);r=zp(t=Fp(t,n.runs,n.numRleValues))}else r=zp(t);break;case lp.RLE:r=function(t,e,i){if(void 0===i){i=0;for(let r=0;r<e;r++)i+=Number(t[r])}const r=new BigInt64Array(i);let n=0;for(let i=0;i<e;i++){const a=Number(t[i]);let o=t[i+e];o=Sp(o),r.fill(o,n,n+a),n+=a}return r}(t,e.runs,e.numRleValues);break;case lp.NONE:r=function(t){const e=new BigInt64Array(t.length);for(let i=0;i<t.length;i++)e[i]=Sp(t[i]);return e}(t);break;default:throw new Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}return i?Yp(r,i,0n):r}(Vp(t,e,i.numValues),i,r)}(t,e,a,n):tm(t,e,a,n);return new rm(i.name,o,r)}if(o===Pp.SEQUENCE){const r=$p(t,e,a);return new nm(i.name,r[0],r[1],a.numRleValues)}const l=s?function(t,e,i){const r=Vp(t,e,i.numValues);return 1===r.length?Sp(r[0]):function(t){return Sp(t[1])}(r)}(t,e,a):em(t,e,a);return new Tm(i.name,l,r,s)}(e,i,a,s,n);case 7:return function(t,e,i,r){const n=Ap(t,e),a=Fm(r)?r:void 0,o=function(t,e,i,r){const n=e.get(),a=n+i*Float32Array.BYTES_PER_ELEMENT,o=new Uint8Array(t.subarray(n,a)).buffer,s=new Float32Array(o);return e.set(a),r?Yp(s,r,0):s}(t,e,n.numValues,a);return new vm(i.name,o,r)}(e,i,a,s);case 8:return function(t,e,i,r){const n=Ap(t,e),a=Fm(r)?r:void 0,o=function(t,e,i,r){const n=e.get(),a=n+i*Float64Array.BYTES_PER_ELEMENT,o=new Uint8Array(t.subarray(n,a)).buffer,s=new Float64Array(o);return e.set(a),r?Yp(s,r,0):s}(t,e,n.numValues,a);return new ip(i.name,o,r)}(e,i,a,s);default:throw new Error(`The specified data type for the field is currently not supported: ${n}`)}}(r,t,e,n,i.scalarType,i):0===r?null:function(t,e,i,r){let n=null,a=null,o=null,s=null,l=!1;for(;!l;){const i=Ap(t,e);switch(i.physicalStreamType){case Ip.LENGTH:Bp.DICTIONARY===i.logicalStreamType.lengthType?n=Xp(t,e,i):o=Xp(t,e,i);break;case Ip.DATA:Dp.SINGLE===i.logicalStreamType.dictionaryType||Dp.SHARED===i.logicalStreamType.dictionaryType?(a=t.subarray(e.get(),e.get()+i.byteLength),l=!0):s=t.subarray(e.get(),e.get()+i.byteLength),e.add(i.byteLength)}}const c=i.complexType.children,h=[];let u=0;for(const l of c){const c=wp(t,e,1)[0];if(0===c)continue;const d=l.name?`${i.name}${l.name}`:i.name;if(2!==c||"scalarField"!==l.type||9!==l.scalarField.physicalType)throw new Error("Currently only optional string fields are implemented for a struct.");const p=Ap(t,e),m=wm(t,p.numValues,p.byteLength,e),f=Ap(t,e),g=Jp(t,e,f,0,f.decompressedCount!==r?new Gp(m,p.numValues):void 0);h[u++]=s?new Nm(d,g,n,a,o,s,new Gp(m,p.numValues)):new Sm(d,g,n,a,new Gp(m,p.numValues))}return h}(t,e,i,n)}function Fm(t){return t instanceof Gp}function Zm(t){switch(t){case 0:case 1:case 2:case 3:{const e={};e.nullable=!!(1&t),e.columnScope=0;const i={type:"logicalType",logicalType:0};return i.longID=!!(2&t),e.scalarType=i,e.type="scalarType",e}case 4:{const t={nullable:!1,columnScope:0},e={type:"physicalType",physicalType:0};return t.type="complexType",t.complexType=e,t}case 30:{const t={nullable:!1,columnScope:0},e={type:"physicalType",physicalType:1};return t.type="complexType",t.complexType=e,t}default:return function(t){let e;switch(t){case 10:case 11:e=0;break;case 12:case 13:e=1;break;case 14:case 15:e=2;break;case 16:case 17:e=3;break;case 18:case 19:e=4;break;case 20:case 21:e=5;break;case 22:case 23:e=6;break;case 24:case 25:e=7;break;case 26:case 27:e=8;break;case 28:case 29:e=9;break;default:return null}const i={};i.nullable=!!(1&t),i.columnScope=0;const r={type:"physicalType"};return r.physicalType=e,i.type="scalarType",i.scalarType=r,i}(t)}}function km(t){return t>=10}function zm(t){return 30===t}function Wm(t){if("scalarType"===t.type){const e=t.scalarType;if("physicalType"===e.type)switch(e.physicalType){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:default:return!1;case 9:return!0}if("logicalType"===e.type)return!1}else if("complexType"===t.type){const e=t.complexType;if("physicalType"===e.type)switch(e.physicalType){case 0:case 1:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",t),!1}function Im(t){return"complexType"===t.type&&"physicalType"===t.complexType?.type&&0===t.complexType.physicalType}const Dm=new TextDecoder;function Cm(t,e){const i=wp(t,e,1)[0];if(0===i)return"";const r=e.get(),n=t.subarray(r,r+i);return e.add(i),Dm.decode(n)}function Bm(t,e){const i=wp(t,e,1)[0]>>>0;if(i<10||i>30)throw new Error(`Unsupported field type code ${i}. Supported: 10-29(scalars), 30(STRUCT)`);const r=Zm(i);if(km(i)&&(r.name=Cm(t,e)),zm(i)){const i=wp(t,e,1)[0]>>>0;r.complexType.children=new Array(i);for(let n=0;n<i;n++)r.complexType.children[n]=Bm(t,e)}return function(t){return{name:t.name,nullable:t.nullable,scalarField:t.scalarType,complexField:t.complexType,type:"scalarType"===t.type?"scalarField":"complexField"}}(r)}function Pm(t,e){const i=wp(t,e,1)[0]>>>0,r=Zm(i);if(!r)throw new Error(`Unsupported column type code ${i}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)`);if(km(i)?r.name=Cm(t,e):i>=0&&i<=3?r.name="id":4===i&&(r.name="geometry"),zm(i)){const i=wp(t,e,1)[0]>>>0,n=r.complexType;n.children=new Array(i);for(let r=0;r<i;r++)n.children[r]=Bm(t,e)}return r}function Om(t,e){const i={featureTables:[]},r={};r.name=Cm(t,e);const n=wp(t,e,1)[0]>>>0,a=wp(t,e,1)[0]>>>0;r.columns=new Array(a);for(let i=0;i<a;i++)r.columns[i]=Pm(t,e);return i.featureTables.push(r),[i,n]}function Lm(t,e,i,r,n,a,o=!1){const s=e.scalarType;if(!s||"logicalType"!==s.type||0!==s.logicalType)throw new Error(`ID column must be a logical ID scalar type: ${r}`);const l=s.longID?6:4,c="number"==typeof a?void 0:a,h=im(n,a,t,i,6===l?"int64":"int32");if(4===l)switch(h){case Pp.FLAT:{const e=Jp(t,i,n,0,c);return new ep(r,e,a)}case Pp.SEQUENCE:{const e=Kp(t,i,n);return new np(r,e[0],e[1],n.numRleValues)}case Pp.CONST:{const e=qp(t,i,n);return new ap(r,e,a,!1)}}switch(h){case Pp.FLAT:{if(o){const e=function(t,e,i){const r=function(t,e,i){const r=new Float64Array(i);for(let n=0;n<i;n++)r[n]=Mp(t,e);return r}(t,e,i.numValues);return function(t,e){switch(e.logicalLevelTechnique1){case lp.DELTA:return e.logicalLevelTechnique2===lp.RLE&&(t=Zp(t,e.runs,e.numRleValues)),function(t){t[0]=Np(t[0]);const e=t.length/4*4;let i=1;if(e>=4)for(;i<e-4;i+=4){const e=t[i+1],r=t[i+2],n=t[i+3];t[i]=Np(t[i])+t[i-1],t[i+1]=Np(e)+t[i],t[i+2]=Np(r)+t[i+1],t[i+3]=Np(n)+t[i+2]}for(;i!==t.length;++i)t[i]=Np(t[i])+t[i-1]}(t),t;case lp.RLE:return function(t,e){return Zp(t,e.runs,e.numRleValues)}(t,e);case lp.NONE:return t;default:throw new Error(`The specified Logical level technique is not supported: ${e.logicalLevelTechnique1}`)}}(r,i)}(t,i,n);return new ip(r,e,a)}const e=tm(t,i,n,c);return new rm(r,e,a)}case Pp.SEQUENCE:{const e=$p(t,i,n);return new nm(r,e[0],e[1],n.numRleValues)}case Pp.CONST:{const e=em(t,i,n);return new Tm(r,e,a,!1)}}throw new Error("Vector type not supported for id column.")}class jm{constructor(t,e){var i;switch(this._featureData=t,this.properties=this._featureData.properties||{},null===(i=this._featureData.geometry)||void 0===i?void 0:i.type){case Op.POINT:case Op.MULTIPOINT:this.type=1;break;case Op.LINESTRING:case Op.MULTILINESTRING:this.type=2;break;case Op.POLYGON:case Op.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=e,this.id=Number(this._featureData.id)}loadGeometry(){const t=[];for(const e of this._featureData.geometry.coordinates){const r=[];for(const t of e)r.push(new i(t.x,t.y));t.push(r)}return t}}class Am{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new jm(this.features[t],this.extent)}}class Gm{constructor(t){this.layers={};const e=function(t,e,i=!0){const r=new sp(0),n=[];for(;r.get()<t.length;){const e=wp(t,r,1)[0]>>>0,o=r.get()+e;if(o>t.length)throw new Error(`Block overruns tile: ${o} > ${t.length}`);if(1!=wp(t,r,1)[0]>>>0){r.set(o);continue}const[s,l]=Om(t,r),c=s.featureTables[0];let h=null,u=null;const d=[];let p=0;for(const e of c.columns){const n=e.name;if("scalarType"===(a=e).type&&"logicalType"===a.scalarType?.type&&0===a.scalarType.logicalType){let a=null;if(e.nullable){const e=Ap(t,r),i=r.get(),n=wm(t,e.numValues,e.byteLength,r);r.set(i+e.byteLength),a=new Gp(n,e.numValues)}const o=Ap(t,r);p=a?a.size():o.decompressedCount,h=Lm(t,e,r,n,o,a??p,i)}else if(Im(e)){const e=wp(t,r,1)[0];if(0===p){const e=r.get();p=Ap(t,r).decompressedCount,r.set(e)}u=_m(t,e,r,p)}else{const i=Wm(e)?wp(t,r,1)[0]:1;if(0===i)continue;const n=Em(t,r,e,i,p);if(n)if(Array.isArray(n))for(const t of n)d.push(t);else d.push(n)}}const m=new op(c.name,u,h,d,l);n.push(m),r.set(o)}var a;return n}(new Uint8Array(t));this.layers=e.reduce((t,e)=>Object.assign(Object.assign({},t),{[e.name]:new Am(e)}),{})}}class Ym{constructor(t,e){this.feature=t,this.type=t.type,this.properties=t.tags?t.tags:{},this.extent=e,"id"in t&&("string"==typeof t.id?this.id=parseInt(t.id,10):"number"!=typeof t.id||isNaN(t.id)||(this.id=t.id))}loadGeometry(){const t=[],e=1===this.feature.type?[this.feature.geometry]:this.feature.geometry;for(const r of e){const e=[];for(const t of r)e.push(new i(t[0],t[1]));t.push(e)}return t}}const Qm="_geojsonTileLayer";function Jm(t,e,i=""){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);const r={jsonPrefix:i,keys:[],values:[],keycache:{},valuecache:{}};for(let i=0;i<t.length;i++)r.feature=t.feature(i),e.writeMessage(2,Xm,r);const n=r.keys;for(const t of n)e.writeStringField(3,t);const a=r.values;for(const t of a)e.writeMessage(4,tf,t)}function Xm(t,e){if(!t.feature)return;const i=t.feature;void 0!==i.id&&e.writeVarintField(1,i.id),e.writeMessage(2,Hm,t),e.writeVarintField(3,i.type),e.writeMessage(4,$m,i)}function Hm(t,e){for(const i in t.feature?.properties){let r=t.feature.properties[i],n=t.keycache[i];if(null==r)continue;void 0===n&&(t.keys.push(i),n=t.keys.length-1,t.keycache[i]=n),e.writeVarint(n),"string"!=typeof r&&"boolean"!=typeof r&&"number"!=typeof r&&(r=t.jsonPrefix+JSON.stringify(r));const a=typeof r+":"+r;let o=t.valuecache[a];void 0===o&&(t.values.push(r),o=t.values.length-1,t.valuecache[a]=o),e.writeVarint(o)}}function qm(t,e){return(e<<3)+(7&t)}function Km(t){return t<<1^t>>31}function $m(t,e){const i=t.loadGeometry(),r=t.type;let n=0,a=0;for(const o of i){let i=1;1===r&&(i=o.length),e.writeVarint(qm(1,i));const s=3===r?o.length-1:o.length;for(let t=0;t<s;t++){1===t&&1!==r&&e.writeVarint(qm(2,s-1));const i=o[t].x-n,l=o[t].y-a;e.writeVarint(Km(i)),e.writeVarint(Km(l)),n+=i,a+=l}3===t.type&&e.writeVarint(qm(7,1))}}function tf(t,e){const i=typeof t;"string"===i?e.writeStringField(1,t):"boolean"===i?e.writeBooleanField(7,t):"number"===i&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}class ef{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new ua(N,16,0),this.grid3D=new ua(N,16,0),this.featureIndexArray=new Ao,this.promoteId=e}insert(t,e,i,r,n,a){const o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,n);const s=a?this.grid3D:this.grid;for(let t=0;t<e.length;t++){const i=e[t],r=[1/0,1/0,-1/0,-1/0];for(let t=0;t<i.length;t++){const e=i[t];r[0]=Math.min(r[0],e.x),r[1]=Math.min(r[1],e.y),r[2]=Math.max(r[2],e.x),r[3]=Math.max(r[3],e.y)}r[0]<N&&r[1]<N&&r[2]>=0&&r[3]>=0&&s.insert(o,r[0],r[1],r[2],r[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers="mlt"!==this.encoding?new Pc(new Iu(this.rawTileData)).layers:new Gm(this.rawTileData).layers,this.sourceLayerCoder=new qd(this.vtLayers?Object.keys(this.vtLayers).sort():[Qm])),this.vtLayers}query(t,e,r,n){this.loadVTLayers();const a=t.params,o=N/t.tileSize/t.scale,s=mn(a.filter,a.globalState),l=t.queryGeometry,c=t.queryPadding*o,h=Hd.fromPoints(l),u=this.grid.query(h.minX-c,h.minY-c,h.maxX+c,h.maxY+c),d=Hd.fromPoints(t.cameraQueryGeometry).expandBy(c),p=this.grid3D.query(d.minX,d.minY,d.maxX,d.maxY,(e,r,n,a)=>function(t,e,r,n,a){for(const i of t)if(e<=i.x&&r<=i.y&&n>=i.x&&a>=i.y)return!0;const o=[new i(e,r),new i(e,a),new i(n,a),new i(n,r)];if(t.length>2)for(const e of o)if(rl(t,e))return!0;for(let e=0;e<t.length-1;e++)if(nl(t[e],t[e+1],o))return!0;return!1}(t.cameraQueryGeometry,e-c,r-c,n+c,a+c));for(const t of p)u.push(t);u.sort(nf);const m={};let f;for(let i=0;i<u.length;i++){const c=u[i];if(c===f)continue;f=c;const h=this.featureIndexArray.get(c);let d=null;this.loadMatchingFeature(m,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,s,a.layers,a.availableImages,e,r,n,(e,i,r)=>(d||(d=js(e)),i.queryIntersectsFeature({queryGeometry:l,feature:e,featureState:r,geometry:d,zoom:this.z,transform:t.transform,pixelsToTileUnits:o,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation})))}return m}loadMatchingFeature(t,e,i,r,n,a,o,s,l,c,h){const u=this.bucketLayerIDs[e];if(a&&!u.some(t=>a.has(t)))return;const d=this.sourceLayerCoder.decode(i),p=this.vtLayers[d].feature(r);if(n.needGeometry){const t=As(p,!0);if(!n.filter(new za(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!n.filter(new za(this.tileID.overscaledZ),p))return;const m=this.getId(p,d);for(let e=0;e<u.length;e++){const i=u[e];if(a&&!a.has(i))continue;const n=s[i];if(!n)continue;let d={};m&&c&&(d=c.getState(n.sourceLayer||Qm,m));const f=C({},l[i]);f.paint=rf(f.paint,n.paint,p,d,o),f.layout=rf(f.layout,n.layout,p,d,o);const g=!h||h(p,n,d);if(!g)continue;const _=new Kd(p,this.z,this.x,this.y,m);_.layer=f;let y=t[i];void 0===y&&(y=t[i]=[]),y.push({featureIndex:r,feature:_,intersectionZ:g})}}lookupSymbolFeatures(t,e,i,r,n,a,o,s){const l={};this.loadVTLayers();const c=mn(n.filterSpec,n.globalState);for(const n of t)this.loadMatchingFeature(l,i,r,n,c,a,o,s,e);return l}hasLayer(t){for(const e of this.bucketLayerIDs)for(const i of e)if(t===i)return!0;return!1}getId(t,e){var i;let r=t.id;return this.promoteId&&(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]],"boolean"==typeof r&&(r=Number(r)),void 0===r&&(null===(i=t.properties)||void 0===i?void 0:i.cluster)&&this.promoteId&&(r=Number(t.properties.cluster_id))),r}}function rf(t,e,i,r,n){return P(t,(t,a)=>{const o=e instanceof Aa?e.get(a):null;return o&&o.evaluate?o.evaluate(i,r,n):o})}function nf(t,e){return e-t}function af(t,e,r,n,a){const o=[];for(let s=0;s<t.length;s++){const l=t[s];let c;for(let t=0;t<l.length-1;t++){let s=l[t],h=l[t+1];s.x<e&&h.x<e||(s.x<e?s=new i(e,s.y+(e-s.x)/(h.x-s.x)*(h.y-s.y))._round():h.x<e&&(h=new i(e,s.y+(e-s.x)/(h.x-s.x)*(h.y-s.y))._round()),s.y<r&&h.y<r||(s.y<r?s=new i(s.x+(r-s.y)/(h.y-s.y)*(h.x-s.x),r)._round():h.y<r&&(h=new i(s.x+(r-s.y)/(h.y-s.y)*(h.x-s.x),r)._round()),s.x>=n&&h.x>=n||(s.x>=n?s=new i(n,s.y+(n-s.x)/(h.x-s.x)*(h.y-s.y))._round():h.x>=n&&(h=new i(n,s.y+(n-s.x)/(h.x-s.x)*(h.y-s.y))._round()),s.y>=a&&h.y>=a||(s.y>=a?s=new i(s.x+(a-s.y)/(h.y-s.y)*(h.x-s.x),a)._round():h.y>=a&&(h=new i(s.x+(a-s.y)/(h.y-s.y)*(h.x-s.x),a)._round()),c&&s.equals(c[c.length-1])||(c=[s],o.push(c)),c.push(h)))))}}return o}function of(t,e,i,r,n){switch(e){case 1:return function(t,e,i,r){const n=[];for(const a of t)for(const t of a){const a=0===r?t.x:t.y;a>=e&&a<=i&&n.push([t])}return n}(t,i,r,n);case 2:return lf(t,i,r,n,!1);case 3:return lf(t,i,r,n,!0)}return[]}function sf(t,e,r,n,a){const o=0===n?cf:hf;let s=[];const l=[];for(let i=0;i<t.length-1;i++){const c=t[i],h=t[i+1],u=0===n?c.x:c.y,d=0===n?h.x:h.y;let p=!1;u<e?d>e&&s.push(o(c,h,e)):u>r?d<r&&s.push(o(c,h,r)):s.push(c),d<e&&u>=e&&(s.push(o(c,h,e)),p=!0),d>r&&u<=r&&(s.push(o(c,h,r)),p=!0),!a&&p&&(l.push(s),s=[])}const c=t.length-1,h=0===n?t[c].x:t[c].y;return h>=e&&h<=r&&s.push(t[c]),a&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new i(s[0].x,s[0].y)),s.length>0&&l.push(s),l}function lf(t,e,i,r,n){const a=[];for(const o of t){const t=sf(o,e,i,r,n);t.length>0&&a.push(...t)}return a}function cf(t,e,r){return new i(r,t.y+(r-t.x)/(e.x-t.x)*(e.y-t.y))}function hf(t,e,r){return new i(t.x+(r-t.y)/(e.y-t.y)*(e.x-t.x),r)}pa("FeatureIndex",ef,{omit:["rawTileData","sourceLayerCoder"]});class uf extends i{constructor(t,e,i,r){super(t,e),this.angle=i,void 0!==r&&(this.segment=r)}clone(){return new uf(this.x,this.y,this.angle,this.segment)}}function df(t,e,i,r,n){if(void 0===e.segment||0===i)return!0;let a=e,o=e.segment+1,s=0;for(;s>-i/2;){if(o--,o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;const l=[];let c=0;for(;s<i/2;){const e=t[o],i=t[o+1];if(!i)return!1;let a=t[o-1].angleTo(e)-e.angleTo(i);for(a=Math.abs((a+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:a}),c+=a;s-l[0].distance>r;)c-=l.shift().angleDelta;if(c>n)return!1;o++,s+=e.dist(i)}return!0}function pf(t){let e=0;for(let i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function mf(t,e,i){return t?.6*e*i:0}function ff(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function gf(t,e,i,r,n,a){const o=mf(i,n,a),s=ff(i,r)*a;let l=0;const c=pf(t)/2;for(let i=0;i<t.length-1;i++){const r=t[i],n=t[i+1],a=r.dist(n);if(l+a>c){const h=(c-l)/a,u=gi.number(r.x,n.x,h),d=gi.number(r.y,n.y,h),p=new uf(u,d,n.angleTo(r),i);return p._round(),!o||df(t,p,s,o,e)?p:void 0}l+=a}}function _f(t,e,i,r,n,a,o,s,l){const c=mf(r,a,o),h=ff(r,n),u=h*o,d=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-u<e/4&&(e=u+e/4),yf(t,d?e/2*s%e:(h/2+2*a)*o*s%e,e,c,i,u,d,!1,l)}function yf(t,e,i,r,n,a,o,s,l){const c=a/2,h=pf(t);let u=0,d=e-i,p=[];for(let e=0;e<t.length-1;e++){const o=t[e],s=t[e+1],m=o.dist(s),f=s.angleTo(o);for(;d+i<u+m;){d+=i;const g=(d-u)/m,_=gi.number(o.x,s.x,g),y=gi.number(o.y,s.y,g);if(_>=0&&_<l&&y>=0&&y<l&&d-c>=0&&d+c<=h){const i=new uf(_,y,f,e);i._round(),r&&!df(t,i,a,r,n)||p.push(i)}}u+=m}return s||p.length||o||(p=yf(t,u/2,i,r,n,a,o,!0,l)),p}function xf(t,e,r,n){const a=[],o=t.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2;let h={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom};const u=o.stretchX||[[0,l]],d=o.stretchY||[[0,c]],p=(t,e)=>t+e[1]-e[0],m=u.reduce(p,0),f=d.reduce(p,0),g=l-m,_=c-f;let y=0,x=m,b=0,v=f,T=0,w=g,V=0,R=_;if(o.content&&n){const e=o.content,i=e[2]-e[0],r=e[3]-e[1];(o.textFitWidth||o.textFitHeight)&&(h=hd(t)),y=bf(u,0,e[0]),b=bf(d,0,e[1]),x=bf(u,e[0],e[2]),v=bf(d,e[1],e[3]),T=e[0]-y,V=e[1]-b,w=i-x,R=r-v}const M=h.x1,U=h.y1,S=h.x2-M,N=h.y2-U,E=(t,n,a,l)=>{const c=Tf(t.stretch-y,x,S,M),h=wf(t.fixed-T,w,t.stretch,m),u=Tf(n.stretch-b,v,N,U),d=wf(n.fixed-V,R,n.stretch,f),p=Tf(a.stretch-y,x,S,M),g=wf(a.fixed-T,w,a.stretch,m),_=Tf(l.stretch-b,v,N,U),E=wf(l.fixed-V,R,l.stretch,f),F=new i(c,u),Z=new i(p,u),k=new i(p,_),z=new i(c,_),W=new i(h/s,d/s),I=new i(g/s,E/s),D=e*Math.PI/180;if(D){const t=Math.sin(D),e=Math.cos(D),i=[e,-t,t,e];F._matMult(i),Z._matMult(i),z._matMult(i),k._matMult(i)}const C=t.stretch+t.fixed,B=n.stretch+n.fixed;return{tl:F,tr:Z,bl:z,br:k,tex:{x:o.paddedRect.x+1+C,y:o.paddedRect.y+1+B,w:a.stretch+a.fixed-C,h:l.stretch+l.fixed-B},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:W,pixelOffsetBR:I,minFontScaleX:w/s/S,minFontScaleY:R/s/N,isSDF:r}};if(n&&(o.stretchX||o.stretchY)){const t=vf(u,g,m),e=vf(d,_,f);for(let i=0;i<t.length-1;i++){const r=t[i],n=t[i+1];for(let t=0;t<e.length-1;t++)a.push(E(r,e[t],n,e[t+1]))}}else a.push(E({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return a}function bf(t,e,i){let r=0;for(const n of t)r+=Math.max(e,Math.min(i,n[1]))-Math.max(e,Math.min(i,n[0]));return r}function vf(t,e,i){const r=[{fixed:-1,stretch:0}];for(const[e,i]of t){const t=r[r.length-1];r.push({fixed:e-t.stretch,stretch:t.stretch}),r.push({fixed:e-t.stretch,stretch:t.stretch+(i-e)})}return r.push({fixed:e+1,stretch:i}),r}function Tf(t,e,i,r){return t/e*i+r}function wf(t,e,i,r){return t-e*i/r}pa("Anchor",uf);class Vf{constructor(t,e,r,n,a,o,s,l,c,h){var u;if(this.boxStartIndex=t.length,c){let t=o.top,e=o.bottom;const i=o.collisionPadding;i&&(t-=i[1],e+=i[3]);let r=e-t;r>0&&(r=Math.max(10,r),this.circleDiameter=r)}else{const c=(null===(u=o.image)||void 0===u?void 0:u.content)&&(o.image.textFitWidth||o.image.textFitHeight)?hd(o):{x1:o.left,y1:o.top,x2:o.right,y2:o.bottom};c.y1=c.y1*s-l[0],c.y2=c.y2*s+l[2],c.x1=c.x1*s-l[3],c.x2=c.x2*s+l[1];const d=o.collisionPadding;if(d&&(c.x1-=d[0]*s,c.y1-=d[1]*s,c.x2+=d[2]*s,c.y2+=d[3]*s),h){const t=new i(c.x1,c.y1),e=new i(c.x2,c.y1),r=new i(c.x1,c.y2),n=new i(c.x2,c.y2),a=h*Math.PI/180;t._rotate(a),e._rotate(a),r._rotate(a),n._rotate(a),c.x1=Math.min(t.x,e.x,r.x,n.x),c.x2=Math.max(t.x,e.x,r.x,n.x),c.y1=Math.min(t.y,e.y,r.y,n.y),c.y2=Math.max(t.y,e.y,r.y,n.y)}t.emplaceBack(e.x,e.y,c.x1,c.y1,c.x2,c.y2,r,n,a)}this.boxEndIndex=t.length}}class Rf{constructor(t=[],e=(t,e)=>t<e?-1:t>e?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,r=e[t];for(;t>0;){const n=t-1>>1,a=e[n];if(i(r,a)>=0)break;e[t]=a,t=n}e[t]=r}_down(t){const{data:e,compare:i}=this,r=this.length>>1,n=e[t];for(;t<r;){let r=1+(t<<1);const a=r+1;if(a<this.length&&i(e[a],e[r])<0&&(r=a),i(e[r],n)>=0)break;e[t]=e[r],t=r}e[t]=n}}function Mf(t,e=1,r=!1){const n=Hd.fromPoints(t[0]),a=Math.min(n.width(),n.height());let o=a/2;const s=new Rf([],Uf),{minX:l,minY:c,maxX:h,maxY:u}=n;if(0===a)return new i(l,c);for(let e=l;e<h;e+=a)for(let i=c;i<u;i+=a)s.push(new Sf(e+o,i+o,o,t));let d=function(t){let e=0,i=0,r=0;const n=t[0];for(let t=0,a=n.length,o=a-1;t<a;o=t++){const a=n[t],s=n[o],l=a.x*s.y-s.x*a.y;i+=(a.x+s.x)*l,r+=(a.y+s.y)*l,e+=3*l}return new Sf(i/e,r/e,0,t)}(t),p=s.length;for(;s.length;){const i=s.pop();(i.d>d.d||!d.d)&&(d=i,r&&console.log("found best %d after %d probes",Math.round(1e4*i.d)/1e4,p)),i.max-d.d<=e||(o=i.h/2,s.push(new Sf(i.p.x-o,i.p.y-o,o,t)),s.push(new Sf(i.p.x+o,i.p.y-o,o,t)),s.push(new Sf(i.p.x-o,i.p.y+o,o,t)),s.push(new Sf(i.p.x+o,i.p.y+o,o,t)),p+=4)}return r&&(console.log(`num probes: ${p}`),console.log(`best distance: ${d.d}`)),d.p}function Uf(t,e){return e.max-t.max}function Sf(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){let i=!1,r=1/0;for(let n=0;n<e.length;n++){const a=e[n];for(let e=0,n=a.length,o=n-1;e<n;o=e++){const n=a[e],s=a[o];n.y>t.y!=s.y>t.y&&t.x<(s.x-n.x)*(t.y-n.y)/(s.y-n.y)+n.x&&(i=!i),r=Math.min(r,el(t,n,s))}}return(i?1:-1)*Math.sqrt(r)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}var Nf;t.aM=void 0,(Nf=t.aM||(t.aM={}))[Nf.center=1]="center",Nf[Nf.left=2]="left",Nf[Nf.right=3]="right",Nf[Nf.top=4]="top",Nf[Nf.bottom=5]="bottom",Nf[Nf["top-left"]=6]="top-left",Nf[Nf["top-right"]=7]="top-right",Nf[Nf["bottom-left"]=8]="bottom-left",Nf[Nf["bottom-right"]=9]="bottom-right";const Ef=Number.POSITIVE_INFINITY;function Ff(t,e){return e[1]!==Ef?function(t,e,i){let r=0,n=0;switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":n=i-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-i}switch(t){case"top-right":case"bottom-right":case"right":r=-e;break;case"top-left":case"bottom-left":case"left":r=e}return[r,n]}(t,e[0],e[1]):function(t,e){let i=0,r=0;e<0&&(e=0);const n=e/Math.SQRT2;switch(t){case"top-right":case"top-left":r=n-7;break;case"bottom-right":case"bottom-left":r=7-n;break;case"bottom":r=7-e;break;case"top":r=e-7}switch(t){case"top-right":case"bottom-right":i=-n;break;case"top-left":case"bottom-left":i=n;break;case"left":i=e;break;case"right":i=-e}return[i,r]}(t,e[0])}function Zf(t,e,i){var r;const n=t.layout,a=null===(r=n.get("text-variable-anchor-offset"))||void 0===r?void 0:r.evaluate(e,{},i);if(a){const t=a.values,e=[];for(let i=0;i<t.length;i+=2){const r=e[i]=t[i],n=t[i+1].map(t=>t*wu);r.startsWith("top")?n[1]-=7:r.startsWith("bottom")&&(n[1]+=7),e[i+1]=n}return new Ce(e)}const o=n.get("text-variable-anchor");if(o){let r;r=void 0!==t._unevaluatedLayout.getValue("text-radial-offset")?[n.get("text-radial-offset").evaluate(e,{},i)*wu,Ef]:n.get("text-offset").evaluate(e,{},i).map(t=>t*wu);const a=[];for(const t of o)a.push(t,Ff(t,r));return new Ce(a)}return null}function kf(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function zf(e,i,r,n,a,o,s,l,c,h,u,d){let p=o.textMaxSize.evaluate(i,{});void 0===p&&(p=s);const m=e.layers[0].layout,f=m.get("icon-offset").evaluate(i,{},u),g=If(r.horizontal),_=s/24,y=e.tilePixelRatio*_,x=e.tilePixelRatio*p/24,b=e.tilePixelRatio*l,v=e.tilePixelRatio*m.get("symbol-spacing"),T=m.get("text-padding")*e.tilePixelRatio,w=function(t,e,i,r=1){const n=t.get("icon-padding").evaluate(e,{},i),a=n&&n.values;return[a[0]*r,a[1]*r,a[2]*r,a[3]*r]}(m,i,u,e.tilePixelRatio),V=m.get("text-max-angle")/180*Math.PI,R="viewport"!==m.get("text-rotation-alignment")&&"point"!==m.get("symbol-placement"),M="map"===m.get("icon-rotation-alignment")&&"point"!==m.get("symbol-placement"),U=m.get("symbol-placement"),S=v/2,E=m.get("icon-text-fit");let F;n&&"none"!==E&&(e.allowVerticalPlacement&&r.vertical&&(F=ud(n,r.vertical,E,m.get("icon-text-fit-padding"),f,_)),g&&(n=ud(n,g,E,m.get("icon-text-fit-padding"),f,_)));const Z=u?d.line.getGranularityForZoomLevel(u.z):1,k=(l,d)=>{d.x<0||d.x>=N||d.y<0||d.y>=N||function(e,i,r,n,a,o,s,l,c,h,u,d,p,m,f,g,_,y,x,b,v,T,w,V,R){const M=e.addToLineVertexArray(i,r);let U,S,N,E,F=0,Z=0,k=0,z=0,W=-1,I=-1;const D={};let C=xs("");if(e.allowVerticalPlacement&&n.vertical){const t=l.layout.get("text-rotate").evaluate(v,{},V)+90;N=new Vf(c,i,h,u,d,n.vertical,p,m,f,t),s&&(E=new Vf(c,i,h,u,d,s,_,y,f,t))}if(a){const r=l.layout.get("icon-rotate").evaluate(v,{}),n="none"!==l.layout.get("icon-text-fit"),o=xf(a,r,w,n),p=s?xf(s,r,w,n):void 0;S=new Vf(c,i,h,u,d,a,_,y,!1,r),F=4*o.length;const m=e.iconSizeData;let f=null;"source"===m.kind?(f=[dd*l.layout.get("icon-size").evaluate(v,{})],f[0]>pd&&A(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===m.kind&&(f=[dd*T.compositeIconSizes[0].evaluate(v,{},V),dd*T.compositeIconSizes[1].evaluate(v,{},V)],(f[0]>pd||f[1]>pd)&&A(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),e.addSymbols(e.icon,o,f,b,x,v,t.aw.none,i,M.lineStartIndex,M.lineLength,-1,V),W=e.icon.placedSymbolArray.length-1,p&&(Z=4*p.length,e.addSymbols(e.icon,p,f,b,x,v,t.aw.vertical,i,M.lineStartIndex,M.lineLength,-1,V),I=e.icon.placedSymbolArray.length-1)}const B=Object.keys(n.horizontal);for(const r of B){const a=n.horizontal[r];if(!U){C=xs(a.text);const t=l.layout.get("text-rotate").evaluate(v,{},V);U=new Vf(c,i,h,u,d,a,p,m,f,t)}const s=1===a.positionedLines.length;if(k+=Wf(e,i,a,o,l,f,v,g,M,n.vertical?t.aw.horizontal:t.aw.horizontalOnly,s?B:[r],D,W,T,V),s)break}n.vertical&&(z+=Wf(e,i,n.vertical,o,l,f,v,g,M,t.aw.vertical,["vertical"],D,I,T,V));const P=U?U.boxStartIndex:e.collisionBoxArray.length,O=U?U.boxEndIndex:e.collisionBoxArray.length,L=N?N.boxStartIndex:e.collisionBoxArray.length,j=N?N.boxEndIndex:e.collisionBoxArray.length,G=S?S.boxStartIndex:e.collisionBoxArray.length,Y=S?S.boxEndIndex:e.collisionBoxArray.length,Q=E?E.boxStartIndex:e.collisionBoxArray.length,J=E?E.boxEndIndex:e.collisionBoxArray.length;let X=-1;const H=(t,e)=>t&&t.circleDiameter?Math.max(t.circleDiameter,e):e;X=H(U,X),X=H(N,X),X=H(S,X),X=H(E,X);const q=X>-1?1:0;q&&(X*=R/wu),e.glyphOffsetArray.length>=Td.MAX_GLYPHS&&A("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==v.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,v.sortKey);const K=Zf(l,v,V),[$,tt]=function(e,i){const r=e.length,n=null==i?void 0:i.values;if((null==n?void 0:n.length)>0)for(let i=0;i<n.length;i+=2){const r=n[i+1];e.emplaceBack(t.aM[n[i]],r[0],r[1])}return[r,e.length]}(e.textAnchorOffsets,K);e.symbolInstances.emplaceBack(i.x,i.y,D.right>=0?D.right:-1,D.center>=0?D.center:-1,D.left>=0?D.left:-1,D.vertical||-1,W,I,C,P,O,L,j,G,Y,Q,J,h,k,z,F,Z,q,0,p,X,$,tt)}(e,d,l,r,n,a,F,e.layers[0],e.collisionBoxArray,i.index,i.sourceLayerIndex,e.index,y,[T,T,T,T],R,c,b,w,M,f,i,o,h,u,s)};if("line"===U)for(const t of af(i.geometry,0,0,N,N)){const i=Tc(t,Z),a=_f(i,v,V,r.vertical||g,n,24,x,e.overscaling,N);for(const t of a)g&&Df(e,g.text,S,t)||k(i,t)}else if("line-center"===U){for(const t of i.geometry)if(t.length>1){const e=Tc(t,Z),i=gf(e,V,r.vertical||g,n,24,x);i&&k(e,i)}}else if("Polygon"===i.type)for(const t of er(i.geometry,0)){const e=Mf(t,16);k(Tc(t[0],Z,!0),new uf(e.x,e.y,0))}else if("LineString"===i.type)for(const t of i.geometry){const e=Tc(t,Z);k(e,new uf(e[0].x,e[0].y,0))}else if("Point"===i.type)for(const t of i.geometry)for(const e of t)k([e],new uf(e.x,e.y,0))}function Wf(t,e,r,n,a,o,s,l,c,h,u,d,p,m,f){const g=function(t,e,r,n,a,o,s,l){const c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,h=[];for(const t of e.positionedLines)for(const n of t.positionedGlyphs){if(!n.rect)continue;const o=n.rect||{};let u=4,d=!0,p=1,m=0;const f=(a||l)&&n.vertical,g=n.metrics.advance*n.scale/2;if(l&&e.verticalizable&&(m=t.lineOffset/2-(n.imageName?-(wu-n.metrics.width*n.scale)/2:(n.scale-1)*wu)),n.imageName){const t=s[n.imageName];d=t.sdf,p=t.pixelRatio,u=1/p}const _=a?[n.x+g,n.y]:[0,0];let y=a?[0,0]:[n.x+g+r[0],n.y+r[1]-m],x=[0,0];f&&(x=y,y=[0,0]);const b=n.metrics.isDoubleResolution?2:1,v=(n.metrics.left-u)*n.scale-g+y[0],T=(-n.metrics.top-u)*n.scale+y[1],w=v+o.w/b*n.scale/p,V=T+o.h/b*n.scale/p,R=new i(v,T),M=new i(w,T),U=new i(v,V),S=new i(w,V);if(f){const t=new i(-g,g- -17),e=-Math.PI/2,r=12-g,a=new i(22-r,-(n.imageName?r:0)),o=new i(...x);R._rotateAround(e,t)._add(a)._add(o),M._rotateAround(e,t)._add(a)._add(o),U._rotateAround(e,t)._add(a)._add(o),S._rotateAround(e,t)._add(a)._add(o)}if(c){const t=Math.sin(c),e=Math.cos(c),i=[e,-t,t,e];R._matMult(i),M._matMult(i),U._matMult(i),S._matMult(i)}const N=new i(0,0),E=new i(0,0);h.push({tl:R,tr:M,bl:U,br:S,tex:o,writingMode:e.writingMode,glyphOffset:_,sectionIndex:n.sectionIndex,isSDF:d,pixelOffsetTL:N,pixelOffsetBR:E,minFontScaleX:0,minFontScaleY:0})}return h}(0,r,l,a,o,s,n,t.allowVerticalPlacement),_=t.textSizeData;let y=null;"source"===_.kind?(y=[dd*a.layout.get("text-size").evaluate(s,{})],y[0]>pd&&A(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===_.kind&&(y=[dd*m.compositeTextSizes[0].evaluate(s,{},f),dd*m.compositeTextSizes[1].evaluate(s,{},f)],(y[0]>pd||y[1]>pd)&&A(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,g,y,l,o,s,h,e,c.lineStartIndex,c.lineLength,p,f);for(const e of u)d[e]=t.text.placedSymbolArray.length-1;return 4*g.length}function If(t){for(const e in t)return t[e];return null}function Df(t,e,i,r){const n=t.compareText;if(e in n){const t=n[e];for(let e=t.length-1;e>=0;e--)if(r.dist(t[e])<i)return!0}else n[e]=[];return n[e].push(r),!1}t.$=h,t.A=p,t.B=ha,t.C=aa,t.D=Ga,t.E=xt,t.F=function([t,e,i]){return e+=90,e*=Math.PI/180,i*=Math.PI/180,{x:t*Math.cos(e)*Math.sin(i),y:t*Math.sin(e)*Math.sin(i),z:t*Math.cos(i)}},t.G=gi,t.H=za,t.I=Ku,t.J=sa,t.K=function(t){if(null==Q){const e=t.navigator?t.navigator.userAgent:null;Q=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Q},t.L=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Zd(()=>this.process()),this.subscription=$(this.target,"message",t=>this.receive(t),!1),this.globalScope=Y(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}unregisterMessageHandler(t){delete this.messageHandlers[t]}sendAsync(t,e){return new Promise((i,r)=>{const n=Math.round(1e18*Math.random()).toString(36).substring(0,10),a=e?$(e.signal,"abort",()=>{null==a||a.unsubscribe(),delete this.resolveRejects[n];const e={id:n,type:"<cancel>",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(e)},kd):null;this.resolveRejects[n]={resolve:t=>{null==a||a.unsubscribe(),i(t)},reject:t=>{null==a||a.unsubscribe(),r(t)}};const o=[],s=Object.assign(Object.assign({},t),{id:n,sourceMapId:this.mapId,origin:location.origin,data:_a(t.data,o)});this.target.postMessage(s,{transfer:o})})}receive(t){const e=t.data,i=e.id,r=["file://","resource://android","null"],n=[e.origin,location.origin],a=e.origin===location.origin,o=n.some(t=>r.includes(t));if((a||o)&&(!e.targetMapId||this.mapId===e.targetMapId)){if("<cancel>"===e.type){delete this.tasks[i];const t=this.abortControllers[i];return delete this.abortControllers[i],void(t&&t.abort())}if(Y(self)||e.mustQueue)return this.tasks[i]=e,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,e)}}process(){if(0===this.taskQueue.length)return;const t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,i){return e(this,void 0,void 0,function*(){if("<response>"===i.type){const e=this.resolveRejects[t];if(delete this.resolveRejects[t],!e)return;return void(i.error?e.reject(ya(i.error)):e.resolve(ya(i.data)))}if(!this.messageHandlers[i.type])return void this.completeTask(t,new Error(`Could not find a registered handler for ${i.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const e=ya(i.data),r=new AbortController;this.abortControllers[t]=r;try{const n=yield this.messageHandlers[i.type](i.sourceMapId,e,r);this.completeTask(t,null,n)}catch(e){this.completeTask(t,e)}})}completeTask(t,e,i){const r=[];delete this.abortControllers[t];const n={id:t,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?_a(e):null,data:_a(i,r)};this.target.postMessage(n,{transfer:r})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.M=ht,t.N=function(){var t=new p(16);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.O=function(t,e,i){var r,n,a,o,s,l,c,h,u,d,p,m,f=i[0],g=i[1],_=i[2];return e===t?(t[12]=e[0]*f+e[4]*g+e[8]*_+e[12],t[13]=e[1]*f+e[5]*g+e[9]*_+e[13],t[14]=e[2]*f+e[6]*g+e[10]*_+e[14],t[15]=e[3]*f+e[7]*g+e[11]*_+e[15]):(n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=e[9],p=e[10],m=e[11],t[0]=r=e[0],t[1]=n,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=h,t[8]=u,t[9]=d,t[10]=p,t[11]=m,t[12]=r*f+s*g+u*_+e[12],t[13]=n*f+l*g+d*_+e[13],t[14]=a*f+c*g+p*_+e[14],t[15]=o*f+h*g+m*_+e[15]),t},t.P=i,t.Q=function(t,e,i){var r=i[0],n=i[1],a=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.R=Ml,t.S=function(t,e,i){var r=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=e[9],p=e[10],m=e[11],f=e[12],g=e[13],_=e[14],y=e[15],x=i[0],b=i[1],v=i[2],T=i[3];return t[0]=x*r+b*s+v*u+T*f,t[1]=x*n+b*l+v*d+T*g,t[2]=x*a+b*c+v*p+T*_,t[3]=x*o+b*h+v*m+T*y,t[4]=(x=i[4])*r+(b=i[5])*s+(v=i[6])*u+(T=i[7])*f,t[5]=x*n+b*l+v*d+T*g,t[6]=x*a+b*c+v*p+T*_,t[7]=x*o+b*h+v*m+T*y,t[8]=(x=i[8])*r+(b=i[9])*s+(v=i[10])*u+(T=i[11])*f,t[9]=x*n+b*l+v*d+T*g,t[10]=x*a+b*c+v*p+T*_,t[11]=x*o+b*h+v*m+T*y,t[12]=(x=i[12])*r+(b=i[13])*s+(v=i[14])*u+(T=i[15])*f,t[13]=x*n+b*l+v*d+T*g,t[14]=x*a+b*c+v*p+T*_,t[15]=x*o+b*h+v*m+T*y,t},t.T=Dl,t.U=function(t,e){const i={};for(let r=0;r<e.length;r++){const n=e[r];n in t&&(i[n]=t[n])}return i},t.V=Wd,t.W=D,t.X=Bd,t.Y=Cd,t.Z=ot,t._=e,t.a=at,t.a$=function(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.a0=u,t.a1=H,t.a2=Jd,t.a3=Od,t.a4=Ld,t.a5=N,t.a6=Ad,t.a7=Hd,t.a8=25,t.a9=Yd,t.aA=function(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)},t.aB=function(t){return t[0]=0,t[1]=0,t},t.aC=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},t.aD=yd,t.aE=V,t.aF=function(t,e,r,n){const a=e.y-t.y,o=e.x-t.x,s=n.y-r.y,l=n.x-r.x,c=s*o-l*a;if(0===c)return null;const h=(l*(t.y-r.y)-s*(t.x-r.x))/c;return new i(t.x+h*o,t.y+h*a)},t.aG=af,t.aH=Js,t.aI=function(t){let e=1/0,i=1/0,r=-1/0,n=-1/0;for(const a of t)e=Math.min(e,a.x),i=Math.min(i,a.y),r=Math.max(r,a.x),n=Math.max(n,a.y);return[e,i,r,n]},t.aJ=wu,t.aK=E,t.aL=function(t,e,i,r,n=!1){if(!i[0]&&!i[1])return[0,0];const a=n?"map"===r?-t.bearingInRadians:0:"viewport"===r?t.bearingInRadians:0;if(a){const t=Math.sin(a),e=Math.cos(a);i=[i[0]*e-i[1]*t,i[0]*t+i[1]*e]}return[n?i[0]:E(e,i[0],t.zoom),n?i[1]:E(e,i[1],t.zoom)]},t.aN=fd,t.aO=kf,t.aP=id,t.aQ=t=>"symbol"===t.type,t.aR=th,t.aS=oo,t.aT=_c,t.aU=Go,t.aV=ls,t.aW=ns,t.aX=et,t.aY=jd,t.aZ=b,t.a_=x,t.aa=t=>{const e=window.document.createElement("video");return e.muted=!0,new Promise(i=>{e.onloadstart=()=>{i(e)};for(const i of t){const t=window.document.createElement("source");mt(i)||(e.crossOrigin="Anonymous"),t.src=i,e.appendChild(t)}})},t.ab=Zt,t.ac=function(){return B++},t.ad=zo,t.ae=Td,t.af=Qm,t.ag=mn,t.ah=As,t.ai=Kd,t.aj=function(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(t,i,r,n)=>{const a=r||n;return e[i]=!a||a.toLowerCase(),""}),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e},t.ak=I,t.al=85.051129,t.am=tt,t.an=function(t){return Math.pow(2,t)},t.ao=f,t.ap=Pd,t.aq=function(t){return Math.log(t)/Math.LN2},t.ar=function(t){var e=t[0],i=t[1];return e*e+i*i},t.as=function(t){if(!t.length)return new Set;const e=Math.max(...t.map(t=>t.canonical.z));let i=1/0,r=-1/0,n=1/0,a=-1/0;const o=[];for(const s of t){const{x:t,y:l,z:c}=s.canonical,h=Math.pow(2,e-c),u=t*h,d=l*h;o.push({id:s,x:u,y:d}),u<i&&(i=u),u>r&&(r=u),d<n&&(n=d),d>a&&(a=d)}const s=new Set;for(const t of o)t.x!==i&&t.x!==r&&t.y!==n&&t.y!==a||s.add(t.id);return s},t.at=function(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x},t.au=class{constructor(t,e){this.max=t,this.onRemove=e,this.reset()}reset(){for(const t in this.data)for(const e of this.data[t])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(t,e,i){const r=t.wrapped().key;void 0===this.data[r]&&(this.data[r]=[]);const n={value:e,timeout:void 0};if(void 0!==i&&(n.timeout=setTimeout(()=>{this.remove(t,n)},i)),this.data[r].push(n),this.order.push(r),this.order.length>this.max){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}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){const e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){const e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;const i=t.wrapped().key,r=void 0===e?0:this.data[i].indexOf(e),n=this.data[i][r];return this.data[i].splice(r,1),n.timeout&&clearTimeout(n.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(n.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){const e=[];for(const i in this.data)for(const r of this.data[i])t(r.value)||e.push(r);for(const t of e)this.remove(t.value.tileID,t)}},t.av=function(t,e){let i=0,r=0;if("constant"===t.kind)r=t.layoutSize;else if("source"!==t.kind){const{interpolationType:n,minZoom:a,maxZoom:o}=t,s=n?I(mi.interpolationFactor(n,e,a,o),0,1):0;"camera"===t.kind?r=gi.number(t.minSize,t.maxSize,s):i=s}return{uSizeT:i,uSize:r}},t.ax=function(t,{uSize:e,uSizeT:i},{lowerSize:r,upperSize:n}){return"source"===t.kind?r/dd:"composite"===t.kind?gi.number(r/dd,n/dd,i):e},t.ay=function(t,e){var i=e[0],r=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],h=e[8],u=e[9],d=e[10],p=e[11],m=e[12],f=e[13],g=e[14],_=e[15],y=i*s-r*o,x=i*l-n*o,b=i*c-a*o,v=r*l-n*s,T=r*c-a*s,w=n*c-a*l,V=h*f-u*m,R=h*g-d*m,M=h*_-p*m,U=u*g-d*f,S=u*_-p*f,N=d*_-p*g,E=y*N-x*S+b*U+v*M-T*R+w*V;return E?(t[0]=(s*N-l*S+c*U)*(E=1/E),t[1]=(n*S-r*N-a*U)*E,t[2]=(f*w-g*T+_*v)*E,t[3]=(d*T-u*w-p*v)*E,t[4]=(l*M-o*N-c*R)*E,t[5]=(i*N-n*M+a*R)*E,t[6]=(g*b-m*w-_*x)*E,t[7]=(h*w-d*b+p*x)*E,t[8]=(o*S-s*M+c*V)*E,t[9]=(r*M-i*S-a*V)*E,t[10]=(m*T-f*b+_*y)*E,t[11]=(u*b-h*T-p*y)*E,t[12]=(s*R-o*U-l*V)*E,t[13]=(i*U-r*R+n*V)*E,t[14]=(f*x-m*v-g*y)*E,t[15]=(h*v-u*x+d*y)*E,t):null},t.az=U,t.b=J,t.b$=class extends Vs{constructor(t,e){super(t,e),this.current=Ss}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(let e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}},t.b0=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t},t.b1=function(t,e){var i=e[0],r=e[1],n=e[2],a=i*i+r*r+n*n;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.b2=v,t.b3=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.b4=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t},t.b5=_,t.b6=function(t,e,i){const r=e[0]*i[0]+e[1]*i[1]+e[2]*i[2];return 0===r?null:(-(t[0]*i[0]+t[1]*i[1]+t[2]*i[2])-i[3])/r},t.b7=w,t.b8=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t},t.b9=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]},t.bA=function(t,e,i){var r=i[0],n=i[1],a=i[2],o=i[3],s=e[0],l=e[1],c=e[2],h=n*c-a*l,u=a*s-r*c,d=r*l-n*s;return t[0]=s+o*(h+=h)+n*(d+=d)-a*(u+=u),t[1]=l+o*u+a*h-r*d,t[2]=c+o*d+r*u-n*h,t},t.bB=function(t,e,i){const r=(n=[t[0],t[1],t[2],e[0],e[1],e[2],i[0],i[1],i[2]])[0]*((h=n[8])*(o=n[4])-(s=n[5])*(c=n[7]))+n[1]*(-h*(a=n[3])+s*(l=n[6]))+n[2]*(c*a-o*l);var n,a,o,s,l,c,h;if(0===r)return null;const u=v([],[e[0],e[1],e[2]],[i[0],i[1],i[2]]),d=v([],[i[0],i[1],i[2]],[t[0],t[1],t[2]]),p=v([],[t[0],t[1],t[2]],[e[0],e[1],e[2]]),m=b([],u,-t[3]);return x(m,m,b([],d,-e[3])),x(m,m,b([],p,-i[3])),b(m,m,1/r),m},t.bC=zd,t.bD=function(){return new Float64Array(4)},t.bE=function(t,e,i,r){var n=[],a=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],a[0]=n[0]*Math.cos(r)-n[1]*Math.sin(r),a[1]=n[0]*Math.sin(r)+n[1]*Math.cos(r),a[2]=n[2],t[0]=a[0]+i[0],t[1]=a[1]+i[1],t[2]=a[2]+i[2],t},t.bF=function(t,e,i,r){var n=[],a=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],a[0]=n[0],a[1]=n[1]*Math.cos(r)-n[2]*Math.sin(r),a[2]=n[1]*Math.sin(r)+n[2]*Math.cos(r),t[0]=a[0]+i[0],t[1]=a[1]+i[1],t[2]=a[2]+i[2],t},t.bG=function(t,e,i,r){var n=[],a=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],a[0]=n[2]*Math.sin(r)+n[0]*Math.cos(r),a[1]=n[1],a[2]=n[2]*Math.cos(r)-n[0]*Math.sin(r),t[0]=a[0]+i[0],t[1]=a[1]+i[1],t[2]=a[2]+i[2],t},t.bH=function(t,e,i){var r=Math.sin(i),n=Math.cos(i),a=e[0],o=e[1],s=e[2],l=e[3],c=e[8],h=e[9],u=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*n-c*r,t[1]=o*n-h*r,t[2]=s*n-u*r,t[3]=l*n-d*r,t[8]=a*r+c*n,t[9]=o*r+h*n,t[10]=s*r+u*n,t[11]=l*r+d*n,t},t.bI=function(t,e){const i=F(t,360),r=F(e,360),n=r-i,a=r>i?n-360:n+360;return Math.abs(n)<Math.abs(a)?n:a},t.bJ=function(t){return t[0]=0,t[1]=0,t[2]=0,t},t.bK=function(t,e,i,r){const n=Math.sqrt(t*t+e*e),a=Math.sqrt(i*i+r*r);t/=n,e/=n,i/=a,r/=a;const o=Math.acos(t*i+e*r);return-e*i+t*r>0?o:-o},t.bL=function(t,e){const i=F(t,2*Math.PI),r=F(e,2*Math.PI);return Math.min(Math.abs(i-r),Math.abs(i-r+2*Math.PI),Math.abs(i-r-2*Math.PI))},t.bM=function(){const t={},e=bt.$version;for(const i in bt.$root){const r=bt.$root[i];if(r.required){let n=null;n="version"===i?e:"array"===r.type?[]:{},null!=n&&(t[i]=n)}}return t},t.bN=dt,t.bO=xa,t.bP=function t(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return!1;for(let r=0;r<e.length;r++)if(!t(e[r],i[r]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==i){if("object"!=typeof i)return!1;if(Object.keys(e).length!==Object.keys(i).length)return!1;for(const r in e)if(!t(e[r],i[r]))return!1;return!0}return e===i},t.bQ=st,t.bR=function(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=Tt(t[i],e[t[i].ref]));return t},t.bS=function(t,e){if("custom"===t.type)return new Fd(t,e);switch(t.type){case"background":return new Ed(t,e);case"circle":return new yl(t,e);case"color-relief":return new Pl(t,e);case"fill":return new Ec(t,e);case"fill-extrusion":return new Hc(t,e);case"heatmap":return new El(t,e);case"hillshade":return new kl(t,e);case"line":return new fu(t,e);case"raster":return new io(t,e);case"symbol":return new Ud(t,e)}},t.bT=t=>"raster"===t.type,t.bU=L,t.bV=function(t,e){if(!t)return[{command:"setStyle",args:[e]}];let i=[];try{if(!wt(t.version,e.version))return[{command:"setStyle",args:[e]}];wt(t.center,e.center)||i.push({command:"setCenter",args:[e.center]}),wt(t.state,e.state)||i.push({command:"setGlobalState",args:[e.state]}),wt(t.centerAltitude,e.centerAltitude)||i.push({command:"setCenterAltitude",args:[e.centerAltitude]}),wt(t.zoom,e.zoom)||i.push({command:"setZoom",args:[e.zoom]}),wt(t.bearing,e.bearing)||i.push({command:"setBearing",args:[e.bearing]}),wt(t.pitch,e.pitch)||i.push({command:"setPitch",args:[e.pitch]}),wt(t.roll,e.roll)||i.push({command:"setRoll",args:[e.roll]}),wt(t.sprite,e.sprite)||i.push({command:"setSprite",args:[e.sprite]}),wt(t.glyphs,e.glyphs)||i.push({command:"setGlyphs",args:[e.glyphs]}),wt(t.transition,e.transition)||i.push({command:"setTransition",args:[e.transition]}),wt(t.light,e.light)||i.push({command:"setLight",args:[e.light]}),wt(t.terrain,e.terrain)||i.push({command:"setTerrain",args:[e.terrain]}),wt(t.sky,e.sky)||i.push({command:"setSky",args:[e.sky]}),wt(t.projection,e.projection)||i.push({command:"setProjection",args:[e.projection]});const r={},n=[];!function(t,e,i,r){let n;for(n in e=e||{},t=t||{})Object.prototype.hasOwnProperty.call(t,n)&&(Object.prototype.hasOwnProperty.call(e,n)||Mt(n,i,r));for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Object.prototype.hasOwnProperty.call(t,n)?wt(t[n],e[n])||("geojson"===t[n].type&&"geojson"===e[n].type&&St(t,e,n)?Vt(i,{command:"setGeoJSONSourceData",args:[n,e[n].data]}):Ut(n,e,i,r)):Rt(n,e,i))}(t.sources,e.sources,n,r);const a=[];t.layers&&t.layers.forEach(t=>{"source"in t&&r[t.source]?i.push({command:"removeLayer",args:[t.id]}):a.push(t)}),i=i.concat(n),function(t,e,i){e=e||[];const r=(t=t||[]).map(Et),n=e.map(Et),a=t.reduce(Ft,{}),o=e.reduce(Ft,{}),s=r.slice(),l=Object.create(null);let c,h,u,d,p;for(let t=0,e=0;t<r.length;t++)c=r[t],Object.prototype.hasOwnProperty.call(o,c)?e++:(Vt(i,{command:"removeLayer",args:[c]}),s.splice(s.indexOf(c,e),1));for(let t=0,e=0;t<n.length;t++)c=n[n.length-1-t],s[s.length-1-t]!==c&&(Object.prototype.hasOwnProperty.call(a,c)?(Vt(i,{command:"removeLayer",args:[c]}),s.splice(s.lastIndexOf(c,s.length-e),1)):e++,d=s[s.length-t],Vt(i,{command:"addLayer",args:[o[c],d]}),s.splice(s.length-t,0,c),l[c]=!0);for(let t=0;t<n.length;t++)if(c=n[t],h=a[c],u=o[c],!l[c]&&!wt(h,u))if(wt(h.source,u.source)&&wt(h["source-layer"],u["source-layer"])&&wt(h.type,u.type)){for(p in Nt(h.layout,u.layout,i,c,null,"setLayoutProperty"),Nt(h.paint,u.paint,i,c,null,"setPaintProperty"),wt(h.filter,u.filter)||Vt(i,{command:"setFilter",args:[c,u.filter]}),wt(h.minzoom,u.minzoom)&&wt(h.maxzoom,u.maxzoom)||Vt(i,{command:"setLayerZoomRange",args:[c,u.minzoom,u.maxzoom]}),h)Object.prototype.hasOwnProperty.call(h,p)&&"layout"!==p&&"paint"!==p&&"filter"!==p&&"metadata"!==p&&"minzoom"!==p&&"maxzoom"!==p&&(0===p.indexOf("paint.")?Nt(h[p],u[p],i,c,p.slice(6),"setPaintProperty"):wt(h[p],u[p])||Vt(i,{command:"setLayerProperty",args:[c,p,u[p]]}));for(p in u)Object.prototype.hasOwnProperty.call(u,p)&&!Object.prototype.hasOwnProperty.call(h,p)&&"layout"!==p&&"paint"!==p&&"filter"!==p&&"metadata"!==p&&"minzoom"!==p&&"maxzoom"!==p&&(0===p.indexOf("paint.")?Nt(h[p],u[p],i,c,p.slice(6),"setPaintProperty"):wt(h[p],u[p])||Vt(i,{command:"setLayerProperty",args:[c,p,u[p]]}))}else Vt(i,{command:"removeLayer",args:[c]}),d=s[s.lastIndexOf(c)+1],Vt(i,{command:"addLayer",args:[u,d]})}(a,e.layers,i)}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:"setStyle",args:[e]}]}return i},t.bW=function(t){const e=[],i=t.id;return void 0===i&&e.push({message:`layers.${i}: missing required property "id"`}),void 0===t.render&&e.push({message:`layers.${i}: missing required method "render"`}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},t.bX=P,t.bY=O,t.bZ=class extends Vs{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}},t.b_=Us,t.ba=Qd,t.bb=Xd,t.bc=function(t,e,i,r,n){var a=1/Math.tan(e/2);if(t[0]=a/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=n&&n!==1/0){var o=1/(r-n);t[10]=(n+r)*o,t[14]=2*n*r*o}else t[10]=-1,t[14]=-2*r;return t},t.bd=function(t){var e=new p(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.be=function(t,e,i){var r=Math.sin(i),n=Math.cos(i),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],h=e[5],u=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*n+c*r,t[1]=o*n+h*r,t[2]=s*n+u*r,t[3]=l*n+d*r,t[4]=c*n-a*r,t[5]=h*n-o*r,t[6]=u*n-s*r,t[7]=d*n-l*r,t},t.bf=function(t,e,i){var r=Math.sin(i),n=Math.cos(i),a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*n+c*r,t[5]=o*n+h*r,t[6]=s*n+u*r,t[7]=l*n+d*r,t[8]=c*n-a*r,t[9]=h*n-o*r,t[10]=u*n-s*r,t[11]=d*n-l*r,t},t.bg=function(){const t=new Float32Array(16);return f(t),t},t.bh=function(){const t=new Float64Array(16);return f(t),t},t.bi=function(){return new Float64Array(16)},t.bj=function(t,e,i){const r=new Float64Array(4);return M(r,t,e-90,i),r},t.bk=function(t,e,i,r){var n,a,o,s,l,c=e[0],h=e[1],u=e[2],p=e[3],m=i[0],f=i[1],g=i[2],_=i[3];return(a=c*m+h*f+u*g+p*_)<0&&(a=-a,m=-m,f=-f,g=-g,_=-_),1-a>d?(n=Math.acos(a),o=Math.sin(n),s=Math.sin((1-r)*n)/o,l=Math.sin(r*n)/o):(s=1-r,l=r),t[0]=s*c+l*m,t[1]=s*h+l*f,t[2]=s*u+l*g,t[3]=s*p+l*_,t},t.bl=function(t){const e=new Float64Array(9);var i,r,n,a,o,s,l,c,h,u,d,p,m,f,g,_,y,x;u=(n=(r=t)[0])*(l=n+n),d=(a=r[1])*l,m=(o=r[2])*l,f=o*(c=a+a),_=(s=r[3])*l,y=s*c,x=s*(h=o+o),(i=e)[0]=1-(p=a*c)-(g=o*h),i[3]=d-x,i[6]=m+y,i[1]=d+x,i[4]=1-u-g,i[7]=f-_,i[2]=m-y,i[5]=f+_,i[8]=1-u-p;const b=et(-Math.asin(I(e[2],-1,1)));let v,T;return Math.hypot(e[5],e[8])<.001?(v=0,T=-et(Math.atan2(e[3],e[4]))):(v=et(0===e[5]&&0===e[8]?0:Math.atan2(e[5],e[8])),T=et(0===e[1]&&0===e[0]?0:Math.atan2(e[1],e[0]))),{roll:v,pitch:b+90,bearing:T}},t.bm=function(t,e){return t.roll==e.roll&&t.pitch==e.pitch&&t.bearing==e.bearing},t.bn=Se,t.bo=Rs,t.bp=yc,t.bq=xc,t.br=gc,t.bs=Z,t.bt=k,t.bu=Pe,t.bv=function(t,e,i,r,n){return Z(r,n,I((t-e)/(i-e),0,1))},t.bw=function(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t},t.bx=F,t.by=function(){return new Float64Array(3)},t.bz=M,t.c=lt,t.c$=class{get tiles(){return this.tileIndex?.tiles??{}}get stats(){return this.tileIndex.stats}get total(){return this.tileIndex.total}constructor(t,e){const i=(e=this.options=Object.assign({},iu,e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let r=hh(t,e);i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles")),r=Wh(r,e),e.updateable&&(this.source=r),this.initializeIndex(r,e)}initializeIndex(t,e){this.tileIndex=e.cluster?new Oh(e.clusterOptions):new tu(e),t.length&&this.tileIndex.initialize(t)}getTile(t,e,i){return e=+e,i=+i,(t=+t)<0||t>24?null:this.tileIndex.getTile(t,e,i)}updateData(t,e){const i=this.options;if(!i.updateable)throw new Error("to update tile geojson `updateable` option must be set to true");let{affected:r,source:n}=function(t,e,i){const r=function(t){return t?{removeAll:t.removeAll,remove:new Set(t.remove||[]),add:new Map(t.add?.map(t=>[t.id,t])),update:new Map(t.update?.map(t=>[t.id,t]))}:{remove:new Set,add:new Map,update:new Map}}(e);let n=[];if(r.removeAll&&(n=t,t=[]),r.remove.size||r.add.size){const e=[];for(const i of t)(r.remove.has(i.id)||r.add.has(i.id))&&e.push(i);if(e.length){n.push(...e);const i=new Set(e.map(t=>t.id));t=t.filter(t=>!i.has(t.id))}if(r.add.size){let e=hh({type:"FeatureCollection",features:Array.from(r.add.values())},i);e=Wh(e,i),n.push(...e),t.push(...e)}}if(r.update.size)for(const[e,a]of r.update){const r=[],o=[];for(const i of t)i.id===e?r.push(i):o.push(i);if(!r.length)continue;const s=Ch(r,a,i);s.length&&(n.push(...r,...s),o.push(...s),t=o)}return{affected:n,source:t}}(this.source,t,i);e&&({affected:r,source:n}=this.filterUpdate(n,r,e)),r.length&&(this.source=n,this.tileIndex.updateIndex(n,r,i))}filterUpdate(t,e,i){const r=new Set;for(const n of t)null!=n.id&&(i(gh(n))||(e.push(n),r.add(n.id)));return{affected:e,source:t=t.filter(t=>!r.has(t.id))}}getData(){if(!this.options.updateable)throw new Error("to retrieve data the `updateable` option must be set to true");return{type:"FeatureCollection",features:this.source.map(t=>gh(t))}}updateClusterOptions(t,e){const i=this.options.cluster;this.options.cluster=t,this.options.clusterOptions=e,i!=t?this.initializeIndex(this.source,this.options):this.tileIndex.updateIndex(this.source,[],this.options)}getClusterExpansionZoom(t){return this.tileIndex.getClusterExpansionZoom(t)}getClusterChildren(t){return this.tileIndex.getChildren(t)}getClusterLeaves(t,e,i){return this.tileIndex.getLeaves(t,e,i)}},t.c0=Ms,t.c1=class extends Vs{constructor(t,e){super(t,e),this.current=[0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}},t.c2=class extends Vs{constructor(t,e){super(t,e),this.current=[0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}},t.c3=m,t.c4=function(t,e){var i=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.c5=function(t,e,i){var r=e[0],n=e[1],a=e[2];return t[0]=r*i[0]+n*i[3]+a*i[6],t[1]=r*i[1]+n*i[4]+a*i[7],t[2]=r*i[2]+n*i[5]+a*i[8],t},t.c6=function(t,e,i,r,n,a,o){var s=1/(e-i),l=1/(r-n),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*s,t[13]=(n+r)*l,t[14]=(o+a)*c,t[15]=1,t},t.c7=class extends Vs{constructor(t,e){super(t,e),this.current=new Array}set(t){if(t!=this.current){this.current=t;const e=new Float32Array(4*t.length);for(let i=0;i<t.length;i++)e[4*i]=t[i].r,e[4*i+1]=t[i].g,e[4*i+2]=t[i].b,e[4*i+3]=t[i].a;this.gl.uniform4fv(this.location,e)}}},t.c8=class extends Vs{constructor(t,e){super(t,e),this.current=new Array}set(t){if(t!=this.current){this.current=t;const e=new Float32Array(t);this.gl.uniform1fv(this.location,e)}}},t.c9=class extends To{},t.cA=function(t){return it[t]||rt[t]},t.cB=function(t,e,i){var r=e[0],n=e[1];return t[0]=i[0]*r+i[4]*n+i[12],t[1]=i[1]*r+i[5]*n+i[13],t},t.cC=function(t,e){const{x:i,y:r}=Ad.fromLngLat(e);return!(t<0||t>25||r<0||r>=1||i<0||i>=1)},t.cD=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.cE=class extends co{},t.cF=ut,t.cG=function(t,e){lt.REGISTERED_PROTOCOLS[t]=e},t.cH=function(t){delete lt.REGISTERED_PROTOCOLS[t]},t.cI=function(t,e){const i={};for(let r=0;r<t.length;r++){const n=e&&e[t[r].id]||wn(t[r]);e&&(e[t[r].id]=n);let a=i[n];a||(a=i[n]=[]),a.push(t[r])}const r=[];for(const t in i)r.push(i[t]);return r},t.cJ=pa,t.cK=qd,t.cL=ef,t.cM=$u,t.cN=function(e){var i;e.bucket.createArrays(),e.bucket.tilePixelRatio=N/(512*e.bucket.overscaling),e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;const r=e.bucket.layers[0],n=r.layout,a=r._unevaluatedLayout._values,o={layoutIconSize:a["icon-size"].possiblyEvaluate(new za(e.bucket.zoom+1),e.canonical),layoutTextSize:a["text-size"].possiblyEvaluate(new za(e.bucket.zoom+1),e.canonical),textMaxSize:a["text-size"].possiblyEvaluate(new za(18))};if("composite"===e.bucket.textSizeData.kind){const{minZoom:t,maxZoom:i}=e.bucket.textSizeData;o.compositeTextSizes=[a["text-size"].possiblyEvaluate(new za(t),e.canonical),a["text-size"].possiblyEvaluate(new za(i),e.canonical)]}if("composite"===e.bucket.iconSizeData.kind){const{minZoom:t,maxZoom:i}=e.bucket.iconSizeData;o.compositeIconSizes=[a["icon-size"].possiblyEvaluate(new za(t),e.canonical),a["icon-size"].possiblyEvaluate(new za(i),e.canonical)]}const s=n.get("text-line-height")*wu,l="viewport"!==n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement"),c=n.get("text-keep-upright"),h=n.get("text-size");for(const a of e.bucket.features){const u=n.get("text-font").evaluate(a,{},e.canonical).join(","),d=h.evaluate(a,{},e.canonical),p=o.layoutTextSize.evaluate(a,{},e.canonical),m=o.layoutIconSize.evaluate(a,{},e.canonical),f={horizontal:{},vertical:void 0},g=a.text;let _,y=[0,0];if(g){const i=g.toString(),o=n.get("text-letter-spacing").evaluate(a,{},e.canonical)*wu,h=Va(i)?o:0,m=n.get("text-anchor").evaluate(a,{},e.canonical),_=Zf(r,a,e.canonical);if(!_){const t=n.get("text-radial-offset").evaluate(a,{},e.canonical);y=t?Ff(m,[t*wu,Ef]):n.get("text-offset").evaluate(a,{},e.canonical).map(t=>t*wu)}let x=l?"center":n.get("text-justify").evaluate(a,{},e.canonical);const b="point"===n.get("symbol-placement")?n.get("text-max-width").evaluate(a,{},e.canonical)*wu:1/0,v=()=>{e.bucket.allowVerticalPlacement&&wa(i)&&(f.vertical=ed(g,e.glyphMap,e.glyphPositions,e.imagePositions,u,b,s,m,"left",h,y,t.aw.vertical,!0,p,d))};if(!l&&_){const i=new Set;if("auto"===x)for(let t=0;t<_.values.length;t+=2)i.add(kf(_.values[t]));else i.add(x);let r=!1;for(const n of i)if(!f.horizontal[n])if(r)f.horizontal[n]=f.horizontal[0];else{const i=ed(g,e.glyphMap,e.glyphPositions,e.imagePositions,u,b,s,"center",n,h,y,t.aw.horizontal,!1,p,d);i&&(f.horizontal[n]=i,r=1===i.positionedLines.length)}v()}else{"auto"===x&&(x=kf(m));const r=ed(g,e.glyphMap,e.glyphPositions,e.imagePositions,u,b,s,m,x,h,y,t.aw.horizontal,!1,p,d);r&&(f.horizontal[x]=r),v(),wa(i)&&l&&c&&(f.vertical=ed(g,e.glyphMap,e.glyphPositions,e.imagePositions,u,b,s,m,x,h,y,t.aw.vertical,!1,p,d))}}let x=!1;if(a.icon&&a.icon.name){const t=e.imageMap[a.icon.name];t&&(_=cd(e.imagePositions[a.icon.name],n.get("icon-offset").evaluate(a,{},e.canonical),n.get("icon-anchor").evaluate(a,{},e.canonical)),x=!!t.sdf,void 0===e.bucket.sdfIcons?e.bucket.sdfIcons=x:e.bucket.sdfIcons!==x&&A("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==e.bucket.pixelRatio||0!==n.get("icon-rotate").constantOr(1))&&(e.bucket.iconsNeedLinear=!0))}const b=If(f.horizontal)||f.vertical;(i=e.bucket).iconsInText||(i.iconsInText=!!b&&b.iconsInText),(b||_)&&zf(e.bucket,a,f,_,e.imageMap,o,p,m,y,x,e.canonical,e.subdivisionGranularity)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()},t.cO=Mc,t.cP=Ac,t.cQ=cu,t.cR=function(t,e=""){const i=new Iu;return function(t,e,i=""){for(const r in t.layers)e.writeMessage(3,(t,e)=>Jm(t,e,i),t.layers[r])}(t,i,e),i.finish()},t.cS=function(t,e,i,r,n,a){let o=of(t,e,i,n,0);return o=of(o,e,r,a,1),o},t.cT=class{constructor(t){this.maxEntries=t,this.map=new Map}get(t){const e=this.map.get(t);return void 0!==e&&(this.map.delete(t),this.map.set(t,e)),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxEntries){const t=this.map.keys().next().value;this.map.delete(t)}this.map.set(t,e)}clear(){this.map.clear()}},t.cU=Pc,t.cV=Iu,t.cW=Gm,t.cX=function(t,i,r,n,a){return e(this,void 0,void 0,function*(){if(u())try{return yield H(t,i,r,n,a)}catch(t){}return function(t,e,i,r,n){const a=t.width,o=t.height;q&&K||(q=new OffscreenCanvas(a,o),K=q.getContext("2d",{willReadFrequently:!0})),q.width=a,q.height=o,K.drawImage(t,0,0,a,o);const s=K.getImageData(e,i,r,n);return K.clearRect(0,0,a,o),s.data}(t,i,r,n,a)})},t.cY=Cl,t.cZ=class{constructor(t,e){this.layers={[Qm]:this},this.name=Qm,this.version=e?e.version:1,this.extent=e?e.extent:4096,this.length=t.length,this.features=t}feature(t){return new Ym(this.features[t],this.extent)}},t.c_=nn,t.ca=vu,t.cb=class extends Vo{},t.cc=Nl,t.cd=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.ce=Sl,t.cf=function(t,e,i){var r=e[0],n=e[1],a=e[2],o=i[3]*r+i[7]*n+i[11]*a+i[15];return t[0]=(i[0]*r+i[4]*n+i[8]*a+i[12])/(o=o||1),t[1]=(i[1]*r+i[5]*n+i[9]*a+i[13])/o,t[2]=(i[2]*r+i[6]*n+i[10]*a+i[14])/o,t},t.cg=class extends ho{},t.ch=class extends Fo{},t.ci=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},t.cj=function(t,e){var i=t[0],r=t[1],n=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],h=t[8],u=t[9],p=t[10],m=t[11],f=t[12],g=t[13],_=t[14],y=t[15],x=e[0],b=e[1],v=e[2],T=e[3],w=e[4],V=e[5],R=e[6],M=e[7],U=e[8],S=e[9],N=e[10],E=e[11],F=e[12],Z=e[13],k=e[14],z=e[15];return Math.abs(i-x)<=d*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-v)<=d*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(a-T)<=d*Math.max(1,Math.abs(a),Math.abs(T))&&Math.abs(o-w)<=d*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-V)<=d*Math.max(1,Math.abs(s),Math.abs(V))&&Math.abs(l-R)<=d*Math.max(1,Math.abs(l),Math.abs(R))&&Math.abs(c-M)<=d*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(h-U)<=d*Math.max(1,Math.abs(h),Math.abs(U))&&Math.abs(u-S)<=d*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(p-N)<=d*Math.max(1,Math.abs(p),Math.abs(N))&&Math.abs(m-E)<=d*Math.max(1,Math.abs(m),Math.abs(E))&&Math.abs(f-F)<=d*Math.max(1,Math.abs(f),Math.abs(F))&&Math.abs(g-Z)<=d*Math.max(1,Math.abs(g),Math.abs(Z))&&Math.abs(_-k)<=d*Math.max(1,Math.abs(_),Math.abs(k))&&Math.abs(y-z)<=d*Math.max(1,Math.abs(y),Math.abs(z))},t.ck=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.cl=t=>"circle"===t.type,t.cm=t=>"heatmap"===t.type,t.cn=t=>"line"===t.type,t.co=t=>"fill"===t.type,t.cp=t=>"fill-extrusion"===t.type,t.cq=t=>"hillshade"===t.type,t.cr=t=>"color-relief"===t.type,t.cs=t=>"background"===t.type,t.ct=t=>"custom"===t.type,t.cu=z,t.cv=function(t,e,i){if(e<=0)return t;const r=1/e;return void 0===i||Math.abs(i)<1e-10?Math.round(t*r)/r:(i>0?Math.ceil(t*r-1e-9):Math.floor(t*r+1e-10))/r},t.cw=function(t,e,i){const r=S(e.x-i.x,e.y-i.y),n=S(t.x-i.x,t.y-i.y);var a,o;return et(Math.atan2(r[0]*n[1]-r[1]*n[0],(a=r)[0]*(o=n)[0]+a[1]*o[1]))},t.cx=W,t.cy=function(t,e){var i;if(!rt[e])return!1;const r=null==t?void 0:t.target,n=(null===(i=null==r?void 0:r.ownerDocument)||void 0===i?void 0:i.defaultView)||window;return t instanceof n.MouseEvent||t instanceof n.WheelEvent},t.cz=function(t,e){return it[e]&&"touches"in t},t.d=mt,t.d0=ka,t.e=C,t.f=t=>e(void 0,void 0,void 0,function*(){if(0===t.byteLength)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(e)}catch(t){throw new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),t.g=ct,t.h=t=>new Promise((e,i)=>{const r=new Image;r.onload=()=>{e(r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=X})},r.onerror=()=>i(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."));const n=new Blob([new Uint8Array(t)],{type:"image/png"});r.src=t.byteLength?URL.createObjectURL(n):X}),t.i=Y,t.j=(t,e)=>pt(C(t,{type:"json"}),e),t.k=yt,t.l=_t,t.m=pt,t.n=(t,e)=>pt(C(t,{type:"arrayBuffer"}),e),t.o=function(t){return new Iu(t).readFields(Ju,[])},t.p=qu,t.q=function(t){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(t))},t.r=Rl,t.s=$,t.t=Ha,t.u=bt,t.v=na,t.w=A,t.x=Ba,t.y=oa,t.z=Ia}),i("worker",["./shared"],function(t){class e{constructor(t,e){this.keyCache={},t&&this.replace(t,e)}replace(t,e){this._layerConfigs={},this._layers={},this.update(t,[],e)}update(e,i,r){for(const i of e){this._layerConfigs[i.id]=i;const e=this._layers[i.id]=t.bS(i,r);e._featureFilter=t.ag(e.filter,r),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(const t of i)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];this.familiesBySource={};const n=t.cI(Object.values(this._layerConfigs),this.keyCache);for(const e of n){const i=e.map(t=>this._layers[t.id]),r=i[0];if(r.isHidden())continue;const n=r.source||"";let a=this.familiesBySource[n];a||(a=this.familiesBySource[n]={});const o=r.sourceLayer||t.af;let s=a[o];s||(s=a[o]=[]),s.push(i)}}}class i{constructor(e){const i={},r=[];for(const t in e){const n=e[t],a=i[t]={};for(const t in n){const e=n[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const i={x:0,y:0,w:e.bitmap.width+2,h:e.bitmap.height+2};r.push(i),a[t]={rect:i,metrics:e.metrics}}}const{w:n,h:a}=t.p(r),o=new t.r({width:n||1,height:a||1});for(const r in e){const n=e[r];for(const e in n){const a=n[+e];if(!a||0===a.bitmap.width||0===a.bitmap.height)continue;const s=i[r][e].rect;t.r.copy(a.bitmap,o,{x:0,y:0},{x:s.x+1,y:s.y+1},a.bitmap)}}this.image=o,this.positions=i}}t.cJ("GlyphAtlas",i);class r{constructor(e){this.tileID=new t.a2(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}parse(e,r,a,o,s){return t._(this,void 0,void 0,function*(){this.status="parsing",this.data=e,this.collisionBoxArray=new t.ad;const l=new t.cK(Object.keys(e.layers).sort()),c=new t.cL(this.tileID,this.promoteId);c.bucketLayerIDs=[];const h={},u={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:a,subdivisionGranularity:s},d=r.familiesBySource[this.source];for(const i in d){const r=e.layers[i];if(!r)continue;1===r.version&&t.w(`Vector tile source "${this.source}" layer "${i}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const o=l.encode(i),s=[];for(let t=0;t<r.length;t++){const e=r.feature(t),n=c.getId(e,i);s.push({feature:e,id:n,index:t,sourceLayerIndex:o})}for(const e of d[i]){const i=e[0];i.source!==this.source&&t.w(`layer.source = ${i.source} does not equal this.source = ${this.source}`),i.isHidden(this.zoom,!0)||(n(e,this.zoom,a),(h[i.id]=i.createBucket({index:c.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:o,sourceID:this.source})).populate(s,u,this.tileID.canonical),c.bucketLayerIDs.push(e.map(t=>t.id)))}}const p=t.bX(u.glyphDependencies,t=>Object.keys(t).map(Number));this.inFlightDependencies.forEach(t=>null==t?void 0:t.abort()),this.inFlightDependencies=[];let m=Promise.resolve({});if(Object.keys(p).length){const t=new AbortController;this.inFlightDependencies.push(t),m=o.sendAsync({type:"GG",data:{stacks:p,source:this.source,tileID:this.tileID,type:"glyphs"}},t)}const f=Object.keys(u.iconDependencies);let g=Promise.resolve({});if(f.length){const t=new AbortController;this.inFlightDependencies.push(t),g=o.sendAsync({type:"GI",data:{icons:f,source:this.source,tileID:this.tileID,type:"icons"}},t)}const _=Object.keys(u.patternDependencies);let y=Promise.resolve({});if(_.length){const t=new AbortController;this.inFlightDependencies.push(t),y=o.sendAsync({type:"GI",data:{icons:_,source:this.source,tileID:this.tileID,type:"patterns"}},t)}const x=u.dashDependencies;let b=Promise.resolve({});if(Object.keys(x).length){const t=new AbortController;this.inFlightDependencies.push(t),b=o.sendAsync({type:"GDA",data:{dashes:x}},t)}const[v,T,w,V]=yield Promise.all([m,g,y,b]),R=new i(v),M=new t.cM(T,w);for(const e in h){const i=h[e];i instanceof t.ae?(n(i.layers,this.zoom,a),t.cN({bucket:i,glyphMap:v,glyphPositions:R.positions,imageMap:T,imagePositions:M.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:u.subdivisionGranularity})):i.hasDependencies&&(i instanceof t.cO||i instanceof t.cP||i instanceof t.cQ)&&(n(i.layers,this.zoom,a),i.addFeatures(u,this.tileID.canonical,M.patternPositions,V))}return this.status="done",{buckets:Object.values(h).filter(t=>!t.isEmpty()),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:R.image,imageAtlas:M,dashPositions:V,glyphMap:this.returnDependencies?v:null,iconMap:this.returnDependencies?T:null,glyphPositions:this.returnDependencies?R.positions:null}})}}function n(e,i,r){const n=new t.H(i);for(const t of e)t.recalculate(n,r)}class a{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(t,e){this.loading[t]=e}finishLoading(t){delete this.loading[t]}abort(t){const e=this.loading[t];(null==e?void 0:e.abort)&&(e.abort.abort(),delete this.loading[t])}setParsing(t,e){this.parsing[t]=e}consumeParsing(t){const e=this.parsing[t];if(e)return delete this.parsing[t],e}clearParsing(t){delete this.parsing[t]}markLoaded(t,e){this.loaded[t]=e}getLoaded(t){const e=this.loaded[t];if(e)return e}removeLoaded(t){delete this.loaded[t]}clearLoaded(){this.loaded={}}}class o{constructor(t){this.start=`${t}#start`,this.end=`${t}#end`,this.measure=t,performance.mark(this.start)}finish(){performance.mark(this.end);let t=performance.getEntriesByName(this.measure);return 0===t.length&&(performance.measure(this.measure,this.start,this.end),t=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),t}}class s{constructor(t,e,i,r,n){this.type=t,this.properties=i||{},this.extent=n,this.pointsArray=e,this.id=r}loadGeometry(){return this.pointsArray.map(e=>e.map(e=>new t.P(e.x,e.y)))}}class l{constructor(t,e,i){this.version=2,this._myFeatures=t,this.name=e,this.length=t.length,this.extent=i}feature(t){return this._myFeatures[t]}}class c{constructor(){this.layers={}}addLayer(t){this.layers[t.name]=t}}function h(e){let i=t.cR(e);return 0===i.byteOffset&&i.byteLength===i.buffer.byteLength||(i=new Uint8Array(i)),{vectorTile:e,rawData:i.buffer}}function u(e,i,r){const{extent:n}=e,a=Math.pow(2,r.z-i.z),o=(r.x-i.x*a)*n,c=(r.y-i.y*a)*n,h=[];for(let i=0;i<e.length;i++){const r=e.feature(i);let l=r.loadGeometry();for(const t of l)for(const e of t)e.x=e.x*a-o,e.y=e.y*a-c;const u=128;l=t.cS(l,r.type,-u,-u,n+u,n+u),0!==l.length&&h.push(new s(r.type,l,r.properties,r.id,n))}return new l(h,e.name,n)}class d{constructor(e,i,r){this.actor=e,this.layerIndex=i,this.availableImages=r,this.tileState=new a,this.overzoomedTileResultCache=new t.cT(1e3)}loadVectorTile(e,i){try{return{vectorTile:"mlt"!==e.encoding?new t.cU(new t.cV(i)):new t.cW(i),rawData:i}}catch(t){const r=new Uint8Array(i);let n=`Unable to parse the tile at ${e.request.url}, `;throw n+=31===r[0]&&139===r[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${t.message}`,new Error(n)}}loadTile(e){return t._(this,void 0,void 0,function*(){const{uid:i,overzoomParameters:n}=e;n&&(e.request=n.overzoomRequest);const a=this._startRequestTiming(e),o=new r(e);this.tileState.startLoading(i,o);const s=new AbortController;o.abort=s;try{const r=yield t.n(e.request,s);if(e.etag&&e.etag===r.etag)return this.tileState.finishLoading(i),this._getEtagUnmodifiedResult(r,a);const l=this.loadVectorTile(e,r.data);if(this.tileState.finishLoading(i),!l)return null;let{vectorTile:c,rawData:h}=l;n&&({vectorTile:c,rawData:h}=this._getOverzoomTile(e,c));const u=this._getExpiryData(r),d=this._finishRequestTiming(a);o.vectorTile=c,this.tileState.markLoaded(i,o);const p={rawData:h,cacheControl:u,resourceTiming:d};this.tileState.setParsing(i,p);try{return yield this._parseWorkerTile(o,e,p)}finally{this.tileState.clearParsing(i)}}catch(t){throw this.tileState.finishLoading(i),o.status="done",this.tileState.markLoaded(i,o),t}})}_getEtagUnmodifiedResult(e,i){const r=this._getExpiryData(e),n=this._finishRequestTiming(i);return t.e({etagUnmodified:!0},r,n)}_parseWorkerTile(e,i,r){return t._(this,void 0,void 0,function*(){let n=yield e.parse(e.vectorTile,this.layerIndex,this.availableImages,this.actor,i.subdivisionGranularity);if(r){const{rawData:e,cacheControl:a,resourceTiming:o}=r;n=t.e({rawTileData:e.slice(0),encoding:i.encoding},n,a,o)}return n})}_getExpiryData({expires:t,cacheControl:e,etag:i}){const r={};return t&&(r.expires=t),e&&(r.cacheControl=e),i&&(r.etag=i),r}_startRequestTiming(t){var e;if(null===(e=t.request)||void 0===e?void 0:e.collectResourceTiming)return new o(t.request.url)}_finishRequestTiming(t){const e=null==t?void 0:t.finish();return e?{resourceTiming:JSON.parse(JSON.stringify(e))}:{}}_getOverzoomTile(t,e){const{tileID:i,source:r,overzoomParameters:n}=t,{maxZoomTileID:a}=n,o=`${a.key}_${i.key}`,s=this.overzoomedTileResultCache.get(o);if(s)return s;const l=new c,d=this.layerIndex.familiesBySource[r];for(const t in d){const r=e.layers[t];if(!r)continue;const n=u(r,a,i.canonical);n.length>0&&l.addLayer(n)}const p=h(l);return this.overzoomedTileResultCache.set(o,p),p}reloadTile(e){return t._(this,void 0,void 0,function*(){const t=e.uid,i=this.tileState.getLoaded(t);if(!i)throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");if(i.showCollisionBoxes=e.showCollisionBoxes,"parsing"===i.status){const r=this.tileState.consumeParsing(t);return yield this._parseWorkerTile(i,e,r)}if("done"===i.status&&i.vectorTile)return yield this._parseWorkerTile(i,e)})}abortTile(e){return t._(this,void 0,void 0,function*(){this.tileState.abort(e.uid)})}removeTile(e){return t._(this,void 0,void 0,function*(){this.tileState.removeLoaded(e.uid)})}}class p{constructor(){this.loaded={}}loadTile(e){return t._(this,void 0,void 0,function*(){const{uid:i,encoding:r,rawImageData:n,redFactor:a,greenFactor:o,blueFactor:s,baseShift:l}=e,c=n.width+2,h=n.height+2,u=t.b(n)?new t.R({width:c,height:h},yield t.cX(n,-1,-1,c,h)):n,d=new t.cY(i,u,r,a,o,s,l);return this.loaded=this.loaded||{},this.loaded[i]=d,d})}removeTile(t){const e=this.loaded,i=t.uid;e&&e[i]&&delete e[i]}}class m{constructor(t,e,i,r=f){this.actor=t,this.layerIndex=e,this.availableImages=i,this.tileState=new a,this._createGeoJSONIndex=r}loadVectorTile(e){if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const{z:i,x:r,y:n}=e.tileID.canonical,a=this._geoJSONIndex.getTile(i,r,n);return a?h(new t.cZ(a.features,{version:2,extent:t.a5})):null}loadTile(e){return t._(this,void 0,void 0,function*(){const{uid:t}=e,i=new r(e);i.abort=new AbortController;try{const r=this.loadVectorTile(e);if(!r)return null;const{vectorTile:n,rawData:a}=r;i.vectorTile=n,this.tileState.markLoaded(t,i);const o={rawData:a};this.tileState.setParsing(t,o);try{return yield this._parseWorkerTile(i,e,o)}finally{this.tileState.clearParsing(t)}}catch(e){throw i.status="done",this.tileState.markLoaded(t,i),e}})}_reloadLoadedTile(e){return t._(this,void 0,void 0,function*(){const t=e.uid,i=this.tileState.getLoaded(t);if(!i)throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");if(i.showCollisionBoxes=e.showCollisionBoxes,"parsing"===i.status){const r=this.tileState.consumeParsing(t);return yield this._parseWorkerTile(i,e,r)}if("done"===i.status&&i.vectorTile)return yield this._parseWorkerTile(i,e)})}_parseWorkerTile(e,i,r){return t._(this,void 0,void 0,function*(){let n=yield e.parse(e.vectorTile,this.layerIndex,this.availableImages,this.actor,i.subdivisionGranularity);if(r){const{rawData:e}=r;n=t.e({rawTileData:e.slice(0),encoding:"mvt"},n)}return n})}abortTile(e){return t._(this,void 0,void 0,function*(){this.tileState.abort(e.uid)})}removeTile(e){return t._(this,void 0,void 0,function*(){this.tileState.removeLoaded(e.uid)})}loadData(e){return t._(this,void 0,void 0,function*(){var i;null===(i=this._pendingRequest)||void 0===i||i.abort();const r=this._startRequestTiming(e);this._pendingRequest=new AbortController;try{yield this.loadAndProcessGeoJSON(e,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();const t={};return e.request&&(t.data=e.data),this._finishRequestTiming(r,e,t),t}catch(e){if(delete this._pendingRequest,!t.Z(e))throw e;return{abandoned:!0}}})}_startRequestTiming(t){var e;if(null===(e=t.request)||void 0===e?void 0:e.collectResourceTiming)return new o(t.request.url)}_finishRequestTiming(t,e,i){const r=null==t?void 0:t.finish();r&&(i.resourceTiming={[e.source]:JSON.parse(JSON.stringify(r))})}reloadTile(t){return this.tileState.getLoaded(t.uid)?this._reloadLoadedTile(t):this.loadTile(t)}loadAndProcessGeoJSON(e,i){return t._(this,void 0,void 0,function*(){var r;if(e.request&&(e.data=(yield t.j(e.request,i)).data),e.data)return e.data=this._filterGeoJSON(e.data,e.filter),void(this._geoJSONIndex=this._createGeoJSONIndex(e.data,e));if(e.dataDiff)return null!==(r=this._geoJSONIndex)&&void 0!==r||(this._geoJSONIndex=this._createGeoJSONIndex({type:"FeatureCollection",features:[]},e)),void this._geoJSONIndex.updateData(e.dataDiff,this._getFilterPredicate(e.filter));if(e.updateCluster&&this._geoJSONIndex.updateClusterOptions(e.geojsonVtOptions.cluster,g(e)),null==this._geoJSONIndex)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`)})}_filterGeoJSON(t,e){if("FeatureCollection"!==t.type)return t;const i=this._getFilterPredicate(e);return i?{type:"FeatureCollection",features:t.features.filter(t=>i(t))}:t}_getFilterPredicate(e){if("boolean"!=typeof e&&!(null==e?void 0:e.length))return;const i=t.c_(e,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===i.result)throw new Error(i.value.map(t=>`${t.key}: ${t.message}`).join(", "));return t=>i.value.evaluate({zoom:0},t)}removeSource(e){return t._(this,void 0,void 0,function*(){var t;null===(t=this._pendingRequest)||void 0===t||t.abort()})}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getClusterChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getClusterLeaves(t.clusterId,t.limit,t.offset)}}function f(e,i){const r=t.e(i.geojsonVtOptions||{},{updateable:!0,clusterOptions:g(i)});return new t.c$(e,r)}function g({geojsonVtOptions:e,clusterProperties:i}){if(!i||!e.clusterOptions)return e.clusterOptions;const r={},n={},a={accumulated:null,zoom:0},o={properties:null},s=Object.keys(i);for(const e of s){const[a,o]=i[e],s=t.c_(o),l=t.c_("string"==typeof a?[a,["accumulated"],["get",e]]:a);r[e]=s.value,n[e]=l.value}return e.clusterOptions.map=t=>{o.properties=t;const e={};for(const t of s)e[t]=r[t].evaluate(a,o);return e},e.clusterOptions.reduce=(t,e)=>{o.properties=e;for(const e of s)a.accumulated=t[e],t[e]=n[e].evaluate(a,o)},e.clusterOptions}class _{constructor(e){this.self=e,this.actor=new t.L(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(t,e)=>{if(this.externalWorkerSourceTypes[t])throw new Error(`Worker source with name "${t}" already registered.`);this.externalWorkerSourceTypes[t]=e},this.self.addProtocol=t.cG,this.self.removeProtocol=t.cH,this.self.registerRTLTextPlugin=e=>{t.d0.setMethods(e)},this.actor.registerMessageHandler("LDT",(t,e)=>this._getDEMWorkerSource(t,e.source).loadTile(e)),this.actor.registerMessageHandler("RDT",(e,i)=>t._(this,void 0,void 0,function*(){this._getDEMWorkerSource(e,i.source).removeTile(i)})),this.actor.registerMessageHandler("GCEZ",(e,i)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(e,i.type,i.source).getClusterExpansionZoom(i)})),this.actor.registerMessageHandler("GCC",(e,i)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(e,i.type,i.source).getClusterChildren(i)})),this.actor.registerMessageHandler("GCL",(e,i)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(e,i.type,i.source).getClusterLeaves(i)})),this.actor.registerMessageHandler("LD",(t,e)=>this._getWorkerSource(t,e.type,e.source).loadData(e)),this.actor.registerMessageHandler("LT",(t,e)=>this._getWorkerSource(t,e.type,e.source).loadTile(e)),this.actor.registerMessageHandler("RT",(t,e)=>this._getWorkerSource(t,e.type,e.source).reloadTile(e)),this.actor.registerMessageHandler("AT",(t,e)=>this._getWorkerSource(t,e.type,e.source).abortTile(e)),this.actor.registerMessageHandler("RMT",(t,e)=>this._getWorkerSource(t,e.type,e.source).removeTile(e)),this.actor.registerMessageHandler("RS",(e,i)=>t._(this,void 0,void 0,function*(){if(!this.workerSources[e]||!this.workerSources[e][i.type]||!this.workerSources[e][i.type][i.source])return;const t=this.workerSources[e][i.type][i.source];delete this.workerSources[e][i.type][i.source],void 0!==t.removeSource&&t.removeSource(i)})),this.actor.registerMessageHandler("RM",e=>t._(this,void 0,void 0,function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)})),this.actor.registerMessageHandler("SR",(e,i)=>t._(this,void 0,void 0,function*(){this.referrer=i})),this.actor.registerMessageHandler("SRPS",(t,e)=>this._syncRTLPluginState(t,e)),this.actor.registerMessageHandler("IS",(e,i)=>t._(this,void 0,void 0,function*(){this.self.importScripts(i)})),this.actor.registerMessageHandler("SI",(t,e)=>this._setImages(t,e)),this.actor.registerMessageHandler("UL",(e,i)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(e).update(i.layers,i.removedIds,this._getGlobalState(e))})),this.actor.registerMessageHandler("UGS",(e,i)=>t._(this,void 0,void 0,function*(){const t=this._getGlobalState(e);for(const e in i)t[e]=i[e]})),this.actor.registerMessageHandler("SL",(e,i)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(e).replace(i,this._getGlobalState(e))}))}_getGlobalState(t){let e=this.globalStates.get(t);return e||(e={},this.globalStates.set(t,e)),e}_setImages(e,i){return t._(this,void 0,void 0,function*(){this.availableImages[e]=i;for(const t in this.workerSources[e]){const r=this.workerSources[e][t];for(const t in r)r[t].availableImages=i}})}_syncRTLPluginState(e,i){return t._(this,void 0,void 0,function*(){return yield t.d0.syncState(i,this.self.importScripts)})}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let i=this.layerIndexes[t];return i||(i=this.layerIndexes[t]=new e),i}_getWorkerSource(t,e,i){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][i]){const r={sendAsync:(e,i)=>(e.targetMapId=t,this.actor.sendAsync(e,i))};switch(e){case"vector":this.workerSources[t][e][i]=new d(r,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][i]=new m(r,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][i]=new this.externalWorkerSourceTypes[e](r,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][i]}_getDEMWorkerSource(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new p),this.demWorkerSources[t][e]}}return t.i(self)&&(self.worker=new _(self)),_}),i("index",["exports","./shared"],function(t,e){var i="5.22.0";function r(){var t=new e.A(4);return e.A!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}let n,a,o;const s={frame(t,i,r,n){const a=n||window,o=a.requestAnimationFrame(t=>{s(),i(t)}),{unsubscribe:s}=e.s(t.signal,"abort",()=>{s(),a.cancelAnimationFrame(o),r(new e.a(t.signal.reason))},!1)},frameAsync(t,e){return new Promise((i,r)=>{this.frame(t,i,r,e)})},getImageData(t,e=0){return this.getImageCanvasContext(t).getImageData(-e,-e,t.width+2*e,t.height+2*e)},getImageCanvasContext(t){const e=window.document.createElement("canvas"),i=e.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,i.drawImage(t,0,0,t.width,t.height),i},resolveURL:t=>(n||(n=document.createElement("a")),n.href=t,n.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return void 0!==o?o:!!matchMedia&&(null==a&&(a=matchMedia("(prefers-reduced-motion: reduce)")),a.matches)},set prefersReducedMotion(t){o=t}},l=new class{constructor(){this._frozenAt=null}getCurrentTime(){return null!==this._frozenAt?this._frozenAt:performance.now()}setNow(t){this._frozenAt=t}restoreNow(){this._frozenAt=null}isFrozen(){return null!==this._frozenAt}};function c(){return l.getCurrentTime()}class h{static create(t,e,i){const r=window.document.createElement(t);return void 0!==e&&(r.className=e),i&&i.appendChild(r),r}static createNS(t,e){return window.document.createElementNS(t,e)}static disableDrag(){h.docStyle&&h.selectProp&&(h.userSelect=h.docStyle[h.selectProp],h.docStyle[h.selectProp]="none")}static enableDrag(){h.docStyle&&h.selectProp&&(h.docStyle[h.selectProp]=h.userSelect)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",h.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",h.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",h.suppressClickInternal,!0)},0)}static getScale(t){const e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}static getPoint(t,i,r){const n=i.boundingClientRect;return new e.P((r.clientX-n.left)/i.x-t.clientLeft,(r.clientY-n.top)/i.y-t.clientTop)}static mousePos(t,e){const i=h.getScale(t);return h.getPoint(t,i,e)}static touchPos(t,e){const i=[],r=h.getScale(t);for(let n=0;n<e.length;n++)i.push(h.getPoint(t,r,e[n]));return i}static sanitize(t){const e=(new DOMParser).parseFromString(t,"text/html").body||document.createElement("body"),i=e.querySelectorAll("script");for(const t of i)t.remove();return h.clean(e),e.innerHTML}static isPossiblyDangerous(t,e){const i=e.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(t)||!i.includes("javascript:")&&!i.includes("data:"))||!!t.startsWith("on")||void 0}static clean(t){const e=t.children;for(const t of e)h.removeAttributes(t),h.clean(t)}static removeAttributes(t){for(const{name:e,value:i}of t.attributes)h.isPossiblyDangerous(e,i)&&t.removeAttribute(e)}}var u;h.docStyle="undefined"!=typeof window&&window.document&&window.document.documentElement.style,h.selectProp=!h.docStyle||"userSelect"in h.docStyle?"userSelect":"webkitUserSelect",function(t){let i,r,n,a;t.resetRequestQueue=()=>{i=[],r=0,n=0,a={}},t.addThrottleControl=t=>{const e=n++;return a[e]=t,e},t.removeThrottleControl=t=>{delete a[t],s()},t.getImage=(t,r,n=!0)=>new Promise((a,o)=>{t.headers||(t.headers={}),t.headers.accept="image/webp,*/*",e.e(t,{type:"image"}),i.push({abortController:r,requestParameters:t,supportImageRefresh:n,state:"queued",onError:t=>{o(t)},onSuccess:t=>{a(t)}}),s()});const o=t=>e._(this,void 0,void 0,function*(){t.state="running";const{requestParameters:i,supportImageRefresh:n,onError:a,onSuccess:o,abortController:c}=t,h=!1===n&&!e.i(self)&&!e.g(i.url)&&(!i.headers||Object.keys(i.headers).reduce((t,e)=>t&&"accept"===e,!0));r++;const u=h?l(i,c):e.m(i,c);try{const i=yield u;delete t.abortController,t.state="completed",i.data instanceof HTMLImageElement||e.b(i.data)?o(i):i.data&&o({data:yield(d=i.data,"function"==typeof createImageBitmap?e.f(d):e.h(d)),cacheControl:i.cacheControl,expires:i.expires})}catch(e){delete t.abortController,a(e)}finally{r--,s()}var d}),s=()=>{const t=(()=>{for(const t of Object.keys(a))if(a[t]())return!0;return!1})()?e.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let e=r;e<t&&i.length>0;e++){const t=i.shift();t.abortController.signal.aborted?e--:o(t)}},l=(t,i)=>new Promise((r,n)=>{const a=new Image,o=t.url,s=t.credentials;s&&"include"===s?a.crossOrigin="use-credentials":(s&&"same-origin"===s||!e.d(o))&&(a.crossOrigin="anonymous"),i.signal.addEventListener("abort",()=>{a.src="",n(new e.a(i.signal.reason))}),a.fetchPriority="high",a.onload=()=>{a.onerror=a.onload=null,r({data:a})},a.onerror=()=>{a.onerror=a.onload=null,i.signal.aborted||n(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."))},a.src=o})}(u||(u={})),u.resetRequestQueue();class d{constructor(t){this._transformRequestFn=null!=t?t:null}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function p(t){const e=[];if("string"==typeof t)e.push({id:"default",url:t});else if(t&&t.length>0){const i=[];for(const{id:r,url:n}of t){const t=`${r}${n}`;-1===i.indexOf(t)&&(i.push(t),e.push({id:r,url:n}))}}return e}function m(t,e,i){try{const r=new URL(t);return r.pathname+=`${e}${i}`,r.toString()}catch(e){throw new Error(`Invalid sprite URL "${t}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function f(t){const{userImage:e}=t;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}class g extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=!0}destroy(){this.atlasTexture&&(this.atlasTexture.destroy(),this.atlasTexture=null);for(const t of Object.keys(this.images))this.removeImage(t);this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:t,promiseResolve:e}of this.requestors)e(this._getImagesForIds(t));this.requestors=[]}}getImage(t){const i=this.images[t];if(i&&!i.data&&i.spriteData){const t=i.spriteData;i.data=new e.R({width:t.width,height:t.height},t.context.getImageData(t.x,t.y,t.width,t.height).data),i.spriteData=null}return i}addImage(t,e){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,e)&&(this.images[t]=e)}_validate(t,i){let r=!0;const n=i.data||i.spriteData;return this._validateStretch(i.stretchX,n&&n.width)||(this.fire(new e.k(new Error(`Image "${t}" has invalid "stretchX" value`))),r=!1),this._validateStretch(i.stretchY,n&&n.height)||(this.fire(new e.k(new Error(`Image "${t}" has invalid "stretchY" value`))),r=!1),this._validateContent(i.content,i)||(this.fire(new e.k(new Error(`Image "${t}" has invalid "content" value`))),r=!1),r}_validateStretch(t,e){if(!t)return!0;let i=0;for(const r of t){if(r[0]<i||r[1]<r[0]||e<r[1])return!1;i=r[1]}return!0}_validateContent(t,e){if(!t)return!0;if(4!==t.length)return!1;const i=e.spriteData,r=i&&i.width||e.data.width,n=i&&i.height||e.data.height;return!(t[0]<0||r<t[0]||t[1]<0||n<t[1]||t[2]<0||r<t[2]||t[3]<0||n<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,e,i=!0){const r=this.getImage(t);if(i&&(r.data.width!==e.data.width||r.data.height!==e.data.height))throw new Error(`size mismatch between old image (${r.data.width}x${r.data.height}) and new image (${e.data.width}x${e.data.height}).`);e.version=r.version+1,this.images[t]=e,this.updatedImages[t]=!0}removeImage(t){const e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise((e,i)=>{let r=!0;if(!this.isLoaded())for(const e of t)this.images[e]||(r=!1);this.isLoaded()||r?e(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:e})})}_getImagesForIds(t){const i={};for(const r of t){let t=this.getImage(r);t||(this.fire(new e.l("styleimagemissing",{id:r})),t=this.getImage(r)),t?i[r]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,textFitWidth:t.textFitWidth,textFitHeight:t.textFitHeight,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)}:e.w(`Image "${r}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return i}getPixelSize(){const{width:t,height:e}=this.atlasImage;return{width:t,height:e}}getPattern(t){const i=this.patterns[t],r=this.getImage(t);if(!r)return null;if(i&&i.position.version===r.version)return i.position;if(i)i.position.version=r.version;else{const i={w:r.data.width+2,h:r.data.height+2,x:0,y:0},n=new e.I(i,r);this.patterns[t]={bin:i,position:n}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const i=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new e.T(t,this.atlasImage,i.RGBA),this.atlasTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const e in this.patterns)t.push(this.patterns[e].bin);const{w:i,h:r}=e.p(t),n=this.atlasImage;n.resize({width:i||1,height:r||1});for(const t in this.patterns){const{bin:i}=this.patterns[t],r=i.x+1,a=i.y+1,o=this.getImage(t).data,s=o.width,l=o.height;e.R.copy(o,n,{x:0,y:0},{x:r,y:a},{width:s,height:l}),e.R.copy(o,n,{x:0,y:l-1},{x:r,y:a-1},{width:s,height:1}),e.R.copy(o,n,{x:0,y:0},{x:r,y:a+l},{width:s,height:1}),e.R.copy(o,n,{x:s-1,y:0},{x:r-1,y:a},{width:1,height:l}),e.R.copy(o,n,{x:0,y:0},{x:r+s,y:a},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const i of t){if(this.callbackDispatchedThisFrame[i])continue;this.callbackDispatchedThisFrame[i]=!0;const t=this.getImage(i);t||e.w(`Image with ID: "${i}" was not found`),f(t)&&this.updateImage(i,t)}}cloneImages(){const t={};for(const e in this.images){const i=this.images[e];t[e]=Object.assign(Object.assign({},i),{data:i.data?i.data.clone():null})}return t}}const _=1e20;function y(t,e,i,r,n,a,o,s,l){for(let c=e;c<e+r;c++)x(t,i*a+c,a,n,o,s,l);for(let c=i;c<i+n;c++)x(t,c*a+e,1,r,o,s,l)}function x(t,e,i,r,n,a,o){a[0]=0,o[0]=-_,o[1]=_,n[0]=t[e];for(let s=1,l=0,c=0;s<r;s++){n[s]=t[e+s*i];const r=s*s;do{const t=a[l];c=(n[s]-n[t]+r-t*t)/(s-t)/2}while(c<=o[l]&&--l>-1);l++,a[l]=s,o[l]=c,o[l+1]=_}for(let s=0,l=0;s<r;s++){for(;o[l+1]<s;)l++;const r=a[l],c=s-r;t[e+s*i]=n[r]+c*c}}const b=e.v.layout_symbol["text-font"].default.join(",");class v{constructor(t,e,i){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={},this.lang=i}setURL(t){this.url=t}getGlyphs(t){return e._(this,void 0,void 0,function*(){const e=[];for(const i in t)for(const r of t[i])e.push(this._getAndCacheGlyphsPromise(i,r));const i=yield Promise.all(e),r={};for(const{stack:t,id:e,glyph:n}of i)r[t]||(r[t]={}),r[t][e]=n&&{id:n.id,bitmap:n.bitmap.clone(),metrics:n.metrics};return r})}_getAndCacheGlyphsPromise(t,i){return e._(this,void 0,void 0,function*(){let e=this.entries[t];e||(e=this.entries[t]={glyphs:{},requests:{},ranges:{}});let r=e.glyphs[i];return void 0!==r?{stack:t,id:i,glyph:r}:!this.url||this._charUsesLocalIdeographFontFamily(i)?(r=e.glyphs[i]=this._drawGlyph(e,t,i),{stack:t,id:i,glyph:r}):yield this._downloadAndCacheRangePromise(t,i)})}_downloadAndCacheRangePromise(t,i){return e._(this,void 0,void 0,function*(){const e=this.entries[t],r=Math.floor(i/256);if(e.ranges[r])return{stack:t,id:i,glyph:null};if(!e.requests[r]){const i=v.loadGlyphRange(t,r,this.url,this.requestManager);e.requests[r]=i}try{const n=yield e.requests[r];for(const t in n)e.glyphs[+t]=n[+t];return e.ranges[r]=!0,{stack:t,id:i,glyph:n[i]||null}}catch(n){const a=e.glyphs[i]=this._drawGlyph(e,t,i);return this._warnOnMissingGlyphRange(a,r,i,n),{stack:t,id:i,glyph:a}}})}_warnOnMissingGlyphRange(t,i,r,n){const a=256*i,o=a+255,s=r.toString(16).padStart(4,"0").toUpperCase();e.w(`Unable to load glyph range ${i}, ${a}-${o}. Rendering codepoint U+${s} locally instead. ${n}`)}_charUsesLocalIdeographFontFamily(t){return!!this.localIdeographFontFamily&&e.q(t)}_drawGlyph(t,i,r){const n=i===b&&""!==this.localIdeographFontFamily&&this._charUsesLocalIdeographFontFamily(r),a=n?"ideographTinySDF":"tinySDF";t[a]||(t[a]=this._createTinySDF(n?this.localIdeographFontFamily:i));const o=t[a].draw(String.fromCodePoint(r)),s=/^\p{gc=Cf}+$/u.test(String.fromCodePoint(r));return{id:r,bitmap:new e.r({width:o.width||60,height:o.height||60},o.data),metrics:{width:s?0:o.glyphWidth/2||24,height:o.glyphHeight/2||24,left:o.glyphLeft/2+.5||0,top:o.glyphTop/2-27.5||-8,advance:s?0:o.glyphAdvance/2||24,isDoubleResolution:!0}}}_createTinySDF(t){const e=t?t.split(","):[];e.push("sans-serif");const i=e.map(t=>/[-\w]+/.test(t)?t:`'${CSS.escape(t)}'`).join(",");return new v.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:i,fontWeight:this._fontWeight(e[0]),fontStyle:this._fontStyle(e[0]),lang:this.lang})}_fontStyle(t){return/italic/i.test(t)?"italic":/oblique/i.test(t)?"oblique":"normal"}_fontWeight(t){const e={thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950};let i;for(const[r,n]of Object.entries(e))new RegExp(`\\b${r}\\b`,"i").test(t)&&(i=`${n}`);return i}destroy(){for(const t in this.entries){const e=this.entries[t];e.tinySDF&&(e.tinySDF=null),e.ideographTinySDF&&(e.ideographTinySDF=null),e.glyphs={},e.requests={},e.ranges={}}this.entries={}}}v.loadGlyphRange=function(t,i,r,n){return e._(this,void 0,void 0,function*(){const a=256*i,o=a+255,s=yield n.transformRequest(r.replace("{fontstack}",t).replace("{range}",`${a}-${o}`),"Glyphs"),l=yield e.n(s,new AbortController);if(!l||!l.data)throw new Error(`Could not load glyph range. range: ${i}, ${a}-${o}`);const c={};for(const t of e.o(l.data))c[t.id]=t;return c})},v.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:r=.25,fontFamily:n="sans-serif",fontWeight:a="normal",fontStyle:o="normal",lang:s=null}={}){this.buffer=e,this.cutoff=r,this.radius=i,this.lang=s;const l=this.size=t+4*e,c=this._createCanvas(l),h=this.ctx=c.getContext("2d",{willReadFrequently:!0});h.font=`${o} ${a} ${t}px ${n}`,h.textBaseline="alphabetic",h.textAlign="left",h.fillStyle="black",this.gridOuter=new Float64Array(l*l),this.gridInner=new Float64Array(l*l),this.f=new Float64Array(l),this.z=new Float64Array(l+1),this.v=new Uint16Array(l)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:r,actualBoundingBoxLeft:n,actualBoundingBoxRight:a}=this.ctx.measureText(t),o=Math.ceil(i),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-n))),l=Math.min(this.size-this.buffer,o+Math.ceil(r)),c=s+2*this.buffer,h=l+2*this.buffer,u=Math.max(c*h,0),d=new Uint8ClampedArray(u),p={data:d,width:c,height:h,glyphWidth:s,glyphHeight:l,glyphTop:o,glyphLeft:0,glyphAdvance:e};if(0===s||0===l)return p;const{ctx:m,buffer:f,gridInner:g,gridOuter:x}=this;this.lang&&(m.lang=this.lang),m.clearRect(f,f,s,l),m.fillText(t,f,f+o);const b=m.getImageData(f,f,s,l);x.fill(_,0,u),g.fill(0,0,u);for(let t=0;t<l;t++)for(let e=0;e<s;e++){const i=b.data[4*(t*s+e)+3]/255;if(0===i)continue;const r=(t+f)*c+e+f;if(1===i)x[r]=0,g[r]=_;else{const t=.5-i;x[r]=t>0?t*t:0,g[r]=t<0?t*t:0}}y(x,0,0,c,h,c,this.f,this.v,this.z),y(g,f,f,s,l,c,this.f,this.v,this.z);for(let t=0;t<u;t++){const e=Math.sqrt(x[t])-Math.sqrt(g[t]);d[t]=Math.round(255-255*(e/this.radius+this.cutoff))}return p}};class T{constructor(){this.specification=e.u.light.position}possiblyEvaluate(t,i){return e.F(t.expression.evaluate(i))}interpolate(t,i,r){return{x:e.G.number(t.x,i.x,r),y:e.G.number(t.y,i.y,r),z:e.G.number(t.z,i.z,r)}}}let w;class V extends e.E{constructor(t){super(),w=w||new e.t({anchor:new e.D(e.u.light.anchor),position:new T,color:new e.D(e.u.light.color),intensity:new e.D(e.u.light.intensity)}),this._transitionable=new e.x(w,void 0),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,i={}){if(!this._validate(e.y,t,i))for(const i in t){const r=t[i];i.endsWith(e.z)?this._transitionable.setTransition(i.slice(0,-e.z.length),r):this._transitionable.setValue(i,r)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,i,r){return(!r||!1!==r.validate)&&e.B(this,t.call(e.C,{value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.u}))}}const R=new e.t({"sky-color":new e.D(e.u.sky["sky-color"]),"horizon-color":new e.D(e.u.sky["horizon-color"]),"fog-color":new e.D(e.u.sky["fog-color"]),"fog-ground-blend":new e.D(e.u.sky["fog-ground-blend"]),"horizon-fog-blend":new e.D(e.u.sky["horizon-fog-blend"]),"sky-horizon-blend":new e.D(e.u.sky["sky-horizon-blend"]),"atmosphere-blend":new e.D(e.u.sky["atmosphere-blend"])});class M extends e.E{constructor(t){super(),this._transitionable=new e.x(R,void 0),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new e.H(0))}setSky(t,i={}){if(!this._validate(e.J,t,i)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const i in t){const r=t[i];i.endsWith(e.z)?this._transitionable.setTransition(i.slice(0,-e.z.length),r):this._transitionable.setValue(i,r)}}}getSky(){return this._transitionable.serialize()}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,i,r={}){return!1!==(null==r?void 0:r.validate)&&e.B(this,t.call(e.C,e.e({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.u})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class U{constructor(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,e){const i=t.join(",")+String(e);return this.dashEntry[i]||(this.dashEntry[i]=this.addDash(t,e)),this.dashEntry[i]}getDashRanges(t,e,i){const r=[];let n=t.length%2==1?-t[t.length-1]*i:0,a=t[0]*i,o=!0;r.push({left:n,right:a,isDash:o,zeroLength:0===t[0]});let s=t[0];for(let e=1;e<t.length;e++){o=!o;const l=t[e];n=s*i,s+=l,a=s*i,r.push({left:n,right:a,isDash:o,zeroLength:0===l})}return r}addRoundDash(t,e,i){const r=e/2;for(let e=-i;e<=i;e++){const n=this.width*(this.nextRow+i+e);let a=0,o=t[a];for(let s=0;s<this.width;s++){s/o.right>1&&(o=t[++a]);const l=Math.abs(s-o.left),c=Math.abs(s-o.right),h=Math.min(l,c);let u;const d=e/i*(r+1);if(o.isDash){const t=r-Math.abs(d);u=Math.sqrt(h*h+t*t)}else u=r-Math.sqrt(h*h+d*d);this.data[n+s]=Math.max(0,Math.min(255,u+128))}}}addRegularDash(t){for(let e=t.length-1;e>=0;--e){const i=t[e],r=t[e+1];i.zeroLength?t.splice(e,1):r&&r.isDash===i.isDash&&(r.left=i.left,t.splice(e,1))}const e=t[0],i=t[t.length-1];e.isDash===i.isDash&&(e.left=i.left-this.width,i.right=e.right+this.width);const r=this.width*this.nextRow;let n=0,a=t[n];for(let e=0;e<this.width;e++){e/a.right>1&&(a=t[++n]);const i=Math.abs(e-a.left),o=Math.abs(e-a.right),s=Math.min(i,o);this.data[r+e]=Math.max(0,Math.min(255,(a.isDash?s:-s)+128))}}addDash(t,i){const r=i?7:0,n=2*r+1;if(this.nextRow+n>this.height)return e.w("LineAtlas out of space"),null;let a=0;for(let e=0;e<t.length;e++)a+=t[e];if(0!==a){const e=this.width/a,n=this.getDashRanges(t,this.width,e);i?this.addRoundDash(n,e,r):this.addRegularDash(n)}const o={y:this.nextRow+r,height:2*r,width:a};return this.nextRow+=n,this.dirty=!0,o}bind(t){const e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))}}const S="maplibre_preloaded_worker_pool";class N{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<N.workerCount;)this.workers.push(new Worker(e.c.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach(t=>{t.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[S]}numActive(){return Object.keys(this.active).length}}const E=Math.floor(s.hardwareConcurrency/2);let F,Z;function k(){return F||(F=new N),F}N.workerCount=e.K(globalThis)?Math.max(Math.min(E,3),1):1;class z{constructor(t,i){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=i;const r=this.workerPool.acquire(i);for(let t=0;t<r.length;t++){const n=new e.L(r[t],i);n.name=`Worker ${t}`,this.actors.push(n)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,e){const i=[];for(const r of this.actors)i.push(r.sendAsync({type:t,data:e}));return Promise.all(i)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(t=>{t.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,e){for(const i of this.actors)i.registerMessageHandler(t,e)}unregisterMessageHandler(t){for(const e of this.actors)e.unregisterMessageHandler(t)}}function W(){return Z||(Z=new z(k(),e.M),Z.registerMessageHandler("GR",(t,i,r)=>e.m(i,r))),Z}function I(t,i){const r=e.N();return e.O(r,r,[1,1,0]),e.Q(r,r,[.5*t.width,.5*t.height,1]),t.calculatePosMatrix?e.S(r,r,t.calculatePosMatrix(i.toUnwrapped())):r}function D(t,e,i,r,n,a,o){var s;const l=function(t,e,i){if(t)for(const r of t){const t=e[r];if(t&&t.source===i&&"fill-extrusion"===t.type)return!0}else for(const t in e){const r=e[t];if(r.source===i&&"fill-extrusion"===r.type)return!0}return!1}(null!==(s=null==n?void 0:n.layers)&&void 0!==s?s:null,e,t.id),c=a.maxPitchScaleFactor(),h=t.tilesIn(r,c,l);h.sort(C);const u=[];for(const r of h)u.push({wrappedTileID:r.tileID.wrapped().key,queryResults:r.tile.queryRenderedFeatures(e,i,t.getState(),r.queryGeometry,r.cameraQueryGeometry,r.scale,n,a,c,I(a,r.tileID),o?(t,e)=>o(r.tileID,t,e):void 0)});return function(t,e){for(const i in t)for(const r of t[i])B(r,e);return t}(function(t){const e={},i={};for(const r of t){const t=r.queryResults,n=r.wrappedTileID,a=i[n]=i[n]||{};for(const i in t){const r=t[i],n=a[i]=a[i]||{},o=e[i]=e[i]||[];for(const t of r)n[t.featureIndex]||(n[t.featureIndex]=!0,o.push(t))}}return e}(u),t)}function C(t,e){const i=t.tileID,r=e.tileID;return i.overscaledZ-r.overscaledZ||i.canonical.y-r.canonical.y||i.wrap-r.wrap||i.canonical.x-r.canonical.x}function B(t,e){const i=t.feature,r=e.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=r}function P(t,i,r,n){return e._(this,void 0,void 0,function*(){let a=t;if(t.url?a=(yield e.j(yield i.transformRequest(t.url,"Source"),r)).data:yield s.frameAsync(r,n),!a)return null;const o=e.U(e.e(a,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in a&&a.vector_layers&&(o.vectorLayerIds=a.vector_layers.map(t=>t.id)),o})}class O{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):Array.isArray(t)&&(4===t.length?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 e.V?new e.V(t.lng,t.lat):e.V.convert(t),this}setSouthWest(t){return this._sw=t instanceof e.V?new e.V(t.lng,t.lat):e.V.convert(t),this}extend(t){const i=this._sw,r=this._ne;let n,a;if(t instanceof e.V)n=t,a=t;else{if(!(t instanceof O))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(O.convert(t)):this.extend(e.V.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(e.V.convert(t)):this;if(n=t._sw,a=t._ne,!n||!a)return this}return i||r?(i.lng=Math.min(n.lng,i.lng),i.lat=Math.min(n.lat,i.lat),r.lng=Math.max(a.lng,r.lng),r.lat=Math.max(a.lat,r.lat)):(this._sw=new e.V(n.lng,n.lat),this._ne=new e.V(a.lng,a.lat)),this}getCenter(){return new e.V((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 e.V(this.getWest(),this.getNorth())}getSouthEast(){return new e.V(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){const{lng:i,lat:r}=e.V.convert(t);let n=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&n}intersects(t){if(!((t=O.convert(t)).getNorth()>=this.getSouth()&&t.getSouth()<=this.getNorth()))return!1;const i=Math.abs(this.getEast()-this.getWest()),r=Math.abs(t.getEast()-t.getWest());if(i>=360||r>=360)return!0;const n=e.W(this.getWest(),-180,180),a=e.W(this.getEast(),-180,180),o=e.W(t.getWest(),-180,180),s=e.W(t.getEast(),-180,180),l=n>a,c=o>s;return!(!l||!c)||(l?s>=n||o<=a:c?a>=o||n<=s:o<=a&&s>=n)}static convert(t){return t instanceof O?t:t?new O(t):t}static fromLngLat(t,i=0){const r=360*i/40075017,n=r/Math.cos(Math.PI/180*t.lat);return new O(new e.V(t.lng-n,t.lat-r),new e.V(t.lng+n,t.lat+r))}adjustAntiMeridian(){const t=new e.V(this._sw.lng,this._sw.lat),i=new e.V(this._ne.lng,this._ne.lat);return new O(t,t.lng>i.lng?new e.V(i.lng+360,i.lat):i)}}class L{constructor(t,e,i){this.bounds=O.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=i||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[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){const i=Math.pow(2,t.z),r=Math.floor(e.Y(this.bounds.getWest())*i),n=Math.floor(e.X(this.bounds.getNorth())*i),a=Math.ceil(e.Y(this.bounds.getEast())*i),o=Math.ceil(e.X(this.bounds.getSouth())*i);return t.x>=r&&t.x<a&&t.y>=n&&t.y<o}}class j extends e.E{constructor(t,i,r,n){if(super(),this.id=t,this.dispatcher=r,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.e(this,e.U(i,["url","scheme","tileSize","promoteId","encoding"])),this._options=e.e({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n)}load(){return e._(this,arguments,void 0,function*(t=!1){this._loaded=!1,this.fire(new e.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const i=yield P(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,i&&(e.e(this,i),i.bounds&&(this.tileBounds=new L(i.bounds,this.minzoom,this.maxzoom)),this.fire(new e.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(t){this._tileJSONRequest=null,this._loaded=!0,e.Z(t)||this.fire(new e.k(t))}})}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.abort(),t(),this.load(!0)}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.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(t){return e._(this,void 0,void 0,function*(){const e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i={request:yield this.map._requestManager.transformRequest(e,"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,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:yield this._getOverzoomParameters(t),etag:t.etag};i.request.collectResourceTiming=this._collectResourceTiming;let r="RT";if(t.actor&&"expired"!==t.state){if("loading"===t.state)return new Promise((e,i)=>{t.reloadPromise={resolve:e,reject:i}})}else t.actor=this.dispatcher.getActor(),r="LT";t.abortController=new AbortController;try{const e=yield t.actor.sendAsync({type:r,data:i},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,e);const n={};return(null==e?void 0:e.etagUnmodified)&&(n.unmodified=!0),n}catch(e){if(delete t.abortController,t.aborted)return;if(e&&404!==e.status)throw e;this._afterTileLoadWorkerResponse(t,null)}})}_getOverzoomParameters(t){return e._(this,void 0,void 0,function*(){if(t.tileID.canonical.z<=this.maxzoom)return;if(void 0===this.map._zoomLevelsToOverscale)return;const e=t.tileID.scaledTo(this.maxzoom).canonical,i=e.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:e,overzoomRequest:yield this.map._requestManager.transformRequest(i,"Tile")}})}_afterTileLoadWorkerResponse(t,e){if((null==e?void 0:e.resourceTiming)&&(t.resourceTiming=e.resourceTiming),e&&this.map._refreshExpiredTiles&&t.setExpiryData(e),t.etag=null==e?void 0:e.etag,t.loadVectorData(e,this.map.painter),t.reloadPromise){const e=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(e.resolve).catch(e.reject)}}abortTile(t){return e._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))})}unloadTile(t){return e._(this,void 0,void 0,function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class A extends e.E{constructor(t,i,r,n){super(),this.id=t,this.dispatcher=r,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.e({type:"raster"},i),e.e(this,e.U(i,["url","scheme","tileSize"]))}load(){return e._(this,arguments,void 0,function*(t=!1){this._loaded=!1,this.fire(new e.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const i=yield P(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,i&&(e.e(this,i),i.bounds&&(this.tileBounds=new L(i.bounds,this.minzoom,this.maxzoom)),this.fire(new e.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:t})))}catch(t){this._tileJSONRequest=null,this._loaded=!0,e.Z(t)||this.fire(new e.k(t))}})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load(!0)}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}serialize(){return e.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return e._(this,void 0,void 0,function*(){const i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const r=yield u.getImage(yield this.map._requestManager.transformRequest(i,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(r&&r.data){this.map._refreshExpiredTiles&&(r.cacheControl||r.expires)&&t.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const i=this.map.painter.context,n=i.gl,a=r.data;t.texture=this.map.painter.getTileTexture(a.width),t.texture?t.texture.update(a,{useMipmap:!0}):(t.texture=new e.T(i,a,n.RGBA,{useMipmap:!0}),t.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}})}abortTile(t){return e._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)})}unloadTile(t){return e._(this,void 0,void 0,function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)})}hasTransition(){return!1}}class G extends A{constructor(t,i,r,n){super(t,i,r,n),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox",this.redFactor=i.redFactor,this.greenFactor=i.greenFactor,this.blueFactor=i.blueFactor,this.baseShift=i.baseShift}loadTile(t){return e._(this,void 0,void 0,function*(){const i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r=yield this.map._requestManager.transformRequest(i,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const i=yield u.getImage(r,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(i&&i.data){const r=i.data;this.map._refreshExpiredTiles&&(i.cacheControl||i.expires)&&t.setExpiryData({cacheControl:i.cacheControl,expires:i.expires});const n=e.b(r)&&e.$()?r:yield this.readImageNow(r),a={type:this.type,uid:t.uid,source:this.id,rawImageData:n,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(t.actor&&"expired"!==t.state&&"reloading"!==t.state)return;t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor());const o=yield t.actor.sendAsync({type:"LDT",data:a});t.dem=o,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}})}readImageNow(t){return e._(this,void 0,void 0,function*(){if("undefined"!=typeof VideoFrame&&e.a0()){const i=t.width+2,r=t.height+2;try{return new e.R({width:i,height:r},yield e.a1(t,-1,-1,i,r))}catch(t){}}return s.getImageData(t,1)})}_getNeighboringTiles(t){const i=t.canonical,r=Math.pow(2,i.z),n=(i.x-1+r)%r,a=0===i.x?t.wrap-1:t.wrap,o=(i.x+1+r)%r,s=i.x+1===r?t.wrap+1:t.wrap,l={};return l[new e.a2(t.overscaledZ,a,i.z,n,i.y).key]={backfilled:!1},l[new e.a2(t.overscaledZ,s,i.z,o,i.y).key]={backfilled:!1},i.y>0&&(l[new e.a2(t.overscaledZ,a,i.z,n,i.y-1).key]={backfilled:!1},l[new e.a2(t.overscaledZ,t.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new e.a2(t.overscaledZ,s,i.z,o,i.y-1).key]={backfilled:!1}),i.y+1<r&&(l[new e.a2(t.overscaledZ,a,i.z,n,i.y+1).key]={backfilled:!1},l[new e.a2(t.overscaledZ,t.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new e.a2(t.overscaledZ,s,i.z,o,i.y+1).key]={backfilled:!1}),l}unloadTile(t){return e._(this,void 0,void 0,function*(){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&(yield t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}}))})}}function Y(t,e){return e?t.properties[e]:t.id}function Q(t,e){const i={id:t.id};if(e.removeAllProperties&&(delete t.removeProperties,delete t.addOrUpdateProperties,delete e.removeProperties),e.removeProperties)for(const i of e.removeProperties){const e=t.addOrUpdateProperties.findIndex(t=>t.key===i);e>-1&&t.addOrUpdateProperties.splice(e,1)}return(t.removeAllProperties||e.removeAllProperties)&&(i.removeAllProperties=!0),(t.removeProperties||e.removeProperties)&&(i.removeProperties=[...t.removeProperties||[],...e.removeProperties||[]]),(t.addOrUpdateProperties||e.addOrUpdateProperties)&&(i.addOrUpdateProperties=[...t.addOrUpdateProperties||[],...e.addOrUpdateProperties||[]]),(t.newGeometry||e.newGeometry)&&(i.newGeometry=e.newGeometry||t.newGeometry),i}function J(t){var e,i;if(!t)return{};const r={};return r.removeAll=t.removeAll,r.remove=new Set(t.remove||[]),r.add=new Map(null===(e=t.add)||void 0===e?void 0:e.map(t=>[t.id,t])),r.update=new Map(null===(i=t.update)||void 0===i?void 0:i.map(t=>[t.id,t])),r}function X(t){return t&&0!==t.length?"number"==typeof t[0]?[t]:t.flatMap(t=>X(t)):[]}function H(t){return"GeometryCollection"===t.type?t.geometries.flatMap(t=>H(t)):X(t.coordinates)}function q(t){const e=new O;let i;switch(t.type){case"FeatureCollection":i=t.features.flatMap(t=>H(t.geometry));break;case"Feature":i=H(t.geometry);break;default:i=H(t)}if(0===i.length)return e;for(let t=0;t<i.length;t++){const[r,n]=i[t];e.extend([r,n])}return e}class K extends e.E{constructor(t,i,r,n){super(),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._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:i.data},this.actor=r.getActor(),this.setEventedParent(n),this._data="string"==typeof i.data?{url:i.data}:{geojson:i.data},this._options=e.e({},i),this._collectResourceTiming=i.collectResourceTiming,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId,void 0!==i.clusterMaxZoom&&this.maxzoom<=i.clusterMaxZoom&&e.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${i.clusterMaxZoom}".`),this.workerOptions=e.e({source:this.id,geojsonVtOptions:{buffer:this._pixelsToTileUnits(void 0!==i.buffer?i.buffer:128),tolerance:this._pixelsToTileUnits(void 0!==i.tolerance?i.tolerance:.375),extent:e.a5,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1,promoteId:"string"==typeof i.promoteId?i.promoteId:void 0,cluster:i.cluster||!1,clusterOptions:{maxZoom:this._getClusterMaxZoom(i.clusterMaxZoom),minPoints:Math.max(2,i.clusterMinPoints||2),extent:e.a5,radius:this._pixelsToTileUnits(i.clusterRadius||50),log:!1,generateId:i.generateId||!1}},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions)}_hasPendingWorkerUpdate(){return void 0!==this._pendingWorkerUpdate.data||void 0!==this._pendingWorkerUpdate.diff||this._pendingWorkerUpdate.updateCluster}_pixelsToTileUnits(t){return t*(e.a5/this.tileSize)}_getClusterMaxZoom(t){const i=t?Math.round(t):this.maxzoom-1;return Number.isInteger(t)||void 0===t||e.w(`Integer expected for option 'clusterMaxZoom': provided value "${t}" rounded to "${i}"`),i}load(){return e._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(t){this.map=t,this.load()}setData(t,e){this._data="string"==typeof t?{url:t}:{geojson:t},this._pendingWorkerUpdate={data:t};const i=this._updateWorkerData();return e?i:this}updateData(t,e){this._pendingWorkerUpdate.diff=function(t,e){if(!t)return e||{};if(!e)return t||{};const i=J(t),r=J(e);!function(t,e){e.removeAll&&(t.add.clear(),t.update.clear(),t.remove.clear(),e.remove.clear());for(const i of e.remove)t.add.delete(i),t.update.delete(i);for(const[i,r]of e.update){const n=t.update.get(i);n&&(e.update.set(i,Q(n,r)),t.update.delete(i))}}(i,r);const n={};if((i.removeAll||r.removeAll)&&(n.removeAll=!0),n.remove=new Set([...i.remove,...r.remove]),n.add=new Map([...i.add,...r.add]),n.update=new Map([...i.update,...r.update]),n.remove.size&&n.add.size)for(const t of n.add.keys())n.remove.delete(t);return function(t){const e={};return t.removeAll&&(e.removeAll=t.removeAll),t.remove&&(e.remove=Array.from(t.remove)),t.add&&(e.add=Array.from(t.add.values())),t.update&&(e.update=Array.from(t.update.values())),e}(n)}(this._pendingWorkerUpdate.diff,t);const i=this._updateWorkerData();return e?i:this}getData(){return e._(this,void 0,void 0,function*(){return this._data.url&&(yield this.once("data")),this._data.geojson?this._data.geojson:{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}})}getBounds(){return e._(this,void 0,void 0,function*(){return q(yield this.getData())})}setClusterOptions(t){return this.workerOptions.geojsonVtOptions.cluster=t.cluster,void 0!==t.clusterRadius&&(this.workerOptions.geojsonVtOptions.clusterOptions.radius=this._pixelsToTileUnits(t.clusterRadius)),void 0!==t.clusterMaxZoom&&(this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom=this._getClusterMaxZoom(t.clusterMaxZoom)),this._pendingWorkerUpdate.updateCluster=!0,this._updateWorkerData(),this}getClusterExpansionZoom(t){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}getClusterChildren(t){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}getClusterLeaves(t,e,i){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:e,offset:i}})}_updateWorkerData(){return e._(this,void 0,void 0,function*(){if(this._isUpdatingWorker)return;if(!this._hasPendingWorkerUpdate())return void e.w(`No pending worker updates for GeoJSONSource ${this.id}.`);const{data:t,diff:i,updateCluster:r}=this._pendingWorkerUpdate,n=this._getLoadGeoJSONParameters(t,i,r);void 0!==t?this._pendingWorkerUpdate.data=void 0:i?this._pendingWorkerUpdate.diff=void 0:r&&(this._pendingWorkerUpdate.updateCluster=void 0),yield this._dispatchWorkerUpdate(n)})}_getLoadGeoJSONParameters(t,i,r){return e._(this,void 0,void 0,function*(){const n=e.e({type:this.type},this.workerOptions);return"string"==typeof t?(n.request=yield this.map._requestManager.transformRequest(s.resolveURL(t),"Source"),n.request.collectResourceTiming=this._collectResourceTiming,n):void 0!==t?(n.data=t,n):i?(n.dataDiff=i,n):r?(n.updateCluster=!0,n):void 0})}_dispatchWorkerUpdate(t){return e._(this,void 0,void 0,function*(){this._isUpdatingWorker=!0,this.fire(new e.l("dataloading",{dataType:"source"}));try{const i=yield t,r=yield this.actor.sendAsync({type:"LD",data:i});if(this._isUpdatingWorker=!1,this._removed||r.abandoned)return void this.fire(new e.l("dataabort",{dataType:"source"}));r.data&&(this._data={geojson:r.data});const n=this._applyDiffToSource(i.dataDiff),a=this._getShouldReloadTileOptions(n),o={dataType:"source"};this._applyResourceTiming(o,r),this.fire(new e.l("data",Object.assign(Object.assign({},o),{sourceDataType:"metadata"}))),this.fire(new e.l("data",Object.assign(Object.assign({},o),{sourceDataType:"content",shouldReloadTileOptions:a})))}catch(t){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new e.l("dataabort",{dataType:"source"}));this.fire(new e.k(t))}finally{this._hasPendingWorkerUpdate()&&this._updateWorkerData()}})}_applyResourceTiming(t,i){var r;if(!this._collectResourceTiming)return;const n=null===(r=i.resourceTiming)||void 0===r?void 0:r[this.id];if(!n)return;const a=n.slice(0);(null==a?void 0:a.length)&&e.e(t,{resourceTiming:a})}_applyDiffToSource(t){if(!t)return;const e="string"==typeof this.promoteId?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){const t=function(t,e){const i=new Map;if(null==t)return i;if(null==t.type)return i;if("Feature"===t.type){const r=Y(t,e);if(null==r)return;return i.set(r,t),i}if("FeatureCollection"===t.type){const r=new Set;for(const n of t.features){const t=Y(n,e);if(null==t)return;if(r.has(t))return;r.add(t),i.set(t,n)}return i}}(this._data.geojson,e);if(!t)throw new Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:t}}if(!this._data.updateable)return;const i=function(t,e,i){var r,n;const a=[];if(e.removeAll)t.clear();else if(e.remove)for(const i of e.remove){const e=t.get(i);e&&(a.push(e.geometry),t.delete(i))}if(e.add)for(const r of e.add){const e=Y(r,i);if(null==e)continue;const n=t.get(e);n&&a.push(n.geometry),a.push(r.geometry),t.set(e,r)}if(e.update)for(const i of e.update){const e=t.get(i.id);if(!e)continue;const o=!!i.newGeometry,s=i.removeAllProperties||(null===(r=i.removeProperties)||void 0===r?void 0:r.length)>0||(null===(n=i.addOrUpdateProperties)||void 0===n?void 0:n.length)>0;if(!o&&!s)continue;a.push(e.geometry);const l=Object.assign({},e);if(t.set(i.id,l),o&&(a.push(i.newGeometry),l.geometry=i.newGeometry),s){if(l.properties=i.removeAllProperties?{}:Object.assign({},l.properties||{}),i.removeProperties)for(const t of i.removeProperties)delete l.properties[t];if(i.addOrUpdateProperties)for(const{key:t,value:e}of i.addOrUpdateProperties)l.properties[t]=e}}return a}(this._data.updateable,t,e);return t.removeAll||this._options.cluster?void 0:i}_getShouldReloadTileOptions(t){if(t)return{affectedBounds:t.filter(Boolean).map(t=>q(t))}}shouldReloadTile(t,{affectedBounds:i}){if("loading"===t.state)return!0;if("unloaded"===t.state)return!1;const{buffer:r,extent:n}=this.workerOptions.geojsonVtOptions,a=function({x:t,y:i,z:r},n=0){const a=e.a3((t-n)/Math.pow(2,r)),o=e.a4((i+1+n)/Math.pow(2,r)),s=e.a3((t+1+n)/Math.pow(2,r)),l=e.a4((i-n)/Math.pow(2,r));return new O([a,o],[s,l])}(t.tileID.canonical,r/n);for(const t of i)if(a.intersects(t))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(t){return e._(this,void 0,void 0,function*(){const e=t.actor?"RT":"LT";t.actor=this.actor;const i={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,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};t.abortController=new AbortController;const r=yield this.actor.sendAsync({type:e,data:i},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(r,this.map.painter,"RT"===e)})}abortTile(t){return e._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0})}unloadTile(t){return e._(this,void 0,void 0,function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return e.e({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}}class $ extends e.E{constructor(t,e,i,r){super(),this.flippedWindingOrder=!1,this.id=t,this.dispatcher=i,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=e}load(t){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.l("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const e=yield u.getImage(yield this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,e&&e.data&&(this.image=e.data,t&&(this.coordinates=t),this._finishLoading())}catch(t){this._request=null,this._loaded=!0,e.Z(t)||this.fire(new e.k(t))}})}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.l("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const i=t.map(e.a6.fromLngLat);var r;return this.tileID=function(t){const i=e.a7.fromPoints(t),r=i.width(),n=i.height(),a=Math.max(r,n),o=Math.max(0,Math.floor(-Math.log(a)/Math.LN2)),s=Math.pow(2,o);return new e.a9(o,Math.floor((i.minX+i.maxX)/2*s),Math.floor((i.minY+i.maxY)/2*s))}(i),this.terrainTileRanges=this._getOverlappingTileRanges(i),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=i.map(t=>this.tileID.getTilePoint(t)._round()),this.flippedWindingOrder=((r=this.tileCoords)[1].x-r[0].x)*(r[2].y-r[0].y)-(r[1].y-r[0].y)*(r[2].x-r[0].x)<0,this.fire(new e.l("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const t=this.map.painter.context,i=t.gl;this.texture||(this.texture=new e.T(t,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,r=!0)}r&&this.fire(new e.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return e._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(t){const{minX:i,minY:r,maxX:n,maxY:a}=e.a7.fromPoints(t),o={};for(let t=0;t<=e.a8;t++){const e=Math.pow(2,t),s=Math.floor(i*e),l=Math.floor(r*e),c=Math.floor(n*e),h=Math.floor(a*e),u=(s%e+e)%e,d=c%e,p=Math.floor(s/e),m=Math.floor(c/e);o[t]={minWrap:p,maxWrap:m,minTileXWrapped:u,maxTileXWrapped:d,minTileY:l,maxTileY:h}}return o}}class tt extends ${constructor(t,e,i,r){super(t,e,i,r),this._onPlayingHandler=()=>{var t;null===(t=this.map)||void 0===t||t.triggerRepaint()},this.roundZoom=!0,this.type="video",this.options=e}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1;const t=this.options;this.urls=[];for(const e of t.urls)this.urls.push((yield this.map._requestManager.transformRequest(e,"Source")).url);try{const t=yield e.aa(this.urls);if(this._loaded=!0,!t)return;this.video=t,this.video.loop=!0,this.video.addEventListener("playing",this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(t){this.fire(new e.k(t))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const i=this.video.seekable;t<i.start(0)||t>i.end(0)?this.fire(new e.k(new e.ab(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.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)))}onRemove(){super.onRemove(),this.video&&(this.video.removeEventListener("playing",this._onPlayingHandler),this.video.pause())}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,i=t.gl;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 e.T(t,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,r=!0)}r&&this.fire(new e.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class et extends ${constructor(t,i,r,n){super(t,i,r,n),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some(t=>!Array.isArray(t)||2!==t.length||t.some(t=>"number"!=typeof t))||this.fire(new e.k(new e.ab(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.k(new e.ab(`sources.${t}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new e.k(new e.ab(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof HTMLCanvasElement||this.fire(new e.k(new e.ab(`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 e.k(new e.ab(`sources.${t}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}load(){return e._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.k(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const i=this.map.painter.context,r=i.gl;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new e.T(i,this.canvas,r.RGBA,{premultiply:!0}),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new e.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const it={},rt=t=>{switch(t){case"geojson":return K;case"image":return $;case"raster":return A;case"raster-dem":return G;case"vector":return j;case"video":return tt;case"canvas":return et}return it[t]},nt="RTLPluginLoaded";class at extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=W()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch(t=>{throw this.status="error",t})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return e._(this,arguments,void 0,function*(t,e=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=s.resolveURL(t),!this.url)throw new Error(`requested url ${t} is invalid`);if("unavailable"===this.status){if(!e)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if("requested"===this.status)return this._requestImport()})}_requestImport(){return e._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new e.l(nt))})}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let ot=null;function st(){return ot||(ot=new at),ot}var lt,ct;!function(t){t[t.Base=0]="Base",t[t.Parent=1]="Parent"}(lt||(lt={})),function(t){t[t.Departing=0]="Departing",t[t.Incoming=1]="Incoming"}(ct||(ct={}));class ht{constructor(t,i){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=t,this.uid=e.ac(),this.uses=0,this.tileSize=i,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state="loading"}isRenderable(t){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(t||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:t,fadingDirection:e,fadingParentID:i,fadeEndTime:r}){this.resetFadeLogic(),this.fadingRole=t,this.fadingDirection=e,this.fadingParentID=i,this.fadeEndTime=r}setSelfFadeLogic(t){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=t}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=c(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,i,r){if(!0!==(null==t?void 0:t.etagUnmodified))if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestEncoding=t.encoding,this.latestFeatureIndex.rawTileData=t.rawTileData,this.latestFeatureIndex.encoding=t.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){const i={};if(!e)return i;for(const r of t){const t=r.layerIds.map(t=>e.getLayer(t)).filter(Boolean);if(0!==t.length){r.layers=t,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map(e=>t.filter(t=>t.id===e)[0]));for(const e of t)i[e.id]=r}}return i}(t.buckets,null==i?void 0:i.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.ae){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.ae&&i.hasRTLText){this.hasRTLText=!0,st().lazyLoad();break}}this.queryPadding=0;for(const t in this.buckets){const e=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(t).queryRadius(e))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),this.dashPositions=t.dashPositions}else this.collisionBoxArray=new e.ad;else this.state="loaded"}unloadVectorData(){for(const 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.dashPositions&&(this.dashPositions=null),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const e in this.buckets){const i=this.buckets[e];i.uploadPending()&&i.upload(t)}const i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new e.T(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new e.T(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,e,i,r,n,a,o,s,l,c,h){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:n,scale:a,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:o,queryPadding:this.queryPadding*l,getElevation:h},t,e,i):{}}querySourceFeatures(t,i){const r=this.latestFeatureIndex;if(!r||!r.rawTileData)return;const n=r.loadVTLayers(),a=i&&i.sourceLayer?i.sourceLayer:"",o=n[e.af]||n[a];if(!o)return;const s=e.ag(null==i?void 0:i.filter,null==i?void 0:i.globalState),{z:l,x:c,y:h}=this.tileID.canonical,u={z:l,x:c,y:h};for(let i=0;i<o.length;i++){const n=o.feature(i);if(s.needGeometry){const t=e.ah(n,!0);if(!s.filter(new e.H(this.tileID.overscaledZ),t,this.tileID.canonical))continue}else if(!s.filter(new e.H(this.tileID.overscaledZ),n))continue;const d=r.getId(n,a),p=new e.ai(n,l,c,h,d);p.tile=u,t.push(p)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const i=this.expirationTime;if(t.cacheControl){const i=e.aj(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const t=Date.now();let e=!1;if(this.expirationTime>t)e=!1;else if(i)if(this.expirationTime<i)e=!0;else{const r=this.expirationTime-i;r?this.expirationTime=t+Math.max(r,3e4):e=!0}else e=!0;e?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(t,i){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(t).length)return;const r=this.latestFeatureIndex.loadVTLayers();for(const n in this.buckets){if(!i.style.hasLayer(n))continue;const a=this.buckets[n],o=a.layers[0].sourceLayer||e.af,s=r[o],l=t[o];if(!s||!l||0===Object.keys(l).length)continue;a.update(l,s,this.imageAtlas&&this.imageAtlas.patternPositions||{},this.dashPositions||{});const c=i&&i.style&&i.style.getLayer(n);c&&(this.queryPadding=Math.max(this.queryPadding,c.queryRadius(a)))}}holdingForSymbolFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<c()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(t){this.symbolFadeHoldUntil=c()+t}setDependencies(t,e){const i={};for(const t of e)i[t]=!0;this.dependencies[t]=i}hasDependency(t,e){for(const i of t){const t=this.dependencies[i];if(t)for(const i of e)if(t[i])return!0}return!1}}class ut{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(t,i,r){const n=String(i);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},e.e(this.stateChanges[t][n],r),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==n&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][n]){this.deletedStates[t][n]={};for(const e in this.state[t][n])r[e]||(this.deletedStates[t][n][e]=null)}else for(const e in r)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][e]&&delete this.deletedStates[t][n][e]}removeFeatureState(t,e,i){if(null===this.deletedStates[t])return;const r=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},i&&void 0!==e)null!==this.deletedStates[t][r]&&(this.deletedStates[t][r]=this.deletedStates[t][r]||{},this.deletedStates[t][r][i]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][r])for(i in this.deletedStates[t][r]={},this.stateChanges[t][r])this.deletedStates[t][r][i]=null;else this.deletedStates[t][r]=null;else this.deletedStates[t]=null}getState(t,i){const r=String(i),n=e.e({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){const e=this.deletedStates[t][i];if(null===e)return{};for(const t in e)delete n[t]}return n}initializeTileState(t,e){t.setFeatureState(this.state,e)}coalesceChanges(t,i){const r={};for(const t in this.stateChanges){this.state[t]=this.state[t]||{};const i={};for(const r in this.stateChanges[t])this.state[t][r]||(this.state[t][r]={}),e.e(this.state[t][r],this.stateChanges[t][r]),i[r]=this.state[t][r];r[t]=i}for(const t in this.deletedStates){this.state[t]=this.state[t]||{};const i={};if(null===this.deletedStates[t])for(const e in this.state[t])i[e]={},this.state[t][e]={};else for(const e in this.deletedStates[t]){if(null===this.deletedStates[t][e])this.state[t][e]={};else for(const i of Object.keys(this.deletedStates[t][e]))delete this.state[t][e][i];i[e]=this.state[t][e]}r[t]=r[t]||{},e.e(r[t],i)}this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length&&(this.revision++,t.setFeatureState(r,i))}}const dt=89.25;function pt(t,i){const r=e.ak(i.lat,-e.al,e.al);return new e.P(e.Y(i.lng)*t,e.X(r)*t)}function mt(t,i){return new e.a6(i.x/t,i.y/t).toLngLat()}function ft(t){return t.cameraToCenterDistance*Math.min(.85*Math.tan(e.am(90-t.pitch)),Math.tan(e.am(dt-t.pitch)))}function gt(t,i){const r=t.canonical,n=i/e.an(r.z),a=r.x+Math.pow(2,r.z)*t.wrap,o=e.ao(new Float64Array(16));return e.O(o,o,[a*n,r.y*n,0]),e.Q(o,o,[n/e.a5,n/e.a5,1]),o}function _t(t,i,r,n,a){const o=e.a6.fromLngLat(t,i),s=a*e.ap(1,t.lat),{x:l,y:c,z:h}=yt(r,n);return new e.a6(o.x+s*-l,o.y+s*-c,o.z+s*-h)}function yt(t,i){const r=e.am(t),n=e.am(i),a=Math.cos(-r),o=Math.sin(r);return{x:o*Math.sin(n),y:-o*Math.cos(n),z:a}}function xt(t,e,i){const r=e.intersectsFrustum(t);if(!i||0===r)return r;const n=e.intersectsPlane(i);return 0===n?0:2===r&&2===n?2:1}function bt(t,e,i){let r=0;const n=(i-e)/10;for(let a=0;a<10;a++)r+=n*Math.pow(Math.cos(e+(a+.5)/10*(i-e)),t);return r}function vt(t,i){return function(r,n,a,o,s){const l=2*((t-1)/e.aq(Math.cos(e.am(dt-s))/Math.cos(e.am(dt)))-1),c=Math.acos(a/o),h=2*bt(l-1,0,e.am(s/2)),u=Math.min(e.am(dt),c+e.am(s/2)),d=bt(l-1,Math.min(u,c-e.am(s/2)),u),p=Math.atan(n/a),m=Math.hypot(n,a);let f=r;return f+=e.aq(o/m/Math.max(.5,Math.cos(e.am(s/2)))),f+=l*e.aq(Math.cos(p))/2,f-=e.aq(Math.max(1,d/h/i))/2,f}}const Tt=vt(9.314,3);function wt(t,i){const r=(i.roundZoom?Math.round:Math.floor)(t.zoom+e.aq(t.tileSize/i.tileSize));return Math.max(0,r)}function Vt(t,i){const r=t.getCameraFrustum(),n=t.getClippingPlane(),a=t.screenPointToMercatorCoordinate(t.getCameraPoint()),o=e.a6.fromLngLat(t.center,t.elevation);a.z=o.z+Math.cos(t.pitchInRadians)*t.cameraToCenterDistance/t.worldSize;const s=t.getCoveringTilesDetailsProvider(),l=s.allowVariableZoom(t,i),c=wt(t,i),h=i.minzoom||0,u=void 0!==i.maxzoom?i.maxzoom:t.maxZoom,d=Math.min(Math.max(0,c),u),p=Math.pow(2,d),m=[p*a.x,p*a.y,0],f=[p*o.x,p*o.y,0],g=Math.hypot(o.x-a.x,o.y-a.y),_=Math.abs(o.z-a.z),y=Math.hypot(g,_),x=t=>({zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}),b=[],v=[];if(t.renderWorldCopies&&s.allowWorldCopies())for(let t=1;t<=3;t++)b.push(x(-t)),b.push(x(t));for(b.push(x(0));b.length>0;){const p=b.pop(),g=p.x,x=p.y;let T=p.fullyVisible;const w={x:g,y:x,z:p.zoom},V=s.getTileBoundingVolume(w,p.wrap,t.elevation,i);if(!T){const t=xt(r,V,n);if(0===t)continue;T=2===t}const R=s.distanceToTile2d(a.x,a.y,w,V);let M=c;l&&(M=(i.calculateTileZoom||Tt)(t.zoom+e.aq(t.tileSize/i.tileSize),R,_,y,t.fov)),M=(i.roundZoom?Math.round:Math.floor)(M),M=Math.max(0,M);const U=Math.min(M,u);if(p.wrap=s.getWrap(o,w,p.wrap),p.zoom>=U){if(p.zoom<h)continue;const t=d-p.zoom,r=m[0]-.5-(g<<t),n=m[1]-.5-(x<<t),a=i.reparseOverscaled?Math.max(p.zoom,M):p.zoom;v.push({tileID:new e.a2(p.zoom===u?a:p.zoom,p.wrap,p.zoom,g,x),distanceSq:e.ar([f[0]-.5-g,f[1]-.5-x]),tileDistanceToCamera:Math.sqrt(r*r+n*n)})}else for(let t=0;t<4;t++)b.push({zoom:p.zoom+1,x:(g<<1)+t%2,y:(x<<1)+(t>>1),wrap:p.wrap,fullyVisible:T})}return v.sort((t,e)=>t.distanceSq-e.distanceSq).map(t=>t.tileID)}const Rt=e.a7.fromPoints([new e.P(0,0),new e.P(e.a5,e.a5)]);function Mt(t){return"raster"===t||"image"===t||"video"===t}function Ut(t,e,i,r,n,a,o){if(!e.hasData())return!1;const{tileID:s,fadingRole:l,fadingDirection:c,fadingParentID:h}=e;if(l===lt.Base&&c===ct.Incoming&&h)return i[h.key]=h,!0;const u=Math.max(s.overscaledZ-n,a);for(let n=s.overscaledZ-1;n>=u;n--){const a=s.scaledTo(n),l=t.getLoadedTile(a);if(l)return e.setCrossFadeLogic({fadingRole:lt.Base,fadingDirection:ct.Incoming,fadingParentID:l.tileID,fadeEndTime:r+o}),l.setCrossFadeLogic({fadingRole:lt.Parent,fadingDirection:ct.Departing,fadeEndTime:r+o}),i[a.key]=a,!0}return!1}function St(t,e,i,r,n,a){if(!e.hasData())return!1;const o=e.tileID.children(n);let s=Nt(t,e,o,i,r,n,a);if(s)return!0;for(const l of o)Nt(t,e,l.children(n),i,r,n,a)&&(s=!0);return s}function Nt(t,e,i,r,n,a,o){if(i[0].overscaledZ>=a)return!1;let s=!1;for(const a of i){const i=t.getLoadedTile(a);if(!i)continue;const{fadingRole:l,fadingDirection:c,fadingParentID:h}=i;l===lt.Base&&c===ct.Departing&&h||(i.setCrossFadeLogic({fadingRole:lt.Base,fadingDirection:ct.Departing,fadingParentID:e.tileID,fadeEndTime:n+o}),e.setCrossFadeLogic({fadingRole:lt.Parent,fadingDirection:ct.Incoming,fadeEndTime:n+o})),r[a.key]=a,s=!0}return s}function Et(t,e,i,r){const n=t.tileID;return!!t.selfFading||!t.hasData()&&!!e.has(n)&&(t.setSelfFadeLogic(i+r),!0)}function Ft(t,e){var i;t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0;let r=e.tileID.canonical.x-t.tileID.canonical.x;const n=e.tileID.canonical.y-t.tileID.canonical.y,a=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+a)?r+=a:1===Math.abs(r-a)&&(r-=a)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),(null===(i=t.neighboringTiles)||void 0===i?void 0:i[o])&&(t.neighboringTiles[o].backfilled=!0)))}class Zt{constructor(){this._tiles={}}handleWrapJump(t){const e={};for(const i in this._tiles){const r=this._tiles[i];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+t),e[r.tileID.key]=r}this._tiles=e}setFeatureState(t,e){for(const i in this._tiles)this._tiles[i].setFeatureState(t,e)}getAllTiles(){return Object.values(this._tiles)}getAllIds(t=!1){return t?Object.values(this._tiles).map(t=>t.tileID).sort(e.at).map(t=>t.key):Object.keys(this._tiles)}getTileById(t){return this._tiles[t]}setTile(t,e){this._tiles[t]=e}deleteTileById(t){delete this._tiles[t]}getLoadedTile(t){const e=this.getTileById(t.key);return(null==e?void 0:e.hasData())?e:null}isIdRenderable(t,e=!1){var i;return null===(i=this.getTileById(t))||void 0===i?void 0:i.isRenderable(e)}getRenderableIds(t=0,i){const r=[];for(const t of this.getAllIds())this.isIdRenderable(t,i)&&r.push(this.getTileById(t));return i?r.sort((i,r)=>{const n=i.tileID,a=r.tileID,o=new e.P(n.canonical.x,n.canonical.y)._rotate(-t),s=new e.P(a.canonical.x,a.canonical.y)._rotate(-t);return n.overscaledZ-a.overscaledZ||s.y-o.y||s.x-o.x}).map(t=>t.tileID.key):r.map(t=>t.tileID).sort(e.at).map(t=>t.key)}}class kt extends e.E{constructor(t,i,r){super(),this.id=t,this.dispatcher=r,this.on("data",t=>this._dataHandler(t)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((t,e,i,r)=>{const n=new(rt(e.type))(t,e,i,r);if(n.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${n.id}`);return n})(t,i,r,this),this._inViewTiles=new Zt,this._outOfViewCache=new e.au(0,t=>this._unloadTile(t)),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new ut,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){for(const t of this._inViewTiles.getAllTiles())t.unloadVectorData();this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t),this._inViewTiles=new Zt}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t of this._inViewTiles.getAllTiles())if("loaded"!==t.state&&"errored"!==t.state)return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,i,r){return e._(this,void 0,void 0,function*(){try{const e=yield this._source.loadTile(t);this._tileLoaded(t,i,r,e)}catch(i){t.state="errored",404!==i.status?this._source.fire(new e.k(i,{tile:t})):this.update(this.transform,this.terrain)}})}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new e.l("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._inViewTiles,this.map?this.map.painter:null);for(const e of this._inViewTiles.getAllTiles())e.upload(t),e.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(t){var e;return this._inViewTiles.getRenderableIds(null===(e=this.transform)||void 0===e?void 0:e.bearingInRadians,t)}hasRenderableParent(t){const e=t.overscaledZ-1;if(e>=this._source.minzoom){const i=this.getLoadedTile(t.scaledTo(e));if(i)return this._inViewTiles.isIdRenderable(i.tileID.key)}return!1}reload(t,e=void 0){if(this._paused)this._shouldReloadOnResume=!0;else{this._outOfViewCache.reset();for(const i of this._inViewTiles.getAllIds()){const r=this._inViewTiles.getTileById(i);e&&!this._source.shouldReloadTile(r,e)||(t?this._reloadTile(i,"expired"):"errored"!==r.state&&this._reloadTile(i,"reloading"))}}}_reloadTile(t,i){return e._(this,void 0,void 0,function*(){const e=this._inViewTiles.getTileById(t);e&&("loading"!==e.state&&(e.state=i),yield this._loadTile(e,t,i))})}_tileLoaded(t,i,r,n){t.timeAdded=c(),t.selfFading&&(t.fadeEndTime=t.timeAdded+this._rasterFadeDuration),"expired"===r&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),(null==n?void 0:n.unmodified)||("raster-dem"===this.getSource().type&&t.dem&&function(t,e){var i,r;const n=e.getRenderableIds();for(const a of n){if(!t.neighboringTiles||!t.neighboringTiles[a])continue;const n=e.getTileById(a);t.neighboringTiles[a].backfilled||Ft(t,n),(null===(r=null===(i=n.neighboringTiles)||void 0===i?void 0:i[t.tileID.key])||void 0===r?void 0:r.backfilled)||Ft(n,t)}}(t,this._inViewTiles),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new e.l("data",{dataType:"source",tile:t,coord:t.tileID})))}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._inViewTiles.getTileById(t)}_retainLoadedChildren(t,e){const i=this._getLoadedDescendents(e),r=new Set;for(const n of e){const e=i[n.key];if(!(null==e?void 0:e.length)){r.add(n);continue}const a=n.overscaledZ+kt.maxOverzooming,o=e.filter(t=>t.tileID.overscaledZ<=a);if(!o.length){r.add(n);continue}const s=Math.min(...o.map(t=>t.tileID.overscaledZ)),l=o.filter(t=>t.tileID.overscaledZ===s).map(t=>t.tileID);for(const e of l)t[e.key]=e;this._areDescendentsComplete(l,s,n.overscaledZ)||r.add(n)}return r}_getLoadedDescendents(t){var e;const i={};for(const r of this._inViewTiles.getAllTiles().filter(t=>t.hasData()))for(const n of t)r.tileID.isChildOf(n)&&(i[e=n.key]||(i[e]=[])).push(r);return i}_areDescendentsComplete(t,e,i){return 1===t.length&&t[0].isOverscaled()?t[0].overscaledZ===e:Math.pow(4,e-i)===t.length}getLoadedTile(t){return this._inViewTiles.getLoadedTile(t)}updateCacheSize(t){const i=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,n=Math.floor(i*r*(null===this._maxTileCacheZoomLevels?e.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._outOfViewCache.setMaxSize(a)}handleWrapJump(t){const e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);this._prevLng=t,e&&(this._inViewTiles.handleWrapJump(e),this._resetTileReloadTimers())}update(t,i){if(!this._sourceLoaded||this._paused)return;let r;this.transform=t,this.terrain=i,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?r=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(t=>new e.a2(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)):(r=Vt(t,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:"vector"===this._source.type&&void 0!==this.map._zoomLevelsToOverscale?t.maxZoom-this.map._zoomLevelsToOverscale:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:i,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(r=r.filter(t=>this._source.hasTile(t)))):r=[],this.usedForTerrain&&(r=this._addTerrainIdealTiles(r));const n=0===r.length&&!this._updated&&this._didEmitContent;this._updated=!0,n&&this.fire(new e.l("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const a=wt(t,this._source),o=this._updateRetainedTiles(r,a),s=Mt(this._source.type);s&&this._rasterFadeDuration>0&&!i&&function(t,i,r,n,a,o,s){const l=c(),h=e.as(i);for(const e of i){const i=t.getTileById(e.key);i.fadingDirection!==ct.Departing&&0!==i.fadeOpacity||i.resetFadeLogic(),Ut(t,i,r,l,n,a,s)||St(t,i,r,l,o,s)||Et(i,h,l,s)||i.resetFadeLogic()}}(this._inViewTiles,r,o,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),s?this._cleanUpRasterTiles(o):this._cleanUpVectorTiles(o)}_cleanUpRasterTiles(t){for(const e of this._inViewTiles.getAllIds())t[e]||this._removeTile(e)}_cleanUpVectorTiles(t){for(const e of this._inViewTiles.getAllIds()){const i=this._inViewTiles.getTileById(e);t[e]?i.clearSymbolFadeHold():i.hasSymbolBuckets?i.holdingForSymbolFade()?i.symbolFadeFinished()&&this._removeTile(e):i.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(e)}}_addTerrainIdealTiles(t){const e=[];for(const i of t)if(i.canonical.z>this._source.minzoom){const t=i.scaledTo(i.canonical.z-1);e.push(t);const r=i.scaledTo(Math.max(this._source.minzoom,Math.min(i.canonical.z,5)));e.push(r)}return t.concat(e)}releaseSymbolFadeTiles(){for(const t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).holdingForSymbolFade()&&this._removeTile(t)}_updateRetainedTiles(t,e){var i;const r=new Set;for(const e of t)this._addTile(e).hasData()||r.add(e);const n=t.reduce((t,e)=>(t[e.key]=e,t),{}),a=this._retainLoadedChildren(n,r),o={},s=Math.max(e-kt.maxUnderzooming,this._source.minzoom);for(const t of a){let e=this._inViewTiles.getTileById(t.key),r=null==e?void 0:e.wasRequested();for(let a=t.overscaledZ-1;a>=s;--a){const s=t.scaledTo(a);if(o[s.key])break;if(o[s.key]=!0,e=this.getTile(s),!e&&r&&(e=this._addTile(s)),e){const t=e.hasData();if((t||!(null===(i=this.map)||void 0===i?void 0:i.cancelPendingTileRequestsWhileZooming)||r)&&(n[s.key]=s),r=e.wasRequested(),t)break}}}return n}_addTile(t){let i=this._inViewTiles.getTileById(t.key);if(i)return i;i=this._outOfViewCache.getAndRemove(t),i&&(i.resetFadeLogic(),this._setTileReloadTimer(t.key,i),i.tileID=t,this._state.initializeTileState(i,this.map?this.map.painter:null));const r=i;return i||(i=new ht(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(i,t.key,i.state)),i.uses++,this._inViewTiles.setTile(t.key,i),r||this._source.fire(new e.l("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i}_setTileReloadTimer(t,e){this._clearTileReloadTimer(t);const i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},i))}_clearTileReloadTimer(t){const e=this._timers[t];e&&(clearTimeout(e),delete this._timers[t])}_resetTileReloadTimers(){for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t of this._inViewTiles.getAllIds()){const e=this._inViewTiles.getTileById(t);this._setTileReloadTimer(t,e)}}refreshTiles(t){for(const e of this._inViewTiles.getAllIds()){const i=this._inViewTiles.getTileById(e);(this._inViewTiles.isIdRenderable(e)||"errored"==i.state)&&t.some(t=>t.equals(i.tileID.canonical))&&this._reloadTile(e,"expired")}}_removeTile(t){const e=this._inViewTiles.getTileById(t);e&&(e.uses--,this._inViewTiles.deleteTileById(t),this._clearTileReloadTimer(t),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._outOfViewCache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))}_dataHandler(t){"source"===t.dataType&&("metadata"!==t.sourceDataType?"content"===t.sourceDataType&&this._sourceLoaded&&!this._paused&&(this.reload(t.sourceDataChanged,t.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0):this._sourceLoaded=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t of this._inViewTiles.getAllIds())this._removeTile(t);this._outOfViewCache.reset()}tilesIn(t,i,r){const n=[],a=this.transform;if(!a)return n;const o=a.getCoveringTilesDetailsProvider().allowWorldCopies(),s=r?a.getCameraQueryGeometry(t):t,l=t=>a.screenPointToMercatorCoordinate(t,this.terrain),c=this.transformBbox(t,l,!o),h=this.transformBbox(s,l,!o),u=this.getIds(),d=e.a7.fromPoints(h);for(let t=0;t<u.length;t++){const r=this._inViewTiles.getTileById(u[t]);if(r.holdingForSymbolFade())continue;const s=o?[r.tileID]:[r.tileID.unwrapTo(-1),r.tileID.unwrapTo(0)],l=Math.pow(2,a.zoom-r.tileID.overscaledZ),p=i*r.queryPadding*e.a5/r.tileSize/l;for(const t of s){const i=d.map(i=>t.getTilePoint(new e.a6(i.x,i.y)));if(i.expandBy(p),i.intersects(Rt)){const e=c.map(e=>t.getTilePoint(e)),i=h.map(e=>t.getTilePoint(e));n.push({tile:r,tileID:o?t:t.unwrapTo(0),queryGeometry:e,cameraQueryGeometry:i,scale:l})}}}return n}transformBbox(t,i,r){let n=t.map(i);if(r){const r=e.a7.fromPoints(t);r.shrinkBy(.001*Math.min(r.width(),r.height()));const a=r.map(i);e.a7.fromPoints(n).covers(a)||(n=n.map(t=>t.x>.5?new e.a6(t.x-1,t.y,t.z):t))}return n}getVisibleCoordinates(t){const e=this.getRenderableIds(t).map(t=>this._inViewTiles.getTileById(t).tileID);return this.transform&&this.transform.populateCache(e),e}hasTransition(){return!!this._source.hasTransition()||!(!Mt(this._source.type)||!function(t,e){if(e<=0)return!1;const i=c();for(const e of t.getAllTiles())if(e.fadeEndTime>=i)return!0;return!1}(this._inViewTiles,this._rasterFadeDuration))}setRasterFadeDuration(t){this._rasterFadeDuration=t}setFeatureState(t,i,r){this._state.updateState(t=t||e.af,i,r)}removeFeatureState(t,i,r){this._state.removeFeatureState(t=t||e.af,i,r)}getFeatureState(t,i){return this._state.getState(t=t||e.af,i)}setDependencies(t,e,i){const r=this._inViewTiles.getTileById(t);r&&r.setDependencies(e,i)}reloadTilesForDependencies(t,e){for(const i of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(i).hasDependency(t,e)&&this._reloadTile(i,"reloading");this._outOfViewCache.filter(i=>!i.hasDependency(t,e))}areTilesLoaded(){for(const t of this._inViewTiles.getAllTiles())if("loaded"!==t.state&&"errored"!==t.state)return!1;return!0}}kt.maxUnderzooming=10,kt.maxOverzooming=3;class zt{constructor(t,e){this.reset(t,e)}reset(t,e){this.points=t||[],this._distances=[0];for(let t=1;t<this.points.length;t++)this._distances[t]=this._distances[t-1]+this.points[t].dist(this.points[t-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.ak(t,0,1);let i=1,r=this._distances[i];const n=t*this.paddedLength+this.padding;for(;r<n&&i<this._distances.length;)r=this._distances[++i];const a=i-1,o=this._distances[a],s=r-o,l=s>0?(n-o)/s:0;return this.points[a].mult(1-l).add(this.points[i].mult(l))}}function Wt(t,e){let i=!0;return"always"===t||"never"!==t&&"never"!==e||(i=!1),i}class It{constructor(t,e,i){const r=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(let t=0;t<this.xCellCount*this.yCellCount;t++)r.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,e,i,r,n){this._forEachCell(e,i,r,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)}insertCircle(t,e,i,r){this._forEachCell(e-r,i-r,e+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(r)}_insertBoxCell(t,e,i,r,n,a){this.boxCells[n].push(a)}_insertCircleCell(t,e,i,r,n,a){this.circleCells[n].push(a)}_query(t,e,i,r,n,a,o){if(i<0||t>this.width||r<0||e>this.height)return[];const s=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=r){if(n)return[{key:null,x1:t,y1:e,x2:i,y2:r}];for(let t=0;t<this.boxKeys.length;t++)s.push({key:this.boxKeys[t],x1:this.bboxes[4*t],y1:this.bboxes[4*t+1],x2:this.bboxes[4*t+2],y2:this.bboxes[4*t+3]});for(let t=0;t<this.circleKeys.length;t++){const e=this.circles[3*t],i=this.circles[3*t+1],r=this.circles[3*t+2];s.push({key:this.circleKeys[t],x1:e-r,y1:i-r,x2:e+r,y2:i+r})}}else this._forEachCell(t,e,i,r,this._queryCell,s,{hitTest:n,overlapMode:a,seenUids:{box:{},circle:{}}},o);return s}query(t,e,i,r){return this._query(t,e,i,r,!1,null)}hitTest(t,e,i,r,n,a){return this._query(t,e,i,r,!0,n,a).length>0}hitTestCircle(t,e,i,r,n){const a=t-i,o=t+i,s=e-i,l=e+i;if(o<0||a>this.width||l<0||s>this.height)return!1;const c=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,c,{hitTest:!0,overlapMode:r,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},n),c.length>0}_queryCell(t,e,i,r,n,a,o,s){const{seenUids:l,hitTest:c,overlapMode:h}=o,u=this.boxCells[n],d=1e-6;if(null!==u){const n=this.bboxes;for(const o of u)if(!l.box[o]){l.box[o]=!0;const u=4*o,p=this.boxKeys[o];if(t<=n[u+2]+d&&e<=n[u+3]+d&&i>=n[u+0]-d&&r>=n[u+1]-d&&(!s||s(p))&&(!c||!Wt(h,p.overlapMode))&&(a.push({key:p,x1:n[u],y1:n[u+1],x2:n[u+2],y2:n[u+3]}),c))return!0}}const p=this.circleCells[n];if(null!==p){const n=this.circles;for(const o of p)if(!l.circle[o]){l.circle[o]=!0;const u=3*o,d=this.circleKeys[o];if(this._circleAndRectCollide(n[u],n[u+1],n[u+2],t,e,i,r)&&(!s||s(d))&&(!c||!Wt(h,d.overlapMode))){const t=n[u],e=n[u+1],i=n[u+2];if(a.push({key:d,x1:t-i,y1:e-i,x2:t+i,y2:e+i}),c)return!0}}}return!1}_queryCellCircle(t,e,i,r,n,a,o,s){const{circle:l,seenUids:c,overlapMode:h}=o,u=this.boxCells[n];if(null!==u){const t=this.bboxes;for(const e of u)if(!c.box[e]){c.box[e]=!0;const i=4*e,r=this.boxKeys[e];if(this._circleAndRectCollide(l.x,l.y,l.radius,t[i+0],t[i+1],t[i+2],t[i+3])&&(!s||s(r))&&!Wt(h,r.overlapMode))return a.push(!0),!0}}const d=this.circleCells[n];if(null!==d){const t=this.circles;for(const e of d)if(!c.circle[e]){c.circle[e]=!0;const i=3*e,r=this.circleKeys[e];if(this._circlesCollide(t[i],t[i+1],t[i+2],l.x,l.y,l.radius)&&(!s||s(r))&&!Wt(h,r.overlapMode))return a.push(!0),!0}}}_forEachCell(t,e,i,r,n,a,o,s){const l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),h=this._convertToXCellCoord(i),u=this._convertToYCellCoord(r);for(let d=l;d<=h;d++)for(let l=c;l<=u;l++)if(n.call(this,t,e,i,r,this.xCellCount*l+d,a,o,s))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,e,i,r,n,a){const o=r-t,s=n-e,l=i+a;return l*l>o*o+s*s}_circleAndRectCollide(t,e,i,r,n,a,o){const s=(a-r)/2,l=Math.abs(t-(r+s));if(l>s+i)return!1;const c=(o-n)/2,h=Math.abs(e-(n+c));if(h>c+i)return!1;if(l<=s||h<=c)return!0;const u=l-s,d=h-c;return u*u+d*d<=i*i}}function Dt(t,i,n){const a=e.N();if(!t){const{vecSouth:t,vecEast:e}=Bt(i),n=r();n[0]=e[0],n[1]=e[1],n[2]=t[0],n[3]=t[1],o=n,(d=(l=(s=n)[0])*(u=s[3])-(h=s[2])*(c=s[1]))&&(o[0]=u*(d=1/d),o[1]=-c*d,o[2]=-h*d,o[3]=l*d),a[0]=n[0],a[1]=n[1],a[4]=n[2],a[5]=n[3]}var o,s,l,c,h,u,d;return e.Q(a,a,[1/n,1/n,1]),a}function Ct(t,i,r,n){if(t){const t=e.N();if(!i){const{vecSouth:e,vecEast:i}=Bt(r);t[0]=i[0],t[1]=i[1],t[4]=e[0],t[5]=e[1]}return e.Q(t,t,[n,n,1]),t}return r.pixelsToClipSpaceMatrix}function Bt(t){const i=Math.cos(t.rollInRadians),r=Math.sin(t.rollInRadians),n=Math.cos(t.pitchInRadians),a=Math.cos(t.bearingInRadians),o=Math.sin(t.bearingInRadians),s=e.az();s[0]=-a*n*r-o*i,s[1]=-o*n*r+a*i;const l=e.aA(s);l<1e-9?e.aB(s):e.aC(s,s,1/l);const c=e.az();c[0]=a*n*i-o*r,c[1]=o*n*i+a*r;const h=e.aA(c);return h<1e-9?e.aB(c):e.aC(c,c,1/h),{vecEast:c,vecSouth:s}}function Pt(t,i,r,n){let a;n?(a=[t,i,n(t,i),1],e.aE(a,a,r)):(a=[t,i,0,1],re(a,a,r));const o=a[3];return{point:new e.P(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function Ot(t,e){return.5+t/e*.5}function Lt(t,e){return t.x>=-e[0]&&t.x<=e[0]&&t.y>=-e[1]&&t.y<=e[1]}function jt(t,i,r,n,a,o,s,l,c,h,u,d,p){const m=r?t.textSizeData:t.iconSizeData,f=e.av(m,i.transform.zoom),g=[256/i.width*2+1,256/i.height*2+1],_=r?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;_.clear();const y=t.lineVertexArray,x=r?t.text.placedSymbolArray:t.icon.placedSymbolArray,b=i.transform.width/i.transform.height;let v=!1;for(let r=0;r<x.length;r++){const T=x.get(r);if(T.hidden||T.writingMode===e.aw.vertical&&!v){ie(T.numGlyphs,_);continue}v=!1;const w=new e.P(T.anchorX,T.anchorY),V={getElevation:p,pitchedLabelPlaneMatrix:n,lineVertexArray:y,pitchWithMap:o,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:i.transform,tileAnchorPoint:w,unwrappedTileID:c,width:h,height:u,translation:d},R=qt(T.anchorX,T.anchorY,V);if(!Lt(R.point,g)){ie(T.numGlyphs,_);continue}const M=Ot(i.transform.cameraToCenterDistance,R.signedDistanceFromCamera),U=e.ax(m,f,T),S=o?U*i.transform.getPitchedTextCorrection(T.anchorX,T.anchorY,c)/M:U*M,N=Yt({projectionContext:V,pitchedLabelPlaneMatrixInverse:a,symbol:T,fontSize:S,flip:!1,keepUpright:s,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:_,aspectRatio:b,rotateToLine:l});v=N.useVertical,(N.notEnoughRoom||v||N.needsFlipping&&Yt({projectionContext:V,pitchedLabelPlaneMatrixInverse:a,symbol:T,fontSize:S,flip:!0,keepUpright:s,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:_,aspectRatio:b,rotateToLine:l}).notEnoughRoom)&&ie(T.numGlyphs,_)}r?t.text.dynamicLayoutVertexBuffer.updateData(_):t.icon.dynamicLayoutVertexBuffer.updateData(_)}function At(t,e,i,r,n,a,o,s){const l=a.glyphStartIndex+a.numGlyphs,c=a.lineStartIndex,h=a.lineStartIndex+a.lineLength,u=e.getoffsetX(a.glyphStartIndex),d=e.getoffsetX(l-1),p=te(t*u,i,r,n,a.segment,c,h,s,o);if(!p)return null;const m=te(t*d,i,r,n,a.segment,c,h,s,o);return m?s.projectionCache.anyProjectionOccluded?null:{first:p,last:m}:null}function Gt(t,i,r,n){return t===e.aw.horizontal&&Math.abs(r.y-i.y)>Math.abs(r.x-i.x)*n?{useVertical:!0}:(t===e.aw.vertical?i.y<r.y:i.x>r.x)?{needsFlipping:!0}:null}function Yt(t){const{projectionContext:i,pitchedLabelPlaneMatrixInverse:r,symbol:n,fontSize:a,flip:o,keepUpright:s,glyphOffsetArray:l,dynamicLayoutVertexArray:c,aspectRatio:h,rotateToLine:u}=t,d=a/24,p=n.lineOffsetX*d,m=n.lineOffsetY*d;let f;if(n.numGlyphs>1){const t=n.glyphStartIndex+n.numGlyphs,e=n.lineStartIndex,a=n.lineStartIndex+n.lineLength,c=At(d,l,p,m,o,n,u,i);if(!c)return{notEnoughRoom:!0};const g=Ht(c.first.point.x,c.first.point.y,i,r),_=Ht(c.last.point.x,c.last.point.y,i,r);if(s&&!o){const t=Gt(n.writingMode,g,_,h);if(t)return t}f=[c.first];for(let r=n.glyphStartIndex+1;r<t-1;r++){const t=te(d*l.getoffsetX(r),p,m,o,n.segment,e,a,i,u);if(!t)return{notEnoughRoom:!0};f.push(t)}f.push(c.last)}else{if(s&&!o){const t=Xt(i.tileAnchorPoint.x,i.tileAnchorPoint.y,i).point,a=n.lineStartIndex+n.segment+1,o=new e.P(i.lineVertexArray.getx(a),i.lineVertexArray.gety(a)),s=Xt(o.x,o.y,i),l=s.signedDistanceFromCamera>0?s.point:Qt(i.tileAnchorPoint,o,t,1,i),c=Ht(t.x,t.y,i,r),u=Ht(l.x,l.y,i,r),d=Gt(n.writingMode,c,u,h);if(d)return d}const t=te(d*l.getoffsetX(n.glyphStartIndex),p,m,o,n.segment,n.lineStartIndex,n.lineStartIndex+n.lineLength,i,u);if(!t||i.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};f=[t]}for(const t of f)e.aD(c,t.point,t.angle);return{}}function Qt(t,e,i,r,n){const a=t.add(t.sub(e)._unit()),o=Xt(a.x,a.y,n).point,s=i.sub(o);return i.add(s._mult(r/s.mag()))}function Jt(t,i,r){const n=i.projectionCache;if(n.projections[t])return n.projections[t];const a=new e.P(i.lineVertexArray.getx(t),i.lineVertexArray.gety(t)),o=Xt(a.x,a.y,i);if(o.signedDistanceFromCamera>0)return n.projections[t]=o.point,n.anyProjectionOccluded=n.anyProjectionOccluded||o.isOccluded,o.point;const s=t-r.direction;return Qt(0===r.distanceFromAnchor?i.tileAnchorPoint:new e.P(i.lineVertexArray.getx(s),i.lineVertexArray.gety(s)),a,r.previousVertex,r.absOffsetX-r.distanceFromAnchor+1,i)}function Xt(t,e,i){const r=t+i.translation[0],n=e+i.translation[1];let a;return i.pitchWithMap?(a=Pt(r,n,i.pitchedLabelPlaneMatrix,i.getElevation),a.isOccluded=!1):(a=i.transform.projectTileCoordinates(r,n,i.unwrappedTileID,i.getElevation),a.point.x=(.5*a.point.x+.5)*i.width,a.point.y=(.5*-a.point.y+.5)*i.height),a}function Ht(t,i,r,n){if(r.pitchWithMap){const a=[t,i,0,1];return e.aE(a,a,n),r.transform.projectTileCoordinates(a[0]/a[3],a[1]/a[3],r.unwrappedTileID,r.getElevation).point}return{x:t/r.width*2-1,y:1-i/r.height*2}}function qt(t,e,i){return i.transform.projectTileCoordinates(t,e,i.unwrappedTileID,i.getElevation)}function Kt(t,e,i){return t._unit()._perp()._mult(e*i)}function $t(t,i,r,n,a,o,s,l,c){if(l.projectionCache.offsets[t])return l.projectionCache.offsets[t];const h=r.add(i);if(t+c.direction<n||t+c.direction>=a)return l.projectionCache.offsets[t]=h,h;const u=Jt(t+c.direction,l,c),d=Kt(u.sub(r),s,c.direction),p=r.add(d),m=u.add(d);return l.projectionCache.offsets[t]=e.aF(o,h,p,m)||h,l.projectionCache.offsets[t]}function te(t,e,i,r,n,a,o,s,l){const c=r?t-e:t+e;let h=c>0?1:-1,u=0;r&&(h*=-1,u=Math.PI),h<0&&(u+=Math.PI);let d,p=h>0?a+n:a+n+1;s.projectionCache.cachedAnchorPoint?d=s.projectionCache.cachedAnchorPoint:(d=Xt(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=d);let m,f,g=d,_=d,y=0,x=0;const b=Math.abs(c),v=[];let T;for(;y+x<=b;){if(p+=h,p<a||p>=o)return null;y+=x,_=g,f=m;const t={absOffsetX:b,direction:h,distanceFromAnchor:y,previousVertex:_};if(g=Jt(p,s,t),0===i)v.push(_),T=g.sub(_);else{let e;const r=g.sub(_);e=0===r.mag()?Kt(Jt(p+h,s,t).sub(g),i,h):Kt(r,i,h),f||(f=_.add(e)),m=$t(p,e,g,a,o,f,i,s,t),v.push(f),T=m.sub(f)}x=T.mag()}const w=T._mult((b-y)/x)._add(f||_),V=u+Math.atan2(g.y-_.y,g.x-_.x);return v.push(w),{point:w,angle:l?V:0,path:v}}const ee=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ie(t,e){for(let i=0;i<t;i++){const t=e.length;e.resize(t+4),e.float32.set(ee,3*t)}}function re(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[4]*n+i[12],t[1]=i[1]*r+i[5]*n+i[13],t[3]=i[3]*r+i[7]*n+i[15],t}const ne=100;class ae{constructor(t,e=new It(t.width+200,t.height+200,25),i=new It(t.width+200,t.height+200,25)){this.transform=t,this.grid=e,this.ignoredGrid=i,this.pitchFactor=Math.cos(t.pitch*Math.PI/180)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+ne,this.screenBottomBoundary=t.height+ne,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,e,i,r,n,a,o,s,l,c,h,u){const d=this.projectAndGetPerspectiveRatio(t.anchorPointX+s[0],t.anchorPointY+s[1],n,c,u),p=i*d.perspectiveRatio;let m;if(a||o)m=this._projectCollisionBox(t,p,r,n,a,o,s,d,c,h,u);else{const e=d.x+(h?h.x*p:0),i=d.y+(h?h.y*p:0);m={allPointsOccluded:!1,box:[e+t.x1*p,i+t.y1*p,e+t.x2*p,i+t.y2*p]}}const[f,g,_,y]=m.box,x=a?m.allPointsOccluded:d.isOccluded;let b=x;return b||(b=d.perspectiveRatio<this.perspectiveRatioCutoff),b||(b=!this.isInsideGrid(f,g,_,y)),b||"always"!==e&&this.grid.hitTest(f,g,_,y,e,l)?{box:[f,g,_,y],placeable:!1,offscreen:!1,occluded:x}:{box:[f,g,_,y],placeable:!0,offscreen:this.isOffscreen(f,g,_,y),occluded:x}}placeCollisionCircles(t,i,r,n,a,o,s,l,c,h,u,d,p,m){const f=[],g=new e.P(i.anchorX,i.anchorY),_=this.getPerspectiveRatio(g.x,g.y,o,m),y=(c?a*this.transform.getPitchedTextCorrection(i.anchorX,i.anchorY,o)/_:a*_)/e.aJ,x={getElevation:m,pitchedLabelPlaneMatrix:s,lineVertexArray:r,pitchWithMap:c,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:g,unwrappedTileID:o,width:this.transform.width,height:this.transform.height,translation:p},b=At(y,n,i.lineOffsetX*y,i.lineOffsetY*y,!1,i,!1,x);let v=!1,T=!1,w=!0;if(b){const i=.5*u*_+d,r=new e.P(-100,-100),n=new e.P(this.screenRightBoundary,this.screenBottomBoundary),a=new zt,o=b.first,s=b.last;let p=[];for(let t=o.path.length-1;t>=1;t--)p.push(o.path[t]);for(let t=1;t<s.path.length;t++)p.push(s.path[t]);const m=2.5*i;if(c){const t=this.projectPathToScreenSpace(p,x);p=t.some(t=>t.signedDistanceFromCamera<=0)?[]:t.map(t=>t.point)}let g=[];if(p.length>0){const t=p[0].clone(),i=p[0].clone();for(let e=1;e<p.length;e++)t.x=Math.min(t.x,p[e].x),t.y=Math.min(t.y,p[e].y),i.x=Math.max(i.x,p[e].x),i.y=Math.max(i.y,p[e].y);g=t.x>=r.x&&i.x<=n.x&&t.y>=r.y&&i.y<=n.y?[p]:i.x<r.x||t.x>n.x||i.y<r.y||t.y>n.y?[]:e.aG([p],r.x,r.y,n.x,n.y)}for(const e of g){a.reset(e,.25*i);let r=0;r=a.length<=.5*i?1:Math.ceil(a.paddedLength/m)+1;for(let e=0;e<r;e++){const n=e/Math.max(r-1,1),o=a.lerp(n),s=o.x+ne,c=o.y+ne;f.push(s,c,i,0);const u=s-i,d=c-i,p=s+i,m=c+i;if(w=w&&this.isOffscreen(u,d,p,m),T=T||this.isInsideGrid(u,d,p,m),"always"!==t&&this.grid.hitTestCircle(s,c,i,t,h)&&(v=!0,!l))return{circles:[],offscreen:!1,collisionDetected:v}}}}return{circles:!l&&v||!T||_<this.perspectiveRatioCutoff?[]:f,offscreen:w,collisionDetected:v}}projectPathToScreenSpace(t,i){const r=function(t,i){const r=e.N();return e.ay(r,i.pitchedLabelPlaneMatrix),t.map(t=>{const e=Pt(t.x,t.y,r,i.getElevation),n=i.transform.projectTileCoordinates(e.point.x,e.point.y,i.unwrappedTileID,i.getElevation);return n.point.x=(.5*n.point.x+.5)*i.width,n.point.y=(.5*-n.point.y+.5)*i.height,n})}(t,i);return function(t){let e=0,i=0,r=0,n=0;for(let a=0;a<t.length;a++)t[a].isOccluded?(r=a+1,n=0):(n++,n>i&&(i=n,e=r));return t.slice(e,e+i)}(r)}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const i=[],r=new e.a7;for(const n of t){const t=new e.P(n.x+ne,n.y+ne);r.extend(t),i.push(t)}const{minX:n,minY:a,maxX:o,maxY:s}=r,l=this.grid.query(n,a,o,s).concat(this.ignoredGrid.query(n,a,o,s)),c={},h={};for(const t of l){const r=t.key;if(void 0===c[r.bucketInstanceId]&&(c[r.bucketInstanceId]={}),c[r.bucketInstanceId][r.featureIndex])continue;const n=[new e.P(t.x1,t.y1),new e.P(t.x2,t.y1),new e.P(t.x2,t.y2),new e.P(t.x1,t.y2)];e.aH(i,n)&&(c[r.bucketInstanceId][r.featureIndex]=!0,void 0===h[r.bucketInstanceId]&&(h[r.bucketInstanceId]=[]),h[r.bucketInstanceId].push(r.featureIndex))}return h}insertCollisionBox(t,e,i,r,n,a){(i?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:n,collisionGroupID:a,overlapMode:e},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,e,i,r,n,a){const o=i?this.ignoredGrid:this.grid,s={bucketInstanceId:r,featureIndex:n,collisionGroupID:a,overlapMode:e};for(let e=0;e<t.length;e+=4)o.insertCircle(s,t[e],t[e+1],t[e+2])}projectAndGetPerspectiveRatio(t,i,r,n,a){if(a){let r;n?(r=[t,i,n(t,i),1],e.aE(r,r,a)):(r=[t,i,0,1],re(r,r,a));const o=r[3];return{x:(r[0]/o+1)/2*this.transform.width+ne,y:(-r[1]/o+1)/2*this.transform.height+ne,perspectiveRatio:.5+this.transform.cameraToCenterDistance/o*.5,isOccluded:!1,signedDistanceFromCamera:o}}{const e=this.transform.projectTileCoordinates(t,i,r,n);return{x:(e.point.x+1)/2*this.transform.width+ne,y:(1-e.point.y)/2*this.transform.height+ne,perspectiveRatio:.5+this.transform.cameraToCenterDistance/e.signedDistanceFromCamera*.5,isOccluded:e.isOccluded,signedDistanceFromCamera:e.signedDistanceFromCamera}}}getPerspectiveRatio(t,e,i,r){const n=this.transform.projectTileCoordinates(t,e,i,r);return.5+this.transform.cameraToCenterDistance/n.signedDistanceFromCamera*.5}isOffscreen(t,e,i,r){return i<ne||t>=this.screenRightBoundary||r<ne||e>this.screenBottomBoundary}isInsideGrid(t,e,i,r){return i>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary}getViewportMatrix(){const t=e.ao([]);return e.O(t,t,[-100,-100,0]),t}_projectCollisionBox(t,i,r,n,a,o,s,l,c,h,u){let d=1,p=0,m=0,f=1;const g=t.anchorPointX+s[0],_=t.anchorPointY+s[1];if(o&&!a){const t=this.projectAndGetPerspectiveRatio(g+1,_,n,c,u),e=t.x-l.x,i=Math.atan((t.y-l.y)/e)+(e<0?Math.PI:0),r=Math.sin(i),a=Math.cos(i);d=a,p=r,m=-r,f=a}else if(!o&&a){const t=Bt(this.transform);d=t.vecEast[0],p=t.vecEast[1],m=t.vecSouth[0],f=t.vecSouth[1]}let y=l.x,x=l.y,b=i;a&&(y=g,x=_,b=Math.pow(2,-(this.transform.zoom-r.overscaledZ)),b*=this.transform.getPitchedTextCorrection(g,_,n),h||(b*=e.ak(.5+l.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),h&&(y+=d*h.x*b+m*h.y*b,x+=p*h.x*b+f*h.y*b);const v=t.x1*b,T=t.x2*b,w=(v+T)/2,V=t.y1*b,R=t.y2*b,M=(V+R)/2,U=[{offsetX:v,offsetY:V},{offsetX:w,offsetY:V},{offsetX:T,offsetY:V},{offsetX:T,offsetY:M},{offsetX:T,offsetY:R},{offsetX:w,offsetY:R},{offsetX:v,offsetY:R},{offsetX:v,offsetY:M}];let S=[];for(const{offsetX:t,offsetY:i}of U)S.push(new e.P(y+d*t+m*i,x+p*t+f*i));let N=!1;if(a){const t=S.map(t=>this.projectAndGetPerspectiveRatio(t.x,t.y,n,c,u));N=t.some(t=>!t.isOccluded),S=t.map(t=>new e.P(t.x,t.y))}else N=!0;return{box:e.aI(S),allPointsOccluded:!N}}}class oe{constructor(t,e,i,r){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):r&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}}class se{constructor(t,e,i,r,n){this.text=new oe(t?t.text:null,e,i,n),this.icon=new oe(t?t.icon:null,e,r,n)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class le{constructor(t,e,i){this.text=t,this.icon=e,this.skipFade=i}}class ce{constructor(t,e,i,r,n){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=r,this.tileID=n}}class he{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:t=>t.collisionGroupID===e}}return this.collisionGroups[t]}}function ue(t,i,r,n,a){const{horizontalAlign:o,verticalAlign:s}=e.aP(t);return new e.P(-(o-.5)*i+n[0]*a,-(s-.5)*r+n[1]*a)}class de{constructor(t,e,i,r,n){this.transform=t.clone(),this.terrain=e,this.collisionIndex=new ae(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=i,this.retainedQueryData={},this.collisionGroups=new he(r),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){const e=this.terrain;return e?(i,r)=>e.getElevation(t,i,r):null}getBucketParts(t,i,r,n){const a=r.getBucket(i),o=r.latestFeatureIndex;if(!a||!o||i.id!==a.layerIds[0])return;const s=r.collisionBoxArray,l=a.layers[0].layout,c=a.layers[0].paint,h=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),u=r.tileSize/e.a5,d=r.tileID.toUnwrapped(),p="map"===l.get("text-rotation-alignment"),m=e.aK(r,1,this.transform.zoom),f=e.aL(this.collisionIndex.transform,r,c.get("text-translate"),c.get("text-translate-anchor")),g=e.aL(this.collisionIndex.transform,r,c.get("icon-translate"),c.get("icon-translate-anchor")),_=Dt(p,this.transform,m);this.retainedQueryData[a.bucketInstanceId]=new ce(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,r.tileID);const y={bucket:a,layout:l,translationText:f,translationIcon:g,unwrappedTileID:d,pitchedLabelPlaneMatrix:_,scale:h,textPixelRatio:u,holdingForFade:r.holdingForSymbolFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:e.av(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(n)for(const e of a.sortKeyRanges){const{sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:n}=e;t.push({sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:n,parameters:y})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:y})}attemptAnchorPlacement(t,i,r,n,a,o,s,l,c,h,u,d,p,m,f,g,_,y,x,b){const v=e.aM[t.textAnchor],T=[t.textOffset0,t.textOffset1],w=ue(v,r,n,T,a),V=this.collisionIndex.placeCollisionBox(i,d,l,c,h,s,o,g,u.predicate,x,w,b);if((!y||this.collisionIndex.placeCollisionBox(y,d,l,c,h,s,o,_,u.predicate,x,w,b).placeable)&&V.placeable){let t;if(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(t=this.prevPlacement.variableOffsets[p.crossTileID].anchor),0===p.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[p.crossTileID]={textOffset:T,width:r,height:n,anchor:v,textBoxScale:a,prevAnchor:t},this.markUsedJustification(m,v,p,f),m.allowVerticalPlacement&&(this.markUsedOrientation(m,f,p),this.placedOrientations[p.crossTileID]=f),{shift:w,placedGlyphBoxes:V}}}placeLayerBucketPart(t,i,r){const{bucket:n,layout:a,translationText:o,translationIcon:s,unwrappedTileID:l,pitchedLabelPlaneMatrix:c,textPixelRatio:h,holdingForFade:u,collisionBoxArray:d,partiallyEvaluatedTextSize:p,collisionGroup:m}=t.parameters,f=a.get("text-optional"),g=a.get("icon-optional"),_=e.aN(a,"text-overlap","text-allow-overlap"),y="always"===_,x=e.aN(a,"icon-overlap","icon-allow-overlap"),b="always"===x,v="map"===a.get("text-rotation-alignment"),T="map"===a.get("text-pitch-alignment"),w="none"!==a.get("icon-text-fit"),V="viewport-y"===a.get("symbol-z-order"),R=y&&(b||!n.hasIconData()||g),M=b&&(y||!n.hasTextData()||f);!n.collisionArrays&&d&&n.deserializeCollisionBoxes(d);const U=this.retainedQueryData[n.bucketInstanceId].tileID,S=this._getTerrainElevationFunc(U),N=this.transform.getFastPathSimpleProjectionMatrix(U),E=(t,d,b)=>{var V,E;if(i[t.crossTileID])return;if(u)return void(this.placements[t.crossTileID]=new le(!1,!1,!1));let F=!1,Z=!1,k=!0,z=null,W={box:null,placeable:!1,offscreen:null,occluded:!1},I={placeable:!1},D=null,C=null,B=null,P=0,O=0,L=0;d.textFeatureIndex?P=d.textFeatureIndex:t.useRuntimeCollisionCircles&&(P=t.featureIndex),d.verticalTextFeatureIndex&&(O=d.verticalTextFeatureIndex);const j=d.textBox;if(j){const i=i=>{let r=e.aw.horizontal;if(n.allowVerticalPlacement&&!i&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[t.crossTileID];e&&(this.placedOrientations[t.crossTileID]=e,r=e,this.markUsedOrientation(n,r,t))}return r},a=(i,r)=>{if(n.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&d.verticalTextBox){for(const t of n.writingModes)if(t===e.aw.vertical?(W=r(),I=W):W=i(),W&&W.placeable)break}else W=i()},c=t.textAnchorOffsetStartIndex,u=t.textAnchorOffsetEndIndex;if(u===c){const r=(e,i)=>{const r=this.collisionIndex.placeCollisionBox(e,_,h,U,l,T,v,o,m.predicate,S,void 0,N);return r&&r.placeable&&(this.markUsedOrientation(n,i,t),this.placedOrientations[t.crossTileID]=i),r};a(()=>r(j,e.aw.horizontal),()=>{const i=d.verticalTextBox;return n.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&i?r(i,e.aw.vertical):{box:null,offscreen:null}}),i(W&&W.placeable)}else{let p=e.aM[null===(E=null===(V=this.prevPlacement)||void 0===V?void 0:V.variableOffsets[t.crossTileID])||void 0===E?void 0:E.anchor];const f=(e,i,a)=>{const d=e.x2-e.x1,f=e.y2-e.y1,g=t.textBoxScale,y=w&&"never"===x?i:null;let b=null,V="never"===_?1:2,R="never";p&&V++;for(let i=0;i<V;i++){for(let i=c;i<u;i++){const r=n.textAnchorOffsets.get(i);if(p&&r.textAnchor!==p)continue;const c=this.attemptAnchorPlacement(r,e,d,f,g,v,T,h,U,l,m,R,t,n,a,o,s,y,S);if(c&&(b=c.placedGlyphBoxes,b&&b.placeable))return F=!0,z=c.shift,b}p?p=null:R=_}return r&&!b&&(b={box:this.collisionIndex.placeCollisionBox(j,"always",h,U,l,T,v,o,m.predicate,S,void 0,N).box,offscreen:!1,placeable:!1,occluded:!1}),b};a(()=>f(j,d.iconBox,e.aw.horizontal),()=>{const i=d.verticalTextBox;return n.allowVerticalPlacement&&(!W||!W.placeable)&&t.numVerticalGlyphVertices>0&&i?f(i,d.verticalIconBox,e.aw.vertical):{box:null,occluded:!0,offscreen:null}}),W&&(F=W.placeable,k=W.offscreen);const g=i(W&&W.placeable);if(!F&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[t.crossTileID];e&&(this.variableOffsets[t.crossTileID]=e,this.markUsedJustification(n,e.anchor,t,g))}}}if(D=W,F=D&&D.placeable,k=D&&D.offscreen,t.useRuntimeCollisionCircles&&t.centerJustifiedTextSymbolIndex>=0){const i=n.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),s=e.ax(n.textSizeData,p,i),h=a.get("text-padding");C=this.collisionIndex.placeCollisionCircles(_,i,n.lineVertexArray,n.glyphOffsetArray,s,l,c,r,T,m.predicate,t.collisionCircleDiameter,h,o,S),C.circles.length&&C.collisionDetected&&!r&&e.w("Collisions detected, but collision boxes are not shown"),F=y||C.circles.length>0&&!C.collisionDetected,k=k&&C.offscreen}if(d.iconFeatureIndex&&(L=d.iconFeatureIndex),d.iconBox){const t=t=>this.collisionIndex.placeCollisionBox(t,x,h,U,l,T,v,s,m.predicate,S,w&&z?z:void 0,N);I&&I.placeable&&d.verticalIconBox?(B=t(d.verticalIconBox),Z=B.placeable):(B=t(d.iconBox),Z=B.placeable),k=k&&B.offscreen}const A=f||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,G=g||0===t.numIconVertices;A||G?G?A||(Z=Z&&F):F=Z&&F:Z=F=Z&&F;const Y=Z&&B.placeable;if(F&&D.placeable&&this.collisionIndex.insertCollisionBox(D.box,_,a.get("text-ignore-placement"),n.bucketInstanceId,I&&I.placeable&&O?O:P,m.ID),Y&&this.collisionIndex.insertCollisionBox(B.box,x,a.get("icon-ignore-placement"),n.bucketInstanceId,L,m.ID),C&&F&&this.collisionIndex.insertCollisionCircles(C.circles,_,a.get("text-ignore-placement"),n.bucketInstanceId,P,m.ID),r&&this.storeCollisionData(n.bucketInstanceId,b,d,D,B,C),0===t.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===n.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[t.crossTileID]=new le((F||R)&&!(null==D?void 0:D.occluded),(Z||M)&&!(null==B?void 0:B.occluded),k||n.justReloaded),i[t.crossTileID]=!0};if(V){if(0!==t.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");const e=n.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let t=e.length-1;t>=0;--t){const i=e[t];E(n.symbolInstances.get(i),n.collisionArrays[i],i)}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)E(n.symbolInstances.get(e),n.collisionArrays[e],e);n.justReloaded=!1}storeCollisionData(t,e,i,r,n,a){if(i.textBox||i.iconBox){let a,o;this.collisionBoxArrays.has(t)?a=this.collisionBoxArrays.get(t):(a=new Map,this.collisionBoxArrays.set(t,a)),a.has(e)?o=a.get(e):(o={text:null,icon:null},a.set(e,o)),i.textBox&&(o.text=r.box),i.iconBox&&(o.icon=n.box)}if(a){let e=this.collisionCircleArrays[t];void 0===e&&(e=this.collisionCircleArrays[t]=[]);for(let t=0;t<a.circles.length;t+=4)e.push(a.circles[t+0]-ne),e.push(a.circles[t+1]-ne),e.push(a.circles[t+2]),e.push(a.collisionDetected?1:0)}}markUsedJustification(t,i,r,n){let a;a=n===e.aw.vertical?r.verticalPlacedTextSymbolIndex:{left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex}[e.aO(i)];const o=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];for(const e of o)e>=0&&(t.text.placedSymbolArray.get(e).crossTileID=a>=0&&e!==a?0:r.crossTileID)}markUsedOrientation(t,i,r){const n=i===e.aw.horizontal||i===e.aw.horizontalOnly?i:0,a=i===e.aw.vertical?i:0,o=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];for(const e of o)t.text.placedSymbolArray.get(e).placedOrientation=n;r.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const e=this.prevPlacement;let i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;const r=e?e.symbolFadeChange(t):1,n=e?e.opacities:{},a=e?e.variableOffsets:{},o=e?e.placedOrientations:{};for(const t in this.placements){const e=this.placements[t],a=n[t];a?(this.opacities[t]=new se(a,r,e.text,e.icon),i=i||e.text!==a.text.placed||e.icon!==a.icon.placed):(this.opacities[t]=new se(null,r,e.text,e.icon,e.skipFade),i=i||e.text||e.icon)}for(const t in n){const e=n[t];if(!this.opacities[t]){const n=new se(e,r,!1,!1);n.isHidden()||(this.opacities[t]=n,i=i||e.text.placed||e.icon.placed)}}for(const t in a)this.variableOffsets[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.variableOffsets[t]=a[t]);for(const t in o)this.placedOrientations[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.placedOrientations[t]=o[t]);if(e&&void 0===e.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){const i={};for(const r of e){const e=r.getBucket(t);e&&r.latestFeatureIndex&&t.id===e.layerIds[0]&&this.updateBucketOpacities(e,r.tileID,i,r.collisionBoxArray)}}updateBucketOpacities(t,i,r,n){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();const a=t.layers[0],o=a.layout,s=new se(null,0,!1,!1,!0),l=o.get("text-allow-overlap"),c=o.get("icon-allow-overlap"),h=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),u="map"===o.get("text-rotation-alignment"),d="map"===o.get("text-pitch-alignment"),p="none"!==o.get("icon-text-fit"),m=new se(null,0,l&&(c||!t.hasIconData()||o.get("icon-optional")),c&&(l||!t.hasTextData()||o.get("text-optional")),!0);!t.collisionArrays&&n&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(n);const f=(t,e,i)=>{for(let r=0;r<e/4;r++)t.opacityVertexArray.emplaceBack(i);t.hasVisibleVertices=t.hasVisibleVertices||i!==Te},g=this.collisionBoxArrays.get(t.bucketInstanceId);for(let i=0;i<t.symbolInstances.length;i++){const n=t.symbolInstances.get(i),{numHorizontalGlyphVertices:a,numVerticalGlyphVertices:o,crossTileID:l}=n;let c=this.opacities[l];r[l]?c=s:c||(c=m,this.opacities[l]=c),r[l]=!0;const _=n.numIconVertices>0,y=this.placedOrientations[n.crossTileID],x=y===e.aw.vertical,b=y===e.aw.horizontal||y===e.aw.horizontalOnly;if(a>0||o>0){const e=ve(c.text);f(t.text,a,x?Te:e),f(t.text,o,b?Te:e);const i=c.text.isHidden();[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach(e=>{e>=0&&(t.text.placedSymbolArray.get(e).hidden=i||x?1:0)}),n.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).hidden=i||b?1:0);const r=this.variableOffsets[n.crossTileID];r&&this.markUsedJustification(t,r.anchor,n,y);const s=this.placedOrientations[n.crossTileID];s&&(this.markUsedJustification(t,"left",n,s),this.markUsedOrientation(t,s,n))}if(_){const e=ve(c.icon),i=!(p&&n.verticalPlacedIconSymbolIndex&&x);n.placedIconSymbolIndex>=0&&(f(t.icon,n.numIconVertices,i?e:Te),t.icon.placedSymbolArray.get(n.placedIconSymbolIndex).hidden=c.icon.isHidden()),n.verticalPlacedIconSymbolIndex>=0&&(f(t.icon,n.numVerticalIconVertices,i?Te:e),t.icon.placedSymbolArray.get(n.verticalPlacedIconSymbolIndex).hidden=c.icon.isHidden())}const v=g&&g.has(i)?g.get(i):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const r=t.collisionArrays[i];if(r){let i=new e.P(0,0);if(r.textBox||r.verticalTextBox){let e=!0;if(h){const t=this.variableOffsets[l];t?(i=ue(t.anchor,t.width,t.height,t.textOffset,t.textBoxScale),u&&i._rotate(d?-this.transform.bearingInRadians:this.transform.bearingInRadians)):e=!1}if(r.textBox||r.verticalTextBox){let n;r.textBox&&(n=x),r.verticalTextBox&&(n=b),pe(t.textCollisionBox.collisionVertexArray,c.text.placed,!e||n,v.text,i.x,i.y)}}if(r.iconBox||r.verticalIconBox){const e=Boolean(!b&&r.verticalIconBox);let n;r.iconBox&&(n=e),r.verticalIconBox&&(n=!e),pe(t.iconCollisionBox.collisionVertexArray,c.icon.placed,n,v.icon,p?i.x:0,p?i.y:0)}}}}if(t.sortFeatures(-this.transform.bearingInRadians),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`);t.bucketInstanceId in this.collisionCircleArrays&&(t.collisionCircleArray=this.collisionCircleArrays[t.bucketInstanceId],delete this.collisionCircleArrays[t.bucketInstanceId])}symbolFadeChange(t){return 0===this.fadeDuration?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.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,e){const i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t}setStale(){this.stale=!0}}function pe(t,e,i,r,n,a){r&&0!==r.length||(r=[0,0,0,0]);const o=r[0]-ne,s=r[1]-ne,l=r[2]-ne,c=r[3]-ne;t.emplaceBack(e?1:0,i?1:0,n||0,a||0,o,s),t.emplaceBack(e?1:0,i?1:0,n||0,a||0,l,s),t.emplaceBack(e?1:0,i?1:0,n||0,a||0,l,c),t.emplaceBack(e?1:0,i?1:0,n||0,a||0,o,c)}const me=Math.pow(2,25),fe=Math.pow(2,24),ge=Math.pow(2,17),_e=Math.pow(2,16),ye=Math.pow(2,9),xe=Math.pow(2,8),be=Math.pow(2,1);function ve(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;const e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*me+e*fe+i*ge+e*_e+i*ye+e*xe+i*be+e}const Te=0;class we{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,e,i,r,n){const a=this._bucketParts;for(;this._currentTileIndex<t.length;)if(e.getBucketParts(a,r,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,n())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort((t,e)=>t.sortKey-e.sortKey));this._currentPartIndex<a.length;)if(e.placeLayerBucketPart(a[this._currentPartIndex],this._seenCrossTileIDs,i),this._currentPartIndex++,n())return!0;return!1}}class Ve{constructor(t,e,i,r,n,a,o,s){this.placement=new de(t,e,a,o,s),this._currentPlacementIndex=i.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1}isDone(){return this._done}continuePlacement(t,i,r){const n=c(),a=()=>!this._forceFullPlacement&&c()-n>2;for(;this._currentPlacementIndex>=0;){const n=i[t[this._currentPlacementIndex]],o=this.placement.collisionIndex.transform.zoom;if(e.aQ(n)&&n.layout&&(!n.minzoom||n.minzoom<=o)&&(!n.maxzoom||n.maxzoom>o)){if(this._inProgressLayer||(this._inProgressLayer=new we(n)),this._inProgressLayer.continuePlacement(r[n.source],this.placement,this._showCollisionBoxes,n,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const Re=512/e.a5/2;class Me{constructor(t,i,r){this.tileID=t,this.bucketInstanceId=r,this._symbolsByKey={};const n=new Map;for(let t=0;t<i.length;t++){const e=i.get(t),r=e.key,a=n.get(r);a?a.push(e):n.set(r,[e])}for(const[t,i]of n){const r={positions:i.map(t=>({x:Math.floor(t.anchorX*Re),y:Math.floor(t.anchorY*Re)})),crossTileIDs:i.map(t=>t.crossTileID)};if(r.positions.length>128){const t=new e.aR(r.positions.length,16,Uint16Array);for(const{x:e,y:i}of r.positions)t.add(e,i);t.finish(),delete r.positions,r.index=t}this._symbolsByKey[t]=r}}getScaledCoordinates(t,i){const{x:r,y:n,z:a}=this.tileID.canonical,{x:o,y:s,z:l}=i.canonical,c=Re/Math.pow(2,l-a),h=(s*e.a5+t.anchorY)*c,u=n*e.a5*Re;return{x:Math.floor((o*e.a5+t.anchorX)*c-r*e.a5*Re),y:Math.floor(h-u)}}findMatches(t,e,i){const r=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z);for(let n=0;n<t.length;n++){const a=t.get(n);if(a.crossTileID)continue;const o=this._symbolsByKey[a.key];if(!o)continue;const s=this.getScaledCoordinates(a,e);if(o.index){const t=o.index.range(s.x-r,s.y-r,s.x+r,s.y+r).sort();for(const e of t){const t=o.crossTileIDs[e];if(!i[t]){i[t]=!0,a.crossTileID=t;break}}}else if(o.positions)for(let t=0;t<o.positions.length;t++){const e=o.positions[t],n=o.crossTileIDs[t];if(Math.abs(e.x-s.x)<=r&&Math.abs(e.y-s.y)<=r&&!i[n]){i[n]=!0,a.crossTileID=n;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:t})=>t)}}class Ue{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Se{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const e=Math.round((t-this.lng)/360);if(0!==e)for(const t in this.indexes){const i=this.indexes[t],r={};for(const t in i){const n=i[t];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),r[n.tileID.key]=n}this.indexes[t]=r}this.lng=t}addBucket(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let t=0;t<e.symbolInstances.length;t++)e.symbolInstances.get(t).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const r=this.usedCrossTileIDs[t.overscaledZ];for(const i in this.indexes){const n=this.indexes[i];if(Number(i)>t.overscaledZ)for(const i in n){const a=n[i];a.tileID.isChildOf(t)&&a.findMatches(e.symbolInstances,t,r)}else{const a=n[t.scaledTo(Number(i)).key];a&&a.findMatches(e.symbolInstances,t,r)}}for(let t=0;t<e.symbolInstances.length;t++){const n=e.symbolInstances.get(t);n.crossTileID||(n.crossTileID=i.generate(),r[n.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Me(t,e.symbolInstances,e.bucketInstanceId),!0}removeBucketCrossTileIDs(t,e){for(const i of e.getCrossTileIDsLists())for(const e of i)delete this.usedCrossTileIDs[t][e]}removeStaleBuckets(t){let e=!1;for(const i in this.indexes){const r=this.indexes[i];for(const n in r)t[r[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,r[n]),delete r[n],e=!0)}return e}}class Ne{constructor(){this.layerIndexes={},this.crossTileIDs=new Ue,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,e,i){let r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new Se);let n=!1;const a={};r.handleWrapJump(i);for(const i of e){const e=i.getBucket(t);e&&t.id===e.layerIds[0]&&(e.bucketInstanceId||(e.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(i.tileID,e,this.crossTileIDs)&&(n=!0),a[e.bucketInstanceId]=!0)}return r.removeStaleBuckets(a)&&(n=!0),n}pruneUnusedLayers(t){const e={};t.forEach(t=>{e[t]=!0});for(const t in this.layerIndexes)e[t]||delete this.layerIndexes[t]}}var Ee="void main() {fragColor=vec4(1.0);}";const Fe={prelude:Ze("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nout highp vec4 fragColor;","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+ c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+ c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+ c\n);}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\n#ifdef GLOBE\nif ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}\n#endif\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;"),projectionMercator:Ze("","float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:Ze("","#define GLOBE_RADIUS 6371008.8\nuniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos\n);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY); \nif (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len\n);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}"),background:Ze("uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:Ze("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;in vec2 v_pos_a;in 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=texture(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=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);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:Ze("in vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;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));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {\n#ifdef GLOBE\nvec3 center_vector=projectToSphere(circle_center);\n#endif\nfloat angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {\n#ifdef GLOBE\nvec4 projected_center=interpolateProjection(circle_center,center_vector,ele);\n#else\nvec4 projected_center=projectTileWithElevation(circle_center,ele);\n#endif\ncorner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}\n#ifdef GLOBE\nvec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);\n#else\ngl_Position=projectTileWithElevation(corner_position,ele);\n#endif\n} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}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;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:Ze(Ee,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:Ze("uniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.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;vec2 circle_center=floor(pos_raw/8.0);\n#ifdef GLOBE\nvec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);\n#else\ngl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));\n#endif\n}"),heatmapTexture:Ze("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out 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:Ze("in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Ze("in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;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);fragColor=color*alpha*opacity_t;}","in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {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;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:Ze("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else\n{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:Ze("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:Ze(Ee,"in vec2 a_pos;void main() {\n#ifdef GLOBE\ngl_Position=projectTileFor3D(a_pos,0.0);\n#else\ngl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);\n#endif\n}"),fill:Ze("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nfragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_fill_translate;in vec2 a_pos;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);}"),fillOutline:Ze("in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}"),fillOutlinePattern:Ze("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(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=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);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;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}"),fillPattern:Ze("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(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=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);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:Ze("in vec4 v_color;void main() {fragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\nout vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nfloat 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;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);\n#ifdef GLOBE\nmat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);\n#endif\ndirectional=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:Ze("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(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=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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 vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\n#ifdef GLOBE\nout vec3 v_sphere_pos;\n#endif\nout vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,elevation*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:Ze("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;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))*tileSize/pow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out 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:Ze("uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];\n#define PI 3.141592653589793\n#define STANDARD 0\n#define COMBINED 1\n#define IGOR 2\n#define MULTIDIRECTIONAL 3\n#define BASIC 4\nfloat get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;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_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else\n{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else\n{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:Ze("uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:Ze("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:Ze("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:Ze("uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}"),lineGradientSDF:Ze("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}"),raster:Ze("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in 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=texture(u_image0,v_pos0);vec4 color1=texture(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);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5;\n#ifdef GLOBE\nif (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}\n#endif\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Ze("uniform sampler2D u_texture;in vec2 v_tex;in float v_total_opacity;void main() {fragColor=texture(u_texture,v_tex)*v_total_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in 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_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_tex;out float v_total_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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_total_opacity=opacity*max(0.0,min(visibility,fade_opacity[0]+fade_change));if (v_total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;}"),symbolSDF:Ze("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float total_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=texture(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);}fragColor=color*(alpha*total_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in 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_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;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_translation;uniform float u_pitched_scale;out vec2 v_data0;out vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy/16.0;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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,total_opacity);}"),symbolTextAndIcon:Ze("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat total_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;fragColor=texture(u_texture_icon,tex_icon)*total_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);fragColor=color*(alpha*total_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in 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_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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec4 v_data0;out vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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));float total_opacity=opacity*interpolated_fade_opacity;if (total_opacity < 0.1){gl_Position=vec4(-2.,-2.,-2.,1.);return;}highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,total_opacity,is_sdf);}"),terrain:Ze("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:Ze("in 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() {fragColor=pack(v_depth);}","in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:Ze("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}"),projectionErrorMeasurement:Ze("in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}","in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}"),atmosphere:Ze("#ifdef GL_ES\nprecision highp float;\n#endif\nin vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758\n);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}","in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:Ze("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function Ze(t,e){const i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=e.match(/in ([\w]+) ([\w]+)/g),n=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(n):n,s={};return{fragmentSource:t=t.replace(i,(t,e,i,r,n)=>(s[n]=!0,"define"===e?`\n#ifndef HAS_UNIFORM_u_${n}\nin ${i} ${r} ${n};\n#else\nuniform ${i} ${r} u_${n};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${n}\n ${i} ${r} ${n} = u_${n};\n#endif\n`)),vertexSource:e=e.replace(i,(t,e,i,r,n)=>{const a="float"===r?"vec2":"vec4",o=n.match(/color/)?"color":a;return s[n]?"define"===e?`\n#ifndef HAS_UNIFORM_u_${n}\nuniform lowp float u_${n}_t;\nin ${i} ${a} a_${n};\nout ${i} ${r} ${n};\n#else\nuniform ${i} ${r} u_${n};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${n}\n ${n} = a_${n};\n#else\n ${i} ${r} ${n} = u_${n};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${n}\n ${n} = unpack_mix_${o}(a_${n}, u_${n}_t);\n#else\n ${i} ${r} ${n} = u_${n};\n#endif\n`:"define"===e?`\n#ifndef HAS_UNIFORM_u_${n}\nuniform lowp float u_${n}_t;\nin ${i} ${a} a_${n};\n#else\nuniform ${i} ${r} u_${n};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${n}\n ${i} ${r} ${n} = a_${n};\n#else\n ${i} ${r} ${n} = u_${n};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${n}\n ${i} ${r} ${n} = unpack_mix_${o}(a_${n}, u_${n}_t);\n#else\n ${i} ${r} ${n} = u_${n};\n#endif\n`}),staticAttributes:r,staticUniforms:o}}class ke{constructor(t,e,i){this.vertexBuffer=t,this.indexBuffer=e,this.segments=i}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var ze=e.aS([{name:"a_pos",type:"Int16",components:2}]);const We="#define PROJECTION_MERCATOR",Ie="mercator";class De{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return Ie}get shaderDefine(){return We}get shaderPreludeCode(){return Fe.projectionMercator}get vertexShaderPreludeCode(){return Fe.projectionMercator.vertexSource}get subdivisionGranularity(){return e.aT.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(t){}getMeshFromTileID(t,i,r,n,a){if(this._cachedMesh)return this._cachedMesh;const o=new e.aU;o.emplaceBack(0,0),o.emplaceBack(e.a5,0),o.emplaceBack(0,e.a5),o.emplaceBack(e.a5,e.a5);const s=t.createVertexBuffer(o,ze.members),l=e.aV.simpleSegment(0,0,4,2),c=new e.aW;c.emplaceBack(1,0,2),c.emplaceBack(1,2,3);const h=t.createIndexBuffer(c);return this._cachedMesh=new ke(s,h,l),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(t){}}class Ce{constructor(t=0,e=0,i=0,r=0){if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=r}interpolate(t,i,r){return null!=i.top&&null!=t.top&&(this.top=e.G.number(t.top,i.top,r)),null!=i.bottom&&null!=t.bottom&&(this.bottom=e.G.number(t.bottom,i.bottom,r)),null!=i.left&&null!=t.left&&(this.left=e.G.number(t.left,i.left,r)),null!=i.right&&null!=t.right&&(this.right=e.G.number(t.right,i.right,r)),this}getCenter(t,i){const r=e.ak((this.left+t-this.right)/2,0,t),n=e.ak((this.top+i-this.bottom)/2,0,i);return new e.P(r,n)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Ce(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Be(t,e){if(!t.renderWorldCopies||t.lngRange)return;const i=e.lng-t.center.lng;e.lng+=i>180?-360:i<-180?360:0}function Pe(t){return Math.max(0,Math.floor(t))}class Oe{constructor(t,i){var r;this.applyConstrain=(t,e)=>null!==this._constrainOverride?this._constrainOverride(t,e):this._callbacks.defaultConstrain(t,e),this._callbacks=t,this._tileSize=512,this._renderWorldCopies=void 0===(null==i?void 0:i.renderWorldCopies)||!!(null==i?void 0:i.renderWorldCopies),this._minZoom=(null==i?void 0:i.minZoom)||0,this._maxZoom=(null==i?void 0:i.maxZoom)||22,this._minPitch=null==(null==i?void 0:i.minPitch)?0:null==i?void 0:i.minPitch,this._maxPitch=null==(null==i?void 0:i.maxPitch)?60:null==i?void 0:i.maxPitch,this._constrainOverride=null!==(r=null==i?void 0:i.constrainOverride)&&void 0!==r?r:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new e.V(0,0),this._elevation=0,this._zoom=0,this._tileZoom=Pe(this._zoom),this._scale=e.an(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new Ce,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(t,i,r){this._constrainOverride=t.constrainOverride,this._latRange=t.latRange,this._lngRange=t.lngRange,this._width=t.width,this._height=t.height,this._center=t.center,this._elevation=t.elevation,this._minElevationForCurrentTile=t.minElevationForCurrentTile,this._zoom=t.zoom,this._tileZoom=Pe(this._zoom),this._scale=e.an(this._zoom),this._bearingInRadians=t.bearingInRadians,this._fovInRadians=t.fovInRadians,this._pitchInRadians=t.pitchInRadians,this._rollInRadians=t.rollInRadians,this._unmodified=t.unmodified,this._edgeInsets=new Ce(t.padding.top,t.padding.bottom,t.padding.left,t.padding.right),this._minZoom=t.minZoom,this._maxZoom=t.maxZoom,this._minPitch=t.minPitch,this._maxPitch=t.maxPitch,this._renderWorldCopies=t.renderWorldCopies,this._cameraToCenterDistance=t.cameraToCenterDistance,this._nearZ=t.nearZ,this._farZ=t.farZ,this._autoCalculateNearFarZ=!r&&t.autoCalculateNearFarZ,i&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(t){this._minElevationForCurrentTile=t}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(t){this._minZoom!==t&&(this._minZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(t){this._minPitch!==t&&(this._minPitch=t,this.setPitch(Math.max(this.pitch,t)))}get maxPitch(){return this._maxPitch}setMaxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.setPitch(Math.min(this.pitch,t)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get constrainOverride(){return this._constrainOverride}setConstrainOverride(t){void 0===t&&(t=null),this._constrainOverride!==t&&(this._constrainOverride=t,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(t){const i=e.W(t,-180,180)*Math.PI/180;var n,a,o,s,l,c,h,u,d;this._bearingInRadians!==i&&(this._unmodified=!1,this._bearingInRadians=i,this._calcMatrices(),this._rotationMatrix=r(),n=this._rotationMatrix,o=-this._bearingInRadians,s=(a=this._rotationMatrix)[0],l=a[1],c=a[2],h=a[3],u=Math.sin(o),d=Math.cos(o),n[0]=s*d+c*u,n[1]=l*d+h*u,n[2]=s*-u+c*d,n[3]=l*-u+h*d)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(t){const i=e.ak(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==i&&(this._unmodified=!1,this._pitchInRadians=i,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(t){const e=t/180*Math.PI;this._rollInRadians!==e&&(this._unmodified=!1,this._rollInRadians=e,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return e.aX(this._fovInRadians)}setFov(t){t=e.ak(t,.1,150),this.fov!==t&&(this._unmodified=!1,this._fovInRadians=e.am(t),this._calcMatrices())}get zoom(){return this._zoom}setZoom(t){const i=this.applyConstrain(this._center,t).zoom;this._zoom!==i&&(this._unmodified=!1,this._zoom=i,this._tileZoom=Math.max(0,Math.floor(i)),this._scale=e.an(i),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(t){t!==this._elevation&&(this._elevation=t,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(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)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(t,e){this._autoCalculateNearFarZ=!1,this._nearZ=t,this._farZ=e,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this.constrainInternal(),this._calcMatrices()}resize(t,e,i=!0){this._width=t,this._height=e,i&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){return this._latRange&&2===this._latRange.length&&this._lngRange&&2===this._lngRange.length?new O([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]]):null}setMaxBounds(t){t?(this._lngRange=[t.getWest(),t.getEast()],this._latRange=[t.getSouth(),t.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-e.al,e.al])}getCameraQueryGeometry(t,i){if(1===i.length)return[i[0],t];{const{minX:r,minY:n,maxX:a,maxY:o}=e.a7.fromPoints(i).extend(t);return[new e.P(r,n),new e.P(a,n),new e.P(a,o),new e.P(r,o),new e.P(r,n)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;const t=this._unmodified,{center:e,zoom:i}=this.applyConstrain(this.center,this.zoom);this.setCenter(e),this.setZoom(i),this._unmodified=t,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let t=e.ao(new Float64Array(16));e.Q(t,t,[this._width/2,-this._height/2,1]),e.O(t,t,[1,-1,0]),this._clipSpaceToPixelsMatrix=t,t=e.ao(new Float64Array(16)),e.Q(t,t,[1,-1,1]),e.O(t,t,[-1,-1,0]),e.Q(t,t,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=t,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(t,i,r,n){const a=void 0!==r?r:this.bearing,o=n=void 0!==n?n:this.pitch,{distanceToCenter:s,clampedElevation:l}=this._distanceToCenterFromAltElevationPitch(i,this.elevation,o),{x:c,y:h}=yt(o,a),u=e.a6.fromLngLat(t,i);let d,p,m=e.aY(1,u.y),f=0;do{if(f+=1,f>10)break;p=s/m,d=new e.a6(u.x+c*p,u.y+h*p),m=1/d.meterInMercatorCoordinateUnits()}while(Math.abs(s-p*m)>1e-12);return{center:d.toLngLat(),elevation:l,zoom:e.aq(this.height/2/Math.tan(this.fovInRadians/2)/p/this.tileSize)}}recalculateZoomAndCenter(t){if(this.elevation-t==0)return;const i=1/this.worldSize,r=e.ap(1,this.center.lat)*this.worldSize,n=e.a6.fromLngLat(this.center,this.elevation),a=n.x/i,o=n.y/i,s=n.z/i,l=this.pitch,c=this.bearing,{x:h,y:u,z:d}=yt(l,c),p=this.cameraToCenterDistance,m=a+p*-h,f=o+p*-u,g=s+p*d,{distanceToCenter:_,clampedElevation:y}=this._distanceToCenterFromAltElevationPitch(g/r,t,l),x=_*r,b=new e.a6((m+h*x)*i,(f+u*x)*i,0).toLngLat(),v=e.ap(1,b.lat),T=e.aq(this.height/2/Math.tan(this.fovInRadians/2)/_/v/this.tileSize);this._elevation=y,this._center=b,this.setZoom(T)}_distanceToCenterFromAltElevationPitch(t,i,r){const n=-Math.cos(e.am(r)),a=t-i;let o,s=i;return n*a>=0||Math.abs(n)<.1?(o=1e4,s=t+o*n):o=-a/n,{distanceToCenter:o,clampedElevation:s}}getCameraPoint(){const t=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(t*Math.sin(this.rollInRadians),t*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){const t=e.ap(1,this.center.lat)*this.worldSize;return _t(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/t).toLngLat()}getMercatorTileCoordinates(t){if(!t)return[0,0,1,1];const i=t.canonical.z>=0?1<<t.canonical.z:Math.pow(2,t.canonical.z);return[t.canonical.x/i,t.canonical.y/i,1/i/e.a5,1/i/e.a5]}}class Le{constructor(t,i){this.min=t,this.max=i,this.center=e.aZ([],e.a_([],this.min,this.max),.5)}quadrant(t){const i=[t%2==0,t<2],r=e.a$(this.min),n=e.a$(this.max);for(let t=0;t<i.length;t++)r[t]=i[t]?this.min[t]:this.center[t],n[t]=i[t]?this.center[t]:this.max[t];return n[2]=this.max[2],new Le(r,n)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersectsFrustum(t){let e=!0;for(let i=0;i<t.planes.length;i++){const r=this.intersectsPlane(t.planes[i]);if(0===r)return 0;1===r&&(e=!1)}return e?2:t.aabb.min[0]>this.max[0]||t.aabb.min[1]>this.max[1]||t.aabb.min[2]>this.max[2]||t.aabb.max[0]<this.min[0]||t.aabb.max[1]<this.min[1]||t.aabb.max[2]<this.min[2]?0:1}intersectsPlane(t){let e=t[3],i=t[3];for(let r=0;r<3;r++)t[r]>0?(e+=t[r]*this.min[r],i+=t[r]*this.max[r]):(i+=t[r]*this.min[r],e+=t[r]*this.max[r]);return e>=0?2:i<0?0:1}}class je{distanceToTile2d(t,e,i,r){const n=r.distanceX([t,e]),a=r.distanceY([t,e]);return Math.hypot(n,a)}getWrap(t,e,i){return i}getTileBoundingVolume(t,i,r,n){var a,o;let s=0,l=0;if(null==n?void 0:n.terrain){const c=new e.a2(t.z,i,t.z,t.x,t.y),h=n.terrain.getMinMaxElevation(c);s=null!==(a=h.minElevation)&&void 0!==a?a:Math.min(0,r),l=null!==(o=h.maxElevation)&&void 0!==o?o:Math.max(0,r)}const c=1<<t.z;return new Le([i+t.x/c,t.y/c,s],[i+(t.x+1)/c,(t.y+1)/c,l])}allowVariableZoom(t,i){const r=t.fov*(Math.abs(Math.cos(t.rollInRadians))*t.height+Math.abs(Math.sin(t.rollInRadians))*t.width)/t.height,n=e.ak(78.5-r/2,0,60);return!!i.terrain||t.pitch>n}allowWorldCopies(){return!0}prepareNextFrame(){}}class Ae{constructor(t,e,i){this.points=t,this.planes=e,this.aabb=i}static fromInvProjectionMatrix(t,i=1,r=0,n,a){const o=a?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],s=Math.pow(2,r),l=[[-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(r=>function(t,i,r,n){const a=e.aE([],t,i),o=1/a[3]/r*n;return e.b4(a,a,[o,o,1/a[3],o])}(r,t,i,s));n&&function(t,i,r,n){const a=n?4:0,o=n?0:4;let s=0;const l=[],c=[];for(let i=0;i<4;i++){const r=e.b0([],t[i+o],t[i+a]),n=e.b5(r);e.aZ(r,r,1/n),l.push(n),c.push(r)}for(let i=0;i<4;i++){const n=e.b6(t[i+a],c[i],r);s=null!==n&&n>=0?Math.max(s,n):Math.max(s,l[i])}const h=function(t,i){const r=e.b0([],t[i[0]],t[i[1]]),n=e.b0([],t[i[2]],t[i[1]]),a=[0,0,0,0];return e.b1(a,e.b2([],r,n)),a[3]=-e.b3(a,t[i[0]]),a}(t,i),u=function(t,i){const r=e.b7(t),n=e.b8([],t,1/r),a=e.b0([],i,e.aZ([],n,e.b3(i,n))),o=e.b7(a);if(o>0){const t=Math.sqrt(1-n[3]*n[3]),r=e.aZ([],n,-n[3]),s=e.a_([],r,e.aZ([],a,t/o));return e.b9(i,s)}return null}(r,h);if(null!==u){const t=u/e.b3(c[0],h);s=Math.min(s,t)}for(let e=0;e<4;e++){const i=Math.min(s,l[e]);t[e+o]=[t[e+a][0]+c[e][0]*i,t[e+a][1]+c[e][1]*i,t[e+a][2]+c[e][2]*i,1]}}(l,o[0],n,a);const c=o.map(t=>{const i=e.b0([],l[t[0]],l[t[1]]),r=e.b0([],l[t[2]],l[t[1]]),n=e.b1([],e.b2([],i,r)),a=-e.b3(n,l[t[1]]);return n.concat(a)}),h=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],u=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const t of l)for(let e=0;e<3;e++)h[e]=Math.min(h[e],t[e]),u[e]=Math.max(u[e],t[e]);return new Ae(l,c,new Le(h,u))}}class Ge{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,e,i){return this._helper.interpolatePadding(t,e,i)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,e,i=!0){this._helper.resize(t,e,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,e){this._helper.overrideNearFarZ(t,e)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t,e){}constructor(t){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(t,i)=>{i=e.ak(+i,this.minZoom,this.maxZoom);const r={center:new e.V(t.lng,t.lat),zoom:i};let n=this._helper._lngRange;if(!this._helper._renderWorldCopies&&null===n){const t=180-1e-10;n=[-t,t]}const a=this.tileSize*e.an(r.zoom);let o=0,s=a,l=0,c=a,h=0,u=0;const{x:d,y:p}=this.size;if(this._helper._latRange){const t=this._helper._latRange;o=e.X(t[1])*a,s=e.X(t[0])*a,s-o<p&&(h=p/(s-o))}n&&(l=e.W(e.Y(n[0])*a,0,a),c=e.W(e.Y(n[1])*a,0,a),c<l&&(c+=a),c-l<d&&(u=d/(c-l)));const{x:m,y:f}=pt(a,t);let g,_;const y=Math.max(u||0,h||0);if(y){const t=new e.P(u?(c+l)/2:m,h?(s+o)/2:f);return r.center=mt(a,t).wrap(),r.zoom+=e.aq(y),r}if(this._helper._latRange){const t=p/2;f-t<o&&(_=o+t),f+t>s&&(_=s-t)}if(n){const t=(l+c)/2;let i=m;this._helper._renderWorldCopies&&(i=e.W(m,t-a/2,t+a/2));const r=d/2;i-r<l&&(g=l+r),i+r>c&&(g=c-r)}if(void 0!==g||void 0!==_){const t=new e.P(null!=g?g:m,null!=_?_:f);r.center=mt(a,t).wrap()}return r},this.applyConstrain=(t,e)=>this._helper.applyConstrain(t,e),this._helper=new Oe({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(t,e)=>this.defaultConstrain(t,e)},t),this._coveringTilesDetailsProvider=new je}clone(){const t=new Ge;return t.apply(this,!1),t}apply(t,e,i){this._helper.apply(t,e,i)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(t){const i=[new e.ba(0,t)];if(this._helper._renderWorldCopies){const r=this.screenPointToMercatorCoordinate(new e.P(0,0)),n=this.screenPointToMercatorCoordinate(new e.P(this._helper._width,0)),a=this.screenPointToMercatorCoordinate(new e.P(this._helper._width,this._helper._height)),o=this.screenPointToMercatorCoordinate(new e.P(0,this._helper._height)),s=Math.floor(Math.min(r.x,n.x,a.x,o.x)),l=Math.floor(Math.max(r.x,n.x,a.x,o.x)),c=1;for(let r=s-c;r<=l+c;r++)0!==r&&i.push(new e.ba(r,t))}return i}getCameraFrustum(){return Ae.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){const e=this.screenPointToLocation(this.centerPoint,t),i=t?t.getElevationForLngLatZoom(e,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(i)}setLocationAtPoint(t,i){const r=e.ap(this.elevation,this.center.lat),n=this.screenPointToMercatorCoordinateAtZ(i,r),a=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,r),o=e.a6.fromLngLat(t),s=new e.a6(o.x-(n.x-a.x),o.y-(n.y-a.y));this.setCenter(null==s?void 0:s.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(t,i){return i?this.coordinatePoint(e.a6.fromLngLat(t),i.getElevationForLngLat(t,this),this._pixelMatrix3D):this.coordinatePoint(e.a6.fromLngLat(t))}screenPointToLocation(t,e){var i;return null===(i=this.screenPointToMercatorCoordinate(t,e))||void 0===i?void 0:i.toLngLat()}screenPointToMercatorCoordinate(t,e){if(e){const i=e.pointCoordinate(t);if(null!=i)return i}return this.screenPointToMercatorCoordinateAtZ(t)}screenPointToMercatorCoordinateAtZ(t,i){const r=i||0,n=[t.x,t.y,0,1],a=[t.x,t.y,1,1];e.aE(n,n,this._pixelMatrixInverse),e.aE(a,a,this._pixelMatrixInverse);const o=n[3],s=a[3],l=n[1]/o,c=a[1]/s,h=n[2]/o,u=a[2]/s,d=h===u?0:(r-h)/(u-h);return new e.a6(e.G.number(n[0]/o,a[0]/s,d)/this.worldSize,e.G.number(l,c,d)/this.worldSize,r)}coordinatePoint(t,i=0,r=this._pixelMatrix){const n=[t.x*this.worldSize,t.y*this.worldSize,i,1];return e.aE(n,n,r),new e.P(n[0]/n[3],n[1]/n[3])}getBounds(){const t=Math.max(0,this._helper._height/2-ft(this));return(new O).extend(this.screenPointToLocation(new e.P(0,t))).extend(this.screenPointToLocation(new e.P(this._helper._width,t))).extend(this.screenPointToLocation(new e.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new e.P(0,this._helper._height)))}isPointOnMapSurface(t,e){return e?null!=e.pointCoordinate(t):t.y>this.height/2-ft(this)}calculatePosMatrix(t,i=!1,r){var n;const a=null!==(n=t.key)&&void 0!==n?n:e.bb(t.wrap,t.canonical.z,t.canonical.z,t.canonical.x,t.canonical.y),o=i?this._alignedPosMatrixCache:this._posMatrixCache;if(o.has(a)){const t=o.get(a);return r?t.f32:t.f64}const s=gt(t,this.worldSize);e.S(s,i?this._alignedProjMatrix:this._viewProjMatrix,s);const l={f64:s,f32:new Float32Array(s)};return o.set(a,l),r?l.f32:l.f64}calculateFogMatrix(t){const i=t.key,r=this._fogMatrixCacheF32;if(r.has(i))return r.get(i);const n=gt(t,this.worldSize);return e.S(n,this._fogMatrix,n),r.set(i,new Float32Array(n)),r.get(i)}calculateCenterFromCameraLngLatAlt(t,e,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(t,e,i,r)}_calculateNearFarZIfNeeded(t,i,r){if(!this._helper.autoCalculateNearFarZ)return;const n=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),a=t-n*this._helper._pixelPerMeter/Math.cos(i),o=n<0?a:t,s=Math.PI/2+this.pitchInRadians,l=e.am(this.fov)*(Math.abs(Math.cos(e.am(this.roll)))*this.height+Math.abs(Math.sin(e.am(this.roll)))*this.width)/this.height*(.5+r.y/this.height),c=Math.sin(l)*o/Math.sin(e.ak(Math.PI-s-l,.01,Math.PI-.01)),h=ft(this),u=Math.atan(h/this._helper.cameraToCenterDistance),d=e.am(.75),p=u>d?2*u*(.5+r.y/(2*h)):d,m=Math.sin(p)*o/Math.sin(e.ak(Math.PI-s-p,.01,Math.PI-.01)),f=Math.min(c,m);this._helper._farZ=1.01*(Math.cos(Math.PI/2-i)*f+o),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;const t=this.centerOffset,i=pt(this.worldSize,this.center),r=i.x,n=i.y;this._helper._pixelPerMeter=e.ap(1,this.center.lat)*this.worldSize;const a=e.am(Math.min(this.pitch,dt)),o=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(a));let s;this._calculateNearFarZIfNeeded(o,a,t),s=new Float64Array(16),e.bc(s,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),e.ay(this._invProjMatrix,s),s[8]=2*-t.x/this._helper._width,s[9]=2*t.y/this._helper._height,this._projectionMatrix=e.bd(s),e.Q(s,s,[1,-1,1]),e.O(s,s,[0,0,-this._helper.cameraToCenterDistance]),e.be(s,s,-this.rollInRadians),e.bf(s,s,this.pitchInRadians),e.be(s,s,-this.bearingInRadians),e.O(s,s,[-r,-n,0]),this._mercatorMatrix=e.Q([],s,[this.worldSize,this.worldSize,this.worldSize]),e.Q(s,s,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=e.S(new Float64Array(16),this.clipSpaceToPixelsMatrix,s),e.O(s,s,[0,0,-this.elevation]),this._viewProjMatrix=s,this._invViewProjMatrix=e.ay([],s);const l=[0,0,-1,1];e.aE(l,l,this._invViewProjMatrix),this._cameraPosition=[l[0]/l[3],l[1]/l[3],l[2]/l[3]],this._fogMatrix=new Float64Array(16),e.bc(this._fogMatrix,this.fovInRadians,this.width/this.height,o,this._helper._farZ),this._fogMatrix[8]=2*-t.x/this.width,this._fogMatrix[9]=2*t.y/this.height,e.Q(this._fogMatrix,this._fogMatrix,[1,-1,1]),e.O(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),e.be(this._fogMatrix,this._fogMatrix,-this.rollInRadians),e.bf(this._fogMatrix,this._fogMatrix,this.pitchInRadians),e.be(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),e.O(this._fogMatrix,this._fogMatrix,[-r,-n,0]),e.Q(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),e.O(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=e.S(new Float64Array(16),this.clipSpaceToPixelsMatrix,s);const c=this._helper._width%2/2,h=this._helper._height%2/2,u=Math.cos(this.bearingInRadians),d=Math.sin(-this.bearingInRadians),p=r-Math.round(r)+u*c+d*h,m=n-Math.round(n)+u*h+d*c,f=new Float64Array(s);if(e.O(f,f,[p>.5?p-1:p,m>.5?m-1:m,0]),this._alignedProjMatrix=f,s=e.ay(new Float64Array(16),this._pixelMatrix),!s)throw new Error("failed to invert matrix");this._pixelMatrixInverse=s,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;const t=this.screenPointToMercatorCoordinate(new e.P(0,0)),i=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.aE(i,i,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){const t=e.ap(1,this.center.lat)*this.worldSize;return _t(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/t).toLngLat()}lngLatToCameraDepth(t,i){const r=e.a6.fromLngLat(t),n=[r.x*this.worldSize,r.y*this.worldSize,i,1];return e.aE(n,n,this._viewProjMatrix),n[2]/n[3]}getProjectionData(t){const{overscaledTileID:i,aligned:r,applyTerrainMatrix:n}=t,a=this._helper.getMercatorTileCoordinates(i),o=i?this.calculatePosMatrix(i,r,!0):null;let s;return s=i&&i.terrainRttPosMatrix32f&&n?i.terrainRttPosMatrix32f:o||e.bg(),{mainMatrix:s,tileMercatorCoords:a,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:s}}isLocationOccluded(t){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(t,e,i){return 1}transformLightDirection(t){return e.a$(t)}getRayDirectionFromPixel(t){throw new Error("Not implemented.")}projectTileCoordinates(t,i,r,n){const a=this.calculatePosMatrix(r);let o;n?(o=[t,i,n(t,i),1],e.aE(o,o,a)):(o=[t,i,0,1],re(o,o,a));const s=o[3];return{point:new e.P(o[0]/s,o[1]/s),signedDistanceFromCamera:s,isOccluded:!1}}populateCache(t){for(const e of t)this.calculatePosMatrix(e)}getMatrixForModel(t,i){const r=e.a6.fromLngLat(t,i),n=r.meterInMercatorCoordinateUnits(),a=e.bh();return e.O(a,a,[r.x,r.y,r.z]),e.be(a,a,Math.PI),e.bf(a,a,Math.PI/2),e.Q(a,a,[-n,n,n]),a}getProjectionDataForCustomLayer(t=!0){const i=new e.a2(0,0,0,0,0),r=this.getProjectionData({overscaledTileID:i,applyGlobeMatrix:t}),n=gt(i,this.worldSize);e.S(n,this._viewProjMatrix,n),r.tileMercatorCoords=[0,0,1,1];const a=[e.a5,e.a5,this.worldSize/this._helper.pixelsPerMeter],o=e.bi();return e.Q(o,n,a),r.fallbackMatrix=o,r.mainMatrix=o,r}getFastPathSimpleProjectionMatrix(t){return this.calculatePosMatrix(t)}}function Ye(){e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function Qe(t){if(t.useSlerp)if(t.k<1){const i=e.bj(t.startEulerAngles.roll,t.startEulerAngles.pitch,t.startEulerAngles.bearing),r=e.bj(t.endEulerAngles.roll,t.endEulerAngles.pitch,t.endEulerAngles.bearing),n=new Float64Array(4);e.bk(n,i,r,t.k);const a=e.bl(n);t.tr.setRoll(a.roll),t.tr.setPitch(a.pitch),t.tr.setBearing(a.bearing)}else t.tr.setRoll(t.endEulerAngles.roll),t.tr.setPitch(t.endEulerAngles.pitch),t.tr.setBearing(t.endEulerAngles.bearing);else t.tr.setRoll(e.G.number(t.startEulerAngles.roll,t.endEulerAngles.roll,t.k)),t.tr.setPitch(e.G.number(t.startEulerAngles.pitch,t.endEulerAngles.pitch,t.k)),t.tr.setBearing(e.G.number(t.startEulerAngles.bearing,t.endEulerAngles.bearing,t.k))}function Je(t,i,r,n,a){const o=a.padding,s=pt(a.worldSize,r.getNorthWest()),l=pt(a.worldSize,r.getNorthEast()),c=pt(a.worldSize,r.getSouthEast()),h=pt(a.worldSize,r.getSouthWest()),u=e.am(-n),d=s.rotate(u),p=l.rotate(u),m=c.rotate(u),f=h.rotate(u),g=new e.P(Math.max(d.x,p.x,f.x,m.x),Math.max(d.y,p.y,f.y,m.y)),_=new e.P(Math.min(d.x,p.x,f.x,m.x),Math.min(d.y,p.y,f.y,m.y)),y=g.sub(_),x=(a.width-(o.left+o.right+i.left+i.right))/y.x,b=(a.height-(o.top+o.bottom+i.top+i.bottom))/y.y;if(b<0||x<0)return void Ye();const v=Math.min(e.aq(a.scale*Math.min(x,b)),t.maxZoom),T=e.P.convert(t.offset),w=new e.P((i.left-i.right)/2,(i.top-i.bottom)/2).rotate(e.am(n)),V=T.add(w).mult(a.scale/e.an(v));return{center:mt(a.worldSize,s.add(c).div(2).sub(V)),zoom:v,bearing:n}}class Xe{get useGlobeControls(){return!1}handlePanInertia(t,e){const i=t.mag(),r=Math.abs(ft(e));return{easingOffset:t.mult(Math.min(.75*r/i,1)),easingCenter:e.center}}handleMapControlsRollPitchBearingZoom(t,e){t.bearingDelta&&e.setBearing(e.bearing+t.bearingDelta),t.pitchDelta&&e.setPitch(e.pitch+t.pitchDelta),t.rollDelta&&e.setRoll(e.roll+t.rollDelta),t.zoomDelta&&e.setZoom(e.zoom+t.zoomDelta)}handleMapControlsPan(t,e,i){t.around.distSqr(e.centerPoint)<.01||e.setLocationAtPoint(i,t.around)}cameraForBoxAndBearing(t,e,i,r,n){return Je(t,e,i,r,n)}handleJumpToCenterZoom(t,i){t.zoom!==(void 0!==i.zoom?+i.zoom:t.zoom)&&t.setZoom(+i.zoom),void 0!==i.center&&t.setCenter(e.V.convert(i.center))}handleEaseTo(t,i){const r=t.zoom,n=t.padding,a={roll:t.roll,pitch:t.pitch,bearing:t.bearing},o={roll:void 0===i.roll?t.roll:i.roll,pitch:void 0===i.pitch?t.pitch:i.pitch,bearing:void 0===i.bearing?t.bearing:i.bearing},s=void 0!==i.zoom,l=!t.isPaddingEqual(i.padding);let c=!1;const h=s?+i.zoom:t.zoom;let u=t.centerPoint.add(i.offsetAsPoint);const d=t.screenPointToLocation(u),{center:p,zoom:m}=t.applyConstrain(e.V.convert(i.center||d),null!=h?h:r);Be(t,p);const f=pt(t.worldSize,d),g=pt(t.worldSize,p).sub(f),_=e.an(m-r);return c=m!==r,{easeFunc:s=>{if(c&&t.setZoom(e.G.number(r,m,s)),e.bm(a,o)||Qe({startEulerAngles:a,endEulerAngles:o,tr:t,k:s,useSlerp:a.roll!=o.roll}),l&&(t.interpolatePadding(n,i.padding,s),u=t.centerPoint.add(i.offsetAsPoint)),i.around)t.setLocationAtPoint(i.around,i.aroundPoint);else{const i=e.an(t.zoom-r),n=m>r?Math.min(2,_):Math.max(.5,_),a=Math.pow(n,1-s),o=mt(t.worldSize,f.add(g.mult(s*a)).mult(i));t.setLocationAtPoint(t.renderWorldCopies?o.wrap():o,u)}},isZooming:c,elevationCenter:p}}handleFlyTo(t,i){const r=void 0!==i.zoom,n=t.zoom,a=t.applyConstrain(e.V.convert(i.center||i.locationAtOffset),r?+i.zoom:n),o=a.center,s=a.zoom;Be(t,o);const l=pt(t.worldSize,i.locationAtOffset),c=pt(t.worldSize,o).sub(l),h=c.mag(),u=e.an(s-n);let d;if(void 0!==i.minZoom){const r=Math.min(+i.minZoom,n,s),a=t.applyConstrain(o,r).zoom;d=e.an(a-n)}return{easeFunc:(i,r,a,h)=>{t.setZoom(1===i?s:n+e.aq(r));const u=1===i?o:mt(t.worldSize,l.add(c.mult(a)).mult(r));t.setLocationAtPoint(t.renderWorldCopies?u.wrap():u,h)},scaleOfZoom:u,targetCenter:o,scaleOfMinZoom:d,pixelPathLength:h}}}class He{constructor(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i}}He.Replace=[1,0],He.disabled=new He(He.Replace,e.bn.transparent,[!1,!1,!1,!1]),He.unblended=new He(He.Replace,e.bn.transparent,[!0,!0,!0,!0]),He.alphaBlended=new He([1,771],e.bn.transparent,[!0,!0,!0,!0]);const qe=2305;class Ke{constructor(t,e,i){this.enable=t,this.mode=e,this.frontFace=i}}Ke.disabled=new Ke(!1,1029,qe),Ke.backCCW=new Ke(!0,1029,qe),Ke.frontCCW=new Ke(!0,1028,qe);class $e{constructor(t,e,i){this.func=t,this.mask=e,this.range=i}}$e.ReadOnly=!1,$e.ReadWrite=!0,$e.disabled=new $e(519,$e.ReadOnly,[0,1]);const ti=7680;class ei{constructor(t,e,i,r,n,a){this.test=t,this.ref=e,this.mask=i,this.fail=r,this.depthFail=n,this.pass=a}}ei.disabled=new ei({func:519,mask:0},0,0,ti,ti,ti);const ii=new WeakMap;function ri(t){var e;if(ii.has(t))return ii.get(t);{const i=null===(e=t.getParameter(t.VERSION))||void 0===e?void 0:e.startsWith("WebGL 2.0");return ii.set(t,i),i}}class ni{get awaitingQuery(){return!!this._readbackQueue}constructor(t){this._readbackWaitFrames=4,this._measureWaitFrames=6,this._texWidth=1,this._texHeight=1,this._measuredError=0,this._updateCount=0,this._lastReadbackFrame=-1e3,this._readbackQueue=null,this._cachedRenderContext=t;const i=t.context,r=i.gl;this._texFormat=r.RGBA,this._texType=r.UNSIGNED_BYTE;const n=new e.aU;n.emplaceBack(-1,-1),n.emplaceBack(2,-1),n.emplaceBack(-1,2);const a=new e.aW;a.emplaceBack(0,1,2),this._fullscreenTriangle=new ke(i.createVertexBuffer(n,ze.members),i.createIndexBuffer(a),e.aV.simpleSegment(0,0,n.length,a.length)),this._resultBuffer=new Uint8Array(4),i.activeTexture.set(r.TEXTURE1);const o=r.createTexture();r.bindTexture(r.TEXTURE_2D,o),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texImage2D(r.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=i.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(o),ri(r)&&(this._pbo=r.createBuffer(),r.bindBuffer(r.PIXEL_PACK_BUFFER,this._pbo),r.bufferData(r.PIXEL_PACK_BUFFER,4,r.STREAM_READ),r.bindBuffer(r.PIXEL_PACK_BUFFER,null))}destroy(){const t=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),t.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(t,e){const i=this._updateCount;return this._readbackQueue?i>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():i>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(t,e),this._updateCount++,this._measuredError}_bindFramebuffer(){const t=this._cachedRenderContext.context,e=t.gl;t.activeTexture.set(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,this._fbo.colorAttachment.get()),t.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(t,i){const r=this._cachedRenderContext.context,n=r.gl;if(this._bindFramebuffer(),r.viewport.set([0,0,this._texWidth,this._texHeight]),r.clear({color:e.bn.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(r,n.TRIANGLES,$e.disabled,ei.disabled,He.unblended,Ke.disabled,((t,e)=>({u_input:t,u_output_expected:e}))(t,i),null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&ri(n)){n.bindBuffer(n.PIXEL_PACK_BUFFER,this._pbo),n.readBuffer(n.COLOR_ATTACHMENT0),n.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),n.bindBuffer(n.PIXEL_PACK_BUFFER,null);const t=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);n.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:t}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){const t=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&ri(t)){const i=t.clientWaitSync(this._readbackQueue.sync,0,0);if(i===t.WAIT_FAILED)return e.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(i===t.TIMEOUT_EXPIRED)return;t.bindBuffer(t.PIXEL_PACK_BUFFER,this._pbo),t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),t.bindBuffer(t.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),t.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=ni._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(t){let e=0;return e+=t[0]/256,e+=t[1]/65536,e+=t[2]/16777216,t[3]<127&&(e=-e),e/128}}const ai=e.a5/128;function oi(t,i){const r=void 0!==t.granularity?Math.max(t.granularity,1):1,n=r+(t.generateBorders?2:0),a=r+(t.extendToNorthPole||t.generateBorders?1:0)+(t.extendToSouthPole||t.generateBorders?1:0),o=n+1,s=a+1,l=t.generateBorders?-1:0,c=t.generateBorders||t.extendToNorthPole?-1:0,h=r+(t.generateBorders?1:0),u=r+(t.generateBorders||t.extendToSouthPole?1:0),d=o*s,p=n*a*6,m=o*s>65536;if(m&&"16bit"===i)throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");const f=m||"32bit"===i,g=new Int16Array(2*d);let _=0;for(let i=c;i<=u;i++)for(let n=l;n<=h;n++){let a=n/r*e.a5;-1===n&&(a=-ai),n===r+1&&(a=e.a5+ai);let o=i/r*e.a5;-1===i&&(o=t.extendToNorthPole?e.bp:-ai),i===r+1&&(o=t.extendToSouthPole?e.bq:e.a5+ai),g[_++]=a,g[_++]=o}const y=f?new Uint32Array(p):new Uint16Array(p);let x=0;for(let t=0;t<a;t++)for(let e=0;e<n;e++){const i=e+1+t*o,r=e+(t+1)*o,n=e+1+(t+1)*o;y[x++]=e+t*o,y[x++]=r,y[x++]=i,y[x++]=i,y[x++]=r,y[x++]=n}return{vertices:g.buffer.slice(0),indices:y.buffer.slice(0),uses32bitIndices:f}}const si=new e.aT({fill:new e.br(128,2),line:new e.br(512,0),tile:new e.br(128,32),stencil:new e.br(128,1),circle:3});class li{constructor(){this._tileMeshCache={},this._errorCorrectionUsable=0,this._errorMeasurementLastValue=0,this._errorCorrectionPreviousValue=0,this._errorMeasurementLastChangeTime=-1e3}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return Fe.projectionGlobe}get vertexShaderPreludeCode(){return Fe.projectionMercator.vertexSource}get subdivisionGranularity(){return si}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(t){this._errorMeasurement||(this._errorMeasurement=new ni(t));const i=e.X(this._errorQueryLatitudeDegrees),r=2*Math.atan(Math.exp(Math.PI-i*Math.PI*2))-.5*Math.PI,n=this._errorMeasurement.updateErrorLoop(i,r),a=c();n!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=n,this._errorMeasurementLastChangeTime=a);const o=Math.min(Math.max((a-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=e.bs(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,e.bt(o))}_getMeshKey(t){return`${t.granularity.toString(36)}_${t.generateBorders?"b":""}${t.extendToNorthPole?"n":""}${t.extendToSouthPole?"s":""}`}getMeshFromTileID(t,e,i,r,n){const a=("stencil"===n?si.stencil:si.tile).getGranularityForZoomLevel(e.z);return this._getMesh(t,{granularity:a,generateBorders:i,extendToNorthPole:0===e.y&&r,extendToSouthPole:e.y===(1<<e.z)-1&&r})}_getMesh(t,i){const r=this._getMeshKey(i);if(r in this._tileMeshCache)return this._tileMeshCache[r];const n=function(t,i){const r=oi(i,"16bit"),n=e.aU.deserialize({arrayBuffer:r.vertices,length:r.vertices.byteLength/2/2}),a=e.aW.deserialize({arrayBuffer:r.indices,length:r.indices.byteLength/2/3});return new ke(t.createVertexBuffer(n,ze.members),t.createIndexBuffer(a),e.aV.simpleSegment(0,0,n.length,a.length))}(t,i);return this._tileMeshCache[r]=n,n}recalculate(t){}hasTransition(){const t=c();let e=!1;return e=e||(t-this._errorMeasurementLastChangeTime)/1e3<.7,e=e||this._errorMeasurement&&this._errorMeasurement.awaitingQuery,e}setErrorQueryLatitudeDegrees(t){this._errorQueryLatitudeDegrees=t}}const ci=new e.t({type:new e.D(e.u.projection.type)});class hi extends e.E{constructor(t){super(),this._transitionable=new e.x(ci,void 0),this.setProjection(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new e.H(0)),this._mercatorProjection=new De,this._verticalPerspectiveProjection=new li}get transitionState(){const t=this.properties.get("type");if("string"==typeof t&&"mercator"===t)return 0;if("string"==typeof t&&"vertical-perspective"===t)return 1;if(t instanceof e.bu){if("vertical-perspective"===t.from&&"mercator"===t.to)return 1-t.transition;if("mercator"===t.from&&"vertical-perspective"===t.to)return t.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get latitudeErrorCorrectionRadians(){return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}updateGPUdependent(t){this._mercatorProjection.updateGPUdependent(t),this._verticalPerspectiveProjection.updateGPUdependent(t)}getMeshFromTileID(t,e,i,r,n){return this.currentProjection.getMeshFromTileID(t,e,i,r,n)}setProjection(t){this._transitionable.setValue("type",(null==t?void 0:t.type)||"mercator")}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}setErrorQueryLatitudeDegrees(t){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(t),this._mercatorProjection.setErrorQueryLatitudeDegrees(t)}}function ui(t){const e=mi(t.worldSize,t.center.lat);return 2*Math.PI*e}function di(t,i,r,n,a){const o=1/(1<<a),s=i/e.a5*o+n*o,l=e.bx((t/e.a5*o+r*o)*Math.PI*2+Math.PI,2*Math.PI),c=2*Math.atan(Math.exp(Math.PI-s*Math.PI*2))-.5*Math.PI,h=Math.cos(c),u=new Float64Array(3);return u[0]=Math.sin(l)*h,u[1]=Math.sin(c),u[2]=Math.cos(l)*h,u}function pi(t){return function(t,e){const i=Math.cos(e),r=new Float64Array(3);return r[0]=Math.sin(t)*i,r[1]=Math.sin(e),r[2]=Math.cos(t)*i,r}(t.lng*Math.PI/180,t.lat*Math.PI/180)}function mi(t,e){return t/(2*Math.PI)/Math.cos(e*Math.PI/180)}function fi(t){const i=Math.asin(t[1])/Math.PI*180,r=Math.sqrt(t[0]*t[0]+t[2]*t[2]);if(r>1e-6){const n=t[0]/r,a=Math.acos(t[2]/r),o=(n>0?a:-a)/Math.PI*180;return new e.V(e.W(o,-180,180),i)}return new e.V(0,i)}function gi(t){return Math.cos(t*Math.PI/180)}function _i(t,i){const r=gi(t),n=gi(i);return e.aq(n/r)}function yi(t,i){const r=t.rotate(i.bearingInRadians),n=i.zoom+_i(i.center.lat,0),a=e.bs(1/gi(i.center.lat),1/gi(Math.min(Math.abs(i.center.lat),60)),e.bv(n,7,3,0,1)),o=360/ui({worldSize:i.worldSize,center:{lat:i.center.lat}});return new e.V(i.center.lng-r.x*o*a,e.ak(i.center.lat+r.y*o,-e.al,e.al))}function xi(t){const e=.5*t,i=Math.sin(e),r=Math.cos(e);return Math.log(i+r)-Math.log(r-i)}function bi(t,i,r,n){const a=t.lat+r*n;if(Math.abs(r)>1){const o=(Math.sign(t.lat+r)!==Math.sign(t.lat)?-Math.abs(t.lat):Math.abs(t.lat))*Math.PI/180,s=Math.abs(t.lat+r)*Math.PI/180,l=xi(o+n*(s-o)),c=xi(o),h=xi(s);return new e.V(t.lng+i*((l-c)/(h-c)),a)}return new e.V(t.lng+i*n,a)}class vi{constructor(t){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=t}swapBuffers(){if(!this._hadAnyChanges)return;const t=this._cachePrevious;this._cachePrevious=this._cache,this._cache=t,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(t,e,i,r){const n=`${t.z}_${t.x}_${t.y}_${(null==r?void 0:r.terrain)?"t":""}`,a=this._cache.get(n);if(a)return a;const o=this._cachePrevious.get(n);if(o)return this._cache.set(n,o),o;const s=this._boundingVolumeFactory(t,e,i,r);return this._cache.set(n,s),this._hadAnyChanges=!0,s}}class Ti{constructor(t,e,i,r){this.min=i,this.max=r,this.points=t,this.planes=e}static fromAabb(t,e){const i=[];for(let r=0;r<8;r++)i.push([1&~r?t[0]:e[0],1==(r>>1&1)?e[1]:t[1],1==(r>>2&1)?e[2]:t[2]]);return new Ti(i,[[-1,0,0,e[0]],[1,0,0,-t[0]],[0,-1,0,e[1]],[0,1,0,-t[1]],[0,0,-1,e[2]],[0,0,1,-t[2]]],t,e)}static fromCenterSizeAngles(t,i,r){const n=e.bz([],r[0],r[1],r[2]),a=e.bA([],[i[0],0,0],n),o=e.bA([],[0,i[1],0],n),s=e.bA([],[0,0,i[2]],n),l=[...t],c=[...t];for(let e=0;e<8;e++)for(let i=0;i<3;i++){const r=t[i]+a[i]*(1&~e?-1:1)+o[i]*(1==(e>>1&1)?1:-1)+s[i]*(1==(e>>2&1)?1:-1);l[i]=Math.min(l[i],r),c[i]=Math.max(c[i],r)}const h=[];for(let i=0;i<8;i++){const r=[...t];e.a_(r,r,e.aZ([],a,1&~i?-1:1)),e.a_(r,r,e.aZ([],o,1==(i>>1&1)?1:-1)),e.a_(r,r,e.aZ([],s,1==(i>>2&1)?1:-1)),h.push(r)}return new Ti(h,[[...a,-e.b3(a,h[0])],[...o,-e.b3(o,h[0])],[...s,-e.b3(s,h[0])],[-a[0],-a[1],-a[2],-e.b3(a,h[7])],[-o[0],-o[1],-o[2],-e.b3(o,h[7])],[-s[0],-s[1],-s[2],-e.b3(s,h[7])]],l,c)}intersectsFrustum(t){let e=!0;const i=this.points.length,r=this.planes.length,n=t.planes.length,a=t.points.length;for(let r=0;r<n;r++){const n=t.planes[r];let a=0;for(let t=0;t<i;t++){const e=this.points[t];n[0]*e[0]+n[1]*e[1]+n[2]*e[2]+n[3]>=0&&a++}if(0===a)return 0;a<i&&(e=!1)}if(e)return 2;for(let e=0;e<r;e++){const i=this.planes[e];let r=0;for(let e=0;e<a;e++){const n=t.points[e];i[0]*n[0]+i[1]*n[1]+i[2]*n[2]+i[3]>=0&&r++}if(0===r)return 0}return 1}intersectsPlane(t){const e=this.points.length;let i=0;for(let r=0;r<e;r++){const e=this.points[r];t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]>=0&&i++}return i===e?2:0===i?0:1}}function wi(t,e,i){const r=t-e;return r<0?-r:Math.max(0,r-i)}function Vi(t,e,i,r,n){const a=t-i;let o;return o=a<0?Math.min(-a,1+a-n):a>n?Math.min(Math.max(a-n,0),1-a):0,Math.max(o,wi(e,r,n))}class Ri{constructor(){this._boundingVolumeCache=new vi(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(t,e,i,r){const n=1<<i.z,a=1/n,o=i.x/n,s=i.y/n;let l=2;return l=Math.min(l,Vi(t,e,o,s,a)),l=Math.min(l,Vi(t,e,o+.5,-s-a,a)),l=Math.min(l,Vi(t,e,o+.5,2-s-a,a)),l}getWrap(t,e,i){const r=1<<e.z,n=1/r,a=e.x/r,o=wi(t.x,a,n),s=wi(t.x,a-1,n),l=wi(t.x,a+1,n),c=Math.min(o,s,l);return c===l?1:c===s?-1:0}allowVariableZoom(t,e){return wt(t,e)>4}allowWorldCopies(){return!1}getTileBoundingVolume(t,e,i,r){return this._boundingVolumeCache.getTileBoundingVolume(t,e,i,r)}_computeTileBoundingVolume(t,i,r,n){var a,o;let s=0,l=0;if(null==n?void 0:n.terrain){const c=new e.a2(t.z,i,t.z,t.x,t.y),h=n.terrain.getMinMaxElevation(c);s=null!==(a=h.minElevation)&&void 0!==a?a:Math.min(0,r),l=null!==(o=h.maxElevation)&&void 0!==o?o:Math.max(0,r)}if(s/=e.bC,l/=e.bC,s+=1,l+=1,t.z<=0)return Ti.fromAabb([-l,-l,-l],[l,l,l]);if(1===t.z)return Ti.fromAabb([0===t.x?-l:0,0===t.y?0:-l,-l],[0===t.x?0:l,0===t.y?l:0,l]);{const i=[di(0,0,t.x,t.y,t.z),di(e.a5,0,t.x,t.y,t.z),di(e.a5,e.a5,t.x,t.y,t.z),di(0,e.a5,t.x,t.y,t.z)],r=[];for(const t of i)r.push(e.aZ([],t,l));if(l!==s)for(const t of i)r.push(e.aZ([],t,s));0===t.y&&r.push([0,1,0]),t.y===(1<<t.z)-1&&r.push([0,-1,0]);const n=[1,1,1],a=[-1,-1,-1];for(const t of r)for(let e=0;e<3;e++)n[e]=Math.min(n[e],t[e]),a[e]=Math.max(a[e],t[e]);const o=di(e.a5/2,e.a5/2,t.x,t.y,t.z),c=e.b2([],[0,1,0],o);e.b1(c,c);const h=e.b2([],o,c);e.b1(h,h);const u=e.b2([],i[2],i[1]);e.b1(u,u);const d=e.b2([],i[0],i[3]);e.b1(d,d),r.push(e.aZ([],o,l)),t.y>=(1<<t.z)/2&&r.push(e.aZ([],di(e.a5/2,0,t.x,t.y,t.z),l)),t.y<(1<<t.z)/2&&r.push(e.aZ([],di(e.a5/2,e.a5,t.x,t.y,t.z),l));const p=Mi(o,r),m=Mi(h,r),f=[-o[0],-o[1],-o[2],p.max],g=[o[0],o[1],o[2],-p.min],_=[-h[0],-h[1],-h[2],m.max],y=[h[0],h[1],h[2],-m.min],x=[...u,0],b=[...d,0],v=[];return 0===t.y?v.push(e.bB(b,x,f),e.bB(b,x,g)):v.push(e.bB(_,x,f),e.bB(_,x,g),e.bB(_,b,f),e.bB(_,b,g)),t.y===(1<<t.z)-1?v.push(e.bB(b,x,f),e.bB(b,x,g)):v.push(e.bB(y,x,f),e.bB(y,x,g),e.bB(y,b,f),e.bB(y,b,g)),new Ti(v,[f,g,_,y,x,b],n,a)}}}function Mi(t,i){let r=1/0,n=-1/0;for(const a of i){const i=e.b3(t,a);r=Math.min(r,i),n=Math.max(n,i)}return{min:r,max:n}}class Ui{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,e,i){return this._helper.interpolatePadding(t,e,i)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,e){this._helper.resize(t,e)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,e){this._helper.overrideNearFarZ(t,e)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t){}constructor(t){this._cachedClippingPlane=e.bD(),this._projectionMatrix=e.bh(),this._globeViewProjMatrix32f=e.bg(),this._globeViewProjMatrixNoCorrection=e.bh(),this._globeViewProjMatrixNoCorrectionInverted=e.bh(),this._globeProjMatrixInverted=e.bh(),this._cameraPosition=e.by(),this._globeLatitudeErrorCorrectionRadians=0,this.defaultConstrain=(t,i)=>{const r=e.ak(t.lat,-e.al,e.al),n=e.ak(+i,this.minZoom+_i(0,r),this.maxZoom);return{center:new e.V(t.lng,r),zoom:n}},this.applyConstrain=(t,e)=>this._helper.applyConstrain(t,e),this._helper=new Oe({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(t,e)=>this.defaultConstrain(t,e)},t),this._coveringTilesDetailsProvider=new Ri}clone(){const t=new Ui;return t.apply(this,!1),t}apply(t,e,i){this._globeLatitudeErrorCorrectionRadians=i||0,this._helper.apply(t,e)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){const t=e.by();return t[0]=this._cameraPosition[0],t[1]=this._cameraPosition[1],t[2]=this._cameraPosition[2],t}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(t){const{overscaledTileID:e,applyGlobeMatrix:i}=t,r=this._helper.getMercatorTileCoordinates(e);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:r,clippingPlane:this._cachedClippingPlane,projectionTransition:i?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(t){const i=this.pitchInRadians,r=this.cameraToCenterDistance/t,n=Math.sin(i)*r,a=Math.cos(i)*r+1,o=1/Math.sqrt(n*n+a*a)*1;let s=-n,l=a;const c=Math.sqrt(s*s+l*l);s/=c,l/=c;const h=[0,s,l];e.bE(h,h,[0,0,0],-this.bearingInRadians),e.bF(h,h,[0,0,0],-1*this.center.lat*Math.PI/180),e.bG(h,h,[0,0,0],this.center.lng*Math.PI/180);const u=1/e.b5(h);return e.aZ(h,h,u),[...h,-o*u]}isLocationOccluded(t){return!this.isSurfacePointVisible(pi(t))}transformLightDirection(t){const i=this._helper._center.lng*Math.PI/180,r=this._helper._center.lat*Math.PI/180,n=Math.cos(r),a=[Math.sin(i)*n,Math.sin(r),Math.cos(i)*n],o=[a[2],0,-a[0]],s=[0,0,0];e.b2(s,o,a),e.b1(o,o),e.b1(s,s);const l=[0,0,0];return e.b1(l,[o[0]*t[0]+s[0]*t[1]+a[0]*t[2],o[1]*t[0]+s[1]*t[1]+a[1]*t[2],o[2]*t[0]+s[2]*t[1]+a[2]*t[2]]),l}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(t,i,r){const n=function(t,i,r){const n=1/(1<<r.z);return new e.a6(t/e.a5*n+r.x*n,i/e.a5*n+r.y*n)}(t,i,r.canonical),a=(o=n.y,[e.bx(n.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-o*Math.PI*2))-.5*Math.PI]);var o;return this.getCircleRadiusCorrection()/Math.cos(a[1])}projectTileCoordinates(t,i,r,n){const a=r.canonical,o=di(t,i,a.x,a.y,a.z),s=1+(n?n(t,i):0)/e.bC,l=[o[0]*s,o[1]*s,o[2]*s,1];e.aE(l,l,this._globeViewProjMatrixNoCorrection);const c=this._cachedClippingPlane,h=c[0]*o[0]+c[1]*o[1]+c[2]*o[2]+c[3]<0;return{point:new e.P(l[0]/l[3],l[1]/l[3]),signedDistanceFromCamera:l[3],isOccluded:h}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;const t=mi(this.worldSize,this.center.lat),i=e.bi(),r=e.bi();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*t),e.bc(i,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);const n=this.centerOffset;i[8]=2*-n.x/this._helper._width,i[9]=2*n.y/this._helper._height,this._projectionMatrix=e.bd(i),this._globeProjMatrixInverted=e.bi(),e.ay(this._globeProjMatrixInverted,i),e.O(i,i,[0,0,-this.cameraToCenterDistance]),e.be(i,i,this.rollInRadians),e.bf(i,i,-this.pitchInRadians),e.be(i,i,this.bearingInRadians),e.O(i,i,[0,0,-t]);const a=e.by();a[0]=t,a[1]=t,a[2]=t,e.bf(r,i,this.center.lat*Math.PI/180),e.bH(r,r,-this.center.lng*Math.PI/180),e.Q(r,r,a),this._globeViewProjMatrixNoCorrection=r,e.bf(i,i,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),e.bH(i,i,-this.center.lng*Math.PI/180),e.Q(i,i,a),this._globeViewProjMatrix32f=new Float32Array(i),this._globeViewProjMatrixNoCorrectionInverted=e.bi(),e.ay(this._globeViewProjMatrixNoCorrectionInverted,r);const o=e.by();this._cameraPosition=e.by(),this._cameraPosition[2]=this.cameraToCenterDistance/t,e.bE(this._cameraPosition,this._cameraPosition,o,-this.rollInRadians),e.bF(this._cameraPosition,this._cameraPosition,o,this.pitchInRadians),e.bE(this._cameraPosition,this._cameraPosition,o,-this.bearingInRadians),e.a_(this._cameraPosition,this._cameraPosition,[0,0,1]),e.bF(this._cameraPosition,this._cameraPosition,o,-this.center.lat*Math.PI/180),e.bG(this._cameraPosition,this._cameraPosition,o,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(t);const s=e.bd(this._globeViewProjMatrixNoCorrectionInverted);e.Q(s,s,[1,1,-1]),this._cachedFrustum=Ae.fromInvProjectionMatrix(s,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(t){e.w("calculateFogMatrix is not supported on globe projection.");const i=e.bi();return e.ao(i),i}getVisibleUnwrappedCoordinates(t){return[new e.ba(0,t)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){t&&e.w("terrain is not fully supported on vertical perspective projection."),this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,i){if(!this._globeViewProjMatrixNoCorrection)return 1;const r=pi(t);e.aZ(r,r,1+i/e.bC);const n=e.bD();return e.aE(n,[r[0],r[1],r[2],1],this._globeViewProjMatrixNoCorrection),n[2]/n[3]}populateCache(t){}getBounds(){const t=.5*this.width,i=.5*this.height,r=[new e.P(0,0),new e.P(t,0),new e.P(this.width,0),new e.P(this.width,i),new e.P(this.width,this.height),new e.P(t,this.height),new e.P(0,this.height),new e.P(0,i)],n=[];for(const t of r)n.push(this.unprojectScreenPoint(t));let a=0,o=0,s=0,l=0;const c=this.center;for(const t of n){const i=e.bI(c.lng,t.lng),r=e.bI(c.lat,t.lat);i<o&&(o=i),i>a&&(a=i),r<l&&(l=r),r>s&&(s=r)}const h=[c.lng+o,c.lat+l,c.lng+a,c.lat+s];return this.isSurfacePointOnScreen([0,1,0])&&(h[3]=90,h[0]=-180,h[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(h[1]=-90,h[0]=-180,h[2]=180),new O(h)}calculateCenterFromCameraLngLatAlt(t,e,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(t,e,i,r)}setLocationAtPoint(t,i){const r=pi(this.unprojectScreenPoint(i)),n=pi(t),a=e.by();e.bJ(a);const o=e.by();e.bG(o,r,a,-this.center.lng*Math.PI/180),e.bF(o,o,a,this.center.lat*Math.PI/180);const s=n[0]*n[0]+n[2]*n[2],l=o[0]*o[0];if(s<l)return;const c=Math.sqrt(s-l),h=-c,u=e.bK(n[0],n[2],o[0],c),d=e.bK(n[0],n[2],o[0],h),p=e.by();e.bG(p,n,a,-u);const m=e.bK(p[1],p[2],o[1],o[2]),f=e.by();e.bG(f,n,a,-d);const g=e.bK(f[1],f[2],o[1],o[2]),_=.5*Math.PI,y=m>=-_&&m<=_,x=g>=-_&&g<=_;let b,v;if(y&&x){const t=this.center.lng*Math.PI/180,i=this.center.lat*Math.PI/180;e.bL(u,t)+e.bL(m,i)<e.bL(d,t)+e.bL(g,i)?(b=u,v=m):(b=d,v=g)}else if(y)b=u,v=m;else{if(!x)return;b=d,v=g}const T=b/Math.PI*180,w=v/Math.PI*180,V=this.center.lat;this.setCenter(new e.V(T,e.ak(w,-90,90))),this.setZoom(this.zoom+_i(V,this.center.lat))}locationToScreenPoint(t,i){const r=pi(t);if(i){const n=i.getElevationForLngLatZoom(t,this._helper._tileZoom);e.aZ(r,r,1+n/e.bC)}return this._projectSurfacePointToScreen(r)}_projectSurfacePointToScreen(t){const i=e.bD();return e.aE(i,[...t,1],this._globeViewProjMatrixNoCorrection),i[0]/=i[3],i[1]/=i[3],new e.P((.5*i[0]+.5)*this.width,(.5*-i[1]+.5)*this.height)}screenPointToMercatorCoordinate(t,i){if(i){const e=i.pointCoordinate(t);if(e)return e}return e.a6.fromLngLat(this.unprojectScreenPoint(t))}screenPointToLocation(t,e){var i;return null===(i=this.screenPointToMercatorCoordinate(t,e))||void 0===i?void 0:i.toLngLat()}isPointOnMapSurface(t,e){const i=this._cameraPosition,r=this.getRayDirectionFromPixel(t);return!!this.rayPlanetIntersection(i,r)}getRayDirectionFromPixel(t){const i=e.bD();i[0]=t.x/this.width*2-1,i[1]=-1*(t.y/this.height*2-1),i[2]=1,i[3]=1,e.aE(i,i,this._globeViewProjMatrixNoCorrectionInverted),i[0]/=i[3],i[1]/=i[3],i[2]/=i[3];const r=e.by();r[0]=i[0]-this._cameraPosition[0],r[1]=i[1]-this._cameraPosition[1],r[2]=i[2]-this._cameraPosition[2];const n=e.by();return e.b1(n,r),n}isSurfacePointVisible(t){const e=this._cachedClippingPlane;return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]>=0}isSurfacePointOnScreen(t){if(!this.isSurfacePointVisible(t))return!1;const i=e.bD();return e.aE(i,[...t,1],this._globeViewProjMatrixNoCorrection),i[0]/=i[3],i[1]/=i[3],i[2]/=i[3],i[0]>-1&&i[0]<1&&i[1]>-1&&i[1]<1&&i[2]>-1&&i[2]<1}rayPlanetIntersection(t,i){const r=e.b3(t,i),n=e.by(),a=e.by();e.aZ(a,i,r),e.b0(n,t,a);const o=1-e.b3(n,n);if(o<0)return null;const s=e.b3(t,t)-1,l=-r+(r<0?1:-1)*Math.sqrt(o),c=s/l,h=l;return{tMin:Math.min(c,h),tMax:Math.max(c,h)}}unprojectScreenPoint(t){const i=this._cameraPosition,r=this.getRayDirectionFromPixel(t),n=this.rayPlanetIntersection(i,r);if(n){const t=e.by();e.a_(t,i,[r[0]*n.tMin,r[1]*n.tMin,r[2]*n.tMin]);const a=e.by();return e.b1(a,t),fi(a)}const a=this._cachedClippingPlane,o=a[0]*r[0]+a[1]*r[1]+a[2]*r[2],s=-e.b9(a,i)/o,l=e.by();if(s>0)e.a_(l,i,[r[0]*s,r[1]*s,r[2]*s]);else{const t=e.by();e.a_(t,i,[2*r[0],2*r[1],2*r[2]]);const n=e.b9(this._cachedClippingPlane,t);e.b0(l,t,[this._cachedClippingPlane[0]*n,this._cachedClippingPlane[1]*n,this._cachedClippingPlane[2]*n])}const c=function(t){const i=e.by();return i[0]=t[0]*-t[3],i[1]=t[1]*-t[3],i[2]=t[2]*-t[3],{center:i,radius:Math.sqrt(1-t[3]*t[3])}}(a);return fi(function(t,i,r){const n=e.by();e.b0(n,r,t);const a=e.by();return e.bw(a,t,n,i/e.b7(n)),a}(c.center,c.radius,l))}getMatrixForModel(t,i){const r=e.V.convert(t),n=1/e.bC,a=e.bh();return e.bH(a,a,r.lng/180*Math.PI),e.bf(a,a,-r.lat/180*Math.PI),e.O(a,a,[0,0,1+i/e.bC]),e.bf(a,a,.5*Math.PI),e.Q(a,a,[n,n,n]),a}getProjectionDataForCustomLayer(t=!0){const i=this.getProjectionData({overscaledTileID:new e.a2(0,0,0,0,0),applyGlobeMatrix:t});return i.tileMercatorCoords=[0,0,1,1],i}getFastPathSimpleProjectionMatrix(t){}}class Si{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,e,i){return this._helper.interpolatePadding(t,e,i)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,e,i=!0){this._helper.resize(t,e,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,e){this._helper.overrideNearFarZ(t,e)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(t,e){this._globeness=t,this._globeLatitudeErrorCorrectionRadians=e,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(t){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this.defaultConstrain=(t,e)=>this.currentTransform.defaultConstrain(t,e),this.applyConstrain=(t,e)=>this._helper.applyConstrain(t,e),this._helper=new Oe({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(t,e)=>this.defaultConstrain(t,e)},t),this._globeness=1,this._mercatorTransform=new Ge,this._verticalPerspectiveTransform=new Ui}clone(){const t=new Si;return t._globeness=this._globeness,t._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,t.apply(this,!1),t}apply(t,e){this._helper.apply(t,e),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1,this._globeLatitudeErrorCorrectionRadians)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(t){const e=this._mercatorTransform.getProjectionData(t),i=this._verticalPerspectiveTransform.getProjectionData(t);return{mainMatrix:this.isGlobeRendering?i.mainMatrix:e.mainMatrix,clippingPlane:i.clippingPlane,tileMercatorCoords:i.tileMercatorCoords,projectionTransition:t.applyGlobeMatrix?this._globeness:0,fallbackMatrix:e.fallbackMatrix}}isLocationOccluded(t){return this.currentTransform.isLocationOccluded(t)}transformLightDirection(t){return this.currentTransform.transformLightDirection(t)}getPixelScale(){return e.bs(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return e.bs(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(t,i,r){const n=this._mercatorTransform.getPitchedTextCorrection(t,i,r),a=this._verticalPerspectiveTransform.getPitchedTextCorrection(t,i,r);return e.bs(n,a,this._globeness)}projectTileCoordinates(t,e,i,r){return this.currentTransform.projectTileCoordinates(t,e,i,r)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,!1,this._globeLatitudeErrorCorrectionRadians),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(t){return this.currentTransform.calculateFogMatrix(t)}getVisibleUnwrappedCoordinates(t){return this.currentTransform.getVisibleUnwrappedCoordinates(t)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(t){this._mercatorTransform.recalculateZoomAndCenter(t),this._verticalPerspectiveTransform.recalculateZoomAndCenter(t)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,e){return this.currentTransform.lngLatToCameraDepth(t,e)}populateCache(t){this._mercatorTransform.populateCache(t),this._verticalPerspectiveTransform.populateCache(t)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(t,e,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(t,e,i,r)}setLocationAtPoint(t,e){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(t,e),void this.apply(this._mercatorTransform,!1);this._verticalPerspectiveTransform.setLocationAtPoint(t,e),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(t,e){return this.currentTransform.locationToScreenPoint(t,e)}screenPointToMercatorCoordinate(t,e){return this.currentTransform.screenPointToMercatorCoordinate(t,e)}screenPointToLocation(t,e){return this.currentTransform.screenPointToLocation(t,e)}isPointOnMapSurface(t,e){return this.currentTransform.isPointOnMapSurface(t,e)}getRayDirectionFromPixel(t){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(t)}getMatrixForModel(t,e){return this.currentTransform.getMatrixForModel(t,e)}getProjectionDataForCustomLayer(t=!0){const e=this._mercatorTransform.getProjectionDataForCustomLayer(t);if(!this.isGlobeRendering)return e;const i=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(t);return i.fallbackMatrix=e.mainMatrix,i}getFastPathSimpleProjectionMatrix(t){return this.currentTransform.getFastPathSimpleProjectionMatrix(t)}}class Ni{get useGlobeControls(){return!0}handlePanInertia(t,i){const r=yi(t,i);return Math.abs(r.lng-i.center.lng)>180&&(r.lng=i.center.lng+179.5*Math.sign(r.lng-i.center.lng)),{easingCenter:r,easingOffset:new e.P(0,0)}}handleMapControlsRollPitchBearingZoom(t,i){const r=t.around,n=i.screenPointToLocation(r);t.bearingDelta&&i.setBearing(i.bearing+t.bearingDelta),t.pitchDelta&&i.setPitch(i.pitch+t.pitchDelta),t.rollDelta&&i.setRoll(i.roll+t.rollDelta);const a=i.zoom;t.zoomDelta&&i.setZoom(i.zoom+t.zoomDelta);const o=i.zoom-a;if(0===o)return;const s=e.bI(i.center.lng,n.lng),l=s/(Math.abs(s/180)+1),c=e.bI(i.center.lat,n.lat),h=i.getRayDirectionFromPixel(r),u=i.cameraPosition,d=-1*e.b3(u,h),p=e.by();e.a_(p,u,[h[0]*d,h[1]*d,h[2]*d]);const m=e.b5(p)-1,f=Math.exp(.5*-Math.max(m-.3,0)),g=mi(i.worldSize,i.center.lat)/Math.min(i.width,i.height),_=e.bv(g,.9,.5,1,.25),y=(1-e.an(-o))*Math.min(f,_),x=i.center.lat,b=i.zoom,v=new e.V(i.center.lng+l*y,e.ak(i.center.lat+c*y,-e.al,e.al));i.setLocationAtPoint(n,r);const T=i.center,w=e.bv(Math.abs(s),45,85,0,1),V=e.bv(g,.75,.35,0,1),R=Math.pow(Math.max(w,V),.25),M=e.bI(T.lng,v.lng),U=e.bI(T.lat,v.lat);i.setCenter(new e.V(T.lng+M*R,T.lat+U*R).wrap()),i.setZoom(b+_i(x,i.center.lat))}handleMapControlsPan(t,e,i){if(!t.panDelta)return;const r=e.center.lat,n=e.zoom;e.setCenter(yi(t.panDelta,e).wrap()),e.setZoom(n+_i(r,e.center.lat))}cameraForBoxAndBearing(t,i,r,n,a){const o=Je(t,i,r,n,a),s=i.left/a.width*2-1,l=(a.width-i.right)/a.width*2-1,c=i.top/a.height*-2+1,h=(a.height-i.bottom)/a.height*-2+1,u=e.bI(r.getWest(),r.getEast())<0,d=u?r.getEast():r.getWest(),p=u?r.getWest():r.getEast(),m=Math.max(r.getNorth(),r.getSouth()),f=Math.min(r.getNorth(),r.getSouth()),g=d+.5*e.bI(d,p),_=m+.5*e.bI(m,f),y=a.clone();y.setCenter(o.center),y.setBearing(o.bearing),y.setPitch(0),y.setRoll(0),y.setZoom(o.zoom);const x=y.modelViewProjectionMatrix,b=[pi(r.getNorthWest()),pi(r.getNorthEast()),pi(r.getSouthWest()),pi(r.getSouthEast()),pi(new e.V(p,_)),pi(new e.V(d,_)),pi(new e.V(g,m)),pi(new e.V(g,f))],v=pi(o.center);let T=Number.POSITIVE_INFINITY;for(const t of b)s<0&&(T=Ni.getLesserNonNegativeNonNull(T,Ni.solveVectorScale(t,v,x,"x",s))),l>0&&(T=Ni.getLesserNonNegativeNonNull(T,Ni.solveVectorScale(t,v,x,"x",l))),c>0&&(T=Ni.getLesserNonNegativeNonNull(T,Ni.solveVectorScale(t,v,x,"y",c))),h<0&&(T=Ni.getLesserNonNegativeNonNull(T,Ni.solveVectorScale(t,v,x,"y",h)));if(Number.isFinite(T)&&0!==T)return o.zoom=Math.min(y.zoom+e.aq(T),t.maxZoom),o;Ye()}handleJumpToCenterZoom(t,i){const r=t.center.lat,n=t.applyConstrain(i.center?e.V.convert(i.center):t.center,t.zoom).center;t.setCenter(n.wrap());const a=void 0!==i.zoom?+i.zoom:t.zoom+_i(r,n.lat);t.zoom!==a&&t.setZoom(a)}handleEaseTo(t,i){const r=t.zoom,n=t.center,a=t.padding,o={roll:t.roll,pitch:t.pitch,bearing:t.bearing},s={roll:void 0===i.roll?t.roll:i.roll,pitch:void 0===i.pitch?t.pitch:i.pitch,bearing:void 0===i.bearing?t.bearing:i.bearing},l=void 0!==i.zoom,c=!t.isPaddingEqual(i.padding);let h=!1;const u=i.center?e.V.convert(i.center):n,d=t.applyConstrain(u,r).center;Be(t,d);const p=t.clone();p.setCenter(d),p.setZoom(l?+i.zoom:r+_i(n.lat,u.lat)),p.setBearing(i.bearing);const m=new e.P(e.ak(t.centerPoint.x+i.offsetAsPoint.x,0,t.width),e.ak(t.centerPoint.y+i.offsetAsPoint.y,0,t.height));p.setLocationAtPoint(d,m);const f=(i.offset&&i.offsetAsPoint.mag())>0?p.center:d,g=l?+i.zoom:r+_i(n.lat,f.lat),_=r+_i(n.lat,0),y=g+_i(f.lat,0),x=e.bI(n.lng,f.lng),b=e.bI(n.lat,f.lat),v=e.an(y-_);return h=g!==r,{easeFunc:r=>{if(e.bm(o,s)||Qe({startEulerAngles:o,endEulerAngles:s,tr:t,k:r,useSlerp:o.roll!=s.roll}),c&&t.interpolatePadding(a,i.padding,r),i.around)e.w("Easing around a point is not supported under globe projection."),t.setLocationAtPoint(i.around,i.aroundPoint);else{const e=y>_?Math.min(2,v):Math.max(.5,v),i=Math.pow(e,1-r),a=bi(n,x,b,r*i);t.setCenter(a.wrap())}if(h){const i=e.G.number(_,y,r)+_i(0,t.center.lat);t.setZoom(i)}},isZooming:h,elevationCenter:f}}handleFlyTo(t,i){const r=void 0!==i.zoom,n=t.center,a=t.zoom,o=t.padding,s=!t.isPaddingEqual(i.padding),l=t.applyConstrain(e.V.convert(i.center||i.locationAtOffset),a).center,c=r?+i.zoom:t.zoom+_i(t.center.lat,l.lat),h=t.clone();h.setCenter(l),h.setZoom(c),h.setBearing(i.bearing);const u=new e.P(e.ak(t.centerPoint.x+i.offsetAsPoint.x,0,t.width),e.ak(t.centerPoint.y+i.offsetAsPoint.y,0,t.height));h.setLocationAtPoint(l,u);const d=h.center;Be(t,d);const p=function(t,i,r){const n=pi(i),a=pi(r),o=e.b3(n,a),s=Math.acos(o),l=ui(t);return s/(2*Math.PI)*l}(t,n,d),m=a+_i(n.lat,0),f=c+_i(d.lat,0),g=e.an(f-m);let _;if("number"==typeof i.minZoom){const r=+i.minZoom+_i(d.lat,0),n=Math.min(r,m,f)+_i(0,d.lat),a=t.applyConstrain(d,n).zoom+_i(d.lat,0);_=e.an(a-m)}const y=e.bI(n.lng,d.lng),x=e.bI(n.lat,d.lat);return{easeFunc:(r,a,l,h)=>{const u=bi(n,y,x,l);s&&t.interpolatePadding(o,i.padding,r);const p=1===r?d:u;t.setCenter(p.wrap());const f=m+e.aq(a);t.setZoom(1===r?c:f+_i(0,p.lat))},scaleOfZoom:g,targetCenter:d,scaleOfMinZoom:_,pixelPathLength:p}}static solveVectorScale(t,e,i,r,n){const a="x"===r?[i[0],i[4],i[8],i[12]]:[i[1],i[5],i[9],i[13]],o=[i[3],i[7],i[11],i[15]],s=t[0]*a[0]+t[1]*a[1]+t[2]*a[2],l=t[0]*o[0]+t[1]*o[1]+t[2]*o[2],c=e[0]*a[0]+e[1]*a[1]+e[2]*a[2],h=e[0]*o[0]+e[1]*o[1]+e[2]*o[2];return c+n*l===s+n*h||o[3]*(s-c)+a[3]*(h-l)+s*h==c*l?null:(c+a[3]-n*h-n*o[3])/(c-s-n*h+n*l)}static getLesserNonNegativeNonNull(t,e){return null!==e&&e>=0&&e<t?e:t}}class Ei{constructor(t){this._globe=t,this._mercatorCameraHelper=new Xe,this._verticalPerspectiveCameraHelper=new Ni}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(t,e){return this.currentHelper.handlePanInertia(t,e)}handleMapControlsRollPitchBearingZoom(t,e){return this.currentHelper.handleMapControlsRollPitchBearingZoom(t,e)}handleMapControlsPan(t,e,i){this.currentHelper.handleMapControlsPan(t,e,i)}cameraForBoxAndBearing(t,e,i,r,n){return this.currentHelper.cameraForBoxAndBearing(t,e,i,r,n)}handleJumpToCenterZoom(t,e){this.currentHelper.handleJumpToCenterZoom(t,e)}handleEaseTo(t,e){return this.currentHelper.handleEaseTo(t,e)}handleFlyTo(t,e){return this.currentHelper.handleFlyTo(t,e)}}const Fi=(t,i)=>e.B(t,i&&i.filter(t=>"source.canvas"!==t.identifier)),Zi=e.bM();class ki extends e.E{constructor(t,i={}){var r,n;super(),this._rtlPluginLoaded=()=>{for(const t in this.tileManagers){const e=this.tileManagers[t].getSource().type;"vector"!==e&&"geojson"!==e||this.tileManagers[t].reload()}},this.map=t,this.dispatcher=new z(k(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",(t,e)=>this.getGlyphs(t,e)),this.dispatcher.registerMessageHandler("GI",(t,e)=>this.getImages(t,e)),this.dispatcher.registerMessageHandler("GDA",(t,e)=>this.getDashes(t,e)),this.imageManager=new g,this.imageManager.setEventedParent(this);const a=(null===(r=t._container)||void 0===r?void 0:r.lang)||"undefined"!=typeof document&&(null===(n=document.documentElement)||void 0===n?void 0:n.lang)||void 0;this.glyphManager=new v(t._requestManager,i.localIdeographFontFamily,a),this.lineAtlas=new U(256,512),this.crossTileSymbolIndex=new Ne,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",e.bN()),st().on(nt,this._rtlPluginLoaded),this.on("data",t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;const e=this.tileManagers[t.sourceId];if(!e)return;const i=e.getSource();if(i&&i.vectorLayerIds)for(const t in this._layers){const e=this._layers[t];e.source===i.id&&this._validateLayer(e)}})}_setInitialValues(){var t;this._spritesImagesIds={},this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new e.bO,this._availableImages=[],this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this.crossTileSymbolIndex=new((null===(t=this.crossTileSymbolIndex)||void 0===t?void 0:t.constructor)||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(t,i){var r,n,a;this._checkLoaded();const o=null===i?null!==(a=null===(n=null===(r=this.stylesheet.state)||void 0===r?void 0:r[t])||void 0===n?void 0:n.default)&&void 0!==a?a:null:i;if(e.bP(o,this._globalState[t]))return this;this._globalState[t]=o,this._applyGlobalStateChanges([t])}getGlobalState(){return this._globalState}setGlobalState(t){this._checkLoaded();const i=[];for(const r in t)!e.bP(this._globalState[r],t[r].default)&&(i.push(r),this._globalState[r]=t[r].default);this._applyGlobalStateChanges(i)}_applyGlobalStateChanges(t){if(0===t.length)return;const e=new Set,i={};for(const r of t){i[r]=this._globalState[r];for(const t in this._layers){const i=this._layers[t],n=i.getLayoutAffectingGlobalStateRefs(),a=i.getPaintAffectingGlobalStateRefs(),o=i.getVisibilityAffectingGlobalStateRefs();if(n.has(r)&&e.add(i.source),a.has(r))for(const{name:t,value:e}of a.get(r))this._updatePaintProperty(i,t,e);(null==o?void 0:o.has(r))&&(i.recalculateVisibility(),this._updateLayer(i))}}this.dispatcher.broadcast("UGS",i);for(const t in this.tileManagers)e.has(t)&&(this._reloadSource(t),this._changed=!0)}loadURL(t){return e._(this,arguments,void 0,function*(t,i={},r){this.fire(new e.l("dataloading",{dataType:"style"})),i.validate="boolean"!=typeof i.validate||i.validate,this._loadStyleRequest=new AbortController;const n=this._loadStyleRequest;try{const a=yield this.map._requestManager.transformRequest(t,"Style");e.bQ(n.signal);const o=yield e.j(a,n);this._loadStyleRequest===n&&(this._loadStyleRequest=null),this._load(o.data,i,r)}catch(t){this._loadStyleRequest===n&&(this._loadStyleRequest=null),t&&!n.signal.aborted&&this.fire(new e.k(t))}})}loadJSON(t,i={},r){this.fire(new e.l("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,s.frameAsync(this._frameRequest,this.map._ownerWindow).then(()=>{this._frameRequest=null,i.validate=!1!==i.validate,this._load(t,i,r)}).catch(()=>{})}loadEmpty(){this.fire(new e.l("dataloading",{dataType:"style"})),this._load(Zi,{validate:!1})}_load(t,i,r){var n,a;let o=i.transformStyle?i.transformStyle(r,t):t;if(!i.validate||!Fi(this,e.C(o))){o=Object.assign({},o),this._loaded=!0,this.stylesheet=o;for(const t in o.sources)this.addSource(t,o.sources[t],{validate:!1});o.sprite?this._loadSprite(o.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(o.glyphs),this._createLayers(),this.light=new V(this.stylesheet.light),this._setProjectionInternal((null===(n=this.stylesheet.projection)||void 0===n?void 0:n.type)||"mercator"),this.sky=new M(this.stylesheet.sky),this.map.setTerrain(null!==(a=this.stylesheet.terrain)&&void 0!==a?a:null),this.fire(new e.l("data",{dataType:"style"})),this.fire(new e.l("style.load"))}}_createLayers(){var t,i,r;const n=e.bR(this.stylesheet.layers);this.setGlobalState(null!==(t=this.stylesheet.state)&&void 0!==t?t:null),this.dispatcher.broadcast("SL",n),this._order=n.map(t=>t.id),this._layers={},this._serializedLayers=null;for(const t of n){const n=e.bS(t,this._globalState);if(n.setEventedParent(this,{layer:{id:t.id}}),this._layers[t.id]=n,e.bT(n)&&this.tileManagers[n.source]){const e=null!==(r=null===(i=t.paint)||void 0===i?void 0:i["raster-fade-duration"])&&void 0!==r?r:n.paint.get("raster-fade-duration");this.tileManagers[n.source].setRasterFadeDuration(e)}}}_loadSprite(t,i=!1,r=void 0){this.imageManager.setLoaded(!1);const n=new AbortController;let a;this._spriteRequest=n,function(t,i,r,n){return e._(this,void 0,void 0,function*(){const a=p(t),o=r>1?"@2x":"",l={},c={};for(const{id:t,url:r}of a){const a=yield i.transformRequest(m(r,o,".json"),"SpriteJSON");l[t]=e.j(a,n);const s=yield i.transformRequest(m(r,o,".png"),"SpriteImage");c[t]=u.getImage(s,n)}return yield Promise.all([...Object.values(l),...Object.values(c)]),function(t,i){return e._(this,void 0,void 0,function*(){const e={};for(const r in t){e[r]={};const n=s.getImageCanvasContext((yield i[r]).data),a=(yield t[r]).data;for(const t in a){const{width:i,height:o,x:s,y:l,sdf:c,pixelRatio:h,stretchX:u,stretchY:d,content:p,textFitWidth:m,textFitHeight:f}=a[t];e[r][t]={data:null,pixelRatio:h,sdf:c,stretchX:u,stretchY:d,content:p,textFitWidth:m,textFitHeight:f,spriteData:{width:i,height:o,x:s,y:l,context:n}}}}return e})}(l,c)})}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(t=>{if(this._spriteRequest=null,t)for(const e in t){this._spritesImagesIds[e]=[];const r=this._spritesImagesIds[e]?this._spritesImagesIds[e].filter(e=>!(e in t)):[];for(const t of r)this.imageManager.removeImage(t),this._changedImages[t]=!0;for(const r in t[e]){const n="default"===e?r:`${e}:${r}`;this._spritesImagesIds[e].push(n),n in this.imageManager.images?this.imageManager.updateImage(n,t[e][r],!1):this.imageManager.addImage(n,t[e][r]),i&&(this._changedImages[n]=!0)}}}).catch(t=>{this._spriteRequest=null,a=t,n.signal.aborted||this.fire(new e.k(a))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),i&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.l("data",{dataType:"style"})),r&&r(a)})}_unloadSprite(){for(const 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("SI",this._availableImages),this.fire(new e.l("data",{dataType:"style"}))}_validateLayer(t){const i=this.tileManagers[t.source];if(!i)return;const r=t.sourceLayer;if(!r)return;const n=i.getSource();("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(r))&&this.fire(new e.k(new Error(`Source layer "${r}" does not exist on source "${n.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const t in this.tileManagers)if(!this.tileManagers[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t,i=!1){const r=this._serializedAllLayers();if(!t||0===t.length)return Object.values(i?e.bU(r):r);const n=[];for(const a of t)if(r[a]){const t=i?e.bU(r[a]):r[a];n.push(t)}return n}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const e=Object.keys(this._layers);for(const i of e){const e=this._layers[i];"custom"!==e.type&&(t[i]=e.serialize())}return t}hasTransitions(){var t,e,i;if(null===(t=this.light)||void 0===t?void 0:t.hasTransition())return!0;if(null===(e=this.sky)||void 0===e?void 0:e.hasTransition())return!0;if(null===(i=this.projection)||void 0===i?void 0:i.hasTransition())return!0;for(const t in this.tileManagers)if(this.tileManagers[t].hasTransition())return!0;for(const 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;const i=this._changed;if(i){const e=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(e.length||i.length)&&this._updateWorkerLayers(e,i);for(const t in this._updatedSources){const e=this._updatedSources[t];if("reload"===e)this._reloadSource(t);else{if("clear"!==e)throw new Error(`Invalid action ${e}`);this._clearSource(t)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const e in this._updatedPaintProps)this._layers[e].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}const r={};for(const t in this.tileManagers){const e=this.tileManagers[t];r[t]=e.used,e.used=!1}for(const e of this._order){const i=this._layers[e];i.recalculate(t,this._availableImages),!i.isHidden(t.zoom)&&i.source&&(this.tileManagers[i.source].used=!0)}for(const t in r){const i=this.tileManagers[t];!!r[t]!=!!i.used&&i.fire(new e.l("data",{sourceDataType:"visibility",dataType:"source",sourceId:t}))}this.light.recalculate(t),this.sky.recalculate(t),this.projection.recalculate(t),this.z=t.zoom,i&&this.fire(new e.l("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const e in this.tileManagers)this.tileManagers[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:e})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,i={}){var r;this._checkLoaded();const n=this.serialize();if(t=i.transformStyle?i.transformStyle(n,t):t,(null===(r=i.validate)||void 0===r||r)&&Fi(this,e.C(t)))return!1;(t=e.bU(t)).layers=e.bR(t.layers);const a=e.bV(n,t),o=this._getOperationsToPerform(a);if(o.unimplemented.length>0)throw new Error(`Unimplemented: ${o.unimplemented.join(", ")}.`);if(0===o.operations.length)return!1;for(const t of o.operations)t();return this.stylesheet=t,this._serializedLayers=null,this.fire(new e.l("style.load",{style:this})),!0}_getOperationsToPerform(t){const e=[],i=[];for(const r of t)switch(r.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":e.push(()=>this.addLayer.apply(this,r.args));break;case"removeLayer":e.push(()=>this.removeLayer.apply(this,r.args));break;case"setPaintProperty":e.push(()=>this.setPaintProperty.apply(this,r.args));break;case"setLayoutProperty":e.push(()=>this.setLayoutProperty.apply(this,r.args));break;case"setFilter":e.push(()=>this.setFilter.apply(this,r.args));break;case"addSource":e.push(()=>this.addSource.apply(this,r.args));break;case"removeSource":e.push(()=>this.removeSource.apply(this,r.args));break;case"setLayerZoomRange":e.push(()=>this.setLayerZoomRange.apply(this,r.args));break;case"setLight":e.push(()=>this.setLight.apply(this,r.args));break;case"setGeoJSONSourceData":e.push(()=>this.setGeoJSONSourceData.apply(this,r.args));break;case"setGlyphs":e.push(()=>this.setGlyphs.apply(this,r.args));break;case"setSprite":e.push(()=>this.setSprite.apply(this,r.args));break;case"setTerrain":e.push(()=>this.map.setTerrain.apply(this,r.args));break;case"setSky":e.push(()=>this.setSky.apply(this,r.args));break;case"setProjection":this.setProjection.apply(this,r.args);break;case"setGlobalState":e.push(()=>this.setGlobalState.apply(this,r.args));break;case"setTransition":e.push(()=>{});break;default:i.push(r.command)}return{operations:e,unimplemented:i}}addImage(t,i){if(this.getImage(t))return this.fire(new e.k(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,i),this._afterImageUpdated(t)}updateImage(t,e){this.imageManager.updateImage(t,e)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new e.k(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("SI",this._availableImages),this.fire(new e.l("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,i,r={}){if(this._checkLoaded(),void 0!==this.tileManagers[t])throw new Error(`Source "${t}" already exists.`);if(!i.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(e.C.source,`sources.${t}`,i,null,r))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);const n=this.tileManagers[t]=new kt(t,i,this.dispatcher);n.style=this,n.setEventedParent(this,()=>({isSourceLoaded:n.loaded(),source:n.serialize(),sourceId:t})),n.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),void 0===this.tileManagers[t])throw new Error(`There is no source with this ID=${t}`);for(const i in this._layers)if(this._layers[i].source===t)return this.fire(new e.k(new Error(`Source "${t}" cannot be removed while layer "${i}" is using it.`)));const i=this.tileManagers[t];delete this.tileManagers[t],delete this._updatedSources[t],i.fire(new e.l("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),i.setEventedParent(null),i.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,e){if(this._checkLoaded(),void 0===this.tileManagers[t])throw new Error(`There is no source with this ID=${t}`);const i=this.tileManagers[t].getSource();if("geojson"!==i.type)throw new Error(`geojsonSource.type is ${i.type}, which is !== 'geojson`);i.setData(e),this._changed=!0}getSource(t){return this.tileManagers[t]&&this.tileManagers[t].getSource()}addLayer(t,i,r={}){this._checkLoaded();const n=t.id;if(this.getLayer(n))return void this.fire(new e.k(new Error(`Layer "${n}" already exists on this map.`)));let a;if("custom"===t.type){if(Fi(this,e.bW(t)))return;a=e.bS(t,this._globalState)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(n,t.source),t=e.bU(t),t=e.e(t,{source:n})),this._validate(e.C.layer,`layers.${n}`,t,{arrayIndex:-1},r))return;a=e.bS(t,this._globalState),this._validateLayer(a),a.setEventedParent(this,{layer:{id:n}})}const o=i?this._order.indexOf(i):this._order.length;if(i&&-1===o)this.fire(new e.k(new Error(`Cannot add layer "${n}" before non-existing layer "${i}".`)));else{if(this._order.splice(o,0,n),this._layerOrderChanged=!0,this._layers[n]=a,this._removedLayers[n]&&a.source&&"custom"!==a.type){const t=this._removedLayers[n];delete this._removedLayers[n],t.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.tileManagers[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}moveLayer(t,i){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new e.k(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===i)return;const r=this._order.indexOf(t);this._order.splice(r,1);const n=i?this._order.indexOf(i):this._order.length;i&&-1===n?this.fire(new e.k(new Error(`Cannot move layer "${t}" before non-existing layer "${i}".`))):(this._order.splice(n,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const i=this._layers[t];if(!i)return void this.fire(new e.k(new Error(`Cannot remove non-existing layer "${t}".`)));i.setEventedParent(null);const r=this._order.indexOf(t);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=i,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],i.onRemove&&i.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,i,r){this._checkLoaded();const n=this.getLayer(t);n?n.minzoom===i&&n.maxzoom===r||(null!=i&&(n.minzoom=i),null!=r&&(n.maxzoom=r),this._updateLayer(n)):this.fire(new e.k(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,i,r={}){this._checkLoaded();const n=this.getLayer(t);if(n){if(!e.bP(n.filter,i))return null==i?(n.setFilter(void 0),void this._updateLayer(n)):void(this._validate(e.C.filter,`layers.${n.id}.filter`,i,null,r)||(n.setFilter(e.bU(i)),this._updateLayer(n)))}else this.fire(new e.k(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return e.bU(this.getLayer(t).filter)}setLayoutProperty(t,i,r,n={}){this._checkLoaded();const a=this.getLayer(t);a?e.bP(a.getLayoutProperty(i),r)||(a.setLayoutProperty(i,r,n),this._updateLayer(a)):this.fire(new e.k(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,i){const r=this.getLayer(t);if(r)return r.getLayoutProperty(i);this.fire(new e.k(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,i,r,n={}){this._checkLoaded();const a=this.getLayer(t);a?e.bP(a.getPaintProperty(i),r)||this._updatePaintProperty(a,i,r,n):this.fire(new e.k(new Error(`Cannot style non-existing layer "${t}".`)))}_updatePaintProperty(t,i,r,n={}){t.setPaintProperty(i,r,n)&&this._updateLayer(t),e.bT(t)&&"raster-fade-duration"===i&&this.tileManagers[t.source].setRasterFadeDuration(r),this._changed=!0,this._updatedPaintProps[t.id]=!0,this._serializedLayers=null}getPaintProperty(t,e){return this.getLayer(t).getPaintProperty(e)}setFeatureState(t,i){this._checkLoaded();const r=t.source,n=t.sourceLayer,a=this.tileManagers[r];if(void 0===a)return void this.fire(new e.k(new Error(`The source '${r}' does not exist in the map's style.`)));const o=a.getSource().type;"geojson"===o&&n?this.fire(new e.k(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||n?(void 0===t.id&&this.fire(new e.k(new Error("The feature id parameter must be provided."))),a.setFeatureState(n,t.id,i)):this.fire(new e.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,i){this._checkLoaded();const r=t.source,n=this.tileManagers[r];if(void 0===n)return void this.fire(new e.k(new Error(`The source '${r}' does not exist in the map's style.`)));const a=n.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?i&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.k(new Error("A feature id is required to remove its specific state property."))):n.removeFeatureState(o,t.id,i):this.fire(new e.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const i=t.source,r=t.sourceLayer,n=this.tileManagers[i];if(void 0!==n)return"vector"!==n.getSource().type||r?(void 0===t.id&&this.fire(new e.k(new Error("The feature id parameter must be provided."))),n.getFeatureState(r,t.id)):void this.fire(new e.k(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.k(new Error(`The source '${i}' does not exist in the map's style.`)))}getTransition(){return e.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=e.bX(this.tileManagers,t=>t.serialize()),i=this._serializeByIds(this._order,!0),r=this.map.getTerrain()||void 0,n=this.stylesheet;return e.bY({version:n.version,name:n.name,metadata:n.metadata,light:n.light,sky:n.sky,center:n.center,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch,sprite:n.sprite,glyphs:n.glyphs,transition:n.transition,projection:n.projection,sources:t,layers:i,terrain:r},t=>void 0!==t)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.tileManagers[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.tileManagers[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const e=t=>"fill-extrusion"===this._layers[t].type,i={},r=[];for(let n=this._order.length-1;n>=0;n--){const a=this._order[n];if(e(a)){i[a]=n;for(const e of t){const t=e[a];if(t)for(const e of t)r.push(e)}}}r.sort((t,e)=>e.intersectionZ-t.intersectionZ);const n=[];for(let a=this._order.length-1;a>=0;a--){const o=this._order[a];if(e(o))for(let t=r.length-1;t>=0;t--){const e=r[t].feature;if(i[e.layer.id]<a)break;n.push(e),r.pop()}else for(const e of t){const t=e[o];if(t)for(const e of t)n.push(e.feature)}}return n}queryRenderedFeatures(t,i,r){i&&i.filter&&this._validate(e.C.filter,"queryRenderedFeatures.filter",i.filter,null,i);const n={};if(i&&i.layers){if(!(Array.isArray(i.layers)||i.layers instanceof Set))return this.fire(new e.k(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(const t of i.layers){const i=this._layers[t];if(!i)return this.fire(new e.k(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];n[i.source]=!0}}const a=[];i.availableImages=this._availableImages;const o=this._serializedAllLayers(),s=i.layers instanceof Set?i.layers:Array.isArray(i.layers)?new Set(i.layers):null,l=Object.assign(Object.assign({},i),{layers:s,globalState:this._globalState});for(const e in this.tileManagers)i.layers&&!n[e]||a.push(D(this.tileManagers[e],this._layers,o,t,l,r,this.map.terrain?(t,e,i)=>this.map.terrain.getElevation(t,e,i):void 0));return this.placement&&a.push(function(t,e,i,r,n,a,o){const s={},l=a.queryRenderedSymbols(r),c=[];for(const t of Object.keys(l).map(Number))c.push(o[t]);c.sort(C);for(const i of c){const r=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],e,i.bucketIndex,i.sourceLayerIndex,{filterSpec:n.filter,globalState:n.globalState},n.layers,n.availableImages,t);for(const t in r){const e=s[t]=s[t]||[],n=r[t];n.sort((t,e)=>{const r=i.featureSortOrder;if(r){const i=r.indexOf(t.featureIndex);return r.indexOf(e.featureIndex)-i}return e.featureIndex-t.featureIndex});for(const t of n)e.push(t)}}return function(t,e,i){for(const r in t)for(const n of t[r])B(n,i[e[r].source]);return t}(s,t,i)}(this._layers,o,this.tileManagers,t,l,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(t,i){(null==i?void 0:i.filter)&&this._validate(e.C.filter,"querySourceFeatures.filter",i.filter,null,i);const r=this.tileManagers[t];return r?function(t,e){const i=t.getRenderableIds().map(e=>t.getTileByID(e)),r=[],n={};for(let t=0;t<i.length;t++){const a=i[t],o=a.tileID.canonical.key;n[o]||(n[o]=!0,a.querySourceFeatures(r,e))}return r}(r,i?Object.assign(Object.assign({},i),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(t,i={}){this._checkLoaded();const r=this.light.getLight();let n=!1;for(const i in t)if(!e.bP(t[i],r[i])){n=!0;break}if(!n)return;const a={now:c(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,i),this.light.updateTransitions(a)}getProjection(){var t;return null===(t=this.stylesheet)||void 0===t?void 0:t.projection}setProjection(t){this._checkLoaded();const e=null!=t?t:{type:"mercator"};if(this.stylesheet.projection=t,this.projection){if(this.projection.name===e.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(e.type)}getSky(){var t;return null===(t=this.stylesheet)||void 0===t?void 0:t.sky}setSky(t,i={}){this._checkLoaded();const r=this.getSky();let n=!1;if(!t&&!r)return;if(t&&!r)n=!0;else if(!t&&r)n=!0;else for(const i in t)if(!e.bP(t[i],r[i])){n=!0;break}if(!n)return;const a={now:c(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,i),this.sky.updateTransitions(a)}_setProjectionInternal(t){const i=function(t,i){const r={constrainOverride:i};if(Array.isArray(t)){const e=new hi({type:t});return{projection:e,transform:new Si(r),cameraHelper:new Ei(e)}}switch(t){case"mercator":return{projection:new De,transform:new Ge(r),cameraHelper:new Xe};case"globe":{const t=new hi({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:t,transform:new Si(r),cameraHelper:new Ei(t)}}case"vertical-perspective":return{projection:new li,transform:new Ui(r),cameraHelper:new Ni};default:return e.w(`Unknown projection name: ${t}. Falling back to mercator projection.`),{projection:new De,transform:new Ge(r),cameraHelper:new Xe}}}(t,this.map.transformConstrain);this.projection=i.projection,this.map.migrateProjection(i.transform,i.cameraHelper);for(const t in this.tileManagers)this.tileManagers[t].reload()}_validate(t,i,r,n,a={}){return(!a||!1!==a.validate)&&Fi(this,t.call(e.C,e.e({key:i,style:this.serialize(),value:r,styleSpec:e.u},n)))}_remove(t=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),st().off(nt,this._rtlPluginLoaded);for(const t in this._layers)this._layers[t].setEventedParent(null);for(const t in this.tileManagers){const e=this.tileManagers[t];e.setEventedParent(null),e.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.tileManagers[t].clearTiles()}_reloadSource(t){this.tileManagers[t].resume(),this.tileManagers[t].reload()}_updateSources(t){for(const e in this.tileManagers)this.tileManagers[e].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.tileManagers)this._reloadSource(t)}_updatePlacement(t,e,i,r,n=!1){let a=!1,o=!1;const s={};for(const e of this._order){const i=this._layers[e];if("symbol"!==i.type)continue;if(!s[i.source]){const t=this.tileManagers[i.source];s[i.source]=t.getRenderableIds(!0).map(e=>t.getTileByID(e)).sort((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1))}const r=this.crossTileSymbolIndex.addLayer(i,s[i.source],t.center.lng);a=a||r}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((n=n||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(c(),t.zoom))&&(this.pauseablePlacement=new Ve(t,this.map.terrain,this._order,n,e,i,r,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,s),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(c()),o=!0),a&&this.pauseablePlacement.placement.setStale()),o||a)for(const t of this._order){const e=this._layers[t];"symbol"===e.type&&this.placement.updateLayerOpacities(e,s[e.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(c())}_releaseSymbolFadeTiles(){for(const t in this.tileManagers)this.tileManagers[t].releaseSymbolFadeTiles()}getImages(t,i){return e._(this,void 0,void 0,function*(){const t=yield this.imageManager.getImages(i.icons);this._updateTilesForChangedImages();const e=this.tileManagers[i.source];return e&&e.setDependencies(i.tileID.key,i.type,i.icons),t})}getGlyphs(t,i){return e._(this,void 0,void 0,function*(){const t=yield this.glyphManager.getGlyphs(i.stacks),e=this.tileManagers[i.source];return e&&e.setDependencies(i.tileID.key,i.type,[""]),t})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,i={}){this._checkLoaded(),t&&this._validate(e.C.glyphs,"glyphs",t,null,i)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}getDashes(t,i){return e._(this,void 0,void 0,function*(){const t={};for(const[e,r]of Object.entries(i.dashes))t[e]=this.lineAtlas.getDash(r.dasharray,r.round);return t})}addSprite(t,i,r={},n){this._checkLoaded();const a=[{id:t,url:i}],o=[...p(this.stylesheet.sprite),...a];this._validate(e.C.sprite,"sprite",o,null,r)||(this.stylesheet.sprite=o,this._loadSprite(a,!0,n))}removeSprite(t){this._checkLoaded();const i=p(this.stylesheet.sprite);if(i.find(e=>e.id===t)){if(this._spritesImagesIds[t])for(const e of this._spritesImagesIds[t])this.imageManager.removeImage(e),this._changedImages[e]=!0;i.splice(i.findIndex(e=>e.id===t),1),this.stylesheet.sprite=i.length>0?i:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.l("data",{dataType:"style"}))}else this.fire(new e.k(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return p(this.stylesheet.sprite)}setSprite(t,i={},r){this._checkLoaded(),t&&this._validate(e.C.sprite,"sprite",t,null,i)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,r):(this._unloadSprite(),r&&r(null)))}destroy(){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null);for(const t in this.tileManagers){const e=this.tileManagers[t];e.setEventedParent(null),e.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this._availableImages=[],this._spritesImagesIds={}),this.glyphManager&&this.glyphManager.destroy();for(const t in this._layers){const e=this._layers[t];e.setEventedParent(null),e.onRemove&&e.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler("GG"),this.dispatcher.unregisterMessageHandler("GI"),this.dispatcher.unregisterMessageHandler("GDA"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}}var zi=e.aS([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Wi{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,i,r,n,a,o,s,l){this.context=t;let c=this.boundPaintVertexBuffers.length!==r.length;for(let t=0;!c&&t<r.length;t++)this.boundPaintVertexBuffers[t]!==r[t]&&(c=!0);!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==i||c||this.boundIndexBuffer!==n||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==l?this.freshBind(e,i,r,n,a,o,s,l):(t.bindVertexArray.set(this.vao),o&&o.bind(),n&&n.dynamicDraw&&n.bind(),s&&s.bind(),l&&l.bind())}freshBind(t,e,i,r,n,a,o,s){const l=t.numAttributes,c=this.context,h=c.gl;this.vao&&this.destroy(),this.vao=c.createVertexArray(),c.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o,this.boundDynamicVertexBuffer3=s,e.enableAttributes(h,t);for(const e of i)e.enableAttributes(h,t);a&&a.enableAttributes(h,t),o&&o.enableAttributes(h,t),s&&s.enableAttributes(h,t),e.bind(),e.setVertexAttribPointers(h,t,n);for(const e of i)e.bind(),e.setVertexAttribPointers(h,t,n);a&&(a.bind(),a.setVertexAttribPointers(h,t,n)),r&&r.bind(),o&&(o.bind(),o.setVertexAttribPointers(h,t,n)),s&&(s.bind(),s.setVertexAttribPointers(h,t,n)),c.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const Ii=(t,i,r,n,a)=>({u_texture:0,u_ele_delta:t,u_fog_matrix:i,u_fog_color:r?r.properties.get("fog-color"):e.bn.white,u_fog_ground_blend:r?r.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:a?0:r?r.calculateFogBlendOpacity(n):0,u_horizon_color:r?r.properties.get("horizon-color"):e.bn.white,u_horizon_fog_blend:r?r.properties.get("horizon-fog-blend"):1,u_is_globe_mode:a?1:0}),Di={mainMatrix:"u_projection_matrix",tileMercatorCoords:"u_projection_tile_mercator_coords",clippingPlane:"u_projection_clipping_plane",projectionTransition:"u_projection_transition",fallbackMatrix:"u_projection_fallback_matrix"};function Ci(t){const e=[];for(let i=0;i<t.length;i++){if(null===t[i])continue;const r=t[i].split(" ");e.push(r.pop())}return e}class Bi{constructor(t,i,r,n,a,o,s,l,c=[]){const h=t.gl;this.program=h.createProgram();const u=Ci(i.staticAttributes),d=r?r.getBinderAttributes():[],p=u.concat(d),m=Fe.prelude.staticUniforms?Ci(Fe.prelude.staticUniforms):[],f=s.staticUniforms?Ci(s.staticUniforms):[],g=i.staticUniforms?Ci(i.staticUniforms):[],_=r?r.getBinderUniforms():[],y=m.concat(f).concat(g).concat(_),x=[];for(const t of y)x.indexOf(t)<0&&x.push(t);const b=r?r.defines():[];ri(h)&&b.unshift("#version 300 es"),a&&b.push("#define OVERDRAW_INSPECTOR;"),o&&b.push("#define TERRAIN3D;"),l&&b.push(l),c&&b.push(...c);let v=b.concat(Fe.prelude.fragmentSource,s.fragmentSource,i.fragmentSource).join("\n"),T=b.concat(Fe.prelude.vertexSource,s.vertexSource,i.vertexSource).join("\n");ri(h)||(v=function(t){return t.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")}(v),T=function(t){return t.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")}(T));const w=h.createShader(h.FRAGMENT_SHADER);if(h.isContextLost())return void(this.failedToCreate=!0);if(h.shaderSource(w,v),h.compileShader(w),!h.getShaderParameter(w,h.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${h.getShaderInfoLog(w)}`);h.attachShader(this.program,w);const V=h.createShader(h.VERTEX_SHADER);if(h.isContextLost())return void(this.failedToCreate=!0);if(h.shaderSource(V,T),h.compileShader(V),!h.getShaderParameter(V,h.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${h.getShaderInfoLog(V)}`);h.attachShader(this.program,V),this.attributes={};const R={};this.numAttributes=p.length;for(let t=0;t<this.numAttributes;t++)p[t]&&(h.bindAttribLocation(this.program,t,p[t]),this.attributes[p[t]]=t);if(h.linkProgram(this.program),!h.getProgramParameter(this.program,h.LINK_STATUS))throw new Error(`Program failed to link: ${h.getProgramInfoLog(this.program)}`);h.deleteShader(V),h.deleteShader(w);for(let t=0;t<x.length;t++){const e=x[t];if(e&&!R[e]){const t=h.getUniformLocation(this.program,e);t&&(R[e]=t)}}this.fixedUniforms=n(t,R),this.terrainUniforms=((t,i)=>({u_depth:new e.bZ(t,i.u_depth),u_terrain:new e.bZ(t,i.u_terrain),u_terrain_dim:new e.bo(t,i.u_terrain_dim),u_terrain_matrix:new e.b$(t,i.u_terrain_matrix),u_terrain_unpack:new e.c0(t,i.u_terrain_unpack),u_terrain_exaggeration:new e.bo(t,i.u_terrain_exaggeration)}))(t,R),this.projectionUniforms=((t,i)=>({u_projection_matrix:new e.b$(t,i.u_projection_matrix),u_projection_tile_mercator_coords:new e.c0(t,i.u_projection_tile_mercator_coords),u_projection_clipping_plane:new e.c0(t,i.u_projection_clipping_plane),u_projection_transition:new e.bo(t,i.u_projection_transition),u_projection_fallback_matrix:new e.b$(t,i.u_projection_fallback_matrix)}))(t,R),this.binderUniforms=r?r.getUniforms(t,R):[]}draw(t,e,i,r,n,a,o,s,l,c,h,u,d,p,m,f,g,_,y){const x=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(n),t.setCullFace(a),s){t.activeTexture.set(x.TEXTURE2),x.bindTexture(x.TEXTURE_2D,s.depthTexture),t.activeTexture.set(x.TEXTURE3),x.bindTexture(x.TEXTURE_2D,s.texture);for(const t in this.terrainUniforms)this.terrainUniforms[t].set(s[t])}if(l)for(const t in l)this.projectionUniforms[Di[t]].set(l[t]);if(o)for(const t in this.fixedUniforms)this.fixedUniforms[t].set(o[t]);f&&f.setUniforms(t,this.binderUniforms,p,{zoom:m});let b=0;switch(e){case x.LINES:b=2;break;case x.TRIANGLES:b=3;break;case x.LINE_STRIP:b=1}for(const i of d.get()){const r=i.vaos||(i.vaos={});(r[c]||(r[c]=new Wi)).bind(t,this,h,f?f.getPaintVertexBuffers():[],u,i.vertexOffset,g,_,y),x.drawElements(e,i.primitiveLength*b,x.UNSIGNED_SHORT,i.primitiveOffset*b*2)}}}function Pi(t,i,r){const n=1/e.aK(r,1,i.transform.tileZoom),a=Math.pow(2,r.tileID.overscaledZ),o=r.tileSize*Math.pow(2,i.transform.tileZoom)/a,s=o*(r.tileID.canonical.x+r.tileID.wrap*a),l=o*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[s>>16,l>>16],u_pixel_coord_lower:[65535&s,65535&l]}}const Oi=(t,i,r,n)=>{const a=t.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=e.c3();"viewport"===a.properties.get("anchor")&&e.c4(l,t.transform.bearingInRadians),e.c5(s,s,l);const c=t.transform.transformLightDirection(s),h=a.properties.get("color");return{u_lightpos:s,u_lightpos_globe:c,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[h.r,h.g,h.b],u_vertical_gradient:+i,u_opacity:r,u_fill_translate:n}},Li=(t,i,r,n,a,o,s)=>e.e(Oi(t,i,r,n),Pi(o,t,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8}),ji=(t,i,r,n)=>e.e(Pi(i,t,r),{u_fill_translate:n}),Ai=(t,e)=>({u_world:t,u_fill_translate:e}),Gi=(t,i,r,n,a)=>e.e(ji(t,i,r,a),{u_world:n}),Yi=(t,i,r,n,a)=>{const o=t.transform;let s,l,c=0;if("map"===r.paint.get("circle-pitch-alignment")){const t=e.aK(i,1,o.zoom);s=!0,l=[t,t],c=t/(e.a5*Math.pow(2,i.tileID.overscaledZ))*2*Math.PI*a}else s=!1,l=o.pixelsToGLUnits;return{u_camera_to_center_distance:o.cameraToCenterDistance,u_scale_with_map:+("map"===r.paint.get("circle-pitch-scale")),u_pitch_with_map:+s,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:l,u_globe_extrude_scale:c,u_translate:n}},Qi=t=>({u_pixel_extrude_scale:[1/t.width,1/t.height]}),Ji=t=>({u_viewport_size:[t.width,t.height]}),Xi=(t,e=1)=>({u_color:t,u_overlay:0,u_overlay_scale:e}),Hi=(t,i,r,n)=>{const a=e.aK(t,1,i)/(e.a5*Math.pow(2,t.tileID.overscaledZ))*2*Math.PI*n;return{u_extrude_scale:e.aK(t,1,i),u_intensity:r,u_globe_extrude_scale:a}},qi=(t,i,r,n)=>{const a=e.N();e.c6(a,0,t.width,t.height,0,0,1);const o=t.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:r,u_color_ramp:n,u_opacity:i.paint.get("heatmap-opacity")}},Ki=(t,e,i)=>{const r=i.paint.get("hillshade-accent-color");let n;switch(i.paint.get("hillshade-method")){case"basic":n=4;break;case"combined":n=1;break;case"igor":n=2;break;case"multidirectional":n=3;break;default:n=0}const a=i.getIlluminationProperties();for(let e=0;e<a.directionRadians.length;e++)"viewport"===i.paint.get("hillshade-illumination-anchor")&&(a.directionRadians[e]+=t.transform.bearingInRadians);return{u_image:0,u_latrange:tr(0,e.tileID),u_exaggeration:i.paint.get("hillshade-exaggeration"),u_altitudes:a.altitudeRadians,u_azimuths:a.directionRadians,u_accent:r,u_method:n,u_highlights:a.highlightColor,u_shadows:a.shadowColor}},$i=(t,i)=>{const r=i.stride,n=e.N();return e.c6(n,0,e.a5,-e.a5,0,0,1),e.O(n,n,[0,-e.a5,0]),{u_matrix:n,u_image:1,u_dimension:[r,r],u_zoom:t.overscaledZ,u_unpack:i.getUnpackVector()}};function tr(t,i){const r=Math.pow(2,i.canonical.z),n=i.canonical.y;return[new e.a6(0,n/r).toLngLat().lat,new e.a6(0,(n+1)/r).toLngLat().lat]}const er=(t,e,i=0)=>({u_image:0,u_unpack:e.getUnpackVector(),u_dimension:[e.stride,e.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:i,u_opacity:t.paint.get("color-relief-opacity")}),ir=(t,i,r,n)=>{const a=t.transform;return{u_translation:lr(t,i,r),u_ratio:n/e.aK(i,1,a.zoom),u_device_pixel_ratio:t.pixelRatio,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},rr=(t,i,r,n,a)=>e.e(ir(t,i,r,n),{u_image:0,u_image_height:a}),nr=(t,i,r,n,a)=>{const o=t.transform,s=sr(i,o);return{u_translation:lr(t,i,r),u_texsize:i.imageAtlasTexture.size,u_ratio:n/e.aK(i,1,o.zoom),u_device_pixel_ratio:t.pixelRatio,u_image:0,u_scale:[s,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},ar=(t,i,r,n,a)=>{const o=sr(i,t.transform);return e.e(ir(t,i,r,n),{u_tileratio:o,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image:0,u_mix:a.t,u_lineatlas_width:t.lineAtlas.width,u_lineatlas_height:t.lineAtlas.height})},or=(t,i,r,n,a,o)=>{const s=sr(i,t.transform);return e.e(ir(t,i,r,n),{u_image:0,u_image_height:o,u_tileratio:s,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image_dash:1,u_mix:a.t,u_lineatlas_width:t.lineAtlas.width,u_lineatlas_height:t.lineAtlas.height})};function sr(t,i){return 1/e.aK(t,1,i.tileZoom)}function lr(t,i,r){return e.aL(t.transform,i,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const cr=(t,e,i,r,n)=>{return{u_tl_parent:t,u_scale_parent:e,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(o=r.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=r.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:hr(r.paint.get("raster-hue-rotate")),u_coords_top:[n[0].x,n[0].y,n[1].x,n[1].y],u_coords_bottom:[n[3].x,n[3].y,n[2].x,n[2].y]};var a,o};function hr(t){t*=Math.PI/180;const e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}const ur=(t,e,i,r,n,a,o,s,l,c,h,u,d)=>{const p=o.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:p.cameraToCenterDistance,u_pitch:p.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:p.width/p.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_label_plane_matrix:s,u_coord_matrix:l,u_is_text:+h,u_pitch_with_map:+r,u_is_along_line:n,u_is_variable_anchor:a,u_texsize:u,u_texture:0,u_translation:c,u_pitched_scale:d}},dr=(t,i,r,n,a,o,s,l,c,h,u,d,p,m)=>{const f=s.transform;return e.e(ur(t,i,r,n,a,o,s,l,c,h,u,d,m),{u_gamma_scale:n?Math.cos(f.pitch*Math.PI/180)*f.cameraToCenterDistance:1,u_device_pixel_ratio:s.pixelRatio,u_is_halo:1})},pr=(t,i,r,n,a,o,s,l,c,h,u,d,p)=>e.e(dr(t,i,r,n,a,o,s,l,c,h,!0,u,0,p),{u_texsize_icon:d,u_texture_icon:1}),mr=(t,e)=>({u_opacity:t,u_color:e}),fr=(t,i,r,n,a)=>e.e(function(t,i,r,n){const a=r.imageManager.getPattern(t.from.toString()),o=r.imageManager.getPattern(t.to.toString()),{width:s,height:l}=r.imageManager.getPixelSize(),c=Math.pow(2,n.tileID.overscaledZ),h=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,u=h*(n.tileID.canonical.x+n.tileID.wrap*c),d=h*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,l],u_mix:i.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:i.fromScale,u_scale_b:i.toScale,u_tile_units_to_pixels:1/e.aK(n,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,d>>16],u_pixel_coord_lower:[65535&u,65535&d]}}(r,a,i,n),{u_opacity:t}),gr=(t,e)=>{},_r={fillExtrusion:(t,i)=>({u_lightpos:new e.c1(t,i.u_lightpos),u_lightpos_globe:new e.c1(t,i.u_lightpos_globe),u_lightintensity:new e.bo(t,i.u_lightintensity),u_lightcolor:new e.c1(t,i.u_lightcolor),u_vertical_gradient:new e.bo(t,i.u_vertical_gradient),u_opacity:new e.bo(t,i.u_opacity),u_fill_translate:new e.c2(t,i.u_fill_translate)}),fillExtrusionPattern:(t,i)=>({u_lightpos:new e.c1(t,i.u_lightpos),u_lightpos_globe:new e.c1(t,i.u_lightpos_globe),u_lightintensity:new e.bo(t,i.u_lightintensity),u_lightcolor:new e.c1(t,i.u_lightcolor),u_vertical_gradient:new e.bo(t,i.u_vertical_gradient),u_height_factor:new e.bo(t,i.u_height_factor),u_opacity:new e.bo(t,i.u_opacity),u_fill_translate:new e.c2(t,i.u_fill_translate),u_image:new e.bZ(t,i.u_image),u_texsize:new e.c2(t,i.u_texsize),u_pixel_coord_upper:new e.c2(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.c2(t,i.u_pixel_coord_lower),u_scale:new e.c1(t,i.u_scale),u_fade:new e.bo(t,i.u_fade)}),fill:(t,i)=>({u_fill_translate:new e.c2(t,i.u_fill_translate)}),fillPattern:(t,i)=>({u_image:new e.bZ(t,i.u_image),u_texsize:new e.c2(t,i.u_texsize),u_pixel_coord_upper:new e.c2(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.c2(t,i.u_pixel_coord_lower),u_scale:new e.c1(t,i.u_scale),u_fade:new e.bo(t,i.u_fade),u_fill_translate:new e.c2(t,i.u_fill_translate)}),fillOutline:(t,i)=>({u_world:new e.c2(t,i.u_world),u_fill_translate:new e.c2(t,i.u_fill_translate)}),fillOutlinePattern:(t,i)=>({u_world:new e.c2(t,i.u_world),u_image:new e.bZ(t,i.u_image),u_texsize:new e.c2(t,i.u_texsize),u_pixel_coord_upper:new e.c2(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.c2(t,i.u_pixel_coord_lower),u_scale:new e.c1(t,i.u_scale),u_fade:new e.bo(t,i.u_fade),u_fill_translate:new e.c2(t,i.u_fill_translate)}),circle:(t,i)=>({u_camera_to_center_distance:new e.bo(t,i.u_camera_to_center_distance),u_scale_with_map:new e.bZ(t,i.u_scale_with_map),u_pitch_with_map:new e.bZ(t,i.u_pitch_with_map),u_extrude_scale:new e.c2(t,i.u_extrude_scale),u_device_pixel_ratio:new e.bo(t,i.u_device_pixel_ratio),u_globe_extrude_scale:new e.bo(t,i.u_globe_extrude_scale),u_translate:new e.c2(t,i.u_translate)}),collisionBox:(t,i)=>({u_pixel_extrude_scale:new e.c2(t,i.u_pixel_extrude_scale)}),collisionCircle:(t,i)=>({u_viewport_size:new e.c2(t,i.u_viewport_size)}),debug:(t,i)=>({u_color:new e.b_(t,i.u_color),u_overlay:new e.bZ(t,i.u_overlay),u_overlay_scale:new e.bo(t,i.u_overlay_scale)}),depth:gr,clippingMask:gr,heatmap:(t,i)=>({u_extrude_scale:new e.bo(t,i.u_extrude_scale),u_intensity:new e.bo(t,i.u_intensity),u_globe_extrude_scale:new e.bo(t,i.u_globe_extrude_scale)}),heatmapTexture:(t,i)=>({u_matrix:new e.b$(t,i.u_matrix),u_world:new e.c2(t,i.u_world),u_image:new e.bZ(t,i.u_image),u_color_ramp:new e.bZ(t,i.u_color_ramp),u_opacity:new e.bo(t,i.u_opacity)}),hillshade:(t,i)=>({u_image:new e.bZ(t,i.u_image),u_latrange:new e.c2(t,i.u_latrange),u_exaggeration:new e.bo(t,i.u_exaggeration),u_altitudes:new e.c8(t,i.u_altitudes),u_azimuths:new e.c8(t,i.u_azimuths),u_accent:new e.b_(t,i.u_accent),u_method:new e.bZ(t,i.u_method),u_shadows:new e.c7(t,i.u_shadows),u_highlights:new e.c7(t,i.u_highlights)}),hillshadePrepare:(t,i)=>({u_matrix:new e.b$(t,i.u_matrix),u_image:new e.bZ(t,i.u_image),u_dimension:new e.c2(t,i.u_dimension),u_zoom:new e.bo(t,i.u_zoom),u_unpack:new e.c0(t,i.u_unpack)}),colorRelief:(t,i)=>({u_image:new e.bZ(t,i.u_image),u_unpack:new e.c0(t,i.u_unpack),u_dimension:new e.c2(t,i.u_dimension),u_elevation_stops:new e.bZ(t,i.u_elevation_stops),u_color_stops:new e.bZ(t,i.u_color_stops),u_color_ramp_size:new e.bZ(t,i.u_color_ramp_size),u_opacity:new e.bo(t,i.u_opacity)}),line:(t,i)=>({u_translation:new e.c2(t,i.u_translation),u_ratio:new e.bo(t,i.u_ratio),u_device_pixel_ratio:new e.bo(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.c2(t,i.u_units_to_pixels)}),lineGradient:(t,i)=>({u_translation:new e.c2(t,i.u_translation),u_ratio:new e.bo(t,i.u_ratio),u_device_pixel_ratio:new e.bo(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.c2(t,i.u_units_to_pixels),u_image:new e.bZ(t,i.u_image),u_image_height:new e.bo(t,i.u_image_height)}),linePattern:(t,i)=>({u_translation:new e.c2(t,i.u_translation),u_texsize:new e.c2(t,i.u_texsize),u_ratio:new e.bo(t,i.u_ratio),u_device_pixel_ratio:new e.bo(t,i.u_device_pixel_ratio),u_image:new e.bZ(t,i.u_image),u_units_to_pixels:new e.c2(t,i.u_units_to_pixels),u_scale:new e.c1(t,i.u_scale),u_fade:new e.bo(t,i.u_fade)}),lineSDF:(t,i)=>({u_translation:new e.c2(t,i.u_translation),u_ratio:new e.bo(t,i.u_ratio),u_device_pixel_ratio:new e.bo(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.c2(t,i.u_units_to_pixels),u_image:new e.bZ(t,i.u_image),u_mix:new e.bo(t,i.u_mix),u_tileratio:new e.bo(t,i.u_tileratio),u_crossfade_from:new e.bo(t,i.u_crossfade_from),u_crossfade_to:new e.bo(t,i.u_crossfade_to),u_lineatlas_width:new e.bo(t,i.u_lineatlas_width),u_lineatlas_height:new e.bo(t,i.u_lineatlas_height)}),lineGradientSDF:(t,i)=>({u_translation:new e.c2(t,i.u_translation),u_ratio:new e.bo(t,i.u_ratio),u_device_pixel_ratio:new e.bo(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.c2(t,i.u_units_to_pixels),u_image:new e.bZ(t,i.u_image),u_image_height:new e.bo(t,i.u_image_height),u_tileratio:new e.bo(t,i.u_tileratio),u_crossfade_from:new e.bo(t,i.u_crossfade_from),u_crossfade_to:new e.bo(t,i.u_crossfade_to),u_image_dash:new e.bZ(t,i.u_image_dash),u_mix:new e.bo(t,i.u_mix),u_lineatlas_width:new e.bo(t,i.u_lineatlas_width),u_lineatlas_height:new e.bo(t,i.u_lineatlas_height)}),raster:(t,i)=>({u_tl_parent:new e.c2(t,i.u_tl_parent),u_scale_parent:new e.bo(t,i.u_scale_parent),u_buffer_scale:new e.bo(t,i.u_buffer_scale),u_fade_t:new e.bo(t,i.u_fade_t),u_opacity:new e.bo(t,i.u_opacity),u_image0:new e.bZ(t,i.u_image0),u_image1:new e.bZ(t,i.u_image1),u_brightness_low:new e.bo(t,i.u_brightness_low),u_brightness_high:new e.bo(t,i.u_brightness_high),u_saturation_factor:new e.bo(t,i.u_saturation_factor),u_contrast_factor:new e.bo(t,i.u_contrast_factor),u_spin_weights:new e.c1(t,i.u_spin_weights),u_coords_top:new e.c0(t,i.u_coords_top),u_coords_bottom:new e.c0(t,i.u_coords_bottom)}),symbolIcon:(t,i)=>({u_is_size_zoom_constant:new e.bZ(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.bZ(t,i.u_is_size_feature_constant),u_size_t:new e.bo(t,i.u_size_t),u_size:new e.bo(t,i.u_size),u_camera_to_center_distance:new e.bo(t,i.u_camera_to_center_distance),u_pitch:new e.bo(t,i.u_pitch),u_rotate_symbol:new e.bZ(t,i.u_rotate_symbol),u_aspect_ratio:new e.bo(t,i.u_aspect_ratio),u_fade_change:new e.bo(t,i.u_fade_change),u_label_plane_matrix:new e.b$(t,i.u_label_plane_matrix),u_coord_matrix:new e.b$(t,i.u_coord_matrix),u_is_text:new e.bZ(t,i.u_is_text),u_pitch_with_map:new e.bZ(t,i.u_pitch_with_map),u_is_along_line:new e.bZ(t,i.u_is_along_line),u_is_variable_anchor:new e.bZ(t,i.u_is_variable_anchor),u_texsize:new e.c2(t,i.u_texsize),u_texture:new e.bZ(t,i.u_texture),u_translation:new e.c2(t,i.u_translation),u_pitched_scale:new e.bo(t,i.u_pitched_scale)}),symbolSDF:(t,i)=>({u_is_size_zoom_constant:new e.bZ(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.bZ(t,i.u_is_size_feature_constant),u_size_t:new e.bo(t,i.u_size_t),u_size:new e.bo(t,i.u_size),u_camera_to_center_distance:new e.bo(t,i.u_camera_to_center_distance),u_pitch:new e.bo(t,i.u_pitch),u_rotate_symbol:new e.bZ(t,i.u_rotate_symbol),u_aspect_ratio:new e.bo(t,i.u_aspect_ratio),u_fade_change:new e.bo(t,i.u_fade_change),u_label_plane_matrix:new e.b$(t,i.u_label_plane_matrix),u_coord_matrix:new e.b$(t,i.u_coord_matrix),u_is_text:new e.bZ(t,i.u_is_text),u_pitch_with_map:new e.bZ(t,i.u_pitch_with_map),u_is_along_line:new e.bZ(t,i.u_is_along_line),u_is_variable_anchor:new e.bZ(t,i.u_is_variable_anchor),u_texsize:new e.c2(t,i.u_texsize),u_texture:new e.bZ(t,i.u_texture),u_gamma_scale:new e.bo(t,i.u_gamma_scale),u_device_pixel_ratio:new e.bo(t,i.u_device_pixel_ratio),u_is_halo:new e.bZ(t,i.u_is_halo),u_translation:new e.c2(t,i.u_translation),u_pitched_scale:new e.bo(t,i.u_pitched_scale)}),symbolTextAndIcon:(t,i)=>({u_is_size_zoom_constant:new e.bZ(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.bZ(t,i.u_is_size_feature_constant),u_size_t:new e.bo(t,i.u_size_t),u_size:new e.bo(t,i.u_size),u_camera_to_center_distance:new e.bo(t,i.u_camera_to_center_distance),u_pitch:new e.bo(t,i.u_pitch),u_rotate_symbol:new e.bZ(t,i.u_rotate_symbol),u_aspect_ratio:new e.bo(t,i.u_aspect_ratio),u_fade_change:new e.bo(t,i.u_fade_change),u_label_plane_matrix:new e.b$(t,i.u_label_plane_matrix),u_coord_matrix:new e.b$(t,i.u_coord_matrix),u_is_text:new e.bZ(t,i.u_is_text),u_pitch_with_map:new e.bZ(t,i.u_pitch_with_map),u_is_along_line:new e.bZ(t,i.u_is_along_line),u_is_variable_anchor:new e.bZ(t,i.u_is_variable_anchor),u_texsize:new e.c2(t,i.u_texsize),u_texsize_icon:new e.c2(t,i.u_texsize_icon),u_texture:new e.bZ(t,i.u_texture),u_texture_icon:new e.bZ(t,i.u_texture_icon),u_gamma_scale:new e.bo(t,i.u_gamma_scale),u_device_pixel_ratio:new e.bo(t,i.u_device_pixel_ratio),u_is_halo:new e.bZ(t,i.u_is_halo),u_translation:new e.c2(t,i.u_translation),u_pitched_scale:new e.bo(t,i.u_pitched_scale)}),background:(t,i)=>({u_opacity:new e.bo(t,i.u_opacity),u_color:new e.b_(t,i.u_color)}),backgroundPattern:(t,i)=>({u_opacity:new e.bo(t,i.u_opacity),u_image:new e.bZ(t,i.u_image),u_pattern_tl_a:new e.c2(t,i.u_pattern_tl_a),u_pattern_br_a:new e.c2(t,i.u_pattern_br_a),u_pattern_tl_b:new e.c2(t,i.u_pattern_tl_b),u_pattern_br_b:new e.c2(t,i.u_pattern_br_b),u_texsize:new e.c2(t,i.u_texsize),u_mix:new e.bo(t,i.u_mix),u_pattern_size_a:new e.c2(t,i.u_pattern_size_a),u_pattern_size_b:new e.c2(t,i.u_pattern_size_b),u_scale_a:new e.bo(t,i.u_scale_a),u_scale_b:new e.bo(t,i.u_scale_b),u_pixel_coord_upper:new e.c2(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.c2(t,i.u_pixel_coord_lower),u_tile_units_to_pixels:new e.bo(t,i.u_tile_units_to_pixels)}),terrain:(t,i)=>({u_texture:new e.bZ(t,i.u_texture),u_ele_delta:new e.bo(t,i.u_ele_delta),u_fog_matrix:new e.b$(t,i.u_fog_matrix),u_fog_color:new e.b_(t,i.u_fog_color),u_fog_ground_blend:new e.bo(t,i.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.bo(t,i.u_fog_ground_blend_opacity),u_horizon_color:new e.b_(t,i.u_horizon_color),u_horizon_fog_blend:new e.bo(t,i.u_horizon_fog_blend),u_is_globe_mode:new e.bo(t,i.u_is_globe_mode)}),terrainDepth:(t,i)=>({u_ele_delta:new e.bo(t,i.u_ele_delta)}),terrainCoords:(t,i)=>({u_texture:new e.bZ(t,i.u_texture),u_terrain_coords_id:new e.bo(t,i.u_terrain_coords_id),u_ele_delta:new e.bo(t,i.u_ele_delta)}),projectionErrorMeasurement:(t,i)=>({u_input:new e.bo(t,i.u_input),u_output_expected:new e.bo(t,i.u_output_expected)}),atmosphere:(t,i)=>({u_sun_pos:new e.c1(t,i.u_sun_pos),u_atmosphere_blend:new e.bo(t,i.u_atmosphere_blend),u_globe_position:new e.c1(t,i.u_globe_position),u_globe_radius:new e.bo(t,i.u_globe_radius),u_inv_proj_matrix:new e.b$(t,i.u_inv_proj_matrix)}),sky:(t,i)=>({u_sky_color:new e.b_(t,i.u_sky_color),u_horizon_color:new e.b_(t,i.u_horizon_color),u_horizon:new e.c2(t,i.u_horizon),u_horizon_normal:new e.c2(t,i.u_horizon_normal),u_sky_horizon_blend:new e.bo(t,i.u_sky_horizon_blend),u_sky_blend:new e.bo(t,i.u_sky_blend)})};class yr{constructor(t,e,i){this.context=t;const r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||e.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const xr={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class br{constructor(t,e,i,r){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.context=t;const n=t.gl;this.buffer=n.createBuffer(),t.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||e.freeBufferAfterUpload()}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}`);const e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let i=0;i<this.attributes.length;i++){const r=e.attributes[this.attributes[i].name];void 0!==r&&t.enableVertexAttribArray(r)}}setVertexAttribPointers(t,e,i){for(let r=0;r<this.attributes.length;r++){const n=this.attributes[r],a=e.attributes[n.name];void 0!==a&&t.vertexAttribPointer(a,n.components,t[xr[n.type]],!1,this.itemSize,n.offset+this.itemSize*(i||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class vr{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Tr extends vr{getDefault(){return e.bn.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class wr extends vr{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class Vr extends vr{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class Rr extends vr{getDefault(){return[!0,!0,!0,!0]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Mr extends vr{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class Ur extends vr{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class Sr extends vr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class Nr extends vr{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class Er extends vr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}}class Fr extends vr{getDefault(){return[0,1]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class Zr extends vr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}}class kr extends vr{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class zr extends vr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}}class Wr extends vr{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class Ir extends vr{getDefault(){return e.bn.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Dr extends vr{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class Cr extends vr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}}class Br extends vr{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class Pr extends vr{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class Or extends vr{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class Lr extends vr{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class jr extends vr{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Ar extends vr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class Gr extends vr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Yr extends vr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class Qr extends vr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Jr extends vr{getDefault(){return null}set(t){const e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Xr extends vr{getDefault(){return null}set(t){var e;if(t===this.current&&!this.dirty)return;const i=this.gl;ri(i)?i.bindVertexArray(t):null===(e=i.getExtension("OES_vertex_array_object"))||void 0===e||e.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class Hr extends vr{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class qr extends vr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class Kr extends vr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class $r extends vr{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}}class tn extends $r{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class en extends $r{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class rn extends $r{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}const nn="Framebuffer is not complete";class an{constructor(t,e,i,r,n){this.context=t,this.width=e,this.height=i;const a=t.gl,o=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new tn(t,o),r)this.depthAttachment=n?new rn(t,o):new en(t,o);else if(n)throw new Error("Stencil cannot be set without depth");if(a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw new Error(nn)}destroy(){const t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){const e=this.depthAttachment.get();e&&t.deleteRenderbuffer(e)}t.deleteFramebuffer(this.framebuffer)}}class on{constructor(t){var e,i;if(this.gl=t,this.clearColor=new Tr(this),this.clearDepth=new wr(this),this.clearStencil=new Vr(this),this.colorMask=new Rr(this),this.depthMask=new Mr(this),this.stencilMask=new Ur(this),this.stencilFunc=new Sr(this),this.stencilOp=new Nr(this),this.stencilTest=new Er(this),this.depthRange=new Fr(this),this.depthTest=new Zr(this),this.depthFunc=new kr(this),this.blend=new zr(this),this.blendFunc=new Wr(this),this.blendColor=new Ir(this),this.blendEquation=new Dr(this),this.cullFace=new Cr(this),this.cullFaceSide=new Br(this),this.frontFace=new Pr(this),this.program=new Or(this),this.activeTexture=new Lr(this),this.viewport=new jr(this),this.bindFramebuffer=new Ar(this),this.bindRenderbuffer=new Gr(this),this.bindTexture=new Yr(this),this.bindVertexBuffer=new Qr(this),this.bindElementBuffer=new Jr(this),this.bindVertexArray=new Xr(this),this.pixelStoreUnpack=new Hr(this),this.pixelStoreUnpackPremultiplyAlpha=new qr(this),this.pixelStoreUnpackFlipY=new Kr(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),ri(t)){this.HALF_FLOAT=t.HALF_FLOAT;const r=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!==(e=t.RGBA16F)&&void 0!==e?e:null==r?void 0:r.RGBA16F_EXT,this.RGB16F=null!==(i=t.RGB16F)&&void 0!==i?i:null==r?void 0:r.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");const e=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=null==e?void 0:e.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,e){return new yr(this,t,e)}createVertexBuffer(t,e,i){return new br(this,t,e,i)}createRenderbuffer(t,e,i){const r=this.gl,n=r.createRenderbuffer();return this.bindRenderbuffer.set(n),r.renderbufferStorage(r.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),n}createFramebuffer(t,e,i,r){return new an(this,t,e,i,r)}clear({color:t,depth:e,stencil:i}){const r=this.gl;let n=0;t&&(n|=r.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==e&&(n|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(e),this.depthMask.set(!0)),void 0!==i&&(n|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),r.clear(n)}setCullFace(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){e.bP(t.blendFunction,He.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return ri(this.gl)?this.gl.createVertexArray():null===(t=this.gl.getExtension("OES_vertex_array_object"))||void 0===t?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var e;return ri(this.gl)?this.gl.deleteVertexArray(t):null===(e=this.gl.getExtension("OES_vertex_array_object"))||void 0===e?void 0:e.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}let sn;function ln(t,i,r,n,a){const o=t.context,s=t.transform,l=o.gl,c=t.useProgram("collisionBox"),h=[];let u=0,d=0;for(let e=0;e<n.length;e++){const p=n[e],m=i.getTile(p).getBucket(r);if(!m)continue;const f=a?m.textCollisionBox:m.iconCollisionBox,g=m.collisionCircleArray;g.length>0&&(h.push({circleArray:g,circleOffset:d,coord:p}),u+=g.length/4,d=u),f&&c.draw(o,l.LINES,$e.disabled,ei.disabled,t.colorModeForRenderPass(),Ke.disabled,Qi(t.transform),t.style.map.terrain&&t.style.map.terrain.getTerrainData(p),s.getProjectionData({overscaledTileID:p,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),r.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,null,t.transform.zoom,null,null,f.collisionVertexBuffer)}if(!a||!h.length)return;const p=t.useProgram("collisionCircle"),m=new e.c9;m.resize(4*u),m._trim();let f=0;for(const t of h)for(let e=0;e<t.circleArray.length/4;e++){const i=4*e,r=t.circleArray[i+0],n=t.circleArray[i+1],a=t.circleArray[i+2],o=t.circleArray[i+3];m.emplace(f++,r,n,a,o,0),m.emplace(f++,r,n,a,o,1),m.emplace(f++,r,n,a,o,2),m.emplace(f++,r,n,a,o,3)}(!sn||sn.length<2*u)&&(sn=function(t){const i=2*t,r=new e.cb;r.resize(i),r._trim();for(let t=0;t<i;t++){const e=6*t;r.uint16[e+0]=4*t+0,r.uint16[e+1]=4*t+1,r.uint16[e+2]=4*t+2,r.uint16[e+3]=4*t+2,r.uint16[e+4]=4*t+3,r.uint16[e+5]=4*t+0}return r}(u));const g=o.createIndexBuffer(sn,!0),_=o.createVertexBuffer(m,e.ca.members,!0);for(const i of h){const n=Ji(t.transform);p.draw(o,l.TRIANGLES,$e.disabled,ei.disabled,t.colorModeForRenderPass(),Ke.disabled,n,t.style.map.terrain&&t.style.map.terrain.getTerrainData(i.coord),null,r.id,_,g,e.aV.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,t.transform.zoom,null,null,null)}_.destroy(),g.destroy()}const cn=e.ao(new Float32Array(16));function hn(t,i,r,n,a,o){const{horizontalAlign:s,verticalAlign:l}=e.aP(t);return new e.P((-(s-.5)*i/a+n[0])*o,(-(l-.5)*r/a+n[1])*o)}function un(t,i,r,n,a,o){const s=i.tileAnchorPoint.add(new e.P(i.translation[0],i.translation[1]));if(i.pitchWithMap){let t=n.mult(o);r||(t=t.rotate(-a));const e=s.add(t);return Pt(e.x,e.y,i.pitchedLabelPlaneMatrix,i.getElevation).point}if(r){const e=Xt(i.tileAnchorPoint.x+1,i.tileAnchorPoint.y,i).point.sub(t),r=Math.atan(e.y/e.x)+(e.x<0?Math.PI:0);return t.add(n.rotate(r))}return t.add(n)}function dn(t,i,r,n,a,o,s,l,c,h,u,d){const p=t.text.placedSymbolArray,m=t.text.dynamicLayoutVertexArray,f=t.icon.dynamicLayoutVertexArray,g={};m.clear();for(let f=0;f<p.length;f++){const _=p.get(f),y=_.hidden||!_.crossTileID||t.allowVerticalPlacement&&!_.placedOrientation?null:n[_.crossTileID];if(y){const n=new e.P(_.anchorX,_.anchorY),p={getElevation:d,width:a.width,height:a.height,pitchedLabelPlaneMatrix:o,pitchWithMap:r,transform:a,tileAnchorPoint:n,translation:h,unwrappedTileID:u},f=r?qt(n.x,n.y,p):Xt(n.x,n.y,p),x=Ot(a.cameraToCenterDistance,f.signedDistanceFromCamera);let b=e.ax(t.textSizeData,l,_)*x/e.aJ;r&&(b*=t.tilePixelRatio/s);const{width:v,height:T,anchor:w,textOffset:V,textBoxScale:R}=y,M=hn(w,v,T,V,R,b),U=a.getPitchedTextCorrection(n.x+h[0],n.y+h[1],u),S=un(f.point,p,i,M,-a.bearingInRadians,U),N=t.allowVerticalPlacement&&_.placedOrientation===e.aw.vertical?Math.PI/2:0;for(let t=0;t<_.numGlyphs;t++)e.aD(m,S,N);c&&_.associatedIconIndex>=0&&(g[_.associatedIconIndex]={shiftedAnchor:S,angle:N})}else ie(_.numGlyphs,m)}if(c){f.clear();const i=t.icon.placedSymbolArray;for(let t=0;t<i.length;t++){const r=i.get(t);if(r.hidden)ie(r.numGlyphs,f);else{const i=g[t];if(i)for(let t=0;t<r.numGlyphs;t++)e.aD(f,i.shiftedAnchor,i.angle);else ie(r.numGlyphs,f)}}t.icon.dynamicLayoutVertexBuffer.updateData(f)}t.text.dynamicLayoutVertexBuffer.updateData(m)}function pn(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function mn(t,i,r,n,a,o,s,l,c,h,u,d,p){const m=t.context,f=m.gl,g=t.transform,_="map"===l,y="map"===c,x="viewport"!==l&&"point"!==r.layout.get("symbol-placement"),b=_&&!y&&!x,v=!r.layout.get("symbol-sort-key").isConstant();let T=!1;const w=t.getDepthModeForSublayer(0,$e.ReadOnly),V=r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"),R=[],M=g.getCircleRadiusCorrection();for(const l of n){const n=i.getTile(l),c=n.getBucket(r);if(!c)continue;const u=a?c.text:c.icon;if(!u||!u.segments.get().length||!u.hasVisibleVertices)continue;const d=u.programConfigurations.get(r.id),m=a||c.sdfIcons,w=a?c.textSizeData:c.iconSizeData,U=y||0!==g.pitch,S=t.useProgram(pn(m,a,c),d),N=e.av(w,g.zoom),E=t.style.map.terrain&&t.style.map.terrain.getTerrainData(l);let F,Z,k,z,W=[0,0],I=null;if(a)Z=n.glyphAtlasTexture,k=f.LINEAR,F=n.glyphAtlasTexture.size,c.iconsInText&&(W=n.imageAtlasTexture.size,I=n.imageAtlasTexture,z=U||t.options.rotating||t.options.zooming||"composite"===w.kind||"camera"===w.kind?f.LINEAR:f.NEAREST);else{const e=1!==r.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;Z=n.imageAtlasTexture,k=m||t.options.rotating||t.options.zooming||e||U?f.LINEAR:f.NEAREST,F=n.imageAtlasTexture.size}const D=e.aK(n,1,t.transform.zoom),C=Dt(_,t.transform,D),B=e.N();e.ay(B,C);const P=Ct(y,_,t.transform,D),O=e.aL(g,n,o,s),L=g.getProjectionData({overscaledTileID:l,applyGlobeMatrix:!p,applyTerrainMatrix:!0}),j=V&&c.hasTextData(),A="none"!==r.layout.get("icon-text-fit")&&j&&c.hasIconData();if(x){const e=t.style.map.terrain?(e,i)=>t.style.map.terrain.getElevation(l,e,i):null,i="map"===r.layout.get("text-rotation-alignment");jt(c,t,a,C,B,y,h,i,l.toUnwrapped(),g.width,g.height,O,e)}const G=a&&V||A,Y=x||G?cn:y?C:t.transform.clipSpaceToPixelsMatrix,Q=m&&0!==r.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1);let J;J=m?c.iconsInText?pr(w.kind,N,b,y,x,G,t,Y,P,O,F,W,M):dr(w.kind,N,b,y,x,G,t,Y,P,O,a,F,0,M):ur(w.kind,N,b,y,x,G,t,Y,P,O,a,F,M);const X={program:S,buffers:u,uniformValues:J,projectionData:L,atlasTexture:Z,atlasTextureIcon:I,atlasInterpolation:k,atlasInterpolationIcon:z,isSDF:m,hasHalo:Q};if(v&&c.canOverlap){T=!0;const t=u.segments.get();for(const i of t)R.push({segments:new e.aV([i]),sortKey:i.sortKey,state:X,terrainData:E})}else R.push({segments:u.segments,sortKey:0,state:X,terrainData:E})}T&&R.sort((t,e)=>t.sortKey-e.sortKey);for(const e of R){const i=e.state;if(m.activeTexture.set(f.TEXTURE0),i.atlasTexture.bind(i.atlasInterpolation,f.CLAMP_TO_EDGE),i.atlasTextureIcon&&(m.activeTexture.set(f.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),i.isSDF){const n=i.uniformValues;i.hasHalo&&(n.u_is_halo=1,fn(i.buffers,e.segments,r,t,i.program,w,u,d,n,i.projectionData,e.terrainData)),n.u_is_halo=0}fn(i.buffers,e.segments,r,t,i.program,w,u,d,i.uniformValues,i.projectionData,e.terrainData)}}function fn(t,e,i,r,n,a,o,s,l,c,h){const u=r.context;n.draw(u,u.gl.TRIANGLES,a,o,s,Ke.backCCW,l,h,c,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,r.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function gn(t,i,r,n,a){const o=t.context,s=o.gl,l=ei.disabled,c=new He([s.ONE,s.ONE],e.bn.transparent,[!0,!0,!0,!0]),h=i.getBucket(r);if(!h)return;const u=n.key;let d=r.heatmapFbos.get(u);d||(d=yn(o,i.tileSize,i.tileSize),r.heatmapFbos.set(u,d)),o.bindFramebuffer.set(d.framebuffer),o.viewport.set([0,0,i.tileSize,i.tileSize]),o.clear({color:e.bn.transparent});const p=h.programConfigurations.get(r.id),m=t.useProgram("heatmap",p,!a),f=t.transform.getProjectionData({overscaledTileID:i.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),g=t.style.map.terrain.getTerrainData(n);m.draw(o,s.TRIANGLES,$e.disabled,l,c,Ke.disabled,Hi(i,t.transform.zoom,r.paint.get("heatmap-intensity"),1),g,f,r.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,r.paint,t.transform.zoom,p)}function _n(t,e,i,r,n){const a=t.context,o=a.gl,s=t.transform;a.setColorMode(t.colorModeForRenderPass());const l=xn(a,e),c=i.key,h=e.heatmapFbos.get(c);if(!h)return;a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,h.colorAttachment.get()),a.activeTexture.set(o.TEXTURE1),l.bind(o.LINEAR,o.CLAMP_TO_EDGE);const u=s.getProjectionData({overscaledTileID:i,applyTerrainMatrix:n,applyGlobeMatrix:!r});t.useProgram("heatmapTexture").draw(a,o.TRIANGLES,$e.disabled,ei.disabled,t.colorModeForRenderPass(),Ke.disabled,qi(t,e,0,1),null,u,e.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,e.paint,s.zoom),h.destroy(),e.heatmapFbos.delete(c)}function yn(t,e,i){var r,n;const a=t.gl,o=a.createTexture();a.bindTexture(a.TEXTURE_2D,o),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);const s=null!==(r=t.HALF_FLOAT)&&void 0!==r?r:a.UNSIGNED_BYTE,l=null!==(n=t.RGBA16F)&&void 0!==n?n:a.RGBA;a.texImage2D(a.TEXTURE_2D,0,l,e,i,0,a.RGBA,s,null);const c=t.createFramebuffer(e,i,!1,!1);return c.colorAttachment.set(o),c}function xn(t,i){return i.colorRampTexture||(i.colorRampTexture=new e.T(t,i.colorRamp,t.gl.RGBA)),i.colorRampTexture}function bn(t,i,r,n,a,o,s,l){let c=256;if(a.stepInterpolant){const n=i.getSource().maxzoom,a=s.canonical.z===n?Math.ceil(1<<t.transform.maxZoom-s.canonical.z):1;c=e.ak(e.cd(o.maxLineLength/e.a5*1024*a),256,r.maxTextureSize)}return l.gradient=e.ce({expression:a.gradientExpression(),evaluationKey:"lineProgress",resolution:c,image:l.gradient||void 0,clips:o.lineClipsArray}),l.texture?l.texture.update(l.gradient):l.texture=new e.T(r,l.gradient,n.RGBA),l.version=a.gradientVersion,l.texture}function vn(t,e,i,r,n){t.activeTexture.set(e.TEXTURE0),i.imageAtlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE),r.updatePaintBuffers(n)}function Tn(t,e,i,r,n,a){(n||t.lineAtlas.dirty)&&(e.activeTexture.set(i.TEXTURE0),t.lineAtlas.bind(e)),r.updatePaintBuffers(a)}function wn(t,e,i,r,n,a,o){const s=a.gradients[n.id];let l=s.texture;n.gradientVersion!==s.version&&(l=bn(t,e,i,r,n,a,o,s)),i.activeTexture.set(r.TEXTURE0),l.bind(n.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE)}function Vn(t,e,i,r,n,a,o,s,l){const c=a.gradients[n.id];let h=c.texture;n.gradientVersion!==c.version&&(h=bn(t,e,i,r,n,a,o,c)),i.activeTexture.set(r.TEXTURE0),h.bind(n.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE),i.activeTexture.set(r.TEXTURE1),t.lineAtlas.bind(i),s.updatePaintBuffers(l)}function Rn(t,e,i,r,n){if(!i||!r||!r.imageAtlas)return;const a=r.imageAtlas.patternPositions;let o=a[i.to.toString()],s=a[i.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){const t=n.getPaintProperty(e);o=a[t],s=a[t]}o&&s&&t.setConstantPatternPositions(o,s)}function Mn(t,i,r,n,a,o,s,l){const c=t.context.gl,h="fill-pattern",u=r.paint.get(h),d=u&&u.constantOr(1),p=r.getCrossfadeParameters();let m,f,g,_,y;const x=t.transform,b=r.paint.get("fill-translate"),v=r.paint.get("fill-translate-anchor");s?(f=d&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",m=c.LINES):(f=d?"fillPattern":"fill",m=c.TRIANGLES);const T=u.constantOr(null);for(const u of n){const n=i.getTile(u);if(d&&!n.patternsLoaded())continue;const w=n.getBucket(r);if(!w)continue;const V=w.programConfigurations.get(r.id),R=t.useProgram(f,V),M=t.style.map.terrain&&t.style.map.terrain.getTerrainData(u);d&&(t.context.activeTexture.set(c.TEXTURE0),n.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),V.updatePaintBuffers(p)),Rn(V,h,T,n,r);const U=x.getProjectionData({overscaledTileID:u,applyGlobeMatrix:!l,applyTerrainMatrix:!0}),S=e.aL(x,n,b,v);if(s){_=w.indexBuffer2,y=w.segments2;const e=[c.drawingBufferWidth,c.drawingBufferHeight];g="fillOutlinePattern"===f&&d?Gi(t,p,n,e,S):Ai(e,S)}else _=w.indexBuffer,y=w.segments,g=d?ji(t,p,n,S):{u_fill_translate:S};const N=t.stencilModeForClipping(u);R.draw(t.context,m,a,N,o,Ke.backCCW,g,M,U,r.id,w.layoutVertexBuffer,_,y,r.paint,t.transform.zoom,V)}}function Un(t,i,r,n,a,o,s,l){const c=t.context,h=c.gl,u="fill-extrusion-pattern",d=r.paint.get(u),p=d.constantOr(1),m=r.getCrossfadeParameters(),f=r.paint.get("fill-extrusion-opacity"),g=d.constantOr(null),_=t.transform;for(const d of n){const n=i.getTile(d),y=n.getBucket(r);if(!y)continue;const x=t.style.map.terrain&&t.style.map.terrain.getTerrainData(d),b=y.programConfigurations.get(r.id),v=t.useProgram(p?"fillExtrusionPattern":"fillExtrusion",b);p&&(t.context.activeTexture.set(h.TEXTURE0),n.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),b.updatePaintBuffers(m));const T=_.getProjectionData({overscaledTileID:d,applyGlobeMatrix:!l,applyTerrainMatrix:!0});Rn(b,u,g,n,r);const w=e.aL(_,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),V=r.paint.get("fill-extrusion-vertical-gradient"),R=p?Li(t,V,f,w,d,m,n):Oi(t,V,f,w);v.draw(c,c.gl.TRIANGLES,a,o,s,Ke.backCCW,R,x,T,r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,r.paint,t.transform.zoom,b,t.style.map.terrain&&y.centroidVertexBuffer)}}function Sn(t,e,i,r,n,a,o,s,l){var c;const h=t.style.projection,u=t.context,d=t.transform,p=u.gl,m=[`#define NUM_ILLUMINATION_SOURCES ${i.paint.get("hillshade-highlight-color").values.length}`],f=t.useProgram("hillshade",null,!1,m),g=!t.options.moving;for(const m of r){const r=e.getTile(m),_=r.fbo;if(!_)continue;const y=h.getMeshFromTileID(u,m.canonical,s,!0,"raster"),x=null===(c=t.style.map.terrain)||void 0===c?void 0:c.getTerrainData(m);u.activeTexture.set(p.TEXTURE0),p.bindTexture(p.TEXTURE_2D,_.colorAttachment.get());const b=d.getProjectionData({overscaledTileID:m,aligned:g,applyGlobeMatrix:!l,applyTerrainMatrix:!0});f.draw(u,p.TRIANGLES,a,n[m.overscaledZ],o,Ke.backCCW,Ki(t,r,i),x,b,i.id,y.vertexBuffer,y.indexBuffer,y.segments)}}function Nn(t,i,r,n,a,o,s,l,c){var h;const u=t.style.projection,d=t.context,p=t.transform,m=d.gl,f=t.useProgram("colorRelief"),g=!t.options.moving,_="nearest"===r.paint.get("resampling")?m.NEAREST:m.LINEAR;let y=!0,x=0;for(const b of n){const n=i.getTile(b),v=n.dem;if(y){const t=m.getParameter(m.MAX_TEXTURE_SIZE),{elevationTexture:e,colorTexture:i}=r.getColorRampTextures(d,t,v.getUnpackVector());d.activeTexture.set(m.TEXTURE1),e.bind(m.NEAREST,m.CLAMP_TO_EDGE),d.activeTexture.set(m.TEXTURE4),i.bind(m.LINEAR,m.CLAMP_TO_EDGE),y=!1,x=e.size[0]}if(!v||!v.data)continue;const T=v.stride,w=v.getPixels();if(d.activeTexture.set(m.TEXTURE0),d.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||t.getTileTexture(T),n.demTexture){const t=n.demTexture;t.update(w,{premultiply:!1}),t.bind(_,m.CLAMP_TO_EDGE)}else n.demTexture=new e.T(d,w,m.RGBA,{premultiply:!1}),n.demTexture.bind(_,m.CLAMP_TO_EDGE);const V=u.getMeshFromTileID(d,b.canonical,l,!0,"raster"),R=null===(h=t.style.map.terrain)||void 0===h?void 0:h.getTerrainData(b),M=p.getProjectionData({overscaledTileID:b,aligned:g,applyGlobeMatrix:!c,applyTerrainMatrix:!0});f.draw(d,m.TRIANGLES,o,a[b.overscaledZ],s,Ke.backCCW,er(r,n.dem,x),R,M,r.id,V.vertexBuffer,V.indexBuffer,V.segments)}}const En=[new e.P(0,0),new e.P(e.a5,0),new e.P(e.a5,e.a5),new e.P(0,e.a5)];function Fn(t,e,i,r,n,a,o,s,l=!1,c=!1){const h=r[r.length-1].overscaledZ,u=t.context,d=u.gl,p=t.useProgram("raster"),m=t.transform,f=t.style.projection,g=t.colorModeForRenderPass(),_=!t.options.moving,y=i.paint.get("raster-opacity"),x="nearest"===i.paint.get("resampling")||"nearest"===i.paint.get("raster-resampling")?d.NEAREST:d.LINEAR,b=i.paint.get("raster-fade-duration"),v=!!t.style.map.terrain;for(const T of r){const r=t.getDepthModeForSublayer(T.overscaledZ-h,1===y?$e.ReadWrite:$e.ReadOnly,d.LESS),w=e.getTile(T);u.activeTexture.set(d.TEXTURE0),w.texture.bind(x,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST),u.activeTexture.set(d.TEXTURE1);const{parentTile:V,parentScaleBy:R,parentTopLeft:M,fadeValues:U}=Zn(w,e,b,v);w.fadeOpacity=U.tileOpacity,V?(V.fadeOpacity=U.parentTileOpacity,V.texture.bind(x,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST)):w.texture.bind(x,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST),w.texture.useMipmap&&u.extTextureFilterAnisotropic&&t.transform.pitch>t.options.anisotropicFilterPitch&&d.texParameterf(d.TEXTURE_2D,u.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,u.extTextureFilterAnisotropicMax);const S=t.style.map.terrain&&t.style.map.terrain.getTerrainData(T),N=m.getProjectionData({overscaledTileID:T,aligned:_,applyGlobeMatrix:!c,applyTerrainMatrix:!0}),E=cr(M,R,U.fadeMix,i,s),F=f.getMeshFromTileID(u,T.canonical,a,o,"raster");p.draw(u,d.TRIANGLES,r,n?n[T.overscaledZ]:ei.disabled,g,l?Ke.frontCCW:Ke.backCCW,E,S,N,i.id,F.vertexBuffer,F.indexBuffer,F.segments)}}function Zn(t,i,r,n){const a={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(0===r||n)return a;if(t.fadingParentID){const n=i.getLoadedTile(t.fadingParentID);if(!n)return a;const o=Math.pow(2,n.tileID.overscaledZ-t.tileID.overscaledZ),s=[t.tileID.canonical.x*o%1,t.tileID.canonical.y*o%1],l=function(t,i,r){const n=c(),a=(n-i.timeAdded)/r,o=t.fadingDirection===ct.Incoming,s=e.ak((n-t.timeAdded)/r,0,1),l=e.ak(1-a,0,1),h=o?s:l;return{tileOpacity:h,parentTileOpacity:o?l:s,fadeMix:{opacity:1,mix:1-h}}}(t,n,r);return{parentTile:n,parentScaleBy:o,parentTopLeft:s,fadeValues:l}}if(t.selfFading){const i=function(t,i){const r=(c()-t.timeAdded)/i,n=e.ak(r,0,1);return{tileOpacity:n,fadeMix:{opacity:n,mix:0}}}(t,r);return{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:i}}return a}const kn=new e.bn(1,0,0,1),zn=new e.bn(0,1,0,1),Wn=new e.bn(0,0,1,1),In=new e.bn(1,0,1,1),Dn=new e.bn(0,1,1,1);function Cn(t,e,i,r){Pn(t,0,e+i/2,t.transform.width,i,r)}function Bn(t,e,i,r){Pn(t,e-i/2,0,i,t.transform.height,r)}function Pn(t,e,i,r,n,a){const o=t.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(e*t.pixelRatio,i*t.pixelRatio,r*t.pixelRatio,n*t.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function On(t,i,r){const n=t.context,a=n.gl,o=t.useProgram("debug"),s=$e.disabled,l=ei.disabled,c=t.colorModeForRenderPass(),h="$debug",u=t.style.map.terrain&&t.style.map.terrain.getTerrainData(r);n.activeTexture.set(a.TEXTURE0);const d=i.getTileByID(r.key).latestRawTileData,p=Math.floor((d&&d.byteLength||0)/1024),m=i.getTile(r).tileSize,f=512/Math.min(m,512)*(r.overscaledZ/t.transform.zoom)*.5;let g=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(g+=` => ${r.overscaledZ}`),function(t,e){t.initDebugOverlayCanvas();const i=t.debugOverlayCanvas,r=t.context.gl,n=t.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,i.width,i.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(e,5,5),n.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(t,`${g} ${p}kB`);const _=t.transform.getProjectionData({overscaledTileID:r,applyGlobeMatrix:!0,applyTerrainMatrix:!0});o.draw(n,a.TRIANGLES,s,l,He.alphaBlended,Ke.disabled,Xi(e.bn.transparent,f),null,_,h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),o.draw(n,a.LINE_STRIP,s,l,c,Ke.disabled,Xi(e.bn.red),u,_,h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}function Ln(t,e,i,r){const{isRenderingGlobe:n}=r,a=t.context,o=a.gl,s=t.transform,l=t.colorModeForRenderPass(),c=t.getDepthModeFor3D(),h=t.useProgram("terrain");a.bindFramebuffer.set(null),a.viewport.set([0,0,t.width,t.height]);for(const r of i){const i=e.getTerrainMesh(r.tileID),u=t.renderToTexture.getTexture(r),d=e.getTerrainData(r.tileID);a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,u.texture);const p=e.getMeshFrameDelta(s.zoom),m=s.calculateFogMatrix(r.tileID.toUnwrapped()),f=Ii(p,m,t.style.sky,s.pitch,n),g=s.getProjectionData({overscaledTileID:r.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});h.draw(a,o.TRIANGLES,c,ei.disabled,l,Ke.backCCW,f,d,g,"terrain",i.vertexBuffer,i.indexBuffer,i.segments)}}function jn(t,i){if(!i.mesh){const r=new e.aU;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(1,1),r.emplaceBack(-1,1);const n=new e.aW;n.emplaceBack(0,1,2),n.emplaceBack(0,2,3),i.mesh=new ke(t.createVertexBuffer(r,ze.members),t.createIndexBuffer(n),e.aV.simpleSegment(0,0,r.length,n.length))}return i.mesh}class An{constructor(t,i){this.context=new on(t),this.transform=i,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.ao(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=kt.maxOverzooming+kt.maxUnderzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ne}resize(t,e,i){if(this.width=Math.floor(t*i),this.height=Math.floor(e*i),this.pixelRatio=i,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const t of this.style._order)this.style._layers[t].resize()}setup(){const t=this.context,i=new e.aU;i.emplaceBack(0,0),i.emplaceBack(e.a5,0),i.emplaceBack(0,e.a5),i.emplaceBack(e.a5,e.a5),this.tileExtentBuffer=t.createVertexBuffer(i,ze.members),this.tileExtentSegments=e.aV.simpleSegment(0,0,4,2);const r=new e.aU;r.emplaceBack(0,0),r.emplaceBack(e.a5,0),r.emplaceBack(0,e.a5),r.emplaceBack(e.a5,e.a5),this.debugBuffer=t.createVertexBuffer(r,ze.members),this.debugSegments=e.aV.simpleSegment(0,0,4,5);const n=new e.cg;n.emplaceBack(0,0,0,0),n.emplaceBack(e.a5,0,e.a5,0),n.emplaceBack(0,e.a5,0,e.a5),n.emplaceBack(e.a5,e.a5,e.a5,e.a5),this.rasterBoundsBuffer=t.createVertexBuffer(n,zi.members),this.rasterBoundsSegments=e.aV.simpleSegment(0,0,4,2);const a=new e.aU;a.emplaceBack(0,0),a.emplaceBack(e.a5,0),a.emplaceBack(0,e.a5),a.emplaceBack(e.a5,e.a5),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(a,ze.members),this.rasterBoundsSegmentsPosOnly=e.aV.simpleSegment(0,0,4,5);const o=new e.aU;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(o,ze.members),this.viewportSegments=e.aV.simpleSegment(0,0,4,2);const s=new e.ch;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(s);const l=new e.aW;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(l);const c=this.context.gl;this.stencilClearMode=new ei({func:c.ALWAYS,mask:0},0,255,c.ZERO,c.ZERO,c.ZERO),this.tileExtentMesh=new ke(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){const t=this.context,i=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const r=e.N();e.c6(r,0,this.width,this.height,0,0,1),e.Q(r,r,[i.drawingBufferWidth,i.drawingBufferHeight,0]);const n={mainMatrix:r,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:r};this.useProgram("clippingMask",null,!0).draw(t,i.TRIANGLES,$e.disabled,this.stencilClearMode,He.disabled,Ke.disabled,null,null,n,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,e,i){if(this.currentStencilSource===t.source||!t.isTileClipped()||!e||!e.length)return;this.currentStencilSource=t.source,this.nextStencilID+e.length>256&&this.clearStencil();const r=this.context;r.setColorMode(He.disabled),r.setDepthMode($e.disabled);const n={};for(const t of e)n[t.key]=this.nextStencilID++;this._renderTileMasks(n,e,i,!0),this._renderTileMasks(n,e,i,!1),this._tileClippingMaskIDs=n}_renderTileMasks(t,e,i,r){const n=this.context,a=n.gl,o=this.style.projection,s=this.transform,l=this.useProgram("clippingMask");for(const c of e){const e=t[c.key],h=this.style.map.terrain&&this.style.map.terrain.getTerrainData(c),u=o.getMeshFromTileID(this.context,c.canonical,r,!0,"stencil"),d=s.getProjectionData({overscaledTileID:c,applyGlobeMatrix:!i,applyTerrainMatrix:!0});l.draw(n,a.TRIANGLES,$e.disabled,new ei({func:a.ALWAYS,mask:0},e,255,a.KEEP,a.KEEP,a.REPLACE),He.disabled,i?Ke.disabled:Ke.backCCW,null,h,d,"$clipping",u.vertexBuffer,u.indexBuffer,u.segments)}}_renderTilesDepthBuffer(){const t=this.context,e=t.gl,i=this.style.projection,r=this.transform,n=this.useProgram("depth"),a=this.getDepthModeFor3D(),o=Vt(r,{tileSize:r.tileSize});for(const s of o){const o=this.style.map.terrain&&this.style.map.terrain.getTerrainData(s),l=i.getMeshFromTileID(this.context,s.canonical,!0,!0,"raster"),c=r.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!0,applyTerrainMatrix:!0});n.draw(t,e.TRIANGLES,a,ei.disabled,He.disabled,Ke.backCCW,null,o,c,"$clipping",l.vertexBuffer,l.indexBuffer,l.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,e=this.context.gl;return new ei({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)}stencilModeForClipping(t){const e=this.context.gl;return new ei({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){const e=this.context.gl,i=t.sort((t,e)=>e.overscaledZ-t.overscaledZ),r=i[i.length-1].overscaledZ,n=i[0].overscaledZ-r+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();const t={};for(let i=0;i<n;i++)t[i+r]=new ei({func:e.GEQUAL,mask:255},i+this.nextStencilID,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID+=n,[t,i]}return[{[r]:ei.disabled},i]}stencilConfigForOverlapTwoPass(t){const e=this.context.gl,i=t.sort((t,e)=>e.overscaledZ-t.overscaledZ),r=i[i.length-1].overscaledZ,n=i[0].overscaledZ-r+1;if(this.clearStencil(),n>1){const t={},a={};for(let i=0;i<n;i++)t[i+r]=new ei({func:e.GREATER,mask:255},n+1+i,255,e.KEEP,e.KEEP,e.REPLACE),a[i+r]=new ei({func:e.GREATER,mask:255},1+i,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID=2*n+1,[t,a,i]}return this.nextStencilID=3,[{[r]:new ei({func:e.GREATER,mask:255},2,255,e.KEEP,e.KEEP,e.REPLACE)},{[r]:new ei({func:e.GREATER,mask:255},1,255,e.KEEP,e.KEEP,e.REPLACE)},i]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const i=1/8;return new He([t.CONSTANT_COLOR,t.ONE],new e.bn(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?He.unblended:He.alphaBlended}getDepthModeForSublayer(t,e,i){if(!this.opaquePassEnabledForLayer())return $e.disabled;const r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new $e(i||this.context.gl.LEQUAL,e,[r,r])}getDepthModeFor3D(){return new $e(this.context.gl.LEQUAL,$e.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,i){var r,n;this.style=t,this.options=i,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(c()),this.imageManager.beginFrame();const a=this.style._order,o=this.style.tileManagers,s={},l={},h={},u={isRenderingToTexture:!1,isRenderingGlobe:(null===(r=t.projection)||void 0===r?void 0:r.transitionState)>0};for(const t in o){const e=o[t];e.used&&e.prepare(this.context),s[t]=e.getVisibleCoordinates(!1),l[t]=s[t].slice().reverse(),h[t]=e.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let t=0;t<a.length;t++)if(this.style._layers[a[t]].is3D()){this.opaquePassCutoff=t;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const t of a){const e=this.style._layers[t];if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;const i=l[e.source];("custom"===e.type||i.length)&&this.renderLayer(this,o[e.source],e,i,u)}if(null===(n=this.style.projection)||void 0===n||n.updateGPUdependent({context:this.context,useProgram:t=>this.useProgram(t)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?e.bn.black:e.bn.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(t,e){const i=t.context,r=i.gl,n=((t,e,i)=>{const r=Math.cos(e.rollInRadians),n=Math.sin(e.rollInRadians),a=ft(e),o=e.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:t.properties.get("sky-color"),u_horizon_color:t.properties.get("horizon-color"),u_horizon:[(e.width/2-a*n)*i,(e.height/2+a*r)*i],u_horizon_normal:[-n,r],u_sky_horizon_blend:t.properties.get("sky-horizon-blend")*e.height/2*i,u_sky_blend:o}})(e,t.style.map.transform,t.pixelRatio),a=new $e(r.LEQUAL,$e.ReadWrite,[0,1]),o=ei.disabled,s=t.colorModeForRenderPass(),l=t.useProgram("sky"),c=jn(i,e);l.draw(i,r.TRIANGLES,a,o,s,Ke.disabled,n,null,void 0,"sky",c.vertexBuffer,c.indexBuffer,c.segments)}(this,this.style.sky),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=a.length-1;this.currentLayer>=0;this.currentLayer--){const t=this.style._layers[a[this.currentLayer]],e=o[t.source],i=s[t.source];this._renderTileClippingMasks(t,i,!1),this.renderLayer(this,e,t,i,u)}this.renderPass="translucent";let d=!1;for(this.currentLayer=0;this.currentLayer<a.length;this.currentLayer++){const t=this.style._layers[a[this.currentLayer]],e=o[t.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(t,u))continue;this.opaquePassEnabledForLayer()||d||(d=!0,u.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());const i=("symbol"===t.type?h:l)[t.source];this._renderTileClippingMasks(t,s[t.source],!!this.renderToTexture),this.renderLayer(this,e,t,i,u)}if(u.isRenderingGlobe&&function(t,i,r){const n=t.context,a=n.gl,o=t.useProgram("atmosphere"),s=new $e(a.LEQUAL,$e.ReadOnly,[0,1]),l=t.transform,c=function(t,i){const r=t.properties.get("position"),n=[-r.x,-r.y,-r.z],a=e.ao(new Float64Array(16));return"map"===t.properties.get("anchor")&&(e.be(a,a,i.rollInRadians),e.bf(a,a,-i.pitchInRadians),e.be(a,a,i.bearingInRadians),e.bf(a,a,i.center.lat*Math.PI/180),e.bH(a,a,-i.center.lng*Math.PI/180)),e.cf(n,n,a),n}(r,t.transform),h=l.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),u=i.properties.get("atmosphere-blend")*h.projectionTransition;if(0===u)return;const d=mi(l.worldSize,l.center.lat),p=l.inverseProjectionMatrix,m=new Float64Array(4);m[3]=1,e.aE(m,m,l.modelViewProjectionMatrix),m[0]/=m[3],m[1]/=m[3],m[2]/=m[3],m[3]=1,e.aE(m,m,p),m[0]/=m[3],m[1]/=m[3],m[2]/=m[3],m[3]=1;const f=((t,e,i,r,n)=>({u_sun_pos:t,u_atmosphere_blend:e,u_globe_position:i,u_globe_radius:r,u_inv_proj_matrix:n}))(c,u,[m[0],m[1],m[2]],d,p),g=jn(n,i);o.draw(n,a.TRIANGLES,s,ei.disabled,He.alphaBlended,Ke.disabled,f,null,null,"atmosphere",g.vertexBuffer,g.indexBuffer,g.segments)}(this,this.style.sky,this.style.light),this.options.showTileBoundaries){const t=function(t,e){let i=null;const r=Object.values(t._layers).flatMap(i=>i.source&&!i.isHidden(e)?[t.tileManagers[i.source]]:[]),n=r.filter(t=>"vector"===t.getSource().type),a=r.filter(t=>"vector"!==t.getSource().type),o=t=>{(!i||i.getSource().maxzoom<t.getSource().maxzoom)&&(i=t)};return n.forEach(t=>o(t)),i||a.forEach(t=>o(t)),i}(this.style,this.transform.zoom);t&&function(t,e,i){for(let r=0;r<i.length;r++)On(t,e,i[r])}(this,t,t.getVisibleCoordinates())}this.options.showPadding&&function(t){const e=t.transform.padding;Cn(t,t.transform.height-(e.top||0),3,kn),Cn(t,e.bottom||0,3,zn),Bn(t,e.left||0,3,Wn),Bn(t,t.transform.width-(e.right||0),3,In);const i=t.transform.centerPoint;!function(t,e,i,r){Pn(t,e-1,i-10,2,20,r),Pn(t,e-10,i-1,20,2,r)}(t,i.x,t.transform.height-i.y,Dn)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(t){if(!this.style||!this.style.map||!this.style.map.terrain)return;const i=this.terrainFacilitator.matrix,r=this.transform.modelViewProjectionMatrix;let n=this.terrainFacilitator.dirty;n||(n=t?!e.ci(i,r):!e.cj(i,r)),n||(n=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),n&&(e.ck(i,r),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(t,i){const r=t.context,n=r.gl,a=t.transform,o=He.unblended,s=new $e(n.LEQUAL,$e.ReadWrite,[0,1]),l=i.tileManager.getRenderableTiles(),c=t.useProgram("terrainDepth");r.bindFramebuffer.set(i.getFramebuffer("depth").framebuffer),r.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),r.clear({color:e.bn.transparent,depth:1});for(const t of l){const e=i.getTerrainMesh(t.tileID),l=i.getTerrainData(t.tileID),h=a.getProjectionData({overscaledTileID:t.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),u={u_ele_delta:i.getMeshFrameDelta(a.zoom)};c.draw(r,n.TRIANGLES,s,ei.disabled,o,Ke.backCCW,u,l,h,"terrain",e.vertexBuffer,e.indexBuffer,e.segments)}r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain),function(t,i){const r=t.context,n=r.gl,a=t.transform,o=He.unblended,s=new $e(n.LEQUAL,$e.ReadWrite,[0,1]),l=i.getCoordsTexture(),c=i.tileManager.getRenderableTiles(),h=t.useProgram("terrainCoords");r.bindFramebuffer.set(i.getFramebuffer("coords").framebuffer),r.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),r.clear({color:e.bn.transparent,depth:1}),i.coordsIndex=[];for(const t of c){const e=i.getTerrainMesh(t.tileID),c=i.getTerrainData(t.tileID);r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,l.texture);const u={u_terrain_coords_id:(255-i.coordsIndex.length)/255,u_texture:0,u_ele_delta:i.getMeshFrameDelta(a.zoom)},d=a.getProjectionData({overscaledTileID:t.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});h.draw(r,n.TRIANGLES,s,ei.disabled,o,Ke.backCCW,u,c,d,"terrain",e.vertexBuffer,e.indexBuffer,e.segments),i.coordsIndex.push(t.tileID.key)}r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain))}renderLayer(t,i,r,n,a){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||(n||[]).length)&&(this.id=r.id,e.aQ(r)?function(t,i,r,n,a,o){if("translucent"!==t.renderPass)return;const{isRenderingToTexture:s}=o,l=ei.disabled,c=t.colorModeForRenderPass();(r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,i,r,n,a,o,s,l,c){const h=i.transform,u=i.style.map.terrain,d="map"===a,p="map"===o;for(const a of t){const t=n.getTile(a),o=t.getBucket(r);if(!o||!o.text||!o.text.segments.get().length)continue;const m=e.av(o.textSizeData,h.zoom),f=e.aK(t,1,i.transform.zoom),g=Dt(d,i.transform,f),_="none"!==r.layout.get("icon-text-fit")&&o.hasIconData();if(m){const i=Math.pow(2,h.zoom-t.tileID.overscaledZ),r=u?(t,e)=>u.getElevation(a,t,e):null;dn(o,d,p,c,h,g,i,m,_,e.aL(h,t,s,l),a.toUnwrapped(),r)}}}(n,t,r,i,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),a),0!==r.paint.get("icon-opacity").constantOr(1)&&mn(t,i,r,n,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),l,c,s),0!==r.paint.get("text-opacity").constantOr(1)&&mn(t,i,r,n,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),l,c,s),i.map.showCollisionBoxes&&(ln(t,i,r,n,!0),ln(t,i,r,n,!1))}(t,i,r,n,this.style.placement.variableOffsets,a):e.cl(r)?function(t,i,r,n,a){if("translucent"!==t.renderPass)return;const{isRenderingToTexture:o}=a,s=r.paint.get("circle-opacity"),l=r.paint.get("circle-stroke-width"),c=r.paint.get("circle-stroke-opacity"),h=!r.layout.get("circle-sort-key").isConstant();if(0===s.constantOr(1)&&(0===l.constantOr(1)||0===c.constantOr(1)))return;const u=t.context,d=u.gl,p=t.transform,m=t.getDepthModeForSublayer(0,$e.ReadOnly),f=ei.disabled,g=t.colorModeForRenderPass(),_=[],y=p.getCircleRadiusCorrection();for(let a=0;a<n.length;a++){const s=n[a],l=i.getTile(s),c=l.getBucket(r);if(!c)continue;const u=r.paint.get("circle-translate"),d=r.paint.get("circle-translate-anchor"),m=e.aL(p,l,u,d),f=c.programConfigurations.get(r.id),g=t.useProgram("circle",f),x=c.layoutVertexBuffer,b=c.indexBuffer,v=t.style.map.terrain&&t.style.map.terrain.getTerrainData(s),T={programConfiguration:f,program:g,layoutVertexBuffer:x,indexBuffer:b,uniformValues:Yi(t,l,r,m,y),terrainData:v,projectionData:p.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!o,applyTerrainMatrix:!0})};if(h){const t=c.segments.get();for(const i of t)_.push({segments:new e.aV([i]),sortKey:i.sortKey,state:T})}else _.push({segments:c.segments,sortKey:0,state:T})}h&&_.sort((t,e)=>t.sortKey-e.sortKey);for(const e of _){const{programConfiguration:i,program:n,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:l,projectionData:c}=e.state;n.draw(u,d.TRIANGLES,m,f,g,Ke.backCCW,s,l,c,r.id,a,o,e.segments,r.paint,t.transform.zoom,i)}}(t,i,r,n,a):e.cm(r)?function(t,i,r,n,a){if(0===r.paint.get("heatmap-opacity"))return;const o=t.context,{isRenderingToTexture:s,isRenderingGlobe:l}=a;if(t.style.map.terrain){for(const e of n){const n=i.getTile(e);i.hasRenderableParent(e)||("offscreen"===t.renderPass?gn(t,n,r,e,l):"translucent"===t.renderPass&&_n(t,r,e,s,l))}o.viewport.set([0,0,t.width,t.height])}else"offscreen"===t.renderPass?function(t,i,r,n){const a=t.context,o=a.gl,s=t.transform,l=ei.disabled,c=new He([o.ONE,o.ONE],e.bn.transparent,[!0,!0,!0,!0]);(function(t,i,r){const n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,i.width/4,i.height/4]);let a=r.heatmapFbos.get(e.cc);a?(n.bindTexture(n.TEXTURE_2D,a.colorAttachment.get()),t.bindFramebuffer.set(a.framebuffer)):(a=yn(t,i.width/4,i.height/4),r.heatmapFbos.set(e.cc,a))})(a,t,r),a.clear({color:e.bn.transparent});for(let e=0;e<n.length;e++){const h=n[e];if(i.hasRenderableParent(h))continue;const u=i.getTile(h),d=u.getBucket(r);if(!d)continue;const p=d.programConfigurations.get(r.id),m=t.useProgram("heatmap",p),f=s.getProjectionData({overscaledTileID:h,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),g=s.getCircleRadiusCorrection();m.draw(a,o.TRIANGLES,$e.disabled,l,c,Ke.backCCW,Hi(u,s.zoom,r.paint.get("heatmap-intensity"),g),null,f,r.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,r.paint,s.zoom,p)}a.viewport.set([0,0,t.width,t.height])}(t,i,r,n):"translucent"===t.renderPass&&function(t,i){const r=t.context,n=r.gl;r.setColorMode(t.colorModeForRenderPass());const a=i.heatmapFbos.get(e.cc);a&&(r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,a.colorAttachment.get()),r.activeTexture.set(n.TEXTURE1),xn(r,i).bind(n.LINEAR,n.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(r,n.TRIANGLES,$e.disabled,ei.disabled,t.colorModeForRenderPass(),Ke.disabled,qi(t,i,0,1),null,null,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom))}(t,r)}(t,i,r,n,a):e.cn(r)?function(t,e,i,r,n){if("translucent"!==t.renderPass)return;const{isRenderingToTexture:a}=n,o=i.paint.get("line-opacity"),s=i.paint.get("line-width");if(0===o.constantOr(1)||0===s.constantOr(1))return;const l=t.getDepthModeForSublayer(0,$e.ReadOnly),c=t.colorModeForRenderPass(),h=i.paint.get("line-dasharray"),u=h.constantOr(1),d=i.paint.get("line-pattern"),p=d.constantOr(1),m=i.paint.get("line-gradient"),f=i.getCrossfadeParameters();let g;g=p?"linePattern":u&&m?"lineGradientSDF":u?"lineSDF":m?"lineGradient":"line";const _=t.context,y=_.gl,x=t.transform;let b=!0;for(const n of r){const r=e.getTile(n);if(p&&!r.patternsLoaded())continue;const o=r.getBucket(i);if(!o)continue;const s=o.programConfigurations.get(i.id),v=t.context.program.get(),T=t.useProgram(g,s),w=b||T.program!==v,V=t.style.map.terrain&&t.style.map.terrain.getTerrainData(n),R=d.constantOr(null),M=h&&h.constantOr(null);if(R&&r.imageAtlas){const t=r.imageAtlas,e=t.patternPositions[R.to.toString()],i=t.patternPositions[R.from.toString()];e&&i&&s.setConstantPatternPositions(e,i)}else if(M){const e="round"===i.layout.get("line-cap").constantOr(null),r=t.lineAtlas.getDash(M.to,e),n=t.lineAtlas.getDash(M.from,e);s.setConstantDashPositions(r,n)}const U=x.getProjectionData({overscaledTileID:n,applyGlobeMatrix:!a,applyTerrainMatrix:!0}),S=x.getPixelScale();let N;p?(N=nr(t,r,i,S,f),vn(_,y,r,s,f)):u&&m?(N=or(t,r,i,S,f,o.lineClipsArray.length),Vn(t,e,_,y,i,o,n,s,f)):u?(N=ar(t,r,i,S,f),Tn(t,_,y,s,w,f)):m?(N=rr(t,r,i,S,o.lineClipsArray.length),wn(t,e,_,y,i,o,n)):N=ir(t,r,i,S);const E=t.stencilModeForClipping(n);T.draw(_,y.TRIANGLES,l,E,c,Ke.disabled,N,V,U,i.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,i.paint,t.transform.zoom,s,o.layoutVertexBuffer2),b=!1}}(t,i,r,n,a):e.co(r)?function(t,i,r,n,a){const o=r.paint.get("fill-color"),s=r.paint.get("fill-opacity");if(0===s.constantOr(1))return;const{isRenderingToTexture:l}=a,c=t.colorModeForRenderPass(),h=r.paint.get("fill-pattern"),u=t.opaquePassEnabledForLayer()&&!h.constantOr(1)&&1===o.constantOr(e.bn.transparent).a&&1===s.constantOr(0)?"opaque":"translucent";if(t.renderPass===u){const e=t.getDepthModeForSublayer(1,"opaque"===t.renderPass?$e.ReadWrite:$e.ReadOnly);Mn(t,i,r,n,e,c,!1,l)}if("translucent"===t.renderPass&&r.paint.get("fill-antialias")){const e=t.getDepthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,$e.ReadOnly);Mn(t,i,r,n,e,c,!0,l)}}(t,i,r,n,a):e.cp(r)?function(t,e,i,r,n){const a=i.paint.get("fill-extrusion-opacity");if(0===a)return;const{isRenderingToTexture:o}=n;if("translucent"===t.renderPass){const n=new $e(t.context.gl.LEQUAL,$e.ReadWrite,t.depthRangeFor3D);if(1!==a||i.paint.get("fill-extrusion-pattern").constantOr(1))Un(t,e,i,r,n,ei.disabled,He.disabled,o),Un(t,e,i,r,n,t.stencilModeFor3D(),t.colorModeForRenderPass(),o);else{const a=t.colorModeForRenderPass();Un(t,e,i,r,n,ei.disabled,a,o)}}}(t,i,r,n,a):e.cq(r)?function(t,i,r,n,a){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;const{isRenderingToTexture:o}=a,s=t.context,l=t.style.projection.useSubdivision,c=t.getDepthModeForSublayer(0,$e.ReadOnly),h=t.colorModeForRenderPass();if("offscreen"===t.renderPass)!function(t,i,r,n,a,o,s){const l=t.context,c=l.gl,h="nearest"===n.paint.get("resampling")?c.NEAREST:c.LINEAR;for(const u of r){const r=i.getTile(u),d=r.dem;if(!d||!d.data)continue;if(!r.needsHillshadePrepare)continue;const p=d.dim,m=d.stride,f=d.getPixels();if(l.activeTexture.set(c.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(m),r.demTexture){const t=r.demTexture;t.update(f,{premultiply:!1}),t.bind(c.NEAREST,c.CLAMP_TO_EDGE)}else r.demTexture=new e.T(l,f,c.RGBA,{premultiply:!1}),r.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);l.activeTexture.set(c.TEXTURE0);let g=r.fbo;if(!g){const t=new e.T(l,{width:p,height:p,data:null},c.RGBA);t.bind(h,c.CLAMP_TO_EDGE),g=r.fbo=l.createFramebuffer(p,p,!0,!1),g.colorAttachment.set(t.texture)}l.bindFramebuffer.set(g.framebuffer),l.viewport.set([0,0,p,p]),t.useProgram("hillshadePrepare").draw(l,c.TRIANGLES,a,o,s,Ke.disabled,$i(r.tileID,d),null,null,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}}(t,i,n,r,c,ei.disabled,h),s.viewport.set([0,0,t.width,t.height]);else if("translucent"===t.renderPass)if(l){const[e,a,s]=t.stencilConfigForOverlapTwoPass(n);Sn(t,i,r,s,e,c,h,!1,o),Sn(t,i,r,s,a,c,h,!0,o)}else{const[e,a]=t.getStencilConfigForOverlapAndUpdateStencilID(n);Sn(t,i,r,a,e,c,h,!1,o)}}(t,i,r,n,a):e.cr(r)?function(t,e,i,r,n){if("translucent"!==t.renderPass)return;if(!r.length)return;const{isRenderingToTexture:a}=n,o=t.style.projection.useSubdivision,s=t.getDepthModeForSublayer(0,$e.ReadOnly),l=t.colorModeForRenderPass();if(o){const[n,o,c]=t.stencilConfigForOverlapTwoPass(r);Nn(t,e,i,c,n,s,l,!1,a),Nn(t,e,i,c,o,s,l,!0,a)}else{const[n,o]=t.getStencilConfigForOverlapAndUpdateStencilID(r);Nn(t,e,i,o,n,s,l,!1,a)}}(t,i,r,n,a):e.bT(r)?function(t,e,i,r,n){if("translucent"!==t.renderPass)return;if(0===i.paint.get("raster-opacity"))return;if(!r.length)return;const{isRenderingToTexture:a}=n,o=e.getSource(),s=t.style.projection.useSubdivision;if(o instanceof $)Fn(t,e,i,r,null,!1,!1,o.tileCoords,o.flippedWindingOrder,a);else if(s){const[n,o,s]=t.stencilConfigForOverlapTwoPass(r);Fn(t,e,i,s,n,!1,!0,En,!1,a),Fn(t,e,i,s,o,!0,!0,En,!1,a)}else{const[n,o]=t.getStencilConfigForOverlapAndUpdateStencilID(r);Fn(t,e,i,o,n,!1,!0,En,!1,a)}}(t,i,r,n,a):e.cs(r)?function(t,e,i,r,n){const a=i.paint.get("background-color"),o=i.paint.get("background-opacity");if(0===o)return;const{isRenderingToTexture:s}=n,l=t.context,c=l.gl,h=t.style.projection,u=t.transform,d=u.tileSize,p=i.paint.get("background-pattern");if(t.isPatternMissing(p))return;const m=!p&&1===a.a&&1===o&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==m)return;const f=ei.disabled,g=t.getDepthModeForSublayer(0,"opaque"===m?$e.ReadWrite:$e.ReadOnly),_=t.colorModeForRenderPass(),y=t.useProgram(p?"backgroundPattern":"background"),x=r||Vt(u,{tileSize:d,terrain:t.style.map.terrain});p&&(l.activeTexture.set(c.TEXTURE0),t.imageManager.bind(t.context));const b=i.getCrossfadeParameters();for(const e of x){const r=u.getProjectionData({overscaledTileID:e,applyGlobeMatrix:!s,applyTerrainMatrix:!0}),n=p?fr(o,t,p,{tileID:e,tileSize:d},b):mr(o,a),m=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e),x=h.getMeshFromTileID(l,e.canonical,!1,!0,"raster");y.draw(l,c.TRIANGLES,g,f,_,Ke.backCCW,n,m,r,i.id,x.vertexBuffer,x.indexBuffer,x.segments)}}(t,0,r,n,a):e.ct(r)&&function(t,e,i,r){const{isRenderingGlobe:n}=r,a=t.context,o=i.implementation,s=t.style.projection,l=t.transform,c=l.getProjectionDataForCustomLayer(n),h={farZ:l.farZ,nearZ:l.nearZ,fov:l.fov*Math.PI/180,modelViewProjectionMatrix:l.modelViewProjectionMatrix,projectionMatrix:l.projectionMatrix,shaderData:{variantName:s.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;\nuniform mat4 u_projection_matrix;\n${s.shaderPreludeCode.vertexSource}`,define:s.shaderDefine},defaultProjectionData:c},u=o.renderingMode?o.renderingMode:"2d";if("offscreen"===t.renderPass){const e=o.prerender;e&&(t.setCustomLayerDefaults(),a.setColorMode(t.colorModeForRenderPass()),e.call(o,a.gl,h),a.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),a.setColorMode(t.colorModeForRenderPass()),a.setStencilMode(ei.disabled);const e="3d"===u?t.getDepthModeFor3D():t.getDepthModeForSublayer(0,$e.ReadOnly);a.setDepthMode(e),o.render(a.gl,h),a.setDirty(),t.setBaseState(),a.bindFramebuffer.set(null)}}(t,0,r,a))}saveTileTexture(t){const e=this._tileTextures[t.size[0]];e?e.length<An.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?e.push(t):t.destroy():this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!e||!i}useProgram(t,e,i=!1,r=[]){this.cache=this.cache||{};const n=!!this.style.map.terrain,a=this.style.projection,o=i?Fe.projectionMercator:a.shaderPreludeCode,s=i?We:a.shaderDefine,l=t+(e?e.cacheKey:"")+`/${i?Ie:a.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(n?"/terrain":"")+(r?`/${r.join("/")}`:"");return this.cache[l]||(this.cache[l]=new Bi(this.context,Fe[t],e,_r[t],this._showOverdrawInspector,n,o,s,r)),this.cache[l]}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(){const 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(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){var t,e;if(this._tileTextures){for(const t in this._tileTextures){const e=this._tileTextures[t];if(e)for(const t of e)t.destroy()}this._tileTextures={}}if(this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&(null===(t=this.tileExtentMesh.vertexBuffer)||void 0===t||t.destroy()),this.tileExtentMesh&&(null===(e=this.tileExtentMesh.indexBuffer)||void 0===e||e.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.cache){for(const t in this.cache){const e=this.cache[t];e&&e.program&&this.context.gl.deleteProgram(e.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:e}=this.context.gl;return this.width!==t||this.height!==e}}function Gn(t,e){let i,r=!1,n=null,a=null;const o=()=>{n=null,r&&(t.apply(a,i),n=setTimeout(o,e),r=!1)};return(...t)=>(r=!0,a=this,i=t,n||o(),n)}An.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50;class Yn{constructor(t){this._getCurrentHash=()=>{const t=window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map(t=>t.split("=")).forEach(t=>{t[0]===this._hashName&&(e=t)}),(e&&e[1]||"").split("/")}return t.split("/")},this._onHashChange=()=>{const t=this._getCurrentHash();if(!this._isValidHash(t))return!1;const e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0},this._updateHashUnthrottled=()=>{const t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{const t=this._getCurrentHash();if(0===t.length)return;const e=t.join("/");let i=e;i.split("&").length>0&&(i=i.split("&")[0]),this._hashName&&(i=`${this._hashName}=${e}`);let r=window.location.hash.replace(i,"");r.startsWith("#&")?r=r.slice(0,1)+r.slice(2):"#"===r&&(r="");let n=window.location.href.replace(/(#.+)?$/,r);n=n.replace("&&","&"),window.history.replaceState(window.history.state,null,n)},this._updateHash=Gn(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()),this._removeHash(),delete this._map,this}getHashString(t){const e=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,r=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,r),a=Math.round(e.lng*n)/n,o=Math.round(e.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch();let c="";if(c+=t?`/${a}/${o}/${i}`:`${i}/${o}/${a}`,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+=`/${Math.round(l)}`),this._hashName){const t=this._hashName;let e=!1;const i=window.location.hash.slice(1).split("&").map(i=>{const r=i.split("=")[0];return r===t?(e=!0,`${r}=${c}`):i}).filter(t=>t);return e||i.push(`${t}=${c}`),`#${i.join("&")}`}return`#${c}`}_isValidHash(t){if(t.length<3||t.some(isNaN))return!1;try{new e.V(+t[2],+t[1])}catch(t){return!1}const i=+t[0],r=+(t[3]||0),n=+(t[4]||0);return i>=this._map.getMinZoom()&&i<=this._map.getMaxZoom()&&r>=-180&&r<=180&&n>=this._map.getMinPitch()&&n<=this._map.getMaxPitch()}}const Qn={linearity:.3,easing:e.cu(0,0,.3,1)},Jn=e.e({deceleration:2500,maxSpeed:1400},Qn),Xn=e.e({deceleration:20,maxSpeed:1400},Qn),Hn=e.e({deceleration:1e3,maxSpeed:360},Qn),qn=e.e({deceleration:1e3,maxSpeed:90},Qn),Kn=e.e({deceleration:1e3,maxSpeed:360},Qn);class $n{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:c(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,e=c();for(;t.length>0&&e-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,roll:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:t}of this._inertiaBuffer)i.zoom+=t.zoomDelta||0,i.bearing+=t.bearingDelta||0,i.pitch+=t.pitchDelta||0,i.roll+=t.rollDelta||0,t.panDelta&&i.pan._add(t.panDelta),t.around&&(i.around=t.around),t.pinchAround&&(i.pinchAround=t.pinchAround);const r=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,n={};if(i.pan.mag()){const a=ea(i.pan.mag(),r,e.e({},Jn,t||{})),o=i.pan.mult(a.amount/i.pan.mag()),s=this._map.cameraHelper.handlePanInertia(o,this._map.transform);n.center=s.easingCenter,n.offset=s.easingOffset,ta(n,a)}if(i.zoom){const t=ea(i.zoom,r,Xn),a=e.cv(this._map.transform.zoom+t.amount,this._map.getZoomSnap(),t.amount);n.zoom=a,ta(n,t)}if(i.bearing){const t=ea(i.bearing,r,Hn);n.bearing=this._map.transform.bearing+e.ak(t.amount,-179,179),ta(n,t)}if(i.pitch){const t=ea(i.pitch,r,qn);n.pitch=this._map.transform.pitch+t.amount,ta(n,t)}if(i.roll){const t=ea(i.roll,r,Kn);n.roll=this._map.transform.roll+e.ak(t.amount,-179,179),ta(n,t)}if(n.zoom||n.bearing){const t=void 0===i.pinchAround?i.around:i.pinchAround;n.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),e.e(n,{noMoveStart:!0})}}function ta(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function ea(t,i,r){const{maxSpeed:n,linearity:a,deceleration:o}=r,s=e.ak(t*a/(i/1e3),-n,n),l=Math.abs(s)/(o*a);return{easing:r.easing,duration:1e3*l,amount:s*(l/2)}}class ia extends e.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r,n={}){r=r instanceof MouseEvent?r:new MouseEvent(t,r);const a=h.mousePos(i.getCanvas(),r),o=i.unproject(a);super(t,e.e({point:a,lngLat:o,originalEvent:r},n)),this._defaultPrevented=!1,this.target=i}}class ra extends e.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r){const n="touchend"===t?r.changedTouches:r.touches,a=h.touchPos(i.getCanvasContainer(),n),o=a.map(t=>i.unproject(t)),s=a.reduce((t,e,i,r)=>t.add(e.div(r.length)),new e.P(0,0));super(t,{points:a,point:s,lngLats:o,lngLat:i.unproject(s),originalEvent:r}),this._defaultPrevented=!1}}class na extends e.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i){super(t,{originalEvent:i}),this._defaultPrevented=!1}}class aa{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new na(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new ia(t.type,this._map,t))}mouseup(t){this._map.fire(new ia(t.type,this._map,t))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new ia(t.type,this._map,t))}dblclick(t){return this._firePreventable(new ia(t.type,this._map,t))}mouseover(t){this._map.fire(new ia(t.type,this._map,t))}mouseout(t){this._map.fire(new ia(t.type,this._map,t))}touchstart(t){return this._firePreventable(new ra(t.type,this._map,t))}touchmove(t){this._map.fire(new ra(t.type,this._map,t))}touchend(t){this._map.fire(new ra(t.type,this._map,t))}touchcancel(t){this._map.fire(new ra(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class oa{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new ia(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ia("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new ia(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class sa{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.screenPointToLocation(e.P.convert(t),this._map.terrain)}}class la{constructor(t,e){this._map=t,this._tr=new sa(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1,e.boxZoom&&"object"==typeof e.boxZoom&&(this._boxZoomEnd=e.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(h.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active)return;const i=e;if(this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)return;const r=this._startPos;this._lastPos=i,this._box||(this._box=h.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));const n=Math.min(r.x,i.x),a=Math.max(r.x,i.x),o=Math.min(r.y,i.y),s=Math.max(r.y,i.y);this._box.style.transform=`translate(${n}px,${o}px)`,this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"}mouseupWindow(t,i){if(!this._active)return;if(0!==t.button)return;const r=this._startPos,n=i;if(this.reset(),h.suppressClick(),r.x!==n.x||r.y!==n.y)return this._map.fire(new e.l("boxzoomend",{originalEvent:t})),this._boxZoomEnd?void this._boxZoomEnd(this._map,r,n,t):{cameraAnimation:t=>t.fitScreenCoordinates(r,n,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(this._box.remove(),this._box=null),h.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new e.l(t,{originalEvent:i}))}}function ca(t,e){if(t.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${t.length}, points ${e.length}`);const i={};for(let r=0;r<t.length;r++)i[t[r].identifier]=e[r];return i}class ha{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,i,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=function(t){const i=new e.P(0,0);for(const e of t)i._add(e);return i.div(t.length)}(i),this.touches=ca(r,i)))}touchmove(t,e,i){if(this.aborted||!this.centroid)return;const r=ca(i,e);for(const t in this.touches){const e=r[t];(!e||e.dist(this.touches[t])>30)&&(this.aborted=!0)}}touchend(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){const t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class ua{constructor(t){this.singleTap=new ha(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,i){this.singleTap.touchstart(t,e,i)}touchmove(t,e,i){this.singleTap.touchmove(t,e,i)}touchend(t,e,i){const r=this.singleTap.touchend(t,e,i);if(r){const e=t.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(r)<30;if(e&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}class da{constructor(t){this._tr=new sa(t),this._zoomIn=new ua({numTouches:1,numTaps:2}),this._zoomOut=new ua({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)}touchmove(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)}touchend(t,i,r){const n=this._zoomIn.touchend(t,i,r),a=this._zoomOut.touchend(t,i,r),o=this._tr;return n?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:i=>i.easeTo({duration:300,zoom:e.cv(o.zoom+1,i.getZoomSnap()),around:o.unproject(n)},{originalEvent:t})}):a?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:i=>i.easeTo({duration:300,zoom:e.cv(o.zoom-1,i.getZoomSnap()),around:o.unproject(a)},{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 pa{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){const e=this._moveFunction(...t);if(e.bearingDelta||e.pitchDelta||e.rollDelta||e.around||e.panDelta)return this._active=!0,e}dragStart(t,e){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(e)?e[0]:e,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,e){if(!this.isEnabled())return;const i=this._lastPoint;if(!i)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const r=Array.isArray(e)?e[0]:e;return!this._moved&&r.dist(i)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=r,this._move(i,r))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&h.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const ma=0,fa=2,ga={[ma]:1,[fa]:2};class _a{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){this._eventButton=t.button}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(t,e){const i=ga[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton)}isValidEndEvent(t){return t.button===this._eventButton}}class ya{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return 1===t.targetTouches.length}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}class xa{constructor(t=new _a({checkCorrectEvent:()=>!0}),e=new ya){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=e}_executeRelevantHandler(t,e,i){return t instanceof MouseEvent?e(t):"undefined"!=typeof TouchEvent&&t instanceof TouchEvent?i(t):void 0}startMove(t){this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.startMove(t),t=>this.oneFingerTouchMoveStateManager.startMove(t))}endMove(t){this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.endMove(t),t=>this.oneFingerTouchMoveStateManager.endMove(t))}isValidStartEvent(t){return this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidStartEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidStartEvent(t))}isValidMoveEvent(t){return this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidMoveEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(t))}isValidEndEvent(t){return this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidEndEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidEndEvent(t))}}const ba=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}};class va{constructor(t,e){this._clickTolerance=t.clickTolerance||1,this._map=e,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,e,i){return this._calculateTransform(t,e,i)}touchmove(t,e,i){if(this._active){if(!this._shouldBePrevented(i.length))return t.preventDefault(),this._calculateTransform(t,e,i);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,e,i){this._calculateTransform(t,e,i),this._active&&this._shouldBePrevented(i.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,i,r){r.length>0&&(this._active=!0);const n=ca(r,i),a=new e.P(0,0),o=new e.P(0,0);let s=0;for(const t in n){const e=n[t],i=this._touches[t];i&&(a._add(e),o._add(e.sub(i)),s++,n[t]=e)}if(this._touches=n,this._shouldBePrevented(s)||!o.mag())return;const l=o.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ta{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]))}touchmove(t,e,i){if(!this._firstTwoTouches)return;t.preventDefault();const[r,n]=this._firstTwoTouches,a=wa(i,e,r),o=wa(i,e,n);if(!a||!o)return;const s=this._aroundCenter?null:a.add(o).div(2);return this._move([a,o],s,t)}touchend(t,e,i){if(!this._firstTwoTouches)return;const[r,n]=this._firstTwoTouches,a=wa(i,e,r),o=wa(i,e,n);a&&o||(this._active&&h.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function wa(t,e,i){for(let r=0;r<t.length;r++)if(t[r].identifier===i)return e[r]}function Va(t,e){return Math.log(t/e)/Math.LN2}class Ra extends Ta{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,e){const i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Va(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Va(this._distance,i),pinchAround:e}}}function Ma(t,e){return 180*t.angleWith(e)/Math.PI}class Ua extends Ta{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,e,i){const r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Ma(this._vector,r),pinchAround:e}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const e=25/(Math.PI*this._minDiameter)*360,i=Ma(t,this._startVector);return Math.abs(i)<e}}function Sa(t){return Math.abs(t.y)>Math.abs(t.x)}class Na extends Ta{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,e,i){super.touchstart(t,e,i),this._currentTouchCount=i.length}_start(t){this._lastPoints=t,Sa(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,i){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const r=t[0].sub(this._lastPoints[0]),n=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(r,n,i.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(r.y+n.y)/2*-.5}):void 0}gestureBeginsVertically(t,e,i){if(void 0!==this._valid)return this._valid;const r=t.mag()>=2,n=e.mag()>=2;if(!r&&!n)return;if(!r||!n)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;const a=t.y>0==e.y>0;return Sa(t)&&Sa(e)&&a}}const Ea={panStep:100,bearingStep:15,pitchStep:10};class Fa{constructor(t){this._tr=new sa(t);const e=Ea;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let i=0,r=0,n=0,a=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:s=>{const l=this._tr;s.easeTo({duration:300,easeId:"keyboardHandler",easing:Za,zoom:i?e.cv(l.zoom+i*(t.shiftKey?2:1),s.getZoomSnap()):l.zoom,bearing:l.bearing+r*this._bearingStep,pitch:l.pitch+n*this._pitchStep,offset:[-a*this._panStep,-o*this._panStep],center:l.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 Za(t){return t*(2-t)}const ka=4.000244140625,za=1/450;class Wa{constructor(t,e){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new sa(t),this._triggerRenderFrame=e,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=za}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let e=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const i=c(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==e&&e%ka==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(r*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,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);const i=h.mousePos(this._map.getCanvas(),t),r=this._tr;this._aroundPoint=this._aroundCenter?r.transform.locationToScreenPoint(e.V.convert(r.center)):i,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._tr.transform;if("number"==typeof this._lastExpectedZoom){const e=t.zoom-this._lastExpectedZoom;"number"==typeof this._startZoom&&(this._startZoom+=e),"number"==typeof this._targetZoom&&(this._targetZoom+=e)}if(0!==this._delta){const i="wheel"===this._type&&Math.abs(this._delta)>ka?this._wheelZoomRate:this._defaultZoomRate;let r=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==r&&(r=1/r);const n="number"!=typeof this._targetZoom?t.scale:e.an(this._targetZoom),a=t.applyConstrain(t.getCameraLngLat(),e.aq(n*r)).zoom,o=this._map.getZoomSnap();if("wheel"===this._type&&o>0){const i=e.cv(t.zoom,o);this._targetZoom=e.cv(a,o,a-i)}else this._targetZoom=a;"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const i="number"!=typeof this._targetZoom?t.zoom:this._targetZoom,r=this._startZoom,n=this._easing;let a,o=!1;if("wheel"===this._type&&r&&n){const t=c()-this._lastWheelEventTime,s=Math.min((t+5)/200,1),l=n(s);a=e.G.number(r,i,l),s<1?this._frameId||(this._frameId=!0):o=!0}else a=i,o=!0;return this._active=!0,o&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=a,{noInertia:!0,needsRenderFrame:!o,zoomDelta:a-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=e.cx;if(this._prevEase){const t=this._prevEase,r=(c()-t.start)/t.duration,n=t.easing(r+.01)-t.easing(r),a=.27/Math.sqrt(n*n+1e-4)*.01,o=Math.sqrt(.0729-a*a);i=e.cu(a,o,.25,1)}return this._prevEase={start:c(),duration:t,easing:i},i}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Ia{constructor(t,e){this._clickZoom=t,this._tapZoom=e}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 Da{constructor(t){this._tr=new sa(t),this.reset()}reset(){this._active=!1}dblclick(t,i){return t.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:e.cv(this._tr.zoom+(t.shiftKey?-1:1),r.getZoomSnap()),around:this._tr.unproject(i)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ca{constructor(){this._tap=new ua({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,e,i){if(!this._swipePoint)if(this._tapTime){const r=e[0],n=t.timeStamp-this._tapTime<500,a=this._tapPoint.dist(r)<30;n&&a?i.length>0&&(this._swipePoint=r,this._swipeTouch=i[0].identifier):this.reset()}else this._tap.touchstart(t,e,i)}touchmove(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;const r=e[0],n=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:n/128}}}else this._tap.touchmove(t,e,i)}touchend(t,e,i){if(this._tapTime)this._swipePoint&&0===i.length&&this.reset();else{const r=this._tap.touchend(t,e,i);r&&(this._tapTime=t.timeStamp,this._tapPoint=r)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ba{constructor(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i}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 Pa{constructor(t,e,i,r){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=e,this._mousePitch=i,this._mouseRoll=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class Oa{constructor(t,e,i,r){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=r,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()}}class La{constructor(t,e){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=e,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=h.create("div","maplibregl-cooperative-gesture-screen",t);let e=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(e=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const i=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),r=document.createElement("div");r.className="maplibregl-desktop-message",r.textContent=e,this._container.appendChild(r);const n=document.createElement("div");n.className="maplibregl-mobile-message",n.textContent=i,this._container.appendChild(n),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,i){this._enabled&&(this._map.fire(new e.l("cooperativegestureprevented",{gestureType:t,originalEvent:i})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const ja=t=>t.zoom||t.drag||t.roll||t.pitch||t.rotate;class Aa extends e.l{}function Ga(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta||t.rollDelta}class Ya{get _ownerDocument(){var t;return(null===(t=this._el)||void 0===t?void 0:t.ownerDocument)||document}get _ownerWindow(){var t,e;return(null===(e=null===(t=this._el)||void 0===t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView)||window}constructor(t,i){this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,i)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;const r="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},a={},o={};for(const{handlerName:s,handler:l,allowed:c}of this._handlers){if(!l.isEnabled())continue;let u;if(this._blockedByActive(o,c,s))l.reset();else if(l[i||t.type]){if(e.cy(t,i||t.type)){const e=h.mousePos(this._map.getCanvas(),t);u=l[i||t.type](t,e)}else if(e.cz(t,i||t.type)){const e=this._getMapTouches(t.touches),r=h.touchPos(this._map.getCanvas(),e);u=l[i||t.type](t,r,e)}else e.cA(i||t.type)||(u=l[i||t.type](t));this.mergeHandlerResult(n,a,u,s,r),u&&u.needsRenderFrame&&this._triggerRenderFrame()}(u||l.isActive())&&(o[s]=l)}const s={};for(const t in this._previousActiveHandlers)o[t]||(s[t]=r);this._previousActiveHandlers=o,(Object.keys(s).length||Ga(n))&&(this._changes.push([n,a,s]),this._triggerRenderFrame()),(Object.keys(o).length||Ga(n))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:l}=n;l&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],l(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new $n(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i);const r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(const[t,e,i]of this._listeners)t.addEventListener(e,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}destroy(){for(const[t,e,i]of this._listeners)t.removeEventListener(e,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){const i=this._map,r=i.getCanvasContainer();this._add("mapEvent",new aa(i,t));const n=i.boxZoom=new la(i,t);this._add("boxZoom",n),t.interactive&&t.boxZoom&&n.enable();const a=i.cooperativeGestures=new La(i,t.cooperativeGestures);this._add("cooperativeGestures",a),t.cooperativeGestures&&a.enable();const o=new da(i),s=new Da(i);i.doubleClickZoom=new Ia(s,o),this._add("tapZoom",o),this._add("clickZoom",s),t.interactive&&t.doubleClickZoom&&i.doubleClickZoom.enable();const l=new Ca;this._add("tapDragZoom",l);const c=i.touchPitch=new Na(i);this._add("touchPitch",c),t.interactive&&t.touchPitch&&i.touchPitch.enable(t.touchPitch);const h=()=>i.project(i.getCenter()),u=function({enable:t,clickTolerance:i,aroundCenter:r=!0,minPixelCenterThreshold:n=100,rotateDegreesPerPixelMoved:a=.8},o){const s=new _a({checkCorrectEvent:t=>0===t.button&&t.ctrlKey||2===t.button&&!t.ctrlKey});return new pa({clickTolerance:i,move:(t,i)=>{const s=o();if(r&&Math.abs(s.y-t.y)>n)return{bearingDelta:e.cw(new e.P(t.x,i.y),i,s)};let l=(i.x-t.x)*a;return r&&i.y<s.y&&(l=-l),{bearingDelta:l}},moveStateManager:s,enable:t,assignEvents:ba})}(t,h),d=function({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:i=-.5}){const r=new _a({checkCorrectEvent:t=>0===t.button&&t.ctrlKey||2===t.button});return new pa({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*i}),moveStateManager:r,enable:t,assignEvents:ba})}(t),p=function({enable:t,clickTolerance:e,rollDegreesPerPixelMoved:i=.3},r){const n=new _a({checkCorrectEvent:t=>2===t.button&&t.ctrlKey});return new pa({clickTolerance:e,move:(t,e)=>{const n=r();let a=(e.x-t.x)*i;return e.y<n.y&&(a=-a),{rollDelta:a}},moveStateManager:n,enable:t,assignEvents:ba})}(t,h);i.dragRotate=new Pa(t,u,d,p),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",d,["mouseRotate","mouseRoll"]),this._add("mouseRoll",p,["mousePitch"]),t.interactive&&t.dragRotate&&i.dragRotate.enable();const m=function({enable:t,clickTolerance:e}){const i=new _a({checkCorrectEvent:t=>0===t.button&&!t.ctrlKey});return new pa({clickTolerance:e,move:(t,e)=>({around:e,panDelta:e.sub(t)}),activateOnStart:!0,moveStateManager:i,enable:t,assignEvents:ba})}(t),f=new va(t,i);i.dragPan=new Ba(r,m,f),this._add("mousePan",m),this._add("touchPan",f,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&i.dragPan.enable(t.dragPan);const g=new Ua,_=new Ra;i.touchZoomRotate=new Oa(r,_,g,l),this._add("touchRotate",g,["touchPan","touchZoom"]),this._add("touchZoom",_,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&i.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new oa(i));const y=i.scrollZoom=new Wa(i,()=>this._triggerRenderFrame());this._add("scrollZoom",y,["mousePan"]),t.interactive&&t.scrollZoom&&i.scrollZoom.enable(t.scrollZoom);const x=i.keyboard=new Fa(i);this._add("keyboard",x),t.interactive&&t.keyboard&&i.keyboard.enable()}_add(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(const{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{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(ja(this._eventsInProgress))||this.isZooming()}_blockedByActive(t,e,i){for(const r in t)if(r!==i&&(!e||e.indexOf(r)<0))return!0;return!1}_getMapTouches(t){const e=[];for(const i of t)this._el.contains(i.target)&&e.push(i);return e}mergeHandlerResult(t,i,r,n,a){if(!r)return;e.e(t,r);const o={handlerName:n,originalEvent:r.originalEvent||a};void 0!==r.zoomDelta&&(i.zoom=o),void 0!==r.panDelta&&(i.drag=o),void 0!==r.rollDelta&&(i.roll=o),void 0!==r.pitchDelta&&(i.pitch=o),void 0!==r.bearingDelta&&(i.rotate=o)}_applyChanges(){const t={},i={},r={};for(const[n,a,o]of this._changes)n.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(n.panDelta)),n.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+n.zoomDelta),n.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+n.bearingDelta),n.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+n.pitchDelta),n.rollDelta&&(t.rollDelta=(t.rollDelta||0)+n.rollDelta),void 0!==n.around&&(t.around=n.around),void 0!==n.pinchAround&&(t.pinchAround=n.pinchAround),n.noInertia&&(t.noInertia=n.noInertia),e.e(i,a),e.e(r,o);this._updateMapTransform(t,i,r),this._changes=[]}_updateMapTransform(t,e,i){const r=this._map,n=r._getTransformForUpdate(),a=r.terrain;if(!(Ga(t)||a&&this._terrainMovement))return this._fireEvents(e,i,!0);r._stop(!0);let{panDelta:o,zoomDelta:s,bearingDelta:l,pitchDelta:c,rollDelta:h,around:u,pinchAround:d}=t;void 0!==d&&(u=d),u=u||r.transform.centerPoint,a&&!n.isPointOnMapSurface(u)&&(u=n.centerPoint);const p={panDelta:o,zoomDelta:s,rollDelta:h,pitchDelta:c,bearingDelta:l,around:u};this._map.cameraHelper.useGlobeControls&&!n.isPointOnMapSurface(u)&&(u=n.centerPoint);const m=u.distSqr(n.centerPoint)<.01?n.center:n.screenPointToLocation(o?u.sub(o):u);this._handleMapControls({terrain:a,tr:n,deltasForHelper:p,preZoomAroundLoc:m,combinedEventsInProgress:e,panDelta:o}),r._applyUpdatedTransform(n),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,i,!0)}_handleMapControls({terrain:t,tr:e,deltasForHelper:i,preZoomAroundLoc:r,combinedEventsInProgress:n,panDelta:a}){const o=this._map.cameraHelper;if(o.handleMapControlsRollPitchBearingZoom(i,e),t)return o.useGlobeControls?(this._terrainMovement||!n.drag&&!n.zoom||(this._terrainMovement=!0,this._map._elevationFreeze=!0),void o.handleMapControlsPan(i,e,r)):this._terrainMovement||!n.drag&&!n.zoom?void(n.drag&&this._terrainMovement&&a?e.setCenter(e.screenPointToLocation(e.centerPoint.sub(a))):o.handleMapControlsPan(i,e,r)):(this._terrainMovement=!0,this._map._elevationFreeze=!0,void o.handleMapControlsPan(i,e,r));o.handleMapControlsPan(i,e,r)}_fireEvents(t,i,r){const n=ja(this._eventsInProgress),a=ja(t),o={};for(const e in t){const{originalEvent:i}=t[e];this._eventsInProgress[e]||(o[`${e}start`]=i),this._eventsInProgress[e]=t[e]}!n&&a&&this._fireEvent("movestart",a.originalEvent);for(const t in o)this._fireEvent(t,o[t]);a&&this._fireEvent("move",a.originalEvent);for(const e in t){const{originalEvent:i}=t[e];this._fireEvent(e,i)}const l={};let c;for(const t in this._eventsInProgress){const{handlerName:e,originalEvent:r}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],c=i[e]||r,l[`${t}end`]=c)}for(const t in l)this._fireEvent(t,l[t]);const h=ja(this._eventsInProgress),u=(n||a)&&!h;if(u&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const t=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&t.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(t)}if(r&&u){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;!t||!t.essential&&s.prefersReducedMotion?(this._map.fire(new e.l("moveend",{originalEvent:c})),i(this._map.getBearing())&&this._map.resetNorth()):(i(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this._map.easeTo(t,{originalEvent:c})),this._updatingCamera=!1}}_fireEvent(t,i){this._map.fire(new e.l(t,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new Aa("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class Qa extends e.E{constructor(t,e,i){super(),this._renderFrameCallback=()=>{const t=Math.min((c()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=i.bearingSnap,this._zoomSnap=i.zoomSnap,this.cameraHelper=e,this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(t,e){t.apply(this.transform,!0),this.transform=t,this.cameraHelper=e}getCenter(){return new e.V(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,e){return this.jumpTo({elevation:t},e),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,i,r){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.e({offset:t},i),r)}panTo(t,i,r){return this.easeTo(e.e({center:t},i),r)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,i,r){return this.easeTo(e.e({zoom:t},i),r)}zoomIn(t,i){return this.zoomTo(e.cv(this.getZoom()+1,this._zoomSnap),t,i),this}zoomOut(t,i){return this.zoomTo(e.cv(this.getZoom()-1,this._zoomSnap),t,i),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,i){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new e.l("movestart",i)).fire(new e.l("move",i)).fire(new e.l("moveend",i))),this}getBearing(){return this.transform.bearing}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(t,i,r){return this.easeTo(e.e({bearing:t},i),r)}resetNorth(t,i){return this.rotateTo(0,e.e({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo(e.e({bearing:0,pitch:0,roll:0,duration:1e3},t),i),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}getRoll(){return this.transform.roll}setRoll(t,e){return this.jumpTo({roll:t},e),this}cameraForBounds(t,e){t=O.convert(t).adjustAntiMeridian();const i=e&&e.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,e)}_cameraForBoxAndBearing(t,i,r,n){const a={top:0,bottom:0,right:0,left:0};if("number"==typeof(n=e.e({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding){const t=n.padding;n.padding={top:t,bottom:t,right:t,left:t}}const o=e.e(a,n.padding);n.padding=o;const s=this.transform,l=new O(t,i),c=this.cameraHelper.cameraForBoxAndBearing(n,o,l,r,s);return c&&this._zoomSnap&&(c.zoom=e.cv(c.zoom,this._zoomSnap,-1)),c}fitBounds(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)}fitScreenCoordinates(t,i,r,n,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(e.P.convert(t)),this.transform.screenPointToLocation(e.P.convert(i)),r,n),n,a)}_fitInternal(t,i,r){return t?(delete(i=e.e(t,i)).padding,i.linear?this.easeTo(i,r):this.flyTo(i,r)):this}jumpTo(t,i){this.stop(),"zoom"in t&&this._zoomSnap&&(t.zoom=e.cv(t.zoom,this._zoomSnap));const r=this._getTransformForUpdate();let n=!1,a=!1,o=!1;const s=r.zoom;this.terrain&&r.setElevation(this.terrain.getElevationForLngLatZoom(t.center?e.V.convert(t.center):r.center,t.zoom||r.tileZoom)),this.cameraHelper.handleJumpToCenterZoom(r,t);const l=r.zoom!==s;return"elevation"in t&&r.elevation!==+t.elevation&&r.setElevation(+t.elevation),"bearing"in t&&r.bearing!==+t.bearing&&(n=!0,r.setBearing(+t.bearing)),"pitch"in t&&r.pitch!==+t.pitch&&(a=!0,r.setPitch(+t.pitch)),"roll"in t&&r.roll!==+t.roll&&(o=!0,r.setRoll(+t.roll)),null==t.padding||r.isPaddingEqual(t.padding)||r.setPadding(t.padding),this._applyUpdatedTransform(r),this.fire(new e.l("movestart",i)).fire(new e.l("move",i)),l&&this.fire(new e.l("zoomstart",i)).fire(new e.l("zoom",i)).fire(new e.l("zoomend",i)),n&&this.fire(new e.l("rotatestart",i)).fire(new e.l("rotate",i)).fire(new e.l("rotateend",i)),a&&this.fire(new e.l("pitchstart",i)).fire(new e.l("pitch",i)).fire(new e.l("pitchend",i)),o&&this.fire(new e.l("rollstart",i)).fire(new e.l("roll",i)).fire(new e.l("rollend",i)),this.fire(new e.l("moveend",i))}calculateCameraOptionsFromTo(t,i,r,n=0){const a=e.a6.fromLngLat(t,i),o=e.a6.fromLngLat(r,n),s=o.x-a.x,l=o.y-a.y,c=o.z-a.z,h=Math.hypot(s,l,c);if(0===h)throw new Error("Can't calculate camera options with same From and To");const u=Math.hypot(s,l),d=e.aq(this.transform.cameraToCenterDistance/h/this.transform.tileSize),p=180*Math.atan2(s,-l)/Math.PI;let m=180*Math.acos(u/h)/Math.PI;return m=c<0?90-m:90+m,{center:o.toLngLat(),elevation:n,zoom:d,pitch:m,bearing:p}}calculateCameraOptionsFromCameraLngLatAltRotation(t,e,i,r,n){const a=this.transform.calculateCenterFromCameraLngLatAlt(t,e,i,r);return{center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:i,pitch:r,roll:n}}easeTo(t,i){this._stop(!1,t.easeId),"zoom"in(t=e.e({offset:[0,0],duration:500,easing:e.cx},t))&&this._zoomSnap&&(t.zoom=e.cv(t.zoom,this._zoomSnap)),(!1===t.animate||!t.essential&&s.prefersReducedMotion)&&(t.duration=0);const r=this._getTransformForUpdate(),n=this.getBearing(),a=r.pitch,o=r.roll,l="bearing"in t?this._normalizeBearing(t.bearing,n):n,c="pitch"in t?+t.pitch:a,h="roll"in t?this._normalizeBearing(t.roll,o):o,u="padding"in t?t.padding:r.padding,d=e.P.convert(t.offset);let p,m;t.around&&(p=e.V.convert(t.around),m=r.locationToScreenPoint(p));const f={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},g=this.cameraHelper.handleEaseTo(r,{bearing:l,pitch:c,roll:h,padding:u,around:p,aroundPoint:m,offsetAsPoint:d,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating=this._rotating||n!==l,this._pitching=this._pitching||c!==a,this._rolling=this._rolling||h!==o,this._padding=!r.isPaddingEqual(u),this._zooming=this._zooming||g.isZooming,this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,f),this.terrain&&this._prepareElevation(g.elevationCenter),this._ease(e=>{g.easeFunc(e),this.terrain&&!t.freezeElevation&&this._updateElevation(e),this._applyUpdatedTransform(r),this._fireMoveEvents(i)},e=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i,e)},t),this}_prepareEase(t,i,r={}){this._moving=!0,i||r.moving||this.fire(new e.l("movestart",t)),this._zooming&&!r.zooming&&this.fire(new e.l("zoomstart",t)),this._rotating&&!r.rotating&&this.fire(new e.l("rotatestart",t)),this._pitching&&!r.pitching&&this.fire(new e.l("pitchstart",t)),this._rolling&&!r.rolling&&this.fire(new e.l("rollstart",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){void 0!==this._elevationStart&&void 0!==this._elevationCenter||this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const i=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&i!==this._elevationTarget){const e=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(e-(i-(e*t+this._elevationStart))/(1-t)),this._elevationTarget=i}this.transform.setElevation(e.G.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};const e=t.getCameraLngLat(),i=t.getCameraAltitude(),r=this.terrain?this.terrain.getElevationForLngLatZoom(e,t.zoom):0;if(i<r){const i=this.calculateCameraOptionsFromTo(e,r,t.center,t.elevation);return{pitch:i.pitch,zoom:i.zoom}}return{}}_applyUpdatedTransform(t){const e=[];if(e.push(t=>this._elevateCameraIfInsideTerrain(t)),this.transformCameraUpdate&&e.push(t=>this.transformCameraUpdate(t)),!e.length)return;const i=t.clone();for(const t of e){const e=i.clone(),{center:r,zoom:n,roll:a,pitch:o,bearing:s,elevation:l}=t(e);r&&e.setCenter(r),void 0!==l&&e.setElevation(l),void 0!==n&&e.setZoom(n),void 0!==a&&e.setRoll(a),void 0!==o&&e.setPitch(o),void 0!==s&&e.setBearing(s),i.apply(e,!1)}this.transform.apply(i,!1)}_fireMoveEvents(t){this.fire(new e.l("move",t)),this._zooming&&this.fire(new e.l("zoom",t)),this._rotating&&this.fire(new e.l("rotate",t)),this._pitching&&this.fire(new e.l("pitch",t)),this._rolling&&this.fire(new e.l("roll",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId;const r=this._zooming,n=this._rotating,a=this._pitching,o=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,r&&this.fire(new e.l("zoomend",t)),n&&this.fire(new e.l("rotateend",t)),a&&this.fire(new e.l("pitchend",t)),o&&this.fire(new e.l("rollend",t)),this.fire(new e.l("moveend",t))}flyTo(t,i){if(!t.essential&&s.prefersReducedMotion){const r=e.U(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(r,i)}this.stop(),"zoom"in(t=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.cx},t))&&this._zoomSnap&&(t.zoom=e.cv(t.zoom,this._zoomSnap));const r=this._getTransformForUpdate(),n=r.bearing,a=r.pitch,o=r.roll,l=r.padding,c="bearing"in t?this._normalizeBearing(t.bearing,n):n,h="pitch"in t?+t.pitch:a,u="roll"in t?this._normalizeBearing(t.roll,o):o,d="padding"in t?t.padding:r.padding,p=e.P.convert(t.offset);let m=r.centerPoint.add(p);const f=r.screenPointToLocation(m),g=this.cameraHelper.handleFlyTo(r,{bearing:c,pitch:h,roll:u,padding:d,locationAtOffset:f,offsetAsPoint:p,center:t.center,minZoom:t.minZoom,zoom:t.zoom});let _=t.curve;const y=Math.max(r.width,r.height),x=y/g.scaleOfZoom,b=g.pixelPathLength;"number"==typeof g.scaleOfMinZoom&&(_=Math.sqrt(y/g.scaleOfMinZoom/b*2));const v=_*_;function T(t){const e=(x*x-y*y+(t?-1:1)*v*v*b*b)/(2*(t?x:y)*v*b);return Math.log(Math.sqrt(e*e+1)-e)}function w(t){return(Math.exp(t)-Math.exp(-t))/2}function V(t){return(Math.exp(t)+Math.exp(-t))/2}const R=T(!1);let M=function(t){return V(R)/V(R+_*t)},U=function(t){return y*((V(R)*(w(e=R+_*t)/V(e))-w(R))/v)/b;var e},S=(T(!0)-R)/_;if(Math.abs(b)<2e-6||!isFinite(S)){if(Math.abs(y-x)<1e-6)return this.easeTo(t,i);const e=x<y?-1:1;S=Math.abs(Math.log(x/y))/_,U=()=>0,M=t=>Math.exp(e*_*t)}return t.duration="duration"in t?+t.duration:1e3*S/("screenSpeed"in t?+t.screenSpeed/_:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=n!==c,this._pitching=h!==a,this._rolling=u!==o,this._padding=!r.isPaddingEqual(d),this._prepareEase(i,!1),this.terrain&&this._prepareElevation(g.targetCenter),this._ease(s=>{const f=s*S,_=1/M(f),y=U(f);this._rotating&&r.setBearing(e.G.number(n,c,s)),this._pitching&&r.setPitch(e.G.number(a,h,s)),this._rolling&&r.setRoll(e.G.number(o,u,s)),this._padding&&(r.interpolatePadding(l,d,s),m=r.centerPoint.add(p)),g.easeFunc(s,_,y,m),this.terrain&&!t.freezeElevation&&this._updateElevation(s),this._applyUpdatedTransform(r),this._fireMoveEvents(i)},()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){var i;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,e)}return t||null===(i=this.handlers)||void 0===i||i.stop(!1),this}_ease(t,e,i){!1===i.animate||0===i.duration?(t(1),e()):(this._easeStart=c(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,i){t=e.W(t,-180,180);const r=Math.abs(t-i);return Math.abs(t-360-i)<r&&(t-=360),Math.abs(t+360-i)<r&&(t+=360),t}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(e.V.convert(t),this.transform):null}}const Ja={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Xa{constructor(t=Ja){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=t=>{!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType&&"terrain"!==t.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?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.compact,this._container=h.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=h.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=h.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(){this._container.remove(),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,e){const i=this._map._getUIString(`AttributionControl.${e}`);t.title=i,t.setAttribute("aria-label",i)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(t=>"string"!=typeof t?"":t)):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}const e=this._map.style.tileManagers;for(const i in e){const r=e[i];if(r.used||r.usedForTerrain){const e=r.getSource();e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}}t=t.filter(t=>String(t).trim()),t.sort((t,e)=>t.length-e.length),t=t.filter((e,i)=>{for(let r=i+1;r<t.length;r++)if(t[r].indexOf(e)>=0)return!1;return!0});const i=t.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=h.sanitize(i),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ha{constructor(t={}){this._updateCompact=()=>{const t=this._container.children;if(t.length){const e=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&e.classList.add("maplibregl-compact"):e.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=h.create("div","maplibregl-ctrl");const e=h.create("a","maplibregl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class qa{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){const e=this._currentlyRunning,i=e?this._queue.concat(e):this._queue;for(const e of i)if(e.id===t)return void(e.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const e=this._currentlyRunning=this._queue;this._queue=[];for(const i of e)if(!i.cancelled&&(i.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ka=e.aS([{name:"a_pos3d",type:"Int16",components:3}]);class $a extends e.E{constructor(t){super(),this._lastTilesetChange=c(),this.tileManager=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=t._source.tileSize*2**this.deltaZoom,t.usedForTerrain=!0,t.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null}getSource(){return this.tileManager._source}update(t,i){this.tileManager.update(t,i),this._renderableTilesKeys=[];const r={};for(const n of Vt(t,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:i,calculateTileZoom:this.tileManager._source.calculateTileZoom}))r[n.key]=!0,this._renderableTilesKeys.push(n.key),this._tiles[n.key]||(n.terrainRttPosMatrix32f=new Float64Array(16),e.c6(n.terrainRttPosMatrix32f,0,e.a5,e.a5,0,0,1),this._tiles[n.key]=new ht(n,this.tileSize),this._lastTilesetChange=c());for(const t in this._tiles)r[t]||delete this._tiles[t]}freeRtt(t){for(const e in this._tiles){const i=this._tiles[e];(!t||i.tileID.equals(t)||i.tileID.isChildOf(t)||t.isChildOf(i.tileID))&&(i.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t,e){return e?this._getTerrainCoordsForTileRanges(t,e):this._getTerrainCoordsForRegularTile(t)}_getTerrainCoordsForRegularTile(t){const i={};for(const r of this._renderableTilesKeys){const n=this._tiles[r].tileID,a=t.clone(),o=e.bi();if(n.canonical.equals(t.canonical))e.c6(o,0,e.a5,e.a5,0,0,1);else if(n.canonical.isChildOf(t.canonical)){const i=n.canonical.z-t.canonical.z,r=n.canonical.x-(n.canonical.x>>i<<i),a=n.canonical.y-(n.canonical.y>>i<<i),s=e.a5>>i;e.c6(o,0,s,s,0,0,1),e.O(o,o,[-r*s,-a*s,0])}else{if(!t.canonical.isChildOf(n.canonical))continue;{const i=t.canonical.z-n.canonical.z,r=t.canonical.x-(t.canonical.x>>i<<i),a=t.canonical.y-(t.canonical.y>>i<<i),s=e.a5>>i;e.c6(o,0,e.a5,e.a5,0,0,1),e.O(o,o,[r*s,a*s,0]),e.Q(o,o,[1/2**i,1/2**i,0])}}a.terrainRttPosMatrix32f=new Float32Array(o),i[r]=a}return i}_getTerrainCoordsForTileRanges(t,i){const r={};for(const n of this._renderableTilesKeys){const a=this._tiles[n].tileID;if(!this._isWithinTileRanges(a,i))continue;const o=t.clone(),s=e.bi();if(a.canonical.z===t.canonical.z){const i=t.canonical.x-a.canonical.x+t.wrap*(1<<t.canonical.z),r=t.canonical.y-a.canonical.y;e.c6(s,0,e.a5,e.a5,0,0,1),e.O(s,s,[i*e.a5,r*e.a5,0])}else if(a.canonical.z>t.canonical.z){const i=a.canonical.z-t.canonical.z,r=a.canonical.x-(a.canonical.x>>i<<i)+t.wrap*(1<<a.canonical.z),n=a.canonical.y-(a.canonical.y>>i<<i),o=t.canonical.x-(a.canonical.x>>i),l=t.canonical.y-(a.canonical.y>>i),c=e.a5>>i;e.c6(s,0,c,c,0,0,1),e.O(s,s,[-r*c+o*e.a5,-n*c+l*e.a5,0])}else{const i=t.canonical.z-a.canonical.z,r=t.canonical.x-(t.canonical.x>>i<<i)+t.wrap*(1<<t.canonical.z),n=t.canonical.y-(t.canonical.y>>i<<i),o=(t.canonical.x>>i)-a.canonical.x,l=(t.canonical.y>>i)-a.canonical.y,c=e.a5<<i;e.c6(s,0,c,c,0,0,1),e.O(s,s,[r*e.a5+o*c,n*e.a5+l*c,0])}o.terrainRttPosMatrix32f=new Float32Array(s),r[n]=o}return r}getSourceTile(t,e){const i=this.tileManager._source;let r=t.overscaledZ-this.deltaZoom;if(r>i.maxzoom&&(r=i.maxzoom),r<i.minzoom)return;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(r).key);let n=this.findTileInCaches(this._sourceTileCache[t.key]);if(!(null==n?void 0:n.dem)&&e)for(;r>=i.minzoom&&!(null==n?void 0:n.dem);)n=this.findTileInCaches(t.scaledTo(r--).key);return n}findTileInCaches(t){let e=this.tileManager.getTileByID(t);return e||(e=this.tileManager._outOfViewCache.getByKey(t),e)}anyTilesAfterTime(t=Date.now()){return this._lastTilesetChange>=t}_isWithinTileRanges(t,e){const i=e[t.canonical.z];return!!i&&(t.wrap>i.minWrap||t.wrap<i.maxWrap||t.canonical.x>=i.minTileXWrapped&&t.canonical.x<=i.maxTileXWrapped&&t.canonical.y>=i.minTileY&&t.canonical.y<=i.maxTileY)}}class to{constructor(t,e,i){this._meshCache={},this.painter=t,this.tileManager=new $a(e),this.options=i,this.exaggeration="number"==typeof i.exaggeration?i.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}destroy(){this._fbo&&(this._fbo.destroy(),this._fbo=null),this._fboCoordsTexture&&(this._fboCoordsTexture.destroy(),this._fboCoordsTexture=null),this._fboDepthTexture&&(this._fboDepthTexture.destroy(),this._fboDepthTexture=null),this._emptyDemTexture&&(this._emptyDemTexture.destroy(),this._emptyDemTexture=null),this._emptyDepthTexture&&(this._emptyDepthTexture.destroy(),this._emptyDepthTexture=null),this._coordsTexture&&(this._coordsTexture.destroy(),this._coordsTexture=null);for(const t in this._meshCache)this._meshCache[t].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(t,i,r,n=e.a5){var a;const o=t.normalizeCoordinates(i,r,n);if(!o)return 0;const s=this.getTerrainData(o.tileID),l=null===(a=s.tile)||void 0===a?void 0:a.dem;if(!l)return 0;const c=e.cB([],[o.x/n*e.a5,o.y/n*e.a5],s.u_terrain_matrix),h=[c[0]*l.dim,c[1]*l.dim],u=Math.floor(h[0]),d=Math.floor(h[1]),p=h[0]-u,m=h[1]-d;return l.get(u,d)*(1-p)*(1-m)+l.get(u+1,d)*p*(1-m)+l.get(u,d+1)*(1-p)*m+l.get(u+1,d+1)*p*m}getElevationForLngLatZoom(t,i){if(!e.cC(i,t.wrap()))return 0;const{tileID:r,mercatorX:n,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(t,i);return this.getElevation(r,n%e.a5,a%e.a5,e.a5)}getElevationForLngLat(t,e){const i=Vt(e,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this});let r=0;for(const t of i)t.canonical.z>r&&(r=Math.min(t.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(t,r)}getElevation(t,i,r,n=e.a5){return this.getDEMElevation(t,i,r,n)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const t=this.painter.context,i=new e.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new e.T(t,i,t.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new e.T(t,new e.R({width:1,height:1}),t.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.ao([])}const i=this.tileManager.getSourceTile(t,!0);if(i&&i.dem&&(!i.demTexture||i.needsTerrainPrepare)){const t=this.painter.context;i.demTexture=this.painter.getTileTexture(i.dem.stride),i.demTexture?i.demTexture.update(i.dem.getPixels(),{premultiply:!1}):i.demTexture=new e.T(t,i.dem.getPixels(),t.gl.RGBA,{premultiply:!1}),i.demTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),i.needsTerrainPrepare=!1}const r=i&&i.toString()+i.tileID.key+t.key;if(r&&!this._demMatrixCache[r]){const r=this.tileManager.getSource().maxzoom;let n=t.canonical.z-i.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=r?n=t.canonical.z-r:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const a=t.canonical.x-(t.canonical.x>>n<<n),o=t.canonical.y-(t.canonical.y>>n<<n),s=e.cD(new Float64Array(16),[1/(e.a5<<n),1/(e.a5<<n),0]);e.O(s,s,[a*e.a5,o*e.a5,0]),this._demMatrixCache[t.key]={matrix:s,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:i&&i.dem&&i.dem.dim||1,u_terrain_matrix:r?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:i&&i.dem&&i.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(i&&i.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:i}}getFramebuffer(t){const i=this.painter,r=i.width/devicePixelRatio,n=i.height/devicePixelRatio;return!this._fbo||this._fbo.width===r&&this._fbo.height===n||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new e.T(i.context,{width:r,height:n,data:null},i.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(i.context.gl.NEAREST,i.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new e.T(i.context,{width:r,height:n,data:null},i.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(i.context.gl.NEAREST,i.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=i.context.createFramebuffer(r,n,!0,!1),this._fbo.depthAttachment.set(i.context.createRenderbuffer(i.context.gl.DEPTH_COMPONENT16,r,n))),this._fbo.colorAttachment.set("coords"===t?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const i=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let t=0,e=0;t<this._coordsTextureSize;t++)for(let r=0;r<this._coordsTextureSize;r++,e+=4)i[e+0]=255&r,i[e+1]=255&t,i[e+2]=r>>8<<4|t>>8,i[e+3]=0;const r=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(i.buffer)),n=new e.T(t,r,t.gl.RGBA,{premultiply:!1});return n.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=n,n}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);const i=new Uint8Array(4),r=this.painter.context,n=r.gl,a=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),o=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),s=Math.round(this.painter.height/devicePixelRatio);r.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),n.readPixels(a,s-o-1,1,1,n.RGBA,n.UNSIGNED_BYTE,i),r.bindFramebuffer.set(null);const l=i[0]+(i[2]>>4<<8),c=i[1]+((15&i[2])<<8),h=this.coordsIndex[255-i[3]],u=h&&this.tileManager.getTileByID(h);if(!u)return null;const d=this._coordsTextureSize,p=(1<<u.tileID.canonical.z)*d;return new e.a6((u.tileID.canonical.x*d+l)/p+u.tileID.wrap,(u.tileID.canonical.y*d+c)/p,this.getElevation(u.tileID,l,c,d))}depthAtPoint(t){const e=new Uint8Array(4),i=this.painter.context,r=i.gl;return i.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),r.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,e),i.bindFramebuffer.set(null),(e[0]/16777216+e[1]/65536+e[2]/256+e[3])/256}getTerrainMesh(t){var i;const r=(null===(i=this.painter.style.projection)||void 0===i?void 0:i.transitionState)>0,n=r&&0===t.canonical.y,a=r&&t.canonical.y===(1<<t.canonical.z)-1,o=`m_${n?"n":""}_${a?"s":""}`;if(this._meshCache[o])return this._meshCache[o];const s=this.painter.context,l=new e.cE,c=new e.aW,h=this.meshSize,u=e.a5/h,d=h*h;for(let t=0;t<=h;t++)for(let e=0;e<=h;e++)l.emplaceBack(e*u,t*u,0);for(let t=0;t<d;t+=h+1)for(let e=0;e<h;e++)c.emplaceBack(e+t,h+e+t+1,h+e+t+2),c.emplaceBack(e+t,h+e+t+2,e+t+1);const p=l.length,m=p+(h+1),f=(h+1)*h,g=n?e.bp:0,_=n?0:1,y=a?e.bq:e.a5,x=a?0:1;for(let t=0;t<=h;t++)l.emplaceBack(t*u,g,_);for(let t=0;t<=h;t++)l.emplaceBack(t*u,y,x);for(let t=0;t<h;t++)c.emplaceBack(f+t,m+t,m+t+1),c.emplaceBack(f+t,m+t+1,f+t+1),c.emplaceBack(0+t,p+t+1,p+t),c.emplaceBack(0+t,0+t+1,p+t+1);const b=l.length,v=b+2*(h+1);for(const t of[0,1])for(let i=0;i<=h;i++)for(const r of[0,1])l.emplaceBack(t*e.a5,i*u,r);for(let t=0;t<2*h;t+=2)c.emplaceBack(b+t,b+t+1,b+t+3),c.emplaceBack(b+t,b+t+3,b+t+2),c.emplaceBack(v+t,v+t+3,v+t+1),c.emplaceBack(v+t,v+t+2,v+t+3);const T=new ke(s.createVertexBuffer(l,Ka.members),s.createIndexBuffer(c),e.aV.simpleSegment(0,0,l.length,c.length));return this._meshCache[o]=T,T}getMeshFrameDelta(t){return 2*Math.PI*e.bC/Math.pow(2,Math.max(t,0))/5}getMinTileElevationForLngLatZoom(t,i){var r;if(!e.cC(i,t.wrap()))return 0;const{tileID:n}=this._getOverscaledTileIDFromLngLatZoom(t,i);return null!==(r=this.getMinMaxElevation(n).minElevation)&&void 0!==r?r:0}getMinMaxElevation(t){const e=this.getTerrainData(t).tile,i={minElevation:null,maxElevation:null};return e&&e.dem&&(i.minElevation=e.dem.min*this.exaggeration,i.maxElevation=e.dem.max*this.exaggeration),i}_getOverscaledTileIDFromLngLatZoom(t,i){const r=e.a6.fromLngLat(t.wrap()),n=(1<<i)*e.a5,a=r.x*n,o=r.y*n,s=Math.floor(a/e.a5),l=Math.floor(o/e.a5);return{tileID:new e.a2(i,0,i,s,l),mercatorX:a,mercatorY:o}}}class eo{constructor(t,e,i){this._context=t,this._size=e,this._tileSize=i,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const i=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),r=new e.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return r.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),i.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),i.colorAttachment.set(r.texture),{id:t,fbo:i,texture:r,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(e=>t.id!==e),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some(t=>!t.inUse)}}const io={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class ro{constructor(t,e){this.painter=t,this.terrain=e,this.pool=new eo(t.context,30,e.tileManager.tileSize*e.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,e){var i,r;this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter(i=>!t._layers[i].isHidden(e)),this._coordsAscending={};for(const e in t.tileManagers){this._coordsAscending[e]={};const i=t.tileManagers[e].getVisibleCoordinates(),r=t.tileManagers[e].getSource(),n=r instanceof $?r.terrainTileRanges:null;for(const t of i){const i=this.terrain.tileManager.getTerrainCoords(t,n);for(const t in i)this._coordsAscending[e][t]||(this._coordsAscending[e][t]=[]),this._coordsAscending[e][t].push(i[t])}}this._rttFingerprints={};for(const e of t._order){const n=t._layers[e],a=n.source;if(io[n.type]&&!this._rttFingerprints[a]){this._rttFingerprints[a]={};const e=null!==(r=null===(i=t.tileManagers[a])||void 0===i?void 0:i.getState().revision)&&void 0!==r?r:0;for(const t in this._coordsAscending[a])this._rttFingerprints[a][t]=`${this._coordsAscending[a][t].map(t=>t.key).sort().join()}#${e}`}}for(const t of this._renderableTiles)for(const e in this._rttFingerprints){const i=this._rttFingerprints[e][t.tileID.key];i&&i!==t.rttFingerprint[e]&&(t.rtt=[])}}renderLayer(t,i){if(t.isHidden(this.painter.transform.zoom))return!1;const r=Object.assign(Object.assign({},i),{isRenderingToTexture:!0}),n=t.type,a=this.painter,o=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(io[n]&&(this._prevType&&io[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!o))return!0;if(io[this._prevType]||io[n]&&o){this._prevType=n;const t=this._stacks.length-1,i=this._stacks[t]||[];for(const n of this._renderableTiles){if(this.pool.isFull()&&(Ln(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(n),n.rtt[t]){const e=this.pool.getObjectForId(n.rtt[t].id);if(e.stamp===n.rtt[t].stamp){this.pool.useObject(e);continue}}const o=this.pool.getOrCreateFreeObject();this.pool.useObject(o),this.pool.stampObject(o),n.rtt[t]={id:o.id,stamp:o.stamp},a.context.bindFramebuffer.set(o.fbo.framebuffer),a.context.clear({color:e.bn.transparent,stencil:0}),a.currentStencilSource=void 0;for(let t=0;t<i.length;t++){const e=a.style._layers[i[t]],s=e.source?this._coordsAscending[e.source][n.tileID.key]:[n.tileID];a.context.viewport.set([0,0,o.fbo.width,o.fbo.height]),a._renderTileClippingMasks(e,s,!0),a.renderLayer(a,a.style.tileManagers[e.source],e,s,r),e.source&&(n.rttFingerprint[e.source]=this._rttFingerprints[e.source][n.tileID.key])}}return Ln(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],this.pool.freeAllObjects(),io[n]}return!1}}const no={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Drag to rotate map, click to reset north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},ao=i,oo={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:Ja,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:e.c.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,experimentalZoomLevelsToOverscale:void 0,anisotropicFilterPitch:20};let so=class extends Qa{get _ownerWindow(){var t,e;return(null===(e=null===(t=this._container)||void 0===t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView)||window}constructor(t){var i,r;const n=Object.assign(Object.assign(Object.assign({},oo),t),{canvasContextAttributes:Object.assign(Object.assign({},oo.canvasContextAttributes),t.canvasContextAttributes)});if(null!=n.minZoom&&null!=n.maxZoom&&n.minZoom>n.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=n.minPitch&&null!=n.maxPitch&&n.minPitch>n.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=n.minPitch&&n.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=n.maxPitch&&n.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const a=new Ge,o=new Xe;void 0!==n.minZoom&&a.setMinZoom(n.minZoom),void 0!==n.maxZoom&&a.setMaxZoom(n.maxZoom),void 0!==n.minPitch&&a.setMinPitch(n.minPitch),void 0!==n.maxPitch&&a.setMaxPitch(n.maxPitch),void 0!==n.renderWorldCopies&&a.setRenderWorldCopies(n.renderWorldCopies),null!==n.transformConstrain&&a.setConstrainOverride(n.transformConstrain),super(a,o,{bearingSnap:n.bearingSnap,zoomSnap:n.zoomSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new qa,this._controls=[],this._mapId=e.ac(),this._lostContextStyle={style:null,images:null},this._contextLost=t=>{if(t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),this.style){for(const t of Object.values(this.style._layers))if("custom"===t.type&&console.warn(`Custom layer with id '${t.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),t._listeners)for(const[e]of Object.entries(t._listeners))console.warn(`Custom layer with id '${t.id}' had event listeners for event '${e}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new e.l("webglcontextlost",{originalEvent:t}))}else this.fire(new e.l("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&(this.style.imageManager.images=this._lostContextStyle.images),this._lostContextStyle={style:null,images:null},this._setupPainter(),this.resize(),this._update(),this._resizeInternal(),this.fire(new e.l("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=n.interactive,this._maxTileCacheSize=n.maxTileCacheSize,this._maxTileCacheZoomLevels=n.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},n.canvasContextAttributes),this._trackResize=!0===n.trackResize,this._bearingSnap=n.bearingSnap,this._zoomSnap=n.zoomSnap,this._centerClampedToGround=n.centerClampedToGround,this._refreshExpiredTiles=!0===n.refreshExpiredTiles,this._fadeDuration=n.fadeDuration,this._crossSourceCollisions=!0===n.crossSourceCollisions,this._collectResourceTiming=!0===n.collectResourceTiming,this._locale=Object.assign(Object.assign({},no),n.locale),this._clickTolerance=n.clickTolerance,this._overridePixelRatio=n.pixelRatio,this._maxCanvasSize=n.maxCanvasSize,this._zoomLevelsToOverscale=n.experimentalZoomLevelsToOverscale,this.transformCameraUpdate=n.transformCameraUpdate,this.transformConstrain=n.transformConstrain,this.cancelPendingTileRequestsWhileZooming=!0===n.cancelPendingTileRequestsWhileZooming,this.setAnisotropicFilterPitch(n.anisotropicFilterPitch),void 0!==n.reduceMotion&&(s.prefersReducedMotion=n.reduceMotion),this._imageQueueHandle=u.addThrottleControl(()=>this.isMoving()),this._requestManager=new d(n.transformRequest),this._container=this._resolveContainer(n.container),n.maxBounds&&this.setMaxBounds(n.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}),"undefined"!=typeof window&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver()),this.handlers=new Ya(this,n),this._hash=n.hash&&new Yn("string"==typeof n.hash&&n.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:n.center,elevation:n.elevation,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch,roll:n.roll}),n.bounds&&(this.resize(),this.fitBounds(n.bounds,e.e({},n.fitBoundsOptions,{duration:0}))));const l="string"==typeof n.style||!("globe"===(null===(r=null===(i=n.style)||void 0===i?void 0:i.projection)||void 0===r?void 0:r.type));this.resize(null,l),this._localIdeographFontFamily=n.localIdeographFontFamily,this._validateStyle=n.validateStyle,n.style&&this.setStyle(n.style,{localIdeographFontFamily:n.localIdeographFontFamily}),n.attributionControl&&this.addControl(new Xa("boolean"==typeof n.attributionControl?void 0:n.attributionControl)),n.maplibreLogo&&this.addControl(new Ha,n.logoPosition),this.on("style.load",()=>{if(l||this._resizeTransform(),this.transform.unmodified){const t=e.U(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(t)}}),this.on("data",t=>{this._update("style"===t.dataType),this.fire(new e.l(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new e.l(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new e.l("sourcedataabort",t))})}_getMapId(){return this._mapId}setGlobalStateProperty(t,e){return this.style.setGlobalStateProperty(t,e),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const r=t.onAdd(this);this._controls.push(t);const n=this._controlPositions[i];return-1!==i.indexOf("bottom")?n.insertBefore(r,n.firstChild):n.appendChild(r),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}coveringTiles(t){return Vt(this.transform,t)}calculateCameraOptionsFromTo(t,e,i,r){return null==r&&this.terrain&&(r=this.terrain.getElevationForLngLat(i,this.transform)),super.calculateCameraOptionsFromTo(t,e,i,r)}resize(t,i=!0){if(null!==this._lostContextStyle.style)return this;this._resizeInternal(i);const r=!this._moving;return r&&(this.stop(),this.fire(new e.l("movestart",t)).fire(new e.l("move",t))),this.fire(new e.l("resize",t)),r&&this.fire(new e.l("moveend",t)),this}_resizeInternal(t=!0){const[e,i]=this._containerDimensions(),r=this._getClampedPixelRatio(e,i);if(this._resizeCanvas(e,i,r),this.painter.resize(e,i,r),this.painter.overLimit()){const t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];const r=this._getClampedPixelRatio(e,i);this._resizeCanvas(e,i,r),this.painter.resize(e,i,r)}this._resizeTransform(t)}_resizeTransform(t=!0){var e;const[i,r]=this._containerDimensions();this.transform.resize(i,r,t),null===(e=this._requestedCameraState)||void 0===e||e.resize(i,r,t)}_getClampedPixelRatio(t,e){const{0:i,1:r}=this._maxCanvasSize,n=this.getPixelRatio(),a=t*n,o=e*n;return Math.min(a>i?i/a:1,o>r?r/o:1)*n}getPixelRatio(){var t;return null!==(t=this._overridePixelRatio)&&void 0!==t?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(O.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom){const i=this.transform.zoom,r=this._getTransformForUpdate();return r.setMinZoom(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.zoom&&this.fire(new e.l("zoomstart")).fire(new e.l("zoom")).fire(new e.l("zoomend")).fire(new e.l("movestart")).fire(new e.l("move")).fire(new e.l("moveend")),this}throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom){const i=this.transform.zoom,r=this._getTransformForUpdate();return r.setMaxZoom(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.zoom&&this.fire(new e.l("zoomstart")).fire(new e.l("zoom")).fire(new e.l("zoomend")).fire(new e.l("movestart")).fire(new e.l("move")).fire(new e.l("moveend")),this}throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch){const i=this.transform.pitch,r=this._getTransformForUpdate();return r.setMinPitch(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.pitch&&this.fire(new e.l("pitchstart")).fire(new e.l("pitch")).fire(new e.l("pitchend")).fire(new e.l("movestart")).fire(new e.l("move")).fire(new e.l("moveend")),this}throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?60:t)>180)throw new Error("maxPitch must be less than or equal to 180");if(t>=this.transform.minPitch){const i=this.transform.pitch,r=this._getTransformForUpdate();return r.setMaxPitch(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.pitch&&this.fire(new e.l("pitchstart")).fire(new e.l("pitch")).fire(new e.l("pitchend")).fire(new e.l("movestart")).fire(new e.l("move")).fire(new e.l("moveend")),this}throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(t){if((t=null==t?20:t)>180)throw new Error("anisotropicFilterPitch must be less than or equal to 180");if(t<0)throw new Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=t,this._update()}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.setRenderWorldCopies(t),this._update()}setTransformConstrain(t){return this.transform.setConstrainOverride(t),this._update()}project(t){return this.transform.locationToScreenPoint(e.V.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.screenPointToLocation(e.P.convert(t),this.terrain)}isMoving(){var t;return this._moving||(null===(t=this.handlers)||void 0===t?void 0:t.isMoving())}isZooming(){var t;return this._zooming||(null===(t=this.handlers)||void 0===t?void 0:t.isZooming())}isRotating(){var t;return this._rotating||(null===(t=this.handlers)||void 0===t?void 0:t.isRotating())}_createDelegatedListener(t,e,i){if("mouseenter"===t||"mouseover"===t){let r=!1;const n=n=>{const a=e.filter(t=>this.getLayer(t)),o=0!==a.length?this.queryRenderedFeatures(n.point,{layers:a}):[];o.length?r||(r=!0,i.call(this,new ia(t,this,n.originalEvent,{features:o}))):r=!1};return{layers:e,listener:i,delegates:{mousemove:n,mouseout:()=>{r=!1}}}}if("mouseleave"===t||"mouseout"===t){let r=!1;const n=n=>{const a=e.filter(t=>this.getLayer(t));(0!==a.length?this.queryRenderedFeatures(n.point,{layers:a}):[]).length?r=!0:r&&(r=!1,i.call(this,new ia(t,this,n.originalEvent)))},a=e=>{r&&(r=!1,i.call(this,new ia(t,this,e.originalEvent)))};return{layers:e,listener:i,delegates:{mousemove:n,mouseout:a}}}{const r=t=>{const r=e.filter(t=>this.getLayer(t)),n=0!==r.length?this.queryRenderedFeatures(t.point,{layers:r}):[];n.length&&(t.features=n,i.call(this,t),delete t.features)};return{layers:e,listener:i,delegates:{[t]:r}}}}_saveDelegatedListener(t,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(e)}_removeDelegatedListener(t,e,i){if(!this._delegatedListeners||!this._delegatedListeners[t])return;const r=this._delegatedListeners[t];for(let t=0;t<r.length;t++){const n=r[t];if(n.listener===i&&n.layers.length===e.length&&n.layers.every(t=>e.includes(t))){for(const t in n.delegates)this.off(t,n.delegates[t]);return void r.splice(t,1)}}}on(t,e,i){if(void 0===i)return super.on(t,e);const r="string"==typeof e?[e]:e,n=this._createDelegatedListener(t,r,i);this._saveDelegatedListener(t,n);for(const t in n.delegates)this.on(t,n.delegates[t]);return{unsubscribe:()=>{this._removeDelegatedListener(t,r,i)}}}once(t,e,i){if(void 0===i)return super.once(t,e);const r="string"==typeof e?[e]:e,n=this._createDelegatedListener(t,r,i);for(const e in n.delegates){const a=n.delegates[e];n.delegates[e]=(...e)=>{this._removeDelegatedListener(t,r,i),a(...e)}}this._saveDelegatedListener(t,n);for(const t in n.delegates)this.once(t,n.delegates[t]);return this}off(t,e,i){return void 0===i?super.off(t,e):(this._removeDelegatedListener(t,"string"==typeof e?[e]:e,i),this)}queryRenderedFeatures(t,i){if(!this.style)return[];let r;const n=t instanceof e.P||Array.isArray(t),a=n?t:[[0,0],[this.transform.width,this.transform.height]];if(i=i||(n?{}:t)||{},a instanceof e.P||"number"==typeof a[0])r=[e.P.convert(a)];else{const t=e.P.convert(a[0]),i=e.P.convert(a[1]);r=[t,new e.P(i.x,t.y),i,new e.P(t.x,i.y),t]}return this.style.queryRenderedFeatures(r,i,this.transform)}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}setStyle(t,i){return!1!==(i=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(t,i))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){const e=this._locale[t];if(null==e)throw new Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){var i,r,n;if(null===(i=this._diffStyleRequest)||void 0===i||i.abort(),this._diffStyleRequest=null,e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(t,e));const a=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t?(this.style=new ki(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,e,a):this.style.loadJSON(t,e,a),this):(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),null===(n=null===(r=this.style)||void 0===r?void 0:r.projection)||void 0===n||n.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new ki(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,i){return e._(this,void 0,void 0,function*(){var r;if(null===(r=this._diffStyleRequest)||void 0===r||r.abort(),"string"==typeof t){const r=t;this._diffStyleRequest=new AbortController;const n=this._diffStyleRequest;try{const t=yield this._requestManager.transformRequest(r,"Style");if(n.signal.aborted)return void(this._diffStyleRequest=null);const a=yield e.j(t,n);this._diffStyleRequest=null,this._updateDiff(a.data,i)}catch(t){this._diffStyleRequest=null,e.Z(t)||this.fire(new e.k(t))}}else"object"==typeof t&&(this._diffStyleRequest=null,this._updateDiff(t,i))})}_updateDiff(t,i){try{this.style.setState(t,i)&&this._update(!0)}catch(r){e.w(`Unable to perform style diff: ${r.message||r.error||r}. Rebuilding the style from scratch.`),this._updateStyle(t,i)}}getStyle(){if(this.style)return this.style.serialize()}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(t){const i=this.style&&this.style.tileManagers[t];if(void 0!==i)return i.loaded();this.fire(new e.k(new Error(`There is no tile manager with ID '${t}'`)))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){const i=this.style.tileManagers[t.source];if(!i)throw new Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);null===this.terrain&&i.reload();for(const i in this.style._layers){const r=this.style._layers[i];"hillshade"===r.type&&r.source===t.source&&e.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."),"color-relief"===r.type&&r.source===t.source&&e.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new to(this.painter,i,t),this.painter.renderToTexture=new ro(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=e=>{var i;"style"===e.dataType?this.terrain.tileManager.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),"image"===(null===(i=e.source)||void 0===i?void 0:i.type)?this.terrain.tileManager.freeRtt():this.terrain.tileManager.freeRtt(e.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new e.l("terrain",{terrain:t})),this}getTerrain(){var t,e;return null!==(e=null===(t=this.terrain)||void 0===t?void 0:t.options)&&void 0!==e?e:null}areTilesLoaded(){const t=this.style&&this.style.tileManagers;for(const e of Object.values(t))if(!e.areTilesLoaded())return!1;return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style.getSource(t)}setSourceTileLodParams(t,e,i){if(i){const r=this.getSource(i);if(!r)throw new Error(`There is no source with ID "${i}", cannot set LOD parameters`);r.calculateTileZoom=vt(Math.max(1,t),Math.max(1,e))}else for(const i in this.style.tileManagers)this.style.tileManagers[i].getSource().calculateTileZoom=vt(Math.max(1,t),Math.max(1,e));return this._update(!0),this}refreshTiles(t,i){const r=this.style.tileManagers[t];if(!r)throw new Error(`There is no tile manager with ID "${t}", cannot refresh tile`);void 0===i?r.reload(!0):r.refreshTiles(i.map(t=>new e.a9(t.z,t.x,t.y)))}addImage(t,i,r={}){const{pixelRatio:n=1,sdf:a=!1,stretchX:o,stretchY:l,content:c,textFitWidth:h,textFitHeight:u}=r;if(this._lazyInitEmptyStyle(),!(i instanceof HTMLImageElement||e.b(i))){if(void 0===i.width||void 0===i.height)return this.fire(new e.k(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`")));{const{width:r,height:s,data:d}=i,p=i;return this.style.addImage(t,{data:new e.R({width:r,height:s},new Uint8Array(d)),pixelRatio:n,stretchX:o,stretchY:l,content:c,textFitWidth:h,textFitHeight:u,sdf:a,version:0,userImage:p}),p.onAdd&&p.onAdd(this,t),this}}{const{width:r,height:d,data:p}=s.getImageData(i);this.style.addImage(t,{data:new e.R({width:r,height:d},p),pixelRatio:n,stretchX:o,stretchY:l,content:c,textFitWidth:h,textFitHeight:u,sdf:a,version:0})}}updateImage(t,i){const r=this.style.getImage(t);if(!r)return this.fire(new e.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const n=i instanceof HTMLImageElement||e.b(i)?s.getImageData(i):i,{width:a,height:o,data:l}=n;if(void 0===a||void 0===o)return this.fire(new e.k(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(a!==r.data.width||o!==r.data.height)return this.fire(new e.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));const c=!(i instanceof HTMLImageElement||e.b(i));return r.data.replace(l,c),this.style.updateImage(t,r),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.k(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return e._(this,void 0,void 0,function*(){return u.getImage(yield this._requestManager.transformRequest(t,"Image"),new AbortController)})}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)}setFilter(t,e,i={}){return this.style.setFilter(t,e,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,i,r={}){return this.style.setPaintProperty(t,e,i,r),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,i,r={}){return this.style.setLayoutProperty(t,e,i,r),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,e,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,e,i,t=>{t||this._update(!0)}),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,e,t=>{t||this._update(!0)}),this}setLight(t,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(t,e={}){return this._lazyInitEmptyStyle(),this.style.setSky(t,e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]}_setupResizeObserver(){var t;let e=!1;const i=Gn(t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())},50),r=null!==(t=this._ownerWindow.ResizeObserver)&&void 0!==t?t:ResizeObserver;this._resizeObserver=new r(t=>{e?i(t):e=!0}),this._resizeObserver.observe(this._container)}_resolveContainer(t){if("string"==typeof t){const e=document.getElementById(t);if(!e)throw new Error(`Container '${t}' not found.`);return e}if(t instanceof HTMLElement)return t;if(t&&"object"==typeof t&&1===t.nodeType)return t;throw new Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){const t=this._container;t.classList.add("maplibregl-map");const e=this._canvasContainer=h.create("div","maplibregl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=h.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const i=this._containerDimensions(),r=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],r);const n=this._controlContainer=h.create("div","maplibregl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(t=>{a[t]=h.create("div",`maplibregl-ctrl-${t} `,n)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,e,i){this._canvas.width=Math.floor(i*t),this._canvas.height=Math.floor(i*e),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const t=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let e=null;this._canvas.addEventListener("webglcontextcreationerror",i=>{e={requestedAttributes:t},i&&(e.statusMessage=i.statusMessage,e.type=i.type)},{once:!0});let i=null;if(i=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,t):this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t),!i){const t="Failed to initialize WebGL";throw e?(e.message=t,new Error(JSON.stringify(e))):new Error(t)}this.painter=new An(i,this.transform)}migrateProjection(t,i){super.migrateProjection(t,i),this.painter.transform=t,this.fire(new e.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){var i,r,n,a,o;const s=this._idleTriggered?this._fadeDuration:0,l=(null===(i=this.style.projection)||void 0===i?void 0:i.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let h=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,i=c();this.style.zoomHistory.update(t,i);const r=new e.H(t,{now:i,fadeDuration:s,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),n=r.crossFadingFactor();1===n&&n===this._crossFadingFactor||(h=!0,this._crossFadingFactor=n),this.style.update(r)}const u=(null===(r=this.style.projection)||void 0===r?void 0:r.transitionState)>0!==l;null===(n=this.style.projection)||void 0===n||n.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState(null===(a=this.style.projection)||void 0===a?void 0:a.transitionState,null===(o=this.style.projection)||void 0===o?void 0:o.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||u)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.tileManager.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,s,this._crossSourceCollisions,u),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:s,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new e.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new e.l("load"))),this.style&&(this.style.hasTransitions()||h)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const d=this._sourcesDirty||this._styleDirty||this._placementDirty;return d||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.l("idle")),!this._loaded||this._fullyLoaded||d||(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var t,i;this._hash&&this._hash.remove();for(const t of this._controls)t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),null===(t=this._diffStyleRequest)||void 0===t||t.abort(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),u.removeThrottleControl(this._imageQueueHandle),null===(i=this._resizeObserver)||void 0===i||i.disconnect();const r=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==r?void 0:r.loseContext)&&r.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),this._removed=!0,this.fire(new e.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,s.frame(this._frameRequest,t=>{this._frameRequest=null;try{this._render(t)}catch(t){if(!e.Z(t)&&!function(t){return t.message===nn}(t))throw t}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return ao}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(t){return this._lazyInitEmptyStyle(),this.style.setProjection(t),this._update(!0)}};const lo={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class co{constructor(t,i,r=!1){this.mousedown=t=>{this.startMove(t,h.mousePos(this.element,t)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=t=>{this.move(t,h.mousePos(this.element,t))},this.mouseup=t=>{this._rotatePitchHandler.dragEnd(t),this.offTemp()},this.touchstart=t=>{1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=h.touchPos(this.element,t.targetTouches)[0],this.startMove(t,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend))},this.touchmove=t=>{1!==t.targetTouches.length?this.reset():(this._lastPos=h.touchPos(this.element,t.targetTouches)[0],this.move(t,this._lastPos))},this.touchend=t=>{0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=i;const n=new xa;this._rotatePitchHandler=new pa({clickTolerance:3,move:(t,n)=>{const a=i.getBoundingClientRect(),o=new e.P((a.bottom-a.top)/2,(a.right-a.left)/2);return{bearingDelta:e.cw(new e.P(t.x,n.y),n,o),pitchDelta:r?-.5*(n.y-t.y):void 0}},moveStateManager:n,enable:!0,assignEvents:()=>{}}),this.map=t,i.addEventListener("mousedown",this.mousedown),i.addEventListener("touchstart",this.touchstart,{passive:!1}),i.addEventListener("touchcancel",this.reset)}startMove(t,e){this._rotatePitchHandler.dragStart(t,e),h.disableDrag()}move(t,e){const i=this.map,{bearingDelta:r,pitchDelta:n}=this._rotatePitchHandler.dragMove(t,e)||{};r&&i.setBearing(i.getBearing()+r),n&&i.setPitch(i.getPitch()+n)}off(){const t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){h.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}}let ho;function uo(t,i,r,n=!1){if(n||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return null==t?void 0:t.wrap();const a=new e.V(t.lng,t.lat);if(t=new e.V(t.lng,t.lat),i){const n=new e.V(t.lng-360,t.lat),a=new e.V(t.lng+360,t.lat),o=r.locationToScreenPoint(t).distSqr(i);r.locationToScreenPoint(n).distSqr(i)<o?t=n:r.locationToScreenPoint(a).distSqr(i)<o&&(t=a)}for(;Math.abs(t.lng-r.center.lng)>180;){const e=r.locationToScreenPoint(t);if(e.x>=0&&e.y>=0&&e.x<=r.width&&e.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t.lng!==a.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(t))?t:a}const po={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 mo(t,e,i){const r=t.classList;for(const t in po)r.remove(`maplibregl-${i}-anchor-${t}`);r.add(`maplibregl-${i}-anchor-${e}`)}class fo extends e.E{constructor(t){if(super(),this._onClick=t=>{this.fire(new e.l("click",{originalEvent:t}))},this._onKeyPress=t=>{"Space"!==t.code&&"Enter"!==t.code||this.togglePopup()},this._onMapClick=t=>{const e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()},this._update=t=>{if(!this._map)return;const e=this._map.loaded()&&!this._map.isMoving();("terrain"===(null==t?void 0:t.type)||"render"===(null==t?void 0:t.type)&&!e)&&this._map.once("render",this._update),this._lngLat=uo(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let i="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?i=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(i=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),this._element.style.transform=`${po[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${i}`,s.frameAsync(new AbortController,this._map._ownerWindow).then(()=>{this._updateOpacity(t&&"moveend"===t.type)}).catch(()=>{})},this._onMove=t=>{if(!this._isDragging){const e=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=e}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.l("dragstart"))),this.fire(new e.l("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),"active"===this._state&&this.fire(new e.l("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.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._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=h.create("div");const i=h.createNS("http://www.w3.org/2000/svg","svg"),r=41,n=27;i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height",`${r}px`),i.setAttributeNS(null,"width",`${n}px`),i.setAttributeNS(null,"viewBox",`0 0 ${n} ${r}`);const a=h.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");const o=h.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"fill-rule","nonzero");const s=h.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"transform","translate(3.0, 29.0)"),s.setAttributeNS(null,"fill","#000000");const l=[{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(const t of l){const e=h.createNS("http://www.w3.org/2000/svg","ellipse");e.setAttributeNS(null,"opacity","0.04"),e.setAttributeNS(null,"cx","10.5"),e.setAttributeNS(null,"cy","5.80029008"),e.setAttributeNS(null,"rx",t.rx),e.setAttributeNS(null,"ry",t.ry),s.appendChild(e)}const c=h.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"fill",this._color);const u=h.createNS("http://www.w3.org/2000/svg","path");u.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"),c.appendChild(u);const d=h.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"opacity","0.25"),d.setAttributeNS(null,"fill","#000000");const p=h.createNS("http://www.w3.org/2000/svg","path");p.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"),d.appendChild(p);const m=h.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(6.0, 7.0)"),m.setAttributeNS(null,"fill","#FFFFFF");const f=h.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"transform","translate(8.0, 8.0)");const g=h.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");const _=h.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#FFFFFF"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962"),f.appendChild(g),f.appendChild(_),o.appendChild(s),o.appendChild(c),o.appendChild(d),o.appendChild(m),o.appendChild(f),i.appendChild(o),i.setAttributeNS(null,"height",r*this._scale+"px"),i.setAttributeNS(null,"width",n*this._scale+"px"),this._element.appendChild(i),this._offset=e.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),mo(this._element,this._anchor,"marker"),t&&t.className)for(const e of t.className.split(" "))this._element.classList.add(e);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._element.hasAttribute("role")||this._element.setAttribute("role","button"),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",this._update),this._element.addEventListener("click",this._onClick),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("terrain",this._update),this._map.off("projectiontransition",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),this._element.removeEventListener("click",this._onClick),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.V.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)){const e=38.1,i=13.5,r=Math.abs(i)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-e],"bottom-left":[r,-1*(e-i+r)],"bottom-right":[-r,-1*(e-i+r)],left:[i,-1*(e-i)],right:[-i,-1*(e-i)]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=!1){var i,r;const n=null===(i=this._map)||void 0===i?void 0:i.terrain,a=this._map.transform.isLocationOccluded(this._lngLat);if(!n||a){const t=a?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==t&&(this._element.style.opacity=t))}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const o=this._map,s=o.terrain.depthAtPoint(this._pos),l=o.terrain.getElevationForLngLat(this._lngLat,o.transform);if(o.transform.lngLatToCameraDepth(this._lngLat,l)-s<.006)return void(this._element.style.opacity=this._opacity);const c=-this._offset.y/o.transform.pixelsPerMeter,h=Math.sin(o.getPitch()*Math.PI/180)*c,u=o.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),d=o.transform.lngLatToCameraDepth(this._lngLat,l+h)-u>.006;(null===(r=this._popup)||void 0===r?void 0:r.isOpen())&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=e.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&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,e){return(void 0===this._opacity||void 0===t&&void 0===e)&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=t),void 0!==e&&(this._opacityWhenCovered=e),this._map&&this._updateOpacity(!0),this}}const go={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let _o=0,yo=!1;const xo={maxWidth:100,unit:"metric"};function bo(t,e,i){const r=i&&i.maxWidth||100,n=t._container.clientHeight/2,a=t._container.clientWidth/2,o=t.unproject([a-r/2,n]),s=t.unproject([a+r/2,n]),l=Math.round(t.project(s).x-t.project(o).x),c=Math.min(r,l,t._container.clientWidth),h=o.distanceTo(s);if(i&&"imperial"===i.unit){const i=3.2808*h;i>5280?vo(e,c,i/5280,t._getUIString("ScaleControl.Miles")):vo(e,c,i,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?vo(e,c,h/1852,t._getUIString("ScaleControl.NauticalMiles")):h>=1e3?vo(e,c,h/1e3,t._getUIString("ScaleControl.Kilometers")):vo(e,c,h,t._getUIString("ScaleControl.Meters"))}function vo(t,e,i,r){const n=function(t){const e=Math.pow(10,`${Math.floor(t)}`.length-1);let i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(t){const e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(i),e*i}(i);t.style.width=e*(n/i)+"px",t.innerHTML=`${n} ${r}`}const To={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},wo=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Vo(t){if(t){if("number"==typeof t){const i=Math.round(Math.abs(t)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,t),"top-left":new e.P(i,i),"top-right":new e.P(-i,i),bottom:new e.P(0,-t),"bottom-left":new e.P(i,-i),"bottom-right":new e.P(-i,-i),left:new e.P(t,0),right:new e.P(-t,0)}}if(t instanceof e.P||Array.isArray(t)){const i=e.P.convert(t);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:e.P.convert(t.center||[0,0]),top:e.P.convert(t.top||[0,0]),"top-left":e.P.convert(t["top-left"]||[0,0]),"top-right":e.P.convert(t["top-right"]||[0,0]),bottom:e.P.convert(t.bottom||[0,0]),"bottom-left":e.P.convert(t["bottom-left"]||[0,0]),"bottom-right":e.P.convert(t["bottom-right"]||[0,0]),left:e.P.convert(t.left||[0,0]),right:e.P.convert(t.right||[0,0])}}return Vo(new e.P(0,0))}const Ro=i;t.AJAXError=e.cF,t.EXTENT=e.a5,t.Event=e.l,t.Evented=e.E,t.LngLat=e.V,t.MercatorCoordinate=e.a6,t.Point=e.P,t.addProtocol=e.cG,t.config=e.c,t.removeProtocol=e.cH,t.AttributionControl=Xa,t.BoxZoomHandler=la,t.CanvasSource=et,t.CooperativeGesturesHandler=La,t.DoubleClickZoomHandler=Ia,t.DragPanHandler=Ba,t.DragRotateHandler=Pa,t.EdgeInsets=Ce,t.FullscreenControl=class extends e.E{constructor(t={}){var i;super(),this._onFullscreenChange=()=>{var t;let e=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.fullscreenElement;)e=e.shadowRoot.fullscreenElement;e===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=null!==(i=t.pseudo)&&void 0!==i&&i,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const t=this._fullscreenButton=h.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);h.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new e.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.l("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=K,t.GeolocateControl=class extends e.E{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.l("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&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.l("geolocate",t)),this._finish()}},this._updateCamera=t=>{const i=new e.V(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,n=this._map.getBearing(),a=e.e({bearing:n},this.options.fitBoundsOptions),o=O.fromLngLat(i,r);this._map.fitBounds(o,a,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const i=new e.V(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(1===t.code){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;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&yo)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.l("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=t=>{if(!this._map)return;const i=(null==t?void 0:t[0])instanceof ResizeObserverEntry;t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||i||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.l("trackuserlocationend")),this.fire(new e.l("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=h.create("button","maplibregl-ctrl-geolocate",this._container),h.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=h.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new fo({element:this._dotElement}),this._circleElement=h.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new fo({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",this._onMoveStart)}},this.options=e.e({},go,t)}onAdd(t){return this._map=t,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,function*(t=!1){if(void 0!==ho&&!t)return ho;if(void 0===window.navigator.permissions)return ho=!!window.navigator.geolocation,ho;try{const t=yield window.navigator.permissions.query({name:"geolocation"});ho="denied"!==t.state}catch(t){ho=!!window.navigator.geolocation}return ho})}().then(t=>this._finishSetupUI(t)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(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(),this._container.remove(),this._map.off("movestart",this._onMoveStart),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,_o=0,yo=!1}_isOutOfMapMaxBounds(t){const e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.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":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){const t=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&t))return;const e=this._map.project(t),i=this._map.unproject([e.x+100,e.y]),r=t.distanceTo(i)/100,n=2*this._accuracy/r;this._circleElement.style.width=`${n.toFixed(2)}px`,this._circleElement.style.height=`${n.toFixed(2)}px`}trigger(){if(!this._setup)return e.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 e.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":_o--,yo=!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 e.l("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 e.l("trackuserlocationstart")),this.fire(new e.l("userlocationfocus"));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("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),_o++,_o>1?(t={maximumAge:6e5,timeout:0},yo=!0):(t=this.options.positionOptions,yo=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},t.GlobeControl=class{constructor(){this._toggleProjection=()=>{var t;const e=null===(t=this._map.getProjection())||void 0===t?void 0:t.type;this._map.setProjection("mercator"!==e&&e?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var t;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),"globe"===(null===(t=this._map.getProjection())||void 0===t?void 0:t.type)?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(t){return this._map=t,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=h.create("button","maplibregl-ctrl-globe",this._container),h.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},t.Hash=Yn,t.ImageSource=$,t.KeyboardHandler=Fa,t.LngLatBounds=O,t.LogoControl=Ha,t.Map=so,t.MapLibreMap=so,t.MapMouseEvent=ia,t.MapTouchEvent=ra,t.MapWheelEvent=na,t.Marker=fo,t.NavigationControl=class{constructor(t){this._updateZoomButtons=()=>{const t=this._map.getZoom(),e=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(t,e)=>{const i=this._map._getUIString(`NavigationControl.${e}`);t.title=i,t.setAttribute("aria-label",i)},this.options=e.e({},lo,t),this._container=h.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})),h.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})),h.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=h.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,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.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new co(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,e){const i=h.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i}},t.Popup=class extends e.E{constructor(t){super(),this._updateOpacity=()=>{void 0!==this.options.locationOccludedOpacity&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:"")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),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._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.l("close"))),this),this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=h.create("div","maplibregl-popup",this._map.getContainer()),this._tip=h.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const t of this.options.className.split(" "))this._container.classList.add(t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}let e;if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=uo(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),t&&"point"in t&&t.point&&(e=t.point),this._trackPointer&&!e)return;const i=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationToScreenPoint(this._lngLat));let r=this.options.anchor;const n=Vo(this.options.offset);if(!r){const t=this._container.offsetWidth,e=this._container.offsetHeight,a=function(t){var e,i,r,n;return t?{top:null!==(e=t.top)&&void 0!==e?e:0,right:null!==(i=t.right)&&void 0!==i?i:0,bottom:null!==(r=t.bottom)&&void 0!==r?r:0,left:null!==(n=t.left)&&void 0!==n?n:0}:{top:0,right:0,bottom:0,left:0}}(this.options.padding);let o;o=i.y+n.bottom.y<e+a.top?["top"]:i.y>this._map.transform.height-e-a.bottom?["bottom"]:[],i.x<t/2+a.left?o.push("left"):i.x>this._map.transform.width-t/2-a.right&&o.push("right"),r=0===o.length?"bottom":o.join("-")}let a=i.add(n[r]);this.options.subpixelPositioning||(a=a.round()),this._container.style.transform=`${po[r]} translate(${a.x}px,${a.y}px)`,mo(this._container,r,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(To),t)}addTo(t){return this._map&&this.remove(),this._map=t,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._update),this._map.on("mouseup",this._update),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 e.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.V.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),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._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){const e=document.createDocumentFragment(),i=document.createElement("body");let r;for(i.innerHTML=t;r=i.firstChild,r;)e.appendChild(r);return this.setDOMContent(e)}getMaxWidth(){var t;return null===(t=this._container)||void 0===t?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=h.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}setPadding(t){this.options.padding=t,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=h.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const t=this._container.querySelector(wo);t&&t.focus()}},t.RasterDEMTileSource=G,t.RasterTileSource=A,t.ScaleControl=class{constructor(t){this._onMove=()=>{bo(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,bo(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},xo),t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=Wa,t.Style=ki,t.TerrainControl=class{constructor(t){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.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=t}onAdd(t){return this._map=t,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=h.create("button","maplibregl-ctrl-terrain",this._container),h.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(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=Na,t.TwoFingersTouchRotateHandler=Ua,t.TwoFingersTouchZoomHandler=Ra,t.TwoFingersTouchZoomRotateHandler=Oa,t.VectorTileSource=j,t.VideoSource=tt,t.addSourceType=(t,i)=>e._(void 0,void 0,void 0,function*(){if(rt(t))throw new Error(`A source type called "${t}" already exists.`);((t,e)=>{it[t]=e})(t,i)}),t.clearPrewarmedResources=function(){const t=F;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(S),F=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()"))},t.createTileMesh=oi,t.getMaxParallelImageRequests=function(){return e.c.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return st().getRTLTextPluginStatus()},t.getVersion=function(){return Ro},t.getWorkerCount=function(){return N.workerCount},t.getWorkerUrl=function(){return e.c.WORKER_URL},t.importScriptInWorkers=function(t){return W().broadcast("IS",t)},t.isTimeFrozen=function(){return l.isFrozen()},t.now=c,t.prewarm=function(){k().acquire(S)},t.restoreNow=function(){l.restoreNow()},t.setMaxParallelImageRequests=function(t){e.c.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setNow=function(t){l.setNow(t)},t.setRTLTextPlugin=function(t,e){return st().setRTLTextPlugin(t,e)},t.setWorkerCount=function(t){N.workerCount=t},t.setWorkerUrl=function(t){e.c.WORKER_URL=t}}),t}()}(r)),r.exports);const a="bottom-left",o="data-yarrow-brand-badge-root",s="data-yarrow-brand-badge-theme",l=t=>{switch(t){case"top-left":case"top-right":case"bottom-left":case"bottom-right":return t;default:return a}};class c{constructor(){this.state={theme:"light",position:a}}mount(t,e){var i,r;this.state=e,this.container=t,this.teardown(!1),"static"===getComputedStyle(t).position&&t.style.setProperty("position","relative","important");const n=null!==(r=null!==(i=this.host)&&void 0!==i?i:t.querySelector(`[${o}]`))&&void 0!==r?r:this.createHost();this.host=n;const a=()=>{if(!this.host||!this.container)return;const t=this.host;this.container.contains(t)||this.container.appendChild(t),t.removeAttribute("hidden"),t.setAttribute(o,"1"),t.setAttribute(s,this.state.theme),this.applyHostStyles(t)};a(),this.observer=new MutationObserver(()=>{a()}),this.observer.observe(t,{childList:!0}),this.enforcerInterval=setInterval(()=>{a()},1e3)}update(t){this.state=t,this.host&&(this.host.setAttribute(s,this.state.theme),this.applyHostStyles(this.host))}getHostElement(){return this.host}teardown(t=!0){var e,i;null===(e=this.observer)||void 0===e||e.disconnect(),this.observer=void 0,this.enforcerInterval&&(clearInterval(this.enforcerInterval),this.enforcerInterval=void 0),t&&(null===(i=this.host)||void 0===i?void 0:i.isConnected)&&this.host.remove(),t&&(this.host=void 0,this.container=void 0)}getHostInlineStyle(){let t="";switch(this.state.position){case"top-left":t="top: 6px !important; left: 6px !important;";break;case"top-right":t="top: 6px !important; right: 6px !important;";break;case"bottom-right":t="bottom: 6px !important; right: 6px !important;";break;default:t="bottom: 6px !important; left: 6px !important;"}return["position: absolute !important","z-index: 1000 !important","pointer-events: none !important","user-select: none !important","display: block !important","visibility: visible !important","opacity: 1 !important","transform: none !important","top: auto !important","right: auto !important","bottom: auto !important","left: auto !important",t].join("; ")}applyHostStyles(t){const e=this.getHostInlineStyle();t.getAttribute("style")!==e&&t.setAttribute("style",e)}createHost(){const t=document.createElement("div");t.setAttribute(o,"1"),t.setAttribute(s,this.state.theme),t.setAttribute("aria-hidden","true"),t.removeAttribute("hidden"),this.applyHostStyles(t);const e=t.attachShadow({mode:"closed"}),i=document.createElement("style");i.textContent='\n :host {\n all: initial;\n }\n .badge {\n display: inline-flex !important;\n align-items: center !important;\n justify-content: center !important;\n background: rgba(255, 255, 255, 0.416) !important;\n backdrop-filter: blur(4px) !important;\n border: 1px solid rgba(255, 255, 255, 0.3) !important;\n border-radius: 16px !important;\n box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07) !important;\n padding: 2px 10px !important;\n }\n :host([data-yarrow-brand-badge-theme="dark"]) .badge {\n background: rgba(15, 23, 42, 0.416) !important;\n border: 1px solid rgba(255, 255, 255, 0.16) !important;\n box-shadow: 0 2px 12px rgba(2, 6, 23, 0.5) !important;\n }\n img {\n display: block !important;\n width: 106px !important;\n height: auto !important;\n max-width: none !important;\n opacity: 1 !important;\n visibility: visible !important;\n }\n ';const r=document.createElement("div");r.className="badge";const n=document.createElement("img");return n.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg2IiBoZWlnaHQ9IjUzIiB2aWV3Qm94PSIwIDAgMTg2IDUzIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KPHJlY3Qgd2lkdGg9IjU3IiBoZWlnaHQ9IjUzIiBmaWxsPSJ1cmwoI3BhdHRlcm4wXzFfODgpIi8+CjxyZWN0IHg9IjU3IiB5PSI2IiB3aWR0aD0iMTI4LjIxMSIgaGVpZ2h0PSI0MCIgZmlsbD0idXJsKCNwYXR0ZXJuMV8xXzg4KSIvPgo8ZGVmcz4KPHBhdHRlcm4gaWQ9InBhdHRlcm4wXzFfODgiIHBhdHRlcm5Db250ZW50VW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiB3aWR0aD0iMSIgaGVpZ2h0PSIxIj4KPHVzZSB4bGluazpocmVmPSIjaW1hZ2UwXzFfODgiIHRyYW5zZm9ybT0ibWF0cml4KDAuMDAxNDE5NTggMCAwIDAuMDAxNTI2NzIgLTAuMDAzMjQwOTMgMCkiLz4KPC9wYXR0ZXJuPgo8cGF0dGVybiBpZD0icGF0dGVybjFfMV84OCIgcGF0dGVybkNvbnRlbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giIHdpZHRoPSIxIiBoZWlnaHQ9IjEiPgo8dXNlIHhsaW5rOmhyZWY9IiNpbWFnZTFfMV84OCIgdHJhbnNmb3JtPSJzY2FsZSgwLjAwMTY0MjA0IDAuMDA1MjYzMTYpIi8+CjwvcGF0dGVybj4KPGltYWdlIGlkPSJpbWFnZTBfMV84OCIgd2lkdGg9IjcwOSIgaGVpZ2h0PSI2NTUiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIH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ZxUzFqZmVIbDN3QUFKQUdnakFBQUFBUHFJNzBhNnNBMkcwalJyQU1BTUNZNE8xSWY3WnFoSjgwUDZtalZqcmJCUUJnQkFWaFNBdzJJcWcyQmdCZ2pOQkZ4ZWdnQUFNQVlJd3dkaVFBQUlBSGxJUUJBQUI0UUJBR0FBRGdBVzlIQWdBQWVFQkpHQUFBZ0FjRVlRQUFBQjRRaEFFQUFIaEFGeFVBQUFBZVVCSUdBQURnQVVFWUFBQ0FCM1JSQVFBQTRBRWxZUUFBQUI0UWhBRUFBSGpBMjVFQUFBQWVVQklHQUFEZ0FRM3pBUUFBUEtBa0RBQUF3QU9DTUFBQUFBOEl3Z0FBQUR3Z0NBTUFBUENBSUF3QUFNQURnakFBQUFBUENNSUFBQUE4SUFnREFBRHd3QTVieE5CRkFBQUFRelFoZXN3SEFBQVlPcW9qQVFBQVBMRFZrUUFBQUJnaVd4SkdJQVlBQURCRTdhb2pDY29BQUFEUzRjWlZnU1FGWVJnbXpRemJUQnNVKzExaHdyUkJmemNBQUVBYWt1SVpkMTQwSVF6RElHSGhwR2tBQUFEb2p3M0dndjhEU0RVSnRYZmx1djhBQUFBQVNVVk9SSzVDWUlJPSIvPgo8L2RlZnM+Cjwvc3ZnPgo=",n.alt="Yarrow",n.draggable=!1,r.appendChild(n),e.append(i,r),t}}const h={enabled:!1,position:"right",zoom:!0,compass:!0};class u{constructor(){this.inset={top:0,right:0,bottom:0,left:0},this.state={theme:"light",controls:h}}mount(t,e){this.map=t,this.update(e)}update(t){if(this.state=t,!this.map||!t.controls.enabled)return void this.teardown(!0);const e=this.map.getContainer();this.container=e,"static"===getComputedStyle(e).position&&e.style.setProperty("position","relative","important"),this.host||(this.createDom(e),this.attachMapListeners()),this.host&&(this.host.dataset.yarrowTheme=this.state.theme,this.applyHostPosition(this.host),this.renderVisibleButtons(),this.updateCompassNeedle())}setInset(t){var e,i,r,n;this.inset={top:null!==(e=null==t?void 0:t.top)&&void 0!==e?e:0,right:null!==(i=null==t?void 0:t.right)&&void 0!==i?i:0,bottom:null!==(r=null==t?void 0:t.bottom)&&void 0!==r?r:0,left:null!==(n=null==t?void 0:t.left)&&void 0!==n?n:0},this.host&&this.applyHostPosition(this.host)}teardown(t=!0){var e;this.map&&this.onRotate&&this.map.off("rotate",this.onRotate),this.onRotate=void 0,this.zoomInButton&&this.onZoomInClick&&this.zoomInButton.removeEventListener("click",this.onZoomInClick),this.zoomOutButton&&this.onZoomOutClick&&this.zoomOutButton.removeEventListener("click",this.onZoomOutClick),this.compassButton&&this.onCompassClick&&this.compassButton.removeEventListener("click",this.onCompassClick),this.zoomInButton=void 0,this.zoomOutButton=void 0,this.compassButton=void 0,this.compassNeedle=void 0,this.onZoomInClick=void 0,this.onZoomOutClick=void 0,this.onCompassClick=void 0,t&&(null===(e=this.host)||void 0===e?void 0:e.isConnected)&&this.host.remove(),t&&(this.host=void 0,this.container=void 0)}createDom(t){const e=document.createElement("div");e.setAttribute("data-yarrow-controls-root","1"),e.dataset.yarrowTheme=this.state.theme;const i=e.attachShadow({mode:"closed"}),r=document.createElement("style");r.textContent='\n :host {\n all: initial;\n }\n .group {\n display: flex;\n flex-direction: column;\n gap: 6px;\n }\n button {\n all: unset;\n width: 36px;\n height: 36px;\n border-radius: 16px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n box-sizing: border-box;\n font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, \'Segoe UI\', sans-serif;\n font-weight: 700;\n font-size: 18px;\n line-height: 1;\n color: #0f172a;\n background: rgba(255, 255, 255, 0.416);\n backdrop-filter: blur(4px);\n border: 1px solid rgba(255, 255, 255, 0.3);\n box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);\n }\n button:hover {\n background: rgba(255, 255, 255, 0.6);\n }\n button:active {\n transform: translateY(1px);\n }\n .needle {\n width: 32px;\n height: 32px;\n display: block;\n filter: none;\n transition: transform 120ms linear;\n }\n :host([data-yarrow-theme="dark"]) button {\n color: #f8fafc;\n background: rgba(15, 23, 42, 0.416);\n border: 1px solid rgba(255, 255, 255, 0.16);\n box-shadow: 0 2px 12px rgba(2, 6, 23, 0.5);\n }\n :host([data-yarrow-theme="dark"]) button:hover {\n background: rgba(15, 23, 42, 0.68);\n }\n :host([data-yarrow-theme="dark"]) .needle {\n filter: invert(1);\n }\n ';const n=document.createElement("div");n.className="group";const a=document.createElement("button");a.type="button",a.ariaLabel="Zoom in",a.textContent="+",this.onZoomInClick=()=>{var t;null===(t=this.map)||void 0===t||t.zoomIn({duration:200})},a.addEventListener("click",this.onZoomInClick);const o=document.createElement("button");o.type="button",o.ariaLabel="Zoom out",o.textContent="-",this.onZoomOutClick=()=>{var t;null===(t=this.map)||void 0===t||t.zoomOut({duration:200})},o.addEventListener("click",this.onZoomOutClick);const s=document.createElement("button");s.type="button",s.ariaLabel="Reset north";const l=document.createElement("img");l.className="needle",l.src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NDAgNjQwIj48IS0tIUZvbnQgQXdlc29tZSBGcmVlIDcuMi4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlL2ZyZWUgQ29weXJpZ2h0IDIwMjYgRm9udGljb25zLCBJbmMuLS0+PHBhdGggZD0iTTUyOCAzMjBDNTI4IDIwNS4xIDQzNC45IDExMiAzMjAgMTEyQzIwNS4xIDExMiAxMTIgMjA1LjEgMTEyIDMyMEMxMTIgNDM0LjkgMjA1LjEgNTI4IDMyMCA1MjhDNDM0LjkgNTI4IDUyOCA0MzQuOSA1MjggMzIwek02NCAzMjBDNjQgMTc4LjYgMTc4LjYgNjQgMzIwIDY0QzQ2MS40IDY0IDU3NiAxNzguNiA1NzYgMzIwQzU3NiA0NjEuNCA0NjEuNCA1NzYgMzIwIDU3NkMxNzguNiA1NzYgNjQgNDYxLjQgNjQgMzIwek0zNzAuNyAzODkuMUwyMjYuNCA0NDQuNkMyMDcgNDUyLjEgMTg3LjkgNDMzIDE5NS40IDQxMy42TDI1MC45IDI2OS4zQzI1NC4yIDI2MC44IDI2MC44IDI1NC4yIDI2OS4zIDI1MC45TDQxMy42IDE5NS40QzQzMyAxODcuOSA0NTIuMSAyMDcgNDQ0LjYgMjI2LjRMMzg5LjEgMzcwLjdDMzg1LjggMzc5LjIgMzc5LjIgMzg1LjggMzcwLjcgMzg5LjF6TTM1MiAzMjBDMzUyIDMwMi4zIDMzNy43IDI4OCAzMjAgMjg4QzMwMi4zIDI4OCAyODggMzAyLjMgMjg4IDMyMEMyODggMzM3LjcgMzAyLjMgMzUyIDMyMCAzNTJDMzM3LjcgMzUyIDM1MiAzMzcuNyAzNTIgMzIweiIvPjwvc3ZnPg==",l.alt="",l.draggable=!1,s.appendChild(l),this.onCompassClick=()=>{var t;null===(t=this.map)||void 0===t||t.easeTo({bearing:0,pitch:0,duration:250})},s.addEventListener("click",this.onCompassClick),n.append(a,o,s),i.append(r,n),t.appendChild(e),this.host=e,this.zoomInButton=a,this.zoomOutButton=o,this.compassButton=s,this.compassNeedle=l}applyHostPosition(t){const e=8+this.inset.top,i=8+this.inset.right,r=8+this.inset.bottom,n=8+this.inset.left;let a="",o="transform: translateY(-50%) !important";switch(this.state.controls.position){case"left":a=`top: 50% !important; left: ${n}px !important;`;break;case"left-top":a=`top: ${e}px !important; left: ${n}px !important;`,o="transform: none !important";break;case"left-bottom":a=`bottom: ${r}px !important; left: ${n}px !important;`,o="transform: none !important";break;case"right-top":a=`top: ${e}px !important; right: ${i}px !important;`,o="transform: none !important";break;case"right-bottom":a=`bottom: ${r}px !important; right: ${i}px !important;`,o="transform: none !important";break;default:a=`top: 50% !important; right: ${i}px !important;`}t.style.cssText=["position: absolute !important","z-index: 2147483646 !important","pointer-events: auto !important","top: auto !important","right: auto !important","bottom: auto !important","left: auto !important",o,a].join("; ")}renderVisibleButtons(){if(!this.zoomInButton||!this.zoomOutButton||!this.compassButton)return;const t=this.state.controls.zoom,e=this.state.controls.compass;this.zoomInButton.style.display=t?"inline-flex":"none",this.zoomOutButton.style.display=t?"inline-flex":"none",this.compassButton.style.display=e?"inline-flex":"none"}attachMapListeners(){this.map&&(this.onRotate=()=>{this.updateCompassNeedle()},this.map.on("rotate",this.onRotate))}updateCompassNeedle(){this.map&&this.compassNeedle&&(this.compassNeedle.style.transform=`rotate(${-this.map.getBearing()-45}deg)`)}}let d=null;const p=864e5,m="yarrow-cache-v1-tile",f="yarrow-cache-v1-icon",g="yarrowcache",_="x-yarrow-cached-at",y=new Set(["Tile","Style","Glyphs","SpriteImage","SpriteJSON","Source"]),x=()=>"undefined"!=typeof globalThis&&void 0!==globalThis.caches&&"function"==typeof globalThis.caches.open,b=t=>/^https?:\/\//i.test(t)?t:new URL(t,"https://gis.yarrow.uz").toString(),v=(t,e)=>`${g}://resource?u=${encodeURIComponent(t)}&ttl=${e}`,T=t=>{const e=function(){if(!d)throw new Error("Yarrow API key not configured");return d}();if(!e)return t;try{const i=new URL(t);return i.searchParams.set("api_key",e),i.toString()}catch(e){return t}},w=t=>e(void 0,void 0,void 0,function*(){return{data:yield t.arrayBuffer(),cacheControl:t.headers.get("cache-control"),expires:t.headers.get("expires"),contentType:t.headers.get("content-type")}}),V=(t,i,r)=>e(void 0,void 0,void 0,function*(){var e;const n=yield fetch(t,{method:null!==(e=null==r?void 0:r.method)&&void 0!==e?e:"GET",headers:null==r?void 0:r.headers,body:null==r?void 0:r.body,credentials:null==r?void 0:r.credentials,signal:i.signal});if(!n.ok)throw new Error(`Request failed: ${n.status} ${n.statusText}`);return w(n)}),R=(t,i,r)=>e(void 0,void 0,void 0,function*(){const e=new Headers;r.contentType&&e.set("content-type",r.contentType),r.cacheControl&&e.set("cache-control",r.cacheControl),r.expires&&e.set("expires",r.expires),e.set(_,Date.now().toString()),yield t.put(i,new Response(r.data.slice(0),{status:200,headers:e}))}),M=(t,i,r,n,a)=>e(void 0,void 0,void 0,function*(){if(!x())return V(t,n,a);const e=yield caches.open(i),o=yield e.match(t);if(o){const i=(t=>{const e=t.headers.get(_);if(!e)return null;const i=Number(e);return Number.isFinite(i)?i:null})(o);if(!(null===i||Date.now()-i>r))return w(o);try{const i=yield V(t,n,a);return yield R(e,t,i),i}catch(t){return w(o)}}const s=yield V(t,n,a);return yield R(e,t,s),s});class U{constructor(t){this.layers=[],this.brandBadgeController=new c,this.yarrowControlsController=new u,this.currentBusMarkers=new Map,this.currentRouteLayers=[],this.MAX_BUSES=100,this.svgCache=new Map,this.busPositions=new Map,this.animateBusMarkers=()=>{const t=Date.now();this.busPositions.forEach((e,i)=>{const r=this.currentBusMarkers.get(i);if(!r)return;const n=t-e.startTime,a=Math.min(n/e.animationDuration,1),o=e.current[0]+(e.target[0]-e.current[0])*a,s=e.current[1]+(e.target[1]-e.current[1])*a;r.setLngLat([s,o]),a>=1&&(e.current=e.target)}),this.animationFrameId=requestAnimationFrame(this.animateBusMarkers)},this.config=t,this.ensureCacheProtocol()}ensureCacheProtocol(){U.isCacheProtocolRegistered||(n.addProtocol(g,(t,i)=>e(this,void 0,void 0,function*(){const e=new URL(t.url),r=e.searchParams.get("u"),n=e.searchParams.get("ttl");if(!r)throw new Error("Missing cache target URL");const a=b(r),o=Number(n),s=Number.isFinite(o)&&o>0?o:2592e6,l=yield M(a,m,s,i,t);return{data:l.data,cacheControl:l.cacheControl,expires:l.expires}})),U.isCacheProtocolRegistered=!0)}get cacheLifespanMs(){return this.config.cache.lifespanDays*p}isCacheEnabled(){return this.config.cache.enabled}transformRequestForCache(t,e){if(!this.isCacheEnabled()||!e||!y.has(e))return{url:t};const i=b(t);return{url:v(i,this.cacheLifespanMs)}}fetchJson(t,i){return e(this,void 0,void 0,function*(){const e=b(t),r=T(e);if(!this.isCacheEnabled()){const t=yield fetch(r);if(!t.ok)throw new Error(`Request failed: ${t.status} ${t.statusText}`);return t.json()}const n=new AbortController,a=yield M(r,i,this.cacheLifespanMs,n),o=(new TextDecoder).decode(a.data);return JSON.parse(o)})}loadImageFromSrc(t,e=!0){return new Promise((i,r)=>{const n=new Image;e&&(n.crossOrigin="anonymous"),n.onload=()=>i(n),n.onerror=()=>r(new Error(`Failed to load icon image: ${t}`)),n.src=t})}loadIconImage(t){return e(this,void 0,void 0,function*(){if(!this.isCacheEnabled())return this.loadImageFromSrc(t);const e=new AbortController,i=yield M(b(t),f,this.cacheLifespanMs,e),r=new Blob([i.data],{type:i.contentType||"image/png"}),n=URL.createObjectURL(r);try{return yield this.loadImageFromSrc(n,!1)}finally{URL.revokeObjectURL(n)}})}getIconsMap(){return e(this,void 0,void 0,function*(){return(yield this.fetchJson("/icons-image",f)).reduce((t,e)=>(t[e.icon_image_name]=e.icon_image_url,t),{})})}addIconsToMap(t){return e(this,void 0,void 0,function*(){this.map&&(yield Promise.all(Object.entries(t).map(t=>e(this,[t],void 0,function*([t,e]){if(this.map&&!this.map.hasImage(t))try{const i=yield this.loadIconImage(e);this.map&&!this.map.hasImage(t)&&this.map.addImage(t,i)}catch(e){console.error(`Error loading icon "${t}":`,e)}}))))})}patchMapRemoveForBadgeCleanup(){if(!this.map)return;const t=this.map,e=t.remove.bind(t);t.remove=()=>(this.stopBadgeCollisionObserver(),this.brandBadgeController.teardown(!0),this.yarrowControlsController.teardown(!0),e())}getControlsInsetForCollision(t,e,i){const r=Math.max(0,Math.ceil(i)+8);return r<=0?{}:"top-left"===e&&"left-top"===t||"top-right"===e&&"right-top"===t?{top:r}:"bottom-left"===e&&"left-bottom"===t||"bottom-right"===e&&"right-bottom"===t?{bottom:r}:{}}syncOverlayCollisionInset(){var t;if(!this.config.controls.enabled)return void this.yarrowControlsController.setInset();const e=this.brandBadgeController.getHostElement(),i=null!==(t=null==e?void 0:e.getBoundingClientRect().height)&&void 0!==t?t:0;!e||!e.isConnected||i<=0?this.yarrowControlsController.setInset():this.yarrowControlsController.setInset(this.getControlsInsetForCollision(this.config.controls.position,this.config.brandBadgePosition,i))}stopBadgeCollisionObserver(){var t;null===(t=this.badgeResizeObserver)||void 0===t||t.disconnect(),this.badgeResizeObserver=void 0}startBadgeCollisionObserver(){this.stopBadgeCollisionObserver();const t=this.brandBadgeController.getHostElement();t&&"undefined"!=typeof window&&void 0!==window.ResizeObserver&&(this.badgeResizeObserver=new window.ResizeObserver(()=>{this.syncOverlayCollisionInset()}),this.badgeResizeObserver.observe(t))}clearCache(){return e(this,void 0,void 0,function*(){x()&&(yield Promise.all([caches.delete(m),caches.delete(f)]))})}fixStyle(t){if(t&&(t.glyphs="https://fonts.openmaptiles.org/{fontstack}/{range}.pbf",console.log("✅ YarrowSDK: Glyphs URL forced to:",t.glyphs),t.layers)){let e=0;t.layers.forEach(t=>{const i=t;if("symbol"===i.type){i.layout||(i.layout={});const t=i.layout["text-font"];((null==t?void 0:t[0])||"").toLowerCase().includes("bold")?i.layout["text-font"]=["Open Sans Bold"]:i.layout["text-font"]=["Open Sans Regular"],e++}}),console.log(`✅ YarrowSDK: Aggressively fixed fonts for ${e} symbol layers`)}}init(){return e(this,void 0,void 0,function*(){const t=yield this.getIconsMap(),i="dark"===this.config.theme?"/styles/?dark=true":"/styles/",r=yield this.fetchJson(i,m);(null==r?void 0:r.layers)&&r.layers.forEach(t=>{const e=t;e.source&&e["source-layer"]&&this.layers.push({type:e["source-layer"],name:e.id})}),this.map=new n.Map({container:this.config.container,style:r,center:this.config.center,zoom:this.config.zoom,minZoom:this.config.minZoom,maxZoom:this.config.maxZoom,maxPitch:85,transformRequest:(t,e)=>this.transformRequestForCache(t,e)}),this.patchMapRemoveForBadgeCleanup(),this.brandBadgeController.mount(this.map.getContainer(),{theme:this.config.theme,position:this.config.brandBadgePosition}),this.yarrowControlsController.mount(this.map,{theme:this.config.theme,controls:this.config.controls}),this.syncOverlayCollisionInset(),this.startBadgeCollisionObserver(),this.map._controls.forEach(t=>{var e;null===(e=this.map)||void 0===e||e.removeControl(t)}),this.map.on("load",()=>e(this,void 0,void 0,function*(){yield this.addIconsToMap(t)}))})}changeStyles(t){return e(this,void 0,void 0,function*(){try{let i="/styles/";"satellite"===t?i="/styles/satellite/":"hybrid"===t&&(i="/styles/hybrid/"),"dark"===this.config.theme&&(i+=i.includes("?")?"&dark=true":"?dark=true");const r=yield this.fetchJson(i,m);if(!r)throw new Error("Failed to fetch style data");return this.fixStyle(r),this.map&&(this.map.setStyle(r),r.layers&&(this.layers=[],r.layers.forEach(t=>{const e=t;e.source&&e["source-layer"]&&this.layers.push({type:e["source-layer"],name:e.id})})),this.map.once("styledata",()=>e(this,void 0,void 0,function*(){try{const t=yield this.getIconsMap();yield this.addIconsToMap(t)}catch(t){console.error("Error re-adding icons after style change:",t)}}))),r}catch(t){throw console.error("Error changing styles:",t),t}})}changeTheme(t){return e(this,void 0,void 0,function*(){try{this.config.theme=t,this.brandBadgeController.update({theme:this.config.theme,position:this.config.brandBadgePosition}),this.yarrowControlsController.update({theme:this.config.theme,controls:this.config.controls}),this.syncOverlayCollisionInset();const i="dark"===t?"/styles/?dark=true":"/styles/",r=yield this.fetchJson(i,m);if(!r)throw new Error("Failed to fetch style data");return this.fixStyle(r),this.map&&(this.map.setStyle(r),r.layers&&(this.layers=[],r.layers.forEach(t=>{const e=t;e.source&&e["source-layer"]&&this.layers.push({type:e["source-layer"],name:e.id})})),this.map.once("styledata",()=>e(this,void 0,void 0,function*(){try{const t=yield this.getIconsMap();yield this.addIconsToMap(t)}catch(t){console.error("Error re-adding icons after theme change:",t)}}))),r}catch(t){throw console.error("Error changing theme:",t),t}})}changeBrandBadgePosition(t){const e=l(t);return this.config.brandBadgePosition=e,this.brandBadgeController.update({theme:this.config.theme,position:this.config.brandBadgePosition}),this.syncOverlayCollisionInset(),e}zoomTo(t,e,i){var r;null===(r=this.map)||void 0===r||r.flyTo({center:[e,t],zoom:i,speed:1})}fitBounds(t){var e;const i=this.getBoundingBox(t),r=.003;Math.abs(i.xMax-i.xMin)<r&&(i.xMin-=.0015,i.xMax+=.0015),Math.abs(i.yMax-i.yMin)<r&&(i.yMin-=.0015,i.yMax+=.0015),null===(e=this.map)||void 0===e||e.fitBounds([[i.xMin,i.yMin],[i.xMax,i.yMax]],{padding:50,duration:1e3})}getBoundingBox(t){var e,i;const r={xMin:180,yMin:180,xMax:-180,yMax:-180};function n(t){const[e,i]=t;r.xMin=Math.min(r.xMin,e),r.xMax=Math.max(r.xMax,e),r.yMin=Math.min(r.yMin,i),r.yMax=Math.max(r.yMax,i)}const a=t=>Array.isArray(t)&&t.length>=2&&"number"==typeof t[0]&&"number"==typeof t[1];for(const r of t.features){const t=null===(e=r.geometry)||void 0===e?void 0:e.type,o=null===(i=r.geometry)||void 0===i?void 0:i.coordinates;if("Point"===t&&a(o))n(o);else if("LineString"===t&&Array.isArray(o))for(const t of o)a(t)&&n(t);else if("Polygon"===t&&Array.isArray(o))for(const t of o)if(Array.isArray(t))for(const e of t)a(e)&&n(e)}return r}onMoveEnd(t){var e;null===(e=this.map)||void 0===e||e.on("moveend",()=>{var e,i;const r=null===(e=this.map)||void 0===e?void 0:e.getCenter(),n=null===(i=this.map)||void 0===i?void 0:i.getZoom();r&&void 0!==n&&t(r.lat,r.lng,n)})}onMapClick(t){var e;null===(e=this.map)||void 0===e||e.on("click",e=>{t(e.lngLat.lat,e.lngLat.lng)})}onIconClick(t,e){let i=[];switch(t){case"pois":i=this.layers.filter(t=>"node_tile"===t.type).map(t=>t.name);break;case"buildings":i=this.layers.filter(t=>"polygon_tile"===t.type).map(t=>t.name)}i.forEach(t=>{var i,r,n;null===(i=this.map)||void 0===i||i.on("mouseenter",t,()=>{this.map&&(this.map.getCanvas().style.cursor="pointer")}),null===(r=this.map)||void 0===r||r.on("mouseleave",t,()=>{this.map&&(this.map.getCanvas().style.cursor="")}),null===(n=this.map)||void 0===n||n.on("click",t,t=>{var i,r;(null===(r=null===(i=t.features)||void 0===i?void 0:i[0])||void 0===r?void 0:r.properties)&&e(t.lngLat.lat,t.lngLat.lng,t.features[0].properties)})})}onLayerClick(t,e){this.layers.filter(e=>"buildings"===t&&"polygon_tile"===e.type||"pois"===t&&"node_tile"===e.type).map(t=>t.name).forEach(t=>{var i,r,n;null===(i=this.map)||void 0===i||i.on("mouseenter",t,()=>{this.map&&(this.map.getCanvas().style.cursor="pointer")}),null===(r=this.map)||void 0===r||r.on("mouseleave",t,()=>{this.map&&(this.map.getCanvas().style.cursor="")}),null===(n=this.map)||void 0===n||n.on("click",t,t=>{var i,r;(null===(r=null===(i=t.features)||void 0===i?void 0:i[0])||void 0===r?void 0:r.properties)&&e(t.lngLat.lat,t.lngLat.lng,t.features[0].properties)})})}changeBackgroundColor(t){var e;null===(e=this.map)||void 0===e||e.on("styledata",()=>{const e=setInterval(()=>{var i;(null===(i=this.map)||void 0===i?void 0:i.isStyleLoaded())&&(this.map.setPaintProperty("background","background-color",t),clearInterval(e))},1e3)})}addSource(t,e){if(!this.map)return;const i=this.map.getSource(t);i?"function"==typeof i.setData?i.setData(e):console.warn(`Source "${t}" already exists and does not support setData.`):this.map.addSource(t,{type:"geojson",data:e})}updateSourceData(t,e){if(!this.map)return;const i=this.map.getSource(t);i&&"function"==typeof i.setData?i.setData(e):this.addSource(t,e)}addLayer(t,e,i,r={},n={},a={},o={}){var s,l,c,h,u;const d=null!==(s=o.sourceId)&&void 0!==s?s:t;(null===(l=this.map)||void 0===l?void 0:l.getLayer(t))&&this.map.removeLayer(t),o.sourceId?(null===(c=this.map)||void 0===c?void 0:c.getSource(d))?i&&this.updateSourceData(d,i):this.addSource(d,i):((null===(h=this.map)||void 0===h?void 0:h.getSource(t))&&this.map.removeSource(t),this.addSource(t,i));const p=Object.assign({id:t,type:e,source:d,paint:r,layout:Object.fromEntries(Object.entries(null!=n?n:{}).filter(([t])=>"icon-image-data"!==t))},o.filter?{filter:o.filter}:{});if("icon-image"in n&&"icon-image-data"in n){const t=new Image;t.src=String(n["icon-image-data"]),a.width&&(t.width=a.width),a.height&&(t.height=a.height),t.onload=()=>{var e,i;const r=String(n["icon-image"]);(null===(e=this.map)||void 0===e?void 0:e.hasImage(r))||null===(i=this.map)||void 0===i||i.addImage(r,t)}}null===(u=this.map)||void 0===u||u.addLayer(p)}setFeatureState(t,e){var i;null===(i=this.map)||void 0===i||i.setFeatureState(t,e)}queryRenderedFeatures(t,e){return this.map?this.map.queryRenderedFeatures(t,e):[]}addMarker(t,e={}){if(!this.map)return console.warn("Map not initialized"),null;const i=new n.Marker({element:e.element,color:e.color||"#FF0000",draggable:e.draggable||!1,anchor:e.anchor||"bottom"}).setLngLat([t[1],t[0]]).addTo(this.map);return e.onClick&&i.getElement().addEventListener("click",e.onClick),i}removeMarker(t){t?t.remove():console.warn("No marker provided to remove")}removeLayer(t){var e,i;(null===(e=this.map)||void 0===e?void 0:e.getLayer(t))&&this.map.removeLayer(t),(null===(i=this.map)||void 0===i?void 0:i.getSource(t))&&this.map.removeSource(t)}renderRoutes(t,e="route"){const i=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"];t.forEach((t,r)=>{this.addLayer(`${e}-${r}`,"line",{type:"FeatureCollection",features:[t]},{"line-color":i[r%i.length],"line-width":4,"line-opacity":.8},{"line-join":"round","line-cap":"round"})})}buildRouteWithLabels(t,i,r){return e(this,void 0,void 0,function*(){var e,n,a;try{const o=T("https://api.yarrow.uz/api/routing/route"),s=yield fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profile:r.toUpperCase(),coordinates:[{lat:t[0],lng:t[1]},{lat:i[0],lng:i[1]}]})});if(!s.ok)throw new Error(`Request failed: ${s.status} ${s.statusText}`);const l=yield s.json();if(!l.success)return console.warn("⚠️ Маршрут не найден"),{features:[],directions:[]};const c=l.data.path;let h=(null==c?void 0:c.features)||[];if(h=h.map(t=>{const e=t.geometry.coordinates.map(t=>[t.lng,t.lat]);return Object.assign(Object.assign({},t),{geometry:Object.assign(Object.assign({},t.geometry),{coordinates:e})})}),!h.length)return console.warn("⚠️ Нет фич для отображения маршрута"),{features:[],directions:[]};const u=(null===(a=null===(n=null===(e=l.data.directions)||void 0===e?void 0:e.routes)||void 0===n?void 0:n[0])||void 0===a?void 0:a.properties)||[];for(let t=0;t<5;t++){this.removeLayer(`custom-route-${t}`),this.removeLayer(`custom-route-label-${t}`);const e=document.getElementById("hover-popup");e&&e.remove()}const d=h[0].properties.duration,p=["#22c55e","#aaaaaa","#cccccc","#dddddd","#eeeeee"];return h.forEach((t,e)=>{var i,r,n;const a=`custom-route-${e}`,o=`custom-route-label-${e}`,s=t.properties.duration,l=t.properties.distance,c=0===e,u=`⏱ ${s.toFixed(1)} мин / ${(l/1e3).toFixed(2)} км${c?"":` (+${Math.round(s-d)} мин)`}`;this.addLayer(a,"line",{type:"FeatureCollection",features:[t]},{"line-color":p[e],"line-width":c?5:2.5,"line-opacity":c?1:.5}),this.addLayer(o,"symbol",{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:t.geometry.coordinates[Math.floor(t.geometry.coordinates.length/2)]},properties:{label:u}}]},{},{"text-field":["get","label"],"text-size":14,"text-offset":[0,1.2],"text-anchor":"top","text-font":["Open Sans Bold","Arial Unicode MS Bold"]}),null===(i=this.map)||void 0===i||i.on("mouseenter",a,t=>{var e,i;this.map&&(this.map.getCanvas().style.cursor="pointer");const r=document.createElement("div");r.id="hover-popup",r.className="route-popup",r.innerHTML=`<span style="color:#111">${u}</span>`,r.style.cssText="\n position: absolute;\n padding: 6px 12px;\n background: #fff;\n border: 1px solid #ccc;\n border-radius: 6px;\n font-size: 13px;\n font-weight: 500;\n box-shadow: 0 2px 6px rgba(0,0,0,0.15);\n pointer-events: none;\n z-index: 9999;\n ";const n=null===(e=this.map)||void 0===e?void 0:e.project(t.lngLat);n&&(r.style.left=`${n.x}px`,r.style.top=n.y-40+"px"),null===(i=document.getElementById("mapContainer"))||void 0===i||i.appendChild(r)}),null===(r=this.map)||void 0===r||r.on("mouseleave",a,()=>{var t;this.map&&(this.map.getCanvas().style.cursor=""),null===(t=document.getElementById("hover-popup"))||void 0===t||t.remove()}),null===(n=this.map)||void 0===n||n.on("click",a,()=>{var i,r,n;for(let t=0;t<h.length;t++)t!==e&&(this.removeLayer(`custom-route-${t}`),this.removeLayer(`custom-route-label-${t}`));this.addLayer(a,"line",{type:"FeatureCollection",features:[t]},{"line-color":"#22c55e","line-width":5,"line-opacity":1}),this.addLayer(o,"symbol",{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:t.geometry.coordinates[Math.floor(t.geometry.coordinates.length/2)]},properties:{label:u}}]},{},{"text-field":["get","label"],"text-size":14,"text-offset":[0,1.2],"text-anchor":"top","text-font":["Open Sans Bold","Arial Unicode MS Bold"]});const s=t.geometry.coordinates[Math.floor(t.geometry.coordinates.length/2)],l=null===(i=this.map)||void 0===i?void 0:i.project({lng:s[0],lat:s[1]});if(l){const t=document.getElementById("hover-popup");t&&t.remove();const e=document.createElement("div");e.id="hover-popup",e.className="route-popup",e.innerHTML=`<span style="color:#111">${u}</span>`,e.style.cssText=`\n position: absolute;\n left: ${l.x}px;\n top: ${l.y-40}px;\n transform: translate(-50%, -100%);\n padding: 6px 12px;\n background: #ffffff;\n border: 1px solid #ccc;\n border-radius: 6px;\n font-size: 13px;\n font-weight: 500;\n box-shadow: 0 2px 6px rgba(0,0,0,0.15);\n z-index: 9999;\n pointer-events: none;\n `,null===(r=document.getElementById("mapContainer"))||void 0===r||r.appendChild(e),null===(n=this.map)||void 0===n||n.on("move",()=>{var t;const e=document.getElementById("hover-popup");if(!e)return;const i=null===(t=this.map)||void 0===t?void 0:t.project({lng:s[0],lat:s[1]});i&&(e.style.left=`${i.x}px`,e.style.top=i.y-40+"px")})}this.fitBounds({type:"FeatureCollection",features:[t]})})}),this.fitBounds({type:"FeatureCollection",features:[h[0]]}),{features:h,directions:u}}catch(t){return console.error("❌ Ошибка при построении маршрута:",t),{features:[],directions:[]}}})}buildMultiSegmentRouteWithLabels(t,i,r){return e(this,void 0,void 0,function*(){var e,n,a,o;if(t.length<2)throw new Error("At least two coordinates are required to build a route.");try{const s=T("https://api.yarrow.uz/api/routing/route"),l=yield fetch(s,{method:"POST",headers:{"Content-Type":"application/json","Accept-Language":r||"ru"},body:JSON.stringify({profile:i.toUpperCase(),coordinates:t.map(t=>({lat:t[0],lng:t[1]}))})});if(!l.ok)throw new Error(`Request failed: ${l.status} ${l.statusText}`);const c=yield l.json();if(!c.success)throw new Error("Route not found");let h=(null===(e=c.data.path)||void 0===e?void 0:e.features)||[];if(h=h.map(t=>{const e=t.geometry.coordinates.map(t=>[t.lng,t.lat]);return Object.assign(Object.assign({},t),{geometry:Object.assign(Object.assign({},t.geometry),{coordinates:e})})}),!h||h.length<1)throw new Error("No route features returned from API");const u=(null===(o=null===(a=null===(n=c.data.directions)||void 0===n?void 0:n.routes)||void 0===a?void 0:a[0])||void 0===o?void 0:o.properties)||[];for(let t=0;t<5;t++){this.removeLayer(`custom-route-${t}`),this.removeLayer(`custom-route-label-${t}`);const e=document.getElementById("hover-popup");e&&e.remove()}const d=h[0].properties.duration,p=["#22c55e","#aaaaaa","#cccccc","#dddddd","#eeeeee"];return h.forEach((t,e)=>{var i,r,n;const a=`custom-route-${e}`,o=`custom-route-label-${e}`,s=t.properties.duration,l=t.properties.distance,c=0===e,u=`⏱ ${s.toFixed(1)} мин / ${(l/1e3).toFixed(2)} км${c?"":` (+${Math.round(s-d)} мин)`}`;this.addLayer(a,"line",{type:"FeatureCollection",features:[t]},{"line-color":p[e]||"#eeeeee","line-width":c?5:2.5,"line-opacity":c?1:.5});const m=t.geometry.coordinates[Math.floor(t.geometry.coordinates.length/2)];this.addLayer(o,"symbol",{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:m},properties:{label:u}}]},{},{"text-field":["get","label"],"text-size":14,"text-offset":[0,1.2],"text-anchor":"top","text-font":["Open Sans Bold","Arial Unicode MS Bold"]}),null===(i=this.map)||void 0===i||i.on("mouseenter",a,t=>{var e,i;this.map&&(this.map.getCanvas().style.cursor="pointer");const r=document.createElement("div");r.id="hover-popup",r.className="route-popup",r.innerHTML=`<span style="color:#111">${u}</span>`,r.style.cssText="\n position: absolute;\n padding: 6px 12px;\n background: #fff;\n border: 1px solid #ccc;\n border-radius: 6px;\n font-size: 13px;\n font-weight: 500;\n box-shadow: 0 2px 6px rgba(0,0,0,0.15);\n pointer-events: none;\n z-index: 9999;\n ";const n=null===(e=this.map)||void 0===e?void 0:e.project(t.lngLat);n&&(r.style.left=`${n.x}px`,r.style.top=n.y-40+"px"),null===(i=document.getElementById("mapContainer"))||void 0===i||i.appendChild(r)}),null===(r=this.map)||void 0===r||r.on("mouseleave",a,()=>{var t;this.map&&(this.map.getCanvas().style.cursor=""),null===(t=document.getElementById("hover-popup"))||void 0===t||t.remove()}),null===(n=this.map)||void 0===n||n.on("click",a,()=>{var i,r,n,s;for(let t=0;t<h.length;t++)t!==e&&(this.removeLayer(`custom-route-${t}`),this.removeLayer(`custom-route-label-${t}`));this.addLayer(a,"line",{type:"FeatureCollection",features:[t]},{"line-color":"#22c55e","line-width":5,"line-opacity":1}),this.addLayer(o,"symbol",{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:m},properties:{label:u}}]},{},{"text-field":["get","label"],"text-size":14,"text-offset":[0,1.2],"text-anchor":"top","text-font":["Open Sans Bold","Arial Unicode MS Bold"]});const l=null===(i=this.map)||void 0===i?void 0:i.project({lng:m[0],lat:m[1]});if(l){null===(r=document.getElementById("hover-popup"))||void 0===r||r.remove();const t=document.createElement("div");t.id="hover-popup",t.className="route-popup",t.innerHTML=`<span style="color:#111">${u}</span>`,t.style.cssText=`\n position: absolute;\n left: ${l.x}px;\n top: ${l.y-40}px;\n transform: translate(-50%, -100%);\n padding: 6px 12px;\n background: #ffffff;\n border: 1px solid #ccc;\n border-radius: 6px;\n font-size: 13px;\n font-weight: 500;\n box-shadow: 0 2px 6px rgba(0,0,0,0.15);\n z-index: 9999;\n pointer-events: none;\n `,null===(n=document.getElementById("mapContainer"))||void 0===n||n.appendChild(t),null===(s=this.map)||void 0===s||s.on("move",()=>{var t;const e=document.getElementById("hover-popup");if(!e)return;const i=null===(t=this.map)||void 0===t?void 0:t.project({lng:m[0],lat:m[1]});i&&(e.style.left=`${i.x}px`,e.style.top=i.y-40+"px")})}this.fitBounds({type:"FeatureCollection",features:[t]})})}),this.fitBounds({type:"FeatureCollection",features:[h[0]]}),{features:h,directions:u}}catch(t){throw console.error("❌ Error while building multi-segment route:",t),t}})}clearAllRoutes(){for(let t=0;t<5;t++)this.removeLayer(`custom-route-${t}`),this.removeLayer(`custom-route-label-${t}`);const t=document.getElementById("hover-popup");t&&t.remove(),console.log("✅ All routes cleared")}highlightSearchResults(t,i={}){let r=0,n=null,a=null,o=!0;const s=`${i.layerName||"search-results"}-icons`,l=i.layerName||"search-results",c=t=>{var e,r;if((null===(e=t.features)||void 0===e?void 0:e.length)&&t.features[0].properties){const e=t.features[0];null===(r=i.onIconClick)||void 0===r||r.call(i,t.lngLat.lat,t.lngLat.lng,e.properties)}},h=()=>{this.map&&(this.map.getCanvas().style.cursor="pointer")},u=()=>{this.map&&(this.map.getCanvas().style.cursor="")},d=()=>{this.map&&n&&(a&&clearTimeout(a),a=setTimeout(()=>{var t;if(!this.map||!n)return;const e=this.map.getCenter(),r=e.lat,a=e.lng,o=m(n[0],n[1],r,a);o>=500&&(console.log(`Map moved ${o.toFixed(2)}m, refetching...`),null===(t=i.onLoadingStateChange)||void 0===t||t.call(i,"rerender"),f())},250))},p=(i,r)=>e(this,void 0,void 0,function*(){try{const e=T("https://api.yarrow.uz/api/search/"),n=new URL(e);n.searchParams.set("q",t),n.searchParams.set("lat",String(i)),n.searchParams.set("lng",String(r)),n.searchParams.set("country","Uzbekistan"),n.searchParams.set("sort_by","relevance"),n.searchParams.set("page","1"),n.searchParams.set("page_size","15");const a=yield fetch(n.toString(),{headers:{"Content-Type":"application/json"}});if(!a.ok)throw new Error(`Request failed: ${a.status} ${a.statusText}`);const o=yield a.json();return((null==o?void 0:o.results)||[]).map(t=>{var e,i,r,n;return{id:t.id,name:t.name,icon_img:t.icon_img,latitude:null===(i=null===(e=t.address)||void 0===e?void 0:e.location)||void 0===i?void 0:i.lat,longitude:null===(n=null===(r=t.address)||void 0===r?void 0:r.location)||void 0===n?void 0:n.lng}})}catch(t){return console.error("Error fetching search results:",t),[]}}),m=(t,e,i,r)=>{const n=t=>t*Math.PI/180,a=n(t),o=n(i),s=n(i-t),l=n(r-e),c=Math.pow(Math.sin(s/2),2)+Math.cos(a)*Math.cos(o)*Math.pow(Math.sin(l/2),2);return 6371e3*(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)))},f=()=>e(this,void 0,void 0,function*(){var t,e;if(!this.map)return;const r=this.map.getCenter(),a=r.lat,d=r.lng,m=yield p(a,d);null===(t=i.onLoadingStateChange)||void 0===t||t.call(i,!1),null===(e=i.onResultsUpdate)||void 0===e||e.call(i,m),n=[a,d];const f=Object.assign({layerName:l,iconImage:"geo-icon",pulseAnimation:!1,zoomToResults:!0,onIconClick:void 0},i);this.removeLayer(l),this.removeLayer(s);const g=m.filter(t=>"number"==typeof t.latitude&&"number"==typeof t.longitude).map(t=>({type:"Feature",geometry:{type:"Point",coordinates:[t.longitude,t.latitude]},properties:Object.assign(Object.assign({},t),{id:t.id||Math.random().toString(36).substring(2)})}));if(0===g.length)return void console.warn("No valid search results to display");const _={type:"FeatureCollection",features:g};setTimeout(()=>{if(this.map)try{if(f.iconImage){m.some(t=>t.icon_img)?(this.addLayer(s,"symbol",_,{"text-halo-color":"#ffffff","text-halo-width":2},{"icon-image":["get","icon_img"],"icon-size":.7,"icon-allow-overlap":!0,"text-field":["get","name"],"text-offset":[0,1.5],"text-anchor":"top","text-size":12}),this.map.on("click",s,c),this.map.on("mouseenter",s,h),this.map.on("mouseleave",s,u)):(this.addLayer(s,"circle",_,{"circle-radius":10,"circle-color":"#f97316","circle-stroke-width":2,"circle-stroke-color":"#ffffff"}),this.addLayer(`${s}-label`,"symbol",_,{},{"text-field":["get","name"],"text-size":12,"text-offset":[0,1.5],"text-anchor":"top","text-font":["Open Sans Bold","Arial Unicode MS Bold"]}),this.map.on("click",s,c),this.map.on("mouseenter",s,h),this.map.on("mouseleave",s,u))}if(o&&f.zoomToResults&&g.length>0)try{this.fitBounds(_)}catch(t){console.warn("Failed to zoom to search results",t)}o=!1}catch(t){console.error("Error rendering search results:",t)}},0)}),g=()=>{var t,e;this.map?(null===(e=i.onLoadingStateChange)||void 0===e||e.call(i,"firstRender"),f(),this.map.on("moveend",d)):r<30?(console.warn("Map not available. Retrying in 1s..."),r++,setTimeout(g,1e3)):(console.error("Map instance never became available. Aborting highlight."),null===(t=i.onLoadingStateChange)||void 0===t||t.call(i,!1))};return g(),()=>{var t;this.map&&(this.map.getLayer(s)&&(this.map.off("click",s,c),this.map.off("mouseenter",s,h),this.map.off("mouseleave",s,u),this.removeLayer(s)),this.map.getLayer(l)&&this.removeLayer(l),this.map.off("moveend",d),a&&(clearTimeout(a),a=null),null===(t=i.onLoadingStateChange)||void 0===t||t.call(i,!1))}}startBusAnimation(){this.animationFrameId||(this.animationFrameId=requestAnimationFrame(this.animateBusMarkers))}stopBusAnimation(){this.animationFrameId&&(cancelAnimationFrame(this.animationFrameId),this.animationFrameId=void 0)}showBusRoute(t){return e(this,void 0,void 0,function*(){var i;this.currentBusRouteInterval&&clearInterval(this.currentBusRouteInterval),this.stopBusAnimation(),this.currentBusMarkers.forEach(t=>{this.removeMarker(t)}),this.currentBusMarkers.clear(),this.busPositions.clear(),this.currentRouteLayers.forEach(t=>{this.removeLayer(t)}),this.currentRouteLayers=[];const r=t=>{if(this.svgCache.has(t)){const e=this.svgCache.get(t);if(e)return e}const e=`<svg width="70" height="70" viewBox="0 0 70 70" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect x="27.501" y="28.4995" width="33" height="16" rx="1.5" fill="#089201" stroke="white"/>\n<text x="44" y="38.5" text-anchor="middle" fill="white" font-family="Arial, sans-serif" font-size="10" font-weight="bold">${t}</text>\n<path d="M23.5925 40.6362C20.913 42.7323 18.145 44.0821 15.5701 44.2746C13.0311 44.4643 10.6244 43.5346 8.5956 40.9411C4.51223 35.721 5.43367 28.1791 10.6537 24.0957C15.8737 20.0124 23.4156 20.9338 27.499 26.1538C29.5278 28.7474 29.8508 31.3071 29.0553 33.7257C28.2486 36.1786 26.272 38.5402 23.5925 40.6362Z" fill="#089201" stroke="white"/>\n<path d="M29.9819 48.4373C29.9924 48.7577 29.7057 48.9994 29.3999 48.9471L29.3391 48.9327L13.7566 44.2539C13.3682 44.1373 13.2725 43.6308 13.5919 43.809L28.6356 31.613C28.9376 31.3771 29.3712 31.556 29.4355 31.9159L29.443 31.9906L29.9832 48.4375L29.9819 48.4373Z" fill="#089201" stroke="white"/>\n<path d="M29.3082 48.2263L12.5495 43.5612L29.0899 30.6224L29.3082 48.2263Z" fill="#089201"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M19.001 26.5002C16.1725 26.5002 14.7583 26.5002 13.8797 27.3789C13.0823 28.1762 13.0085 29.4145 13.0017 31.7502L12.251 31.7502C11.8368 31.7502 11.501 32.086 11.501 32.5002L11.501 33.2502C11.501 33.4863 11.6121 33.7086 11.801 33.8502L13.001 34.7502C13.0078 37.086 13.0823 38.3242 13.8797 39.1216C14.0613 39.3032 14.2658 39.4473 14.501 39.5616L14.501 40.7502C14.501 41.1644 14.8368 41.5002 15.251 41.5002L16.376 41.5002C16.7902 41.5002 17.126 41.1644 17.126 40.7502L17.126 39.9864C17.6713 40.0002 18.2917 40.0002 19.001 40.0002C19.7103 40.0002 20.3307 40.0002 20.876 39.9864L20.876 40.7502C20.876 41.1644 21.2118 41.5002 21.626 41.5002L22.751 41.5002C23.1652 41.5002 23.501 41.1644 23.501 40.7502L23.501 39.5616C23.7361 39.4473 23.9407 39.3032 24.1223 39.1216C24.9196 38.3242 24.9941 37.086 25.001 34.7502L26.201 33.8502C26.3898 33.7086 26.501 33.4863 26.501 33.2502L26.501 32.5002C26.501 32.086 26.1652 31.7502 25.751 31.7502L25.0003 31.7502C24.9934 29.4145 24.9196 28.1762 24.1223 27.3789C23.2436 26.5002 21.8294 26.5002 19.001 26.5002ZM14.126 32.1252C14.126 33.1859 14.126 33.7162 14.4555 34.0457C14.785 34.3752 15.3153 34.3752 16.376 34.3752L19.001 34.3752L21.626 34.3752C22.6866 34.3752 23.217 34.3752 23.5465 34.0457C23.876 33.7162 23.876 33.1859 23.876 32.1252L23.876 30.2502C23.876 29.1896 23.876 28.6593 23.5465 28.3297C23.217 28.0002 22.6866 28.0002 21.626 28.0002L19.001 28.0002L16.376 28.0002C15.3153 28.0002 14.785 28.0002 14.4555 28.3297C14.126 28.6593 14.126 29.1896 14.126 30.2502L14.126 32.1252ZM14.6885 37.0002C14.6885 36.6896 14.9403 36.4377 15.251 36.4377L16.376 36.4377C16.6866 36.4377 16.9385 36.6896 16.9385 37.0002C16.9385 37.3109 16.6866 37.5627 16.376 37.5627L15.251 37.5627C14.9403 37.5627 14.6885 37.3109 14.6885 37.0002ZM23.3135 37.0002C23.3135 36.6896 23.0616 36.4377 22.751 36.4377L21.626 36.4377C21.3153 36.4377 21.0635 36.6896 21.0635 37.0002C21.0635 37.3109 21.3153 37.5627 21.626 37.5627L22.751 37.5627C23.0616 37.5627 23.3135 37.3109 23.3135 37.0002Z" fill="white"/>\n</svg>`;return this.svgCache.set(t,e),e},n=(t,e)=>{if(!this.map)return!1;return this.map.getBounds().contains([e,t])},a=(t,e)=>{if(t.length<=e)return t;return[...t].sort(()=>.5-Math.random()).slice(0,e)};let o=!0;let s=!1,l=0;const c=()=>e(this,void 0,void 0,function*(){var e,i,c;const h=Date.now(),u=h-l;if(u<1e4&&l>0)console.warn(`⚠️ Skipping fetch - only ${(u/1e3).toFixed(1)}s since last fetch (min: 10s)`);else if(s)console.warn("⚠️ Skipping fetch - already in progress");else{s=!0,l=h;try{const s=t?`https://gis.yarrow.uz/api/get-route/?route_id=${t}`:"https://gis.yarrow.uz/api/get-all-bus/",l=yield fetch(s);if(!l.ok)throw new Error(`Request failed: ${l.status} ${l.statusText}`);const h=yield l.json();if(!h.success)throw new Error("Failed to fetch bus locations");const u=t?h.data.busses:h.data;if(!u)throw new Error("No bus data found in response");let d=[],p={xMin:180,yMin:180,xMax:-180,yMax:-180};if(t)d=u.filter(t=>{const e=Number.parseFloat(t.lat),i=Number.parseFloat(t.lon);return!Number.isNaN(e)&&!Number.isNaN(i)}),o&&d.length>0&&d.forEach(t=>{const e=Number.parseFloat(t.lat),i=Number.parseFloat(t.lon);p.xMin=Math.min(p.xMin,i),p.xMax=Math.max(p.xMax,i),p.yMin=Math.min(p.yMin,e),p.yMax=Math.max(p.yMax,e)});else if(o){const t=null===(e=this.map)||void 0===e?void 0:e.getCenter();if(!t)throw new Error("Unable to get map center");const r=t.lat,n=t.lng;p=((t,e,i)=>{const r=i/6371*(180/Math.PI),n=i/6371*(180/Math.PI)/Math.cos(t*Math.PI/180);return{xMin:e-n,xMax:e+n,yMin:t-r,yMax:t+r}})(r,n,5),null===(i=this.map)||void 0===i||i.fitBounds([[p.xMin,p.yMin],[p.xMax,p.yMax]],{padding:50,duration:1e3});const o=u.filter(t=>{const e=Number.parseFloat(t.lat),i=Number.parseFloat(t.lon);return!Number.isNaN(e)&&!Number.isNaN(i)&&((t,e,i,r,n)=>{const a=(t-i)*Math.PI/180,o=(e-r)*Math.PI/180,s=Math.sin(a/2)*Math.sin(a/2)+Math.cos(i*Math.PI/180)*Math.cos(t*Math.PI/180)*Math.sin(o/2)*Math.sin(o/2);return 2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s))*6371<=n})(e,i,r,n,5)});d=a(o,this.MAX_BUSES)}else d=u.filter(t=>{const e=Number.parseFloat(t.lat),i=Number.parseFloat(t.lon);return!Number.isNaN(e)&&!Number.isNaN(i)&&n(e,i)}),d.length>this.MAX_BUSES&&(d=a(d,this.MAX_BUSES));const m=new Set;if(o&&d.length>0&&console.log("🔍 Sample bus data:",d[0]),d.forEach(t=>{var e,i,n,a,o,s;const l=Number.parseFloat(t.lat),c=Number.parseFloat(t.lon),h=t.bus_number||"?",u=(null===(e=t.id)||void 0===e?void 0:e.toString())||(null===(i=t.bus_id)||void 0===i?void 0:i.toString())||(null===(n=t.vehicle_id)||void 0===n?void 0:n.toString())||(null===(a=t.uuid)||void 0===a?void 0:a.toString())||(null===(o=t.device_id)||void 0===o?void 0:o.toString())||(null===(s=t.bus_gos_number)||void 0===s?void 0:s.toString())||`bus-${h}-${l.toFixed(4)}-${c.toFixed(4)}`;m.add(u);const d=this.currentBusMarkers.get(u),p=this.busPositions.get(u);if(d&&p){const t=p.target[0],e=p.target[1];if(Math.abs(t-l)>1e-5||Math.abs(e-c)>1e-5){const t=d.getLngLat(),e=t.lat,i=t.lng;console.log(`🚌 Animating bus ${h} (${u}) from [${e.toFixed(5)}, ${i.toFixed(5)}] to [${l.toFixed(5)}, ${c.toFixed(5)}]`),p.current=[e,i],p.target=[l,c],p.startTime=Date.now(),p.animationDuration=16e3}}else{console.log(`🚌 Creating new bus marker ${h} (${u}) at [${l.toFixed(5)}, ${c.toFixed(5)}]`);const t=document.createElement("div");t.innerHTML=r(h),t.style.width="70px",t.style.height="70px";const e=this.addMarker([l,c],{element:t,anchor:"center",onClick:()=>{console.log(`Bus ${h} clicked at [${l}, ${c}]`)}});e&&(this.currentBusMarkers.set(u,e),this.busPositions.set(u,{current:[l,c],target:[l,c],startTime:Date.now(),animationDuration:16e3}))}}),this.currentBusMarkers.forEach((t,e)=>{m.has(e)||(this.removeMarker(t),this.currentBusMarkers.delete(e),this.busPositions.delete(e))}),this.currentBusMarkers.size>0&&(console.log(`🎬 Starting bus animation for ${this.currentBusMarkers.size} buses`),this.startBusAnimation()),t&&h.data.routes&&h.data.routes.length>0){const e=`bus-route-${t}`;this.currentRouteLayers.forEach(t=>{this.removeLayer(t)}),this.currentRouteLayers=[],this.renderRoutes(h.data.routes,e),h.data.routes.forEach((t,i)=>{this.currentRouteLayers.push(`${e}-${i}`)})}if(o&&t&&d.length>0){const t=.003;Math.abs(p.xMax-p.xMin)<t&&(p.xMin-=t/2,p.xMax+=t/2),Math.abs(p.yMax-p.yMin)<t&&(p.yMin-=t/2,p.yMax+=t/2),null===(c=this.map)||void 0===c||c.fitBounds([[p.xMin,p.yMin],[p.xMax,p.yMax]],{padding:50,duration:1e3})}o=!1,console.log(`Rendered ${d.length} buses out of ${u.length} total buses`)}catch(t){console.error("Error updating bus locations:",t)}finally{s=!1}}}),h=()=>{t||o||(clearTimeout(this.mapMoveTimeout),this.mapMoveTimeout=setTimeout(()=>{c()},500))};return null===(i=this.map)||void 0===i||i.on("moveend",h),yield c(),this.currentBusRouteInterval=setInterval(c,16e3),()=>{var t;this.stopBusAnimation(),this.currentBusRouteInterval&&clearInterval(this.currentBusRouteInterval),this.currentBusRouteInterval=void 0,null===(t=this.map)||void 0===t||t.off("moveend",h),this.mapMoveTimeout&&clearTimeout(this.mapMoveTimeout),this.currentBusMarkers.forEach(t=>{this.removeMarker(t)}),this.currentBusMarkers.clear(),this.busPositions.clear(),this.currentRouteLayers.forEach(t=>{this.removeLayer(t)}),this.currentRouteLayers=[],this.svgCache.clear()}})}}U.isCacheProtocolRegistered=!1,t.YarrowMap=U,t.YarrowMapConfig=class{constructor(t){const{container:e,center:i,zoom:r=10,minZoom:n=0,maxZoom:o=19,theme:s="light",cache:c={},brandBadgePosition:u=a,controls:p={},apiKey:m}=t;if(!m)throw new Error("apiKey is required");!function(t){if(!t)throw new Error("apiKey is required");d=t}(m),this.container=e,this.center=i,this.zoom=r,this.minZoom=n,this.maxZoom=o,this.theme=s,this.cache=(t=>{var e;const i="number"==typeof(null==t?void 0:t.lifespanDays)&&Number.isFinite(t.lifespanDays)&&t.lifespanDays>0?t.lifespanDays:30;return{enabled:null!==(e=null==t?void 0:t.enabled)&&void 0!==e&&e,lifespanDays:i}})(c),this.brandBadgePosition=l(u),this.controls=(t=>{var e,i,r;const n=null==t?void 0:t.position;let a=h.position;return"left"===n||"left-top"===n||"left-bottom"===n||"right"===n||"right-top"===n||"right-bottom"===n?a=n:"top-left"===n||"bottom-left"===n?a="top-left"===n?"left-top":"left-bottom":"top-right"!==n&&"bottom-right"!==n||(a="top-right"===n?"right-top":"right-bottom"),{enabled:null!==(e=null==t?void 0:t.enabled)&&void 0!==e?e:h.enabled,position:a,zoom:null!==(i=null==t?void 0:t.zoom)&&void 0!==i?i:h.zoom,compass:null!==(r=null==t?void 0:t.compass)&&void 0!==r?r:h.compass}})(p),this.apiKey=m}},Object.defineProperty(t,"__esModule",{value:!0})});
|