@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.
@@ -0,0 +1,835 @@
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.YarrowMap={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);(function(){if(!(typeof document>`u`)&&!document.getElementById(`yarrow-css-L2hvbWUvcnVubmVy`)){var e=document.createElement(`style`);e.id=`yarrow-css-L2hvbWUvcnVubmVy`,e.textContent=`.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}`,document.head.appendChild(e)}})()
2
+ /**
3
+ * MapLibre GL JS
4
+ * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.23.0/LICENSE.txt
5
+ */
6
+ ;var n=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.maplibregl=r())})(e,(function(){"use strict";var e={},t={};function n(n,r,i){if(t[n]=i,n===`index`){var a=`var sharedModule = {}; (`+t.shared+`)(sharedModule); (`+t.worker+`)(sharedModule);`,o={};return t.shared(o),t.index(e,o),typeof window<`u`&&e.setWorkerUrl(window.URL.createObjectURL(new Blob([a],{type:`text/javascript`}))),e}}return n(`shared`,[`exports`],(function(e){function t(e,t,n,r){return new(n||=Promise)((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))}function n(e,t){this.x=e,this.y=t}function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var i,a;n.prototype={clone(){return new n(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},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(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),n=Math.sin(e),r=n*this.x+t*this.y;return this.x=t*this.x-n*this.y,this.y=r,this},_rotateAround(e,t){let n=Math.cos(e),r=Math.sin(e),i=t.y+r*(this.x-t.x)+n*(this.y-t.y);return this.x=t.x+n*(this.x-t.x)-r*(this.y-t.y),this.y=i,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:n},n.convert=function(e){if(e instanceof n)return e;if(Array.isArray(e))return new n(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new n(+e.x,+e.y);throw Error(`Expected [x, y] or {x, y} point format`)};var o=r(function(){if(a)return i;function e(e,t,n,r){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=n,this.p2y=r}return a=1,i=e,e.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(t===void 0&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,r=0;r<8;r++){var i=this.sampleCurveX(n)-e;if(Math.abs(i)<t)return n;var a=this.sampleCurveDerivativeX(n);if(Math.abs(a)<1e-6)break;n-=i/a}var o=0,s=1;for(n=e,r=0;r<20&&(i=this.sampleCurveX(n),!(Math.abs(i-e)<t));r++)e>i?o=n:s=n,n=.5*(s-o)+o;return n},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},i}());let s,c;function l(){return s??=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)&&typeof createImageBitmap==`function`,s}function u(){if(c==null&&(c=!1,l())){let e=new OffscreenCanvas(5,5).getContext(`2d`,{willReadFrequently:!0});if(e){for(let t=0;t<25;t++){let n=4*t;e.fillStyle=`rgb(${n},${n+1},${n+2})`,e.fillRect(t%5,Math.floor(t/5),1,1)}let t=e.getImageData(0,0,5,5).data;for(let e=0;e<100;e++)if(e%4!=3&&t[e]!==e){c=!0;break}}}return c||!1}var d=1e-6,f=typeof Float32Array<`u`?Float32Array:Array;function p(){var e=new f(9);return f!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function m(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function h(){var e=new f(3);return f!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function g(e){var t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)}function _(e,t,n){var r=new f(3);return r[0]=e,r[1]=t,r[2]=n,r}function v(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function y(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function b(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[0],s=n[1],c=n[2];return e[0]=i*c-a*s,e[1]=a*o-r*c,e[2]=r*s-i*o,e}var x,S=g;function C(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,e}function w(){var e=new f(4);return f!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function T(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:`zyx`,a=Math.PI/360;t*=a,r*=a,n*=a;var o=Math.sin(t),s=Math.cos(t),c=Math.sin(n),l=Math.cos(n),u=Math.sin(r),d=Math.cos(r);switch(i){case`xyz`:e[0]=o*l*d+s*c*u,e[1]=s*c*d-o*l*u,e[2]=s*l*u+o*c*d,e[3]=s*l*d-o*c*u;break;case`xzy`:e[0]=o*l*d-s*c*u,e[1]=s*c*d-o*l*u,e[2]=s*l*u+o*c*d,e[3]=s*l*d+o*c*u;break;case`yxz`:e[0]=o*l*d+s*c*u,e[1]=s*c*d-o*l*u,e[2]=s*l*u-o*c*d,e[3]=s*l*d+o*c*u;break;case`yzx`:e[0]=o*l*d+s*c*u,e[1]=s*c*d+o*l*u,e[2]=s*l*u-o*c*d,e[3]=s*l*d-o*c*u;break;case`zxy`:e[0]=o*l*d-s*c*u,e[1]=s*c*d+o*l*u,e[2]=s*l*u+o*c*d,e[3]=s*l*d-o*c*u;break;case`zyx`:e[0]=o*l*d-s*c*u,e[1]=s*c*d+o*l*u,e[2]=s*l*u-o*c*d,e[3]=s*l*d+o*c*u;break;default:throw Error(`Unknown angle order `+i)}return e}function E(){var e=new f(2);return f!=Float32Array&&(e[0]=0,e[1]=0),e}function D(e,t){var n=new f(2);return n[0]=e,n[1]=t,n}h(),x=new f(4),f!=Float32Array&&(x[0]=0,x[1]=0,x[2]=0,x[3]=0),h(),_(1,0,0),_(0,1,0),w(),w(),p(),E();let O=8192;function k(e,t,n){return t*(O/(e.tileSize*2**(n-e.tileID.overscaledZ)))}function A(e){return e instanceof Error?e:Error(typeof e==`string`?e:String(e))}function j(e,t){return(e%t+t)%t}function ee(e,t,n){return e*(1-n)+t*n}function M(e){if(e<=0)return 0;if(e>=1)return 1;let t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function te(e,t,n,r){let i=new o(e,t,n,r);return e=>i.solve(e)}let ne=te(.25,.1,.25,1);function N(e,t,n){return Math.min(n,Math.max(t,e))}function re(e,t,n){let r=n-t,i=((e-t)%r+r)%r+t;return i===t?n:i}function ie(e,...t){for(let n of t)for(let t in n)e[t]=n[t];return e}let ae=1;function oe(e,t,n){let r={};for(let n in e)r[n]=t.call(this,e[n],n,e);return r}function se(e,t,n){let r={};for(let n in e)t.call(this,e[n],n,e)&&(r[n]=e[n]);return r}function ce(e){return Array.isArray(e)?e.map(ce):typeof e==`object`&&e?oe(e,ce):e}let le={};function ue(e){le[e]||(typeof console<`u`&&console.warn(e),le[e]=!0)}function de(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}function fe(e){return typeof WorkerGlobalScope<`u`&&e!==void 0&&e instanceof WorkerGlobalScope}let pe=null;function me(e){return typeof ImageBitmap<`u`&&e instanceof ImageBitmap}let he=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=`;function ge(e,n,r,i,a){return t(this,void 0,void 0,(function*(){if(typeof VideoFrame>`u`)throw Error(`VideoFrame not supported`);let t=new VideoFrame(e,{timestamp:0});try{let o=t?.format;if(!o||!o.startsWith(`BGR`)&&!o.startsWith(`RGB`))throw Error(`Unrecognized format ${o}`);let s=o.startsWith(`BGR`),c=new Uint8ClampedArray(i*a*4);if(yield t.copyTo(c,function(e,t,n,r,i){let a=4*Math.max(-t,0),o=(Math.max(0,n)-n)*r*4+a,s=4*r,c=Math.max(0,t),l=Math.max(0,n);return{rect:{x:c,y:l,width:Math.min(e.width,t+r)-c,height:Math.min(e.height,n+i)-l},layout:[{offset:o,stride:s}]}}(e,n,r,i,a)),s)for(let e=0;e<c.length;e+=4){let t=c[e];c[e]=c[e+2],c[e+2]=t}return c}finally{t.close()}}))}let _e,ve;function ye(e,t,n,r){return e.addEventListener(t,n,r),{unsubscribe:()=>{e.removeEventListener(t,n,r)}}}function be(e){return e*Math.PI/180}function xe(e){return e/Math.PI*180}let Se={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},Ce={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},we=`AbortError`;class Te extends Error{constructor(e=we){super(e instanceof Error?e.message:e),this.name=we,e instanceof Error&&e.stack&&(this.stack=e.stack)}}function Ee(e){return e instanceof Error&&e.name===we}function De(e){if(e.aborted)throw new Te(e.reason)}let Oe={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:``};function ke(e){return Oe.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf(`://`))]}let Ae=`global-dispatcher`;class je extends Error{constructor(e,t,n,r){super(`AJAXError: ${t} (${e}): ${n}`),this.status=e,this.statusText=t,this.url=n,this.body=r}}let Me=()=>fe(self)?self.worker?.referrer:(window.location.protocol===`blob:`?window.parent:window).location.href,Ne=function(e,n){return t(this,void 0,void 0,(function*(){if(e.url.includes(`://`)&&!/^https?:|^file:/.test(e.url)){let t=ke(e.url);if(t){let r=yield t(e,n);return r.data||e.type!==`arrayBuffer`?r:ie(r,{data:new ArrayBuffer(0)})}if(fe(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:`GR`,data:e,targetMapId:Ae},n)}if(!(e=>e.startsWith(`file:`)||Me()?.startsWith(`file:`)&&!/^\w+:/.test(e))(e.url)){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,`signal`))return function(e,n){return t(this,void 0,void 0,(function*(){let t=new Request(e.url,{method:e.method||`GET`,body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:Me(),referrerPolicy:e.referrerPolicy,signal:n.signal}),r,i;e.type!==`json`||t.headers.has(`Accept`)||t.headers.set(`Accept`,`application/json`);try{r=yield fetch(t)}catch(t){throw Ee(t)?t:new je(0,A(t).message,e.url,new Blob)}if(!r.ok){let t=yield r.blob();throw new je(r.status,r.statusText,e.url,t)}i=e.type===`arrayBuffer`||e.type===`image`?r.arrayBuffer():e.type===`json`?r.json():r.text();let a=yield i;return De(n.signal),{data:a,cacheControl:r.headers.get(`Cache-Control`),expires:r.headers.get(`Expires`),etag:r.headers.get(`ETag`)}}))}(e,n);if(fe(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:`GR`,data:e,mustQueue:!0,targetMapId:Ae},n)}return function(e,t){return new Promise(((n,r)=>{var i;let a=new XMLHttpRequest;a.open(e.method||`GET`,e.url,!0),e.type!==`arrayBuffer`&&e.type!==`image`||(a.responseType=`arraybuffer`);for(let t in e.headers)a.setRequestHeader(t,e.headers[t]);e.type===`json`&&(a.responseType=`text`,(i=e.headers)!=null&&i.Accept||a.setRequestHeader(`Accept`,`application/json`)),a.withCredentials=e.credentials===`include`,a.onerror=()=>{r(Error(a.statusText))},a.onload=()=>{if(!t.signal.aborted)if((a.status>=200&&a.status<300||a.status===0)&&a.response!==null){let t=a.response;if(e.type===`json`)try{t=JSON.parse(a.response)}catch(e){r(e);return}n({data:t,cacheControl:a.getResponseHeader(`Cache-Control`),expires:a.getResponseHeader(`Expires`),etag:a.getResponseHeader(`ETag`)})}else{let t=new Blob([a.response],{type:a.getResponseHeader(`Content-Type`)});r(new je(a.status,a.statusText,e.url,t))}},t.signal.addEventListener(`abort`,(()=>{a.abort(),r(new Te(t.signal.reason))})),a.send(e.body)}))}(e,n)}))};function Pe(e){if(!e||e.indexOf(`://`)<=0||e.startsWith(`data:image/`)||e.startsWith(`blob:`))return!0;let t=new URL(e),n=window.location;return t.protocol===n.protocol&&t.host===n.host}function Fe(e,t,n){var r;(r=n[e])!=null&&r.includes(t)||(n[e]=n[e]||[],n[e].push(t))}function Ie(e,t,n){if(n?.[e]){let r=n[e].indexOf(t);r!==-1&&n[e].splice(r,1)}}class Le{constructor(e,t={}){ie(this,t),this.type=e}}class Re extends Le{constructor(e,t={}){super(`error`,ie({error:e},t))}}class ze{on(e,t){return this._listeners=this._listeners||{},Fe(e,t,this._listeners),{unsubscribe:()=>{this.off(e,t)}}}off(e,t){return Ie(e,t,this._listeners),Ie(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},Fe(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){typeof e==`string`&&(e=new Le(e,t||{}));let n=e.type;if(this.listens(n)){e.target=this;let t=this._listeners?.[n]?this._listeners[n].slice():[];for(let n of t)n.call(this,e);let r=this._oneTimeListeners?.[n]?this._oneTimeListeners[n].slice():[];for(let t of r)Ie(n,t,this._oneTimeListeners),t.call(this,e);let i=this._eventedParent;i&&(ie(e,typeof this._eventedParentData==`function`?this._eventedParentData():this._eventedParentData),i.fire(e))}else e instanceof Re&&console.error(e.error);return this}listens(e){return this._listeners?.[e]?.length>0||this._oneTimeListeners?.[e]?.length>0||this._eventedParent?.listens(e)}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}var P={$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`}]}}}}};let Be=[`type`,`source`,`source-layer`,`minzoom`,`maxzoom`,`filter`,`layout`];function Ve(e,t){let n={};for(let t in e)t!==`ref`&&(n[t]=e[t]);return Be.forEach((e=>{e in t&&(n[e]=t[e])})),n}function F(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!F(e[n],t[n]))return!1;return!0}if(typeof e==`object`&&e&&t!==null){if(typeof t!=`object`||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(!F(e[n],t[n]))return!1;return!0}return e===t}function He(e,t){e.push(t)}function Ue(e,t,n){He(n,{command:`addSource`,args:[e,t[e]]})}function We(e,t,n){He(t,{command:`removeSource`,args:[e]}),n[e]=!0}function Ge(e,t,n,r){We(e,n,r),Ue(e,t,n)}function Ke(e,t,n){let r;for(r in e[n])if(Object.prototype.hasOwnProperty.call(e[n],r)&&r!==`data`&&!F(e[n][r],t[n][r]))return!1;for(r in t[n])if(Object.prototype.hasOwnProperty.call(t[n],r)&&r!==`data`&&!F(e[n][r],t[n][r]))return!1;return!0}function qe(e,t,n,r,i,a){e||={},t||={};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(F(e[o],t[o])||n.push({command:a,args:[r,o,t[o],i]}));for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&!Object.prototype.hasOwnProperty.call(e,o)&&(F(e[o],t[o])||n.push({command:a,args:[r,o,t[o],i]}))}function Je(e){return e.id}function Ye(e,t){return e[t.id]=t,e}class I{constructor(e,t,n,r){this.message=(e?`${e}: `:``)+n,r&&(this.identifier=r),t!=null&&t.__line__&&(this.line=t.__line__)}}function Xe(e,...t){for(let n of t)for(let t in n)e[t]=n[t];return e}class Ze extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class Qe{constructor(e,t=[]){this.parent=e,this.bindings={};for(let[e,n]of t)this.bindings[e]=n}concat(e){return new Qe(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}let $e={kind:`null`},L={kind:`number`},R={kind:`string`},z={kind:`boolean`},et={kind:`color`},tt={kind:`projectionDefinition`},nt={kind:`object`},B={kind:`value`},rt={kind:`collator`},it={kind:`formatted`},at={kind:`padding`},ot={kind:`colorArray`},st={kind:`numberArray`},ct={kind:`resolvedImage`},lt={kind:`variableAnchorOffsetCollection`};function ut(e,t){return{kind:`array`,itemType:e,N:t}}function dt(e){if(e.kind===`array`){let t=dt(e.itemType);return typeof e.N==`number`?`array<${t}, ${e.N}>`:e.itemType.kind===`value`?`array`:`array<${t}>`}return e.kind}let ft=[$e,L,R,z,et,tt,it,nt,ut(B),at,st,ot,ct,lt];function pt(e,t){if(t.kind===`error`)return null;if(e.kind===`array`){if(t.kind===`array`&&(t.N===0&&t.itemType.kind===`value`||!pt(e.itemType,t.itemType))&&(typeof e.N!=`number`||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind===`value`){for(let e of ft)if(!pt(e,t))return null}}return`Expected ${dt(e)} but found ${dt(t)} instead.`}function mt(e,t){return t.some((t=>t.kind===e.kind))}function ht(e,t){return t.some((t=>t===`null`?e===null:t===`array`?Array.isArray(e):t===`object`?e&&!Array.isArray(e)&&typeof e==`object`:t===typeof e))}function gt(e,t){return e.kind===`array`&&t.kind===`array`?e.itemType.kind===t.itemType.kind&&typeof e.N==`number`:e.kind===t.kind}let _t=.96422,vt=.82521,yt=4/29,bt=6/29,xt=3*bt*bt,St=Math.PI/180,Ct=180/Math.PI;function wt(e){return(e%=360)<0&&(e+=360),e}function Tt([e,t,n,r]){let i,a,o=Dt((.2225045*(e=Et(e))+.7168786*(t=Et(t))+.0606169*(n=Et(n)))/1);e===t&&t===n?i=a=o:(i=Dt((.4360747*e+.3850649*t+.1430804*n)/_t),a=Dt((.0139322*e+.0971045*t+.7141733*n)/vt));let s=116*o-16;return[s<0?0:s,500*(i-o),200*(o-a),r]}function Et(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Dt(e){return e>.008856451679035631?e**(1/3):e/xt+yt}function Ot([e,t,n,r]){let i=(e+16)/116,a=isNaN(t)?i:i+t/500,o=isNaN(n)?i:i-n/200;return i=1*At(i),a=_t*At(a),o=vt*At(o),[kt(3.1338561*a-1.6168667*i-.4906146*o),kt(-.9787684*a+1.9161415*i+.033454*o),kt(.0719453*a-.2289914*i+1.4052427*o),r]}function kt(e){return(e=e<=.00304?12.92*e:1.055*e**(1/2.4)-.055)<0?0:e>1?1:e}function At(e){return e>bt?e*e*e:xt*(e-yt)}let jt=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function Mt(e,t){return jt(e,t)?e[t]:void 0}function Nt(e){return parseInt(e.padEnd(2,e),16)/255}function Pt(e,t){return Ft(t?e/100:e,0,1)}function Ft(e,t,n){return Math.min(Math.max(t,e),n)}function It(e){return!e.some(Number.isNaN)}let Lt={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 Rt(e,t,n){return e+n*(t-e)}function zt(e,t,n){return e.map(((e,r)=>Rt(e,t[r],n)))}class V{constructor(e,t,n,r=1,i=!0){this.r=e,this.g=t,this.b=n,this.a=r,i||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter(`rgb`,[e,t,n,r]))}static parse(e){if(e instanceof V)return e;if(typeof e!=`string`)return;let t=function(e){if((e=e.toLowerCase().trim())===`transparent`)return[0,0,0,0];let t=Mt(Lt,e);if(t){let[e,n,r]=t;return[e/255,n/255,r/255,1]}if(e.startsWith(`#`)&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,n=1;return[Nt(e.slice(n,n+=t)),Nt(e.slice(n,n+=t)),Nt(e.slice(n,n+=t)),Nt(e.slice(n,n+t)||`ff`)]}if(e.startsWith(`rgb`)){let t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[e,n,r,i,a,o,s,c,l,u,d,f]=t,p=[i||` `,s||` `,u].join(``);if(p===` `||p===` /`||p===`,,`||p===`,,,`){let e=[r,o,l].join(``),t=e===`%%%`?100:e===``?255:0;if(t){let e=[Ft(+n/t,0,1),Ft(+a/t,0,1),Ft(+c/t,0,1),d?Pt(+d,f):1];if(It(e))return e}}return}}let n=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(n){let[e,t,r,i,a,o,s,c,l]=n,u=[r||` `,a||` `,s].join(``);if(u===` `||u===` /`||u===`,,`||u===`,,,`){let e=[+t,Ft(+i,0,100),Ft(+o,0,100),c?Pt(+c,l):1];if(It(e))return function([e,t,n,r]){function i(r){let i=(r+e/30)%12,a=t*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(i-3,9-i,1))}return e=wt(e),t/=100,n/=100,[i(0),i(8),i(4),r]}(e)}}}(e);return t?new V(...t,!1):void 0}get rgb(){let{r:e,g:t,b:n,a:r}=this,i=r||1/0;return this.overwriteGetter(`rgb`,[e/i,t/i,n/i,r])}get hcl(){return this.overwriteGetter(`hcl`,function(e){let[t,n,r,i]=Tt(e),a=Math.sqrt(n*n+r*r);return[Math.round(1e4*a)?wt(Math.atan2(r,n)*Ct):NaN,a,t,i]}(this.rgb))}get lab(){return this.overwriteGetter(`lab`,Tt(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,n,r]=this.rgb;return`rgba(${[e,t,n].map((e=>Math.round(255*e))).join(`,`)},${r})`}static interpolate(e,t,n,r=`rgb`){switch(r){case`rgb`:{let[r,i,a,o]=zt(e.rgb,t.rgb,n);return new V(r,i,a,o,!1)}case`hcl`:{let[r,i,a,o]=e.hcl,[s,c,l,u]=t.hcl,d,f;if(isNaN(r)||isNaN(s))isNaN(r)?isNaN(s)?d=NaN:(d=s,a!==1&&a!==0||(f=c)):(d=r,l!==1&&l!==0||(f=i));else{let e=s-r;s>r&&e>180?e-=360:s<r&&r-s>180&&(e+=360),d=r+n*e}let[p,m,h,g]=function([e,t,n,r]){return e=isNaN(e)?0:e*St,Ot([n,Math.cos(e)*t,Math.sin(e)*t,r])}([d,f??Rt(i,c,n),Rt(a,l,n),Rt(o,u,n)]);return new V(p,m,h,g,!1)}case`lab`:{let[r,i,a,o]=Ot(zt(e.lab,t.lab,n));return new V(r,i,a,o,!1)}}}}V.black=new V(0,0,0,1),V.white=new V(1,1,1,1),V.transparent=new V(0,0,0,0),V.red=new V(1,0,0,1);class H{constructor(e,t,n){this.sensitivity=e?t?`variant`:`case`:t?`accent`:`base`,this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:`search`})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}let Bt=[`bottom`,`center`,`top`];class Vt{constructor(e,t,n,r,i,a){this.text=e,this.image=t,this.scale=n,this.fontStack=r,this.textColor=i,this.verticalAlign=a}}class Ht{constructor(e){this.sections=e}static fromString(e){return new Ht([new Vt(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some((e=>e.text.length!==0||e.image&&e.image.name.length!==0))}static factory(e){return e instanceof Ht?e:Ht.fromString(e)}toString(){return this.sections.length===0?``:this.sections.map((e=>e.text)).join(``)}}class Ut{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ut)return e;if(typeof e==`number`)return new Ut([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let t of e)if(typeof t!=`number`)return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Ut(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,n){return new Ut(zt(e.values,t.values,n))}}class Wt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Wt)return e;if(typeof e==`number`)return new Wt([e]);if(Array.isArray(e)){for(let t of e)if(typeof t!=`number`)return;return new Wt(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,n){return new Wt(zt(e.values,t.values,n))}}class Gt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Gt)return e;if(typeof e==`string`){let t=V.parse(e);return t?new Gt([t]):void 0}if(!Array.isArray(e))return;let t=[];for(let n of e){if(typeof n!=`string`)return;let e=V.parse(n);if(!e)return;t.push(e)}return new Gt(t)}toString(){return JSON.stringify(this.values)}static interpolate(e,t,n,r=`rgb`){let i=[];if(e.values.length!=t.values.length)throw Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let a=0;a<e.values.length;a++)i.push(V.interpolate(e.values[a],t.values[a],n,r));return new Gt(i)}}class Kt extends Error{constructor(e){super(e),this.name=`RuntimeError`}toJSON(){return this.message}}let qt=new Set([`center`,`left`,`right`,`top`,`bottom`,`top-left`,`top-right`,`bottom-left`,`bottom-right`]);class Jt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Jt)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t<e.length;t+=2){let n=e[t],r=e[t+1];if(typeof n!=`string`||!qt.has(n)||!Array.isArray(r)||r.length!==2||typeof r[0]!=`number`||typeof r[1]!=`number`)return}return new Jt(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,n){let r=e.values,i=t.values;if(r.length!==i.length)throw new Kt(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);let a=[];for(let e=0;e<r.length;e+=2){if(r[e]!==i[e])throw new Kt(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${r[e]}, to[${e}]: ${i[e]}`);a.push(r[e]);let[t,o]=r[e+1],[s,c]=i[e+1];a.push([Rt(t,s,n),Rt(o,c,n)])}return new Jt(a)}}class Yt{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Yt({name:e,available:!1}):null}}class Xt{constructor(e,t,n){this.from=e,this.to=t,this.transition=n}static interpolate(e,t,n){return new Xt(e,t,n)}static parse(e){return e instanceof Xt?e:Array.isArray(e)&&e.length===3&&typeof e[0]==`string`&&typeof e[1]==`string`&&typeof e[2]==`number`?new Xt(e[0],e[1],e[2]):typeof e==`object`&&typeof e.from==`string`&&typeof e.to==`string`&&typeof e.transition==`number`?new Xt(e.from,e.to,e.transition):typeof e==`string`?new Xt(e,e,1):void 0}}function Zt(e,t,n,r){return typeof e==`number`&&e>=0&&e<=255&&typeof t==`number`&&t>=0&&t<=255&&typeof n==`number`&&n>=0&&n<=255?r===void 0||typeof r==`number`&&r>=0&&r<=1?null:`Invalid rgba value [${[e,t,n,r].join(`, `)}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof r==`number`?[e,t,n,r]:[e,t,n]).join(`, `)}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Qt(e){if(e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||e instanceof Xt||e instanceof V||e instanceof H||e instanceof Ht||e instanceof Ut||e instanceof Wt||e instanceof Gt||e instanceof Jt||e instanceof Yt)return!0;if(Array.isArray(e)){for(let t of e)if(!Qt(t))return!1;return!0}if(typeof e==`object`){for(let t in e)if(!Qt(e[t]))return!1;return!0}return!1}function $t(e){if(e===null)return $e;if(typeof e==`string`)return R;if(typeof e==`boolean`)return z;if(typeof e==`number`)return L;if(e instanceof V)return et;if(e instanceof Xt)return tt;if(e instanceof H)return rt;if(e instanceof Ht)return it;if(e instanceof Ut)return at;if(e instanceof Wt)return st;if(e instanceof Gt)return ot;if(e instanceof Jt)return lt;if(e instanceof Yt)return ct;if(Array.isArray(e)){let t=e.length,n;for(let t of e){let e=$t(t);if(n){if(n===e)continue;n=B;break}n=e}return ut(n||B,t)}return nt}function en(e){let t=typeof e;return e===null?``:t===`string`||t===`number`||t===`boolean`?String(e):e instanceof V||e instanceof Xt||e instanceof Ht||e instanceof Ut||e instanceof Wt||e instanceof Gt||e instanceof Jt||e instanceof Yt?e.toString():JSON.stringify(e)}class tn{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(e.length!==2)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Qt(e[1]))return t.error(`invalid value`);let n=e[1],r=$t(n),i=t.expectedType;return r.kind!==`array`||r.N!==0||!i||i.kind!==`array`||typeof i.N==`number`&&i.N!==0||(r=i),new tn(r,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}let nn={string:R,number:L,boolean:z,object:nt};class U{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error(`Expected at least one argument.`);let n,r=1,i=e[0];if(i===`array`){let i,a;if(e.length>2){let n=e[1];if(typeof n!=`string`||!(n in nn)||n===`object`)return t.error(`The item type argument of "array" must be one of string, number, boolean`,1);i=nn[n],r++}else i=B;if(e.length>3){if(e[2]!==null&&(typeof e[2]!=`number`||e[2]<0||e[2]!==Math.floor(e[2])))return t.error(`The length argument to "array" must be a positive integer literal`,2);a=e[2],r++}n=ut(i,a)}else{if(!nn[i])throw Error(`Types doesn't contain name = ${i}`);n=nn[i]}let a=[];for(;r<e.length;r++){let n=t.parse(e[r],r,B);if(!n)return null;a.push(n)}return new U(n,a)}evaluate(e){for(let t=0;t<this.args.length;t++){let n=this.args[t].evaluate(e);if(!pt(this.type,$t(n)))return n;if(t===this.args.length-1)throw new Kt(`Expected value to be of type ${dt(this.type)}, but found ${dt($t(n))} instead.`)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}let rn={"to-boolean":z,"to-color":et,"to-number":L,"to-string":R};class W{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error(`Expected at least one argument.`);let n=e[0];if(!rn[n])throw Error(`Can't parse ${n} as it is not part of the known types`);if((n===`to-boolean`||n===`to-string`)&&e.length!==2)return t.error(`Expected one argument.`);let r=rn[n],i=[];for(let n=1;n<e.length;n++){let r=t.parse(e[n],n,B);if(!r)return null;i.push(r)}return new W(r,i)}evaluate(e){switch(this.type.kind){case`boolean`:return!!this.args[0].evaluate(e);case`color`:{let t,n;for(let r of this.args){if(t=r.evaluate(e),n=null,t instanceof V)return t;if(typeof t==`string`){let n=e.parseColor(t);if(n)return n}else if(Array.isArray(t)&&(n=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:Zt(t[0],t[1],t[2],t[3]),!n))return new V(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Kt(n||`Could not parse color from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`padding`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Ut.parse(t);if(r)return r}throw new Kt(`Could not parse padding from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`numberArray`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Wt.parse(t);if(r)return r}throw new Kt(`Could not parse numberArray from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`colorArray`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Gt.parse(t);if(r)return r}throw new Kt(`Could not parse colorArray from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`variableAnchorOffsetCollection`:{let t;for(let n of this.args){t=n.evaluate(e);let r=Jt.parse(t);if(r)return r}throw new Kt(`Could not parse variableAnchorOffsetCollection from value '${typeof t==`string`?t:JSON.stringify(t)}'`)}case`number`:{let t=null;for(let n of this.args){if(t=n.evaluate(e),t===null)return 0;let r=Number(t);if(!isNaN(r))return r}throw new Kt(`Could not convert ${JSON.stringify(t)} to number.`)}case`formatted`:return Ht.fromString(en(this.args[0].evaluate(e)));case`resolvedImage`:return Yt.fromString(en(this.args[0].evaluate(e)));case`projectionDefinition`:return this.args[0].evaluate(e);default:return en(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}let G=[`Unknown`,`Point`,`LineString`,`Polygon`];class an{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?typeof this.feature.type==`number`?G[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&`geometry`in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=V.parse(e),this._parseColorCache.set(e,t)),t}}class K{constructor(e,t,n=[],r,i=new Qe,a=[]){this.registry=e,this.path=n,this.key=n.map((e=>`[${e}]`)).join(``),this.scope=i,this.errors=a,this.expectedType=r,this._isConstant=t}parse(e,t,n,r,i={}){return t?this.concat(t,n,r)._parse(e,i):this._parse(e,i)}_parse(e,t){function n(e,t,n){return n===`assert`?new U(t,[e]):n===`coerce`?new W(t,[e]):e}if(e!==null&&typeof e!=`string`&&typeof e!=`boolean`&&typeof e!=`number`||(e=[`literal`,e]),Array.isArray(e)){if(e.length===0)return this.error(`Expected an array with at least one element. If you wanted a literal array, use ["literal", []].`);let r=e[0];if(typeof r!=`string`)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let i=this.registry[r];if(i){let r=i.parse(e,this);if(!r)return null;if(this.expectedType){let e=this.expectedType,i=r.type;if(e.kind!==`string`&&e.kind!==`number`&&e.kind!==`boolean`&&e.kind!==`object`&&e.kind!==`array`||i.kind!==`value`){if(e.kind===`projectionDefinition`&&[`string`,`array`].includes(i.kind)||[`color`,`formatted`,`resolvedImage`].includes(e.kind)&&[`value`,`string`].includes(i.kind)||[`padding`,`numberArray`].includes(e.kind)&&[`value`,`number`,`array`].includes(i.kind)||e.kind===`colorArray`&&[`value`,`string`,`array`].includes(i.kind)||e.kind===`variableAnchorOffsetCollection`&&[`value`,`array`].includes(i.kind))r=n(r,e,t.typeAnnotation||`coerce`);else if(this.checkSubtype(e,i))return null}else r=n(r,e,t.typeAnnotation||`assert`)}if(!(r instanceof tn)&&r.type.kind!==`resolvedImage`&&this._isConstant(r)){let e=new an;try{r=new tn(r.type,r.evaluate(e))}catch(e){return this.error(e.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?`'undefined' value invalid. Use null instead.`:typeof e==`object`?`Bare objects invalid. Use ["literal", {...}] instead.`:`Expected an array, but found ${typeof e} instead.`)}concat(e,t,n){let r=typeof e==`number`?this.path.concat(e):this.path,i=n?this.scope.concat(n):this.scope;return new K(this.registry,this._isConstant,r,t||null,i,this.errors)}error(e,...t){let n=`${this.key}${t.map((e=>`[${e}]`)).join(``)}`;this.errors.push(new Ze(n,e))}checkSubtype(e,t){let n=pt(e,t);return n&&this.error(n),n}}class on{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let n=[];for(let r=1;r<e.length-1;r+=2){let i=e[r];if(typeof i!=`string`)return t.error(`Expected string, but found ${typeof i} instead.`,r);if(/[^a-zA-Z0-9_]/.test(i))return t.error(`Variable names must contain only alphanumeric characters or '_'.`,r);let a=t.parse(e[r+1],r+1);if(!a)return null;n.push([i,a])}let r=t.parse(e[e.length-1],e.length-1,t.expectedType,n);return r?new on(n,r):null}outputDefined(){return this.result.outputDefined()}}class sn{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(e.length!==2||typeof e[1]!=`string`)return t.error(`'var' expression requires exactly one string literal argument.`);let n=e[1];return t.scope.has(n)?new sn(n,t.scope.get(n)):t.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class cn{constructor(e,t,n){this.type=e,this.index=t,this.input=n}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let n=t.parse(e[1],1,L),r=t.parse(e[2],2,ut(t.expectedType||B));return n&&r?new cn(r.type.itemType,n,r):null}evaluate(e){let t=this.index.evaluate(e),n=this.input.evaluate(e);if(t<0)throw new Kt(`Array index out of bounds: ${t} < 0.`);if(t>=n.length)throw new Kt(`Array index out of bounds: ${t} > ${n.length-1}.`);if(t!==Math.floor(t))throw new Kt(`Array index must be an integer, but found ${t} instead.`);return n[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class ln{constructor(e,t){this.type=z,this.needle=e,this.haystack=t}static parse(e,t){if(e.length!==3)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let n=t.parse(e[1],1,B),r=t.parse(e[2],2,B);return n&&r?mt(n.type,[z,R,L,$e,B])?new ln(n,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${dt(n.type)} instead`):null}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!ht(t,[`boolean`,`string`,`number`,`null`]))throw new Kt(`Expected first argument to be of type boolean, string, number or null, but found ${dt($t(t))} instead.`);if(!ht(n,[`string`,`array`]))throw new Kt(`Expected second argument to be of type array or string, but found ${dt($t(n))} instead.`);return n.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class un{constructor(e,t,n){this.type=L,this.needle=e,this.haystack=t,this.fromIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let n=t.parse(e[1],1,B),r=t.parse(e[2],2,B);if(!n||!r)return null;if(!mt(n.type,[z,R,L,$e,B]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${dt(n.type)} instead`);if(e.length===4){let i=t.parse(e[3],3,L);return i?new un(n,r,i):null}return new un(n,r)}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!ht(t,[`boolean`,`string`,`number`,`null`]))throw new Kt(`Expected first argument to be of type boolean, string, number or null, but found ${dt($t(t))} instead.`);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(e)),ht(n,[`string`])){let e=n.indexOf(t,r);return e===-1?-1:[...n.slice(0,e)].length}if(ht(n,[`array`]))return n.indexOf(t,r);throw new Kt(`Expected second argument to be of type array or string, but found ${dt($t(n))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class dn{constructor(e,t,n,r,i,a){this.inputType=e,this.type=t,this.input=n,this.cases=r,this.outputs=i,this.otherwise=a}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error(`Expected an even number of arguments.`);let n,r;t.expectedType&&t.expectedType.kind!==`value`&&(r=t.expectedType);let i={},a=[];for(let o=2;o<e.length-1;o+=2){let s=e[o],c=e[o+1];Array.isArray(s)||(s=[s]);let l=t.concat(o);if(s.length===0)return l.error(`Expected at least one branch label.`);for(let e of s){if(typeof e!=`number`&&typeof e!=`string`)return l.error(`Branch labels must be numbers or strings.`);if(typeof e==`number`&&Math.abs(e)>2**53-1)return l.error(`Branch labels must be integers no larger than ${2**53-1}.`);if(typeof e==`number`&&Math.floor(e)!==e)return l.error(`Numeric branch labels must be integer values.`);if(n){if(l.checkSubtype(n,$t(e)))return null}else n=$t(e);if(i[String(e)]!==void 0)return l.error(`Branch labels must be unique.`);i[String(e)]=a.length}let u=t.parse(c,o,r);if(!u)return null;r||=u.type,a.push(u)}let o=t.parse(e[1],1,B);if(!o)return null;let s=t.parse(e[e.length-1],e.length-1,r);return s?o.type.kind!==`value`&&t.concat(1).checkSubtype(n,o.type)?null:new dn(n,r,o,i,a,s):null}evaluate(e){let t=this.input.evaluate(e);return($t(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}}class fn{constructor(e,t,n){this.type=e,this.branches=t,this.otherwise=n}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error(`Expected an odd number of arguments.`);let n;t.expectedType&&t.expectedType.kind!==`value`&&(n=t.expectedType);let r=[];for(let i=1;i<e.length-1;i+=2){let a=t.parse(e[i],i,z);if(!a)return null;let o=t.parse(e[i+1],i+1,n);if(!o)return null;r.push([a,o]),n||=o.type}let i=t.parse(e[e.length-1],e.length-1,n);if(!i)return null;if(!n)throw Error(`Can't infer output type`);return new fn(n,r,i)}evaluate(e){for(let[t,n]of this.branches)if(t.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,n]of this.branches)e(t),e(n);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}}class pn{constructor(e,t,n,r){this.type=e,this.input=t,this.beginIndex=n,this.endIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let n=t.parse(e[1],1,B),r=t.parse(e[2],2,L);if(!n||!r)return null;if(!mt(n.type,[ut(B),R,B]))return t.error(`Expected first argument to be of type array or string, but found ${dt(n.type)} instead`);if(e.length===4){let i=t.parse(e[3],3,L);return i?new pn(n.type,n,r,i):null}return new pn(n.type,n,r)}evaluate(e){let t=this.input.evaluate(e),n=this.beginIndex.evaluate(e),r;if(this.endIndex&&(r=this.endIndex.evaluate(e)),ht(t,[`string`]))return[...t].slice(n,r).join(``);if(ht(t,[`array`]))return t.slice(n,r);throw new Kt(`Expected first argument to be of type array or string, but found ${dt($t(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function mn(e,t){let n=e.length-1,r,i,a=0,o=n,s=0;for(;a<=o;)if(s=Math.floor((a+o)/2),r=e[s],i=e[s+1],r<=t){if(s===n||t<i)return s;a=s+1}else{if(!(r>t))throw new Kt(`Input is not a number.`);o=s-1}return 0}class hn{constructor(e,t,n){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(let[e,t]of n)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error(`Expected an even number of arguments.`);let n=t.parse(e[1],1,L);if(!n)return null;let r=[],i=null;t.expectedType&&t.expectedType.kind!==`value`&&(i=t.expectedType);for(let n=1;n<e.length;n+=2){let a=n===1?-1/0:e[n],o=e[n+1],s=n,c=n+1;if(typeof a!=`number`)return t.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 t.error(`Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.`,s);let l=t.parse(o,c,i);if(!l)return null;i||=l.type,r.push([a,l])}return new hn(i,n,r)}evaluate(e){let t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);let r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);let i=t.length;return r>=t[i-1]?n[i-1].evaluate(e):n[mn(t,r)].evaluate(e)}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function gn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var _n,vn,yn=gn(function(){if(vn)return _n;function e(e,t,n,r){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=n,this.p2y=r}return vn=1,_n=e,e.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(t===void 0&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,r=0;r<8;r++){var i=this.sampleCurveX(n)-e;if(Math.abs(i)<t)return n;var a=this.sampleCurveDerivativeX(n);if(Math.abs(a)<1e-6)break;n-=i/a}var o=0,s=1;for(n=e,r=0;r<20&&(i=this.sampleCurveX(n),!(Math.abs(i-e)<t));r++)e>i?o=n:s=n,n=.5*(s-o)+o;return n},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},_n}());class bn{constructor(e,t,n,r,i){this.type=e,this.operator=t,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(let[e,t]of i)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,n,r){let i=0;if(e.name===`exponential`)i=xn(t,e.base,n,r);else if(e.name===`linear`)i=xn(t,1,n,r);else if(e.name===`cubic-bezier`){let a=e.controlPoints;i=new yn(a[0],a[1],a[2],a[3]).solve(xn(t,1,n,r))}return i}static parse(e,t){let[n,r,i,...a]=e;if(!Array.isArray(r)||r.length===0)return t.error(`Expected an interpolation type expression.`,1);if(r[0]===`linear`)r={name:`linear`};else if(r[0]===`exponential`){let e=r[1];if(typeof e!=`number`)return t.error(`Exponential interpolation requires a numeric base.`,1,1);r={name:`exponential`,base:e}}else{if(r[0]!==`cubic-bezier`)return t.error(`Unknown interpolation type ${String(r[0])}`,1,0);{let e=r.slice(1);if(e.length!==4||e.some((e=>typeof e!=`number`||e<0||e>1)))return t.error(`Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.`,1);r={name:`cubic-bezier`,controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error(`Expected an even number of arguments.`);if(i=t.parse(i,2,L),!i)return null;let o=[],s=null;n!==`interpolate-hcl`&&n!==`interpolate-lab`||t.expectedType==ot?t.expectedType&&t.expectedType.kind!==`value`&&(s=t.expectedType):s=et;for(let e=0;e<a.length;e+=2){let n=a[e],r=a[e+1],i=e+3,c=e+4;if(typeof n!=`number`)return t.error(`Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.`,i);if(o.length&&o[o.length-1][0]>=n)return t.error(`Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.`,i);let l=t.parse(r,c,s);if(!l)return null;s||=l.type,o.push([n,l])}return gt(s,L)||gt(s,tt)||gt(s,et)||gt(s,at)||gt(s,st)||gt(s,ot)||gt(s,lt)||gt(s,ut(L))?new bn(s,n,r,i,o):t.error(`Type ${dt(s)} is not interpolatable.`)}evaluate(e){let t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);let r=this.input.evaluate(e);if(r<=t[0])return n[0].evaluate(e);let i=t.length;if(r>=t[i-1])return n[i-1].evaluate(e);let a=mn(t,r),o=bn.interpolationFactor(this.interpolation,r,t[a],t[a+1]),s=n[a].evaluate(e),c=n[a+1].evaluate(e);switch(this.operator){case`interpolate`:switch(this.type.kind){case`number`:return Rt(s,c,o);case`color`:return V.interpolate(s,c,o);case`padding`:return Ut.interpolate(s,c,o);case`colorArray`:return Gt.interpolate(s,c,o);case`numberArray`:return Wt.interpolate(s,c,o);case`variableAnchorOffsetCollection`:return Jt.interpolate(s,c,o);case`array`:return zt(s,c,o);case`projectionDefinition`:return Xt.interpolate(s,c,o)}case`interpolate-hcl`:switch(this.type.kind){case`color`:return V.interpolate(s,c,o,`hcl`);case`colorArray`:return Gt.interpolate(s,c,o,`hcl`)}case`interpolate-lab`:switch(this.type.kind){case`color`:return V.interpolate(s,c,o,`lab`);case`colorArray`:return Gt.interpolate(s,c,o,`lab`)}}}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function xn(e,t,n,r){let i=r-n,a=e-n;return i===0?0:t===1?a/i:(t**+a-1)/(t**+i-1)}let Sn={color:V.interpolate,number:Rt,padding:Ut.interpolate,numberArray:Wt.interpolate,colorArray:Gt.interpolate,variableAnchorOffsetCollection:Jt.interpolate,array:zt};class Cn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error(`Expected at least one argument.`);let n=null,r=t.expectedType;r&&r.kind!==`value`&&(n=r);let i=[];for(let r of e.slice(1)){let e=t.parse(r,1+i.length,n,void 0,{typeAnnotation:`omit`});if(!e)return null;n||=e.type,i.push(e)}if(!n)throw Error(`No output type`);return new Cn(r&&i.some((e=>pt(r,e.type)))?B:n,i)}evaluate(e){let t,n=null,r=0;for(let i of this.args)if(r++,n=i.evaluate(e),n&&n instanceof Yt&&!n.available&&(t||=n.name,n=null,r===this.args.length&&(n=t)),n!==null)break;return n}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function wn(e,t){return e===`==`||e===`!=`?t.kind===`boolean`||t.kind===`string`||t.kind===`number`||t.kind===`null`||t.kind===`value`:t.kind===`string`||t.kind===`number`||t.kind===`value`}function Tn(e,t,n,r){return r.compare(t,n)===0}function En(e,t,n){let r=e!==`==`&&e!==`!=`;return class i{constructor(e,t,n){this.type=z,this.lhs=e,this.rhs=t,this.collator=n,this.hasUntypedArgument=e.type.kind===`value`||t.type.kind===`value`}static parse(e,t){if(e.length!==3&&e.length!==4)return t.error(`Expected two or three arguments.`);let n=e[0],a=t.parse(e[1],1,B);if(!a)return null;if(!wn(n,a.type))return t.concat(1).error(`"${n}" comparisons are not supported for type '${dt(a.type)}'.`);let o=t.parse(e[2],2,B);if(!o)return null;if(!wn(n,o.type))return t.concat(2).error(`"${n}" comparisons are not supported for type '${dt(o.type)}'.`);if(a.type.kind!==o.type.kind&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot compare types '${dt(a.type)}' and '${dt(o.type)}'.`);r&&(a.type.kind===`value`&&o.type.kind!==`value`?a=new U(o.type,[a]):a.type.kind!==`value`&&o.type.kind===`value`&&(o=new U(a.type,[o])));let s=null;if(e.length===4){if(a.type.kind!==`string`&&o.type.kind!==`string`&&a.type.kind!==`value`&&o.type.kind!==`value`)return t.error(`Cannot use collator to compare non-string types.`);if(s=t.parse(e[3],3,rt),!s)return null}return new i(a,o,s)}evaluate(i){let a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){let t=$t(a),n=$t(o);if(t.kind!==n.kind||t.kind!==`string`&&t.kind!==`number`)throw new Kt(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${n.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){let e=$t(a),n=$t(o);if(e.kind!==`string`||n.kind!==`string`)return t(i,a,o)}return this.collator?n(i,a,o,this.collator.evaluate(i)):t(i,a,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}let Dn=En(`==`,(function(e,t,n){return t===n}),Tn),On=En(`!=`,(function(e,t,n){return t!==n}),(function(e,t,n,r){return!Tn(0,t,n,r)})),kn=En(`<`,(function(e,t,n){return t<n}),(function(e,t,n,r){return r.compare(t,n)<0})),An=En(`>`,(function(e,t,n){return t>n}),(function(e,t,n,r){return r.compare(t,n)>0})),jn=En(`<=`,(function(e,t,n){return t<=n}),(function(e,t,n,r){return r.compare(t,n)<=0})),Mn=En(`>=`,(function(e,t,n){return t>=n}),(function(e,t,n,r){return r.compare(t,n)>=0}));class Nn{constructor(e,t,n){this.type=rt,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(e.length!==2)return t.error(`Expected one argument.`);let n=e[1];if(typeof n!=`object`||Array.isArray(n))return t.error(`Collator options argument must be an object.`);let r=t.parse(n[`case-sensitive`]!==void 0&&n[`case-sensitive`],1,z);if(!r)return null;let i=t.parse(n[`diacritic-sensitive`]!==void 0&&n[`diacritic-sensitive`],1,z);if(!i)return null;let a=null;return n.locale&&(a=t.parse(n.locale,1,R),!a)?null:new Nn(r,i,a)}evaluate(e){return new H(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Pn{constructor(e,t,n,r,i,a){this.type=R,this.number=e,this.locale=t,this.currency=n,this.unit=r,this.minFractionDigits=i,this.maxFractionDigits=a}static parse(e,t){if(e.length!==3)return t.error(`Expected two arguments.`);let n=t.parse(e[1],1,L);if(!n)return null;let r=e[2];if(typeof r!=`object`||Array.isArray(r))return t.error(`NumberFormat options argument must be an object.`);let i=null;if(r.locale&&(i=t.parse(r.locale,1,R),!i))return null;let a=null;if(r.currency&&(a=t.parse(r.currency,1,R),!a))return null;let o=null;if(r.unit&&(o=t.parse(r.unit,1,R),!o))return null;if(a&&o)return t.error("NumberFormat options `currency` and `unit` are mutually exclusive");let s=null;if(r[`min-fraction-digits`]&&(s=t.parse(r[`min-fraction-digits`],1,L),!s))return null;let c=null;return r[`max-fraction-digits`]&&(c=t.parse(r[`max-fraction-digits`],1,L),!c)?null:new Pn(n,i,a,o,s,c)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?`currency`:this.unit?`unit`:`decimal`,currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Fn{constructor(e){this.type=it,this.sections=e}static parse(e,t){if(e.length<2)return t.error(`Expected at least one argument.`);let n=e[1];if(!Array.isArray(n)&&typeof n==`object`)return t.error(`First argument must be an image or text section.`);let r=[],i=!1;for(let n=1;n<=e.length-1;++n){let a=e[n];if(i&&typeof a==`object`&&!Array.isArray(a)){i=!1;let e=null;if(a[`font-scale`]&&(e=t.parse(a[`font-scale`],1,L),!e))return null;let n=null;if(a[`text-font`]&&(n=t.parse(a[`text-font`],1,ut(R)),!n))return null;let o=null;if(a[`text-color`]&&(o=t.parse(a[`text-color`],1,et),!o))return null;let s=null;if(a[`vertical-align`]){if(typeof a[`vertical-align`]==`string`&&!Bt.includes(a[`vertical-align`]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a[`vertical-align`]}' instead.`);if(s=t.parse(a[`vertical-align`],1,R),!s)return null}let c=r[r.length-1];c.scale=e,c.font=n,c.textColor=o,c.verticalAlign=s}else{let a=t.parse(e[n],1,B);if(!a)return null;let o=a.type.kind;if(o!==`string`&&o!==`value`&&o!==`null`&&o!==`resolvedImage`)return t.error(`Formatted text type must be 'string', 'value', 'image' or 'null'.`);i=!0,r.push({content:a,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Fn(r)}evaluate(e){return new Ht(this.sections.map((t=>{let n=t.content.evaluate(e);return $t(n)===ct?new Vt(``,n,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new Vt(en(n),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(`,`):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)})))}eachChild(e){for(let t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}}class In{constructor(e){this.type=ct,this.input=e}static parse(e,t){if(e.length!==2)return t.error(`Expected two arguments.`);let n=t.parse(e[1],1,R);return n?new In(n):t.error(`No image name provided.`)}evaluate(e){let t=this.input.evaluate(e),n=Yt.fromString(t);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(t)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}}class Ln{constructor(e){this.type=L,this.input=e}static parse(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);let n=t.parse(e[1],1);return n?n.type.kind!==`array`&&n.type.kind!==`string`&&n.type.kind!==`value`?t.error(`Expected argument of type string or array, but found ${dt(n.type)} instead.`):new Ln(n):null}evaluate(e){let t=this.input.evaluate(e);if(typeof t==`string`)return[...t].length;if(Array.isArray(t))return t.length;throw new Kt(`Expected value to be of type string or array, but found ${dt($t(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}let Rn=8192;function zn(e,t){let n=(180+e[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=2**t.z;return[Math.round(n*i*Rn),Math.round(r*i*Rn)]}function Bn(e,t){let n=2**t.z;return[(i=(e[0]/Rn+t.x)/n,360*i-180),(r=(e[1]/Rn+t.y)/n,360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90)];var r,i}function Vn(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Hn(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Un(e,t,n){let r=e[0]-t[0],i=e[1]-t[1],a=e[0]-n[0],o=e[1]-n[1];return r*o-a*i==0&&r*a<=0&&i*o<=0}function Wn(e,t,n,r){return(i=[r[0]-n[0],r[1]-n[1]])[0]*(a=[t[0]-e[0],t[1]-e[1]])[1]-i[1]*a[0]!=0&&!(!Xn(e,t,n,r)||!Xn(n,r,e,t));var i,a}function Gn(e,t,n){for(let r of n)for(let n=0;n<r.length-1;++n)if(Wn(e,t,r[n],r[n+1]))return!0;return!1}function Kn(e,t,n=!1){let r=!1;for(let s of t)for(let t=0;t<s.length-1;t++){if(Un(e,s[t],s[t+1]))return n;(a=s[t])[1]>(i=e)[1]!=(o=s[t+1])[1]>i[1]&&i[0]<(o[0]-a[0])*(i[1]-a[1])/(o[1]-a[1])+a[0]&&(r=!r)}var i,a,o;return r}function qn(e,t){for(let n of t)if(Kn(e,n))return!0;return!1}function Jn(e,t){for(let n of e)if(!Kn(n,t))return!1;for(let n=0;n<e.length-1;++n)if(Gn(e[n],e[n+1],t))return!1;return!0}function Yn(e,t){for(let n of t)if(Jn(e,n))return!0;return!1}function Xn(e,t,n,r){let i=r[0]-n[0],a=r[1]-n[1],o=(e[0]-n[0])*a-i*(e[1]-n[1]),s=(t[0]-n[0])*a-i*(t[1]-n[1]);return o>0&&s<0||o<0&&s>0}function Zn(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=[];for(let r=0;r<e[i].length;r++){let o=zn(e[i][r],n);Vn(t,o),a.push(o)}r.push(a)}return r}function Qn(e,t,n){let r=[];for(let i=0;i<e.length;i++){let a=Zn(e[i],t,n);r.push(a)}return r}function $n(e,t,n,r){if(e[0]<n[0]||e[0]>n[2]){let t=.5*r,i=e[0]-n[0]>t?-r:n[0]-e[0]>t?r:0;i===0&&(i=e[0]-n[2]>t?-r:n[2]-e[0]>t?r:0),e[0]+=i}Vn(t,e)}function er(e,t,n,r){let i=2**r.z*Rn,a=[r.x*Rn,r.y*Rn],o=[];for(let r of e)for(let e of r){let r=[e.x+a[0],e.y+a[1]];$n(r,t,n,i),o.push(r)}return o}function tr(e,t,n,r){let i=2**r.z*Rn,a=[r.x*Rn,r.y*Rn],o=[];for(let n of e){let e=[];for(let r of n){let n=[r.x+a[0],r.y+a[1]];Vn(t,n),e.push(n)}o.push(e)}if(t[2]-t[0]<=i/2){(s=t)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(let e of o)for(let r of e)$n(r,t,n,i)}var s;return o}class nr{constructor(e,t){this.type=z,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Qt(e[1])){let t=e[1];if(t.type===`FeatureCollection`){let e=[];for(let n of t.features){let{type:t,coordinates:r}=n.geometry;t===`Polygon`&&e.push(r),t===`MultiPolygon`&&e.push(...r)}if(e.length)return new nr(t,{type:`MultiPolygon`,coordinates:e})}else if(t.type===`Feature`){let e=t.geometry.type;if(e===`Polygon`||e===`MultiPolygon`)return new nr(t,t.geometry)}else if(t.type===`Polygon`||t.type===`MultiPolygon`)return new nr(t,t)}return t.error(`'within' expression requires valid geojson object that contains polygon geometry type.`)}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===`Point`)return function(e,t){let n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){let a=Zn(t.coordinates,r,i),o=er(e.geometry(),n,r,i);if(!Hn(n,r))return!1;for(let e of o)if(!Kn(e,a))return!1}if(t.type===`MultiPolygon`){let a=Qn(t.coordinates,r,i),o=er(e.geometry(),n,r,i);if(!Hn(n,r))return!1;for(let e of o)if(!qn(e,a))return!1}return!0}(e,this.geometries);if(e.geometryType()===`LineString`)return function(e,t){let n=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type===`Polygon`){let a=Zn(t.coordinates,r,i),o=tr(e.geometry(),n,r,i);if(!Hn(n,r))return!1;for(let e of o)if(!Jn(e,a))return!1}if(t.type===`MultiPolygon`){let a=Qn(t.coordinates,r,i),o=tr(e.geometry(),n,r,i);if(!Hn(n,r))return!1;for(let e of o)if(!Yn(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let rr=class{constructor(e=[],t=(e,t)=>e<t?-1:+(e>t)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:n}=this,r=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r}_down(e){let{data:t,compare:n}=this,r=this.length>>1,i=t[e];for(;e<r;){let r=1+(e<<1),a=r+1;if(a<this.length&&n(t[a],t[r])<0&&(r=a),n(t[r],i)>=0)break;t[e]=t[r],e=r}t[e]=i}};function ir(e,t,n=0,r=e.length-1,i=or){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);ir(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(ar(e,n,t),i(e[r],a)>0&&ar(e,n,r);o<s;){for(ar(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?ar(e,n,s):(s++,ar(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function ar(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function or(e,t){return e<t?-1:+(e>t)}function sr(e,t){if(e.length<=1)return[e];let n=[],r,i;for(let t of e){let e=lr(t);e!==0&&(t.area=Math.abs(e),i===void 0&&(i=e<0),i===e<0?(r&&n.push(r),r=[t]):r.push(t))}if(r&&n.push(r),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||(ir(n[e],t,1,n[e].length-1,cr),n[e]=n[e].slice(0,t));return n}function cr(e,t){return t.area-e.area}function lr(e){let t=0;for(let n,r,i=0,a=e.length,o=a-1;i<a;o=i++)n=e[i],r=e[o],t+=(r.x-n.x)*(n.y+r.y);return t}let ur=1/298.257223563,dr=ur*(2-ur),fr=Math.PI/180;class pr{constructor(e){let t=6378.137*fr*1e3,n=Math.cos(e*fr),r=1/(1-dr*(1-n*n)),i=Math.sqrt(r);this.kx=t*i*n,this.ky=t*i*r*(1-dr)}distance(e,t){let n=this.wrap(e[0]-t[0])*this.kx,r=(e[1]-t[1])*this.ky;return Math.sqrt(n*n+r*r)}pointOnLine(e,t){let n,r,i,a,o=1/0;for(let s=0;s<e.length-1;s++){let c=e[s][0],l=e[s][1],u=this.wrap(e[s+1][0]-c)*this.kx,d=(e[s+1][1]-l)*this.ky,f=0;u===0&&d===0||(f=(this.wrap(t[0]-c)*this.kx*u+(t[1]-l)*this.ky*d)/(u*u+d*d),f>1?(c=e[s+1][0],l=e[s+1][1]):f>0&&(c+=u/this.kx*f,l+=d/this.ky*f)),u=this.wrap(t[0]-c)*this.kx,d=(t[1]-l)*this.ky;let p=u*u+d*d;p<o&&(o=p,n=c,r=l,i=s,a=f)}return{point:[n,r],index:i,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function mr(e,t){return t[0]-e[0]}function hr(e){return e[1]-e[0]+1}function gr(e,t){return e[1]>=e[0]&&e[1]<t}function _r(e,t){if(e[0]>e[1])return[null,null];let n=hr(e);if(t){if(n===2)return[e,null];let t=Math.floor(n/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(n===1)return[e,null];let r=Math.floor(n/2)-1;return[[e[0],e[0]+r],[e[0]+r+1,e[1]]]}function vr(e,t){if(!gr(t,e.length))return[1/0,1/0,-1/0,-1/0];let n=[1/0,1/0,-1/0,-1/0];for(let r=t[0];r<=t[1];++r)Vn(n,e[r]);return n}function yr(e){let t=[1/0,1/0,-1/0,-1/0];for(let n of e)for(let e of n)Vn(t,e);return t}function br(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function xr(e,t,n){if(!br(e)||!br(t))return NaN;let r=0,i=0;return e[2]<t[0]&&(r=t[0]-e[2]),e[0]>t[2]&&(r=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]<t[1]&&(i=t[1]-e[3]),n.distance([0,0],[r,i])}function Sr(e,t,n){let r=n.pointOnLine(t,e);return n.distance(e,r.point)}function Cr(e,t,n,r,i){let a=Math.min(Sr(e,[n,r],i),Sr(t,[n,r],i)),o=Math.min(Sr(n,[e,t],i),Sr(r,[e,t],i));return Math.min(a,o)}function wr(e,t,n,r,i){if(!gr(t,e.length)||!gr(r,n.length))return 1/0;let a=1/0;for(let o=t[0];o<t[1];++o){let t=e[o],s=e[o+1];for(let e=r[0];e<r[1];++e){let r=n[e],o=n[e+1];if(Wn(t,s,r,o))return 0;a=Math.min(a,Cr(t,s,r,o,i))}}return a}function q(e,t,n,r,i){if(!gr(t,e.length)||!gr(r,n.length))return NaN;let a=1/0;for(let o=t[0];o<=t[1];++o)for(let t=r[0];t<=r[1];++t)if(a=Math.min(a,i.distance(e[o],n[t])),a===0)return a;return a}function Tr(e,t,n){if(Kn(e,t,!0))return 0;let r=1/0;for(let i of t){let t=i[0],a=i[i.length-1];if(t!==a&&(r=Math.min(r,Sr(e,[a,t],n)),r===0))return r;let o=n.pointOnLine(i,e);if(r=Math.min(r,n.distance(e,o.point)),r===0)return r}return r}function Er(e,t,n,r){if(!gr(t,e.length))return NaN;for(let r=t[0];r<=t[1];++r)if(Kn(e[r],n,!0))return 0;let i=1/0;for(let a=t[0];a<t[1];++a){let t=e[a],o=e[a+1];for(let e of n)for(let n=0,a=e.length,s=a-1;n<a;s=n++){let a=e[s],c=e[n];if(Wn(t,o,a,c))return 0;i=Math.min(i,Cr(t,o,a,c,r))}}return i}function Dr(e,t){for(let n of e)for(let e of n)if(Kn(e,t,!0))return!0;return!1}function Or(e,t,n,r=1/0){let i=yr(e),a=yr(t);if(r!==1/0&&xr(i,a,n)>=r)return r;if(Hn(i,a)){if(Dr(e,t))return 0}else if(Dr(t,e))return 0;let o=1/0;for(let r of e)for(let e=0,i=r.length,a=i-1;e<i;a=e++){let i=r[a],s=r[e];for(let e of t)for(let t=0,r=e.length,a=r-1;t<r;a=t++){let r=e[a],c=e[t];if(Wn(i,s,r,c))return 0;o=Math.min(o,Cr(i,s,r,c,n))}}return o}function kr(e,t,n,r,i,a){if(!a)return;let o=xr(vr(r,a),i,n);o<t&&e.push([o,a,[0,0]])}function Ar(e,t,n,r,i,a,o){if(!a||!o)return;let s=xr(vr(r,a),vr(i,o),n);s<t&&e.push([s,a,o])}function jr(e,t,n,r,i=1/0){let a=Math.min(r.distance(e[0],n[0][0]),i);if(a===0)return a;let o=new rr([[0,[0,e.length-1],[0,0]]],mr),s=yr(n);for(;o.length>0;){let i=o.pop();if(i[0]>=a)continue;let c=i[1],l=t?50:100;if(hr(c)<=l){if(!gr(c,e.length))return NaN;if(t){let t=Er(e,c,n,r);if(isNaN(t)||t===0)return t;a=Math.min(a,t)}else for(let t=c[0];t<=c[1];++t){let i=Tr(e[t],n,r);if(a=Math.min(a,i),a===0)return 0}}else{let n=_r(c,t);kr(o,a,r,e,s,n[0]),kr(o,a,r,e,s,n[1])}}return a}function Mr(e,t,n,r,i,a=1/0){let o=Math.min(a,i.distance(e[0],n[0]));if(o===0)return o;let s=new rr([[0,[0,e.length-1],[0,n.length-1]]],mr);for(;s.length>0;){let a=s.pop();if(a[0]>=o)continue;let c=a[1],l=a[2],u=t?50:100,d=r?50:100;if(hr(c)<=u&&hr(l)<=d){if(!gr(c,e.length)&&gr(l,n.length))return NaN;let a;if(t&&r)a=wr(e,c,n,l,i),o=Math.min(o,a);else if(t&&!r){let t=e.slice(c[0],c[1]+1);for(let e=l[0];e<=l[1];++e)if(a=Sr(n[e],t,i),o=Math.min(o,a),o===0)return o}else if(!t&&r){let t=n.slice(l[0],l[1]+1);for(let n=c[0];n<=c[1];++n)if(a=Sr(e[n],t,i),o=Math.min(o,a),o===0)return o}else a=q(e,c,n,l,i),o=Math.min(o,a)}else{let a=_r(c,t),u=_r(l,r);Ar(s,o,i,e,n,a[0],u[0]),Ar(s,o,i,e,n,a[0],u[1]),Ar(s,o,i,e,n,a[1],u[0]),Ar(s,o,i,e,n,a[1],u[1])}}return o}function Nr(e){return e.type===`MultiPolygon`?e.coordinates.map((e=>({type:`Polygon`,coordinates:e}))):e.type===`MultiLineString`?e.coordinates.map((e=>({type:`LineString`,coordinates:e}))):e.type===`MultiPoint`?e.coordinates.map((e=>({type:`Point`,coordinates:e}))):[e]}class Pr{constructor(e,t){this.type=L,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Qt(e[1])){let t=e[1];if(t.type===`FeatureCollection`)return new Pr(t,t.features.map((e=>Nr(e.geometry))).flat());if(t.type===`Feature`)return new Pr(t,Nr(t.geometry));if(`type`in t&&`coordinates`in t)return new Pr(t,Nr(t))}return t.error(`'distance' expression requires valid geojson object that contains polygon geometry type.`)}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()===`Point`)return function(e,t){let n=e.geometry(),r=n.flat().map((t=>Bn([t.x,t.y],e.canonical)));if(n.length===0)return NaN;let i=new pr(r[0][1]),a=1/0;for(let e of t){switch(e.type){case`Point`:a=Math.min(a,Mr(r,!1,[e.coordinates],!1,i,a));break;case`LineString`:a=Math.min(a,Mr(r,!1,e.coordinates,!0,i,a));break;case`Polygon`:a=Math.min(a,jr(r,!1,e.coordinates,i,a))}if(a===0)return a}return a}(e,this.geometries);if(e.geometryType()===`LineString`)return function(e,t){let n=e.geometry(),r=n.flat().map((t=>Bn([t.x,t.y],e.canonical)));if(n.length===0)return NaN;let i=new pr(r[0][1]),a=1/0;for(let e of t){switch(e.type){case`Point`:a=Math.min(a,Mr(r,!0,[e.coordinates],!1,i,a));break;case`LineString`:a=Math.min(a,Mr(r,!0,e.coordinates,!0,i,a));break;case`Polygon`:a=Math.min(a,jr(r,!0,e.coordinates,i,a))}if(a===0)return a}return a}(e,this.geometries);if(e.geometryType()===`Polygon`)return function(e,t){let n=e.geometry();if(n.length===0||n[0].length===0)return NaN;let r=sr(n,0).map((t=>t.map((t=>t.map((t=>Bn([t.x,t.y],e.canonical))))))),i=new pr(r[0][0][0][1]),a=1/0;for(let e of t)for(let t of r){switch(e.type){case`Point`:a=Math.min(a,jr([e.coordinates],!1,t,i,a));break;case`LineString`:a=Math.min(a,jr(e.coordinates,!0,t,i,a));break;case`Polygon`:a=Math.min(a,Or(t,e.coordinates,i,a))}if(a===0)return a}return a}(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Fr{constructor(e){this.type=B,this.key=e}static parse(e,t){if(e.length!==2)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);let n=e[1];return n==null?t.error(`Global state property must be defined.`):typeof n==`string`?new Fr(n):t.error(`Global state property must be string, but found ${typeof e[1]} instead.`)}evaluate(e){let t=e.globals?.globalState;return t&&Object.keys(t).length!==0?Mt(t,this.key):null}eachChild(){}outputDefined(){return!1}}let Ir={"==":Dn,"!=":On,">":An,"<":kn,">=":Mn,"<=":jn,array:U,at:cn,boolean:U,case:fn,coalesce:Cn,collator:Nn,format:Fn,image:In,in:ln,"index-of":un,interpolate:bn,"interpolate-hcl":bn,"interpolate-lab":bn,length:Ln,let:on,literal:tn,match:dn,number:U,"number-format":Pn,object:U,slice:pn,step:hn,string:U,"to-boolean":W,"to-color":W,"to-number":W,"to-string":W,var:sn,within:nr,distance:Pr,"global-state":Fr};class Lr{constructor(e,t,n,r){this.name=e,this.type=t,this._evaluate=n,this.args=r}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){let n=e[0],r=Lr.definitions[n];if(!r)return t.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);let i=Array.isArray(r)?r[0]:r.type,a=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,o=a.filter((([t])=>!Array.isArray(t)||t.length===e.length-1)),s=null;for(let[r,a]of o){s=new K(t.registry,Hr,t.path,null,t.scope);let o=[],c=!1;for(let t=1;t<e.length;t++){let n=e[t],i=Array.isArray(r)?r[t-1]:r.type,a=s.parse(n,1+o.length,i);if(!a){c=!0;break}o.push(a)}if(!c)if(Array.isArray(r)&&r.length!==o.length)s.error(`Expected ${r.length} arguments, but found ${o.length} instead.`);else{for(let e=0;e<o.length;e++){let t=Array.isArray(r)?r[e]:r.type,n=o[e];s.concat(e+1).checkSubtype(t,n.type)}if(s.errors.length===0)return new Lr(n,i,a,o)}}if(o.length===1)t.errors.push(...s.errors);else{let n=(o.length?o:a).map((([e])=>{return t=e,Array.isArray(t)?`(${t.map(dt).join(`, `)})`:`(${dt(t.type)}...)`;var t})).join(` | `),r=[];for(let n=1;n<e.length;n++){let i=t.parse(e[n],1+r.length);if(!i)return null;r.push(dt(i.type))}t.error(`Expected arguments of type ${n}, but found (${r.join(`, `)}) instead.`)}return null}static register(e,t){Lr.definitions=t;for(let n in t)e[n]=Lr}}function Rr(e,[t,n,r,i]){t=t.evaluate(e),n=n.evaluate(e),r=r.evaluate(e);let a=i?i.evaluate(e):1,o=Zt(t,n,r,a);if(o)throw new Kt(o);return new V(t/255,n/255,r/255,a,!1)}function zr(e,t){return e in t}function Br(e,t){let n=t[e];return n===void 0?null:n}function Vr(e){return{type:e}}function Hr(e){if(e instanceof sn)return Hr(e.boundExpression);if(e instanceof Lr&&e.name===`error`||e instanceof Nn||e instanceof nr||e instanceof Pr||e instanceof Fr)return!1;let t=e instanceof W||e instanceof U,n=!0;return e.eachChild((e=>{n=t?n&&Hr(e):n&&e instanceof tn})),!!n&&Ur(e)&&Gr(e,[`zoom`,`heatmap-density`,`elevation`,`line-progress`,`accumulated`,`is-supported-script`])}function Ur(e){if(e instanceof Lr&&(e.name===`get`&&e.args.length===1||e.name===`feature-state`||e.name===`has`&&e.args.length===1||e.name===`properties`||e.name===`geometry-type`||e.name===`id`||/^filter-/.test(e.name))||e instanceof nr||e instanceof Pr)return!1;let t=!0;return e.eachChild((e=>{t&&!Ur(e)&&(t=!1)})),t}function Wr(e){if(e instanceof Lr&&e.name===`feature-state`)return!1;let t=!0;return e.eachChild((e=>{t&&!Wr(e)&&(t=!1)})),t}function Gr(e,t){if(e instanceof Lr&&t.indexOf(e.name)>=0)return!1;let n=!0;return e.eachChild((e=>{n&&!Gr(e,t)&&(n=!1)})),n}function Kr(e){return{result:`success`,value:e}}function qr(e){return{result:`error`,value:e}}function Jr(e){return e[`property-type`]===`data-driven`||e[`property-type`]===`cross-faded-data-driven`}function Yr(e){return!!e.expression&&e.expression.parameters.indexOf(`zoom`)>-1}function Xr(e){return!!e.expression&&e.expression.interpolated}function J(e){return e instanceof Number?`number`:e instanceof String?`string`:e instanceof Boolean?`boolean`:Array.isArray(e)?`array`:e===null?`null`:typeof e}function Zr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&$t(e)===nt}function Qr(e){return e}function $r(e,t){let n=e.stops&&typeof e.stops[0][0]==`object`,r=n||!(n||e.property!==void 0),i=e.type||(Xr(t)?`exponential`:`interval`),a=function(e){switch(e.type){case`color`:return V.parse;case`padding`:return Ut.parse;case`numberArray`:return Wt.parse;case`colorArray`:return Gt.parse;default:return null}}(t);if(a&&((e=Xe({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],a(e[1])]))),e.default=a(e.default?e.default:t.default)),e.colorSpace&&(o=e.colorSpace)!==`rgb`&&o!==`hcl`&&o!==`lab`)throw Error(`Unknown color space: "${e.colorSpace}"`);var o;let s=function(e){switch(e){case`exponential`:return ri;case`interval`:return ni;case`categorical`:return ti;case`identity`:return ii;default:throw Error(`Unknown function type "${e}"`)}}(i),c,l;if(i===`categorical`){c=Object.create(null);for(let t of e.stops)c[t[0]]=t[1];l=typeof e.stops[0][0]}if(n){let n={},r=[];for(let t=0;t<e.stops.length;t++){let i=e.stops[t],a=i[0].zoom;n[a]===void 0&&(n[a]={zoom:a,type:e.type,property:e.property,default:e.default,stops:[]},r.push(a)),n[a].stops.push([i[0].value,i[1]])}let i=[];for(let e of r)i.push([n[e].zoom,$r(n[e],t)]);let a={name:`linear`};return{kind:`composite`,interpolationType:a,interpolationFactor:bn.interpolationFactor.bind(void 0,a),zoomStops:i.map((e=>e[0])),evaluate:({zoom:n},r)=>ri({stops:i,base:e.base},t,n).evaluate(n,r)}}if(r){let n=i===`exponential`?{name:`exponential`,base:e.base===void 0?1:e.base}:null;return{kind:`camera`,interpolationType:n,interpolationFactor:bn.interpolationFactor.bind(void 0,n),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:n})=>s(e,t,n,c,l)}}return{kind:`source`,evaluate(n,r){let i=r&&r.properties?r.properties[e.property]:void 0;return i===void 0?ei(e.default,t.default):s(e,t,i,c,l)}}}function ei(e,t,n){return e===void 0?t===void 0?n===void 0?void 0:n:t:e}function ti(e,t,n,r,i){return ei(typeof n===i?r[n]:void 0,e.default,t.default)}function ni(e,t,n){if(J(n)!==`number`)return ei(e.default,t.default);let r=e.stops.length;if(r===1||n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[r-1][0])return e.stops[r-1][1];let i=mn(e.stops.map((e=>e[0])),n);return e.stops[i][1]}function ri(e,t,n){let r=e.base===void 0?1:e.base;if(J(n)!==`number`)return ei(e.default,t.default);let i=e.stops.length;if(i===1||n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[i-1][0])return e.stops[i-1][1];let a=mn(e.stops.map((e=>e[0])),n),o=function(e,t,n,r){let i=r-n,a=e-n;return i===0?0:t===1?a/i:(t**+a-1)/(t**+i-1)}(n,r,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],c=e.stops[a+1][1],l=Sn[t.type]||Qr;return typeof s.evaluate==`function`?{evaluate(...t){let n=s.evaluate.apply(void 0,t),r=c.evaluate.apply(void 0,t);if(n!==void 0&&r!==void 0)return l(n,r,o,e.colorSpace)}}:l(s,c,o,e.colorSpace)}function ii(e,t,n){switch(t.type){case`color`:n=V.parse(n);break;case`formatted`:n=Ht.fromString(n.toString());break;case`resolvedImage`:n=Yt.fromString(n.toString());break;case`padding`:n=Ut.parse(n);break;case`colorArray`:n=Gt.parse(n);break;case`numberArray`:n=Wt.parse(n);break;default:J(n)===t.type||t.type===`enum`&&t.values[n]||(n=void 0)}return ei(n,e.default,t.default)}Lr.register(Ir,{error:[{kind:`error`},[R],(e,[t])=>{throw new Kt(t.evaluate(e))}],typeof:[R,[B],(e,[t])=>dt($t(t.evaluate(e)))],"to-rgba":[ut(L,4),[et],(e,[t])=>{let[n,r,i,a]=t.evaluate(e).rgb;return[255*n,255*r,255*i,a]}],rgb:[et,[L,L,L],Rr],rgba:[et,[L,L,L,L],Rr],has:{type:z,overloads:[[[R],(e,[t])=>zr(t.evaluate(e),e.properties())],[[R,nt],(e,[t,n])=>zr(t.evaluate(e),n.evaluate(e))]]},get:{type:B,overloads:[[[R],(e,[t])=>Br(t.evaluate(e),e.properties())],[[R,nt],(e,[t,n])=>Br(t.evaluate(e),n.evaluate(e))]]},"feature-state":[B,[R],(e,[t])=>Br(t.evaluate(e),e.featureState||{})],properties:[nt,[],e=>e.properties()],"geometry-type":[R,[],e=>e.geometryType()],id:[B,[],e=>e.id()],zoom:[L,[],e=>e.globals.zoom],"heatmap-density":[L,[],e=>e.globals.heatmapDensity||0],elevation:[L,[],e=>e.globals.elevation||0],"line-progress":[L,[],e=>e.globals.lineProgress||0],accumulated:[B,[],e=>e.globals.accumulated===void 0?null:e.globals.accumulated],"+":[L,Vr(L),(e,t)=>{let n=0;for(let r of t)n+=r.evaluate(e);return n}],"*":[L,Vr(L),(e,t)=>{let n=1;for(let r of t)n*=r.evaluate(e);return n}],"-":{type:L,overloads:[[[L,L],(e,[t,n])=>t.evaluate(e)-n.evaluate(e)],[[L],(e,[t])=>-t.evaluate(e)]]},"/":[L,[L,L],(e,[t,n])=>t.evaluate(e)/n.evaluate(e)],"%":[L,[L,L],(e,[t,n])=>t.evaluate(e)%n.evaluate(e)],ln2:[L,[],()=>Math.LN2],pi:[L,[],()=>Math.PI],e:[L,[],()=>Math.E],"^":[L,[L,L],(e,[t,n])=>t.evaluate(e)**+n.evaluate(e)],sqrt:[L,[L],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[L,[L],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[L,[L],(e,[t])=>Math.log(t.evaluate(e))],log2:[L,[L],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[L,[L],(e,[t])=>Math.sin(t.evaluate(e))],cos:[L,[L],(e,[t])=>Math.cos(t.evaluate(e))],tan:[L,[L],(e,[t])=>Math.tan(t.evaluate(e))],asin:[L,[L],(e,[t])=>Math.asin(t.evaluate(e))],acos:[L,[L],(e,[t])=>Math.acos(t.evaluate(e))],atan:[L,[L],(e,[t])=>Math.atan(t.evaluate(e))],min:[L,Vr(L),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[L,Vr(L),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[L,[L],(e,[t])=>Math.abs(t.evaluate(e))],round:[L,[L],(e,[t])=>{let n=t.evaluate(e);return n<0?-Math.round(-n):Math.round(n)}],floor:[L,[L],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[L,[L],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[z,[R,B],(e,[t,n])=>e.properties()[t.value]===n.value],"filter-id-==":[z,[B],(e,[t])=>e.id()===t.value],"filter-type-==":[z,[R],(e,[t])=>e.geometryType()===t.value],"filter-<":[z,[R,B],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<i}],"filter-id-<":[z,[B],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n<r}],"filter->":[z,[R,B],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>i}],"filter-id->":[z,[B],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n>r}],"filter-<=":[z,[R,B],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r<=i}],"filter-id-<=":[z,[B],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n<=r}],"filter->=":[z,[R,B],(e,[t,n])=>{let r=e.properties()[t.value],i=n.value;return typeof r==typeof i&&r>=i}],"filter-id->=":[z,[B],(e,[t])=>{let n=e.id(),r=t.value;return typeof n==typeof r&&n>=r}],"filter-has":[z,[B],(e,[t])=>t.value in e.properties()],"filter-has-id":[z,[],e=>e.id()!==null&&e.id()!==void 0],"filter-type-in":[z,[ut(R)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[z,[ut(B)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[z,[R,ut(B)],(e,[t,n])=>n.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[z,[R,ut(B)],(e,[t,n])=>function(e,t,n,r){for(;n<=r;){let i=n+r>>1;if(t[i]===e)return!0;t[i]>e?r=i-1:n=i+1}return!1}(e.properties()[t.value],n.value,0,n.value.length-1)],all:{type:z,overloads:[[[z,z],(e,[t,n])=>t.evaluate(e)&&n.evaluate(e)],[Vr(z),(e,t)=>{for(let n of t)if(!n.evaluate(e))return!1;return!0}]]},any:{type:z,overloads:[[[z,z],(e,[t,n])=>t.evaluate(e)||n.evaluate(e)],[Vr(z),(e,t)=>{for(let n of t)if(n.evaluate(e))return!0;return!1}]]},"!":[z,[z],(e,[t])=>!t.evaluate(e)],"is-supported-script":[z,[R],(e,[t])=>{let n=e.globals&&e.globals.isSupportedScript;return!n||n(t.evaluate(e))}],upcase:[R,[R],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[R,[R],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[R,Vr(B),(e,t)=>t.map((t=>en(t.evaluate(e)))).join(``)],split:[ut(R),[R,R],(e,[t,n])=>t.evaluate(e).split(n.evaluate(e))],join:[R,[ut(R),R],(e,[t,n])=>t.evaluate(e).join(n.evaluate(e))],"resolved-locale":[R,[rt],(e,[t])=>t.evaluate(e).resolvedLocale()]});class ai{constructor(e,t,n){this.expression=e,this._warningHistory={},this._evaluator=new an,this._defaultValue=t?function(e){if(e.type===`color`&&Zr(e.default))return new V(0,0,0,0);switch(e.type){case`color`:return V.parse(e.default)||null;case`padding`:return Ut.parse(e.default)||null;case`numberArray`:return Wt.parse(e.default)||null;case`colorArray`:return Gt.parse(e.default)||null;case`variableAnchorOffsetCollection`:return Jt.parse(e.default)||null;case`projectionDefinition`:return Xt.parse(e.default)||null;default:return e.default===void 0?null:e.default}}(t):null,this._enumValues=t&&t.type===`enum`?t.values:null,this._globalState=n}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._globalState&&(e=mi(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,n,r,i,a){this._globalState&&(e=mi(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{let e=this.expression.evaluate(this._evaluator);if(e==null||typeof e==`number`&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new Kt(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(`, `)}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,typeof console<`u`&&console.warn(e.message)),this._defaultValue}}}function oi(e){return Array.isArray(e)&&e.length>0&&typeof e[0]==`string`&&e[0]in Ir}function si(e,t,n){let r=new K(Ir,Hr,[],t?function(e){let t={color:et,string:R,number:L,enum:R,boolean:z,formatted:it,padding:at,numberArray:st,colorArray:ot,projectionDefinition:tt,resolvedImage:ct,variableAnchorOffsetCollection:lt};return e.type===`array`?ut(t[e.value]||B,e.length):t[e.type]}(t):void 0),i=r.parse(e,void 0,void 0,void 0,t&&t.type===`string`?{typeAnnotation:`coerce`}:void 0);return i?Kr(new ai(i,t,n)):qr(r.errors)}class ci{constructor(e,t,n){this.kind=e,this._styleExpression=t,this.isStateDependent=e!==`constant`&&!Wr(t.expression),this.globalStateRefs=pi(t.expression),this._globalState=n}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._globalState&&(e=mi(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}evaluate(e,t,n,r,i,a){return this._globalState&&(e=mi(e,this._globalState)),this._styleExpression.evaluate(e,t,n,r,i,a)}}class li{constructor(e,t,n,r,i){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent=e!==`camera`&&!Wr(t.expression),this.globalStateRefs=pi(t.expression),this.interpolationType=r,this._globalState=i}evaluateWithoutErrorHandling(e,t,n,r,i,a){return this._globalState&&(e=mi(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,n,r,i,a)}evaluate(e,t,n,r,i,a){return this._globalState&&(e=mi(e,this._globalState)),this._styleExpression.evaluate(e,t,n,r,i,a)}interpolationFactor(e,t,n){return this.interpolationType?bn.interpolationFactor(this.interpolationType,e,t,n):0}}function ui(e,t,n){let r=si(e,t,n);if(r.result===`error`)return r;let i=r.value.expression,a=Ur(i);if(!a&&!Jr(t))return qr([new Ze(``,`data expressions not supported`)]);let o=Gr(i,[`zoom`]);if(!o&&!Yr(t))return qr([new Ze(``,`zoom expressions not supported`)]);let s=fi(i);return s||o?s instanceof Ze?qr([s]):s instanceof bn&&!Xr(t)?qr([new Ze(``,`"interpolate" expressions cannot be used with this property`)]):Kr(s?new li(a?`camera`:`composite`,r.value,s.labels,s instanceof bn?s.interpolation:void 0,n):new ci(a?`constant`:`source`,r.value,n)):qr([new Ze(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`)])}class di{constructor(e,t){this._parameters=e,this._specification=t,Xe(this,$r(this._parameters,this._specification))}static deserialize(e){return new di(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function fi(e){let t=null;if(e instanceof on)t=fi(e.result);else if(e instanceof Cn){for(let n of e.args)if(t=fi(n),t)break}else (e instanceof hn||e instanceof bn)&&e.input instanceof Lr&&e.input.name===`zoom`&&(t=e);return t instanceof Ze||e.eachChild((e=>{let n=fi(e);n instanceof Ze?t=n:!t&&n?t=new Ze(``,`"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.`):t&&n&&t!==n&&(t=new Ze(``,`Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.`))})),t}function pi(e,t=new Set){return e instanceof Fr&&t.add(e.key),e.eachChild((e=>{pi(e,t)})),t}function mi(e,t){let{zoom:n,heatmapDensity:r,elevation:i,lineProgress:a,isSupportedScript:o,accumulated:s}=e??{};return{zoom:n,heatmapDensity:r,elevation:i,lineProgress:a,isSupportedScript:o,accumulated:s,globalState:t}}function hi(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case`has`:return e.length>=2&&e[1]!==`$id`&&e[1]!==`$type`;case`in`:return e.length>=3&&(typeof e[1]!=`string`||Array.isArray(e[2]));case`!in`:case`!has`:case`none`:return!1;case`==`:case`!=`:case`>`:case`>=`:case`<`:case`<=`:return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case`any`:case`all`:for(let t of e.slice(1))if(!hi(t)&&typeof t!=`boolean`)return!1;return!0;default:return!0}}let gi={type:`boolean`,default:!1,transition:!1,"property-type":`data-driven`,expression:{interpolated:!1,parameters:[`zoom`,`feature`]}};function _i(e,t){if(e==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};hi(e)||(e=bi(e));let n=si(e,gi,t);if(n.result===`error`)throw Error(n.value.map((e=>`${e.key}: ${e.message}`)).join(`, `));return{filter:(e,t,r)=>n.value.evaluate(e,t,{},r),needGeometry:yi(e),getGlobalStateRefs:()=>pi(n.value.expression)}}function vi(e,t){return e<t?-1:+(e>t)}function yi(e){if(!Array.isArray(e))return!1;if(e[0]===`within`||e[0]===`distance`)return!0;for(let t=1;t<e.length;t++)if(yi(e[t]))return!0;return!1}function bi(e){if(!e)return!0;let t=e[0];return e.length<=1?t!==`any`:t===`==`?xi(e[1],e[2],`==`):t===`!=`?wi(xi(e[1],e[2],`==`)):t===`<`||t===`>`||t===`<=`||t===`>=`?xi(e[1],e[2],t):t===`any`?(n=e.slice(1),[`any`].concat(n.map(bi))):t===`all`?[`all`].concat(e.slice(1).map(bi)):t===`none`?[`all`].concat(e.slice(1).map(bi).map(wi)):t===`in`?Si(e[1],e.slice(2)):t===`!in`?wi(Si(e[1],e.slice(2))):t===`has`?Ci(e[1]):t!==`!has`||wi(Ci(e[1]));var n}function xi(e,t,n){switch(e){case`$type`:return[`filter-type-${n}`,t];case`$id`:return[`filter-id-${n}`,t];default:return[`filter-${n}`,e,t]}}function Si(e,t){if(t.length===0)return!1;switch(e){case`$type`:return[`filter-type-in`,[`literal`,t]];case`$id`:return[`filter-id-in`,[`literal`,t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?[`filter-in-large`,e,[`literal`,t.sort(vi)]]:[`filter-in-small`,e,[`literal`,t]]}}function Ci(e){switch(e){case`$type`:return!0;case`$id`:return[`filter-has-id`];default:return[`filter-has`,e]}}function wi(e){return[`!`,e]}function Ti(e){let t=typeof e;if(t===`number`||t===`boolean`||t===`string`||e==null)return JSON.stringify(e);if(Array.isArray(e)){let t=`[`;for(let n of e)t+=`${Ti(n)},`;return`${t}]`}let n=Object.keys(e).sort(),r=`{`;for(let t=0;t<n.length;t++)r+=`${JSON.stringify(n[t])}:${Ti(e[n[t]])},`;return`${r}}`}function Ei(e){let t=``;for(let n of Be)t+=`/${Ti(e[n])}`;return t}function Di(e){let t=e.value;return t?[new I(e.key,t,`constants have been deprecated as of v8`)]:[]}function Oi(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function ki(e){if(Array.isArray(e))return e.map(ki);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let n in e)t[n]=ki(e[n]);return t}return Oi(e)}function Ai(e){let t=e.key,n=e.value,r=e.valueSpec||{},i=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=e.validateSpec,c=[],l=J(n);if(l!==`object`)return[new I(t,n,`object expected, ${l} found`)];for(let e in n){let l=e.split(`.`)[0],u=Mt(r,l)||r[`*`],d;if(Mt(i,l))d=i[l];else if(Mt(r,l)){if(n[e]===void 0)continue;d=s}else if(i[`*`])d=i[`*`];else{if(!r[`*`]){c.push(new I(t,n[e],`unknown property "${e}"`));continue}d=s}c=c.concat(d({key:(t&&`${t}.`)+e,value:n[e],valueSpec:u,style:a,styleSpec:o,object:n,objectKey:e,validateSpec:s},n))}for(let e in r)i[e]||r[e].required&&r[e].default===void 0&&n[e]===void 0&&c.push(new I(t,n,`missing required property "${e}"`));return c}function ji(e){let t=e.value,n=e.valueSpec,r=e.style,i=e.styleSpec,a=e.key,o=e.arrayElementValidator||e.validateSpec;if(J(t)!==`array`)return[new I(a,t,`array expected, ${J(t)} found`)];if(n.length&&t.length!==n.length)return[new I(a,t,`array length ${n.length} expected, length ${t.length} found`)];let s={type:n.value,values:n.values};i.$version<7&&(s.function=n.function),J(n.value)===`object`&&(s=n.value);let c=[];for(let n=0;n<t.length;n++)c=c.concat(o({array:t,arrayIndex:n,value:t[n],valueSpec:s,validateSpec:e.validateSpec,style:r,styleSpec:i,key:`${a}[${n}]`}));return c}function Mi(e){let t=e.key,n=e.value,r=e.valueSpec,i=J(n);return i===`number`&&n!=n&&(i=`NaN`),i===`number`?`minimum`in r&&n<r.minimum?[new I(t,n,`${n} is less than the minimum value ${r.minimum}`)]:`maximum`in r&&n>r.maximum?[new I(t,n,`${n} is greater than the maximum value ${r.maximum}`)]:[]:[new I(t,n,`number expected, ${i} found`)]}function Ni(e){let t=e.valueSpec,n=Oi(e.value.type),r,i,a,o={},s=n!==`categorical`&&e.value.property===void 0,c=!s,l=J(e.value.stops)===`array`&&J(e.value.stops[0])===`array`&&J(e.value.stops[0][0])===`object`,u=Ai({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if(n===`identity`)return[new I(e.key,e.value,`identity function may not have a "stops" property`)];let t=[],r=e.value;return t=t.concat(ji({key:e.key,value:r,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:d})),J(r)===`array`&&r.length===0&&t.push(new I(e.key,r,`array must have at least one stop`)),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return n===`identity`&&s&&u.push(new I(e.key,e.value,`missing required property "property"`)),n===`identity`||e.value.stops||u.push(new I(e.key,e.value,`missing required property "stops"`)),n===`exponential`&&e.valueSpec.expression&&!Xr(e.valueSpec)&&u.push(new I(e.key,e.value,`exponential functions not supported`)),e.styleSpec.$version>=8&&(c&&!Jr(e.valueSpec)?u.push(new I(e.key,e.value,`property functions not supported`)):s&&!Yr(e.valueSpec)&&u.push(new I(e.key,e.value,`zoom functions not supported`))),n!==`categorical`&&!l||e.value.property!==void 0||u.push(new I(e.key,e.value,`"property" property is required`)),u;function d(e){let n=[],r=e.value,s=e.key;if(J(r)!==`array`)return[new I(s,r,`array expected, ${J(r)} found`)];if(r.length!==2)return[new I(s,r,`array length 2 expected, length ${r.length} found`)];if(l){if(J(r[0])!==`object`)return[new I(s,r,`object expected, ${J(r[0])} found`)];if(r[0].zoom===void 0)return[new I(s,r,`object stop key must have zoom`)];if(r[0].value===void 0)return[new I(s,r,`object stop key must have value`)];if(a&&a>Oi(r[0].zoom))return[new I(s,r[0].zoom,`stop zoom values must appear in ascending order`)];Oi(r[0].zoom)!==a&&(a=Oi(r[0].zoom),i=void 0,o={}),n=n.concat(Ai({key:`${s}[0]`,value:r[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Mi,value:f}}))}else n=n.concat(f({key:`${s}[0]`,value:r[0],validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},r));return oi(ki(r[1]))?n.concat([new I(`${s}[1]`,r[1],`expressions are not allowed in function stops.`)]):n.concat(e.validateSpec({key:`${s}[1]`,value:r[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function f(e,a){let s=J(e.value),c=Oi(e.value),l=e.value===null?a:e.value;if(r){if(s!==r)return[new I(e.key,l,`${s} stop domain type must match previous stop domain type ${r}`)]}else r=s;if(s!==`number`&&s!==`string`&&s!==`boolean`)return[new I(e.key,l,`stop domain value must be a number, string, or boolean`)];if(s!==`number`&&n!==`categorical`){let r=`number expected, ${s} found`;return Jr(t)&&n===void 0&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new I(e.key,l,r)]}return n!==`categorical`||s!==`number`||isFinite(c)&&Math.floor(c)===c?n!==`categorical`&&s===`number`&&i!==void 0&&c<i?[new I(e.key,l,`stop domain values must appear in ascending order`)]:(i=c,n===`categorical`&&c in o?[new I(e.key,l,`stop domain values must be unique`)]:(o[c]=!0,[])):[new I(e.key,l,`integer expected, found ${c}`)]}}function Pi(e){let t=(e.expressionContext===`property`?ui:si)(ki(e.value),e.valueSpec);if(t.result===`error`)return t.value.map((t=>new I(`${e.key}${t.key}`,e.value,t.message)));let n=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext===`property`&&e.propertyKey===`text-font`&&!n.outputDefined())return[new I(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if(e.expressionContext===`property`&&e.propertyType===`layout`&&!Wr(n))return[new I(e.key,e.value,`"feature-state" data expressions are not supported with layout properties.`)];if(e.expressionContext===`filter`&&!Wr(n))return[new I(e.key,e.value,`"feature-state" data expressions are not supported with filters.`)];if(e.expressionContext&&e.expressionContext.indexOf(`cluster`)===0){if(!Gr(n,[`zoom`,`feature-state`]))return[new I(e.key,e.value,`"zoom" and "feature-state" expressions are not supported with cluster properties.`)];if(e.expressionContext===`cluster-initial`&&!Ur(n))return[new I(e.key,e.value,`Feature data expressions are not supported with initial expression part of cluster properties.`)]}return[]}function Fi(e){let t=e.key,n=e.value,r=J(n);return r===`string`?V.parse(String(n))?[]:[new I(t,n,`color expected, "${n}" found`)]:[new I(t,n,`color expected, ${r} found`)]}function Ii(e){let t=e.key,n=e.value,r=e.valueSpec,i=[];return Array.isArray(r.values)?r.values.indexOf(Oi(n))===-1&&i.push(new I(t,n,`expected one of [${r.values.join(`, `)}], ${JSON.stringify(n)} found`)):Object.keys(r.values).indexOf(Oi(n))===-1&&i.push(new I(t,n,`expected one of [${Object.keys(r.values).join(`, `)}], ${JSON.stringify(n)} found`)),i}function Li(e){return hi(ki(e.value))?Pi(Xe({},e,{expressionContext:`filter`,valueSpec:{value:`boolean`}})):Ri(e)}function Ri(e){let t=e.value,n=e.key;if(J(t)!==`array`)return[new I(n,t,`array expected, ${J(t)} found`)];let r=e.styleSpec,i,a=[];if(t.length<1)return[new I(n,t,`filter array must have at least 1 element`)];switch(a=a.concat(Ii({key:`${n}[0]`,value:t[0],valueSpec:r.filter_operator,style:e.style,styleSpec:e.styleSpec})),Oi(t[0])){case`<`:case`<=`:case`>`:case`>=`:t.length>=2&&Oi(t[1])===`$type`&&a.push(new I(n,t,`"$type" cannot be use with operator "${t[0]}"`));case`==`:case`!=`:t.length!==3&&a.push(new I(n,t,`filter array for operator "${t[0]}" must have 3 elements`));case`in`:case`!in`:t.length>=2&&(i=J(t[1]),i!==`string`&&a.push(new I(`${n}[1]`,t[1],`string expected, ${i} found`)));for(let o=2;o<t.length;o++)i=J(t[o]),Oi(t[1])===`$type`?a=a.concat(Ii({key:`${n}[${o}]`,value:t[o],valueSpec:r.geometry_type,style:e.style,styleSpec:e.styleSpec})):i!==`string`&&i!==`number`&&i!==`boolean`&&a.push(new I(`${n}[${o}]`,t[o],`string, number, or boolean expected, ${i} found`));break;case`any`:case`all`:case`none`:for(let r=1;r<t.length;r++)a=a.concat(Ri({key:`${n}[${r}]`,value:t[r],style:e.style,styleSpec:e.styleSpec}));break;case`has`:case`!has`:i=J(t[1]),t.length===2?i!==`string`&&a.push(new I(`${n}[1]`,t[1],`string expected, ${i} found`)):a.push(new I(n,t,`filter array for "${t[0]}" operator must have 2 elements`))}return a}function zi(e,t){let n=e.key,r=e.validateSpec,i=e.style,a=e.styleSpec,o=e.value,s=e.objectKey,c=a[`${t}_${e.layerType}`];if(!c)return[];let l=s.match(/^(.*)-transition$/);if(t===`paint`&&l&&c[l[1]]&&c[l[1]].transition)return r({key:n,value:o,valueSpec:a.transition,style:i,styleSpec:a});let u=e.valueSpec||c[s];if(!u)return[new I(n,o,`unknown property "${s}"`)];let d;if(J(o)===`string`&&Jr(u)&&!u.tokens&&(d=/^{([^}]+)}$/.exec(o)))return[new I(n,o,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(d[1])} }\`.`)];let f=[];return e.layerType===`symbol`&&s===`text-font`&&Zr(ki(o))&&Oi(o.type)===`identity`&&f.push(new I(n,o,`"text-font" does not support identity functions`)),f.concat(r({key:e.key,value:o,valueSpec:u,style:i,styleSpec:a,expressionContext:`property`,propertyType:t,propertyKey:s}))}function Bi(e){return zi(e,`paint`)}function Vi(e){return zi(e,`layout`)}function Hi(e){var t,n;let r=[],i=e.value,a=e.key,o=e.style,s=e.styleSpec;if(J(i)!==`object`)return[new I(a,i,`object expected, ${J(i)} found`)];i.type||i.ref||r.push(new I(a,i,`either "type" or "ref" is required`));let c=Oi(i.type),l=Oi(i.ref);if(i.id){let t=Oi(i.id);for(let n=0;n<e.arrayIndex;n++){let e=o.layers[n];Oi(e.id)===t&&r.push(new I(a,i.id,`duplicate layer id "${i.id}", previously used at line ${e.id.__line__}`))}}if(`ref`in i){let e;[`type`,`source`,`source-layer`,`filter`,`layout`].forEach((e=>{e in i&&r.push(new I(a,i[e],`"${e}" is prohibited for ref layers`))})),o.layers.forEach((t=>{Oi(t.id)===l&&(e=t)})),e?e.ref?r.push(new I(a,i.ref,`ref cannot reference another ref layer`)):c=Oi(e.type):r.push(new I(a,i.ref,`ref layer "${l}" not found`))}else if(c!==`background`)if(i.source){let e=o.sources&&o.sources[i.source],t=e&&Oi(e.type);e?t===`vector`&&c===`raster`?r.push(new I(a,i.source,`layer "${i.id}" requires a raster source`)):t!==`raster-dem`&&c===`hillshade`||t!==`raster-dem`&&c===`color-relief`?r.push(new I(a,i.source,`layer "${i.id}" requires a raster-dem source`)):t===`raster`&&c!==`raster`?r.push(new I(a,i.source,`layer "${i.id}" requires a vector source`)):t!==`vector`||i[`source-layer`]?t===`raster-dem`&&c!==`hillshade`&&c!==`color-relief`?r.push(new I(a,i.source,`raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.`)):c!==`line`||!i.paint||!i.paint[`line-gradient`]||t===`geojson`&&e.lineMetrics||r.push(new I(a,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):r.push(new I(a,i,`layer "${i.id}" must specify a "source-layer"`)):r.push(new I(a,i.source,`source "${i.source}" not found`))}else r.push(new I(a,i,`missing required property "source"`));return c===`raster`&&(t=i.paint)!=null&&t.resampling&&(n=i.paint)!=null&&n[`raster-resampling`]&&r.push(new I(a,i.paint,`layer "${i.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),r=r.concat(Ai({key:a,value:i,valueSpec:s.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:`${a}.type`,value:i.type,valueSpec:s.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:i,objectKey:`type`}),filter:Li,layout:e=>Ai({layer:i,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>Vi(Xe({layerType:c},e))}}),paint:e=>Ai({layer:i,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>Bi(Xe({layerType:c},e))}})}})),r}function Ui(e){let t=e.value,n=e.key,r=J(t);return r===`string`?[]:[new I(n,t,`string expected, ${r} found`)]}let Wi={promoteId:function({key:e,value:t}){if(J(t)===`string`)return Ui({key:e,value:t});{let n=[];for(let r in t)n.push(...Ui({key:`${e}.${r}`,value:t[r]}));return n}}};function Gi(e){let t=e.value,n=e.key,r=e.styleSpec,i=e.style,a=e.validateSpec;if(!t.type)return[new I(n,t,`"type" is required`)];let o=Oi(t.type),s;switch(o){case`vector`:case`raster`:return s=Ai({key:n,value:t,valueSpec:r[`source_${o.replace(`-`,`_`)}`],style:e.style,styleSpec:r,objectElementValidators:Wi,validateSpec:a}),s;case`raster-dem`:return s=function(e){let t=e.sourceName??``,n=e.value,r=e.styleSpec,i=r.source_raster_dem,a=e.style,o=[],s=J(n);if(n===void 0)return o;if(s!==`object`)return o.push(new I(`source_raster_dem`,n,`object expected, ${s} found`)),o;let c=Oi(n.encoding)===`custom`,l=[`redFactor`,`greenFactor`,`blueFactor`,`baseShift`],u=e.value.encoding?`"${e.value.encoding}"`:`Default`;for(let s in n)!c&&l.includes(s)?o.push(new I(s,n[s],`In "${t}": "${s}" is only valid when "encoding" is set to "custom". ${u} encoding found`)):i[s]?o=o.concat(e.validateSpec({key:s,value:n[s],valueSpec:i[s],validateSpec:e.validateSpec,style:a,styleSpec:r})):o.push(new I(s,n[s],`unknown property "${s}"`));return o}({sourceName:n,value:t,style:e.style,styleSpec:r,validateSpec:a}),s;case`geojson`:if(s=Ai({key:n,value:t,valueSpec:r.source_geojson,style:i,styleSpec:r,validateSpec:a,objectElementValidators:Wi}),t.cluster)for(let e in t.clusterProperties){let[r,i]=t.clusterProperties[e],a=typeof r==`string`?[r,[`accumulated`],[`get`,e]]:r;s.push(...Pi({key:`${n}.${e}.map`,value:i,expressionContext:`cluster-map`})),s.push(...Pi({key:`${n}.${e}.reduce`,value:a,expressionContext:`cluster-reduce`}))}return s;case`video`:return Ai({key:n,value:t,valueSpec:r.source_video,style:i,validateSpec:a,styleSpec:r});case`image`:return Ai({key:n,value:t,valueSpec:r.source_image,style:i,validateSpec:a,styleSpec:r});case`canvas`:return[new I(n,null,`Please use runtime APIs to add canvas sources, rather than including them in stylesheets.`,`source.canvas`)];default:return Ii({key:`${n}.type`,value:t.type,valueSpec:{values:[`vector`,`raster`,`raster-dem`,`geojson`,`video`,`image`]}})}}function Ki(e){let t=e.value,n=e.styleSpec,r=n.light,i=e.style,a=[],o=J(t);if(t===void 0)return a;if(o!==`object`)return a=a.concat([new I(`light`,t,`object expected, ${o} found`)]),a;for(let o in t){let s=o.match(/^(.*)-transition$/);a=a.concat(s&&r[s[1]]&&r[s[1]].transition?e.validateSpec({key:o,value:t[o],valueSpec:n.transition,validateSpec:e.validateSpec,style:i,styleSpec:n}):r[o]?e.validateSpec({key:o,value:t[o],valueSpec:r[o],validateSpec:e.validateSpec,style:i,styleSpec:n}):[new I(o,t[o],`unknown property "${o}"`)])}return a}function qi(e){let t=e.value,n=e.styleSpec,r=n.sky,i=e.style,a=J(t);if(t===void 0)return[];if(a!==`object`)return[new I(`sky`,t,`object expected, ${a} found`)];let o=[];for(let a in t)o=o.concat(r[a]?e.validateSpec({key:a,value:t[a],valueSpec:r[a],style:i,styleSpec:n}):[new I(a,t[a],`unknown property "${a}"`)]);return o}function Ji(e){let t=e.value,n=e.styleSpec,r=n.terrain,i=e.style,a=[],o=J(t);if(t===void 0)return a;if(o!==`object`)return a=a.concat([new I(`terrain`,t,`object expected, ${o} found`)]),a;for(let o in t)a=a.concat(r[o]?e.validateSpec({key:o,value:t[o],valueSpec:r[o],validateSpec:e.validateSpec,style:i,styleSpec:n}):[new I(o,t[o],`unknown property "${o}"`)]);return a}function Yi(e){let t=[],n=e.value,r=e.key;if(Array.isArray(n)){let i=[],a=[];for(let o in n)n[o].id&&i.includes(n[o].id)&&t.push(new I(r,n,`all the sprites' ids must be unique, but ${n[o].id} is duplicated`)),i.push(n[o].id),n[o].url&&a.includes(n[o].url)&&t.push(new I(r,n,`all the sprites' URLs must be unique, but ${n[o].url} is duplicated`)),a.push(n[o].url),t=t.concat(Ai({key:`${r}[${o}]`,value:n[o],valueSpec:{id:{type:`string`,required:!0},url:{type:`string`,required:!0}},validateSpec:e.validateSpec}));return t}return Ui({key:r,value:n})}function Xi(e){return!!e&&e.constructor===Object}function Zi(e){return Xi(e.value)?[]:[new I(e.key,e.value,`object expected, ${J(e.value)} found`)]}let Qi={"*":()=>[],array:ji,boolean:function(e){let t=e.value,n=e.key,r=J(t);return r===`boolean`?[]:[new I(n,t,`boolean expected, ${r} found`)]},number:Mi,color:Fi,constants:Di,enum:Ii,filter:Li,function:Ni,layer:Hi,object:Ai,source:Gi,light:Ki,sky:qi,terrain:Ji,projection:function(e){let t=e.value,n=e.styleSpec,r=n.projection,i=e.style,a=J(t);if(t===void 0)return[];if(a!==`object`)return[new I(`projection`,t,`object expected, ${a} found`)];let o=[];for(let a in t)o=o.concat(r[a]?e.validateSpec({key:a,value:t[a],valueSpec:r[a],style:i,styleSpec:n}):[new I(a,t[a],`unknown property "${a}"`)]);return o},projectionDefinition:function(e){let t=e.key,n=e.value;n=n instanceof String?n.valueOf():n;let r=J(n);return r!==`array`||function(e){return Array.isArray(e)&&e.length===3&&typeof e[0]==`string`&&typeof e[1]==`string`&&typeof e[2]==`number`}(n)||function(e){return!![`interpolate`,`step`,`literal`].includes(e[0])}(n)?[`array`,`string`].includes(r)?[]:[new I(t,n,`projection expected, invalid type "${r}" found`)]:[new I(t,n,`projection expected, invalid array ${JSON.stringify(n)} found`)]},string:Ui,formatted:function(e){return Ui(e).length===0?[]:Pi(e)},resolvedImage:function(e){return Ui(e).length===0?[]:Pi(e)},padding:function(e){let t=e.key,n=e.value;if(J(n)===`array`){if(n.length<1||n.length>4)return[new I(t,n,`padding requires 1 to 4 values; ${n.length} values found`)];let r={type:`number`},i=[];for(let a=0;a<n.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:n[a],validateSpec:e.validateSpec,valueSpec:r}));return i}return Mi({key:t,value:n,valueSpec:{}})},numberArray:function(e){let t=e.key,n=e.value;if(J(n)===`array`){let r={type:`number`};if(n.length<1)return[new I(t,n,`array length at least 1 expected, length 0 found`)];let i=[];for(let a=0;a<n.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:n[a],validateSpec:e.validateSpec,valueSpec:r}));return i}return Mi({key:t,value:n,valueSpec:{}})},colorArray:function(e){let t=e.key,n=e.value;if(J(n)===`array`){if(n.length<1)return[new I(t,n,`array length at least 1 expected, length 0 found`)];let e=[];for(let r=0;r<n.length;r++)e=e.concat(Fi({key:`${t}[${r}]`,value:n[r]}));return e}return Fi({key:t,value:n})},variableAnchorOffsetCollection:function(e){let t=e.key,n=e.value,r=J(n),i=e.styleSpec;if(r!==`array`||n.length<1||n.length%2!=0)return[new I(t,n,`variableAnchorOffsetCollection requires a non-empty array of even length`)];let a=[];for(let r=0;r<n.length;r+=2)a=a.concat(Ii({key:`${t}[${r}]`,value:n[r],valueSpec:i.layout_symbol[`text-anchor`]})),a=a.concat(ji({key:`${t}[${r+1}]`,value:n[r+1],valueSpec:{length:2,value:`number`},validateSpec:e.validateSpec,style:e.style,styleSpec:i}));return a},sprite:Yi,state:Zi,fontFaces:function(e){let t=e.key,n=e.value,r=e.validateSpec,i=e.styleSpec,a=e.style;if(!Xi(n))return[new I(t,n,`object expected, ${J(n)} found`)];let o=[];for(let e in n){let s=n[e],c=J(s);if(c===`string`)o.push(...Ui({key:`${t}.${e}`,value:s}));else if(c===`array`){let n={url:{type:`string`,required:!0},"unicode-range":{type:`array`,value:`string`}};for(let[c,l]of s.entries())o.push(...Ai({key:`${t}.${e}[${c}]`,value:l,valueSpec:n,styleSpec:i,style:a,validateSpec:r}))}else o.push(new I(`${t}.${e}`,s,`string or array expected, ${c} found`))}return o}};function $i(e){let t=e.value,n=e.valueSpec,r=e.styleSpec;return e.validateSpec=$i,n.expression&&Zr(Oi(t))?Ni(e):n.expression&&oi(ki(t))?Pi(e):n.type&&Qi[n.type]?Qi[n.type](e):Ai(Xe({},e,{valueSpec:n.type?r[n.type]:n}))}function ea(e){let t=e.value,n=e.key,r=Ui(e);return r.length||(t.indexOf(`{fontstack}`)===-1&&r.push(new I(n,t,`"glyphs" url must include a "{fontstack}" token`)),t.indexOf(`{range}`)===-1&&r.push(new I(n,t,`"glyphs" url must include a "{range}" token`))),r}function ta(e,t=P){let n=[];return n=n.concat($i({key:``,value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:$i,objectElementValidators:{glyphs:ea,"*":()=>[]}})),e.constants&&(n=n.concat(Di({key:`constants`,value:e.constants}))),ra(n)}function na(e){return function(t){return e(Object.assign({},t,{validateSpec:$i}))}}function ra(e){return[].concat(e).sort(((e,t)=>e.line-t.line))}function ia(e){return function(...t){return ra(e.apply(this,t))}}ta.source=ia(na(Gi)),ta.sprite=ia(na(Yi)),ta.glyphs=ia(na(ea)),ta.light=ia(na(Ki)),ta.sky=ia(na(qi)),ta.terrain=ia(na(Ji)),ta.state=ia(na(Zi)),ta.layer=ia(na(Hi)),ta.filter=ia(na(Li)),ta.paintProperty=ia(na(Bi)),ta.layoutProperty=ia(na(Vi));let aa={type:`enum`,"property-type":`data-constant`,expression:{interpolated:!1,parameters:[`global-state`]},values:{visible:{},none:{}},transition:!1,default:`visible`};class oa{constructor(e,t){this._globalState=t,this.setValue(e)}evaluate(){return this._literalValue??this._compiledValue.evaluate({})}setValue(e){if(e==null||e===`visible`||e===`none`)return this._literalValue=e===`none`?`none`:`visible`,this._compiledValue=void 0,void(this._globalStateRefs=new Set);let t=si(e,aa,this._globalState);if(t.result===`error`)throw this._literalValue=`visible`,this._compiledValue=void 0,Error(t.value.map((e=>`${e.key}: ${e.message}`)).join(`, `));this._literalValue=void 0,this._compiledValue=t.value,this._globalStateRefs=pi(t.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}}let sa=P,ca=ta,la=ca.light,ua=ca.sky,da=ca.paintProperty,fa=ca.layoutProperty;function pa(e,t){let n=!1;if(t?.length)for(let r of t)e.fire(new Re(Error(r.message))),n=!0;return n}class ma{constructor(e,t,n){let r=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let i=new Int32Array(this.arrayBuffer);e=i[0],this.d=(t=i[1])+2*(n=i[2]);for(let e=0;e<this.d*this.d;e++){let t=i[3+e],n=i[3+e+1];r.push(t===n?null:i.subarray(t,n))}let a=i[3+r.length+1];this.keys=i.subarray(i[3+r.length],a),this.bboxes=i.subarray(a),this.insert=this._insertReadonly}else{this.d=t+2*n;for(let e=0;e<this.d*this.d;e++)r.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=n,this.scale=t/e,this.uid=0;let i=n/t*e;this.min=-i,this.max=e+i}insert(e,t,n,r,i){this._forEachCell(t,n,r,i,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)}_insertReadonly(){throw Error(`Cannot insert into a GridIndex created from an ArrayBuffer.`)}_insertCell(e,t,n,r,i,a){this.cells[i].push(a)}query(e,t,n,r,i){let a=this.min,o=this.max;if(e<=a&&t<=a&&o<=n&&o<=r&&!i)return[...this.keys];{let a=[];return this._forEachCell(e,t,n,r,this._queryCell,a,{},i),a}}_queryCell(e,t,n,r,i,a,o,s){let c=this.cells[i];if(c!==null){let i=this.keys,l=this.bboxes;for(let u of c)if(o[u]===void 0){let c=4*u;(s?s(l[c+0],l[c+1],l[c+2],l[c+3]):e<=l[c+2]&&t<=l[c+3]&&n>=l[c+0]&&r>=l[c+1])?(o[u]=!0,a.push(i[u])):o[u]=!1}}}_forEachCell(e,t,n,r,i,a,o,s){let c=this._convertToCellCoord(e),l=this._convertToCellCoord(t),u=this._convertToCellCoord(n),d=this._convertToCellCoord(r);for(let f=c;f<=u;f++)for(let c=l;c<=d;c++){let l=this.d*c+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(c),this._convertFromCellCoord(f+1),this._convertFromCellCoord(c+1)))&&i.call(this,e,t,n,r,l,a,o,s))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,t=3+this.cells.length+1+1,n=0;for(let e of this.cells)n+=e.length;let r=new Int32Array(t+n+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;let i=t;for(let t=0;t<e.length;t++){let n=e[t];r[3+t]=i,r.set(n,i),i+=n.length}return r[3+e.length]=i,r.set(this.keys,i),i+=this.keys.length,r[3+e.length+1]=i,r.set(this.bboxes,i),i+=this.bboxes.length,r.buffer}static serialize(e,t){let n=e.toArrayBuffer();return t&&t.push(n),{buffer:n}}static deserialize(e){return new ma(e.buffer)}}let ha={};function Y(e,t,n={}){if(ha[e])throw Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),ha[e]={klass:t,omit:n.omit||[],shallow:n.shallow||[]}}Y(`Object`,Object),Y(`Set`,Set),Y(`TransferableGridIndex`,ma),Y(`Color`,V),Y(`Error`,Error),Y(`AJAXError`,je),Y(`ResolvedImage`,Yt),Y(`StylePropertyFunction`,di),Y(`StyleExpression`,ai,{omit:[`_evaluator`]}),Y(`ZoomDependentExpression`,li),Y(`ZoomConstantExpression`,ci),Y(`CompoundExpression`,Lr,{omit:[`_evaluate`]});for(let e in Ir)Ir[e]._classRegistryKey||Y(`Expression_${e}`,Ir[e]);function ga(e){return e&&typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||e.constructor?.name===`ArrayBuffer`)}function _a(e){return e.$name||e.constructor._classRegistryKey}function va(e){return!function(e){if(typeof e!=`object`||!e)return!1;let t=_a(e);return t&&t!==`Object`}(e)&&(e==null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||ga(e)||me(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function ya(e,t){if(va(e))return(ga(e)||me(e))&&t&&t.push(e),ArrayBuffer.isView(e)&&t&&t.push(e.buffer),e instanceof ImageData&&t&&t.push(e.data.buffer),e;if(Array.isArray(e)){let n=[];for(let r of e)n.push(ya(r,t));return n}if(typeof e!=`object`)throw Error(`can't serialize object of type `+typeof e);let n=_a(e);if(!n)throw Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!ha[n])throw Error(`${n} is not registered.`);let{klass:r}=ha[n],i=r.serialize?r.serialize(e,t):{};if(r.serialize){if(i===t?.[t.length-1])throw Error(`statically serialized object won't survive transfer of $name property`)}else{for(let r in e){if(!e.hasOwnProperty(r)||ha[n].omit.includes(r))continue;let a=e[r];i[r]=ha[n].shallow.includes(r)?a:ya(a,t)}e instanceof Error&&(i.message=e.message)}if(i.$name)throw Error(`$name property is reserved for worker serialization logic.`);return n!==`Object`&&(i.$name=n),i}function ba(e){if(va(e))return e;if(Array.isArray(e))return e.map(ba);if(typeof e!=`object`)throw Error(`can't deserialize object of type `+typeof e);let t=_a(e)||`Object`;if(!ha[t])throw Error(`can't deserialize unregistered class ${t}`);let{klass:n}=ha[t];if(!n)throw Error(`can't deserialize unregistered class ${t}`);if(n.deserialize)return n.deserialize(e);let r=Object.create(n.prototype);for(let n of Object.keys(e)){if(n===`$name`)continue;let i=e[n];r[n]=ha[t].shallow.includes(n)?i:ba(i)}return r}class xa{constructor(){this.first=!0}update(e,t){let n=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=n,!0))}}function Sa(e){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(e))}function Ca(e){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(e))}function wa(e){return/\s/u.test(String.fromCodePoint(e))}function Ta(e){for(let t of e)if(Ca(t.codePointAt(0)))return!0;return!1}function Ea(e){for(let t of e)if(!ka(t.codePointAt(0)))return!1;return!0}function Da(e){let t=e.map((e=>{try{return RegExp(`\\p{sc=${e}}`,`u`).source}catch{return null}})).filter((e=>e));return new RegExp(t.join(`|`),`u`)}let Oa=Da([`Arab`,`Dupl`,`Mong`,`Ougr`,`Syrc`]);function ka(e){return!Oa.test(String.fromCodePoint(e))}function Aa(e){return!(Ca(e)||(t=e,/[\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(t))));var t}let ja=Da(`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`.split(`.`));function Ma(e){return ja.test(String.fromCodePoint(e))}function Na(e,t){return!(!t&&Ma(e)||/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(e)))}function Pa(e){for(let t of e)if(Ma(t.codePointAt(0)))return!0;return!1}let Fa=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus=`unavailable`,this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(Fa.isParsed())throw Error(`RTL text plugin already registered.`);this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}syncState(e,n){return t(this,void 0,void 0,(function*(){if(this.isParsed())return this.getState();if(e.pluginStatus!==`loading`)return this.setState(e),e;let t=e.pluginURL,r=new Promise((e=>{this.loadScriptResolve=e}));n(t);let i=new Promise((e=>setTimeout((()=>e()),this.TIMEOUT)));if(yield Promise.race([r,i]),this.isParsed()){let e={pluginStatus:`loaded`,pluginURL:t};return this.setState(e),e}throw this.setState({pluginStatus:`error`,pluginURL:``}),Error(`RTL Text Plugin failed to import scripts from ${t}`)}))}};class Ia{constructor(e,t){this.isSupportedScript=La,this.zoom=e,t?(this.now=t.now||0,this.fadeDuration=t.fadeDuration||0,this.zoomHistory=t.zoomHistory||new xa,this.transition=t.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new xa,this.transition={})}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,t=e-Math.floor(e),n=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*t}}}function La(e){return function(e,t){for(let n of e)if(!Na(n.codePointAt(0),t))return!1;return!0}(e,Fa.getRTLTextPluginStatus()===`loaded`)}let Ra=`-transition`;class za{constructor(e,t,n){this.property=e,this.value=t,this.expression=function(e,t,n){if(Zr(e))return new di(e,t);if(oi(e)){let r=ui(e,t,n);if(r.result===`error`)throw Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(`, `));return r.value}{let n=e;return t.type===`color`&&typeof e==`string`?n=V.parse(e):t.type!==`padding`||typeof e!=`number`&&!Array.isArray(e)?t.type!==`numberArray`||typeof e!=`number`&&!Array.isArray(e)?t.type!==`colorArray`||typeof e!=`string`&&!Array.isArray(e)?t.type===`variableAnchorOffsetCollection`&&Array.isArray(e)?n=Jt.parse(e):t.type===`projectionDefinition`&&typeof e==`string`&&(n=Xt.parse(e)):n=Gt.parse(e):n=Wt.parse(e):n=Ut.parse(e),{globalStateRefs:new Set,_globalState:null,kind:`constant`,evaluate:()=>n}}}(t===void 0?e.specification.default:t,e.specification,n)}isDataDriven(){return this.expression.kind===`source`||this.expression.kind===`composite`}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,t,n){return this.property.possiblyEvaluate(this,e,t,n)}}class Ba{constructor(e,t){this.property=e,this.value=new za(e,void 0,t)}transitioned(e,t){return new Ha(this.property,this.value,t,ie({},e.transition,this.transition),e.now)}untransitioned(){return new Ha(this.property,this.value,null,{},0)}}class Va{constructor(e,t){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=t}hasProperty(e){return e in this._properties.defaultTransitionablePropertyValues}getValue(e){return ce(this._values[e].value.value)}setValue(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new Ba(this._values[e].property,this._globalState)),this._values[e].value=new za(this._values[e].property,t===null?void 0:ce(t),this._globalState)}getTransition(e){return ce(this._values[e].transition)}setTransition(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new Ba(this._values[e].property,this._globalState)),this._values[e].transition=ce(t)||void 0}serialize(){let e={};for(let t of Object.keys(this._values)){let n=this.getValue(t);n!==void 0&&(e[t]=n);let r=this.getTransition(t);r!==void 0&&(e[`${t}${Ra}`]=r)}return e}transitioned(e,t){let n=new Ua(this._properties);for(let r of Object.keys(this._values))n._values[r]=this._values[r].transitioned(e,t._values[r]);return n}untransitioned(){let e=new Ua(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class Ha{constructor(e,t,n,r,i){this.property=e,this.value=t,this.begin=i+r.delay||0,this.end=this.begin+r.duration||0,e.specification.transition&&(r.delay||r.duration)&&(this.prior=n)}possiblyEvaluate(e,t,n){let r=e.now||0,i=this.value.possiblyEvaluate(e,t,n),a=this.prior;if(a){if(r>this.end||this.value.isDataDriven())return this.prior=null,i;if(r<this.begin)return a.possiblyEvaluate(e,t,n);{let o=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,n),i,M(o))}}return i}}class Ua{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,n){let r=new Ka(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].possiblyEvaluate(e,t,n);return r}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Wa{constructor(e,t){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=t}hasValue(e){return this._values[e].value!==void 0}hasProperty(e){return e in this._properties.defaultPropertyValues}getValue(e){return ce(this._values[e].value)}setValue(e,t){this._values[e]=new za(this._values[e].property,t===null?void 0:ce(t),this._globalState)}serialize(){let e={};for(let t of Object.keys(this._values)){let n=this.getValue(t);n!==void 0&&(e[t]=n)}return e}possiblyEvaluate(e,t,n){let r=new Ka(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].possiblyEvaluate(e,t,n);return r}}class Ga{constructor(e,t,n){this.property=e,this.value=t,this.parameters=n}isConstant(){return this.value.kind===`constant`}constantOr(e){return this.value.kind===`constant`?this.value.value:e}evaluate(e,t,n,r){return this.property.evaluate(this.value,this.parameters,e,t,n,r)}}class Ka{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class X{constructor(e){this.specification=e}possiblyEvaluate(e,t){if(e.isDataDriven())throw Error(`Value should not be data driven`);return e.expression.evaluate(t)}interpolate(e,t,n){let r=Sn[this.specification.type];return r?r(e,t,n):e}}class Z{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,n,r){return new Ga(this,e.expression.kind===`constant`||e.expression.kind===`camera`?{kind:`constant`,value:e.expression.evaluate(t,null,{},n,r)}:e.expression,t)}interpolate(e,t,n){if(e.value.kind!==`constant`||t.value.kind!==`constant`)return e;if(e.value.value===void 0||t.value.value===void 0)return new Ga(this,{kind:`constant`,value:void 0},e.parameters);let r=Sn[this.specification.type];if(r){let i=r(e.value.value,t.value.value,n);return new Ga(this,{kind:`constant`,value:i},e.parameters)}return e}evaluate(e,t,n,r,i,a){return e.kind===`constant`?e.value:e.evaluate(t,n,r,i,a)}}class qa extends Z{possiblyEvaluate(e,t,n,r){if(e.value===void 0)return new Ga(this,{kind:`constant`,value:void 0},t);if(e.expression.kind===`constant`){let i=e.expression.evaluate(t,null,{},n,r),a=e.property.specification.type===`resolvedImage`&&typeof i!=`string`?i.name:i,o=this._calculate(a,a,a,t);return new Ga(this,{kind:`constant`,value:o},t)}if(e.expression.kind===`camera`){let n=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new Ga(this,{kind:`constant`,value:n},t)}return new Ga(this,e.expression,t)}evaluate(e,t,n,r,i,a){if(e.kind===`source`){let o=e.evaluate(t,n,r,i,a);return this._calculate(o,o,o,t)}return e.kind===`composite`?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},n,r),e.evaluate({zoom:Math.floor(t.zoom)},n,r),e.evaluate({zoom:Math.floor(t.zoom)+1},n,r),t):e.value}_calculate(e,t,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}}interpolate(e){return e}}class Ja{constructor(e){this.specification=e}possiblyEvaluate(e,t,n,r){if(e.value!==void 0){if(e.expression.kind===`constant`){let i=e.expression.evaluate(t,null,{},n,r);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new Ia(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Ia(Math.floor(t.zoom),t)),e.expression.evaluate(new Ia(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}}interpolate(e){return e}}class Ya{constructor(e){this.specification=e}possiblyEvaluate(e,t,n,r){return!!e.expression.evaluate(t,null,{},n,r)}interpolate(){return!1}}class Xa{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let t in e){let n=e[t];n.specification.overridable&&this.overridableProperties.push(t);let r=this.defaultPropertyValues[t]=new za(n,void 0,void 0),i=this.defaultTransitionablePropertyValues[t]=new Ba(n,void 0);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=r.possiblyEvaluate({})}}}Y(`DataDrivenProperty`,Z),Y(`DataConstantProperty`,X),Y(`CrossFadedDataDrivenProperty`,qa),Y(`CrossFadedProperty`,Ja),Y(`ColorRampProperty`,Ya);let Za=` is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?`,Qa=` is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?`;class $a extends ze{constructor(e,t,n){if(super(),this.id=e.id,this.type=e.type,this._globalState=n,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=function(e,t){return new oa(e,t)}(this.visibility,n),e.type!==`custom`&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!==`background`&&(this.source=e.source,this.sourceLayer=e[`source-layer`],this.filter=e.filter,this._featureFilter=_i(e.filter,n)),t.layout&&(this._unevaluatedLayout=new Wa(t.layout,n)),t.paint)){this._transitionablePaint=new Va(t.paint,n);for(let t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(let t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ka(t.paint)}}setFilter(e){this.filter=e,this._featureFilter=_i(e,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){if(e===`visibility`)return this.visibility;if(this._transitionablePaint?.hasProperty(e))throw Error(e+Za);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${e}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;for(let t of this._visibilityExpression.getGlobalStateRefs())e.add(t);if(this._unevaluatedLayout)for(let t in this._unevaluatedLayout._values){let n=this._unevaluatedLayout._values[t];for(let t of n.getGlobalStateRefs())e.add(t)}for(let t of this._featureFilter.getGlobalStateRefs())e.add(t);return e}getPaintAffectingGlobalStateRefs(){let e=new globalThis.Map;if(this._transitionablePaint)for(let t in this._transitionablePaint._values){let n=this._transitionablePaint._values[t].value;for(let r of n.getGlobalStateRefs()){let i=e.get(r)??[];i.push({name:t,value:n.value}),e.set(r,i)}}return e}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,t,n={}){if(e===`visibility`)return this.visibility=t,this._visibilityExpression.setValue(t),void this.recalculateVisibility();this._transitionablePaint?.hasProperty(e)?this.fire(new Re(Error(e+Za))):t!=null&&this._validate(fa,`layers.${this.id}.layout.${e}`,e,t,n)||this._unevaluatedLayout.setValue(e,t)}getPaintProperty(e){if(e.endsWith(Ra)){let t=e.slice(0,-11);if(t===`visibility`||this._unevaluatedLayout?.hasProperty(t))throw Error(e+Qa);return this._transitionablePaint.getTransition(t)}if(e===`visibility`||this._unevaluatedLayout?.hasProperty(e))throw Error(e+Qa);return this._transitionablePaint.getValue(e)}setPaintProperty(e,t,n={}){if(e===`visibility`||this._unevaluatedLayout?.hasProperty(e))return this.fire(new Re(Error(e+Qa))),!1;if(t!=null&&this._validate(da,`layers.${this.id}.paint.${e}`,e,t,n))return!1;if(e.endsWith(Ra))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{let n=this._transitionablePaint._values[e],r=n.property.specification[`property-type`]===`cross-faded-data-driven`,i=n.value.isDataDriven(),a=n.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);let o=this._transitionablePaint._values[e].value;return o.isDataDriven()||i||r||this._handleOverridablePaintPropertyUpdate(e,a,o)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,n){return!1}isHidden(e=this.minzoom,t=!1){return!!(this.minzoom&&e<(t?Math.floor(this.minzoom):this.minzoom))||!!(this.maxzoom&&e>=this.maxzoom)||this._evaluatedVisibility===`none`}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){let e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout?.serialize(),paint:this._transitionablePaint?.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),se(e,((e,t)=>!(e===void 0||t===`layout`&&!Object.keys(e).length||t===`paint`&&!Object.keys(e).length)))}_validate(e,t,n,r,i={}){return!1!==i?.validate&&pa(this,e.call(ca,{key:t,layerType:this.type,objectKey:n,value:r,styleSpec:P,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let t=this.paint.get(e);if(t instanceof Ga&&Jr(t.property.specification)&&(t.value.kind===`source`||t.value.kind===`composite`)&&t.value.isStateDependent)return!0}return!1}}let eo;var to={get paint(){return eo||=new Xa({"raster-opacity":new X(P.paint_raster[`raster-opacity`]),"raster-hue-rotate":new X(P.paint_raster[`raster-hue-rotate`]),"raster-brightness-min":new X(P.paint_raster[`raster-brightness-min`]),"raster-brightness-max":new X(P.paint_raster[`raster-brightness-max`]),"raster-saturation":new X(P.paint_raster[`raster-saturation`]),"raster-contrast":new X(P.paint_raster[`raster-contrast`]),resampling:new X(P.paint_raster.resampling),"raster-resampling":new X(P.paint_raster[`raster-resampling`]),"raster-fade-duration":new X(P.paint_raster[`raster-fade-duration`])})}};class no extends $a{constructor(e,t){super(e,to,t)}}let ro={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class io{constructor(e,t){this._structArray=e,this._pos1=t*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(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw Error(`_refreshViews() must be implemented by each concrete StructArray layout`)}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}}function oo(e,t=1){let n=0,r=0;return{members:e.map((e=>{let i=ro[e.type].BYTES_PER_ELEMENT,a=n=so(n,Math.max(t,i)),o=e.components||1;return r=Math.max(r,i),n+=i*o,{name:e.name,type:e.type,components:o,offset:a}})),size:so(n,Math.max(r,t)),alignment:t}}function so(e,t){return Math.ceil(e/t)*t}class co extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){let n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){let r=2*e;return this.int16[r+0]=t,this.int16[r+1]=n,e}}co.prototype.bytesPerElement=4,Y(`StructArrayLayout2i4`,co);class lo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=3*e;return this.int16[i+0]=t,this.int16[i+1]=n,this.int16[i+2]=r,e}}lo.prototype.bytesPerElement=6,Y(`StructArrayLayout3i6`,lo);class uo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){let a=4*e;return this.int16[a+0]=t,this.int16[a+1]=n,this.int16[a+2]=r,this.int16[a+3]=i,e}}uo.prototype.bytesPerElement=8,Y(`StructArrayLayout4i8`,uo);class fo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)}emplace(e,t,n,r,i,a,o){let s=6*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e}}fo.prototype.bytesPerElement=12,Y(`StructArrayLayout2i4i12`,fo);class po extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)}emplace(e,t,n,r,i,a,o){let s=4*e,c=8*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.uint8[c+4]=r,this.uint8[c+5]=i,this.uint8[c+6]=a,this.uint8[c+7]=o,e}}po.prototype.bytesPerElement=8,Y(`StructArrayLayout2i4ub8`,po);class mo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){let n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){let r=2*e;return this.float32[r+0]=t,this.float32[r+1]=n,e}}mo.prototype.bytesPerElement=8,Y(`StructArrayLayout2f8`,mo);class ho extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a,o,s,c,l){let u=this.length;return this.resize(u+1),this.emplace(u,e,t,n,r,i,a,o,s,c,l)}emplace(e,t,n,r,i,a,o,s,c,l,u){let d=10*e;return this.uint16[d+0]=t,this.uint16[d+1]=n,this.uint16[d+2]=r,this.uint16[d+3]=i,this.uint16[d+4]=a,this.uint16[d+5]=o,this.uint16[d+6]=s,this.uint16[d+7]=c,this.uint16[d+8]=l,this.uint16[d+9]=u,e}}ho.prototype.bytesPerElement=20,Y(`StructArrayLayout10ui20`,ho);class go extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a,o,s){let c=this.length;return this.resize(c+1),this.emplace(c,e,t,n,r,i,a,o,s)}emplace(e,t,n,r,i,a,o,s,c){let l=8*e;return this.uint16[l+0]=t,this.uint16[l+1]=n,this.uint16[l+2]=r,this.uint16[l+3]=i,this.uint16[l+4]=a,this.uint16[l+5]=o,this.uint16[l+6]=s,this.uint16[l+7]=c,e}}go.prototype.bytesPerElement=16,Y(`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(e,t,n,r,i,a,o,s,c,l,u,d){let f=this.length;return this.resize(f+1),this.emplace(f,e,t,n,r,i,a,o,s,c,l,u,d)}emplace(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=12*e;return this.int16[p+0]=t,this.int16[p+1]=n,this.int16[p+2]=r,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=c,this.int16[p+8]=l,this.int16[p+9]=u,this.int16[p+10]=d,this.int16[p+11]=f,e}}_o.prototype.bytesPerElement=24,Y(`StructArrayLayout4i4ui4i24`,_o);class vo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=3*e;return this.float32[i+0]=t,this.float32[i+1]=n,this.float32[i+2]=r,e}}vo.prototype.bytesPerElement=12,Y(`StructArrayLayout3f12`,vo);class yo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}yo.prototype.bytesPerElement=4,Y(`StructArrayLayout1ul4`,yo);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(e,t,n,r,i,a,o,s,c){let l=this.length;return this.resize(l+1),this.emplace(l,e,t,n,r,i,a,o,s,c)}emplace(e,t,n,r,i,a,o,s,c,l){let u=10*e,d=5*e;return this.int16[u+0]=t,this.int16[u+1]=n,this.int16[u+2]=r,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[d+3]=s,this.uint16[u+8]=c,this.uint16[u+9]=l,e}}bo.prototype.bytesPerElement=20,Y(`StructArrayLayout6i1ul2ui20`,bo);class xo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)}emplace(e,t,n,r,i,a,o){let s=6*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e}}xo.prototype.bytesPerElement=12,Y(`StructArrayLayout2i2i2i12`,xo);class So extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,r,i)}emplace(e,t,n,r,i,a){let o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=n,this.float32[o+2]=r,this.int16[s+6]=i,this.int16[s+7]=a,e}}So.prototype.bytesPerElement=16,Y(`StructArrayLayout2f1f2i16`,So);class Co extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,r,i,a){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,r,i,a)}emplace(e,t,n,r,i,a,o){let s=16*e,c=4*e,l=8*e;return this.uint8[s+0]=t,this.uint8[s+1]=n,this.float32[c+1]=r,this.float32[c+2]=i,this.int16[l+6]=a,this.int16[l+7]=o,e}}Co.prototype.bytesPerElement=16,Y(`StructArrayLayout2ub2f2i16`,Co);class wo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=n,this.uint16[i+2]=r,e}}wo.prototype.bytesPerElement=6,Y(`StructArrayLayout3ui6`,wo);class To 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(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g){let _=this.length;return this.resize(_+1),this.emplace(_,e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g)}emplace(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=24*e,y=12*e,b=48*e;return this.int16[v+0]=t,this.int16[v+1]=n,this.uint16[v+2]=r,this.uint16[v+3]=i,this.uint32[y+2]=a,this.uint32[y+3]=o,this.uint32[y+4]=s,this.uint16[v+10]=c,this.uint16[v+11]=l,this.uint16[v+12]=u,this.float32[y+7]=d,this.float32[y+8]=f,this.uint8[b+36]=p,this.uint8[b+37]=m,this.uint8[b+38]=h,this.uint32[y+10]=g,this.int16[v+22]=_,e}}To.prototype.bytesPerElement=48,Y(`StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48`,To);class Eo 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(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D){let O=this.length;return this.resize(O+1),this.emplace(O,e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D)}emplace(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O){let k=32*e,A=16*e;return this.int16[k+0]=t,this.int16[k+1]=n,this.int16[k+2]=r,this.int16[k+3]=i,this.int16[k+4]=a,this.int16[k+5]=o,this.int16[k+6]=s,this.int16[k+7]=c,this.uint16[k+8]=l,this.uint16[k+9]=u,this.uint16[k+10]=d,this.uint16[k+11]=f,this.uint16[k+12]=p,this.uint16[k+13]=m,this.uint16[k+14]=h,this.uint16[k+15]=g,this.uint16[k+16]=_,this.uint16[k+17]=v,this.uint16[k+18]=y,this.uint16[k+19]=b,this.uint16[k+20]=x,this.uint16[k+21]=S,this.uint16[k+22]=C,this.uint32[A+12]=w,this.float32[A+13]=T,this.float32[A+14]=E,this.uint16[k+30]=D,this.uint16[k+31]=O,e}}Eo.prototype.bytesPerElement=64,Y(`StructArrayLayout8i15ui1ul2f2ui64`,Eo);class Do extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}Do.prototype.bytesPerElement=4,Y(`StructArrayLayout1f4`,Do);class Oo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=3*e;return this.uint16[6*e+0]=t,this.float32[i+1]=n,this.float32[i+2]=r,e}}Oo.prototype.bytesPerElement=12,Y(`StructArrayLayout1ui2f12`,Oo);class ko extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n){let r=this.length;return this.resize(r+1),this.emplace(r,e,t,n)}emplace(e,t,n,r){let i=4*e;return this.uint32[2*e+0]=t,this.uint16[i+2]=n,this.uint16[i+3]=r,e}}ko.prototype.bytesPerElement=8,Y(`StructArrayLayout1ul2ui8`,ko);class Ao extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){let n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){let r=2*e;return this.uint16[r+0]=t,this.uint16[r+1]=n,e}}Ao.prototype.bytesPerElement=4,Y(`StructArrayLayout2ui4`,Ao);class jo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}jo.prototype.bytesPerElement=2,Y(`StructArrayLayout1ui2`,jo);class Mo extends ao{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,n,r)}emplace(e,t,n,r,i){let a=4*e;return this.float32[a+0]=t,this.float32[a+1]=n,this.float32[a+2]=r,this.float32[a+3]=i,e}}Mo.prototype.bytesPerElement=16,Y(`StructArrayLayout4f16`,Mo);class No extends io{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 n(this.anchorPointX,this.anchorPointY)}}No.prototype.size=20;class Po extends bo{get(e){return new No(this,e)}}Y(`CollisionBoxArray`,Po);class Fo extends io{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Fo.prototype.size=48;class Io extends To{get(e){return new Fo(this,e)}}Y(`PlacedSymbolArray`,Io);class Lo extends io{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Lo.prototype.size=64;class Ro extends Eo{get(e){return new Lo(this,e)}}Y(`SymbolInstanceArray`,Ro);class zo extends Do{getoffsetX(e){return this.float32[1*e+0]}}Y(`GlyphOffsetArray`,zo);class Bo extends lo{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Y(`SymbolLineVertexArray`,Bo);class Vo extends io{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]}}Vo.prototype.size=12;class Ho extends Oo{get(e){return new Vo(this,e)}}Y(`TextAnchorOffsetArray`,Ho);class Uo extends io{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]}}Uo.prototype.size=8;class Wo extends ko{get(e){return new Uo(this,e)}}Y(`FeatureIndexArray`,Wo);class Go extends co{}class Ko extends co{}class qo extends co{}class Jo extends fo{}class Yo extends po{}class Xo extends mo{}class Zo extends ho{}class Qo extends go{}class $o extends _o{}class es extends vo{}class ts extends yo{}class ns extends xo{}class rs extends Co{}class is extends wo{}class as extends Ao{}let{members:os}=oo([{name:`a_pos`,components:2,type:`Int16`}],4);class ss{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,t,n,r){let i=this.segments[this.segments.length-1];return e>ss.MAX_VERTEX_ARRAY_LENGTH&&ue(`Max vertices per segment is ${ss.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${ss.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!i||i.vertexLength+e>ss.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==r?this.createNewSegment(t,n,r):i}createNewSegment(e,t,n){let r={vertexOffset:e.length,primitiveOffset:t.length,vertexLength:0,primitiveLength:0,vaos:{}};return n!==void 0&&(r.sortKey=n),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(r),r}getOrCreateLatestSegment(e,t,n){return this.prepareSegment(0,e,t,n)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,n,r){return new ss([{vertexOffset:e,primitiveOffset:t,vertexLength:n,primitiveLength:r,vaos:{},sortKey:0}])}}function cs(e,t){return 256*(e=N(Math.floor(e),0,255))+N(Math.floor(t),0,255)}ss.MAX_VERTEX_ARRAY_LENGTH=2**16-1,Y(`SegmentVector`,ss);let ls=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,fs,ps,ms={exports:{}},hs={exports:{}},gs={exports:{}},_s=r(function(){if(ps)return ms.exports;ps=1;var e=(ds||(ds=1,hs.exports=function(e,t){var n,r,i,a,o,s,c,l;for(r=e.length-(n=3&e.length),i=t,o=3432918353,s=461845907,l=0;l<r;)c=255&e.charCodeAt(l)|(255&e.charCodeAt(++l))<<8|(255&e.charCodeAt(++l))<<16|(255&e.charCodeAt(++l))<<24,++l,i=27492+(65535&(a=5*(65535&(i=(i^=c=(65535&(c=(c=(65535&c)*o+(((c>>>16)*o&65535)<<16)&4294967295)<<15|c>>>17))*s+(((c>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(c=0,n){case 3:c^=(255&e.charCodeAt(l+2))<<16;case 2:c^=(255&e.charCodeAt(l+1))<<8;case 1:i^=c=(65535&(c=(c=(65535&(c^=255&e.charCodeAt(l)))*o+(((c>>>16)*o&65535)<<16)&4294967295)<<15|c>>>17))*s+(((c>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}),hs.exports),t=(fs||(fs=1,gs.exports=function(e,t){for(var n,r=e.length,i=t^r,a=0;r>=4;)n=1540483477*(65535&(n=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(n>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),r-=4,++a;switch(r){case 3:i^=(255&e.charCodeAt(a+2))<<16;case 2:i^=(255&e.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}),gs.exports);return ms.exports=e,ms.exports.murmur3=e,ms.exports.murmur2=t,ms.exports}());class vs{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,n,r){this.ids.push(ys(e)),this.positions.push(t,n,r)}getPositions(e){if(!this.indexed)throw Error(`Trying to get index, but feature positions are not indexed`);let t=ys(e),n=0,r=this.ids.length-1;for(;n<r;){let e=n+r>>1;this.ids[e]>=t?r=e:n=e+1}let i=[];for(;this.ids[n]===t;)i.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return i}static serialize(e,t){let n=new Float64Array(e.ids),r=new Uint32Array(e.positions);return bs(n,r,0,n.length-1),t&&t.push(n.buffer,r.buffer),{ids:n,positions:r}}static deserialize(e){let t=new vs;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t}}function ys(e){let t=+e;return!isNaN(t)&&t<=2**53-1?t:_s(String(e))}function bs(e,t,n,r){for(;n<r;){let i=e[n+r>>1],a=n-1,o=r+1;for(;;){do a++;while(e[a]<i);do o--;while(e[o]>i);if(a>=o)break;xs(e,a,o),xs(t,3*a,3*o),xs(t,3*a+1,3*o+1),xs(t,3*a+2,3*o+2)}o-n<r-o?(bs(e,t,n,o),n=o+1):(bs(e,t,o+1,r),r=o)}}function xs(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}Y(`FeaturePositionMap`,vs);class Ss{constructor(e,t){this.gl=e.gl,this.location=t}}class Cs extends Ss{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class ws extends Ss{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class Ts extends Ss{constructor(e,t){super(e,t),this.current=V.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}let Es=new Float32Array(16);function Ds(e){return[cs(255*e.r,255*e.g),cs(255*e.b,255*e.a)]}class Os{constructor(e,t,n){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=n}setUniform(e,t,n){e.set(n.constantOr(this.value))}getBinding(e,t,n){return this.type===`color`?new Ts(e,t):new Cs(e,t)}}class ks{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,t){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,t.y,t.height,t.width]}setUniform(e,t,n,r){let i=null;r===`u_pattern_to`?i=this.patternTo:r===`u_pattern_from`?i=this.patternFrom:r===`u_dasharray_to`?i=this.dashTo:r===`u_dasharray_from`?i=this.dashFrom:r===`u_pixel_ratio_to`?i=this.pixelRatioTo:r===`u_pixel_ratio_from`&&(i=this.pixelRatioFrom),i!==null&&e.set(i)}getBinding(e,t,n){return n.startsWith(`u_pattern`)||n.startsWith(`u_dasharray_`)?new ws(e,t):new Cs(e,t)}}class As{constructor(e,t,n,r){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:`Float32`,components:n===`color`?2:1,offset:0}))),this.paintVertexArray=new r}populatePaintArray(e,t,n){let r=this.paintVertexArray.length,i=this.expression.evaluate(new Ia(0,n),t,{},n.canonical,[],n.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(r,e,i)}updatePaintArray(e,t,n,r,i){let a=this.expression.evaluate(new Ia(0,i),n,r);this._setPaintValue(e,t,a)}_setPaintValue(e,t,n){if(this.type===`color`){let r=Ds(n);for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r[0],r[1])}else{for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}}upload(e){var t;(t=this.paintVertexArray)!=null&&t.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class js{constructor(e,t,n,r,i,a){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=n,this.useIntegerZoom=r,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:`Float32`,components:n===`color`?4:2,offset:0}))),this.paintVertexArray=new a}populatePaintArray(e,t,n){let r=this.expression.evaluate(new Ia(this.zoom,n),t,{},n.canonical,[],n.formattedSection),i=this.expression.evaluate(new Ia(this.zoom+1,n),t,{},n.canonical,[],n.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(a,e,r,i)}updatePaintArray(e,t,n,r,i){let a=this.expression.evaluate(new Ia(this.zoom,i),n,r),o=this.expression.evaluate(new Ia(this.zoom+1,i),n,r);this._setPaintValue(e,t,a,o)}_setPaintValue(e,t,n,r){if(this.type===`color`){let i=Ds(n),a=Ds(r);for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,i[0],i[1],a[0],a[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,n,r);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(r))}}upload(e){var t;(t=this.paintVertexArray)!=null&&t.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){let n=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,r=N(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);e.set(r)}getBinding(e,t,n){return new Cs(e,t)}}class Ms{constructor(e,t,n,r,i,a){this.expression=e,this.type=t,this.useIntegerZoom=n,this.zoom=r,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i}populatePaintArray(e,t,n){let r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(r,e,this.getPositionIds(t),n)}updatePaintArray(e,t,n,r,i){this._setPaintValues(e,t,this.getPositionIds(n),i)}_setPaintValues(e,t,n,r){let i=this.getPositions(r);if(!i||!n)return;let a=i[n.min],o=i[n.mid],s=i[n.max];if(a&&o&&s)for(let n=e;n<t;n++)this.emplace(this.zoomInPaintVertexArray,n,o,a),this.emplace(this.zoomOutPaintVertexArray,n,o,s)}upload(e){if(this.zoomInPaintVertexArray?.arrayBuffer.byteLength&&this.zoomOutPaintVertexArray?.arrayBuffer.byteLength){let t=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,t,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,t,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Ns extends Ms{getPositions(e){return e.imagePositions}getPositionIds(e){return e.patterns?.[this.layerId]}getVertexAttributes(){return ls.members}emplace(e,t,n,r){e.emplace(t,n.tlbr[0],n.tlbr[1],n.tlbr[2],n.tlbr[3],r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],n.pixelRatio,r.pixelRatio)}}class Ps extends Ms{getPositions(e){return e.dashPositions}getPositionIds(e){return e.dashes?.[this.layerId]}getVertexAttributes(){return us.members}emplace(e,t,n,r){e.emplace(t,0,n.y,n.height,n.width,0,r.y,r.height,r.width)}}class Fs{constructor(e,t,n){this.binders={},this._buffers=[];let r=[];for(let i in e.paint._values){if(!n(i))continue;let a=e.paint.get(i);if(!(a instanceof Ga&&Jr(a.property.specification)))continue;let o=Ls(i,e.type),s=a.value,c=a.property.specification.type,l=a.property.useIntegerZoom,u=a.property.specification[`property-type`],d=u===`cross-faded`||u===`cross-faded-data-driven`;if(s.kind===`constant`)this.binders[i]=d?new ks(s.value,o):new Os(s.value,o,c),r.push(`/u_${i}`);else if(s.kind===`source`||d){let n=Rs(i,c,`source`);this.binders[i]=d?i===`line-dasharray`?new Ps(s,c,l,t,n,e.id):new Ns(s,c,l,t,n,e.id):new As(s,o,c,n),r.push(`/a_${i}`)}else{let e=Rs(i,c,`composite`);this.binders[i]=new js(s,o,c,l,t,e),r.push(`/z_${i}`)}}this.cacheKey=r.sort().join(``)}getMaxValue(e){let t=this.binders[e];return t instanceof As||t instanceof js?t.maxValue:0}populatePaintArrays(e,t,n){for(let r in this.binders){let i=this.binders[r];(i instanceof As||i instanceof js||i instanceof Ms)&&i.populatePaintArray(e,t,n)}}setConstantPatternPositions(e,t){for(let n in this.binders){let r=this.binders[n];r instanceof ks&&r.setConstantPatternPositions(e,t)}}setConstantDashPositions(e,t){for(let n in this.binders){let r=this.binders[n];r instanceof ks&&r.setConstantDashPositions(e,t)}}updatePaintArrays(e,t,n,r,i){let a=!1;for(let o in e){let s=t.getPositions(o);for(let t of s){let s=n.feature(t.index);for(let n in this.binders){let c=this.binders[n];(c instanceof As||c instanceof js||c instanceof Ms)&&!0===c.expression.isStateDependent&&(c.expression=r.paint.get(n).value,c.updatePaintArray(t.start,t.end,s,e[o],i),a=!0)}}}return a}defines(){let e=[];for(let t in this.binders){let n=this.binders[t];(n instanceof Os||n instanceof ks)&&e.push(...n.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let n=this.binders[t];if(n instanceof As||n instanceof js)for(let t of n.paintVertexAttributes)e.push(t.name);else if(n instanceof Ms){let t=n.getVertexAttributes();for(let n of t)e.push(n.name)}}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let n=this.binders[t];if(n instanceof Os||n instanceof ks||n instanceof js)for(let t of n.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let n=[];for(let r in this.binders){let i=this.binders[r];if(i instanceof Os||i instanceof ks||i instanceof js){for(let a of i.uniformNames)if(t[a]){let o=i.getBinding(e,t[a],a);n.push({name:a,property:r,binding:o})}}}return n}setUniforms(e,t,n,r){for(let{name:e,property:i,binding:a}of t)this.binders[i].setUniform(a,r,n.get(i),e)}updatePaintBuffers(e){this._buffers=[];for(let t in this.binders){let n=this.binders[t];if(e&&n instanceof Ms){let t=e.fromScale===2?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;t&&this._buffers.push(t)}else (n instanceof As||n instanceof js)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}}upload(e){for(let t in this.binders){let n=this.binders[t];(n instanceof As||n instanceof js||n instanceof Ms)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof As||t instanceof js||t instanceof Ms)&&t.destroy()}}}class Is{constructor(e,t,n=()=>!0){this.programConfigurations={};for(let r of e)this.programConfigurations[r.id]=new Fs(r,t,n);this.needsUpload=!1,this._featureMap=new vs,this._bufferOffset=0}populatePaintArrays(e,t,n,r){for(let n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(e,t,r);t.id!==void 0&&this._featureMap.add(t.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,n,r){for(let i of n)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(e,this._featureMap,t,i,r)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Ls(e,t){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`]}[e]||[e.replace(`${t}-`,``).replace(/-/g,`_`)]}function Rs(e,t,n){let r={color:{source:mo,composite:Mo},number:{source:Do,composite:mo}};return function(e){return{"line-pattern":{source:Zo,composite:Zo},"fill-pattern":{source:Zo,composite:Zo},"fill-extrusion-pattern":{source:Zo,composite:Zo},"line-dasharray":{source:Qo,composite:Qo}}[e]}(e)?.[n]||r[t][n]}Y(`ConstantBinder`,Os),Y(`CrossFadedConstantBinder`,ks),Y(`SourceExpressionBinder`,As),Y(`CrossFadedPatternBinder`,Ns),Y(`CrossFadedDasharrayBinder`,Ps),Y(`CompositeExpressionBinder`,js),Y(`ProgramConfiguration`,Fs,{omit:[`_buffers`]}),Y(`ProgramConfigurationSet`,Is);let zs=2**14-1,Bs=-zs-1;function Vs(e){let t=O/e.extent,n=e.loadGeometry();for(let e of n)for(let n of e){let e=Math.round(n.x*t),r=Math.round(n.y*t);n.x=N(e,Bs,zs),n.y=N(r,Bs,zs),(e<n.x||e>n.x+1||r<n.y||r>n.y+1)&&ue(`Geometry exceeds allowed extent, reduce your vector tile buffer size`)}return n}function Hs(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Vs(e):[]}}let Us=-32768;function Ws(e,t,n,r,i){e.emplaceBack(Us+8*t+r,Us+8*n+i)}class Gs{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new Ko,this.indexArray=new is,this.segments=new ss,this.programConfigurations=new Is(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,n){let r=this.layers[0],i=[],a=null,o=!1,s=r.type===`heatmap`;if(r.type===`circle`){let e=r;a=e.layout.get(`circle-sort-key`),o=!a.isConstant(),s||=e.paint.get(`circle-pitch-alignment`)===`map`}let c=s?t.subdivisionGranularity.circle:1;for(let{feature:t,id:r,index:s,sourceLayerIndex:c}of e){let e=this.layers[0]._featureFilter.needGeometry,l=Hs(t,e);if(!this.layers[0]._featureFilter.filter(new Ia(this.zoom),l,n))continue;let u=o?a.evaluate(l,{},n):void 0,d={id:r,properties:t.properties,type:t.type,sourceLayerIndex:c,index:s,geometry:e?l.geometry:Vs(t),patterns:{},sortKey:u};i.push(d)}o&&i.sort(((e,t)=>e.sortKey-t.sortKey));for(let r of i){let{geometry:i,index:a,sourceLayerIndex:o}=r,s=e[a].feature;this.addFeature(r,i,a,n,c),t.featureIndex.insert(s,i,a,o,this.index)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:n})}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,os),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,n,r,i=1){let a;switch(i){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 Error(`Invalid circle bucket granularity: ${i}; valid values are 1, 3, 5, 7.`)}let o=a.length;for(let n of t)for(let t of n){let n=t.x,r=t.y;if(n<0||n>=O||r<0||r>=O)continue;let i=this.segments.prepareSegment(o*o,this.layoutVertexArray,this.indexArray,e.sortKey),s=i.vertexLength;for(let e=0;e<o;e++)for(let t=0;t<o;t++)Ws(this.layoutVertexArray,n,r,a[t],a[e]);for(let e=0;e<o-1;e++)for(let t=0;t<o-1;t++){let n=s+e*o+t,r=s+(e+1)*o+t;this.indexArray.emplaceBack(n,r+1,n+1),this.indexArray.emplaceBack(n,r,r+1)}i.vertexLength+=o*o,i.primitiveLength+=(o-1)*(o-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{imagePositions:{},canonical:r})}}function Ks(e,t){for(let n of e)if(tc(t,n))return!0;for(let n of t)if(tc(e,n))return!0;return Xs(e,t)}function qs(e,t,n){return!!tc(e,t)||Qs(t,e,n)}function Js(e,t){if(e.length===1)return ec(t,e[0]);for(let n of t)for(let t of n)if(tc(e,t))return!0;for(let n of e)if(ec(t,n))return!0;for(let n of t)if(Xs(e,n))return!0;return!1}function Ys(e,t,n){if(e.length>1){if(Xs(e,t))return!0;for(let r of t)if(Qs(r,e,n))return!0}for(let r of e)if(Qs(r,t,n))return!0;return!1}function Xs(e,t){if(e.length===0||t.length===0)return!1;for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1];for(let e=0;e<t.length-1;e++)if(Zs(r,i,t[e],t[e+1]))return!0}return!1}function Zs(e,t,n,r){return de(e,n,r)!==de(t,n,r)&&de(e,t,n)!==de(e,t,r)}function Qs(e,t,n){let r=n*n;if(t.length===1)return e.distSqr(t[0])<r;for(let n=1;n<t.length;n++)if($s(e,t[n-1],t[n])<r)return!0;return!1}function $s(e,t,n){let r=t.distSqr(n);if(r===0)return e.distSqr(t);let i=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/r;return e.distSqr(i<0?t:i>1?n:n.sub(t)._mult(i)._add(t))}function ec(e,t){let n,r,i,a=!1;for(let o of e){n=o;for(let e=0,o=n.length-1;e<n.length;o=e++)r=n[e],i=n[o],r.y>t.y!=i.y>t.y&&t.x<(i.x-r.x)*(t.y-r.y)/(i.y-r.y)+r.x&&(a=!a)}return a}function tc(e,t){let n=!1;for(let r=0,i=e.length-1;r<e.length;i=r++){let a=e[r],o=e[i];a.y>t.y!=o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(n=!n)}return n}function nc(e,t,n){let r=n[0],i=n[2];if(e.x<r.x&&t.x<r.x||e.x>i.x&&t.x>i.x||e.y<r.y&&t.y<r.y||e.y>i.y&&t.y>i.y)return!1;let a=de(e,t,n[0]);return a!==de(e,t,n[1])||a!==de(e,t,n[2])||a!==de(e,t,n[3])}function rc(e,t,n){let r=t.paint.get(e).value;return r.kind===`constant`?r.value:n.programConfigurations.get(t.id).getMaxValue(e)}function ic(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function ac(e,t,r,i,a){if(!t[0]&&!t[1])return e;let o=n.convert(t)._mult(a);r===`viewport`&&o._rotate(-i);let s=[];for(let t of e)s.push(t.sub(o));return s}function oc(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=t.at(-1);(n===0||i&&!r.equals(i))&&t.push(r)}return t}function sc({queryGeometry:e,size:t},n){return qs(e,n,t)}function cc({queryGeometry:e,size:t,transform:n,unwrappedTileID:r,getElevation:i},a){return qs(e,a,t*(n.projectTileCoordinates(a.x,a.y,r,i).signedDistanceFromCamera/n.cameraToCenterDistance))}function lc({queryGeometry:e,size:t,transform:n,unwrappedTileID:r,getElevation:i},a){let o=n.projectTileCoordinates(a.x,a.y,r,i).signedDistanceFromCamera,s=t*(n.cameraToCenterDistance/o);return qs(e,fc(a,n,r,i),s)}function uc({queryGeometry:e,size:t,transform:n,unwrappedTileID:r,getElevation:i},a){return qs(e,fc(a,n,r,i),t)}function dc({queryGeometry:e,size:t,transform:n,unwrappedTileID:r,getElevation:i,pitchAlignment:a=`map`,pitchScale:o=`map`},s){let c=a===`map`?o===`map`?sc:cc:o===`map`?lc:uc,l={queryGeometry:e,size:t,transform:n,unwrappedTileID:r,getElevation:i};for(let e of s)for(let t of e)if(c(l,t))return!0;return!1}function fc(e,t,r,i){let a=t.projectTileCoordinates(e.x,e.y,r,i).point;return new n((.5*a.x+.5)*t.width,(.5*-a.y+.5)*t.height)}let pc,mc;Y(`CircleBucket`,Gs,{omit:[`layers`]});var hc={get paint(){return mc||=new Xa({"circle-radius":new Z(P.paint_circle[`circle-radius`]),"circle-color":new Z(P.paint_circle[`circle-color`]),"circle-blur":new Z(P.paint_circle[`circle-blur`]),"circle-opacity":new Z(P.paint_circle[`circle-opacity`]),"circle-translate":new X(P.paint_circle[`circle-translate`]),"circle-translate-anchor":new X(P.paint_circle[`circle-translate-anchor`]),"circle-pitch-scale":new X(P.paint_circle[`circle-pitch-scale`]),"circle-pitch-alignment":new X(P.paint_circle[`circle-pitch-alignment`]),"circle-stroke-width":new Z(P.paint_circle[`circle-stroke-width`]),"circle-stroke-color":new Z(P.paint_circle[`circle-stroke-color`]),"circle-stroke-opacity":new Z(P.paint_circle[`circle-stroke-opacity`])})},get layout(){return pc||=new Xa({"circle-sort-key":new Z(P.layout_circle[`circle-sort-key`])})}};class gc extends $a{constructor(e,t){super(e,hc,t)}createBucket(e){return new Gs(e)}queryRadius(e){let t=e;return rc(`circle-radius`,this,t)+rc(`circle-stroke-width`,this,t)+ic(this.paint.get(`circle-translate`))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:n,geometry:r,transform:i,pixelsToTileUnits:a,unwrappedTileID:o,getElevation:s}){let c=ac(e,this.paint.get(`circle-translate`),this.paint.get(`circle-translate-anchor`),-i.bearingInRadians,a),l=this.paint.get(`circle-radius`).evaluate(t,n)+this.paint.get(`circle-stroke-width`).evaluate(t,n),u=this.paint.get(`circle-pitch-scale`),d=this.paint.get(`circle-pitch-alignment`),f,p;return d===`map`?(f=c,p=l*a):(f=function(e,t,n,r){return e.map((e=>fc(e,t,n,r)))}(c,i,o,s),p=l),dc({queryGeometry:f,size:p,transform:i,unwrappedTileID:o,getElevation:s,pitchAlignment:d,pitchScale:u},r)}}class _c extends Gs{}let vc;Y(`HeatmapBucket`,_c,{omit:[`layers`]});var yc={get paint(){return vc||=new Xa({"heatmap-radius":new Z(P.paint_heatmap[`heatmap-radius`]),"heatmap-weight":new Z(P.paint_heatmap[`heatmap-weight`]),"heatmap-intensity":new X(P.paint_heatmap[`heatmap-intensity`]),"heatmap-color":new Ya(P.paint_heatmap[`heatmap-color`]),"heatmap-opacity":new X(P.paint_heatmap[`heatmap-opacity`])})}};function bc(e,{width:t,height:n},r,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==t*n*r)throw RangeError(`mismatched image size. expected: ${i.length} but got: ${t*n*r}`)}else i=new Uint8Array(t*n*r);return e.width=t,e.height=n,e.data=i,e}function xc(e,{width:t,height:n},r){if(t===e.width&&n===e.height)return;let i=bc({},{width:t,height:n},r);Sc(e,i,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,n)},r),e.width=t,e.height=n,e.data=i.data}function Sc(e,t,n,r,i,a){if(i.width===0||i.height===0)return t;if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw RangeError(`out of range source coordinates for image copy`);if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw RangeError(`out of range destination coordinates for image copy`);let o=e.data,s=t.data;if(o===s)throw Error(`srcData equals dstData, so image is already copied`);for(let c=0;c<i.height;c++){let l=((n.y+c)*e.width+n.x)*a,u=((r.y+c)*t.width+r.x)*a;for(let e=0;e<i.width*a;e++)s[u+e]=o[l+e]}return t}class Cc{constructor(e,t){bc(this,e,1,t)}resize(e){xc(this,e,1)}clone(){return new Cc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,n,r,i){Sc(e,t,n,r,i,1)}}class wc{constructor(e,t){bc(this,e,4,t)}resize(e){xc(this,e,4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new wc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,n,r,i){Sc(e,t,n,r,i,4)}setPixel(e,t,n){let r=4*(e*this.width+t);this.data[r+0]=Math.round(255*n.r/n.a),this.data[r+1]=Math.round(255*n.g/n.a),this.data[r+2]=Math.round(255*n.b/n.a),this.data[r+3]=Math.round(255*n.a)}}function Tc(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=4){let r=e[n+3];t[n+0]=Math.round(e[n+0]*r/255),t[n+1]=Math.round(e[n+1]*r/255),t[n+2]=Math.round(e[n+2]*r/255),t[n+3]=r}return t}function Ec(e){let t={},n=e.resolution||256,r=e.clips?e.clips.length:1,i=e.image||new wc({width:n,height:r});if(Math.log(n)/Math.LN2%1!=0)throw Error(`width is not a power of 2 - ${n}`);let a=(r,a,o)=>{t[e.evaluationKey]=o;let s=e.expression.evaluate(t);i.setPixel(r/4/n,a/4,s)};if(e.clips)for(let t=0,i=0;t<r;++t,i+=4*n)for(let r=0,o=0;r<n;r++,o+=4){let s=r/(n-1),{start:c,end:l}=e.clips[t];a(i,o,c*(1-s)+l*s)}else for(let e=0,t=0;e<n;e++,t+=4)a(0,t,e/(n-1));return i}Y(`AlphaImage`,Cc),Y(`RGBAImage`,wc);let Dc=`big-fb`;class Oc extends $a{createBucket(e){return new _c(e)}constructor(e,t){super(e,yc,t),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e===`heatmap-color`&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Ec({expression:this._transitionablePaint._values[`heatmap-color`].value.expression,evaluationKey:`heatmapDensity`,image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Dc)&&this.heatmapFbos.delete(Dc)}queryRadius(e){return rc(`heatmap-radius`,this,e)}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:n,geometry:r,transform:i,pixelsToTileUnits:a,unwrappedTileID:o,getElevation:s}){return dc({queryGeometry:e,size:this.paint.get(`heatmap-radius`).evaluate(t,n)*a,transform:i,unwrappedTileID:o,getElevation:s},r)}hasOffscreenPass(){return this.paint.get(`heatmap-opacity`)!==0&&!this.isHidden()}}let kc;var Ac={get paint(){return kc||=new Xa({"hillshade-illumination-direction":new X(P.paint_hillshade[`hillshade-illumination-direction`]),"hillshade-illumination-altitude":new X(P.paint_hillshade[`hillshade-illumination-altitude`]),"hillshade-illumination-anchor":new X(P.paint_hillshade[`hillshade-illumination-anchor`]),"hillshade-exaggeration":new X(P.paint_hillshade[`hillshade-exaggeration`]),"hillshade-shadow-color":new X(P.paint_hillshade[`hillshade-shadow-color`]),"hillshade-highlight-color":new X(P.paint_hillshade[`hillshade-highlight-color`]),"hillshade-accent-color":new X(P.paint_hillshade[`hillshade-accent-color`]),"hillshade-method":new X(P.paint_hillshade[`hillshade-method`]),resampling:new X(P.paint_hillshade.resampling)})}};class jc extends $a{constructor(e,t){super(e,Ac,t),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get(`hillshade-illumination-direction`).values,t=this.paint.get(`hillshade-illumination-altitude`).values,n=this.paint.get(`hillshade-highlight-color`).values,r=this.paint.get(`hillshade-shadow-color`).values,i=Math.max(e.length,t.length,n.length,r.length);e=e.concat(Array(i-e.length).fill(e.at(-1))),t=t.concat(Array(i-t.length).fill(t.at(-1))),n=n.concat(Array(i-n.length).fill(n.at(-1))),r=r.concat(Array(i-r.length).fill(r.at(-1)));let a=t.map(be);return{directionRadians:e.map(be),altitudeRadians:a,shadowColor:r,highlightColor:n}}hasOffscreenPass(){return this.paint.get(`hillshade-exaggeration`)!==0&&!this.isHidden()}}let Mc;var Nc={get paint(){return Mc||=new Xa({"color-relief-opacity":new X(P[`paint_color-relief`][`color-relief-opacity`]),"color-relief-color":new Ya(P[`paint_color-relief`][`color-relief-color`]),resampling:new X(P[`paint_color-relief`].resampling)})}};function Pc(e){return`data`in e}class Fc{constructor(e,t,n,r){this.context=e,this.format=n,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(t,r)}update(e,t,n){let{width:r,height:i}=e,a=(this.size?.[0]!==r||this.size[1]!==i)&&!n,{context:o}=this,{gl:s}=o;this.useMipmap=!!t?.useMipmap,s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1);let c=this.format===s.RGBA&&!1!==t?.premultiply;if(a)this.size=[r,i],Pc(e)?(o.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,c,r,i,s)):(o.pixelStoreUnpackPremultiplyAlpha.set(c),this._uploadDomImage(e,s));else{let{x:t,y:a}=n||{x:0,y:0};Pc(e)?(o.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,c,t,a,r,i,s)):(o.pixelStoreUnpackPremultiplyAlpha.set(c),this._updateDomImage(e,t,a,s))}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D),o.pixelStoreUnpackFlipY.setDefault(),o.pixelStoreUnpack.setDefault(),o.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(e,t){t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,t.UNSIGNED_BYTE,e)}_uploadRawData(e,t,n,r,i){let{data:a}=e;t&&a&&(a=Tc(a)),i.texImage2D(i.TEXTURE_2D,0,this.format,n,r,0,this.format,i.UNSIGNED_BYTE,a)}_updateDomImage(e,t,n,r){r.texSubImage2D(r.TEXTURE_2D,0,t,n,r.RGBA,r.UNSIGNED_BYTE,e)}_updateRawData(e,t,n,r,i,a,o){let{data:s}=e;t&&s&&(s=Tc(s)),o.texSubImage2D(o.TEXTURE_2D,0,n,r,i,a,o.RGBA,o.UNSIGNED_BYTE,s)}bind(e,t,n){let{context:r}=this,{gl:i}=r;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),i.bindTexture(i.TEXTURE_2D,this.texture),n!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(n=i.LINEAR),e!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,n||e),this.filter=e),t!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,t),this.wrap=t)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}}class Ic{constructor(e,t,n,r=1,i=1,a=1,o=0){if(this.uid=e,t.height!==t.width)throw RangeError(`DEM tiles must be square`);if(n&&![`mapbox`,`terrarium`,`custom`].includes(n))return void ue(`"${n}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=t.height;let s=this.dim=t.height-2;switch(this.data=new Uint32Array(t.data.buffer),n){case`terrarium`:this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case`custom`:this.redFactor=r,this.greenFactor=i,this.blueFactor=a,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let e=0;e<s;e++)this.data[this._idx(-1,e)]=this.data[this._idx(0,e)],this.data[this._idx(s,e)]=this.data[this._idx(s-1,e)],this.data[this._idx(e,-1)]=this.data[this._idx(e,0)],this.data[this._idx(e,s)]=this.data[this._idx(e,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=2**53-1,this.max=-(2**53-1);for(let e=0;e<s;e++)for(let t=0;t<s;t++){let n=this.get(e,t);n>this.max&&(this.max=n),n<this.min&&(this.min=n)}}get(e,t){let n=new Uint8Array(this.data.buffer),r=4*this._idx(e,t);return this.unpack(n[r],n[r+1],n[r+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${t}, dim: ${this.dim}`);return(t+1)*this.stride+(e+1)}unpack(e,t,n){return e*this.redFactor+t*this.greenFactor+n*this.blueFactor-this.baseShift}pack(e){return Lc(e,this.getUnpackVector())}getPixels(){return new wc({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,t,n){if(this.dim!==e.dim)throw Error(`dem dimension mismatch`);let r=t*this.dim,i=t*this.dim+this.dim,a=n*this.dim,o=n*this.dim+this.dim;switch(t){case-1:r=i-1;break;case 1:i=r+1}switch(n){case-1:a=o-1;break;case 1:o=a+1}let s=-t*this.dim,c=-n*this.dim;for(let t=a;t<o;t++)for(let n=r;n<i;n++)this.data[this._idx(n,t)]=e.data[this._idx(n+s,t+c)]}}function Lc(e,t){let n=t[0],r=t[1],i=t[2],a=t[3],o=Math.min(n,r,i),s=Math.round((e+a)/o);return{r:Math.floor(s*o/n)%256,g:Math.floor(s*o/r)%256,b:Math.floor(s*o/i)%256}}Y(`DEMData`,Ic);class Rc extends $a{constructor(e,t){super(e,Nc,t)}_createColorRamp(e){let t={elevationStops:[],colorStops:[]},n=this._transitionablePaint._values[`color-relief-color`].value.expression;if(n instanceof ci&&n._styleExpression.expression instanceof bn){this.colorRampExpression=n;let e=n._styleExpression.expression;t.elevationStops=e.labels,t.colorStops=[];for(let n of t.elevationStops)t.colorStops.push(e.evaluate({globals:{elevation:n}}))}if(t.elevationStops.length<1&&(t.elevationStops=[0],t.colorStops=[V.transparent]),t.elevationStops.length<2&&(t.elevationStops.push(t.elevationStops[0]+1),t.colorStops.push(t.colorStops[0])),t.elevationStops.length<=e)return t;let r={elevationStops:[],colorStops:[]},i=(t.elevationStops.length-1)/(e-1);for(let e=0;e<t.elevationStops.length-.5;e+=i)r.elevationStops.push(t.elevationStops[Math.round(e)]),r.colorStops.push(t.colorStops[Math.round(e)]);return ue(`Too many colors in specification of ${this.id} color-relief layer, may not render properly. Max possible colors: ${e}, provided: ${t.elevationStops.length}`),r}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values[`color-relief-color`].value.expression}getColorRampTextures(e,t,n){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let r=this._createColorRamp(t),i=new wc({width:r.colorStops.length,height:1}),a=new wc({width:r.colorStops.length,height:1});for(let e=0;e<r.elevationStops.length;e++){let t=Lc(r.elevationStops[e],n);a.setPixel(0,e,new V(t.r/255,t.g/255,t.b/255,1)),i.setPixel(0,e,r.colorStops[e])}return this.colorRampTextures={elevationTexture:new Fc(e,a,e.gl.RGBA),colorTexture:new Fc(e,i,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}}let{members:zc}=oo([{name:`a_pos`,components:2,type:`Int16`}],4);function Bc(e,t,n){let r=n.patternDependencies,i=!1;for(let n of t){let t=n.paint.get(`${e}-pattern`);t.isConstant()||(i=!0);let a=t.constantOr(null);a&&(i=!0,r[a.to]=!0,r[a.from]=!0)}return i}function Vc(e,t,n,r,i){let{zoom:a}=r,o=i.patternDependencies;for(let r of t){let t=r.paint.get(`${e}-pattern`).value;if(t.kind!==`constant`){let e=t.evaluate({zoom:a-1},n,{},i.availableImages),s=t.evaluate({zoom:a},n,{},i.availableImages),c=t.evaluate({zoom:a+1},n,{},i.availableImages);e=e?.name?e.name:e,s=s?.name?s.name:s,c=c?.name?c.name:c,o[e]=!0,o[s]=!0,o[c]=!0,n.patterns[r.id]={min:e,mid:s,max:c}}}return n}function Hc(e,t,n,r,i){let a;if(i===function(e,t,n,r){let i=0;for(let a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,n,r)>0)for(let i=t;i<n;i+=r)a=ul(i/r|0,e[i],e[i+1],a);else for(let i=n-r;i>=t;i-=r)a=ul(i/r|0,e[i],e[i+1],a);return a&&il(a,a.next)&&(dl(a),a=a.next),a}function Uc(e,t){if(!e)return e;t||=e;let n,r=e;do if(n=!1,r.steiner||!il(r,r.next)&&rl(r.prev,r,r.next)!==0)r=r.next;else{if(dl(r),r=t=r.prev,r===r.next)break;n=!0}while(n||r!==t);return t}function Wc(e,t,n,r,i,a,o){if(!e)return;!o&&a&&function(e,t,n,r){let i=e;do i.z===0&&(i.z=Qc(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n=1;do{let r,i=e;e=null;let a=null;for(t=0;i;){t++;let o=i,s=0;for(let e=0;e<n&&(s++,o=o.nextZ,o);e++);let c=n;for(;s>0||c>0&&o;)s!==0&&(c===0||!o||i.z<=o.z)?(r=i,i=i.nextZ,s--):(r=o,o=o.nextZ,c--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;i=o}a.nextZ=null,n*=2}while(t>1)}(i)}(e,r,i,a);let s=e;for(;e.prev!==e.next;){let c=e.prev,l=e.next;if(a?Kc(e,r,i,a):Gc(e))t.push(c.i,e.i,l.i),dl(e),e=l.next,s=l.next;else if((e=l)===s){o?o===1?Wc(e=qc(Uc(e),t),t,n,r,i,a,2):o===2&&Jc(e,t,n,r,i,a):Wc(Uc(e),t,n,r,i,a,1);break}}}function Gc(e){let t=e.prev,n=e,r=e.next;if(rl(t,n,r)>=0)return!1;let i=t.x,a=n.x,o=r.x,s=t.y,c=n.y,l=r.y,u=Math.min(i,a,o),d=Math.min(s,c,l),f=Math.max(i,a,o),p=Math.max(s,c,l),m=r.next;for(;m!==t;){if(m.x>=u&&m.x<=f&&m.y>=d&&m.y<=p&&tl(i,s,a,c,o,l,m.x,m.y)&&rl(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Kc(e,t,n,r){let i=e.prev,a=e,o=e.next;if(rl(i,a,o)>=0)return!1;let s=i.x,c=a.x,l=o.x,u=i.y,d=a.y,f=o.y,p=Math.min(s,c,l),m=Math.min(u,d,f),h=Math.max(s,c,l),g=Math.max(u,d,f),_=Qc(p,m,t,n,r),v=Qc(h,g,t,n,r),y=e.prevZ,b=e.nextZ;for(;y&&y.z>=_&&b&&b.z<=v;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&tl(s,u,c,d,l,f,y.x,y.y)&&rl(y.prev,y,y.next)>=0||(y=y.prevZ,b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&tl(s,u,c,d,l,f,b.x,b.y)&&rl(b.prev,b,b.next)>=0))return!1;b=b.nextZ}for(;y&&y.z>=_;){if(y.x>=p&&y.x<=h&&y.y>=m&&y.y<=g&&y!==i&&y!==o&&tl(s,u,c,d,l,f,y.x,y.y)&&rl(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;b&&b.z<=v;){if(b.x>=p&&b.x<=h&&b.y>=m&&b.y<=g&&b!==i&&b!==o&&tl(s,u,c,d,l,f,b.x,b.y)&&rl(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function qc(e,t){let n=e;do{let r=n.prev,i=n.next.next;!il(r,i)&&al(r,n,n.next,i)&&cl(r,i)&&cl(i,r)&&(t.push(r.i,n.i,i.i),dl(n),dl(n.next),n=e=i),n=n.next}while(n!==e);return Uc(n)}function Jc(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&nl(o,e)){let s=ll(o,e);o=Uc(o,o.next),s=Uc(s,s.next),Wc(o,t,n,r,i,a,0),Wc(s,t,n,r,i,a,0);return}e=e.next}o=o.next}while(o!==e)}function Yc(e,t){let n=e.x-t.x;return n===0&&(n=e.y-t.y,n===0)&&(n=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),n}function Xc(e,t){let n=function(e,t){let n=t,r=e.x,i=e.y,a,o=-1/0;if(il(e,n))return n;do{if(il(e,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>o&&(o=e,a=n.x<n.next.x?n:n.next,e===r))return a}n=n.next}while(n!==t);if(!a)return null;let s=a,c=a.x,l=a.y,u=1/0;n=a;do{if(r>=n.x&&n.x>=c&&r!==n.x&&el(i<l?r:o,i,c,l,i<l?o:r,i,n.x,n.y)){let t=Math.abs(i-n.y)/(r-n.x);cl(n,e)&&(t<u||t===u&&(n.x>a.x||n.x===a.x&&Zc(a,n)))&&(a=n,u=t)}n=n.next}while(n!==s);return a}(e,t);if(!n)return t;let r=ll(n,e);return Uc(r,r.next),Uc(n,n.next)}function Zc(e,t){return rl(e.prev,e,t.prev)<0&&rl(t.next,e,e.next)<0}function Qc(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function $c(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function el(e,t,n,r,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(r-s)>=(n-o)*(t-s)&&(n-o)*(a-s)>=(i-o)*(r-s)}function tl(e,t,n,r,i,a,o,s){return!(e===o&&t===s)&&el(e,t,n,r,i,a,o,s)}function nl(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&al(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(cl(e,t)&&cl(t,e)&&function(e,t){let n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}(e,t)&&(rl(e.prev,e,t.prev)||rl(e,t.prev,t))||il(e,t)&&rl(e.prev,e,e.next)>0&&rl(t.prev,t,t.next)>0)}function rl(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function il(e,t){return e.x===t.x&&e.y===t.y}function al(e,t,n,r){let i=sl(rl(e,t,n)),a=sl(rl(e,t,r)),o=sl(rl(n,r,e)),s=sl(rl(n,r,t));return i!==a&&o!==s||!(i!==0||!ol(e,n,t))||!(a!==0||!ol(e,r,t))||!(o!==0||!ol(n,e,r))||!(s!==0||!ol(n,t,r))}function ol(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function sl(e){return e>0?1:e<0?-1:0}function cl(e,t){return rl(e.prev,e,e.next)<0?rl(e,t,e.next)>=0&&rl(e,e.prev,t)>=0:rl(e,t,e.prev)<0||rl(e,e.next,t)<0}function ll(e,t){let n=fl(e.i,e.x,e.y),r=fl(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function ul(e,t,n,r){let i=fl(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function dl(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function fl(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class pl{constructor(e,t){if(t>e)throw Error(`Min granularity must not be greater than base granularity.`);this._baseZoomGranularity=e,this._minGranularity=t}getGranularityForZoomLevel(e){return Math.max(Math.floor(this._baseZoomGranularity/(1<<e)),this._minGranularity,1)}}class ml{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}}ml.noSubdivision=new ml({fill:new pl(0,0),line:new pl(0,0),tile:new pl(0,0),stencil:new pl(0,0),circle:1}),Y(`SubdivisionGranularityExpression`,pl),Y(`SubdivisionGranularitySetting`,ml);let hl=-32768,gl=32767;class _l{constructor(e,t){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=O/e,this._canonical=t}_getKey(e,t){return(e+=32768)<<16|t+32768}_vertexToIndex(e,t){if(e<-32768||t<-32768||e>32767||t>32767)throw Error(`Vertex coordinates are out of signed 16 bit integer range.`);let n=0|Math.round(e),r=0|Math.round(t),i=this._getKey(n,r);if(this._vertexDictionary.has(i))return this._vertexDictionary.get(i);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(i,a),this._vertexBuffer.push(n,r),a}_subdivideTrianglesScanline(e){if(this._granularity<2)return function(e,t){let n=[];for(let r=0;r<t.length;r+=3){let i=t[r],a=t[r+1],o=t[r+2],s=e[2*i],c=e[2*i+1];(e[2*a]-s)*(e[2*o+1]-c)-(e[2*a+1]-c)*(e[2*o]-s)>0?(n.push(i),n.push(o),n.push(a)):(n.push(i),n.push(a),n.push(o))}return n}(this._vertexBuffer,e);let t=[],n=e.length;for(let r=0;r<n;r+=3){let n=[e[r+0],e[r+1],e[r+2]],i=[this._vertexBuffer[2*e[r+0]+0],this._vertexBuffer[2*e[r+0]+1],this._vertexBuffer[2*e[r+1]+0],this._vertexBuffer[2*e[r+1]+1],this._vertexBuffer[2*e[r+2]+0],this._vertexBuffer[2*e[r+2]+1]],a=1/0,o=1/0,s=-1/0,c=-1/0;for(let e=0;e<3;e++){let t=i[2*e],n=i[2*e+1];a=Math.min(a,t),s=Math.max(s,t),o=Math.min(o,n),c=Math.max(c,n)}if(a===s||o===c)continue;let l=Math.floor(a/this._granularityCellSize),u=Math.ceil(s/this._granularityCellSize),d=Math.floor(o/this._granularityCellSize),f=Math.ceil(c/this._granularityCellSize);if(l!==u||d!==f)for(let e=d;e<f;e++){let r=this._scanlineGenerateVertexRingForCellRow(e,i,n);bl(this._vertexBuffer,r,t)}else t.push(...n)}return t}_scanlineGenerateVertexRingForCellRow(e,t,n){let r=e*this._granularityCellSize,i=r+this._granularityCellSize,a=[];for(let e=0;e<3;e++){let o=t[2*e],s=t[2*e+1],c=t[2*(e+1)%6],l=t[(2*(e+1)+1)%6],u=t[2*(e+2)%6],d=t[(2*(e+2)+1)%6],f=c-o,p=l-s,m=f===0,h=p===0,g=(r-s)/p,_=(i-s)/p,v=Math.min(g,_),y=Math.max(g,_);if(!h&&(v>=1||y<=0)||h&&(s<r||s>i)){l>=r&&l<=i&&a.push(n[(e+1)%3]);continue}!h&&v>0&&a.push(this._vertexToIndex(o+f*v,s+p*v));let b=o+f*Math.max(v,0),x=o+f*Math.min(y,1);m||this._generateIntraEdgeVertices(a,o,s,c,l,b,x),!h&&y<1&&a.push(this._vertexToIndex(o+f*y,s+p*y)),(h||l>=r&&l<=i)&&a.push(n[(e+1)%3]),!h&&(l<=r||l>=i)&&this._generateInterEdgeVertices(a,o,s,c,l,u,d,x,r,i)}return a}_generateIntraEdgeVertices(e,t,n,r,i,a,o){let s=r-t,c=i-n,l=c===0,u=l?Math.min(t,r):Math.min(a,o),d=l?Math.max(t,r):Math.max(a,o),f=Math.floor(u/this._granularityCellSize)+1,p=Math.ceil(d/this._granularityCellSize)-1;if(l?t<r:a<o)for(let r=f;r<=p;r++){let i=r*this._granularityCellSize;e.push(this._vertexToIndex(i,n+c*(i-t)/s))}else for(let r=p;r>=f;r--){let i=r*this._granularityCellSize;e.push(this._vertexToIndex(i,n+c*(i-t)/s))}}_generateInterEdgeVertices(e,t,n,r,i,a,o,s,c,l){let u=i-n,d=a-r,f=o-i,p=(c-i)/f,m=(l-i)/f,h=Math.min(p,m),g=Math.max(p,m),_=r+d*h,v=Math.floor(Math.min(_,s)/this._granularityCellSize)+1,y=Math.ceil(Math.max(_,s)/this._granularityCellSize)-1,b=s<_,x=f===0;if(x&&(o===c||o===l))return;if(x||h>=1||g<=0){let e=n-o,r=a+(t-a)*Math.min((c-o)/e,(l-o)/e);v=Math.floor(Math.min(r,s)/this._granularityCellSize)+1,y=Math.ceil(Math.max(r,s)/this._granularityCellSize)-1,b=s<r}let S=u>0?l:c;if(b)for(let t=v;t<=y;t++)e.push(this._vertexToIndex(t*this._granularityCellSize,S));else for(let t=y;t>=v;t--)e.push(this._vertexToIndex(t*this._granularityCellSize,S))}_generateOutline(e){let t=[];for(let n of e){let e=yl(n,this._granularity,!0),r=this._pointArrayToIndices(e),i=[];for(let e=1;e<r.length;e++)i.push(r[e-1]),i.push(r[e]);t.push(i)}return t}_handlePoles(e){let t=!1,n=!1;this._canonical&&(this._canonical.y===0&&(t=!0),this._canonical.y===(1<<this._canonical.z)-1&&(n=!0)),(t||n)&&this._fillPoles(e,t,n)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let t=0;t<e.length;t+=2){let n=e[t+1];n===hl&&(e[t+1]=-32767),n===gl&&(e[t+1]=32766)}}_generatePoleQuad(e,t,n,r,i,a){r>i==(a===hl)?(e.push(n),e.push(t),e.push(this._vertexToIndex(r,a)),e.push(this._vertexToIndex(i,a)),e.push(n),e.push(this._vertexToIndex(r,a))):(e.push(t),e.push(n),e.push(this._vertexToIndex(r,a)),e.push(n),e.push(this._vertexToIndex(i,a)),e.push(this._vertexToIndex(r,a)))}_fillPoles(e,t,n){let r=this._vertexBuffer,i=O,a=e.length;for(let o=2;o<a;o+=3){let a=e[o-2],s=e[o-1],c=e[o],l=r[2*a],u=r[2*a+1],d=r[2*s],f=r[2*s+1],p=r[2*c],m=r[2*c+1];t&&(u===0&&f===0&&this._generatePoleQuad(e,a,s,l,d,hl),f===0&&m===0&&this._generatePoleQuad(e,s,c,d,p,hl),m===0&&u===0&&this._generatePoleQuad(e,c,a,p,l,hl)),n&&(u===i&&f===i&&this._generatePoleQuad(e,a,s,l,d,gl),f===i&&m===i&&this._generatePoleQuad(e,s,c,d,p,gl),m===i&&u===i&&this._generatePoleQuad(e,c,a,p,l,gl))}}_initializeVertices(e){for(let t=0;t<e.length;t+=2)this._vertexToIndex(e[t],e[t+1])}subdividePolygonInternal(e,t){if(this._used)throw Error(`Subdivision: multiple use not allowed.`);this._used=!0;let{flattened:n,holeIndices:r}=function(e){let t=[],n=[];for(let r of e)if(r.length!==0){r!==e[0]&&t.push(n.length/2);for(let e of r)n.push(e.x),n.push(e.y)}return{flattened:n,holeIndices:t}}(e),i;this._initializeVertices(n);try{let e=function(e,t,n=2){let r=t&&t.length,i=r?t[0]*n:e.length,a=Hc(e,0,i,n,!0),o=[];if(!a||a.next===a.prev)return o;let s,c,l;if(r&&(a=function(e,t,n,r){let i=[];for(let n=0,a=t.length;n<a;n++){let o=Hc(e,t[n]*r,n<a-1?t[n+1]*r:e.length,r,!1);o===o.next&&(o.steiner=!0),i.push($c(o))}i.sort(Yc);for(let e=0;e<i.length;e++)n=Xc(i[e],n);return n}(e,t,a,n)),e.length>80*n){s=e[0],c=e[1];let t=s,r=c;for(let a=n;a<i;a+=n){let n=e[a],i=e[a+1];n<s&&(s=n),i<c&&(c=i),n>t&&(t=n),i>r&&(r=i)}l=Math.max(t-s,r-c),l=l===0?0:32767/l}return Wc(a,o,n,s,c,l,0),o}(n,r),t=this._convertIndices(n,e);i=this._subdivideTrianglesScanline(t)}catch(e){console.error(e)}let a=[];return t&&(a=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(i),{verticesFlattened:this._vertexBuffer,indicesTriangles:i,indicesLineList:a}}_convertIndices(e,t){let n=[];for(let r of t)n.push(this._vertexToIndex(e[2*r],e[2*r+1]));return n}_pointArrayToIndices(e){let t=[];for(let n of e)t.push(this._vertexToIndex(n.x,n.y));return t}}function vl(e,t,n,r=!0){return new _l(n,t).subdividePolygonInternal(e,r)}function yl(e,t,r=!1){if(!e||e.length<1||e.length<2)return[];let i=e[0],a=e[e.length-1],o=r&&(i.x!==a.x||i.y!==a.y);if(t<2)return o?[...e,e[0]]:[...e];let s=Math.floor(O/t),c=[];c.push(new n(e[0].x,e[0].y));let l=e.length,u=o?l:l-1;for(let t=0;t<u;t++){let r=e[t],i=t<l-1?e[t+1]:e[0],a=r.x,o=r.y,u=i.x,d=i.y,f=a!==u,p=o!==d;if(!f&&!p)continue;let m=u-a,h=d-o,g=Math.abs(m),_=Math.abs(h),v=a,y=o;for(;;){let e=m>0?(Math.floor(v/s)+1)*s:(Math.ceil(v/s)-1)*s,t=h>0?(Math.floor(y/s)+1)*s:(Math.ceil(y/s)-1)*s,r=Math.abs(v-e),i=Math.abs(y-t),a=Math.abs(v-u),o=Math.abs(y-d),l=f?r/g:1/0,b=p?i/_:1/0;if((a<=r||!f)&&(o<=i||!p))break;if(l<b&&f||!p){v=e,y+=h*l;let t=new n(v,Math.round(y));c[c.length-1].x===t.x&&c[c.length-1].y===t.y||c.push(t)}else{v+=m*b,y=t;let e=new n(Math.round(v),y);c[c.length-1].x===e.x&&c[c.length-1].y===e.y||c.push(e)}}let b=new n(u,d);c[c.length-1].x===b.x&&c[c.length-1].y===b.y||c.push(b)}return c}function bl(e,t,n){if(t.length===0)throw Error(`Subdivision vertex ring is empty.`);let r=0,i=e[2*t[0]];for(let n=1;n<t.length;n++){let a=e[2*t[n]];a<i&&(i=a,r=n)}let a=t.length,o=r,s=(o+1)%a;for(;;){let r=o-1>=0?o-1:a-1,i=(s+1)%a,c=e[2*t[r]],l=e[2*t[i]],u=e[2*t[o]],d=e[2*t[o]+1],f=e[2*t[s]+1],p=!1;if(c<l)p=!0;else if(c>l)p=!1;else{let n=f-d,a=-(e[2*t[s]]-u),o=d<f?1:-1;((c-u)*n+(e[2*t[r]+1]-d)*a)*o>((l-u)*n+(e[2*t[i]+1]-d)*a)*o&&(p=!0)}if(p){let e=t[r],i=t[o],c=t[s];e!==i&&e!==c&&i!==c&&n.push(c,i,e),o--,o<0&&(o=a-1)}else{let e=t[i],r=t[o],c=t[s];e!==r&&e!==c&&r!==c&&n.push(c,r,e),s++,s>=a&&(s=0)}if(r===i)break}}function xl(e,t,n,r,i,a,o,s,c){let l=i.length/2,u=o&&s&&c;if(l<ss.MAX_VERTEX_ARRAY_LENGTH){let d=t.prepareSegment(l,n,r),f=d.vertexLength;for(let e=0;e<a.length;e+=3)r.emplaceBack(f+a[e],f+a[e+1],f+a[e+2]);let p,m;d.vertexLength+=l,d.primitiveLength+=a.length/3,u&&(m=o.prepareSegment(l,n,s),p=m.vertexLength,m.vertexLength+=l);for(let t=0;t<i.length;t+=2)e(i[t],i[t+1]);if(u)for(let e of c){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(e,t,n,r,i,a){let o=[];for(let e=0;e<r.length/2;e++)o.push(-1);let s={count:0},c=0,l=e.getOrCreateLatestSegment(t,n),u=l.vertexLength;for(let d=2;d<i.length;d+=3){let f=i[d-2],p=i[d-1],m=i[d],h=o[f]<c,g=o[p]<c,_=o[m]<c;l.vertexLength+(+!!h+ +!!g+ +!!_)>ss.MAX_VERTEX_ARRAY_LENGTH&&(l=e.createNewSegment(t,n),c=s.count,h=!0,g=!0,_=!0,u=0);let v=Sl(o,r,a,s,f,h,l),y=Sl(o,r,a,s,p,g,l),b=Sl(o,r,a,s,m,_,l);n.emplaceBack(u+v-c,u+y-c,u+b-c),l.primitiveLength++}})(t,n,r,i,a,e),u&&function(e,t,n,r,i,a){let o=[];for(let e=0;e<r.length/2;e++)o.push(-1);let s={count:0},c=0,l=e.getOrCreateLatestSegment(t,n),u=l.vertexLength;for(let d of i)for(let i=1;i<d.length;i+=2){let f=d[i-1],p=d[i],m=o[f]<c,h=o[p]<c;l.vertexLength+(+!!m+ +!!h)>ss.MAX_VERTEX_ARRAY_LENGTH&&(l=e.createNewSegment(t,n),c=s.count,m=!0,h=!0,u=0);let g=Sl(o,r,a,s,f,m,l),_=Sl(o,r,a,s,p,h,l);n.emplaceBack(u+g-c,u+_-c),l.primitiveLength++}}(o,n,s,i,c,e),t.forceNewSegmentOnNextPrepare(),o?.forceNewSegmentOnNextPrepare()}function Sl(e,t,n,r,i,a,o){if(a){let a=r.count;return n(t[2*i],t[2*i+1]),e[i]=r.count,r.count++,o.vertexLength++,a}return e[i]}class Cl{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new qo,this.indexArray=new is,this.indexArray2=new as,this.programConfigurations=new Is(e.layers,e.zoom),this.segments=new ss,this.segments2=new ss,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,n){this.hasDependencies=Bc(`fill`,this.layers,t);let r=this.layers[0].layout.get(`fill-sort-key`),i=!r.isConstant(),a=[];for(let{feature:o,id:s,index:c,sourceLayerIndex:l}of e){let e=this.layers[0]._featureFilter.needGeometry,u=Hs(o,e);if(!this.layers[0]._featureFilter.filter(new Ia(this.zoom),u,n))continue;let d=i?r.evaluate(u,{},n,t.availableImages):void 0,f={id:s,properties:o.properties,type:o.type,sourceLayerIndex:l,index:c,geometry:e?u.geometry:Vs(o),patterns:{},sortKey:d};a.push(f)}i&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(let r of a){let{geometry:i,index:a,sourceLayerIndex:o}=r;if(this.hasDependencies){let e=Vc(`fill`,this.layers,r,{zoom:this.zoom},t);this.patternFeatures.push(e)}else this.addFeature(r,i,a,n,{},t.subdivisionGranularity);t.featureIndex.insert(e[a].feature,i,a,o,this.index)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:n})}addFeatures(e,t,n){for(let r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,t,n,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,zc),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,n,r,i,a){for(let e of sr(t,500)){let t=vl(e,r,a.fill.getGranularityForZoomLevel(r.z)),n=this.layoutVertexArray;xl(((e,t)=>{n.emplaceBack(e,t)}),this.segments,this.layoutVertexArray,this.indexArray,t.verticesFlattened,t.indicesTriangles,this.segments2,this.indexArray2,t.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{imagePositions:i,canonical:r})}}let wl,Tl;Y(`FillBucket`,Cl,{omit:[`layers`,`patternFeatures`]});var El={get paint(){return Tl||=new Xa({"fill-antialias":new X(P.paint_fill[`fill-antialias`]),"fill-opacity":new Z(P.paint_fill[`fill-opacity`]),"fill-color":new Z(P.paint_fill[`fill-color`]),"fill-outline-color":new Z(P.paint_fill[`fill-outline-color`]),"fill-translate":new X(P.paint_fill[`fill-translate`]),"fill-translate-anchor":new X(P.paint_fill[`fill-translate-anchor`]),"fill-pattern":new qa(P.paint_fill[`fill-pattern`])})},get layout(){return wl||=new Xa({"fill-sort-key":new Z(P.layout_fill[`fill-sort-key`])})}};class Dl extends $a{constructor(e,t){super(e,El,t)}recalculate(e,t){super.recalculate(e,t);let n=this.paint._values[`fill-outline-color`];n.value.kind===`constant`&&n.value.value===void 0&&(this.paint._values[`fill-outline-color`]=this.paint._values[`fill-color`])}createBucket(e){return new Cl(e)}queryRadius(){return ic(this.paint.get(`fill-translate`))}queryIntersectsFeature({queryGeometry:e,geometry:t,transform:n,pixelsToTileUnits:r}){return Js(ac(e,this.paint.get(`fill-translate`),this.paint.get(`fill-translate-anchor`),-n.bearingInRadians,r),t)}isTileClipped(){return!0}}let Ol=oo([{name:`a_pos`,components:2,type:`Int16`},{name:`a_normal_ed`,components:4,type:`Int16`}],4),kl=oo([{name:`a_centroid`,components:2,type:`Int16`}],4),{members:Al}=Ol;class jl{constructor(e,t,n,r,i){this.properties={},this.extent=n,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=r,this._values=i,e.readFields(Ml,this,t)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,r=[],i,a=1,o=0,s=0,c=0;for(;e.pos<t;){if(o<=0){let t=e.readVarint();a=7&t,o=t>>3}if(o--,a===1||a===2)s+=e.readSVarint(),c+=e.readSVarint(),a===1&&(i&&r.push(i),i=[]),i&&i.push(new n(s,c));else{if(a!==7)throw Error(`unknown command ${a}`);i&&i.push(i[0].clone())}}return i&&r.push(i),r}bbox(){let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,n=1,r=0,i=0,a=0,o=1/0,s=-1/0,c=1/0,l=-1/0;for(;e.pos<t;){if(r<=0){let t=e.readVarint();n=7&t,r=t>>3}if(r--,n===1||n===2)i+=e.readSVarint(),a+=e.readSVarint(),i<o&&(o=i),i>s&&(s=i),a<c&&(c=a),a>l&&(l=a);else if(n!==7)throw Error(`unknown command ${n}`)}return[o,c,s,l]}toGeoJSON(e,t,n){let r=this.extent*2**n,i=this.extent*e,a=this.extent*t,o=this.loadGeometry();function s(e){return[360*(e.x+i)/r-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+a)/r)*Math.PI))-90]}function c(e){return e.map(s)}let l;if(this.type===1){let e=[];for(let t of o)e.push(t[0]);let t=c(e);l=e.length===1?{type:`Point`,coordinates:t[0]}:{type:`MultiPoint`,coordinates:t}}else if(this.type===2){let e=o.map(c);l=e.length===1?{type:`LineString`,coordinates:e[0]}:{type:`MultiLineString`,coordinates:e}}else{if(this.type!==3)throw Error(`unknown feature type`);{let e=Nl(o),t=[];for(let n of e)t.push(n.map(c));l=t.length===1?{type:`Polygon`,coordinates:t[0]}:{type:`MultiPolygon`,coordinates:t}}}let u={type:`Feature`,geometry:l,properties:this.properties};return this.id!=null&&(u.id=this.id),u}}function Ml(e,t,n){e===1?t.id=n.readVarint():e===2?function(e,t){let n=e.readVarint()+e.pos;for(;e.pos<n;){let n=t._keys[e.readVarint()],r=t._values[e.readVarint()];t.properties[n]=r}}(n,t):e===3?t.type=n.readVarint():e===4&&(t._geometry=n.pos)}function Nl(e){let t=e.length;if(t<=1)return[e];let n=[],r,i;for(let a=0;a<t;a++){let t=Pl(e[a]);t!==0&&(i===void 0&&(i=t<0),i===t<0?(r&&n.push(r),r=[e[a]]):r&&r.push(e[a]))}return r&&n.push(r),n}function Pl(e){let t=0;for(let n,r,i=0,a=e.length,o=a-1;i<a;o=i++)n=e[i],r=e[o],t+=(r.x-n.x)*(n.y+r.y);return t}jl.types=[`Unknown`,`Point`,`LineString`,`Polygon`];class Fl{constructor(e,t){this.version=1,this.name=``,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Il,this,t),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw Error(`feature index out of bounds`);this._pbf.pos=this._features[e];let t=this._pbf.readVarint()+this._pbf.pos;return new jl(this._pbf,t,this.extent,this._keys,this._values)}}function Il(e,t,n){e===15?t.version=n.readVarint():e===1?t.name=n.readString():e===5?t.extent=n.readVarint():e===2?t._features.push(n.pos):e===3?t._keys.push(n.readString()):e===4&&t._values.push(function(e){let t=null,n=e.readVarint()+e.pos;for(;e.pos<n;){let n=e.readVarint()>>3;t=n===1?e.readString():n===2?e.readFloat():n===3?e.readDouble():n===4?e.readVarint64():n===5?e.readVarint():n===6?e.readSVarint():n===7?e.readBoolean():null}if(t==null)throw Error(`unknown feature value`);return t}(n))}class Ll{constructor(e,t){this.layers=e.readFields(Rl,{},t)}}function Rl(e,t,n){if(e===3){let e=new Fl(n,n.readVarint()+n.pos);e.length&&(t[e.name]=e)}}let zl=2**13;function Bl(e,t,n,r,i,a,o,s){e.emplaceBack(t,n,2*Math.floor(r*zl)+o,i*zl*2,a*zl*2,Math.round(s))}class Vl{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new Jo,this.centroidVertexArray=new Go,this.indexArray=new is,this.programConfigurations=new Is(e.layers,e.zoom),this.segments=new ss,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,n){this.features=[],this.hasDependencies=Bc(`fill-extrusion`,this.layers,t);for(let{feature:r,id:i,index:a,sourceLayerIndex:o}of e){let e=this.layers[0]._featureFilter.needGeometry,s=Hs(r,e);if(!this.layers[0]._featureFilter.filter(new Ia(this.zoom),s,n))continue;let c={id:i,sourceLayerIndex:o,index:a,geometry:e?s.geometry:Vs(r),properties:r.properties,type:r.type,patterns:{}};this.hasDependencies?this.features.push(Vc(`fill-extrusion`,this.layers,c,{zoom:this.zoom},t)):this.addFeature(c,c.geometry,a,n,{},t.subdivisionGranularity),t.featureIndex.insert(r,c.geometry,a,o,this.index,!0)}}addFeatures(e,t,n){for(let r of this.features){let{geometry:i}=r;this.addFeature(r,i,r.index,t,n,e.subdivisionGranularity)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:n})}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Al),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,kl.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,n,r,i,a){for(let n of sr(t,500)){let t={x:0,y:0,sampleCount:0},i=this.layoutVertexArray.length;this.processPolygon(t,r,e,n,a);let o=this.layoutVertexArray.length-i,s=Math.floor(t.x/t.sampleCount),c=Math.floor(t.y/t.sampleCount);for(let e=0;e<o;e++)this.centroidVertexArray.emplaceBack(s,c)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{imagePositions:i,canonical:r})}processPolygon(e,t,n,r,i){if(r.length<1||Wl(r[0]))return;for(let t of r)t.length!==0&&Hl(e,t);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},o=i.fill.getGranularityForZoomLevel(t.z),s=jl.types[n.type]===`Polygon`;for(let e of r){if(e.length===0||Wl(e))continue;let t=yl(e,o,s);this._generateSideFaces(t,a)}if(!s)return;let c=vl(r,t,o,!1),l=this.layoutVertexArray;xl(((e,t)=>{Bl(l,e,t,0,0,1,1,0)}),this.segments,this.layoutVertexArray,this.indexArray,c.verticesFlattened,c.indicesTriangles)}_generateSideFaces(e,t){let n=0;for(let r=1;r<e.length;r++){let i=e[r],a=e[r-1];if(Ul(i,a))continue;t.segment.vertexLength+4>ss.MAX_VERTEX_ARRAY_LENGTH&&(t.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let o=i.sub(a)._perp()._unit(),s=a.dist(i);n+s>32768&&(n=0),Bl(this.layoutVertexArray,i.x,i.y,o.x,o.y,0,0,n),Bl(this.layoutVertexArray,i.x,i.y,o.x,o.y,0,1,n),n+=s,Bl(this.layoutVertexArray,a.x,a.y,o.x,o.y,0,0,n),Bl(this.layoutVertexArray,a.x,a.y,o.x,o.y,0,1,n);let c=t.segment.vertexLength;this.indexArray.emplaceBack(c,c+2,c+1),this.indexArray.emplaceBack(c+1,c+2,c+3),t.segment.vertexLength+=4,t.segment.primitiveLength+=2}}}function Hl(e,t){for(let n=0;n<t.length;n++){let r=t[n];n===t.length-1&&t[0].x===r.x&&t[0].y===r.y||(e.x+=r.x,e.y+=r.y,e.sampleCount++)}}function Ul(e,t){return e.x===t.x&&(e.x<0||e.x>O)||e.y===t.y&&(e.y<0||e.y>O)}function Wl(e){return e.every((e=>e.x<0))||e.every((e=>e.x>O))||e.every((e=>e.y<0))||e.every((e=>e.y>O))}let Gl;Y(`FillExtrusionBucket`,Vl,{omit:[`layers`,`features`]});var Kl={get paint(){return Gl||=new Xa({"fill-extrusion-opacity":new X(P[`paint_fill-extrusion`][`fill-extrusion-opacity`]),"fill-extrusion-color":new Z(P[`paint_fill-extrusion`][`fill-extrusion-color`]),"fill-extrusion-translate":new X(P[`paint_fill-extrusion`][`fill-extrusion-translate`]),"fill-extrusion-translate-anchor":new X(P[`paint_fill-extrusion`][`fill-extrusion-translate-anchor`]),"fill-extrusion-pattern":new qa(P[`paint_fill-extrusion`][`fill-extrusion-pattern`]),"fill-extrusion-height":new Z(P[`paint_fill-extrusion`][`fill-extrusion-height`]),"fill-extrusion-base":new Z(P[`paint_fill-extrusion`][`fill-extrusion-base`]),"fill-extrusion-vertical-gradient":new X(P[`paint_fill-extrusion`][`fill-extrusion-vertical-gradient`])})}};class ql extends $a{constructor(e,t){super(e,Kl,t)}createBucket(e){return new Vl(e)}queryRadius(){return ic(this.paint.get(`fill-extrusion-translate`))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:a,pixelsToTileUnits:o,pixelPosMatrix:s}){let c=ac(e,this.paint.get(`fill-extrusion-translate`),this.paint.get(`fill-extrusion-translate-anchor`),-a.bearingInRadians,o),l=this.paint.get(`fill-extrusion-height`).evaluate(t,r),u=this.paint.get(`fill-extrusion-base`).evaluate(t,r),d=function(e,t){let r=[];for(let i of e){let e=[i.x,i.y,0,1];C(e,e,t),r.push(new n(e[0]/e[3],e[1]/e[3]))}return r}(c,s),f=function(e,t,r,i){let a=[],o=[],s=i[8]*t,c=i[9]*t,l=i[10]*t,u=i[11]*t,d=i[8]*r,f=i[9]*r,p=i[10]*r,m=i[11]*r;for(let t of e){let e=[],r=[];for(let a of t){let t=a.x,o=a.y,h=i[0]*t+i[4]*o+i[12],g=i[1]*t+i[5]*o+i[13],_=i[2]*t+i[6]*o+i[14],v=i[3]*t+i[7]*o+i[15],y=_+l,b=v+u,x=h+d,S=g+f,C=_+p,w=v+m,T=new n((h+s)/b,(g+c)/b);T.z=y/b,e.push(T);let E=new n(x/w,S/w);E.z=C/w,r.push(E)}a.push(e),o.push(r)}return[a,o]}(i,u,l,s);return function(e,t,n){let r=1/0;Js(n,t)&&(r=Yl(n,t[0]));for(let i=0;i<t.length;i++){let a=t[i],o=e[i];for(let e=0;e<a.length-1;e++){let t=a[e],i=[t,a[e+1],o[e+1],o[e],t];Ks(n,i)&&(r=Math.min(r,Yl(n,i)))}}return r!==1/0&&r}(f[0],f[1],d)}}function Jl(e,t){return e.x*t.x+e.y*t.y}function Yl(e,t){if(e.length===1){let n=0,r=t[n++],i;for(;!i||r.equals(i);)if(i=t[n++],!i)return 1/0;for(;n<t.length;n++){let a=t[n],o=e[0],s=i.sub(r),c=a.sub(r),l=o.sub(r),u=Jl(s,s),d=Jl(s,c),f=Jl(c,c),p=Jl(l,s),m=Jl(l,c),h=u*f-d*d,g=(f*p-d*m)/h,_=(u*m-d*p)/h,v=r.z*(1-g-_)+i.z*g+a.z*_;if(isFinite(v))return v}return 1/0}{let e=1/0;for(let n of t)e=Math.min(e,n.z);return e}}let Xl=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Zl{static from(e){if(!(e instanceof ArrayBuffer))throw Error(`Data must be an instance of ArrayBuffer.`);let[t,n]=new Uint8Array(e,0,2);if(t!==219)throw Error(`Data does not appear to be in a KDBush format.`);let r=n>>4;if(r!==1)throw Error(`Got v${r} data when expected v1.`);let i=Xl[15&n];if(!i)throw Error(`Unrecognized array type.`);let[a]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new Zl(o,a,i,e)}constructor(e,t=64,n=Float64Array,r){if(isNaN(e)||e<0)throw Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let i=Xl.indexOf(this.ArrayType),a=2*e*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-o%8)%8;if(i<0)throw Error(`Unexpected typed array class: ${n}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+s,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+a+o+s),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+s,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return Ql(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this,s=[0,i.length-1,0],c=[];for(;s.length;){let l=s.pop()||0,u=s.pop()||0,d=s.pop()||0;if(u-d<=o){for(let o=d;o<=u;o++){let s=a[2*o],l=a[2*o+1];s>=e&&s<=n&&l>=t&&l<=r&&c.push(i[o])}continue}let f=d+u>>1,p=a[2*f],m=a[2*f+1];p>=e&&p<=n&&m>=t&&m<=r&&c.push(i[f]),(l===0?e<=p:t<=m)&&(s.push(d),s.push(f-1),s.push(1-l)),(l===0?n>=p:r>=m)&&(s.push(f+1),s.push(u),s.push(1-l))}return c}within(e,t,n){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:r,coords:i,nodeSize:a}=this,o=[0,r.length-1,0],s=[],c=n*n;for(;o.length;){let l=o.pop()||0,u=o.pop()||0,d=o.pop()||0;if(u-d<=a){for(let n=d;n<=u;n++)nu(i[2*n],i[2*n+1],e,t)<=c&&s.push(r[n]);continue}let f=d+u>>1,p=i[2*f],m=i[2*f+1];nu(p,m,e,t)<=c&&s.push(r[f]),(l===0?e-n<=p:t-n<=m)&&(o.push(d),o.push(f-1),o.push(1-l)),(l===0?e+n>=p:t+n>=m)&&(o.push(f+1),o.push(u),o.push(1-l))}return s}}function Ql(e,t,n,r,i,a){if(i-r<=n)return;let o=r+i>>1;$l(e,t,o,r,i,a),Ql(e,t,n,r,o-1,1-a),Ql(e,t,n,o+1,i,1-a)}function $l(e,t,n,r,i,a){for(;i>r;){if(i-r>600){let o=i-r+1,s=n-r+1,c=Math.log(o),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(o-l)/o)*(s-o/2<0?-1:1);$l(e,t,n,Math.max(r,Math.floor(n-s*l/o+u)),Math.min(i,Math.floor(n+(o-s)*l/o+u)),a)}let o=t[2*n+a],s=r,c=i;for(eu(e,t,r,n),t[2*i+a]>o&&eu(e,t,r,i);s<c;){for(eu(e,t,s,c),s++,c--;t[2*s+a]<o;)s++;for(;t[2*c+a]>o;)c--}t[2*r+a]===o?eu(e,t,r,c):(c++,eu(e,t,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}}function eu(e,t,n,r){tu(e,n,r),tu(t,2*n,2*r),tu(t,2*n+1,2*r+1)}function tu(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function nu(e,t,n,r){let i=e-n,a=t-r;return i*i+a*a}function ru(e,t,n,r){let i=r,a=t+(n-t>>1),o,s=n-t,c=e[t],l=e[t+1],u=e[n],d=e[n+1];for(let r=t+3;r<n;r+=3){let t=iu(e[r],e[r+1],c,l,u,d);if(t>i)o=r,i=t;else if(t===i){let e=Math.abs(r-a);e<s&&(o=r,s=e)}}i>r&&(o-t>3&&ru(e,t,o,r),e[o+2]=i,n-o>3&&ru(e,o,n,r))}function iu(e,t,n,r,i,a){let o=i-n,s=a-r;if(o!==0||s!==0){let c=((e-n)*o+(t-r)*s)/(o*o+s*s);c>1?(n=i,r=a):c>0&&(n+=o*c,r+=s*c)}return o=e-n,s=t-r,o*o+s*s}function au(e,t,n,r){let i={type:t,geom:n},a={id:e??null,type:i.type,geometry:i.geom,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(i.type){case`Point`:case`MultiPoint`:su(a,i.geom);break;case`LineString`:su(a,i.geom.points);break;case`Polygon`:su(a,i.geom[0].points);break;case`MultiLineString`:for(let e of i.geom)su(a,e.points);break;case`MultiPolygon`:for(let e of i.geom)su(a,e[0].points)}return a}function ou(e){e.points.length>64&&(e.points=new Float64Array(e.points))}function su(e,t){for(let n=0;n<t.length;n+=3)e.minX=Math.min(e.minX,t[n]),e.minY=Math.min(e.minY,t[n+1]),e.maxX=Math.max(e.maxX,t[n]),e.maxY=Math.max(e.maxY,t[n+1])}function cu(e,t){let n=[];switch(e.type){case`FeatureCollection`:for(let r=0;r<e.features.length;r++)lu(n,e.features[r],t,r);break;case`Feature`:lu(n,e,t);break;default:lu(n,{geometry:e,properties:void 0},t)}return n}function lu(e,t,n,r){if(!t.geometry)return;if(t.geometry.type===`GeometryCollection`)return void function(e,t,n,r,i){for(let a of n.geometries)lu(e,{id:t.id,geometry:a,properties:t.properties},r,i)}(e,t,t.geometry,n,r);if(!t.geometry.coordinates?.length)return;let i=function(e,t,n){return t.promoteId?e.properties?.[t.promoteId]:t.generateId?n||0:e.id}(t,n,r),a=(n.tolerance/((1<<n.maxZoom)*n.extent))**2;switch(t.geometry.type){case`Point`:(function(e,t,n,r){let i=[];i.push(fu(n.coordinates[0]),pu(n.coordinates[1]),0),e.push(au(t,`Point`,i,r))})(e,i,t.geometry,t.properties);return;case`MultiPoint`:(function(e,t,n,r){let i=[];for(let e of n.coordinates)i.push(fu(e[0]),pu(e[1]),0);e.push(au(t,`MultiPoint`,i,r))})(e,i,t.geometry,t.properties);return;case`LineString`:(function(e,t,n,r,i){let a={points:[]};uu(n.coordinates,a,r,!1),e.push(au(t,`LineString`,a,i))})(e,i,t.geometry,a,t.properties);return;case`MultiLineString`:(function(e,t,n,r,i,a){if(i.lineMetrics)for(let i of n.coordinates){let n={points:[]};uu(i,n,r,!1),e.push(au(t,`LineString`,n,a))}else{let i=[];du(n.coordinates,i,r,!1),e.push(au(t,`MultiLineString`,i,a))}})(e,i,t.geometry,a,n,t.properties);return;case`Polygon`:(function(e,t,n,r,i){let a=[];du(n.coordinates,a,r,!0),e.push(au(t,`Polygon`,a,i))})(e,i,t.geometry,a,t.properties);return;case`MultiPolygon`:(function(e,t,n,r,i){let a=[];for(let e of n.coordinates){let t=[];du(e,t,r,!0),a.push(t)}e.push(au(t,`MultiPolygon`,a,i))})(e,i,t.geometry,a,t.properties);return;default:throw Error(`Input data is not a valid GeoJSON object.`)}}function uu(e,t,n,r){let i,a,o=0;for(let n=0;n<e.length;n++){let s=fu(e[n][0]),c=pu(e[n][1]);t.points.push(s,c,0),n>0&&(o+=r?(i*c-s*a)/2:Math.sqrt((s-i)**2+(c-a)**2)),i=s,a=c}let s=t.points.length-3;t.points[2]=1,n>0&&ru(t.points,0,s,n),t.points[s+2]=1,ou(t),t.size=Math.abs(o),t.start=0,t.end=t.size}function du(e,t,n,r){for(let i=0;i<e.length;i++){let a={points:[]};uu(e[i],a,n,r),t.push(a)}}function fu(e){return e/360+.5}function pu(e){let t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function mu(e){let t={type:`Feature`,geometry:hu(e),properties:e.tags};return e.id!=null&&(t.id=e.id),t}function hu(e){let{type:t,geometry:n}=e;switch(t){case`Point`:return{type:t,coordinates:_u(n[0],n[1])};case`MultiPoint`:return{type:t,coordinates:gu(n)};case`LineString`:return{type:t,coordinates:gu(n.points)};case`MultiLineString`:case`Polygon`:return{type:t,coordinates:n.map((e=>gu(e.points)))};case`MultiPolygon`:return{type:t,coordinates:n.map((e=>e.map((e=>gu(e.points)))))}}}function gu(e){let t=[];for(let n=0;n<e.length;n+=3)t.push(_u(e[n],e[n+1]));return t}function _u(e,t){return[vu(e),yu(t)]}function vu(e){return 360*(e-.5)}function yu(e){let t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}var bu;function xu(e,t,n,r,i,a,o,s){if(r/=t,a>=(n/=t)&&o<r)return e;if(o<n||a>=r)return null;let c=[];for(let t of e){let e=i===bu.X?t.minX:t.minY,a=i===bu.X?t.maxX:t.maxY;if(e>=n&&a<r)c.push(t);else if(!(a<n||e>=r))switch(t.type){case`Point`:case`MultiPoint`:Su(t,c,n,r,i);continue;case`LineString`:Cu(t,c,n,r,i,s);continue;case`MultiLineString`:wu(t,c,n,r,i);continue;case`Polygon`:Tu(t,c,n,r,i);continue;case`MultiPolygon`:Eu(t,c,n,r,i);continue}}return c.length?c:null}function Su(e,t,n,r,i){let a=[];(function(e,t,n,r,i){for(let a=0;a<e.length;a+=3){let o=e[a+i];o>=n&&o<=r&&Au(t,e[a],e[a+1],e[a+2])}})(e.geometry,a,n,r,i),a.length&&t.push(au(e.id,a.length===3?`Point`:`MultiPoint`,a,e.tags))}function Cu(e,t,n,r,i,a){let o=[];if(Du(e.geometry,o,n,r,i,!1,a.lineMetrics),o.length)if(a.lineMetrics)for(let n of o)t.push(au(e.id,`LineString`,n,e.tags));else t.push(o.length>1?au(e.id,`MultiLineString`,o,e.tags):au(e.id,`LineString`,o[0],e.tags))}function wu(e,t,n,r,i){let a=[];ku(e.geometry,a,n,r,i,!1),a.length&&t.push(a.length===1?au(e.id,`LineString`,a[0],e.tags):au(e.id,`MultiLineString`,a,e.tags))}function Tu(e,t,n,r,i){let a=[];ku(e.geometry,a,n,r,i,!0),a.length&&t.push(au(e.id,`Polygon`,a,e.tags))}function Eu(e,t,n,r,i){let a=[];for(let t of e.geometry){let e=[];ku(t,e,n,r,i,!0),e.length&&a.push(e)}a.length&&t.push(au(e.id,`MultiPolygon`,a,e.tags))}function Du(e,t,n,r,i,a,o){let s=Ou(e),c=i===bu.X?ju:Mu,l,u,d=e.start;for(let f=0;f<e.points.length-3;f+=3){let p=e.points[f],m=e.points[f+1],h=e.points[f+2],g=e.points[f+3],_=e.points[f+4],v=i===bu.X?p:m,y=i===bu.X?g:_,b=!1;o&&(l=Math.sqrt((p-g)**2+(m-_)**2)),v<n?y>n&&(u=c(s,p,m,g,_,n),o&&(s.start=d+l*u)):v>r?y<r&&(u=c(s,p,m,g,_,r),o&&(s.start=d+l*u)):Au(s.points,p,m,h),y<n&&v>=n&&(u=c(s,p,m,g,_,n),b=!0),y>r&&v<=r&&(u=c(s,p,m,g,_,r),b=!0),!a&&b&&(o&&(s.end=d+l*u),t.push(s),s=Ou(e)),o&&(d+=l)}let f=e.points.length-3,p=e.points[f],m=e.points[f+1],h=i===bu.X?p:m;h>=n&&h<=r&&Au(s.points,p,m,e.points[f+2]),f=s.points.length-3,a&&f>=3&&(s.points[f]!==s.points[0]||s.points[f+1]!==s.points[1])&&Au(s.points,s.points[0],s.points[1],s.points[2]),s.points.length&&(ou(s),t.push(s))}function Ou(e){return{points:[],size:e.size,start:e.start,end:e.end}}function ku(e,t,n,r,i,a){for(let o of e)Du(o,t,n,r,i,a,!1)}function Au(e,t,n,r){e.push(t,n,r)}function ju(e,t,n,r,i,a){let o=(a-t)/(r-t);return Au(e.points,a,n+(i-n)*o,1),o}function Mu(e,t,n,r,i,a){let o=(a-n)/(i-n);return Au(e.points,t+(r-t)*o,a,1),o}function Nu(e,t){let n=t.buffer/t.extent,r=e,i=xu(e,1,-1-n,n,bu.X,-1,2,t),a=xu(e,1,1-n,2+n,bu.X,-1,2,t);return i||a?(r=xu(e,1,-n,1+n,bu.X,-1,2,t)||[],i&&(r=Pu(i,1).concat(r)),a&&(r=r.concat(Pu(a,-1))),r):r}function Pu(e,t){let n=[];for(let r of e)switch(r.type){case`Point`:case`MultiPoint`:{let e=Fu(r.geometry,t);n.push(au(r.id,r.type,e,r.tags));continue}case`LineString`:{let e=Iu(r.geometry,t);n.push(au(r.id,r.type,e,r.tags));continue}case`MultiLineString`:case`Polygon`:{let e=[];for(let n of r.geometry)e.push(Iu(n,t));n.push(au(r.id,r.type,e,r.tags));continue}case`MultiPolygon`:{let e=[];for(let n of r.geometry){let r=[];for(let e of n)r.push(Iu(e,t));e.push(r)}n.push(au(r.id,r.type,e,r.tags));continue}}return n}function Fu(e,t){let n=[];for(let r=0;r<e.length;r+=3)n.push(e[r]+t,e[r+1],e[r+2]);return n}function Iu(e,t){let n={points:[],size:e.size};e.start!==void 0&&(n.start=e.start,n.end=e.end);for(let r=0;r<e.points.length;r+=3)n.points.push(e.points[r]+t,e.points[r+1],e.points[r+2]);return ou(n),n}function Lu(e,t,n){let r=!!t.newGeometry,i=t.removeAllProperties||t.removeProperties?.length>0||t.addOrUpdateProperties?.length>0;if(r){let r=e[0],a=cu({type:`FeatureCollection`,features:[{type:`Feature`,id:r.id,geometry:t.newGeometry,properties:i?Ru(r.tags,t):r.tags}]},n);return a=Nu(a,n),a}if(i){let n=[];for(let r of e){let e={...r};e.tags=Ru(e.tags,t),n.push(e)}return n}return e}function Ru(e,t){if(t.removeAllProperties)return{};let n={...e||{}};if(t.removeProperties)for(let e of t.removeProperties)delete n[e];if(t.addOrUpdateProperties)for(let{key:e,value:r}of t.addOrUpdateProperties)n[e]=r;return n}(function(e){e[e.X=0]=`X`,e[e.Y=1]=`Y`})(bu||={});let zu={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e};class Bu{constructor(e){this.options=Object.assign(Object.create(zu),e),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(e){let t=[];for(let n of e){if(!n.geometry)continue;let[e,r]=n.geometry.coordinates,[i,a]=[fu(e),pu(r)];t.push({id:n.id,type:`Point`,geometry:[i,a],tags:n.properties})}this.createIndex(t)}initialize(e){let t=[];for(let n of e)n.type===`Point`&&t.push(n);this.createIndex(t)}updateIndex(e,t,n){this.options=Object.assign(Object.create(zu),n.clusterOptions),this.initialize(e)}createIndex(e){let{log:t,minZoom:n,maxZoom:r}=this.options;t&&console.time(`total time`);let i=`prepare ${e.length} points`;t&&console.time(i),this.points=e;let a=[];for(let t=0;t<e.length;t++){let n=e[t];if(!n?.geometry)continue;let[r,i]=n.geometry;r=Math.fround(r),i=Math.fround(i),a.push(r,i,1/0,t,-1,1),this.options.reduce&&a.push(0)}let o=this.trees[r+1]=this.createTree(a);t&&console.timeEnd(i);for(let e=r;e>=n;e--){let n=Date.now();o=this.trees[e]=this.createTree(this.cluster(o,e)),t&&console.log(`z%d: %d clusters in %dms`,e,o.numItems,Date.now()-n)}t&&console.timeEnd(`total time`)}getClusters(e,t){return this.getClustersInternal(e,t).map((e=>mu(e)))}getClustersInternal(e,t){let n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){let e=this.getClustersInternal([n,r,180,a],t),o=this.getClustersInternal([-180,r,i,a],t);return e.concat(o)}let o=this.trees[this.limitZoom(t)],s=o.range(fu(n),pu(a),fu(i),pu(r)),c=o.flatData,l=[];for(let e of s){let t=this.stride*e;l.push(c[t+5]>1?Vu(c,t,this.clusterProps):this.points[c[t+3]])}return l}getChildren(e){let t=this.getOriginId(e),n=this.getOriginZoom(e),r=Error(`No cluster with the specified id: `+e),i=this.trees[n];if(!i)throw r;let a=i.flatData;if(t*this.stride>=a.length)throw r;let o=this.options.radius/(this.options.extent*2**(n-1)),s=i.within(a[t*this.stride],a[t*this.stride+1],o),c=[];for(let t of s){let n=t*this.stride;a[n+4]===e&&c.push(a[n+5]>1?Hu(a,n,this.clusterProps):mu(this.points[a[n+3]]))}if(c.length===0)throw r;return c}getLeaves(e,t,n){let r=[];return this.appendLeaves(r,e,t||=10,n||=0,0),r}getTile(e,t,n){let r=this.trees[this.limitZoom(e)];if(!r)return null;let i=2**e,{extent:a,radius:o}=this.options,s=o/a,c=(n-s)/i,l=(n+1+s)/i,u={transformed:!0,features:[],source:null,x:t,y:n,z:e};return this.addTileFeatures(r.range((t-s)/i,c,(t+1+s)/i,l),r.flatData,t,n,i,u),t===0&&this.addTileFeatures(r.range(1-s/i,c,1,l),r.flatData,i,n,i,u),t===i-1&&this.addTileFeatures(r.range(0,c,s/i,l),r.flatData,-1,n,i,u),u}getClusterExpansionZoom(e){return this.getOriginZoom(e)}appendLeaves(e,t,n,r,i){let a=this.getChildren(t);for(let t of a){let a=t.properties;if(a?.cluster?i+a.point_count<=r?i+=a.point_count:i=this.appendLeaves(e,a.cluster_id,n,r,i):i<r?i++:e.push(t),e.length===n)break}return i}createTree(e){let t=new Zl(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)t.add(e[n],e[n+1]);return t.finish(),t.flatData=e,t.data=null,t}addTileFeatures(e,t,n,r,i,a){for(let o of e){let e=o*this.stride,s=t[e+5]>1,c,l,u;if(s)c=Uu(t,e,this.clusterProps),l=t[e],u=t[e+1];else{let n=this.points[t[e+3]];c=n.tags,[l,u]=n.geometry}let d={type:1,geometry:[[Math.round(this.options.extent*(l*i-n)),Math.round(this.options.extent*(u*i-r))]],tags:c},f;f=s||this.options.generateId?t[e+3]:this.points[t[e+3]].id,f!==void 0&&(d.id=f),a.features.push(d)}}limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}cluster(e,t){let{radius:n,extent:r,reduce:i,minPoints:a}=this.options,o=n/(r*2**t),s=e.flatData,c=[],l=this.stride;for(let n=0;n<s.length;n+=l){if(s[n+2]<=t)continue;s[n+2]=t;let r=s[n],u=s[n+1],d=e.within(s[n],s[n+1],o),f=s[n+5],p=f;for(let e of d){let n=e*l;s[n+2]>t&&(p+=s[n+5])}if(p>f&&p>=a){let e,a=r*f,o=u*f,m=-1,h=(n/l<<5)+(t+1)+this.points.length;for(let r of d){let c=r*l;if(s[c+2]<=t)continue;s[c+2]=t;let u=s[c+5];a+=s[c]*u,o+=s[c+1]*u,s[c+4]=h,i&&(e||(e=this.map(s,n,!0),m=this.clusterProps.length,this.clusterProps.push(e)),i(e,this.map(s,c)))}s[n+4]=h,c.push(a/p,o/p,1/0,h,-1,p),i&&c.push(m)}else{for(let e=0;e<l;e++)c.push(s[n+e]);if(p>1)for(let e of d){let n=e*l;if(!(s[n+2]<=t)){s[n+2]=t;for(let e=0;e<l;e++)c.push(s[n+e])}}}}return c}getOriginId(e){return e-this.points.length>>5}getOriginZoom(e){return(e-this.points.length)%32}map(e,t,n){if(e[t+5]>1){let r=this.clusterProps[e[t+6]];return n?Object.assign({},r):r}let r=this.points[e[t+3]].tags,i=this.options.map(r);return n&&i===r?Object.assign({},i):i}}function Vu(e,t,n){return{id:e[t+3],type:`Point`,tags:Uu(e,t,n),geometry:[e[t],e[t+1]]}}function Hu(e,t,n){return{type:`Feature`,id:e[t+3],properties:Uu(e,t,n),geometry:{type:`Point`,coordinates:[vu(e[t]),yu(e[t+1])]}}}function Uu(e,t,n){let r=e[t+5],i=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?Math.round(r/100)/10+`k`:r,a=e[t+6],o=a===-1?{}:Object.assign({},n[a]);return Object.assign(o,{cluster:!0,cluster_id:e[t+3],point_count:r,point_count_abbreviated:i})}let Wu=`geojsonvt_clip_start`,Gu=`geojsonvt_clip_end`;function Ku(e,t,n,r,i){let a=t===i.maxZoom?0:i.tolerance/((1<<t)*i.extent),o={transformed:!1,features:[],source:null,x:n,y:r,z:t,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:e.length};for(let t of e)qu(o,t,a,i);return o}function qu(e,t,n,r){switch(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),t.type){case`Point`:case`MultiPoint`:(function(e,t){let n=[];for(let r=0;r<t.geometry.length;r+=3)n.push(t.geometry[r],t.geometry[r+1]),e.numPoints++,e.numSimplified++;if(!n.length)return;let r={type:1,tags:t.tags||null,geometry:n};t.id!==null&&(r.id=t.id),e.features.push(r)})(e,t);return;case`LineString`:(function(e,t,n,r){let i=[];if(Ju(i,t.geometry,e,n,!1,!1),!i.length)return;let a=t.tags||null;if(r.lineMetrics){a={};for(let e in t.tags)a[e]=t.tags[e];a[Wu]=t.geometry.start/t.geometry.size,a[Gu]=t.geometry.end/t.geometry.size}let o={type:2,tags:a,geometry:i};t.id!==null&&(o.id=t.id),e.features.push(o)})(e,t,n,r);return;case`MultiLineString`:case`Polygon`:(function(e,t,n){let r=[];for(let i=0;i<t.geometry.length;i++)Ju(r,t.geometry[i],e,n,t.type===`Polygon`,i===0);if(!r.length)return;let i={type:t.type===`Polygon`?3:2,tags:t.tags||null,geometry:r};t.id!==null&&(i.id=t.id),e.features.push(i)})(e,t,n);return;case`MultiPolygon`:(function(e,t,n){let r=[];for(let i=0;i<t.geometry.length;i++){let a=t.geometry[i];for(let t=0;t<a.length;t++)Ju(r,a[t],e,n,!0,t===0)}if(!r.length)return;let i={type:3,tags:t.tags||null,geometry:r};t.id!==null&&(i.id=t.id),e.features.push(i)})(e,t,n);return}}function Ju(e,t,n,r,i,a){let o=r*r;if(r>0&&t.size<(i?o:r))return void(n.numPoints+=t.points.length/3);let s=[];for(let e=0;e<t.points.length;e+=3)(r===0||t.points[e+2]>o)&&(n.numSimplified++,s.push(t.points[e],t.points[e+1])),n.numPoints++;i&&function(e,t){let n=0;for(let t=0,r=e.length,i=r-2;t<r;i=t,t+=2)n+=(e[t]-e[i])*(e[t+1]+e[i+1]);if(n>0===t)for(let t=0,n=e.length;t<n/2;t+=2){let r=e[t],i=e[t+1];e[t]=e[n-2-t],e[t+1]=e[n-1-t],e[n-2-t]=r,e[n-1-t]=i}}(s,a),e.push(s)}function Yu(e,t){if(e.transformed)return e;let n=1<<e.z,r=e.x,i=e.y;for(let a of e.features)a.type===1?Xu(a,t,n,r,i):Zu(a,t,n,r,i);return e.transformed=!0,e}function Xu(e,t,n,r,i){let a=e,o=e.geometry,s=[];for(let e=0;e<o.length;e+=2)s.push(Qu(o[e],o[e+1],t,n,r,i));return a.geometry=s,a}function Zu(e,t,n,r,i){let a=e,o=e.geometry,s=[];for(let e of o){let a=[];for(let o=0;o<e.length;o+=2)a.push(Qu(e[o],e[o+1],t,n,r,i));s.push(a)}return a.geometry=s,a}function Qu(e,t,n,r,i,a){return[Math.round(n*(e*r-i)),Math.round(n*(t*r-a))]}class $u{constructor(e){this.options=e,this.total=0,this.stats={},this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(e){this.splitTile(e,0,0,0),this.options.debug&&(e.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(e,t,n){n.debug>1&&(console.log(`invalidating tiles`),console.time(`invalidating`)),this.invalidateTiles(t),n.debug>1&&console.timeEnd(`invalidating`);let[r,i,a]=[0,0,0],o=Ku(e,r,i,a,n);o.source=e;let s=ed(r,i,a);if(this.tiles[s]=o,this.tileCoords.push({z:r,x:i,y:a,id:s}),n.debug){let e=`z${r}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}}getClusterExpansionZoom(e){return null}getChildren(e){return null}getLeaves(e,t,n){return null}getTile(e,t,n){let{extent:r,debug:i}=this.options,a=1<<e,o=ed(e,t=t+a&a-1,n);if(this.tiles[o])return Yu(this.tiles[o],r);i>1&&console.log(`drilling down to z%d-%d-%d`,e,t,n);let s,c=e,l=t,u=n;for(;!s&&c>0;)c--,l>>=1,u>>=1,s=this.tiles[ed(c,l,u)];return s?.source?(i>1&&(console.log(`found parent tile z%d-%d-%d`,c,l,u),console.time(`drilling down`)),this.splitTile(s.source,c,l,u,e,t,n),i>1&&console.timeEnd(`drilling down`),this.tiles[o]?Yu(this.tiles[o],r):null):null}splitTile(e,t,n,r,i,a,o){let s=[e,t,n,r],c=this.options,l=c.debug;for(;s.length;){r=s.pop(),n=s.pop(),t=s.pop(),e=s.pop();let u=1<<t,d=ed(t,n,r),f=this.tiles[d];if(!f&&(l>1&&console.time(`creation`),f=this.tiles[d]=Ku(e,t,n,r,c),this.tileCoords.push({z:t,x:n,y:r,id:d}),l)){l>1&&(console.log(`tile z%d-%d-%d (features: %d, points: %d, simplified: %d)`,t,n,r,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd(`creation`));let e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}if(f.source=e,i==null){if(t===c.indexMaxZoom||f.numPoints<=c.indexMaxPoints)continue}else{if(t===c.maxZoom||t===i)continue;if(i!=null){let e=i-t;if(n!==a>>e||r!==o>>e)continue}}if(f.source=null,!e.length)continue;l>1&&console.time(`clipping`);let p=.5*c.buffer/c.extent,m=.5-p,h=.5+p,g=1+p,_=null,v=null,y=null,b=null,x=xu(e,u,n-p,n+h,bu.X,f.minX,f.maxX,c),S=xu(e,u,n+m,n+g,bu.X,f.minX,f.maxX,c);x&&(_=xu(x,u,r-p,r+h,bu.Y,f.minY,f.maxY,c),v=xu(x,u,r+m,r+g,bu.Y,f.minY,f.maxY,c)),S&&(y=xu(S,u,r-p,r+h,bu.Y,f.minY,f.maxY,c),b=xu(S,u,r+m,r+g,bu.Y,f.minY,f.maxY,c)),l>1&&console.timeEnd(`clipping`),s.push(_||[],t+1,2*n,2*r),s.push(v||[],t+1,2*n,2*r+1),s.push(y||[],t+1,2*n+1,2*r),s.push(b||[],t+1,2*n+1,2*r+1)}}invalidateTiles(e){if(!e.length)return;let t=this.options,{debug:n}=t,r=1/0,i=-1/0,a=1/0,o=-1/0;for(let t of e)r=Math.min(r,t.minX),i=Math.max(i,t.maxX),a=Math.min(a,t.minY),o=Math.max(o,t.maxY);let s=t.buffer/t.extent,c=new Set;for(let t in this.tiles){let l=this.tiles[t],u=1<<l.z,d=(l.x-s)/u,f=(l.x+1+s)/u,p=(l.y-s)/u,m=(l.y+1+s)/u;if(i<d||r>=f||o<p||a>=m)continue;let h=!1;for(let t of e)if(t.maxX>=d&&t.minX<f&&t.maxY>=p&&t.minY<m){h=!0;break}if(h){if(n){n>1&&console.log(`invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)`,l.z,l.x,l.y,l.numFeatures,l.numPoints,l.numSimplified);let e=`z${l.z}`;this.stats[e]=(this.stats[e]||0)-1,this.total--}delete this.tiles[t],c.add(t)}}c.size&&(this.tileCoords=this.tileCoords.filter((e=>!c.has(e.id))))}}function ed(e,t,n){return 32*((1<<e)*n+t)+e}let td={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,cluster:!1,clusterOptions:zu,debug:0},{members:nd}=oo([{name:`a_pos_normal`,components:2,type:`Int16`},{name:`a_data`,components:4,type:`Uint8`}],4),{members:rd}=oo([{name:`a_uv_x`,components:1,type:`Float32`},{name:`a_split_index`,components:1,type:`Float32`}]),id=Math.cos(Math.PI/180*37.5),ad=2**14/.5;class od{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={};for(let e of this.layers)this.gradients[e.id]={};this.layoutVertexArray=new Yo,this.layoutVertexArray2=new Xo,this.indexArray=new is,this.programConfigurations=new Is(e.layers,e.zoom),this.segments=new ss,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,n){this.hasDependencies=Bc(`line`,this.layers,t)||this.hasLineDasharray(this.layers);let r=this.layers[0].layout.get(`line-sort-key`),i=!r.isConstant(),a=[];for(let{feature:t,id:o,index:s,sourceLayerIndex:c}of e){let e=this.layers[0]._featureFilter.needGeometry,l=Hs(t,e);if(!this.layers[0]._featureFilter.filter(new Ia(this.zoom),l,n))continue;let u=i?r.evaluate(l,{},n):void 0,d={id:o,properties:t.properties,type:t.type,sourceLayerIndex:c,index:s,geometry:e?l.geometry:Vs(t),patterns:{},dashes:{},sortKey:u};a.push(d)}i&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(let r of a){let{geometry:i,index:a,sourceLayerIndex:o}=r;this.hasDependencies?(Bc(`line`,this.layers,t)?Vc(`line`,this.layers,r,{zoom:this.zoom},t):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,r,this.zoom,t),this.patternFeatures.push(r)):this.addFeature(r,i,a,n,{},{},t.subdivisionGranularity),t.featureIndex.insert(e[a].feature,i,a,o,this.index)}}update(e,t,n,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:n,dashPositions:r})}addFeatures(e,t,n,r){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,t,n,r,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,rd)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,nd),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.hasOwn(e.properties,Wu)&&Object.hasOwn(e.properties,Gu))return{start:+e.properties[Wu],end:+e.properties[Gu]}}addFeature(e,t,n,r,i,a,o){let s=this.layers[0].layout,c=s.get(`line-join`).evaluate(e,{}),l=s.get(`line-cap`).evaluate(e,{}),u=s.get(`line-miter-limit`).evaluate(e,{}),d=s.get(`line-round-limit`).evaluate(e,{});this.lineClips=this.lineFeatureClips(e);for(let n of t)this.addLine(n,e,c,l,u,d,r,o);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{imagePositions:i,dashPositions:a,canonical:r})}addLine(e,t,n,r,i,a,o,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e=yl(e,o?s.line.getGranularityForZoomLevel(o.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let c=jl.types[t.type]===`Polygon`,l=e.length;for(;l>=2&&e[l-1].equals(e[l-2]);)l--;let u=0;for(;u<l-1&&e[u].equals(e[u+1]);)u++;if(l<(c?3:2))return;n===`bevel`&&(i=1.05);let d=this.overscaling<=16?122880/(512*this.overscaling):0,f=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),p,m,h,g,_;this.e1=this.e2=-1,c&&(p=e[l-2],_=e[u].sub(p)._unit()._perp());for(let t=u;t<l;t++){if(h=t===l-1?c?e[u+1]:void 0:e[t+1],h&&e[t].equals(h))continue;_&&(g=_),p&&(m=p),p=e[t],_=h?h.sub(p)._unit()._perp():g,g||=_;let o=g.add(_);o.x===0&&o.y===0||o._unit();let s=g.x*_.x+g.y*_.y,v=o.x*_.x+o.y*_.y,y=v===0?1/0:1/v,b=2*Math.sqrt(2-2*v),x=v<id&&m&&h,S=g.x*_.y-g.y*_.x>0;if(x&&t>u){let e=p.dist(m);if(e>2*d){let t=p.sub(p.sub(m)._mult(d/e)._round());this.updateDistance(m,t),this.addCurrentVertex(t,g,0,0,f),m=t}}let C=m&&h,w=C?n:c?`butt`:r;if(C&&w===`round`&&(y<a?w=`miter`:y<=2&&(w=`fakeround`)),w===`miter`&&y>i&&(w=`bevel`),w===`bevel`&&(y>2&&(w=`flipbevel`),y<i&&(w=`miter`)),m&&this.updateDistance(m,p),w===`miter`)o._mult(y),this.addCurrentVertex(p,o,0,0,f);else if(w===`flipbevel`){if(y>100)o=_.mult(-1);else{let e=y*g.add(_).mag()/g.sub(_).mag();o._perp()._mult(e*(S?-1:1))}this.addCurrentVertex(p,o,0,0,f),this.addCurrentVertex(p,o.mult(-1),0,0,f)}else if(w===`bevel`||w===`fakeround`){let e=-Math.sqrt(y*y-1),t=S?e:0,n=S?0:e;if(m&&this.addCurrentVertex(p,g,t,n,f),w===`fakeround`){let e=Math.round(180*b/Math.PI/20);for(let t=1;t<e;t++){let n=t/e;if(n!==.5){let e=n-.5;n+=n*e*(n-1)*((1.0904+s*(s*(3.55645-1.43519*s)-3.2452))*e*e+(.848013+s*(.215638*s-1.06021)))}let r=_.sub(g)._mult(n)._add(g)._unit()._mult(S?-1:1);this.addHalfVertex(p,r.x,r.y,!1,S,0,f)}}h&&this.addCurrentVertex(p,_,-t,-n,f)}else if(w===`butt`)this.addCurrentVertex(p,o,0,0,f);else if(w===`square`){let e=m?1:-1;this.addCurrentVertex(p,o,e,e,f)}else w===`round`&&(m&&(this.addCurrentVertex(p,g,0,0,f),this.addCurrentVertex(p,g,1,1,f,!0)),h&&(this.addCurrentVertex(p,_,-1,-1,f,!0),this.addCurrentVertex(p,_,0,0,f)));if(x&&t<l-1){let e=p.dist(h);if(e>2*d){let t=p.add(h.sub(p)._mult(d/e)._round());this.updateDistance(p,t),this.addCurrentVertex(t,_,0,0,f),p=t}}}}addCurrentVertex(e,t,n,r,i,a=!1){let o=t.y*r-t.x,s=-t.y-t.x*r;this.addHalfVertex(e,t.x+t.y*n,t.y-t.x*n,a,!1,n,i),this.addHalfVertex(e,o,s,a,!0,-r,i),this.distance>ad/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,n,r,i,a))}addHalfVertex({x:e,y:t},n,r,i,a,o,s){let c=.5*(this.lineClips?this.scaledDistance*(ad-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+ +!!i,(t<<1)+ +!!a,Math.round(63*n)+128,Math.round(63*r)+128,1+(o===0?0:o<0?-1:1)|(63&c)<<2,c>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let l=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,l,this.e2),s.primitiveLength++),a?this.e2=l:this.e1=l}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}hasLineDasharray(e){for(let t of e){let e=t.paint.get(`line-dasharray`);if(e&&!e.isConstant())return!0}return!1}addLineDashDependencies(e,t,n,r){for(let i of e){let e=i.paint.get(`line-dasharray`);if(!e||e.value.kind===`constant`)continue;let a=i.layout.get(`line-cap`).evaluate(t,{})===`round`,o={dasharray:e.value.evaluate({zoom:n-1},t,{}),round:a},s={dasharray:e.value.evaluate({zoom:n},t,{}),round:a},c={dasharray:e.value.evaluate({zoom:n+1},t,{}),round:a},l=`${o.dasharray.join(`,`)},${o.round}`,u=`${s.dasharray.join(`,`)},${s.round}`,d=`${c.dasharray.join(`,`)},${c.round}`;r.dashDependencies[l]=o,r.dashDependencies[u]=s,r.dashDependencies[d]=c,t.dashes[i.id]={min:l,mid:u,max:d}}}}let sd,cd;Y(`LineBucket`,od,{omit:[`layers`,`patternFeatures`]});var ld={get paint(){return cd||=new Xa({"line-opacity":new Z(P.paint_line[`line-opacity`]),"line-color":new Z(P.paint_line[`line-color`]),"line-translate":new X(P.paint_line[`line-translate`]),"line-translate-anchor":new X(P.paint_line[`line-translate-anchor`]),"line-width":new Z(P.paint_line[`line-width`]),"line-gap-width":new Z(P.paint_line[`line-gap-width`]),"line-offset":new Z(P.paint_line[`line-offset`]),"line-blur":new Z(P.paint_line[`line-blur`]),"line-dasharray":new qa(P.paint_line[`line-dasharray`]),"line-pattern":new qa(P.paint_line[`line-pattern`]),"line-gradient":new Ya(P.paint_line[`line-gradient`])})},get layout(){return sd||=new Xa({"line-cap":new Z(P.layout_line[`line-cap`]),"line-join":new Z(P.layout_line[`line-join`]),"line-miter-limit":new Z(P.layout_line[`line-miter-limit`]),"line-round-limit":new Z(P.layout_line[`line-round-limit`]),"line-sort-key":new Z(P.layout_line[`line-sort-key`])})}};class ud extends Z{possiblyEvaluate(e,t){return t=new Ia(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,n,r){return t=ie({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,n,r)}}let dd;class fd extends $a{constructor(e,t){super(e,ld,t),this.gradientVersion=0,dd||(dd=new ud(ld.paint.properties[`line-width`].specification),dd.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e===`line-gradient`){let e=this.gradientExpression();this.stepInterpolant=!!function(e){return e._styleExpression!==void 0}(e)&&e._styleExpression.expression instanceof hn,this.gradientVersion=(this.gradientVersion+1)%(2**53-1)}}gradientExpression(){return this._transitionablePaint._values[`line-gradient`].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values[`line-floorwidth`]=dd.possiblyEvaluate(this._transitioningPaint._values[`line-width`].value,e)}createBucket(e){return new od(e)}queryRadius(e){let t=e,n=pd(rc(`line-width`,this,t),rc(`line-gap-width`,this,t)),r=rc(`line-offset`,this,t);return n/2+Math.abs(r)+ic(this.paint.get(`line-translate`))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:a,pixelsToTileUnits:o}){let s=ac(e,this.paint.get(`line-translate`),this.paint.get(`line-translate-anchor`),-a.bearingInRadians,o),c=o/2*pd(this.paint.get(`line-width`).evaluate(t,r),this.paint.get(`line-gap-width`).evaluate(t,r)),l=this.paint.get(`line-offset`).evaluate(t,r);return l&&(i=function(e,t){let r=[];for(let i of e){let e=oc(i),a=[];for(let r=0;r<e.length;r++){let i=e[r],o=e[r-1],s=e[r+1],c=r===0?new n(0,0):i.sub(o)._unit()._perp(),l=r===e.length-1?new n(0,0):s.sub(i)._unit()._perp(),u=c._add(l)._unit(),d=u.x*l.x+u.y*l.y;d!==0&&u._mult(1/d),a.push(u._mult(t)._add(i))}r.push(a)}return r}(i,l*o)),function(e,t,n){for(let r of t){if(e.length>=3){for(let t of r)if(tc(e,t))return!0}if(Ys(e,r,n))return!0}return!1}(s,i,c)}isTileClipped(){return!0}}function pd(e,t){return t>0?t+2*e:e}let md=oo([{name:`a_pos_offset`,components:4,type:`Int16`},{name:`a_data`,components:4,type:`Uint16`},{name:`a_pixeloffset`,components:4,type:`Int16`}],4),hd=oo([{name:`a_projected_pos`,components:3,type:`Float32`}],4);oo([{name:`a_fade_opacity`,components:1,type:`Uint32`}],4);let gd=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`}]);let _d=oo([{name:`a_pos`,components:2,type:`Int16`},{name:`a_anchor_pos`,components:2,type:`Int16`},{name:`a_extrude`,components:2,type:`Int16`}],4),vd=oo([{name:`a_pos`,components:2,type:`Float32`},{name:`a_radius`,components:1,type:`Float32`},{name:`a_flags`,components:2,type:`Int16`}],4);function yd(e,t,n){let r=t.layout.get(`text-transform`).evaluate(n,{});return r===`uppercase`?e=e.toLocaleUpperCase():r===`lowercase`&&(e=e.toLocaleLowerCase()),Fa.applyArabicShaping&&(e=Fa.applyArabicShaping(e)),e}function bd(e,t,n){for(let r of e.sections)r.text=yd(r.text,t,n);return e}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 xd=24;let Sd={"!":`︕`,"#":`#`,$:`$`,"%":`%`,"&":`&`,"(":`︵`,")":`︶`,"*":`*`,"+":`+`,",":`︐`,"-":`︲`,".":`・`,"/":`/`,":":`︓`,";":`︔`,"<":`︿`,"=":`=`,">":`﹀`,"?":`︖`,"@":`@`,"[":`﹇`,"\\":`\`,"]":`﹈`,"^":`^`,_:`︳`,"`":```,"{":`︷`,"|":`―`,"}":`︸`,"~":`~`,"¢":`¢`,"£":`£`,"¥":`¥`,"¦":`¦`,"¬":`¬`,"¯":` ̄`,"–":`︲`,"—":`︱`,"‘":`﹃`,"’":`﹄`,"“":`﹁`,"”":`﹂`,"…":`︙`,"⋯":`︙`,"‧":`・`,"₩":`₩`,"、":`︑`,"。":`︒`,"〈":`︿`,"〉":`﹀`,"《":`︽`,"》":`︾`,"「":`﹁`,"」":`﹂`,"『":`﹃`,"』":`﹄`,"【":`︻`,"】":`︼`,"〔":`︹`,"〕":`︺`,"〖":`︗`,"〗":`︘`,"!":`︕`,"(":`︵`,")":`︶`,",":`︐`,"-":`︲`,".":`・`,":":`︓`,";":`︔`,"<":`︿`,">":`﹀`,"?":`︖`,"[":`﹇`,"]":`﹈`,"_":`︳`,"{":`︷`,"|":`―`,"}":`︸`,"⦅":`︵`,"⦆":`︶`,"。":`︒`,"「":`﹁`,"」":`﹂`},Cd={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},wd={40:!0};function Td(e,t,n,r,i,a){if(`fontStack`in t){let r=n[t.fontStack]?.[e];return r?r.metrics.advance*t.scale+i:0}{let e=r[t.imageName];return e?e.displaySize[0]*t.scale*xd/a+i:0}}function Ed(e,t,n,r){let i=(e-t)**2;return r?e<t?i/2:2*i:i+Math.abs(n)*n}function Dd(e,t,n){let r=0;return e===10&&(r-=1e4),n&&(r+=150),e!==40&&e!==65288||(r+=50),t!==41&&t!==65289||(r+=50),r}function Od(e,t,n,r,i,a){let o=null,s=Ed(t,n,i,a);for(let e of r){let r=Ed(t-e.x,n,i,a)+e.badness;r<=s&&(o=e,s=r)}return{index:e,x:t,priorBreak:o,badness:s}}function kd(e){return e?kd(e.priorBreak).concat(e.index):[]}class Ad{constructor(e=``,t=[],n=[]){this.text=e,this.sections=t,this.sectionIndex=n,this.imageSectionID=null}static fromFeature(e,t){let n=new Ad;for(let r of e.sections)r.image?n.addImageSection(r):n.addTextSection(r,t);return n}length(){return[...this.text].length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}verticalizePunctuation(){this.text=function(e){let t=``,n={premature:!0,value:void 0},r=e[Symbol.iterator](),i=r.next(),a=e[Symbol.iterator]();a.next();let o=a.next();for(;!i.done;)t+=!o.done&&Aa(o.value.codePointAt(0))&&!Sd[o.value]||!n.premature&&Aa(n.value.codePointAt(0))&&!Sd[n.value]||!Sd[i.value]?i.value:Sd[i.value],n={value:i.value,premature:!1},i=r.next(),o=a.next();return t}(this.text)}hasZeroWidthSpaces(){return this.text.includes(`​`)}trim(){let e=this.text.match(/^\s*/),t=e?e[0].length:0,n=this.text.match(/\S\s*$/),r=n?n[0].length-1:0;this.text=this.text.substring(t,this.text.length-r),this.sectionIndex=this.sectionIndex.slice(t,this.sectionIndex.length-r)}substring(e,t){let n=[...this.text].slice(e,t).join(``),r=this.sectionIndex.slice(e,t);return new Ad(n,this.sections,r)}toCodeUnitIndex(e){return[...this.text].slice(0,e).join(``).length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}getMaxImageSize(e){let t=0,n=0;for(let r=0;r<this.length();r++){let i=this.getSection(r);if(`imageName`in i){let r=e[i.imageName];if(!r)continue;let a=r.displaySize;t=Math.max(t,a[0]),n=Math.max(n,a[1])}}return{maxImageWidth:t,maxImageHeight:n}}addTextSection(e,t){this.text+=e.text,this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||`bottom`,fontStack:e.fontStack||t});let n=this.sections.length-1;this.sectionIndex.push(...[...e.text].map((()=>n)))}addImageSection(e){let t=e.image?e.image.name:``;if(t.length===0)return void ue(`Can't add FormattedSection with an empty image.`);let n=this.getNextImageSectionCharCode();n?(this.text+=String.fromCharCode(n),this.sections.push({scale:1,verticalAlign:e.verticalAlign||`bottom`,imageName:t}),this.sectionIndex.push(this.sections.length-1)):ue(`Reached maximum number of images 6401`)}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,t,n,r,i){let a=[],o=this.determineAverageLineWidth(e,t,n,r,i),s=this.hasZeroWidthSpaces(),c=0,l=0,u=this.text[Symbol.iterator](),d=u.next(),f=this.text[Symbol.iterator]();f.next();let p=f.next(),m=this.text[Symbol.iterator]();m.next(),m.next();let h=m.next();for(;!d.done;){let t=this.getSection(l),g=d.value.codePointAt(0);if(wa(g)||(c+=Td(g,t,n,r,e,i)),!p.done){let e=Sa(g),n=p.value.codePointAt(0);(Cd[g]||e||`imageName`in t||!h.done&&wd[n])&&a.push(Od(l+1,c,o,a,Dd(g,n,e&&s),!1))}l++,d=u.next(),p=f.next(),h=m.next()}return kd(Od(this.length(),c,o,a,0,!0))}determineAverageLineWidth(e,t,n,r,i){let a=0,o=0;for(let t of this.text){let s=this.getSection(o);a+=Td(t.codePointAt(0),s,n,r,e,i),o++}return a/Math.max(1,Math.ceil(a/t))}}let jd=4294967296,Md=1/jd,Nd=typeof TextDecoder>`u`?null:new TextDecoder(`utf-8`);class Pd{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,t,n=this.length){for(;this.pos<n;){let n=this.readVarint(),r=n>>3,i=this.pos;this.type=7&n,e(r,t,this),this.pos===i&&this.skip(n)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*jd;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*jd;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let t=this.buf,n,r;return r=t[this.pos++],n=127&r,r<128?n:(r=t[this.pos++],n|=(127&r)<<7,r<128?n:(r=t[this.pos++],n|=(127&r)<<14,r<128?n:(r=t[this.pos++],n|=(127&r)<<21,r<128?n:(r=t[this.pos],n|=(15&r)<<28,function(e,t,n){let r=n.buf,i,a;if(a=r[n.pos++],i=(112&a)>>4,a<128||(a=r[n.pos++],i|=(127&a)<<3,a<128)||(a=r[n.pos++],i|=(127&a)<<10,a<128)||(a=r[n.pos++],i|=(127&a)<<17,a<128)||(a=r[n.pos++],i|=(127&a)<<24,a<128)||(a=r[n.pos++],i|=(1&a)<<31,a<128))return Fd(e,i,t);throw Error(`Expected varint not more than 10 bytes`)}(n,e,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){let e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Nd?Nd.decode(this.buf.subarray(t,e)):function(e,t,n){let r=``,i=t;for(;i<n;){let t=e[i],a,o,s,c=null,l=t>239?4:t>223?3:t>191?2:1;if(i+l>n)break;l===1?t<128&&(c=t):l===2?(a=e[i+1],(192&a)==128&&(c=(31&t)<<6|63&a,c<=127&&(c=null))):l===3?(a=e[i+1],o=e[i+2],(192&a)==128&&(192&o)==128&&(c=(15&t)<<12|(63&a)<<6|63&o,(c<=2047||c>=55296&&c<=57343)&&(c=null))):l===4&&(a=e[i+1],o=e[i+2],s=e[i+3],(192&a)==128&&(192&o)==128&&(192&s)==128&&(c=(15&t)<<18|(63&a)<<12|(63&o)<<6|63&s,(c<=65535||c>=1114112)&&(c=null))),c===null?(c=65533,l=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),i+=l}return r}(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===2?this.readVarint()+this.pos:this.pos+1}skip(e){let t=7&e;if(t===0)for(;this.buf[this.pos++]>127;);else if(t===2)this.pos=this.readVarint()+this.pos;else if(t===5)this.pos+=4;else{if(t!==1)throw Error(`Unimplemented type: ${t}`);this.pos+=8}}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){let e=new Uint8Array(t);e.set(this.buf),this.buf=e,this.dataView=new DataView(e.buffer),this.length=t}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Md),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*Md),!0),this.pos+=8}writeVarint(e){(e=+e||0)>268435455||e<0?function(e,t){let n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(n=~(-e%4294967296),r=~(-e/4294967296),4294967295^n?n=n+1|0:(n=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw Error(`Given varint doesn't fit into 10 bytes`);t.realloc(10),function(e,t,n){n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,n.buf[n.pos]=127&(e>>>=7)}(n,0,t),function(e,t){let n=(7&e)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?2*-e-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;let t=this.pos;this.pos=function(e,t,n){for(let r,i,a=0;a<t.length;a++){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){r>56319||a+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):i=r;continue}if(r<56320){e[n++]=239,e[n++]=191,e[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&=(e[n++]=239,e[n++]=191,e[n++]=189,null);r<128?e[n++]=r:(r<2048?e[n++]=r>>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return n}(this.buf,e,this.pos);let n=this.pos-t;n>=128&&Id(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){let t=e.length;this.writeVarint(t),this.realloc(t);for(let n=0;n<t;n++)this.buf[this.pos++]=e[n]}writeRawMessage(e,t){this.pos++;let n=this.pos;e(t,this);let r=this.pos-n;r>=128&&Id(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}writeMessage(e,t,n){this.writeTag(e,2),this.writeRawMessage(t,n)}writePackedVarint(e,t){t.length&&this.writeMessage(e,Ld,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,Rd,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,Vd,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,zd,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,Bd,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,Hd,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,Ud,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,Wd,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,Gd,t)}writeBytesField(e,t){this.writeTag(e,2),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,5),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,5),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,1),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,1),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,0),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,0),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,2),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,5),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,1),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function Fd(e,t,n){return n?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Id(e,t,n){let r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));n.realloc(r);for(let t=n.pos-1;t>=e;t--)n.buf[t+r]=n.buf[t]}function Ld(e,t){for(let n=0;n<e.length;n++)t.writeVarint(e[n])}function Rd(e,t){for(let n=0;n<e.length;n++)t.writeSVarint(e[n])}function zd(e,t){for(let n=0;n<e.length;n++)t.writeFloat(e[n])}function Bd(e,t){for(let n=0;n<e.length;n++)t.writeDouble(e[n])}function Vd(e,t){for(let n=0;n<e.length;n++)t.writeBoolean(e[n])}function Hd(e,t){for(let n=0;n<e.length;n++)t.writeFixed32(e[n])}function Ud(e,t){for(let n=0;n<e.length;n++)t.writeSFixed32(e[n])}function Wd(e,t){for(let n=0;n<e.length;n++)t.writeFixed64(e[n])}function Gd(e,t){for(let n=0;n<e.length;n++)t.writeSFixed64(e[n])}function Kd(e,t,n){e===1&&n.readMessage(qd,t)}function qd(e,t,n){if(e===3){let{id:e,bitmap:r,width:i,height:a,left:o,top:s,advance:c}=n.readMessage(Jd,{});t.push({id:e,bitmap:new Cc({width:i+6,height:a+6},r),metrics:{width:i,height:a,left:o,top:s,advance:c}})}}function Jd(e,t,n){e===1?t.id=n.readVarint():e===2?t.bitmap=n.readBytes():e===3?t.width=n.readVarint():e===4?t.height=n.readVarint():e===5?t.left=n.readSVarint():e===6?t.top=n.readSVarint():e===7&&(t.advance=n.readVarint())}function Yd(e){let t=0,n=0;for(let r of e)t+=r.w*r.h,n=Math.max(n,r.w);e.sort(((e,t)=>t.h-e.h));let r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),n),h:1/0}],i=0,a=0;for(let t of e)for(let e=r.length-1;e>=0;e--){let n=r[e];if(!(t.w>n.w||t.h>n.h)){if(t.x=n.x,t.y=n.y,a=Math.max(a,t.y+t.h),i=Math.max(i,t.x+t.w),t.w===n.w&&t.h===n.h){let t=r.pop();t&&e<r.length&&(r[e]=t)}else t.h===n.h?(n.x+=t.w,n.w-=t.w):t.w===n.w?(n.y+=t.h,n.h-=t.h):(r.push({x:n.x+t.w,y:n.y,w:n.w-t.w,h:t.h}),n.y+=t.h,n.h-=t.h);break}}return{w:i,h:a,fill:t/(i*a)||0}}class Xd{constructor(e,{pixelRatio:t,version:n,stretchX:r,stretchY:i,content:a,textFitWidth:o,textFitHeight:s}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=r,this.stretchY=i,this.content=a,this.version=n,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 Zd{constructor(e,t){let n={},r={};this.haveRenderCallbacks=[];let i=[];this.addImages(e,n,i),this.addImages(t,r,i);let{w:a,h:o}=Yd(i),s=new wc({width:a||1,height:o||1});for(let t in e){let r=e[t],i=n[t].paddedRect;wc.copy(r.data,s,{x:0,y:0},{x:i.x+1,y:i.y+1},r.data)}for(let e in t){let n=t[e],i=r[e].paddedRect,a=i.x+1,o=i.y+1,c=n.data.width,l=n.data.height;wc.copy(n.data,s,{x:0,y:0},{x:a,y:o},n.data),wc.copy(n.data,s,{x:0,y:l-1},{x:a,y:o-1},{width:c,height:1}),wc.copy(n.data,s,{x:0,y:0},{x:a,y:o+l},{width:c,height:1}),wc.copy(n.data,s,{x:c-1,y:0},{x:a-1,y:o},{width:1,height:l}),wc.copy(n.data,s,{x:0,y:0},{x:a+c,y:o},{width:1,height:l})}this.image=s,this.iconPositions=n,this.patternPositions=r}addImages(e,t,n){for(let r in e){let i=e[r],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};n.push(a),t[r]=new Xd(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(r)}}patchUpdatedImages(e,t){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),t),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),t)}patchUpdatedImage(e,t,n){if(!e||!t||e.version===t.version)return;e.version=t.version;let[r,i]=e.tl;n.update(t.data,void 0,{x:r,y:i})}}var Qd;function $d(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=Ad.fromFeature(t,a),_;f===e.ax.vertical&&g.verticalizePunctuation();let v=g.determineLineBreaks(u,o,n,i,m),{processBidirectionalText:y,processStyledBidirectionalText:b}=Fa;if(y&&g.sections.length===1){_=[],v=v.map((e=>g.toCodeUnitIndex(e)));let e=y(g.toString(),v);for(let t of e){let e=[...t].map((()=>0));_.push(new Ad(t,g.sections,e))}}else if(b){_=[],v=v.map((e=>g.toCodeUnitIndex(e)));let e=0,t=[];for(let n of g.text)t.push(...Array(n.length).fill(g.sectionIndex[e])),e++;let n=b(g.text,t,v);for(let e of n){let t=[],n=``;for(let r of e[0])t.push(e[1][n.length]),n+=r;_.push(new Ad(e[0],g.sections,t))}}else _=function(e,t){let n=[],r=0;for(let i of t)n.push(e.substring(r,i)),r=i;return r<e.length()&&n.push(e.substring(r,e.length())),n}(g,v);let x=[],S={positionedLines:x,text:g.toString(),top:d[1],bottom:d[1],left:d[0],right:d[0],writingMode:f,iconsInText:!1,verticalizable:!1};return function(e,t,n,r,i,a,o,s,c,l,u,d){let f=0,p=0,m=0,h=0,g=s===`right`?1:s===`left`?0:.5,_=xd/d,v=0;for(let o of i){o.trim();let i=o.getMaxScale(),s={positionedGlyphs:[],lineOffset:0};e.positionedLines[v]=s;let d=s.positionedGlyphs,y=0;if(!o.length()){p+=a,++v;continue}let b=tf(r,o,_),x=0;for(let a of o.text){let s=o.getSection(x),m=a.codePointAt(0),h=rf(c,u,m),g={glyph:m,imageName:null,x:f,y:p+-17,vertical:h,scale:1,fontStack:``,sectionIndex:o.getSectionIndex(x),metrics:null,rect:null},v;if(`fontStack`in s){if(v=af(s,m,h,b,t,n),!v)continue;g.fontStack=s.fontStack}else{if(e.iconsInText=!0,s.scale*=_,v=of(s,h,i,b,r),!v)continue;y=Math.max(y,v.imageOffset),g.imageName=s.imageName}let{rect:S,metrics:C,baselineOffset:w}=v;g.y+=w,g.scale=s.scale,g.metrics=C,g.rect=S,d.push(g),h?(e.verticalizable=!0,f+=(`imageName`in s?C.advance:xd)*s.scale+l):f+=C.advance*s.scale+l,x++}d.length!==0&&(m=Math.max(f-l,m),sf(d,0,d.length-1,g)),f=0,s.lineOffset=Math.max(y,(i-1)*xd);let S=a*i+y;p+=S,h=Math.max(S,h),++v}let{horizontalAlign:y,verticalAlign:b}=ef(o);(function(e,t,n,r,i,a,o,s,c){let l=(t-n)*i,u=0;u=a===o?-r*c*o+.5*o:-s*r- -17;for(let t of e)for(let e of t.positionedGlyphs)e.x+=l,e.y+=u})(e.positionedLines,g,y,b,m,h,a,p,i.length),e.top+=-b*p,e.bottom=e.top+p,e.left+=-y*m,e.right=e.left+m}(S,n,r,i,_,s,c,l,f,u,p,h),!function(e){for(let t of e)if(t.positionedGlyphs.length!==0)return!1;return!0}(x)&&S}function ef(e){let t=.5,n=.5;switch(e){case`right`:case`top-right`:case`bottom-right`:t=1;break;case`left`:case`top-left`:case`bottom-left`:t=0}switch(e){case`bottom`:case`bottom-right`:case`bottom-left`:n=1;break;case`top`:case`top-right`:case`top-left`:n=0}return{horizontalAlign:t,verticalAlign:n}}function tf(e,t,n){let r=t.getMaxScale()*xd,{maxImageWidth:i,maxImageHeight:a}=t.getMaxImageSize(e),o=Math.max(r,a*n);return{verticalLineContentWidth:Math.max(r,i*n),horizontalLineContentHeight:o}}function nf(e){switch(e){case`top`:return 0;case`center`:return .5;default:return 1}}function rf(t,n,r){return!(t===e.ax.horizontal||!n&&!Ca(r)||n&&(wa(r)||(i=r,/\p{sc=Arab}/u.test(String.fromCodePoint(i)))));var i}function af(e,t,n,r,i,a){let o=function(e,t,n,r){if(e?.rect)return e;let i=t[n.fontStack]?.[r];return i?{rect:null,metrics:i.metrics}:null}(a[e.fontStack]?.[t],i,e,t);if(o===null)return null;let s;if(n)s=r.verticalLineContentWidth-e.scale*xd;else{let t=nf(e.verticalAlign);s=(r.horizontalLineContentHeight-e.scale*xd)*t}return{rect:o.rect,metrics:o.metrics,baselineOffset:s}}function of(e,t,n,r,i){let a=i[e.imageName];if(!a)return null;let o=a.paddedRect,s=a.displaySize,c={width:s[0],height:s[1],left:1,top:-3,advance:t?s[1]:s[0]},l;if(t)l=r.verticalLineContentWidth-s[1]*e.scale;else{let t=nf(e.verticalAlign);l=(r.horizontalLineContentHeight-s[1]*e.scale)*t}return{rect:o,metrics:c,baselineOffset:l,imageOffset:(t?s[0]:s[1])*e.scale-xd*n}}function sf(e,t,n,r){if(r===0)return;let i=e[n],a=(e[n].x+i.metrics.advance*i.scale)*r;for(let r=t;r<=n;r++)e[r].x-=a}function cf(e,t,n){let{horizontalAlign:r,verticalAlign:i}=ef(n),a=t[0]-e.displaySize[0]*r,o=t[1]-e.displaySize[1]*i;return{image:e,top:o,bottom:o+e.displaySize[1],left:a,right:a+e.displaySize[0]}}function lf(e){let t=e.left,n=e.top,r=e.right-t,i=e.bottom-n,a=e.image.textFitWidth??`stretchOrShrink`,o=e.image.textFitHeight??`stretchOrShrink`,s=(e.image.content[2]-e.image.content[0])/(e.image.content[3]-e.image.content[1]);if(o===`proportional`){if(a===`stretchOnly`&&r/i<s||a===`proportional`){let e=Math.ceil(i*s);t*=e/r,r=e}}else if(a===`proportional`&&o===`stretchOnly`&&s!==0&&r/i>s){let e=Math.ceil(r/s);n*=e/i,i=e}return{x1:t,y1:n,x2:t+r,y2:n+i}}function uf(e,t,n,r,i,a){let o=e.image,s;if(o.content){let e=o.content,t=o.pixelRatio||1;s=[e[0]/t,e[1]/t,o.displaySize[0]-e[2]/t,o.displaySize[1]-e[3]/t]}let c=t.left*a,l=t.right*a,u,d,f,p;n===`width`||n===`both`?(p=i[0]+c-r[3],d=i[0]+l+r[1]):(p=i[0]+(c+l-o.displaySize[0])/2,d=p+o.displaySize[0]);let m=t.top*a,h=t.bottom*a;return n===`height`||n===`both`?(u=i[1]+m-r[0],f=i[1]+h+r[2]):(u=i[1]+(m+h-o.displaySize[1])/2,f=u+o.displaySize[1]),{image:o,top:u,right:d,bottom:f,left:p,collisionPadding:s}}Y(`ImagePosition`,Xd),Y(`ImageAtlas`,Zd),e.ax=void 0,(Qd=e.ax||={})[Qd.none=0]=`none`,Qd[Qd.horizontal=1]=`horizontal`,Qd[Qd.vertical=2]=`vertical`,Qd[Qd.horizontalOnly=3]=`horizontalOnly`;let df=32640;function ff(e,t){let{expression:n}=t;if(n.kind===`constant`)return{kind:`constant`,layoutSize:n.evaluate(new Ia(e+1))};if(n.kind===`source`)return{kind:`source`};{let{zoomStops:t,interpolationType:r}=n,i=0;for(;i<t.length&&t[i]<=e;)i++;i=Math.max(0,i-1);let a=i;for(;a<t.length&&t[a]<e+1;)a++;a=Math.min(t.length-1,a);let o=t[i],s=t[a];return n.kind===`composite`?{kind:`composite`,minZoom:o,maxZoom:s,interpolationType:r}:{kind:`camera`,minZoom:o,maxZoom:s,minSize:n.evaluate(new Ia(o)),maxSize:n.evaluate(new Ia(s)),interpolationType:r}}}function pf(e,t,n){let r=`never`,i=e.get(t);return i?r=i:e.get(n)&&(r=`always`),r}let mf=[{name:`a_fade_opacity`,components:1,type:`Uint8`,offset:0}];function hf(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=s?Math.min(df,Math.round(s[0])):0,m=s?Math.min(df,Math.round(s[1])):0;e.emplaceBack(t,n,Math.round(32*r),Math.round(32*i),a,o,(p<<1)+ +!!c,m,16*l,16*u,256*d,256*f)}function gf(e,t,n){e.emplaceBack(t.x,t.y,n),e.emplaceBack(t.x,t.y,n),e.emplaceBack(t.x,t.y,n),e.emplaceBack(t.x,t.y,n)}function _f(e){for(let t of e.sections)if(Pa(t.text))return!0;return!1}class vf{constructor(e){this.layoutVertexArray=new $o,this.indexArray=new is,this.programConfigurations=e,this.segments=new ss,this.dynamicLayoutVertexArray=new es,this.opacityVertexArray=new ts,this.hasVisibleVertices=!1,this.placedSymbolArray=new Io}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,t,n,r){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,md.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,hd.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,mf,!0),this.opacityVertexBuffer.itemSize=1),(n||r)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Y(`SymbolBuffers`,vf);class yf{constructor(e,t,n){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new n,this.segments=new ss,this.collisionVertexArray=new rs}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,gd.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Y(`CollisionBuffers`,yf);class bf{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ff(this.zoom,n[`text-size`]),this.iconSizeData=ff(this.zoom,n[`icon-size`]);let r=this.layers[0].layout,i=r.get(`symbol-sort-key`),a=r.get(`symbol-z-order`);this.canOverlap=pf(r,`text-overlap`,`text-allow-overlap`)!==`never`||pf(r,`icon-overlap`,`icon-allow-overlap`)!==`never`||r.get(`text-ignore-placement`)||r.get(`icon-ignore-placement`),this.sortFeaturesByKey=a!==`viewport-y`&&!i.isConstant(),this.sortFeaturesByY=(a===`viewport-y`||a===`auto`&&!this.sortFeaturesByKey)&&this.canOverlap,r.get(`symbol-placement`)===`point`&&(this.writingModes=r.get(`text-writing-mode`).map((t=>e.ax[t]))),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=t.sourceID}createArrays(){this.text=new vf(new Is(this.layers,this.zoom,(e=>e.startsWith(`text`)))),this.icon=new vf(new Is(this.layers,this.zoom,(e=>e.startsWith(`icon`)))),this.glyphOffsetArray=new zo,this.lineVertexArray=new Bo,this.symbolInstances=new Ro,this.textAnchorOffsets=new Ho}calculateGlyphDependencies(e,t,n,r,i){for(let a of e)if(t[a.codePointAt(0)]=!0,(n||r)&&i){let e=Sd[a];e&&(t[e.codePointAt(0)]=!0)}}populate(t,n,r){let i=this.layers[0],a=i.layout,o=a.get(`text-font`),s=a.get(`text-field`),c=a.get(`icon-image`),l=(s.value.kind!==`constant`||s.value.value instanceof Ht&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(o.value.kind!==`constant`||o.value.value.length>0),u=c.value.kind!==`constant`||!!c.value.value||Object.keys(c.parameters).length>0,d=a.get(`symbol-sort-key`);if(this.features=[],!l&&!u)return;let f=n.iconDependencies,p=n.glyphDependencies,m=n.availableImages,h=new Ia(this.zoom);for(let{feature:n,id:s,index:c,sourceLayerIndex:g}of t){let t=i._featureFilter.needGeometry,_=Hs(n,t);if(!i._featureFilter.filter(h,_,r))continue;let v,y;if(t||(_.geometry=Vs(n)),l){let e=i.getValueAndResolveTokens(`text-field`,_,r,m),t=Ht.factory(e),n=this.hasRTLText=this.hasRTLText||_f(t);(!n||Fa.getRTLTextPluginStatus()===`unavailable`||n&&Fa.isParsed())&&(v=bd(t,i,_))}if(u){let e=i.getValueAndResolveTokens(`icon-image`,_,r,m);y=e instanceof Yt?e:Yt.fromString(e)}if(!v&&!y)continue;let b=this.sortFeaturesByKey?d.evaluate(_,{},r):void 0;if(this.features.push({id:s,text:v,icon:y,index:c,sourceLayerIndex:g,geometry:_.geometry,properties:n.properties,type:jl.types[n.type],sortKey:b}),y&&(f[y.name]=!0),v){let t=o.evaluate(_,{},r).join(`,`),n=a.get(`text-rotation-alignment`)!==`viewport`&&a.get(`symbol-placement`)!==`point`;this.allowVerticalPlacement=this.writingModes?.includes(e.ax.vertical);for(let e of v.sections)if(e.image)f[e.image.name]=!0;else{let r=Ta(v.toString()),i=e.fontStack||t,a=p[i]=p[i]||{};this.calculateGlyphDependencies(e.text,a,n,this.allowVerticalPlacement,r)}}}a.get(`symbol-placement`)===`line`&&(this.features=function(e){let t={},n={},r=[],i=0;function a(t){r.push(e[t]),i++}function o(e,t,i){let a=n[e];return delete n[e],n[t]=a,r[a].geometry[0].pop(),r[a].geometry[0]=r[a].geometry[0].concat(i[0]),a}function s(e,n,i){let a=t[n];return delete t[n],t[e]=a,r[a].geometry[0].shift(),r[a].geometry[0]=i[0].concat(r[a].geometry[0]),a}function c(e,t,n){let r=n?t[0][t[0].length-1]:t[0][0];return`${e}:${r.x}:${r.y}`}for(let l=0;l<e.length;l++){let u=e[l],d=u.geometry,f=u.text?u.text.toString():null;if(!f){a(l);continue}let p=c(f,d),m=c(f,d,!0);if(p in n&&m in t&&n[p]!==t[m]){let e=s(p,m,d),i=o(p,m,r[e].geometry);delete t[p],delete n[m],n[c(f,r[i].geometry,!0)]=i,r[e].geometry=null}else p in n?o(p,m,d):m in t?s(p,m,d):(a(l),t[p]=i-1,n[m]=i-1)}return r.filter((e=>e.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:n}),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:n}))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){let n=this.lineVertexArray.length;if(e.segment!==void 0){let n=e.dist(t[e.segment+1]),r=e.dist(t[e.segment]),i={};for(let r=e.segment+1;r<t.length;r++)i[r]={x:t[r].x,y:t[r].y,tileUnitDistanceFromAnchor:n},r<t.length-1&&(n+=t[r+1].dist(t[r]));for(let n=e.segment||0;n>=0;n--)i[n]={x:t[n].x,y:t[n].y,tileUnitDistanceFromAnchor:r},n>0&&(r+=t[n-1].dist(t[n]));for(let e=0;e<t.length;e++){let t=i[e];this.lineVertexArray.emplaceBack(t.x,t.y,t.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(t,n,r,i,a,o,s,c,l,u,d,f){let p=t.indexArray,m=t.layoutVertexArray,h=t.segments.prepareSegment(4*n.length,m,p,this.canOverlap?o.sortKey:void 0),g=this.glyphOffsetArray.length,_=h.vertexLength,v=this.allowVerticalPlacement&&s===e.ax.vertical?Math.PI/2:0,y=o.text&&o.text.sections;for(let e=0;e<n.length;e++){let{tl:i,tr:a,bl:s,br:l,tex:u,pixelOffsetTL:d,pixelOffsetBR:g,minFontScaleX:_,minFontScaleY:b,glyphOffset:x,isSDF:S,sectionIndex:C}=n[e],w=h.vertexLength,T=x[1];hf(m,c.x,c.y,i.x,T+i.y,u.x,u.y,r,S,d.x,d.y,_,b),hf(m,c.x,c.y,a.x,T+a.y,u.x+u.w,u.y,r,S,g.x,d.y,_,b),hf(m,c.x,c.y,s.x,T+s.y,u.x,u.y+u.h,r,S,d.x,g.y,_,b),hf(m,c.x,c.y,l.x,T+l.y,u.x+u.w,u.y+u.h,r,S,g.x,g.y,_,b),gf(t.dynamicLayoutVertexArray,c,v),p.emplaceBack(w,w+2,w+1),p.emplaceBack(w+1,w+2,w+3),h.vertexLength+=4,h.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(x[0]),e!==n.length-1&&C===n[e+1].sectionIndex||t.programConfigurations.populatePaintArrays(m.length,o,o.index,{imagePositions:{},canonical:f,formattedSection:y?.[C]})}t.placedSymbolArray.emplaceBack(c.x,c.y,g,this.glyphOffsetArray.length-g,_,l,u,c.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],s,0,!1,0,d)}_addCollisionDebugVertex(e,t,n,r,i,a){return t.emplaceBack(0,0),e.emplaceBack(n.x,n.y,r,i,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,t,r,i,a,o,s){let c=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),l=c.vertexLength,u=a.layoutVertexArray,d=a.collisionVertexArray,f=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,d,o,f,p,new n(e,t)),this._addCollisionDebugVertex(u,d,o,f,p,new n(r,t)),this._addCollisionDebugVertex(u,d,o,f,p,new n(r,i)),this._addCollisionDebugVertex(u,d,o,f,p,new n(e,i)),c.vertexLength+=4;let m=a.indexArray;m.emplaceBack(l,l+1),m.emplaceBack(l+1,l+2),m.emplaceBack(l+2,l+3),m.emplaceBack(l+3,l),c.primitiveLength+=4}addDebugCollisionBoxes(e,t,n,r){for(let i=e;i<t;i++){let e=this.collisionBoxArray.get(i);this.addCollisionDebugVertices(e.x1,e.y1,e.x2,e.y2,r?this.textCollisionBox:this.iconCollisionBox,e.anchorPoint,n)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new yf(ns,_d.members,as),this.iconCollisionBox=new yf(ns,_d.members,as);for(let e=0;e<this.symbolInstances.length;e++){let t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,n,r,i,a,o,s,c){let l={};for(let r=t;r<n;r++){let t=e.get(r);l.textBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},l.textFeatureIndex=t.featureIndex;break}for(let t=r;t<i;t++){let n=e.get(t);l.verticalTextBox={x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,anchorPointX:n.anchorPointX,anchorPointY:n.anchorPointY},l.verticalTextFeatureIndex=n.featureIndex;break}for(let t=a;t<o;t++){let n=e.get(t);l.iconBox={x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,anchorPointX:n.anchorPointX,anchorPointY:n.anchorPointY},l.iconFeatureIndex=n.featureIndex;break}for(let t=s;t<c;t++){let n=e.get(t);l.verticalIconBox={x1:n.x1,y1:n.y1,x2:n.x2,y2:n.y2,anchorPointX:n.anchorPointX,anchorPointY:n.anchorPointY},l.verticalIconFeatureIndex=n.featureIndex;break}return l}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){let n=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.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(e,t){let n=e.placedSymbolArray.get(t),r=n.vertexStartIndex+4*n.numGlyphs;for(let t=n.vertexStartIndex;t<r;t+=4)e.indexArray.emplaceBack(t,t+2,t+1),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let t=Math.sin(e),n=Math.cos(e),r=[],i=[],a=[];for(let e=0;e<this.symbolInstances.length;++e){a.push(e);let o=this.symbolInstances.get(e);r.push(0|Math.round(t*o.anchorX+n*o.anchorY)),i.push(o.featureIndex)}return a.sort(((e,t)=>r[e]-r[t]||i[t]-i[e])),a}addToSortKeyRanges(e,t){let n=this.sortKeyRanges[this.sortKeyRanges.length-1];n?.sortKey===t?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex);let n=[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex];for(let e=0;e<n.length;e++){let t=n[e];t>=0&&n.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)}t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let xf,Sf;Y(`SymbolBucket`,bf,{omit:[`layers`,`collisionBoxArray`,`features`,`compareText`]}),bf.MAX_GLYPHS=65535,bf.addDynamicAttributes=gf;var Cf={get paint(){return Sf||=new Xa({"icon-opacity":new Z(P.paint_symbol[`icon-opacity`]),"icon-color":new Z(P.paint_symbol[`icon-color`]),"icon-halo-color":new Z(P.paint_symbol[`icon-halo-color`]),"icon-halo-width":new Z(P.paint_symbol[`icon-halo-width`]),"icon-halo-blur":new Z(P.paint_symbol[`icon-halo-blur`]),"icon-translate":new X(P.paint_symbol[`icon-translate`]),"icon-translate-anchor":new X(P.paint_symbol[`icon-translate-anchor`]),"text-opacity":new Z(P.paint_symbol[`text-opacity`]),"text-color":new Z(P.paint_symbol[`text-color`],{runtimeType:et,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Z(P.paint_symbol[`text-halo-color`]),"text-halo-width":new Z(P.paint_symbol[`text-halo-width`]),"text-halo-blur":new Z(P.paint_symbol[`text-halo-blur`]),"text-translate":new X(P.paint_symbol[`text-translate`]),"text-translate-anchor":new X(P.paint_symbol[`text-translate-anchor`])})},get layout(){return xf||=new Xa({"symbol-placement":new X(P.layout_symbol[`symbol-placement`]),"symbol-spacing":new X(P.layout_symbol[`symbol-spacing`]),"symbol-avoid-edges":new X(P.layout_symbol[`symbol-avoid-edges`]),"symbol-sort-key":new Z(P.layout_symbol[`symbol-sort-key`]),"symbol-z-order":new X(P.layout_symbol[`symbol-z-order`]),"icon-allow-overlap":new X(P.layout_symbol[`icon-allow-overlap`]),"icon-overlap":new X(P.layout_symbol[`icon-overlap`]),"icon-ignore-placement":new X(P.layout_symbol[`icon-ignore-placement`]),"icon-optional":new X(P.layout_symbol[`icon-optional`]),"icon-rotation-alignment":new X(P.layout_symbol[`icon-rotation-alignment`]),"icon-size":new Z(P.layout_symbol[`icon-size`]),"icon-text-fit":new X(P.layout_symbol[`icon-text-fit`]),"icon-text-fit-padding":new X(P.layout_symbol[`icon-text-fit-padding`]),"icon-image":new Z(P.layout_symbol[`icon-image`]),"icon-rotate":new Z(P.layout_symbol[`icon-rotate`]),"icon-padding":new Z(P.layout_symbol[`icon-padding`]),"icon-keep-upright":new X(P.layout_symbol[`icon-keep-upright`]),"icon-offset":new Z(P.layout_symbol[`icon-offset`]),"icon-anchor":new Z(P.layout_symbol[`icon-anchor`]),"icon-pitch-alignment":new X(P.layout_symbol[`icon-pitch-alignment`]),"text-pitch-alignment":new X(P.layout_symbol[`text-pitch-alignment`]),"text-rotation-alignment":new X(P.layout_symbol[`text-rotation-alignment`]),"text-field":new Z(P.layout_symbol[`text-field`]),"text-font":new Z(P.layout_symbol[`text-font`]),"text-size":new Z(P.layout_symbol[`text-size`]),"text-max-width":new Z(P.layout_symbol[`text-max-width`]),"text-line-height":new X(P.layout_symbol[`text-line-height`]),"text-letter-spacing":new Z(P.layout_symbol[`text-letter-spacing`]),"text-justify":new Z(P.layout_symbol[`text-justify`]),"text-radial-offset":new Z(P.layout_symbol[`text-radial-offset`]),"text-variable-anchor":new X(P.layout_symbol[`text-variable-anchor`]),"text-variable-anchor-offset":new Z(P.layout_symbol[`text-variable-anchor-offset`]),"text-anchor":new Z(P.layout_symbol[`text-anchor`]),"text-max-angle":new X(P.layout_symbol[`text-max-angle`]),"text-writing-mode":new X(P.layout_symbol[`text-writing-mode`]),"text-rotate":new Z(P.layout_symbol[`text-rotate`]),"text-padding":new X(P.layout_symbol[`text-padding`]),"text-keep-upright":new X(P.layout_symbol[`text-keep-upright`]),"text-transform":new Z(P.layout_symbol[`text-transform`]),"text-offset":new Z(P.layout_symbol[`text-offset`]),"text-allow-overlap":new X(P.layout_symbol[`text-allow-overlap`]),"text-overlap":new X(P.layout_symbol[`text-overlap`]),"text-ignore-placement":new X(P.layout_symbol[`text-ignore-placement`]),"text-optional":new X(P.layout_symbol[`text-optional`])})}};class wf{constructor(e){if(e.property.overrides===void 0)throw Error(`overrides must be provided to instantiate FormatSectionOverride class`);this.type=e.property.overrides?e.property.overrides.runtimeType:$e,this.defaultValue=e}evaluate(e){if(e.formattedSection){let t=this.defaultValue.property.overrides;if(t?.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Y(`FormatSectionOverride`,wf,{omit:[`defaultValue`]});class Tf extends $a{constructor(e,t){super(e,Cf,t)}recalculate(e,t){if(super.recalculate(e,t),this.layout.get(`icon-rotation-alignment`)===`auto`&&(this.layout._values[`icon-rotation-alignment`]=this.layout.get(`symbol-placement`)===`point`?`viewport`:`map`),this.layout.get(`text-rotation-alignment`)===`auto`&&(this.layout._values[`text-rotation-alignment`]=this.layout.get(`symbol-placement`)===`point`?`viewport`:`map`),this.layout.get(`text-pitch-alignment`)===`auto`&&(this.layout._values[`text-pitch-alignment`]=this.layout.get(`text-rotation-alignment`)===`map`?`map`:`viewport`),this.layout.get(`icon-pitch-alignment`)===`auto`&&(this.layout._values[`icon-pitch-alignment`]=this.layout.get(`icon-rotation-alignment`)),this.layout.get(`symbol-placement`)===`point`){let e=this.layout.get(`text-writing-mode`);if(e){let t=[];for(let n of e)t.includes(n)||t.push(n);this.layout._values[`text-writing-mode`]=t}else this.layout._values[`text-writing-mode`]=[`horizontal`]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,n,r){let i=this.layout.get(e).evaluate(t,{},n,r),a=this._unevaluatedLayout._values[e];return a.isDataDriven()||oi(a.value)||!i?i:function(e,t){return t.replace(/{([^{}]+)}/g,((t,n)=>e&&n in e?String(e[n]):``))}(t.properties,i)}createBucket(e){return new bf(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error(`Should take a different path in FeatureIndex`)}_setPaintOverrides(){for(let e of Cf.paint.overridableProperties){if(!Tf.hasPaintOverride(this.layout,e))continue;let t=this.paint.get(e),n=new ai(new wf(t),t.property.specification),r=null;r=t.value.kind===`constant`||t.value.kind===`source`?new ci(`source`,n):new li(`composite`,n,t.value.zoomStops),this.paint._values[e]=new Ga(t.property,r,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,n){return!(!this.layout||t.isDataDriven()||n.isDataDriven())&&Tf.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){let n=e.get(`text-field`),r=Cf.paint.properties[t],i=!1,a=e=>{for(let t of e)if(r.overrides?.hasOverride(t))return void(i=!0)};if(n.value.kind===`constant`&&n.value.value instanceof Ht)a(n.value.value.sections);else if(n.value.kind===`source`||n.value.kind===`composite`){let e=t=>{i||(t instanceof tn&&$t(t.value)===it?a(t.value.sections):t instanceof Fn?a(t.sections):t.eachChild(e))},t=n.value;t._styleExpression&&e(t._styleExpression.expression)}return i}}let Ef;var Df={get paint(){return Ef||=new Xa({"background-color":new X(P.paint_background[`background-color`]),"background-pattern":new Ja(P.paint_background[`background-pattern`]),"background-opacity":new X(P.paint_background[`background-opacity`])})}};class Of extends $a{constructor(e,t){super(e,Df,t)}}class kf extends $a{constructor(e,t){super(e,{},t),this.onAdd=e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},this.onRemove=e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode===`3d`}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error(`Custom layers cannot be serialized`)}}class Af{constructor(e){this._methodToThrottle=e,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){var e;this._triggered||(this._triggered=!0,(e=this._channel)==null||e.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let jf={once:!0},Mf=6371008.8;class Nf{constructor(e,t){if(isNaN(e)||isNaN(t))throw Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw Error(`Invalid LngLat latitude value: must be between -90 and 90`)}wrap(){return new Nf(re(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let t=Math.PI/180,n=this.lat*t,r=e.lat*t,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((e.lng-this.lng)*t);return Mf*Math.acos(Math.min(i,1))}static convert(e){if(e instanceof Nf)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Nf(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e==`object`&&e)return new Nf(Number(`lng`in e?e.lng:e.lon),Number(e.lat));throw Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}let Pf=2*Math.PI*Mf;function Ff(e){return Pf*Math.cos(e*Math.PI/180)}function If(e){return(180+e)/360}function Lf(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Rf(e,t){return e/Ff(t)}function zf(e){return 360*e-180}function Bf(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function Vf(e,t){return e*Ff(Bf(t))}class Hf{constructor(e,t,n=0){this.x=+e,this.y=+t,this.z=+n}static fromLngLat(e,t=0){let n=Nf.convert(e);return new Hf(If(n.lng),Lf(n.lat),Rf(t,n.lat))}toLngLat(){return new Nf(zf(this.x),Bf(this.y))}toAltitude(){return Vf(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Pf*(e=Bf(this.y),1/Math.cos(e*Math.PI/180));var e}}function Uf(e,t,n){var r=2*Math.PI*6378137/256/2**n;return[e*r-2*Math.PI*6378137/2,t*r-2*Math.PI*6378137/2]}class Wf{constructor(e,t,n){if(!function(e,t,n){return!(e<0||e>25||n<0||n>=2**e||t<0||t>=2**e)}(e,t,n))throw Error(`x=${t}, y=${n}, z=${e} outside of bounds. 0<=x<${2**e}, 0<=y<${2**e} 0<=z<=25 `);this.z=e,this.x=t,this.y=n,this.key=qf(0,e,e,t,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,n){let r=(a=this.y,o=this.z,s=Uf(256*(i=this.x),256*(a=2**o-a-1),o),c=Uf(256*(i+1),256*(a+1),o),s[0]+`,`+s[1]+`,`+c[0]+`,`+c[1]);var i,a,o,s,c;let l=function(e,t,n){let r=``;for(let i=e;i>0;i--){let e=1<<i-1;r+=(t&e?1:0)+(n&e?2:0)}return r}(this.z,this.x,this.y);return e[(this.x+this.y)%e.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(n===`tms`?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,t>1?`@2x`:``).replace(/{quadkey}/g,l).replace(/{bbox-epsg-3857}/g,r)}isChildOf(e){let t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){let t=2**this.z;return new n((e.x*t-this.x)*O,(e.y*t-this.y)*O)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Gf{constructor(e,t){this.wrap=e,this.canonical=t,this.key=qf(e,t.z,t.z,t.x,t.y)}}class Kf{constructor(e,t,n,r,i){if(this.terrainRttPosMatrix32f=null,e<n)throw Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${n}`);this.overscaledZ=e,this.wrap=t,this.canonical=new Wf(n,+r,+i),this.key=qf(t,e,n,r,i)}clone(){return new Kf(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let t=this.canonical.z-e;return e>this.canonical.z?new Kf(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Kf(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,t){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let n=this.canonical.z-e;return e>this.canonical.z?qf(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):qf(this.wrap*+t,e,e,this.canonical.x>>n,this.canonical.y>>n)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(e.overscaledZ===0)return this.overscaledZ>0;let t=this.canonical.z-e.canonical.z;return!(t<0)&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new Kf(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let t=this.canonical.z+1,n=2*this.canonical.x,r=2*this.canonical.y;return[new Kf(t,this.wrap,t,n,r),new Kf(t,this.wrap,t,n+1,r),new Kf(t,this.wrap,t,n,r+1),new Kf(t,this.wrap,t,n+1,r+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new Kf(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Kf(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return 2**(this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Gf(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Hf(e.x-this.wrap,e.y))}normalizeCoordinates(e,t,n=8192){if(e>=0&&e<n&&t>=0&&t<n)return{tileID:this,x:e,y:t};let r=Math.floor(e/n),i=Math.floor(t/n),a=e-r*n,o=t-i*n,s=this.canonical.z,c=1<<s,l=this.canonical.y+i;if(l<0||l>=c)return null;let u=this.canonical.x+r,d=this.wrap;return u<0?(d-=Math.ceil(-u/c),u=(u%c+c)%c):u>=c&&(d+=Math.floor(u/c),u%=c),{tileID:new Kf(this.overscaledZ,d,s,u,l),x:a,y:o}}}function qf(e,t,n,r,i){(e*=2)<0&&(e=-1*e-1);let a=1<<n;return(a*a*e+a*i+r).toString(36)+n.toString(36)+t.toString(36)}Y(`CanonicalTileID`,Wf),Y(`OverscaledTileID`,Kf,{omit:[`terrainRttPosMatrix32f`]});class Jf{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(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(e){return this.expandBy(-e)}map(e){let t=new Jf;return t.extend(e(new n(this.minX,this.minY))),t.extend(e(new n(this.maxX,this.minY))),t.extend(e(new n(this.minX,this.maxY))),t.extend(e(new n(this.maxX,this.maxY))),t}static fromPoints(e){let t=new Jf;for(let n of e)t.extend(n);return t}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}}class Yf{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){let n=e[t];this._stringToNumber[n]=t,this._numberToString[t]=n}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Xf{constructor(e,t,n,r,i){this.type=`Feature`,this._vectorTileFeature=e,this._x=n,this._y=r,this._z=t,this.properties=e.properties,this.id=i}projectPoint(e,t,n,r){return[360*(e.x+t)/r-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+n)/r)*Math.PI))-90]}projectLine(e,t,n,r){return e.map((e=>this.projectPoint(e,t,n,r)))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,t=e.extent*2**this._z,n=e.extent*this._x,r=e.extent*this._y,i=e.loadGeometry();switch(e.type){case 1:{let e=[];for(let t of i)e.push(t[0]);let a=this.projectLine(e,n,r,t);this._geometry=e.length===1?{type:`Point`,coordinates:a[0]}:{type:`MultiPoint`,coordinates:a};break}case 2:{let e=i.map((e=>this.projectLine(e,n,r,t)));this._geometry=e.length===1?{type:`LineString`,coordinates:e[0]}:{type:`MultiLineString`,coordinates:e};break}case 3:{let e=Nl(i),a=[];for(let i of e)a.push(i.map((e=>this.projectLine(e,n,r,t))));this._geometry=a.length===1?{type:`Polygon`,coordinates:a[0]}:{type:`MultiPolygon`,coordinates:a};break}default:throw Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let t in this)t!==`_geometry`&&t!==`_vectorTileFeature`&&t!==`_x`&&t!==`_y`&&t!==`_z`&&(e[t]=this[t]);return e}}class Zf{constructor(e,t,n){this._name=e,this.dataBuffer=t,typeof n==`number`?this._size=n:(this.nullabilityBuffer=n,this._size=n.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){return this.nullabilityBuffer?.get(e)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class Qf extends Zf{}class $f extends Qf{getValueFromBuffer(e){return this.dataBuffer[e]}}class ep extends Qf{getValueFromBuffer(e){return this.dataBuffer[e]}}class tp extends Zf{constructor(e,t,n,r){super(e,t,r),this.delta=n}}class np extends tp{constructor(e,t,n,r){super(e,Int32Array.of(t),n,r)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}}class rp extends Zf{constructor(e,t,n,r){super(e,r?Int32Array.of(t):Uint32Array.of(t),n)}getValueFromBuffer(e){return this.dataBuffer[0]}}class ip{constructor(e,t,n,r,i=4096){this._name=e,this._geometryVector=t,this._idVector=n,this._propertyVectors=r,this._extent=i}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(e){return this.propertyVectorsMap||=new Map(this._propertyVectors.map((e=>[e.name,e]))),this.propertyVectorsMap.get(e)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let e=[],t=this.geometryVector.getGeometries();for(let n=0;n<this.numFeatures;n++){let r;if(this.idVector){let e=this.idVector.getValue(n);r=this.containsMaxSafeIntegerValues(this.idVector)&&e!==null?Number(e):e}let i={coordinates:t[n],type:this.geometryVector.geometryType(n)},a={};for(let e of this.propertyVectors){if(!e)continue;let t=e.name,r=e.getValue(n);r!==null&&(a[t]=r)}e.push({id:r,geometry:i,properties:a})}return e}containsMaxSafeIntegerValues(e){return e instanceof $f||e instanceof rp||e instanceof np||e instanceof ep}}class ap{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}}var Q,op;(function(e){e.NONE=`NONE`,e.DELTA=`DELTA`,e.COMPONENTWISE_DELTA=`COMPONENTWISE_DELTA`,e.RLE=`RLE`,e.MORTON=`MORTON`,e.PDE=`PDE`})(Q||={}),function(e){e.NONE=`NONE`,e.FAST_PFOR=`FAST_PFOR`,e.VARINT=`VARINT`,e.ALP=`ALP`}(op||={});let sp=new Uint32Array(33);sp[0]=0;for(let e=1;e<=32;e++)sp[e]=e===32?4294967295:4294967295>>>32-e;let cp=sp;function lp(e,t){return e-e%t}function up(e){let t=e>>>0;return((255&t)<<24|(65280&t)<<8|t>>>8&65280|t>>>24&255)>>>0}let dp=function(){let e=lp(65536,256);return e===0?256:e}(),fp=3*dp/256+dp|0;function pp(){let e=new Uint8Array(fp);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:e,byteContainerI32:new Int32Array(e.buffer,e.byteOffset,e.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function mp(e,t,n,r,i){switch(i){case 1:(function(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0;n[i++]=t>>>0&1,n[i++]=t>>>1&1,n[i++]=t>>>2&1,n[i++]=t>>>3&1,n[i++]=t>>>4&1,n[i++]=t>>>5&1,n[i++]=t>>>6&1,n[i++]=t>>>7&1,n[i++]=t>>>8&1,n[i++]=t>>>9&1,n[i++]=t>>>10&1,n[i++]=t>>>11&1,n[i++]=t>>>12&1,n[i++]=t>>>13&1,n[i++]=t>>>14&1,n[i++]=t>>>15&1,n[i++]=t>>>16&1,n[i++]=t>>>17&1,n[i++]=t>>>18&1,n[i++]=t>>>19&1,n[i++]=t>>>20&1,n[i++]=t>>>21&1,n[i++]=t>>>22&1,n[i++]=t>>>23&1,n[i++]=t>>>24&1,n[i++]=t>>>25&1,n[i++]=t>>>26&1,n[i++]=t>>>27&1,n[i++]=t>>>28&1,n[i++]=t>>>29&1,n[i++]=t>>>30&1,n[i++]=t>>>31&1}})(e,t,n,r);break;case 2:(function(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,r=e[a++]>>>0;n[i++]=t>>>0&3,n[i++]=t>>>2&3,n[i++]=t>>>4&3,n[i++]=t>>>6&3,n[i++]=t>>>8&3,n[i++]=t>>>10&3,n[i++]=t>>>12&3,n[i++]=t>>>14&3,n[i++]=t>>>16&3,n[i++]=t>>>18&3,n[i++]=t>>>20&3,n[i++]=t>>>22&3,n[i++]=t>>>24&3,n[i++]=t>>>26&3,n[i++]=t>>>28&3,n[i++]=t>>>30&3,n[i++]=r>>>0&3,n[i++]=r>>>2&3,n[i++]=r>>>4&3,n[i++]=r>>>6&3,n[i++]=r>>>8&3,n[i++]=r>>>10&3,n[i++]=r>>>12&3,n[i++]=r>>>14&3,n[i++]=r>>>16&3,n[i++]=r>>>18&3,n[i++]=r>>>20&3,n[i++]=r>>>22&3,n[i++]=r>>>24&3,n[i++]=r>>>26&3,n[i++]=r>>>28&3,n[i++]=r>>>30&3}})(e,t,n,r);break;case 3:(function(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,r=e[a++]>>>0,o=e[a++]>>>0;n[i++]=t>>>0&7,n[i++]=t>>>3&7,n[i++]=t>>>6&7,n[i++]=t>>>9&7,n[i++]=t>>>12&7,n[i++]=t>>>15&7,n[i++]=t>>>18&7,n[i++]=t>>>21&7,n[i++]=t>>>24&7,n[i++]=t>>>27&7,n[i++]=7&(t>>>30|(1&r)<<2),n[i++]=r>>>1&7,n[i++]=r>>>4&7,n[i++]=r>>>7&7,n[i++]=r>>>10&7,n[i++]=r>>>13&7,n[i++]=r>>>16&7,n[i++]=r>>>19&7,n[i++]=r>>>22&7,n[i++]=r>>>25&7,n[i++]=r>>>28&7,n[i++]=7&(r>>>31|(3&o)<<1),n[i++]=o>>>2&7,n[i++]=o>>>5&7,n[i++]=o>>>8&7,n[i++]=o>>>11&7,n[i++]=o>>>14&7,n[i++]=o>>>17&7,n[i++]=o>>>20&7,n[i++]=o>>>23&7,n[i++]=o>>>26&7,n[i++]=o>>>29&7}})(e,t,n,r);break;case 4:(function(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,r=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0;n[i++]=t>>>0&15,n[i++]=t>>>4&15,n[i++]=t>>>8&15,n[i++]=t>>>12&15,n[i++]=t>>>16&15,n[i++]=t>>>20&15,n[i++]=t>>>24&15,n[i++]=t>>>28&15,n[i++]=r>>>0&15,n[i++]=r>>>4&15,n[i++]=r>>>8&15,n[i++]=r>>>12&15,n[i++]=r>>>16&15,n[i++]=r>>>20&15,n[i++]=r>>>24&15,n[i++]=r>>>28&15,n[i++]=o>>>0&15,n[i++]=o>>>4&15,n[i++]=o>>>8&15,n[i++]=o>>>12&15,n[i++]=o>>>16&15,n[i++]=o>>>20&15,n[i++]=o>>>24&15,n[i++]=o>>>28&15,n[i++]=s>>>0&15,n[i++]=s>>>4&15,n[i++]=s>>>8&15,n[i++]=s>>>12&15,n[i++]=s>>>16&15,n[i++]=s>>>20&15,n[i++]=s>>>24&15,n[i++]=s>>>28&15}})(e,t,n,r);break;case 5:(function(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,r=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0,c=e[a++]>>>0;n[i++]=t>>>0&31,n[i++]=t>>>5&31,n[i++]=t>>>10&31,n[i++]=t>>>15&31,n[i++]=t>>>20&31,n[i++]=t>>>25&31,n[i++]=31&(t>>>30|(7&r)<<2),n[i++]=r>>>3&31,n[i++]=r>>>8&31,n[i++]=r>>>13&31,n[i++]=r>>>18&31,n[i++]=r>>>23&31,n[i++]=31&(r>>>28|(1&o)<<4),n[i++]=o>>>1&31,n[i++]=o>>>6&31,n[i++]=o>>>11&31,n[i++]=o>>>16&31,n[i++]=o>>>21&31,n[i++]=o>>>26&31,n[i++]=31&(o>>>31|(15&s)<<1),n[i++]=s>>>4&31,n[i++]=s>>>9&31,n[i++]=s>>>14&31,n[i++]=s>>>19&31,n[i++]=s>>>24&31,n[i++]=31&(s>>>29|(3&c)<<3),n[i++]=c>>>2&31,n[i++]=c>>>7&31,n[i++]=c>>>12&31,n[i++]=c>>>17&31,n[i++]=c>>>22&31,n[i++]=c>>>27&31}})(e,t,n,r);break;case 6:(function(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,r=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0,c=e[a++]>>>0,l=e[a++]>>>0;n[i++]=t>>>0&63,n[i++]=t>>>6&63,n[i++]=t>>>12&63,n[i++]=t>>>18&63,n[i++]=t>>>24&63,n[i++]=63&(t>>>30|(15&r)<<2),n[i++]=r>>>4&63,n[i++]=r>>>10&63,n[i++]=r>>>16&63,n[i++]=r>>>22&63,n[i++]=63&(r>>>28|(3&o)<<4),n[i++]=o>>>2&63,n[i++]=o>>>8&63,n[i++]=o>>>14&63,n[i++]=o>>>20&63,n[i++]=o>>>26&63,n[i++]=s>>>0&63,n[i++]=s>>>6&63,n[i++]=s>>>12&63,n[i++]=s>>>18&63,n[i++]=s>>>24&63,n[i++]=63&(s>>>30|(15&c)<<2),n[i++]=c>>>4&63,n[i++]=c>>>10&63,n[i++]=c>>>16&63,n[i++]=c>>>22&63,n[i++]=63&(c>>>28|(3&l)<<4),n[i++]=l>>>2&63,n[i++]=l>>>8&63,n[i++]=l>>>14&63,n[i++]=l>>>20&63,n[i++]=l>>>26&63}})(e,t,n,r);break;case 7:(function(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,r=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0,c=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0;n[i++]=t>>>0&127,n[i++]=t>>>7&127,n[i++]=t>>>14&127,n[i++]=t>>>21&127,n[i++]=127&(t>>>28|(7&r)<<4),n[i++]=r>>>3&127,n[i++]=r>>>10&127,n[i++]=r>>>17&127,n[i++]=r>>>24&127,n[i++]=127&(r>>>31|(63&o)<<1),n[i++]=o>>>6&127,n[i++]=o>>>13&127,n[i++]=o>>>20&127,n[i++]=127&(o>>>27|(3&s)<<5),n[i++]=s>>>2&127,n[i++]=s>>>9&127,n[i++]=s>>>16&127,n[i++]=s>>>23&127,n[i++]=127&(s>>>30|(31&c)<<2),n[i++]=c>>>5&127,n[i++]=c>>>12&127,n[i++]=c>>>19&127,n[i++]=127&(c>>>26|(1&l)<<6),n[i++]=l>>>1&127,n[i++]=l>>>8&127,n[i++]=l>>>15&127,n[i++]=l>>>22&127,n[i++]=127&(l>>>29|(15&u)<<3),n[i++]=u>>>4&127,n[i++]=u>>>11&127,n[i++]=u>>>18&127,n[i++]=u>>>25&127}})(e,t,n,r);break;case 8:(function(e,t,n,r){let i=r,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,r=e[a++]>>>0,o=e[a++]>>>0,s=e[a++]>>>0,c=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,d=e[a++]>>>0;n[i++]=t>>>0&255,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=r>>>0&255,n[i++]=r>>>8&255,n[i++]=r>>>16&255,n[i++]=r>>>24&255,n[i++]=o>>>0&255,n[i++]=o>>>8&255,n[i++]=o>>>16&255,n[i++]=o>>>24&255,n[i++]=s>>>0&255,n[i++]=s>>>8&255,n[i++]=s>>>16&255,n[i++]=s>>>24&255,n[i++]=c>>>0&255,n[i++]=c>>>8&255,n[i++]=c>>>16&255,n[i++]=c>>>24&255,n[i++]=l>>>0&255,n[i++]=l>>>8&255,n[i++]=l>>>16&255,n[i++]=l>>>24&255,n[i++]=u>>>0&255,n[i++]=u>>>8&255,n[i++]=u>>>16&255,n[i++]=u>>>24&255,n[i++]=d>>>0&255,n[i++]=d>>>8&255,n[i++]=d>>>16&255,n[i++]=d>>>24&255}})(e,t,n,r);break;case 16:(function(e,t,n,r){let i=r,a=t;for(let t=0;t<128;t++){let t=e[a++]>>>0;n[i++]=65535&t,n[i++]=t>>>16&65535}})(e,t,n,r);break;default:(function(e,t,n,r,i){let a=cp[i]>>>0,o=t,s=0,c=e[o]>>>0,l=r;for(let t=0;t<8;t++){for(let t=0;t<32;t++)if(s+i<=32)n[l+t]=c>>>s&a,s+=i,s===32&&(s=0,o++,t!==31&&(c=e[o]>>>0));else{let r=32-s,u=c>>>s;o++,c=e[o]>>>0;let d=i-r;n[l+t]=(u|(c&-1>>>32-d>>>0)<<r)&a,s=d}l+=32,s=0,t<7&&(c=e[o]>>>0)}})(e,t,n,r,i)}return t+(i<<3)|0}function hp(e,t,n,r){if(n+2>t)throw Error(`FastPFOR decode: byteContainer underflow at block=${r} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${n}, byteSize=${t})`);let i=e[n++],a=e[n++];if(i>32)throw Error(`FastPFOR decode: invalid bitWidth=${i} at block=${r} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:i,exceptionCount:a,bytePosIn:n}}function gp(e,t,n,r,i,a,o,s,c){let{maxBits:l,exceptionBitWidth:u,bytePosIn:d}=function(e,t,n,r,i,a){if(n+1>t)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${n}, byteSize=${t})`);let o=e[n++];if(o<r||o>32)throw Error(`FastPFOR decode: invalid maxBits=${o} at block=${a} (bitWidth=${r}, expected ${r}..32)`);let s=o-r|0;if(s<1||s>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${s} at block=${a} (bitWidth=${r}, maxBits=${o})`);if(n+i>t)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${i}, have=${t-n})`);return{maxBits:o,exceptionBitWidth:s,bytePosIn:n}}(i,a,o,n,r,c);if(o=d,u===1){let a=1<<n;for(let n=0;n<r;n=n+1|0)e[i[o++]+t|0]|=a;return o}let f=s.dataToBePacked[u];if(!f)throw Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${u} (bitWidth=${n}, maxBits=${l}) at block ${c}`);let p=s.dataPointers,m=0|p[u],h=0|s.exceptionSizes[u];if(m+r>h)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${u} (ptr=${m}, need ${r}, size=${h}) at block ${c}`);for(let a=0;a<r;a=a+1|0){let r=i[o++],a=0|f[m++];e[r+t|0]|=a<<n}return p[u]=m,o}function _p(e,t,n,r,i,a){let o=0|n,s=0|e[o];if(s<=0||o+s>e.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${s} at pageStart=${o} (expected > 0 and pageStart+whereMeta < encoded.length=${e.length})`);let c=o+1|0,l=o+s|0,u=e[l]>>>0,d=u+3>>>2,f=l+1,p=f+d;if(p>=e.length)throw Error(`FastPFOR decode: invalid byteSize=${u} (metaInts=${d}, pageStart=${o}, packedEnd=${l}, byteContainerStart=${f}) causes bitmapPos=${p} out of bounds (encoded.length=${e.length})`);let m=function(e,t,n,r){r.byteContainer.length<n&&(r.byteContainer=new Uint8Array(2*n),r.byteContainerI32=void 0);let i=r.byteContainer,a=n>>>2;if(3&i.byteOffset)for(let n=0;n<a;n=n+1|0){let r=0|e[t+n|0],a=n<<2;i[a]=255&r,i[a+1|0]=r>>>8&255,i[a+2|0]=r>>>16&255,i[a+3|0]=r>>>24&255}else{let n=r.byteContainerI32;(!n||n.buffer!==i.buffer||n.byteOffset!==i.byteOffset||n.length<a)&&(n=r.byteContainerI32=new Int32Array(i.buffer,i.byteOffset,i.byteLength>>>2)),n.set(e.subarray(t,t+a))}let o=3&n;if(o>0){let n=0|e[t+a|0],r=a<<2;for(let e=0;e<o;e=e+1|0)i[r+e|0]=n>>>(e<<3)&255}return i}(e,f,u,a),h=u,g=function(e,t,n){let r=0|e[t++],i=n.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(r>>>a-1&1))continue;if(t>=e.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${t}, needWords=1, availableWords=${e.length-t}, encodedWords=${e.length})`);let o=e[t++]>>>0,s=lp(o+31,32),c=o*a+31>>>5;if(t+c>e.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${o}, streamWordIndex=${t}, needWords=${c}, availableWords=${e.length-t}, encodedWords=${e.length})`);let l=i[a];(!l||l.length<s)&&(l=i[a]=new Uint32Array(s));let u=0;for(;u<o;u=u+32|0)vp(e,t,l,u,a),t=t+a|0;t=t-((u-o|0)*a>>>5)|0,n.exceptionSizes[a]=o}return t}(e,p,a);return a.dataPointers.fill(0),function(e,t,n,r,i,a,o,s,c,l){let u=0|n,d=0;for(let t=0;t<o;t=t+1|0){let n=hp(s,c,d,t);d=n.bytePosIn;let r=n.bitWidth,o=n.exceptionCount,f=a+t*256|0;switch(r){case 0:i.fill(0,f,f+256);break;case 32:for(let t=0;t<256;t=t+1|0)i[f+t|0]=0|e[u+t|0];u=u+256|0;break;default:u=mp(e,u,i,f,r)}o>0&&(d=gp(i,f,r,o,s,c,d,l,t))}if(u!==r)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${t}, packedStart=${n}, consumedPackedEnd=${u}, expectedPackedEnd=${r}, packedWords=${r-n}, encoded.length=${e.length})`)}(e,o,c,l,t,0|r,i/256|0,m,h,a),g}function vp(e,t,n,r,i){switch(i){case 2:(function(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0;n[i++]=a>>>0&3,n[i++]=a>>>2&3,n[i++]=a>>>4&3,n[i++]=a>>>6&3,n[i++]=a>>>8&3,n[i++]=a>>>10&3,n[i++]=a>>>12&3,n[i++]=a>>>14&3,n[i++]=a>>>16&3,n[i++]=a>>>18&3,n[i++]=a>>>20&3,n[i++]=a>>>22&3,n[i++]=a>>>24&3,n[i++]=a>>>26&3,n[i++]=a>>>28&3,n[i++]=a>>>30&3,n[i++]=o>>>0&3,n[i++]=o>>>2&3,n[i++]=o>>>4&3,n[i++]=o>>>6&3,n[i++]=o>>>8&3,n[i++]=o>>>10&3,n[i++]=o>>>12&3,n[i++]=o>>>14&3,n[i++]=o>>>16&3,n[i++]=o>>>18&3,n[i++]=o>>>20&3,n[i++]=o>>>22&3,n[i++]=o>>>24&3,n[i++]=o>>>26&3,n[i++]=o>>>28&3,n[i]=o>>>30&3})(e,t,n,r);return;case 3:(function(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0;n[i++]=a>>>0&7,n[i++]=a>>>3&7,n[i++]=a>>>6&7,n[i++]=a>>>9&7,n[i++]=a>>>12&7,n[i++]=a>>>15&7,n[i++]=a>>>18&7,n[i++]=a>>>21&7,n[i++]=a>>>24&7,n[i++]=a>>>27&7,n[i++]=7&(a>>>30|(1&o)<<2),n[i++]=o>>>1&7,n[i++]=o>>>4&7,n[i++]=o>>>7&7,n[i++]=o>>>10&7,n[i++]=o>>>13&7,n[i++]=o>>>16&7,n[i++]=o>>>19&7,n[i++]=o>>>22&7,n[i++]=o>>>25&7,n[i++]=o>>>28&7,n[i++]=7&(o>>>31|(3&s)<<1),n[i++]=s>>>2&7,n[i++]=s>>>5&7,n[i++]=s>>>8&7,n[i++]=s>>>11&7,n[i++]=s>>>14&7,n[i++]=s>>>17&7,n[i++]=s>>>20&7,n[i++]=s>>>23&7,n[i++]=s>>>26&7,n[i]=s>>>29&7})(e,t,n,r);return;case 4:(function(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0;n[i++]=a>>>0&15,n[i++]=a>>>4&15,n[i++]=a>>>8&15,n[i++]=a>>>12&15,n[i++]=a>>>16&15,n[i++]=a>>>20&15,n[i++]=a>>>24&15,n[i++]=a>>>28&15,n[i++]=o>>>0&15,n[i++]=o>>>4&15,n[i++]=o>>>8&15,n[i++]=o>>>12&15,n[i++]=o>>>16&15,n[i++]=o>>>20&15,n[i++]=o>>>24&15,n[i++]=o>>>28&15,n[i++]=s>>>0&15,n[i++]=s>>>4&15,n[i++]=s>>>8&15,n[i++]=s>>>12&15,n[i++]=s>>>16&15,n[i++]=s>>>20&15,n[i++]=s>>>24&15,n[i++]=s>>>28&15,n[i++]=c>>>0&15,n[i++]=c>>>4&15,n[i++]=c>>>8&15,n[i++]=c>>>12&15,n[i++]=c>>>16&15,n[i++]=c>>>20&15,n[i++]=c>>>24&15,n[i]=c>>>28&15})(e,t,n,r);return;case 5:(function(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0;n[i++]=a>>>0&31,n[i++]=a>>>5&31,n[i++]=a>>>10&31,n[i++]=a>>>15&31,n[i++]=a>>>20&31,n[i++]=a>>>25&31,n[i++]=31&(a>>>30|(7&o)<<2),n[i++]=o>>>3&31,n[i++]=o>>>8&31,n[i++]=o>>>13&31,n[i++]=o>>>18&31,n[i++]=o>>>23&31,n[i++]=31&(o>>>28|(1&s)<<4),n[i++]=s>>>1&31,n[i++]=s>>>6&31,n[i++]=s>>>11&31,n[i++]=s>>>16&31,n[i++]=s>>>21&31,n[i++]=s>>>26&31,n[i++]=31&(s>>>31|(15&c)<<1),n[i++]=c>>>4&31,n[i++]=c>>>9&31,n[i++]=c>>>14&31,n[i++]=c>>>19&31,n[i++]=c>>>24&31,n[i++]=31&(c>>>29|(3&l)<<3),n[i++]=l>>>2&31,n[i++]=l>>>7&31,n[i++]=l>>>12&31,n[i++]=l>>>17&31,n[i++]=l>>>22&31,n[i]=l>>>27&31})(e,t,n,r);return;case 6:(function(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0;n[i++]=a>>>0&63,n[i++]=a>>>6&63,n[i++]=a>>>12&63,n[i++]=a>>>18&63,n[i++]=a>>>24&63,n[i++]=63&(a>>>30|(15&o)<<2),n[i++]=o>>>4&63,n[i++]=o>>>10&63,n[i++]=o>>>16&63,n[i++]=o>>>22&63,n[i++]=63&(o>>>28|(3&s)<<4),n[i++]=s>>>2&63,n[i++]=s>>>8&63,n[i++]=s>>>14&63,n[i++]=s>>>20&63,n[i++]=s>>>26&63,n[i++]=c>>>0&63,n[i++]=c>>>6&63,n[i++]=c>>>12&63,n[i++]=c>>>18&63,n[i++]=c>>>24&63,n[i++]=63&(c>>>30|(15&l)<<2),n[i++]=l>>>4&63,n[i++]=l>>>10&63,n[i++]=l>>>16&63,n[i++]=l>>>22&63,n[i++]=63&(l>>>28|(3&u)<<4),n[i++]=u>>>2&63,n[i++]=u>>>8&63,n[i++]=u>>>14&63,n[i++]=u>>>20&63,n[i]=u>>>26&63})(e,t,n,r);return;case 7:(function(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0,d=e[t+6]>>>0;n[i++]=a>>>0&127,n[i++]=a>>>7&127,n[i++]=a>>>14&127,n[i++]=a>>>21&127,n[i++]=127&(a>>>28|(7&o)<<4),n[i++]=o>>>3&127,n[i++]=o>>>10&127,n[i++]=o>>>17&127,n[i++]=o>>>24&127,n[i++]=127&(o>>>31|(63&s)<<1),n[i++]=s>>>6&127,n[i++]=s>>>13&127,n[i++]=s>>>20&127,n[i++]=127&(s>>>27|(3&c)<<5),n[i++]=c>>>2&127,n[i++]=c>>>9&127,n[i++]=c>>>16&127,n[i++]=c>>>23&127,n[i++]=127&(c>>>30|(31&l)<<2),n[i++]=l>>>5&127,n[i++]=l>>>12&127,n[i++]=l>>>19&127,n[i++]=127&(l>>>26|(1&u)<<6),n[i++]=u>>>1&127,n[i++]=u>>>8&127,n[i++]=u>>>15&127,n[i++]=u>>>22&127,n[i++]=127&(u>>>29|(15&d)<<3),n[i++]=d>>>4&127,n[i++]=d>>>11&127,n[i++]=d>>>18&127,n[i]=d>>>25&127})(e,t,n,r);return;case 8:(function(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0,d=e[t+6]>>>0,f=e[t+7]>>>0;n[i++]=a>>>0&255,n[i++]=a>>>8&255,n[i++]=a>>>16&255,n[i++]=a>>>24&255,n[i++]=o>>>0&255,n[i++]=o>>>8&255,n[i++]=o>>>16&255,n[i++]=o>>>24&255,n[i++]=s>>>0&255,n[i++]=s>>>8&255,n[i++]=s>>>16&255,n[i++]=s>>>24&255,n[i++]=c>>>0&255,n[i++]=c>>>8&255,n[i++]=c>>>16&255,n[i++]=c>>>24&255,n[i++]=l>>>0&255,n[i++]=l>>>8&255,n[i++]=l>>>16&255,n[i++]=l>>>24&255,n[i++]=u>>>0&255,n[i++]=u>>>8&255,n[i++]=u>>>16&255,n[i++]=u>>>24&255,n[i++]=d>>>0&255,n[i++]=d>>>8&255,n[i++]=d>>>16&255,n[i++]=d>>>24&255,n[i++]=f>>>0&255,n[i++]=f>>>8&255,n[i++]=f>>>16&255,n[i]=f>>>24&255})(e,t,n,r);return;case 9:(function(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0,d=e[t+6]>>>0,f=e[t+7]>>>0,p=e[t+8]>>>0;n[i++]=a>>>0&511,n[i++]=a>>>9&511,n[i++]=a>>>18&511,n[i++]=511&(a>>>27|(15&o)<<5),n[i++]=o>>>4&511,n[i++]=o>>>13&511,n[i++]=o>>>22&511,n[i++]=511&(o>>>31|(255&s)<<1),n[i++]=s>>>8&511,n[i++]=s>>>17&511,n[i++]=511&(s>>>26|(7&c)<<6),n[i++]=c>>>3&511,n[i++]=c>>>12&511,n[i++]=c>>>21&511,n[i++]=511&(c>>>30|(127&l)<<2),n[i++]=l>>>7&511,n[i++]=l>>>16&511,n[i++]=511&(l>>>25|(3&u)<<7),n[i++]=u>>>2&511,n[i++]=u>>>11&511,n[i++]=u>>>20&511,n[i++]=511&(u>>>29|(63&d)<<3),n[i++]=d>>>6&511,n[i++]=d>>>15&511,n[i++]=511&(d>>>24|(1&f)<<8),n[i++]=f>>>1&511,n[i++]=f>>>10&511,n[i++]=f>>>19&511,n[i++]=511&(f>>>28|(31&p)<<4),n[i++]=p>>>5&511,n[i++]=p>>>14&511,n[i]=p>>>23&511})(e,t,n,r);return;case 10:(function(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0,d=e[t+6]>>>0,f=e[t+7]>>>0,p=e[t+8]>>>0,m=e[t+9]>>>0;n[i++]=a>>>0&1023,n[i++]=a>>>10&1023,n[i++]=a>>>20&1023,n[i++]=1023&(a>>>30|(255&o)<<2),n[i++]=o>>>8&1023,n[i++]=o>>>18&1023,n[i++]=1023&(o>>>28|(63&s)<<4),n[i++]=s>>>6&1023,n[i++]=s>>>16&1023,n[i++]=1023&(s>>>26|(15&c)<<6),n[i++]=c>>>4&1023,n[i++]=c>>>14&1023,n[i++]=1023&(c>>>24|(3&l)<<8),n[i++]=l>>>2&1023,n[i++]=l>>>12&1023,n[i++]=l>>>22&1023,n[i++]=u>>>0&1023,n[i++]=u>>>10&1023,n[i++]=u>>>20&1023,n[i++]=1023&(u>>>30|(255&d)<<2),n[i++]=d>>>8&1023,n[i++]=d>>>18&1023,n[i++]=1023&(d>>>28|(63&f)<<4),n[i++]=f>>>6&1023,n[i++]=f>>>16&1023,n[i++]=1023&(f>>>26|(15&p)<<6),n[i++]=p>>>4&1023,n[i++]=p>>>14&1023,n[i++]=1023&(p>>>24|(3&m)<<8),n[i++]=m>>>2&1023,n[i++]=m>>>12&1023,n[i]=m>>>22&1023})(e,t,n,r);return;case 11:(function(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0,d=e[t+6]>>>0,f=e[t+7]>>>0,p=e[t+8]>>>0,m=e[t+9]>>>0,h=e[t+10]>>>0;n[i++]=a>>>0&2047,n[i++]=a>>>11&2047,n[i++]=2047&(a>>>22|(1&o)<<10),n[i++]=o>>>1&2047,n[i++]=o>>>12&2047,n[i++]=2047&(o>>>23|(3&s)<<9),n[i++]=s>>>2&2047,n[i++]=s>>>13&2047,n[i++]=2047&(s>>>24|(7&c)<<8),n[i++]=c>>>3&2047,n[i++]=c>>>14&2047,n[i++]=2047&(c>>>25|(15&l)<<7),n[i++]=l>>>4&2047,n[i++]=l>>>15&2047,n[i++]=2047&(l>>>26|(31&u)<<6),n[i++]=u>>>5&2047,n[i++]=u>>>16&2047,n[i++]=2047&(u>>>27|(63&d)<<5),n[i++]=d>>>6&2047,n[i++]=d>>>17&2047,n[i++]=2047&(d>>>28|(127&f)<<4),n[i++]=f>>>7&2047,n[i++]=f>>>18&2047,n[i++]=2047&(f>>>29|(255&p)<<3),n[i++]=p>>>8&2047,n[i++]=p>>>19&2047,n[i++]=2047&(p>>>30|(511&m)<<2),n[i++]=m>>>9&2047,n[i++]=m>>>20&2047,n[i++]=2047&(m>>>31|(1023&h)<<1),n[i++]=h>>>10&2047,n[i]=h>>>21&2047})(e,t,n,r);return;case 12:(function(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0,d=e[t+6]>>>0,f=e[t+7]>>>0,p=e[t+8]>>>0,m=e[t+9]>>>0,h=e[t+10]>>>0,g=e[t+11]>>>0;n[i++]=a>>>0&4095,n[i++]=a>>>12&4095,n[i++]=4095&(a>>>24|(15&o)<<8),n[i++]=o>>>4&4095,n[i++]=o>>>16&4095,n[i++]=4095&(o>>>28|(255&s)<<4),n[i++]=s>>>8&4095,n[i++]=s>>>20&4095,n[i++]=c>>>0&4095,n[i++]=c>>>12&4095,n[i++]=4095&(c>>>24|(15&l)<<8),n[i++]=l>>>4&4095,n[i++]=l>>>16&4095,n[i++]=4095&(l>>>28|(255&u)<<4),n[i++]=u>>>8&4095,n[i++]=u>>>20&4095,n[i++]=d>>>0&4095,n[i++]=d>>>12&4095,n[i++]=4095&(d>>>24|(15&f)<<8),n[i++]=f>>>4&4095,n[i++]=f>>>16&4095,n[i++]=4095&(f>>>28|(255&p)<<4),n[i++]=p>>>8&4095,n[i++]=p>>>20&4095,n[i++]=m>>>0&4095,n[i++]=m>>>12&4095,n[i++]=4095&(m>>>24|(15&h)<<8),n[i++]=h>>>4&4095,n[i++]=h>>>16&4095,n[i++]=4095&(h>>>28|(255&g)<<4),n[i++]=g>>>8&4095,n[i]=g>>>20&4095})(e,t,n,r);return;case 16:(function(e,t,n,r){let i=r,a=e[t]>>>0,o=e[t+1]>>>0,s=e[t+2]>>>0,c=e[t+3]>>>0,l=e[t+4]>>>0,u=e[t+5]>>>0,d=e[t+6]>>>0,f=e[t+7]>>>0,p=e[t+8]>>>0,m=e[t+9]>>>0,h=e[t+10]>>>0,g=e[t+11]>>>0,_=e[t+12]>>>0,v=e[t+13]>>>0,y=e[t+14]>>>0,b=e[t+15]>>>0;n[i++]=a>>>0&65535,n[i++]=a>>>16&65535,n[i++]=o>>>0&65535,n[i++]=o>>>16&65535,n[i++]=s>>>0&65535,n[i++]=s>>>16&65535,n[i++]=c>>>0&65535,n[i++]=c>>>16&65535,n[i++]=l>>>0&65535,n[i++]=l>>>16&65535,n[i++]=u>>>0&65535,n[i++]=u>>>16&65535,n[i++]=d>>>0&65535,n[i++]=d>>>16&65535,n[i++]=f>>>0&65535,n[i++]=f>>>16&65535,n[i++]=p>>>0&65535,n[i++]=p>>>16&65535,n[i++]=m>>>0&65535,n[i++]=m>>>16&65535,n[i++]=h>>>0&65535,n[i++]=h>>>16&65535,n[i++]=g>>>0&65535,n[i++]=g>>>16&65535,n[i++]=_>>>0&65535,n[i++]=_>>>16&65535,n[i++]=v>>>0&65535,n[i++]=v>>>16&65535,n[i++]=y>>>0&65535,n[i++]=y>>>16&65535,n[i++]=b>>>0&65535,n[i]=b>>>16&65535})(e,t,n,r);return;case 32:for(let i=0;i<32;i=i+1|0)n[r+i|0]=0|e[t+i|0];return}let a=cp[i]>>>0,o=t,s=0,c=e[o]>>>0;for(let t=0;t<32;t++)if(s+i<=32)n[r+t]=c>>>s&a,s+=i,s===32&&(s=0,o++,t!==31&&(c=e[o]>>>0));else{let l=32-s,u=c>>>s;o++,c=e[o]>>>0,n[r+t]=(u|(c&cp[i-l]>>>0)<<l)&a,s=i-l}}function yp(e,t,n){let r=new Uint32Array(n),i=0,a=t.get();for(let t=0;t<r.length;t++){let t=e[a++],n=127&t;t<128||(t=e[a++],n|=(127&t)<<7,t<128||(t=e[a++],n|=(127&t)<<14,t<128||(t=e[a++],n|=(127&t)<<21,t<128||(t=e[a++],n|=(15&t)<<28)))),r[i++]=n}return t.set(a),r}function bp(e,t,n){let r=new BigUint64Array(n);for(let n=0;n<r.length;n++)r[n]=xp(e,t);return r}function xp(e,t){let n=0n,r=0,i=t.get();for(;i<e.length;){let t=e[i++];if(n|=BigInt(127&t)<<BigInt(r),!(128&t))break;if(r+=7,r>=64)throw Error(`Varint too long`)}return t.set(i),n}function Sp(e,t){let n,r;return r=e[t.get()],t.increment(),n=127&r,r<128?n:(r=e[t.get()],t.increment(),n|=(127&r)<<7,r<128?n:(r=e[t.get()],t.increment(),n|=(127&r)<<14,r<128?n:(r=e[t.get()],t.increment(),n|=(127&r)<<21,r<128?n:(r=e[t.get()],n|=(15&r)<<28,function(e,t,n){let r,i;if(i=t[n.get()],n.increment(),r=(112&i)>>4,i<128||(i=t[n.get()],n.increment(),r|=(127&i)<<3,i<128)||(i=t[n.get()],n.increment(),r|=(127&i)<<10,i<128)||(i=t[n.get()],n.increment(),r|=(127&i)<<17,i<128)||(i=t[n.get()],n.increment(),r|=(127&i)<<24,i<128)||(i=t[n.get()],n.increment(),r|=(1&i)<<31,i<128))return 4294967296*r+(e>>>0);throw Error(`Expected varint not more than 10 bytes`)}(n,e,t)))))}function $(e){return e>>>1^-(1&e)}function Cp(e){return e>>1n^-(1n&e)}function wp(e){return e%2==1?(e+1)/-2:e/2}function Tp(e,t,n){if(n===void 0){n=0;for(let r=0;r<t;r++)n+=e[r]}let r=new Uint32Array(n),i=0;for(let n=0;n<t;n++){let a=e[n];r.fill(e[n+t],i,i+a),i+=a}return r}function Ep(e,t,n){if(n===void 0){n=0;for(let r=0;r<t;r++)n+=Number(e[r])}let r=new BigUint64Array(n),i=0;for(let n=0;n<t;n++){let a=Number(e[n]);r.fill(e[n+t],i,i+a),i+=a}return r}function Dp(e,t,n){let r=new Float64Array(n),i=0;for(let n=0;n<t;n++){let a=e[n];r.fill(e[n+t],i,i+a),i+=a}return r}function Op(e){let t=new Int32Array(e.length);t[0]=$(e[0]);let n=e.length/4*4,r=1;if(n>=4)for(;r<n-4;r+=4){let n=e[r+1],i=e[r+2],a=e[r+3];t[r]=$(e[r])+t[r-1],t[r+1]=$(n)+t[r],t[r+2]=$(i)+t[r+1],t[r+3]=$(a)+t[r+2]}for(;r!==e.length;++r)t[r]=$(e[r])+t[r-1];return t}function kp(e){let t=new BigInt64Array(e.length);t[0]=Cp(e[0]);let n=e.length/4*4,r=1;if(n>=4)for(;r<n-4;r+=4){let n=e[r+1],i=e[r+2],a=e[r+3];t[r]=Cp(e[r])+t[r-1],t[r+1]=Cp(n)+t[r],t[r+2]=Cp(i)+t[r+1],t[r+3]=Cp(a)+t[r+2]}for(;r!==t.length;++r)t[r]=Cp(e[r])+t[r-1];return t}function Ap(e){let t=e.length/4*4,n=1;if(t>=4)for(let r=e[0];n<t-4;n+=4)r=e[n]+=r,r=e[n+1]+=r,r=e[n+2]+=r,r=e[n+3]+=r;for(;n!==e.length;)e[n]+=e[n-1],++n}var jp,Mp,Np,Pp,Fp,Ip,Lp,Rp;function zp(e,t){let n=function(e,t){let n=e[t.get()],r=Object.values(jp)[n>>4],i=null;switch(r){case jp.DATA:i={dictionaryType:Object.values(Mp)[15&n]};break;case jp.OFFSET:i={offsetType:Object.values(Np)[15&n]};break;case jp.LENGTH:i={lengthType:Object.values(Pp)[15&n]}}t.increment();let a=e[t.get()],o=Object.values(Q)[a>>5],s=Object.values(Q)[a>>2&7],c=Object.values(op)[3&a];t.increment();let l=yp(e,t,2),u=l[0];return{physicalStreamType:r,logicalStreamType:i,logicalLevelTechnique1:o,logicalLevelTechnique2:s,physicalLevelTechnique:c,numValues:u,byteLength:l[1],decompressedCount:u}}(e,t);return n.logicalLevelTechnique1===Q.MORTON?function(e,t,n){let r=yp(t,n,2);return{physicalStreamType:e.physicalStreamType,logicalStreamType:e.logicalStreamType,logicalLevelTechnique1:e.logicalLevelTechnique1,logicalLevelTechnique2:e.logicalLevelTechnique2,physicalLevelTechnique:e.physicalLevelTechnique,numValues:e.numValues,byteLength:e.byteLength,decompressedCount:e.decompressedCount,numBits:r[0],coordinateShift:r[1]}}(n,e,t):Q.RLE!==n.logicalLevelTechnique1&&Q.RLE!==n.logicalLevelTechnique2||op.NONE===n.physicalLevelTechnique?n:function(e,t,n){let r=yp(t,n,2);return{physicalStreamType:e.physicalStreamType,logicalStreamType:e.logicalStreamType,logicalLevelTechnique1:e.logicalLevelTechnique1,logicalLevelTechnique2:e.logicalLevelTechnique2,physicalLevelTechnique:e.physicalLevelTechnique,numValues:e.numValues,byteLength:e.byteLength,decompressedCount:r[1],runs:r[0],numRleValues:r[1]}}(n,e,t)}(function(e){e.PRESENT=`PRESENT`,e.DATA=`DATA`,e.OFFSET=`OFFSET`,e.LENGTH=`LENGTH`})(jp||={}),function(e){e.NONE=`NONE`,e.SINGLE=`SINGLE`,e.SHARED=`SHARED`,e.VERTEX=`VERTEX`,e.MORTON=`MORTON`,e.FSST=`FSST`}(Mp||={}),function(e){e.VERTEX=`VERTEX`,e.INDEX=`INDEX`,e.STRING=`STRING`,e.KEY=`KEY`}(Np||={}),function(e){e.VAR_BINARY=`VAR_BINARY`,e.GEOMETRIES=`GEOMETRIES`,e.PARTS=`PARTS`,e.RINGS=`RINGS`,e.TRIANGLES=`TRIANGLES`,e.SYMBOL=`SYMBOL`,e.DICTIONARY=`DICTIONARY`}(Pp||={}),function(e){e[e.FLAT=0]=`FLAT`,e[e.CONST=1]=`CONST`,e[e.SEQUENCE=2]=`SEQUENCE`,e[e.DICTIONARY=3]=`DICTIONARY`,e[e.FSST_DICTIONARY=4]=`FSST_DICTIONARY`}(Fp||={});class Bp{constructor(e,t){this.values=e,this._size=t}get(e){let t=Math.floor(e/8);return(this.values[t]>>e%8&1)==1}set(e,t){let n=Math.floor(e/8);this.values[n]=this.values[n]|!!t<<e%8}getInt(e){let t=Math.floor(e/8);return this.values[t]>>e%8&1}size(){return this._size}getBuffer(){return this.values}}function Vp(e,t,n){if(!t)return e;let r=t.size(),i=new e.constructor(r),a=0;for(let o=0;o<r;o++)i[o]=t.get(o)?e[a++]:n;return i}function Hp(e,t,n,r,i){return function(e,t,n,r){let i;switch(t.logicalLevelTechnique1){case Q.DELTA:if(t.logicalLevelTechnique2===Q.RLE){let n=t;if(!r)return function(e,t,n){let r=new Int32Array(n),i=0,a=0;for(let n=0;n<t;n++){let o=e[n],s=$(e[n+t]);for(let e=0;e<o;e++)a+=s,r[i++]=a}return r}(e,n.runs,n.numRleValues);i=Op(e=Tp(e,n.runs,n.numRleValues))}else i=Op(e);break;case Q.RLE:i=function(e,t,n){if(n===void 0){n=0;for(let r=0;r<t;r++)n+=e[r]}let r=new Int32Array(n),i=0;for(let n=0;n<t;n++){let a=e[n],o=e[n+t];o=$(o),r.fill(o,i,i+a),i+=a}return r}(e,t.runs,t.numRleValues);break;case Q.MORTON:Ap(e),i=new Int32Array(e);break;case Q.COMPONENTWISE_DELTA:i=function(e){if(e.length<2)return new Int32Array(e);let t=new Int32Array(e.length);t[0]=$(e[0]),t[1]=$(e[1]);let n=e.length/4*4,r=2;if(n>=4)for(;r<n-4;r+=4){let n=e[r+1],i=e[r+2],a=e[r+3];t[r]=$(e[r])+t[r-2],t[r+1]=$(n)+t[r-1],t[r+2]=$(i)+t[r],t[r+3]=$(a)+t[r+1]}for(;r!==e.length;r+=2)t[r]=$(e[r])+t[r-2],t[r+1]=$(e[r+1])+t[r-1];return t}(e);break;case Q.NONE:i=function(e){let t=new Int32Array(e.length);for(let n=0;n<e.length;n++)t[n]=$(e[n]);return t}(e);break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?Vp(i,r,0):i}(Gp(e,t,n),n,0,i)}function Up(e,t,n,r,i){return function(e,t,n,r){let i;switch(t.logicalLevelTechnique1){case Q.DELTA:i=function(e){let t=new Uint32Array(e.length);t[0]=$(e[0])>>>0;for(let n=1;n<e.length;n++)t[n]=t[n-1]+$(e[n])>>>0;return t}(t.logicalLevelTechnique2===Q.RLE?Tp(e,t.runs,t.numRleValues):e);break;case Q.RLE:i=Tp(e,t.runs,t.numRleValues);break;case Q.MORTON:Ap(e),i=e;break;case Q.COMPONENTWISE_DELTA:i=function(e){if(e.length<2)return new Uint32Array(e);let t=new Uint32Array(e.length);t[0]=$(e[0])>>>0,t[1]=$(e[1])>>>0;for(let n=2;n<e.length;n+=2)t[n]=t[n-2]+$(e[n])>>>0,t[n+1]=t[n-1]+$(e[n+1])>>>0;return t}(e);break;case Q.NONE:i=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?Vp(i,r,0):i}(Gp(e,t,n),n,0,i)}function Wp(e,t,n){return function(e,t){if(t.logicalLevelTechnique1===Q.DELTA&&t.logicalLevelTechnique2===Q.NONE)return function(e){let t=new Int32Array(e.length+1);t[0]=0,t[1]=$(e[0]);let n=t[1];for(let r=2;r!==t.length;++r)n+=$(e[r-1]),t[r]=t[r-1]+n;return new Uint32Array(t)}(e);if(t.logicalLevelTechnique1===Q.RLE&&t.logicalLevelTechnique2===Q.NONE)return function(e,t,n){let r=new Uint32Array(n+1);r[0]=0;let i=1,a=r[0];for(let n=0;n<t;n++){let o=e[n],s=e[n+t];for(let e=i;e<i+o;e++)r[e]=s+a,a=r[e];i+=o}return r}(e,t.runs,t.numRleValues);if(t.logicalLevelTechnique1===Q.NONE&&t.logicalLevelTechnique2===Q.NONE){(function(e){let t=0;for(let n=0;n<e.length;n++)e[n]+=t,t=e[n]})(e);let n=new Uint32Array(t.numValues+1);return n[0]=0,n.set(e,1),n}if(t.logicalLevelTechnique1===Q.DELTA&&t.logicalLevelTechnique2===Q.RLE){let n=function(e,t,n){let r=new Int32Array(n+1);r[0]=0;let i=1,a=r[0];for(let n=0;n<t;n++){let o=e[n],s=e[n+t];s=$(s);for(let e=i;e<i+o;e++)r[e]=s+a,a=r[e];i+=o}return r}(e,t.runs,t.numRleValues);return Ap(n),new Uint32Array(n)}throw Error(`Only delta encoding is supported for transforming length to offset streams yet.`)}(Gp(e,t,n),n)}function Gp(e,t,n){let r=n.physicalLevelTechnique;switch(r){case op.FAST_PFOR:return function(e,t,n,r){return function(e,t,n,r,i){let a=r.get();if(3&n)throw Error(`FastPFOR: invalid encodedByteLength=${n} at offset=${a} (encodedBytes.length=${e.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let o=n>>>2,s=function(e,t){if(t<=e.encodedWords.length)return e.encodedWords;let n=new Uint32Array(Math.max(16,2*t));return e.encodedWords=n,n}(i,o);(function(e,t,n,r){if(t<0||n<0||t+n>e.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${t}, byteLength=${n}, bytes.length=${e.length})`);let i=Math.floor(n/4),a=n%4!=0,o=a?i+1:i;if(r.length<o)throw RangeError(`decodeBigEndianInt32sInto: out.length=${r.length} < ${o}`);if(i>0){let n=e.byteOffset+t;if(3&n)for(let n=0;n<i;n++){let i=t+4*n;r[n]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]}else{let t=new Uint32Array(e.buffer,n,i);for(let e=0;e<i;e++)r[e]=0|up(t[e])}}if(a){let a=t+4*i,o=n-4*i,s=0;for(let t=0;t<o;t++)s|=e[a+t]<<24-8*t;r[i]=0|s}})(e,a,n,s);let c=function(e,t,n){let r=0,i=0,a=new Uint32Array(t),o=n??pp();if(e.length>0){let t=0|e[r];if(r=r+1|0,255&t)throw Error(`FastPFOR decode: invalid alignedLength=${t} (expected multiple of 256)`);if(i+t>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${i}, alignedLength=${t}, out.length=${a.length})`);r=function(e,t,n,r,i,a){let o=r+lp(i,256),s=r,c=n;for(;s!==o;){let n=Math.min(dp,o-s);c=_p(e,t,c,s,n,a),s=s+n|0}return c}(e,a,r,i,t,o),i=i+t|0}return function(e,t,n,r,i,a){if(a===0)return t;let o=0,s=t,c=t+n,l=i,u=i,d=i+a,f=0,p=0;for(;s<c&&u<d;){let t=e[s]>>>o&255;if(o+=8,s+=o>>>5,o&=31,f|=(127&t)<<p,128&t)r[u++]=0|f,f=0,p=0;else if(p+=7,p>28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${p}, partial=${f}, decoded=${u-l}/${a}, inPos=${s}, inEnd=${c})`)}if(u!==d)throw Error(`FastPFOR VByte: truncated stream (decoded=${u-l}, expected=${a}, consumedWords=${s-t}/${n}, vbyteStart=${t}, vbyteEnd=${c})`)}(e,r,e.length-r|0,a,i,t-i|0),a}(s.subarray(0,o),t,i.decoderWorkspace);return r.add(n),c}(e,t,n,r,function(e=16){if(e<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${e}`);let t=Math.max(16,0|e);return{encodedWords:new Uint32Array(t),decoderWorkspace:pp()}}(n>>>2))}(e,n.numValues,n.byteLength,t);case op.VARINT:return yp(e,t,n.numValues);case op.NONE:{let r=t.get();t.add(n.byteLength);let i=e.subarray(r,t.get());return new Uint32Array(i)}default:throw Error(`Specified physicalLevelTechnique ${r} is not supported (yet).`)}}function Kp(e,t,n){let r=Gp(e,t,n);return r.length===1?r[0]:function(e){return e[1]}(r)}function qp(e,t,n){return function(e){if(e.length===2){let t=$(e[1]);return[t,t]}return[$(e[2]),$(e[3])]}(Gp(e,t,n))}function Jp(e,t,n){return function(e){if(e.length===2){let t=Cp(e[1]);return[t,t]}return[Cp(e[2]),Cp(e[3])]}(bp(e,t,n.numValues))}function Yp(e,t,n,r){return function(e,t,n){let r;switch(t.logicalLevelTechnique1){case Q.DELTA:r=function(e){let t=new BigUint64Array(e.length);t[0]=BigInt.asUintN(64,Cp(e[0]));for(let n=1;n<e.length;n++)t[n]=BigInt.asUintN(64,t[n-1]+Cp(e[n]));return t}(t.logicalLevelTechnique2===Q.RLE?Ep(e,t.runs,t.numRleValues):e);break;case Q.RLE:r=Ep(e,t.runs,t.numRleValues);break;case Q.NONE:r=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return n?Vp(r,n,0n):r}(bp(e,t,n.numValues),n,r)}function Xp(e,t,n){let r=bp(e,t,n.numValues);return r.length===1?r[0]:function(e){return e[1]}(r)}function Zp(e,t,n,r,i=`int32`){let a=e.logicalLevelTechnique1;if(a===Q.RLE)return e.runs===1?Fp.CONST:Fp.FLAT;if(a!==Q.DELTA||e.logicalLevelTechnique2!==Q.RLE)return e.numValues===1?Fp.CONST:Fp.FLAT;let o=t instanceof Bp?t.size():t;if(e.numRleValues!==o)return Fp.FLAT;if(e.runs===1)return Fp.SEQUENCE;if(e.runs!==2)return e.numValues===1?Fp.CONST:Fp.FLAT;let s=r.get();if(e.physicalLevelTechnique===op.VARINT)return function(e,t,n){let r=new ap(t.get());if(n===`int64`){let t=bp(e,r,4);return t[2]===2n&&t[3]===2n}let i=yp(e,r,4);return i[2]===2&&i[3]===2}(n,r,i)?Fp.SEQUENCE:e.numValues===1?Fp.CONST:Fp.FLAT;let c=r.get(),l=new Int32Array(n.buffer,n.byteOffset+c,4);return r.set(s),l[2]===2&&l[3]===2?Fp.SEQUENCE:e.numValues===1?Fp.CONST:Fp.FLAT}class Qp extends Qf{getValueFromBuffer(e){return this.dataBuffer[e]}}class $p extends tp{constructor(e,t,n,r){super(e,BigInt64Array.of(t),n,r)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}}function em(e,t,n){return{x:tm(e,t)-n,y:tm(e>>1,t)-n}}function tm(e,t){let n=0;for(let r=0;r<t;r++)n|=(e&1<<2*r)>>r;return n}function nm(e,t,r,i,a,o,s){return e===Rp.MORTON?function(e,t,r,i,a,o){let s=Array(a?i+1:i);for(let a=0;a<i;a++){let i=em(e[t[r+a]],o.numBits,o.coordinateShift);s[a]=new n(i.x,i.y)}return a&&(s[s.length-1]=s[0]),s}(t,r,i,a,o,s):function(e,t,r,i,a){let o=Array(a?i+1:i);for(let a=0;a<2*i;a+=2){let i=2*t[r+a/2];o[a/2]=new n(e[i],e[i+1])}return a&&(o[o.length-1]=o[0]),o}(t,r,i,a,o)}function rm(e,t,r,i){let a=Array(i?r+1:r);for(let i=0;i<2*r;i+=2)a[i/2]=new n(e[t+i],e[t+i+1]);return i&&(a[a.length-1]=a[0]),a}(function(e){e[e.POINT=0]=`POINT`,e[e.LINESTRING=1]=`LINESTRING`,e[e.POLYGON=2]=`POLYGON`,e[e.MULTIPOINT=3]=`MULTIPOINT`,e[e.MULTILINESTRING=4]=`MULTILINESTRING`,e[e.MULTIPOLYGON=5]=`MULTIPOLYGON`})(Ip||={}),function(e){e[e.POINT=0]=`POINT`,e[e.LINESTRING=1]=`LINESTRING`,e[e.POLYGON=2]=`POLYGON`}(Lp||={}),function(e){e[e.MORTON=0]=`MORTON`,e[e.VEC_2=1]=`VEC_2`,e[e.VEC_3=2]=`VEC_3`}(Rp||={});class im{constructor(e,t,n,r,i){this._vertexBufferType=e,this._topologyVector=t,this._vertexOffsets=n,this._vertexBuffer=r,this._mortonSettings=i}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(e){let t=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){let t=em(this.vertexBuffer[this.vertexOffsets[e]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[t.x,t.y]}let t=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getGeometries(){return function(e){let t=Array(e.numGeometries),r=1,i=1,a=1,o=0,s=0,c=0,l=e.mortonSettings,u=e.topologyVector,d=u.geometryOffsets,f=u.partOffsets,p=u.ringOffsets,m=e.vertexOffsets,h=!m||m.length===0,g=e.containsPolygonGeometry(),_=e.vertexBuffer;for(let u=0;u<e.numGeometries;u++)switch(e.geometryType(u)){case Ip.POINT:{let u,g;if(h)u=_[s++],g=_[s++];else if(e.vertexBufferType===Rp.MORTON){let e=em(_[m[c++]],l.numBits,l.coordinateShift);u=e.x,g=e.y}else{let e=2*m[c++];u=_[e],g=_[e+1]}t[o++]=[[new n(u,g)]],d&&a++,f&&r++,p&&i++}break;case Ip.MULTIPOINT:{let e=d[a]-d[a-1];a++;let l=Array(e);if(h)for(let t=0;t<e;t++){let e=_[s++],r=_[s++];l[t]=new n(e,r)}else for(let t=0;t<e;t++){let e=2*m[c++];l[t]=new n(_[e],_[e+1])}t[o++]=l.map((e=>[e])),r+=e,i+=e}break;case Ip.LINESTRING:{let n,u;g?(n=p[i]-p[i-1],i++):n=f[r]-f[r-1],r++,h?(u=rm(_,s,n,!1),s+=2*n):(u=nm(e.vertexBufferType,_,m,c,n,!1,l),c+=n),t[o++]=[u],d&&a++}break;case Ip.POLYGON:{let n=f[r]-f[r-1];r++;let u=Array(n-1),g,v=p[i]-p[i-1];if(i++,h){g=rm(_,s,v,!0),s+=2*v;for(let e=0;e<u.length;e++)v=p[i]-p[i-1],i++,u[e]=rm(_,s,v,!0),s+=2*v}else{g=nm(e.vertexBufferType,_,m,c,v,!0,l),c+=v;for(let t=0;t<u.length;t++)v=p[i]-p[i-1],i++,u[t]=nm(e.vertexBufferType,_,m,c,v,!0,l),c+=v}t[o++]=[g].concat(u),d&&a++}break;case Ip.MULTILINESTRING:{let n=d[a]-d[a-1];a++;let u=Array(n);for(let t=0;t<n;t++){let n;g?(n=p[i]-p[i-1],i++):n=f[r]-f[r-1],r++,h?(u[t]=rm(_,s,n,!1),s+=2*n):(u[t]=nm(e.vertexBufferType,_,m,c,n,!1,l),c+=n)}t[o++]=u}break;case Ip.MULTIPOLYGON:{let n=d[a]-d[a-1];a++;let u=Array(n);for(let t=0;t<n;t++){let n=f[r]-f[r-1],a;r++;let o=Array(n-1),d=p[i]-p[i-1];i++,h?(a=rm(_,s,d,!0),s+=2*d):(a=nm(e.vertexBufferType,_,m,c,d,!0,l),c+=d);for(let t=0;t<o.length;t++){let n=p[i]-p[i-1];i++,h?(o[t]=rm(_,s,n,!0),s+=2*n):(o[t]=nm(e.vertexBufferType,_,m,c,n,!0,l),c+=n)}u[t]=[a].concat(o)}t[o++]=u.flat()}break;default:throw Error(`The specified geometry type is currently not supported.`)}return t}(this)}get mortonSettings(){return this._mortonSettings}}class am extends im{constructor(e,t,n,r,i,a,o){super(n,r,i,a,o),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Ip.POLYGON||this._geometryType===Ip.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class om extends im{constructor(e,t,n,r,i,a){super(e,n,r,i,a),this._geometryTypes=t}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let e=0;e<this.numGeometries;e++)if(this.geometryType(e)===Ip.POLYGON||this.geometryType(e)===Ip.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class sm{constructor(e,t,n,r){this._triangleOffsets=e,this._indexBuffer=t,this._vertexBuffer=n,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 Error(`Cannot convert GpuVector to coordinates without topology information`);let e=Array(this.numGeometries),t=this._topologyVector,r=t.partOffsets,i=t.ringOffsets,a=t.geometryOffsets,o=0,s=1,c=1,l=1;for(let t=0;t<this.numGeometries;t++)switch(this.geometryType(t)){case Ip.POLYGON:{let u=r[s]-r[s-1];s++;let d=[];for(let e=0;e<u;e++){let e=i[c]-i[c-1];c++;let t=[];for(let r=0;r<e;r++){let e=this._vertexBuffer[o++],r=this._vertexBuffer[o++];t.push(new n(e,r))}t.length>0&&t.push(t[0]),d.push(t)}e[t]=d,a&&l++}break;case Ip.MULTIPOLYGON:{let u=a[l]-a[l-1];l++;let d=[];for(let e=0;e<u;e++){let e=r[s]-r[s-1];s++;for(let t=0;t<e;t++){let e=i[c]-i[c-1];c++;let t=[];for(let r=0;r<e;r++){let e=this._vertexBuffer[o++],r=this._vertexBuffer[o++];t.push(new n(e,r))}t.length>0&&t.push(t[0]),d.push(t)}}e[t]=d}}return e}[Symbol.iterator](){return null}}function cm(e,t,n,r,i,a){return new lm(e,t,n,r,i,a)}class lm extends sm{constructor(e,t,n,r,i,a){super(n,r,i,a),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}function um(e,t,n,r,i){return new dm(e,t,n,r,i)}class dm extends sm{constructor(e,t,n,r,i){super(t,n,r,i),this._geometryTypes=e}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function fm(e,t,n,r,i){let a=zp(e,n),o,s,c,l;if(Zp(a,r,e,n)===Fp.CONST){let i=Kp(e,n,a),u,d,f,p;for(let r=0;r<t-1;r++){let t=zp(e,n);switch(t.physicalStreamType){case jp.LENGTH:switch(t.logicalStreamType.lengthType){case Pp.GEOMETRIES:u=Wp(e,n,t);break;case Pp.PARTS:d=Wp(e,n,t);break;case Pp.RINGS:f=Wp(e,n,t);break;case Pp.TRIANGLES:p=Wp(e,n,t)}break;case jp.OFFSET:switch(t.logicalStreamType.offsetType){case Np.VERTEX:o=Up(e,n,t);break;case Np.INDEX:l=Up(e,n,t)}break;case jp.DATA:Mp.VERTEX===t.logicalStreamType.dictionaryType?s=Hp(e,n,t):(c={numBits:t.numBits,coordinateShift:t.coordinateShift},s=Up(e,n,t))}}return l?u!==void 0||d!==void 0?cm(r,i,p,l,s,{geometryOffsets:u,partOffsets:d,ringOffsets:f}):cm(r,i,p,l,s):c===void 0?function(e,t,n,r,i){return new am(e,t,Rp.VEC_2,n,r,i)}(r,i,{geometryOffsets:u,partOffsets:d,ringOffsets:f},o,s):function(e,t,n,r,i,a){return new am(e,t,Rp.MORTON,n,r,i,a)}(r,i,{geometryOffsets:u,partOffsets:d,ringOffsets:f},o,s,c)}let u=Up(e,n,a),d,f,p,m,h,g,_;for(let r=0;r<t-1;r++){let t=zp(e,n);switch(t.physicalStreamType){case jp.LENGTH:switch(t.logicalStreamType.lengthType){case Pp.GEOMETRIES:d=Up(e,n,t);break;case Pp.PARTS:f=Up(e,n,t);break;case Pp.RINGS:p=Up(e,n,t);break;case Pp.TRIANGLES:m=Wp(e,n,t)}break;case jp.OFFSET:switch(t.logicalStreamType.offsetType){case Np.VERTEX:o=Up(e,n,t);break;case Np.INDEX:l=Up(e,n,t)}break;case jp.DATA:Mp.VERTEX===t.logicalStreamType.dictionaryType?s=Hp(e,n,t):(c={numBits:t.numBits,coordinateShift:t.coordinateShift},s=Up(e,n,t))}}return d?(h=pm(u,d,2),f&&p?(g=mm(u,h,f,!1),_=function(e,t,n,r){let i=new Uint32Array(n[n.length-1]+1),a=0;i[0]=a;let o=1,s=1,c=0;for(let l=0;l<e.length;l++){let u=e[l],d=t[l+1]-t[l];if(u!==0&&u!==3)for(let e=0;e<d;e++){let e=n[o]-n[o-1];o++;for(let t=0;t<e;t++)a=i[s++]=a+r[c++]}else for(let e=0;e<d;e++)i[s++]=++a,o++}return i}(u,h,g,p)):f&&(g=function(e,t,n){let r=new Uint32Array(t[t.length-1]+1),i=0;r[0]=i;let a=1,o=0;for(let s=0;s<e.length;s++){let c=e[s],l=t[s+1]-t[s];if(c===4||c===1)for(let e=0;e<l;e++)i=r[a++]=i+n[o++];else for(let e=0;e<l;e++)r[a++]=++i}return r}(u,h,f))):f&&p?(g=pm(u,f,1),_=mm(u,g,p,!0)):f&&(g=pm(u,f,0)),l&&!g?um(u,m,l,s):l?um(u,m,l,s,{geometryOffsets:h,partOffsets:g,ringOffsets:_}):c===void 0?function(e,t,n,r){return new om(Rp.VEC_2,e,t,n,r)}(u,{geometryOffsets:h,partOffsets:g,ringOffsets:_},o,s):function(e,t,n,r,i){return new om(Rp.MORTON,e,t,n,r,i)}(u,{geometryOffsets:h,partOffsets:g,ringOffsets:_},o,s,c)}function pm(e,t,n){let r=new Uint32Array(e.length+1),i=0;r[0]=i;let a=0;for(let o=0;o<e.length;o++)i=r[o+1]=i+(e[o]>n?t[a++]:1);return r}function mm(e,t,n,r){let i=new Uint32Array(t[t.length-1]+1),a=0;i[0]=a;let o=1,s=0;for(let c=0;c<e.length;c++){let l=e[c],u=t[c+1]-t[c];if(l===5||l===2||r&&(l===4||l===1))for(let e=0;e<u;e++)a=i[o++]=a+n[s++];else for(let e=0;e<u;e++)i[o++]=++a}return i}class hm extends Zf{constructor(e,t,n){super(e,t.getBuffer(),n),this.dataVector=t}getValueFromBuffer(e){return this.dataVector.get(e)}}class gm extends Qf{getValueFromBuffer(e){return this.dataBuffer[e]}}class _m extends Zf{constructor(e,t,n,r){super(e,r?BigInt64Array.of(t):BigUint64Array.of(t),n)}getValueFromBuffer(e){return this.dataBuffer[0]}}function vm(e,t,n,r,i){let a=function(e,t,n,r){let i=new Uint8Array(t),a=0,o=r.get()+n;for(;a<t&&!(r.get()>=o);){let n=e[r.increment()];if(n<=127){let o=n+3,s=e[r.increment()],c=Math.min(a+o,t);i.fill(s,a,c),a=c}else{let o=256-n;for(let n=0;n<o&&a<t;n++)i[a++]=e[r.increment()]}}return r.set(o),i}(e,Math.ceil(t/8),n,r);return i?function(e,t,n){if(!n)return e;let r=n.size(),i=new Bp(e,t),a=new Bp(new Uint8Array(Math.ceil(r/8)),r),o=0;for(let e=0;e<r;e++){let t=!!n.get(e)&&i.get(o++);a.set(e,t)}return a.getBuffer()}(a,t,i):a}let ym=new TextDecoder;function bm(e,t,n){return n-t>=12?ym.decode(e.subarray(t,n)):function(e,t,n){let r=``,i=t;for(;i<n;){let t=e[i],a,o,s,c=null,l=t>239?4:t>223?3:t>191?2:1;if(i+l>n)break;l===1?t<128&&(c=t):l===2?(a=e[i+1],(192&a)==128&&(c=(31&t)<<6|63&a,c<=127&&(c=null))):l===3?(a=e[i+1],o=e[i+2],(192&a)==128&&(192&o)==128&&(c=(15&t)<<12|(63&a)<<6|63&o,(c<=2047||c>=55296&&c<=57343)&&(c=null))):l===4&&(a=e[i+1],o=e[i+2],s=e[i+3],(192&a)==128&&(192&o)==128&&(192&s)==128&&(c=(15&t)<<18|(63&a)<<12|(63&o)<<6|63&s,(c<=65535||c>=1114112)&&(c=null))),c===null?(c=65533,l=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),i+=l}return r}(e,t,n)}class xm extends Zf{constructor(e,t,n,r){super(e,n,r),this.offsetBuffer=t}}class Sm extends xm{constructor(e,t,n,r){super(e,t,n,r??t.length-1)}getValueFromBuffer(e){return bm(this.dataBuffer,this.offsetBuffer[e],this.offsetBuffer[e+1])}}class Cm extends xm{constructor(e,t,n,r,i){super(e,n,r,i??t.length),this.indexBuffer=t,this.indexBuffer=t}getValueFromBuffer(e){let t=this.indexBuffer[e];return bm(this.dataBuffer,this.offsetBuffer[t],this.offsetBuffer[t+1])}}class wm extends xm{constructor(e,t,n,r,i,a,o){super(e,n,r,o),this.indexBuffer=t,this.symbolOffsetBuffer=i,this.symbolTableBuffer=a}getValueFromBuffer(e){this.decodedDictionary??=(this.symbolLengthBuffer??=this.offsetToLengthBuffer(this.symbolOffsetBuffer),function(e,t,n){let r=[],i=Array(t.length).fill(0);for(let e=1;e<t.length;e++)i[e]=i[e-1]+t[e-1];for(let a=0;a<n.length;a++)if(n[a]===255)r.push(n[++a]);else{let o=t[n[a]],s=i[n[a]];for(let t=0;t<o;t++)r.push(e[s+t])}return new Uint8Array(r)}(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));let t=this.indexBuffer[e];return bm(this.decodedDictionary,this.offsetBuffer[t],this.offsetBuffer[t+1])}offsetToLengthBuffer(e){let t=new Uint32Array(e.length-1),n=e[0];for(let r=1;r<e.length;r++){let i=e[r];t[r-1]=i-n,n=i}return t}}function Tm(e,t,n,r,i,a){return n.type===`scalarType`?function(e,t,n,r,i,a){let o=null;if(e===0)return null;if(a.nullable){let e=zp(t,n),r=e.numValues,i=n.get(),a=vm(t,r,e.byteLength,n);n.set(i+e.byteLength),o=new Bp(a,e.numValues)}let s=o??r;switch(i.physicalType){case 4:case 3:return function(e,t,n,r,i){let a=zp(e,t),o=Zp(a,i,e,t),s=r.physicalType===3;if(o===Fp.FLAT){let r=Em(i)?i:void 0,o=s?Hp(e,t,a,0,r):Up(e,t,a,0,r);return new $f(n.name,o,i)}if(o===Fp.SEQUENCE){let r=qp(e,t,a);return new np(n.name,r[0],r[1],a.numRleValues)}let c=s?function(e,t,n){let r=Gp(e,t,n);return r.length===1?$(r[0]):function(e){return $(e[1])}(r)}(e,t,a):Kp(e,t,a);return new rp(n.name,c,i,s)}(t,n,a,i,s);case 9:return function(e,t,n,r,i){let a=null,o=null,s=null,c=null,l=null,u=i??null,d=null,f=null;for(let e=0;e<r;e++){let e=zp(t,n);switch(e.physicalStreamType){case jp.PRESENT:{let r=new Bp(vm(t,e.numValues,e.byteLength,n),e.numValues);u=i??r;break}case jp.OFFSET:o=Up(t,n,e,0,u);break;case jp.LENGTH:{let r=Wp(t,n,e);Pp.DICTIONARY===e.logicalStreamType.lengthType?a=r:Pp.SYMBOL===e.logicalStreamType.lengthType?c=r:d=r;break}case jp.DATA:{let r=t.subarray(n.get(),n.get()+e.byteLength);n.add(e.byteLength);let i=e.logicalStreamType.dictionaryType;Mp.FSST===i?l=r:Mp.SINGLE===i||Mp.SHARED===i?s=r:Mp.NONE===i&&(f=r);break}}}return function(e,t,n,r,i,a,o){return t?new wm(e,n,r,i,a,t,o):null}(e,l,o,a,s,c,u)??function(e,t,n,r,i){return t?i?new Cm(e,n,r,t,i):new Cm(e,n,r,t):null}(e,s,o,a,u)??function(e,t,n,r,i){if(!t||!n)return null;if(r)return i?new Cm(e,r,t,n,i):new Cm(e,r,t,n);if(i&&i.size()!==t.length-1){let r=new Uint32Array(i.size()),a=0;for(let e=0;e<i.size();e++)r[e]=i.get(e)?a++:0;return new Cm(e,r,t,n,i)}return i?new Sm(e,t,n,i):new Sm(e,t,n)}(e,d,f,o,u)}(a.name,t,n,a.nullable?e-1:e,o);case 0:return function(e,t,n,r,i){let a=zp(e,t),o=a.numValues,s=t.get(),c=Em(i)?i:void 0,l=vm(e,o,a.byteLength,t,c);t.set(s+a.byteLength);let u=new Bp(l,o);return new hm(n.name,u,i)}(t,n,a,0,s);case 6:case 5:return function(e,t,n,r,i){let a=zp(e,t),o=Zp(a,r,e,t,`int64`),s=i.physicalType===5;if(o===Fp.FLAT){let i=Em(r)?r:void 0,o=s?function(e,t,n,r){return function(e,t,n){let r;switch(t.logicalLevelTechnique1){case Q.DELTA:if(t.logicalLevelTechnique2===Q.RLE){let i=t;if(!n)return function(e,t,n){let r=new BigInt64Array(n),i=0,a=0n;for(let n=0;n<t;n++){let o=Number(e[n]),s=Cp(e[n+t]);for(let e=0;e<o;e++)a+=s,r[i++]=a}return r}(e,i.runs,i.numRleValues);r=kp(e=Ep(e,i.runs,i.numRleValues))}else r=kp(e);break;case Q.RLE:r=function(e,t,n){if(n===void 0){n=0;for(let r=0;r<t;r++)n+=Number(e[r])}let r=new BigInt64Array(n),i=0;for(let n=0;n<t;n++){let a=Number(e[n]),o=e[n+t];o=Cp(o),r.fill(o,i,i+a),i+=a}return r}(e,t.runs,t.numRleValues);break;case Q.NONE:r=function(e){let t=new BigInt64Array(e.length);for(let n=0;n<e.length;n++)t[n]=Cp(e[n]);return t}(e);break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return n?Vp(r,n,0n):r}(bp(e,t,n.numValues),n,r)}(e,t,a,i):Yp(e,t,a,i);return new Qp(n.name,o,r)}if(o===Fp.SEQUENCE){let r=Jp(e,t,a);return new $p(n.name,r[0],r[1],a.numRleValues)}let c=s?function(e,t,n){let r=bp(e,t,n.numValues);return r.length===1?Cp(r[0]):function(e){return Cp(e[1])}(r)}(e,t,a):Xp(e,t,a);return new _m(n.name,c,r,s)}(t,n,a,s,i);case 7:return function(e,t,n,r){let i=zp(e,t),a=Em(r)?r:void 0,o=function(e,t,n,r){let i=t.get(),a=i+n*Float32Array.BYTES_PER_ELEMENT,o=new Uint8Array(e.subarray(i,a)).buffer,s=new Float32Array(o);return t.set(a),r?Vp(s,r,0):s}(e,t,i.numValues,a);return new gm(n.name,o,r)}(t,n,a,s);case 8:return function(e,t,n,r){let i=zp(e,t),a=Em(r)?r:void 0,o=function(e,t,n,r){let i=t.get(),a=i+n*Float64Array.BYTES_PER_ELEMENT,o=new Uint8Array(e.subarray(i,a)).buffer,s=new Float64Array(o);return t.set(a),r?Vp(s,r,0):s}(e,t,i.numValues,a);return new ep(n.name,o,r)}(t,n,a,s);default:throw Error(`The specified data type for the field is currently not supported: ${i}`)}}(r,e,t,i,n.scalarType,n):r===0?null:function(e,t,n,r){let i=null,a=null,o=null,s=null,c=!1;for(;!c;){let n=zp(e,t);switch(n.physicalStreamType){case jp.LENGTH:Pp.DICTIONARY===n.logicalStreamType.lengthType?i=Wp(e,t,n):o=Wp(e,t,n);break;case jp.DATA:Mp.SINGLE===n.logicalStreamType.dictionaryType||Mp.SHARED===n.logicalStreamType.dictionaryType?(a=e.subarray(t.get(),t.get()+n.byteLength),c=!0):s=e.subarray(t.get(),t.get()+n.byteLength),t.add(n.byteLength)}}let l=n.complexType.children,u=[],d=0;for(let c of l){let l=yp(e,t,1)[0];if(l===0)continue;let f=c.name?`${n.name}${c.name}`:n.name;if(l!==2||c.type!==`scalarField`||c.scalarField.physicalType!==9)throw Error(`Currently only optional string fields are implemented for a struct.`);let p=zp(e,t),m=vm(e,p.numValues,p.byteLength,t),h=zp(e,t),g=Up(e,t,h,0,h.decompressedCount===r?void 0:new Bp(m,p.numValues));u[d++]=s?new wm(f,g,i,a,o,s,new Bp(m,p.numValues)):new Cm(f,g,i,a,new Bp(m,p.numValues))}return u}(e,t,n,i)}function Em(e){return e instanceof Bp}function Dm(e){switch(e){case 0:case 1:case 2:case 3:{let t={};t.nullable=!!(1&e),t.columnScope=0;let n={type:`logicalType`,logicalType:0};return n.longID=!!(2&e),t.scalarType=n,t.type=`scalarType`,t}case 4:{let e={nullable:!1,columnScope:0};return e.type=`complexType`,e.complexType={type:`physicalType`,physicalType:0},e}case 30:{let e={nullable:!1,columnScope:0};return e.type=`complexType`,e.complexType={type:`physicalType`,physicalType:1},e}default:return function(e){let t;switch(e){case 10:case 11:t=0;break;case 12:case 13:t=1;break;case 14:case 15:t=2;break;case 16:case 17:t=3;break;case 18:case 19:t=4;break;case 20:case 21:t=5;break;case 22:case 23:t=6;break;case 24:case 25:t=7;break;case 26:case 27:t=8;break;case 28:case 29:t=9;break;default:return null}let n={};n.nullable=!!(1&e),n.columnScope=0;let r={type:`physicalType`};return r.physicalType=t,n.type=`scalarType`,n.scalarType=r,n}(e)}}function Om(e){return e>=10}function km(e){return e===30}function Am(e){if(e.type===`scalarType`){let t=e.scalarType;if(t.type===`physicalType`)switch(t.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(t.type===`logicalType`)return!1}else if(e.type===`complexType`){let t=e.complexType;if(t.type===`physicalType`)switch(t.physicalType){case 0:case 1:return!0;default:return!1}}return console.warn(`Unexpected column type in hasStreamCount`,e),!1}function jm(e){return e.type===`complexType`&&e.complexType?.type===`physicalType`&&e.complexType.physicalType===0}let Mm=new TextDecoder;function Nm(e,t){let n=yp(e,t,1)[0];if(n===0)return``;let r=t.get(),i=e.subarray(r,r+n);return t.add(n),Mm.decode(i)}function Pm(e,t){let n=yp(e,t,1)[0]>>>0;if(n<10||n>30)throw Error(`Unsupported field type code ${n}. Supported: 10-29(scalars), 30(STRUCT)`);let r=Dm(n);if(Om(n)&&(r.name=Nm(e,t)),km(n)){let n=yp(e,t,1)[0]>>>0;r.complexType.children=Array(n);for(let i=0;i<n;i++)r.complexType.children[i]=Pm(e,t)}return function(e){return{name:e.name,nullable:e.nullable,scalarField:e.scalarType,complexField:e.complexType,type:e.type===`scalarType`?`scalarField`:`complexField`}}(r)}function Fm(e,t){let n=yp(e,t,1)[0]>>>0,r=Dm(n);if(!r)throw Error(`Unsupported column type code ${n}. Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)`);if(Om(n)?r.name=Nm(e,t):n>=0&&n<=3?r.name=`id`:n===4&&(r.name=`geometry`),km(n)){let n=yp(e,t,1)[0]>>>0,i=r.complexType;i.children=Array(n);for(let r=0;r<n;r++)i.children[r]=Pm(e,t)}return r}function Im(e,t){let n={featureTables:[]},r={};r.name=Nm(e,t);let i=yp(e,t,1)[0]>>>0,a=yp(e,t,1)[0]>>>0;r.columns=Array(a);for(let n=0;n<a;n++)r.columns[n]=Fm(e,t);return n.featureTables.push(r),[n,i]}function Lm(e,t,n,r,i,a,o=!1){let s=t.scalarType;if(!s||s.type!==`logicalType`||s.logicalType!==0)throw Error(`ID column must be a logical ID scalar type: ${r}`);let c=s.longID?6:4,l=typeof a==`number`?void 0:a,u=Zp(i,a,e,n,c===6?`int64`:`int32`);if(c===4)switch(u){case Fp.FLAT:return new $f(r,Up(e,n,i,0,l),a);case Fp.SEQUENCE:{let t=qp(e,n,i);return new np(r,t[0],t[1],i.numRleValues)}case Fp.CONST:return new rp(r,Kp(e,n,i),a,!1)}switch(u){case Fp.FLAT:return o?new ep(r,function(e,t,n){return function(e,t){switch(t.logicalLevelTechnique1){case Q.DELTA:return t.logicalLevelTechnique2===Q.RLE&&(e=Dp(e,t.runs,t.numRleValues)),function(e){e[0]=wp(e[0]);let t=e.length/4*4,n=1;if(t>=4)for(;n<t-4;n+=4){let t=e[n+1],r=e[n+2],i=e[n+3];e[n]=wp(e[n])+e[n-1],e[n+1]=wp(t)+e[n],e[n+2]=wp(r)+e[n+1],e[n+3]=wp(i)+e[n+2]}for(;n!==e.length;++n)e[n]=wp(e[n])+e[n-1]}(e),e;case Q.RLE:return function(e,t){return Dp(e,t.runs,t.numRleValues)}(e,t);case Q.NONE:return e;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}}(function(e,t,n){let r=new Float64Array(n);for(let i=0;i<n;i++)r[i]=Sp(e,t);return r}(e,t,n.numValues),n)}(e,n,i),a):new Qp(r,Yp(e,n,i,l),a);case Fp.SEQUENCE:{let t=Jp(e,n,i);return new $p(r,t[0],t[1],i.numRleValues)}case Fp.CONST:return new _m(r,Xp(e,n,i),a,!1)}throw Error(`Vector type not supported for id column.`)}class Rm{constructor(e,t){switch(this._featureData=e,this.properties=this._featureData.properties||{},this._featureData.geometry?.type){case Ip.POINT:case Ip.MULTIPOINT:this.type=1;break;case Ip.LINESTRING:case Ip.MULTILINESTRING:this.type=2;break;case Ip.POLYGON:case Ip.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=t,this.id=Number(this._featureData.id)}loadGeometry(){let e=[];for(let t of this._featureData.geometry.coordinates){let r=[];for(let e of t)r.push(new n(e.x,e.y));e.push(r)}return e}}class zm{constructor(e){this.features=[],this.featureTable=e,this.name=e.name,this.extent=e.extent,this.version=2,this.features=e.getFeatures(),this.length=this.features.length}feature(e){return new Rm(this.features[e],this.extent)}}class Bm{constructor(e){this.layers={};let t=function(e,t,n=!0){let r=new ap(0),i=[];for(;r.get()<e.length;){let t=yp(e,r,1)[0]>>>0,o=r.get()+t;if(o>e.length)throw Error(`Block overruns tile: ${o} > ${e.length}`);if(yp(e,r,1)[0]>>>0!=1){r.set(o);continue}let[s,c]=Im(e,r),l=s.featureTables[0],u=null,d=null,f=[],p=0;for(let t of l.columns){let i=t.name;if((a=t).type===`scalarType`&&a.scalarType?.type===`logicalType`&&a.scalarType.logicalType===0){let a=null;if(t.nullable){let t=zp(e,r),n=r.get(),i=vm(e,t.numValues,t.byteLength,r);r.set(n+t.byteLength),a=new Bp(i,t.numValues)}let o=zp(e,r);p=a?a.size():o.decompressedCount,u=Lm(e,t,r,i,o,a??p,n)}else if(jm(t)){let t=yp(e,r,1)[0];if(p===0){let t=r.get();p=zp(e,r).decompressedCount,r.set(t)}d=fm(e,t,r,p)}else{let n=Am(t)?yp(e,r,1)[0]:1;if(n===0)continue;let i=Tm(e,r,t,n,p);if(i)if(Array.isArray(i))for(let e of i)f.push(e);else f.push(i)}}let m=new ip(l.name,d,u,f,c);i.push(m),r.set(o)}var a;return i}(new Uint8Array(e));this.layers=t.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t.name]:new zm(t)})),{})}}class Vm{constructor(e,t){this.feature=e,this.type=e.type,this.properties=e.tags?e.tags:{},this.extent=t,`id`in e&&(typeof e.id==`string`?this.id=parseInt(e.id,10):typeof e.id!=`number`||isNaN(e.id)||(this.id=e.id))}loadGeometry(){let e=[],t=this.feature.type===1?[this.feature.geometry]:this.feature.geometry;for(let r of t){let t=[];for(let e of r)t.push(new n(e[0],e[1]));e.push(t)}return e}}let Hm=`_geojsonTileLayer`;function Um(e,t,n=``){t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||``),t.writeVarintField(5,e.extent||4096);let r={jsonPrefix:n,keys:[],values:[],keycache:{},valuecache:{}};for(let n=0;n<e.length;n++)r.feature=e.feature(n),t.writeMessage(2,Wm,r);let i=r.keys;for(let e of i)t.writeStringField(3,e);let a=r.values;for(let e of a)t.writeMessage(4,Ym,e)}function Wm(e,t){if(!e.feature)return;let n=e.feature;n.id!==void 0&&t.writeVarintField(1,n.id),t.writeMessage(2,Gm,e),t.writeVarintField(3,n.type),t.writeMessage(4,Jm,n)}function Gm(e,t){for(let n in e.feature?.properties){let r=e.feature.properties[n],i=e.keycache[n];if(r==null)continue;i===void 0&&(e.keys.push(n),i=e.keys.length-1,e.keycache[n]=i),t.writeVarint(i),typeof r!=`string`&&typeof r!=`boolean`&&typeof r!=`number`&&(r=e.jsonPrefix+JSON.stringify(r));let a=typeof r+`:`+r,o=e.valuecache[a];o===void 0&&(e.values.push(r),o=e.values.length-1,e.valuecache[a]=o),t.writeVarint(o)}}function Km(e,t){return(t<<3)+(7&e)}function qm(e){return e<<1^e>>31}function Jm(e,t){let n=e.loadGeometry(),r=e.type,i=0,a=0;for(let o of n){let n=1;r===1&&(n=o.length),t.writeVarint(Km(1,n));let s=r===3?o.length-1:o.length;for(let e=0;e<s;e++){e===1&&r!==1&&t.writeVarint(Km(2,s-1));let n=o[e].x-i,c=o[e].y-a;t.writeVarint(qm(n)),t.writeVarint(qm(c)),i+=n,a+=c}e.type===3&&t.writeVarint(Km(7,1))}}function Ym(e,t){let n=typeof e;n===`string`?t.writeStringField(1,e):n===`boolean`?t.writeBooleanField(7,e):n===`number`&&(e%1==0?e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e):t.writeDoubleField(3,e))}class Xm{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new ma(O,16,0),this.grid3D=new ma(O,16,0),this.featureIndexArray=new Wo,this.promoteId=t}insert(e,t,n,r,i,a){let o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,r,i);let s=a?this.grid3D:this.grid;for(let e of t){let t=[1/0,1/0,-1/0,-1/0];for(let n of e)t[0]=Math.min(t[0],n.x),t[1]=Math.min(t[1],n.y),t[2]=Math.max(t[2],n.x),t[3]=Math.max(t[3],n.y);t[0]<O&&t[1]<O&&t[2]>=0&&t[3]>=0&&s.insert(o,t[0],t[1],t[2],t[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=this.encoding===`mlt`?new Bm(this.rawTileData).layers:new Ll(new Pd(this.rawTileData)).layers,this.sourceLayerCoder=new Yf(this.vtLayers?Object.keys(this.vtLayers).sort():[Hm])),this.vtLayers}query(e,t,r,i){this.loadVTLayers();let a=e.params,o=O/e.tileSize/e.scale,s=_i(a.filter,a.globalState),c=e.queryGeometry,l=e.queryPadding*o,u=Jf.fromPoints(c),d=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),f=Jf.fromPoints(e.cameraQueryGeometry).expandBy(l),p=this.grid3D.query(f.minX,f.minY,f.maxX,f.maxY,((t,r,i,a)=>function(e,t,r,i,a){for(let n of e)if(t<=n.x&&r<=n.y&&i>=n.x&&a>=n.y)return!0;let o=[new n(t,r),new n(t,a),new n(i,a),new n(i,r)];if(e.length>2){for(let t of o)if(tc(e,t))return!0}for(let t=0;t<e.length-1;t++)if(nc(e[t],e[t+1],o))return!0;return!1}(e.cameraQueryGeometry,t-l,r-l,i+l,a+l)));for(let e of p)d.push(e);d.sort(Qm);let m={},h;for(let n of d){if(n===h)continue;h=n;let l=this.featureIndexArray.get(n),u=null;this.loadMatchingFeature(m,l.bucketIndex,l.sourceLayerIndex,l.featureIndex,s,a.layers,a.availableImages,t,r,i,((t,n,r)=>(u||=Vs(t),n.queryIntersectsFeature({queryGeometry:c,feature:t,featureState:r,geometry:u,zoom:this.z,transform:e.transform,pixelsToTileUnits:o,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation}))))}return m}loadMatchingFeature(e,t,n,r,i,a,o,s,c,l,u){let d=this.bucketLayerIDs[t];if(a&&!d.some((e=>a.has(e))))return;let f=this.sourceLayerCoder.decode(n),p=this.vtLayers[f].feature(r);if(i.needGeometry){let e=Hs(p,!0);if(!i.filter(new Ia(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!i.filter(new Ia(this.tileID.overscaledZ),p))return;let m=this.getId(p,f);for(let t of d){if(a&&!a.has(t))continue;let n=s[t];if(!n)continue;let i={};m&&l&&(i=l.getState(n.sourceLayer||Hm,m));let d=ie({},c[t]);d.paint=Zm(d.paint,n.paint,p,i,o),d.layout=Zm(d.layout,n.layout,p,i,o);let f=!u||u(p,n,i);if(!f)continue;let h=new Xf(p,this.z,this.x,this.y,m);h.layer=d;let g=e[t];g===void 0&&(g=e[t]=[]),g.push({featureIndex:r,feature:h,intersectionZ:f})}}lookupSymbolFeatures(e,t,n,r,i,a,o,s){let c={};this.loadVTLayers();let l=_i(i.filterSpec,i.globalState);for(let i of e)this.loadMatchingFeature(c,n,r,i,l,a,o,s,t);return c}hasLayer(e){for(let t of this.bucketLayerIDs)for(let n of t)if(e===n)return!0;return!1}getId(e,t){var n;let r=e.id;return this.promoteId&&(r=e.properties[typeof this.promoteId==`string`?this.promoteId:this.promoteId[t]],typeof r==`boolean`&&(r=Number(r)),r===void 0&&(n=e.properties)!=null&&n.cluster&&this.promoteId&&(r=Number(e.properties.cluster_id))),r}}function Zm(e,t,n,r,i){return oe(e,((e,a)=>{let o=t instanceof Ka?t.get(a):null;return o?.evaluate?o.evaluate(n,r,i):o}))}function Qm(e,t){return t-e}function $m(e,t,r,i,a){let o=[];for(let s of e){let e;for(let c=0;c<s.length-1;c++){let l=s[c],u=s[c+1];l.x<t&&u.x<t||(l.x<t?l=new n(t,l.y+(t-l.x)/(u.x-l.x)*(u.y-l.y))._round():u.x<t&&(u=new n(t,l.y+(t-l.x)/(u.x-l.x)*(u.y-l.y))._round()),l.y<r&&u.y<r||(l.y<r?l=new n(l.x+(r-l.y)/(u.y-l.y)*(u.x-l.x),r)._round():u.y<r&&(u=new n(l.x+(r-l.y)/(u.y-l.y)*(u.x-l.x),r)._round()),l.x>=i&&u.x>=i||(l.x>=i?l=new n(i,l.y+(i-l.x)/(u.x-l.x)*(u.y-l.y))._round():u.x>=i&&(u=new n(i,l.y+(i-l.x)/(u.x-l.x)*(u.y-l.y))._round()),l.y>=a&&u.y>=a||(l.y>=a?l=new n(l.x+(a-l.y)/(u.y-l.y)*(u.x-l.x),a)._round():u.y>=a&&(u=new n(l.x+(a-l.y)/(u.y-l.y)*(u.x-l.x),a)._round()),e&&l.equals(e[e.length-1])||(e=[l],o.push(e)),e.push(u)))))}}return o}function eh(e,t,n,r,i){switch(t){case 1:return function(e,t,n,r){let i=[];for(let a of e)for(let e of a){let a=r===0?e.x:e.y;a>=t&&a<=n&&i.push([e])}return i}(e,n,r,i);case 2:return nh(e,n,r,i,!1);case 3:return nh(e,n,r,i,!0)}return[]}function th(e,t,r,i,a){let o=i===0?rh:ih,s=[],c=[];for(let n=0;n<e.length-1;n++){let l=e[n],u=e[n+1],d=i===0?l.x:l.y,f=i===0?u.x:u.y,p=!1;d<t?f>t&&s.push(o(l,u,t)):d>r?f<r&&s.push(o(l,u,r)):s.push(l),f<t&&d>=t&&(s.push(o(l,u,t)),p=!0),f>r&&d<=r&&(s.push(o(l,u,r)),p=!0),!a&&p&&(c.push(s),s=[])}let l=e.length-1,u=i===0?e[l].x:e[l].y;return u>=t&&u<=r&&s.push(e[l]),a&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new n(s[0].x,s[0].y)),s.length>0&&c.push(s),c}function nh(e,t,n,r,i){let a=[];for(let o of e){let e=th(o,t,n,r,i);e.length>0&&a.push(...e)}return a}function rh(e,t,r){return new n(r,e.y+(r-e.x)/(t.x-e.x)*(t.y-e.y))}function ih(e,t,r){return new n(e.x+(r-e.y)/(t.y-e.y)*(t.x-e.x),r)}Y(`FeatureIndex`,Xm,{omit:[`rawTileData`,`sourceLayerCoder`]});class ah extends n{constructor(e,t,n,r){super(e,t),this.angle=n,r!==void 0&&(this.segment=r)}clone(){return new ah(this.x,this.y,this.angle,this.segment)}}function oh(e,t,n,r,i){if(t.segment===void 0||n===0)return!0;let a=t,o=t.segment+1,s=0;for(;s>-n/2;){if(o--,o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;let c=[],l=0;for(;s<n/2;){let t=e[o],n=e[o+1];if(!n)return!1;let a=e[o-1].angleTo(t)-t.angleTo(n);for(a=Math.abs((a+3*Math.PI)%(2*Math.PI)-Math.PI),c.push({distance:s,angleDelta:a}),l+=a;s-c[0].distance>r;)l-=c.shift().angleDelta;if(l>i)return!1;o++,s+=t.dist(n)}return!0}function sh(e){let t=0;for(let n=0;n<e.length-1;n++)t+=e[n].dist(e[n+1]);return t}function ch(e,t,n){return e?.6*t*n:0}function lh(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function uh(e,t,n,r,i,a){let o=ch(n,i,a),s=lh(n,r)*a,c=0,l=sh(e)/2;for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1],a=r.dist(i);if(c+a>l){let u=(l-c)/a,d=new ah(Sn.number(r.x,i.x,u),Sn.number(r.y,i.y,u),i.angleTo(r),n);return d._round(),!o||oh(e,d,s,o,t)?d:void 0}c+=a}}function dh(e,t,n,r,i,a,o,s,c){let l=ch(r,a,o),u=lh(r,i),d=u*o,f=e[0].x===0||e[0].x===c||e[0].y===0||e[0].y===c;return t-d<t/4&&(t=d+t/4),fh(e,f?t/2*s%t:(u/2+2*a)*o*s%t,t,l,n,d,f,!1,c)}function fh(e,t,n,r,i,a,o,s,c){let l=a/2,u=sh(e),d=0,f=t-n,p=[];for(let t=0;t<e.length-1;t++){let o=e[t],s=e[t+1],m=o.dist(s),h=s.angleTo(o);for(;f+n<d+m;){f+=n;let g=(f-d)/m,_=Sn.number(o.x,s.x,g),v=Sn.number(o.y,s.y,g);if(_>=0&&_<c&&v>=0&&v<c&&f-l>=0&&f+l<=u){let n=new ah(_,v,h,t);n._round(),r&&!oh(e,n,a,r,i)||p.push(n)}}d+=m}return s||p.length||o||(p=fh(e,d/2,n,r,i,a,o,!0,c)),p}function ph(e,t,r,i){let a=[],o=e.image,s=o.pixelRatio,c=o.paddedRect.w-2,l=o.paddedRect.h-2,u={x1:e.left,y1:e.top,x2:e.right,y2:e.bottom},d=o.stretchX||[[0,c]],f=o.stretchY||[[0,l]],p=(e,t)=>e+t[1]-t[0],m=d.reduce(p,0),h=f.reduce(p,0),g=c-m,_=l-h,v=0,y=m,b=0,x=h,S=0,C=g,w=0,T=_;if(o.content&&i){let t=o.content,n=t[2]-t[0],r=t[3]-t[1];(o.textFitWidth||o.textFitHeight)&&(u=lf(e)),v=mh(d,0,t[0]),b=mh(f,0,t[1]),y=mh(d,t[0],t[2]),x=mh(f,t[1],t[3]),S=t[0]-v,w=t[1]-b,C=n-y,T=r-x}let E=u.x1,D=u.y1,O=u.x2-E,k=u.y2-D,A=(e,i,a,c)=>{let l=gh(e.stretch-v,y,O,E),u=_h(e.fixed-S,C,e.stretch,m),d=gh(i.stretch-b,x,k,D),f=_h(i.fixed-w,T,i.stretch,h),p=gh(a.stretch-v,y,O,E),g=_h(a.fixed-S,C,a.stretch,m),_=gh(c.stretch-b,x,k,D),A=_h(c.fixed-w,T,c.stretch,h),j=new n(l,d),ee=new n(p,d),M=new n(p,_),te=new n(l,_),ne=new n(u/s,f/s),N=new n(g/s,A/s),re=t*Math.PI/180;if(re){let e=Math.sin(re),t=Math.cos(re),n=[t,-e,e,t];j._matMult(n),ee._matMult(n),te._matMult(n),M._matMult(n)}let ie=e.stretch+e.fixed,ae=i.stretch+i.fixed;return{tl:j,tr:ee,bl:te,br:M,tex:{x:o.paddedRect.x+1+ie,y:o.paddedRect.y+1+ae,w:a.stretch+a.fixed-ie,h:c.stretch+c.fixed-ae},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:ne,pixelOffsetBR:N,minFontScaleX:C/s/O,minFontScaleY:T/s/k,isSDF:r}};if(i&&(o.stretchX||o.stretchY)){let e=hh(d,g,m),t=hh(f,_,h);for(let n=0;n<e.length-1;n++){let r=e[n],i=e[n+1];for(let e=0;e<t.length-1;e++)a.push(A(r,t[e],i,t[e+1]))}}else a.push(A({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:c+1},{fixed:0,stretch:l+1}));return a}function mh(e,t,n){let r=0;for(let i of e)r+=Math.max(t,Math.min(n,i[1]))-Math.max(t,Math.min(n,i[0]));return r}function hh(e,t,n){let r=[{fixed:-1,stretch:0}];for(let[t,n]of e){let e=r[r.length-1];r.push({fixed:t-e.stretch,stretch:e.stretch}),r.push({fixed:t-e.stretch,stretch:e.stretch+(n-t)})}return r.push({fixed:t+1,stretch:n}),r}function gh(e,t,n,r){return e/t*n+r}function _h(e,t,n,r){return e-t*n/r}Y(`Anchor`,ah);class vh{constructor(e,t,r,i,a,o,s,c,l,u){if(this.boxStartIndex=e.length,l){let e=o.top,t=o.bottom,n=o.collisionPadding;n&&(e-=n[1],t+=n[3]);let r=t-e;r>0&&(r=Math.max(10,r),this.circleDiameter=r)}else{let l=o.image?.content&&(o.image.textFitWidth||o.image.textFitHeight)?lf(o):{x1:o.left,y1:o.top,x2:o.right,y2:o.bottom};l.y1=l.y1*s-c[0],l.y2=l.y2*s+c[2],l.x1=l.x1*s-c[3],l.x2=l.x2*s+c[1];let d=o.collisionPadding;if(d&&(l.x1-=d[0]*s,l.y1-=d[1]*s,l.x2+=d[2]*s,l.y2+=d[3]*s),u){let e=new n(l.x1,l.y1),t=new n(l.x2,l.y1),r=new n(l.x1,l.y2),i=new n(l.x2,l.y2),a=u*Math.PI/180;e._rotate(a),t._rotate(a),r._rotate(a),i._rotate(a),l.x1=Math.min(e.x,t.x,r.x,i.x),l.x2=Math.max(e.x,t.x,r.x,i.x),l.y1=Math.min(e.y,t.y,r.y,i.y),l.y2=Math.max(e.y,t.y,r.y,i.y)}e.emplaceBack(t.x,t.y,l.x1,l.y1,l.x2,l.y2,r,i,a)}this.boxEndIndex=e.length}}class yh{constructor(e=[],t=(e,t)=>e<t?-1:+(e>t)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:n}=this,r=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(n(r,a)>=0)break;t[e]=a,e=i}t[e]=r}_down(e){let{data:t,compare:n}=this,r=this.length>>1,i=t[e];for(;e<r;){let r=1+(e<<1),a=r+1;if(a<this.length&&n(t[a],t[r])<0&&(r=a),n(t[r],i)>=0)break;t[e]=t[r],e=r}t[e]=i}}function bh(e,t=1){let r=Jf.fromPoints(e[0]),i=Math.min(r.width(),r.height()),a=i/2,o=new yh([],xh),{minX:s,minY:c,maxX:l,maxY:u}=r;if(i===0)return new n(s,c);for(let t=s;t<l;t+=i)for(let n=c;n<u;n+=i)o.push(new Sh(t+a,n+a,a,e));let d=function(e){let t=0,n=0,r=0,i=e[0];for(let e=0,a=i.length,o=a-1;e<a;o=e++){let a=i[e],s=i[o],c=a.x*s.y-s.x*a.y;n+=(a.x+s.x)*c,r+=(a.y+s.y)*c,t+=3*c}return new Sh(n/t,r/t,0,e)}(e),f=d;for(;o.length;){let n=o.pop();(n.d>f.d||!f.d)&&(f=n),n.max-f.d<=t||(a=n.h/2,o.push(new Sh(n.p.x-a,n.p.y-a,a,e)),o.push(new Sh(n.p.x+a,n.p.y-a,a,e)),o.push(new Sh(n.p.x-a,n.p.y+a,a,e)),o.push(new Sh(n.p.x+a,n.p.y+a,a,e)))}return d.d>0&&f.d-d.d<=t?d.p:f.p}function xh(e,t){return t.max-e.max}class Sh{constructor(e,t,r,i){this.p=new n(e,t),this.h=r,this.d=function(e,t){let n=!1,r=1/0;for(let i of t)for(let t=0,a=i.length,o=a-1;t<a;o=t++){let a=i[t],s=i[o];a.y>e.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(n=!n),r=Math.min(r,$s(e,a,s))}return(n?1:-1)*Math.sqrt(r)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}}var Ch;e.aN=void 0,(Ch=e.aN||={})[Ch.center=1]=`center`,Ch[Ch.left=2]=`left`,Ch[Ch.right=3]=`right`,Ch[Ch.top=4]=`top`,Ch[Ch.bottom=5]=`bottom`,Ch[Ch[`top-left`]=6]=`top-left`,Ch[Ch[`top-right`]=7]=`top-right`,Ch[Ch[`bottom-left`]=8]=`bottom-left`,Ch[Ch[`bottom-right`]=9]=`bottom-right`;let wh=1/0;function Th(e,t){return t[1]===wh?function(e,t){let n=0,r=0;t<0&&(t=0);let i=t/Math.SQRT2;switch(e){case`top-right`:case`top-left`:r=i-7;break;case`bottom-right`:case`bottom-left`:r=7-i;break;case`bottom`:r=7-t;break;case`top`:r=t-7}switch(e){case`top-right`:case`bottom-right`:n=-i;break;case`top-left`:case`bottom-left`:n=i;break;case`left`:n=t;break;case`right`:n=-t}return[n,r]}(e,t[0]):function(e,t,n){let r=0,i=0;switch(t=Math.abs(t),n=Math.abs(n),e){case`top-right`:case`top-left`:case`top`:i=n-7;break;case`bottom-right`:case`bottom-left`:case`bottom`:i=7-n}switch(e){case`top-right`:case`bottom-right`:case`right`:r=-t;break;case`top-left`:case`bottom-left`:case`left`:r=t}return[r,i]}(e,t[0],t[1])}function Eh(e,t,n){let r=e.layout,i=r.get(`text-variable-anchor-offset`)?.evaluate(t,{},n);if(i){let e=i.values,t=[];for(let n=0;n<e.length;n+=2){let r=t[n]=e[n],i=e[n+1].map((e=>e*xd));r.startsWith(`top`)?i[1]-=7:r.startsWith(`bottom`)&&(i[1]+=7),t[n+1]=i}return new Jt(t)}let a=r.get(`text-variable-anchor`);if(a){let i;i=e._unevaluatedLayout.getValue(`text-radial-offset`)===void 0?r.get(`text-offset`).evaluate(t,{},n).map((e=>e*xd)):[r.get(`text-radial-offset`).evaluate(t,{},n)*xd,wh];let o=[];for(let e of a)o.push(e,Th(e,i));return new Jt(o)}return null}function Dh(e){switch(e){case`right`:case`top-right`:case`bottom-right`:return`right`;case`left`:case`top-left`:case`bottom-left`:return`left`}return`center`}function Oh(t,n,r,i,a,o,s,c,l,u,d,f){let p=o.textMaxSize.evaluate(n,{});p===void 0&&(p=s);let m=t.layers[0].layout,h=m.get(`icon-offset`).evaluate(n,{},d),g=Ah(r.horizontal),_=s/24,v=t.tilePixelRatio*_,y=t.tilePixelRatio*p/24,b=t.tilePixelRatio*c,x=t.tilePixelRatio*m.get(`symbol-spacing`),S=m.get(`text-padding`)*t.tilePixelRatio,C=function(e,t,n,r=1){let i=e.get(`icon-padding`).evaluate(t,{},n)?.values;return[i[0]*r,i[1]*r,i[2]*r,i[3]*r]}(m,n,d,t.tilePixelRatio),w=m.get(`text-max-angle`)/180*Math.PI,T=m.get(`text-rotation-alignment`)!==`viewport`&&m.get(`symbol-placement`)!==`point`,E=m.get(`icon-rotation-alignment`)===`map`&&m.get(`symbol-placement`)!==`point`,D=m.get(`symbol-placement`),k=x/2,A=m.get(`icon-text-fit`),j;i&&A!==`none`&&(t.allowVerticalPlacement&&r.vertical&&(j=uf(i,r.vertical,A,m.get(`icon-text-fit-padding`),h,_)),g&&(i=uf(i,g,A,m.get(`icon-text-fit-padding`),h,_)));let ee=d?f.line.getGranularityForZoomLevel(d.z):1,M=(c,f)=>{f.x<0||f.x>=O||f.y<0||f.y>=O||function(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T){let E=t.addToLineVertexArray(n,r),D,O,k,A,j=0,ee=0,M=0,te=0,ne=-1,N=-1,re={},ie=_s(``);if(t.allowVerticalPlacement&&i.vertical){let e=c.layout.get(`text-rotate`).evaluate(x,{},w)+90;k=new vh(l,n,u,d,f,i.vertical,p,m,h,e),s&&(A=new vh(l,n,u,d,f,s,_,v,h,e))}if(a){let r=c.layout.get(`icon-rotate`).evaluate(x,{}),i=c.layout.get(`icon-text-fit`)!==`none`,o=ph(a,r,C,i),p=s?ph(s,r,C,i):void 0;O=new vh(l,n,u,d,f,a,_,v,!1,r),j=4*o.length;let m=t.iconSizeData,h=null;m.kind===`source`?(h=[128*c.layout.get(`icon-size`).evaluate(x,{})],h[0]>df&&ue(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):m.kind===`composite`&&(h=[128*S.compositeIconSizes[0].evaluate(x,{},w),128*S.compositeIconSizes[1].evaluate(x,{},w)],(h[0]>df||h[1]>df)&&ue(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,o,h,b,y,x,e.ax.none,n,E.lineStartIndex,E.lineLength,-1,w),ne=t.icon.placedSymbolArray.length-1,p&&(ee=4*p.length,t.addSymbols(t.icon,p,h,b,y,x,e.ax.vertical,n,E.lineStartIndex,E.lineLength,-1,w),N=t.icon.placedSymbolArray.length-1)}let ae=Object.keys(i.horizontal);for(let r of ae){let a=i.horizontal[r];D||=(ie=_s(a.text),new vh(l,n,u,d,f,a,p,m,h,c.layout.get(`text-rotate`).evaluate(x,{},w)));let s=a.positionedLines.length===1;if(M+=kh(t,n,a,o,c,h,x,g,E,i.vertical?e.ax.horizontal:e.ax.horizontalOnly,s?ae:[r],re,ne,S,w),s)break}i.vertical&&(te+=kh(t,n,i.vertical,o,c,h,x,g,E,e.ax.vertical,[`vertical`],re,N,S,w));let oe=D?D.boxStartIndex:t.collisionBoxArray.length,se=D?D.boxEndIndex:t.collisionBoxArray.length,ce=k?k.boxStartIndex:t.collisionBoxArray.length,le=k?k.boxEndIndex:t.collisionBoxArray.length,de=O?O.boxStartIndex:t.collisionBoxArray.length,fe=O?O.boxEndIndex:t.collisionBoxArray.length,pe=A?A.boxStartIndex:t.collisionBoxArray.length,me=A?A.boxEndIndex:t.collisionBoxArray.length,he=-1,ge=(e,t)=>e?.circleDiameter?Math.max(e.circleDiameter,t):t;he=ge(D,he),he=ge(k,he),he=ge(O,he),he=ge(A,he);let _e=+(he>-1);_e&&(he*=T/xd),t.glyphOffsetArray.length>=bf.MAX_GLYPHS&&ue(`Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907`),x.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey);let ve=Eh(c,x,w),[ye,be]=function(t,n){let r=t.length,i=n?.values;if(i?.length>0)for(let n=0;n<i.length;n+=2){let r=i[n+1];t.emplaceBack(e.aN[i[n]],r[0],r[1])}return[r,t.length]}(t.textAnchorOffsets,ve);t.symbolInstances.emplaceBack(n.x,n.y,re.right>=0?re.right:-1,re.center>=0?re.center:-1,re.left>=0?re.left:-1,re.vertical||-1,ne,N,ie,oe,se,ce,le,de,fe,pe,me,u,M,te,j,ee,_e,0,p,he,ye,be)}(t,f,c,r,i,a,j,t.layers[0],t.collisionBoxArray,n.index,n.sourceLayerIndex,t.index,v,[S,S,S,S],T,l,b,C,E,h,n,o,u,d,s)};if(D===`line`)for(let e of $m(n.geometry,0,0,O,O)){let n=yl(e,ee),a=dh(n,x,w,r.vertical||g,i,24,y,t.overscaling,O);for(let e of a)g&&jh(t,g.text,k,e)||M(n,e)}else if(D===`line-center`){for(let e of n.geometry)if(e.length>1){let t=yl(e,ee),n=uh(t,w,r.vertical||g,i,24,y);n&&M(t,n)}}else if(n.type===`Polygon`)for(let e of sr(n.geometry,0)){let t=bh(e,16);M(yl(e[0],ee,!0),new ah(t.x,t.y,0))}else if(n.type===`LineString`)for(let e of n.geometry){let t=yl(e,ee);M(t,new ah(t[0].x,t[0].y,0))}else if(n.type===`Point`)for(let e of n.geometry)for(let t of e)M([t],new ah(t.x,t.y,0))}function kh(e,t,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=function(e,t,r,i,a,o,s,c){let l=i.layout.get(`text-rotate`).evaluate(o,{})*Math.PI/180,u=[];for(let e of t.positionedLines)for(let i of e.positionedGlyphs){if(!i.rect)continue;let o=i.rect||{},d=4,f=!0,p=1,m=0,h=(a||c)&&i.vertical,g=i.metrics.advance*i.scale/2;if(c&&t.verticalizable&&(m=e.lineOffset/2-(i.imageName?-(xd-i.metrics.width*i.scale)/2:(i.scale-1)*xd)),i.imageName){let e=s[i.imageName];f=e.sdf,p=e.pixelRatio,d=1/p}let _=a?[i.x+g,i.y]:[0,0],v=a?[0,0]:[i.x+g+r[0],i.y+r[1]-m],y=[0,0];h&&(y=v,v=[0,0]);let b=i.metrics.isDoubleResolution?2:1,x=(i.metrics.left-d)*i.scale-g+v[0],S=(-i.metrics.top-d)*i.scale+v[1],C=x+o.w/b*i.scale/p,w=S+o.h/b*i.scale/p,T=new n(x,S),E=new n(C,S),D=new n(x,w),O=new n(C,w);if(h){let e=new n(-g,g- -17),t=-Math.PI/2,r=12-g,a=new n(22-r,-(i.imageName?r:0)),o=new n(...y);T._rotateAround(t,e)._add(a)._add(o),E._rotateAround(t,e)._add(a)._add(o),D._rotateAround(t,e)._add(a)._add(o),O._rotateAround(t,e)._add(a)._add(o)}if(l){let e=Math.sin(l),t=Math.cos(l),n=[t,-e,e,t];T._matMult(n),E._matMult(n),D._matMult(n),O._matMult(n)}let k=new n(0,0),A=new n(0,0);u.push({tl:T,tr:E,bl:D,br:O,tex:o,writingMode:t.writingMode,glyphOffset:_,sectionIndex:i.sectionIndex,isSDF:f,pixelOffsetTL:k,pixelOffsetBR:A,minFontScaleX:0,minFontScaleY:0})}return u}(0,r,c,a,o,s,i,e.allowVerticalPlacement),_=e.textSizeData,v=null;_.kind===`source`?(v=[128*a.layout.get(`text-size`).evaluate(s,{})],v[0]>df&&ue(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):_.kind===`composite`&&(v=[128*m.compositeTextSizes[0].evaluate(s,{},h),128*m.compositeTextSizes[1].evaluate(s,{},h)],(v[0]>df||v[1]>df)&&ue(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),e.addSymbols(e.text,g,v,c,o,s,u,t,l.lineStartIndex,l.lineLength,p,h);for(let t of d)f[t]=e.text.placedSymbolArray.length-1;return 4*g.length}function Ah(e){for(let t in e)return e[t];return null}function jh(e,t,n,r){let i=e.compareText;if(t in i){let e=i[t];for(let t=e.length-1;t>=0;t--)if(r.dist(e[t])<n)return!0}else i[t]=[];return i[t].push(r),!1}e.$=Ee,e.A=f,e.B=Ra,e.C=pa,e.D=X,e.E=ze,e.F=ca,e.G=function([e,t,n]){return t+=90,t*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(t)*Math.sin(n),y:e*Math.sin(t)*Math.sin(n),z:e*Math.cos(n)}},e.H=Sn,e.I=Xd,e.J=Ia,e.K=ua,e.L=function(e){if(pe==null){let t=e.navigator?e.navigator.userAgent:null;pe=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match(`Safari`)&&!t.match(`Chrome`)))}return pe},e.M=Ae,e.N=class{constructor(e,t){this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Af((()=>this.process())),this.subscription=ye(this.target,`message`,(e=>this.receive(e)),!1),this.globalScope=fe(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}unregisterMessageHandler(e){delete this.messageHandlers[e]}sendAsync(e,t){return new Promise(((n,r)=>{let i=Math.round(0xde0b6b3a7640000*Math.random()).toString(36).substring(0,10),a=t?ye(t.signal,`abort`,(()=>{a?.unsubscribe(),delete this.resolveRejects[i];let t={id:i,type:`<cancel>`,origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(t)}),jf):null;this.resolveRejects[i]={resolve:e=>{a?.unsubscribe(),n(e)},reject:e=>{a?.unsubscribe(),r(e)}};let o=[],s=Object.assign(Object.assign({},e),{id:i,sourceMapId:this.mapId,origin:location.origin,data:ya(e.data,o)});this.target.postMessage(s,{transfer:o})}))}receive(e){let t=e.data,n=t.id,r=[`file://`,`resource://android`,`null`],i=[t.origin,location.origin],a=t.origin===location.origin,o=i.some((e=>r.includes(e)));if((a||o)&&(!t.targetMapId||this.mapId===t.targetMapId)){if(t.type===`<cancel>`){delete this.tasks[n];let e=this.abortControllers[n];delete this.abortControllers[n],e&&e.abort();return}if(fe(self)||t.mustQueue)return this.tasks[n]=t,this.taskQueue.push(n),void this.invoker.trigger();this.processTask(n,t)}}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(e,t)}processTask(e,n){return t(this,void 0,void 0,(function*(){if(n.type===`<response>`){let t=this.resolveRejects[e];if(delete this.resolveRejects[e],!t)return;n.error?t.reject(A(ba(n.error))):t.resolve(ba(n.data));return}if(!this.messageHandlers[n.type])return void this.completeTask(e,Error(`Could not find a registered handler for ${n.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(`, `)}`));let t=ba(n.data),r=new AbortController;this.abortControllers[e]=r;try{let i=yield this.messageHandlers[n.type](n.sourceMapId,t,r);this.completeTask(e,null,i)}catch(t){this.completeTask(e,A(t))}}))}completeTask(e,t,n){let r=[];delete this.abortControllers[e];let i={id:e,type:`<response>`,sourceMapId:this.mapId,origin:location.origin,error:t?ya(t):null,data:ya(n,r)};this.target.postMessage(i,{transfer:r})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.O=function(){var e=new f(16);return f!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.P=n,e.Q=function(e,t,n){var r,i,a,o,s,c,l,u,d,f,p,m,h=n[0],g=n[1],_=n[2];return t===e?(e[12]=t[0]*h+t[4]*g+t[8]*_+t[12],e[13]=t[1]*h+t[5]*g+t[9]*_+t[13],e[14]=t[2]*h+t[6]*g+t[10]*_+t[14],e[15]=t[3]*h+t[7]*g+t[11]*_+t[15]):(i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],e[0]=r=t[0],e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=c,e[6]=l,e[7]=u,e[8]=d,e[9]=f,e[10]=p,e[11]=m,e[12]=r*h+s*g+d*_+t[12],e[13]=i*h+c*g+f*_+t[13],e[14]=a*h+l*g+p*_+t[14],e[15]=o*h+u*g+m*_+t[15]),e},e.R=wc,e.S=function(e,t,n){var r=n[0],i=n[1],a=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.T=Fc,e.U=function(e,t,n){var r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=n[0],b=n[1],x=n[2],S=n[3];return e[0]=y*r+b*s+x*d+S*h,e[1]=y*i+b*c+x*f+S*g,e[2]=y*a+b*l+x*p+S*_,e[3]=y*o+b*u+x*m+S*v,e[4]=(y=n[4])*r+(b=n[5])*s+(x=n[6])*d+(S=n[7])*h,e[5]=y*i+b*c+x*f+S*g,e[6]=y*a+b*l+x*p+S*_,e[7]=y*o+b*u+x*m+S*v,e[8]=(y=n[8])*r+(b=n[9])*s+(x=n[10])*d+(S=n[11])*h,e[9]=y*i+b*c+x*f+S*g,e[10]=y*a+b*l+x*p+S*_,e[11]=y*o+b*u+x*m+S*v,e[12]=(y=n[12])*r+(b=n[13])*s+(x=n[14])*d+(S=n[15])*h,e[13]=y*i+b*c+x*f+S*g,e[14]=y*a+b*l+x*p+S*_,e[15]=y*o+b*u+x*m+S*v,e},e.V=function(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n},e.W=Nf,e.X=re,e.Y=Lf,e.Z=If,e._=t,e.a=Te,e.a$=v,e.a0=l,e.a1=u,e.a2=ge,e.a3=Kf,e.a4=zf,e.a5=Bf,e.a6=O,e.a7=Hf,e.a8=Jf,e.a9=25,e.aA=E,e.aB=function(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)},e.aC=function(e){return e[0]=0,e[1]=0,e},e.aD=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},e.aE=gf,e.aF=C,e.aG=function(e,t,r,i){let a=t.y-e.y,o=t.x-e.x,s=i.y-r.y,c=i.x-r.x,l=s*o-c*a;if(l===0)return null;let u=(c*(e.y-r.y)-s*(e.x-r.x))/l;return new n(e.x+u*o,e.y+u*a)},e.aH=$m,e.aI=Ks,e.aJ=function(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x),i=Math.max(i,a.y);return[t,n,r,i]},e.aK=xd,e.aL=k,e.aM=function(e,t,n,r,i=!1){if(!n[0]&&!n[1])return[0,0];let a=i?r===`map`?-e.bearingInRadians:0:r===`viewport`?e.bearingInRadians:0;if(a){let e=Math.sin(a),t=Math.cos(a);n=[n[0]*t-n[1]*e,n[0]*e+n[1]*t]}return[i?n[0]:k(t,n[0],e.zoom),i?n[1]:k(t,n[1],e.zoom)]},e.aO=pf,e.aP=Dh,e.aQ=ef,e.aR=e=>e.type===`symbol`,e.aS=Zl,e.aT=oo,e.aU=ml,e.aV=Go,e.aW=ss,e.aX=is,e.aY=xe,e.aZ=Vf,e.a_=y,e.aa=Wf,e.ab=e=>{let t=window.document.createElement(`video`);return t.muted=!0,new Promise((n=>{t.onloadstart=()=>{n(t)};for(let n of e){let e=window.document.createElement(`source`);Pe(n)||(t.crossOrigin=`Anonymous`),e.src=n,t.appendChild(e)}}))},e.ac=I,e.ad=function(){return ae++},e.ae=Po,e.af=bf,e.ag=Hm,e.ah=_i,e.ai=Hs,e.aj=Xf,e.ak=function(e){let t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,n,r,i)=>{let a=r||i;return t[n]=!a||a.toLowerCase(),``})),t[`max-age`]){let e=parseInt(t[`max-age`],10);isNaN(e)?delete t[`max-age`]:t[`max-age`]=e}return t},e.al=N,e.am=85.051129,e.an=be,e.ao=function(e){return 2**e},e.ap=m,e.aq=Rf,e.ar=function(e){return Math.log(e)/Math.LN2},e.as=function(e){var t=e[0],n=e[1];return t*t+n*n},e.at=function(e){if(!e.length)return new Set;let t=Math.max(...e.map((e=>e.canonical.z))),n=1/0,r=-1/0,i=1/0,a=-1/0,o=[];for(let s of e){let{x:e,y:c,z:l}=s.canonical,u=2**(t-l),d=e*u,f=c*u;o.push({id:s,x:d,y:f}),d<n&&(n=d),d>r&&(r=d),f<i&&(i=f),f>a&&(a=f)}let s=new Set;for(let e of o)e.x!==n&&e.x!==r&&e.y!==i&&e.y!==a||s.add(e.id);return s},e.au=function(e,t){let n=Math.abs(2*e.wrap)-+(e.wrap<0),r=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||r-n||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x},e.av=class{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(let e in this.data)for(let t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,n){let r=e.wrapped().key;this.data[r]===void 0&&(this.data[r]=[]);let i={value:t,timeout:void 0};if(n!==void 0&&(i.timeout=setTimeout((()=>{this.remove(e,i)}),n)),this.data[r].push(i),this.order.push(r),this.order.length>this.max){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){let t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){let t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;let n=e.wrapped().key,r=t===void 0?0:this.data[n].indexOf(t),i=this.data[n][r];return this.data[n].splice(r,1),i.timeout&&clearTimeout(i.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(i.value),this.order.splice(this.order.indexOf(n),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){let t=[];for(let n in this.data)for(let r of this.data[n])e(r.value)||t.push(r);for(let e of t)this.remove(e.value.tileID,e)}},e.aw=function(e,t){let n=0,r=0;if(e.kind===`constant`)r=e.layoutSize;else if(e.kind!==`source`){let{interpolationType:i,minZoom:a,maxZoom:o}=e,s=i?N(bn.interpolationFactor(i,t,a,o),0,1):0;e.kind===`camera`?r=Sn.number(e.minSize,e.maxSize,s):n=s}return{uSizeT:n,uSize:r}},e.ay=function(e,{uSize:t,uSizeT:n},{lowerSize:r,upperSize:i}){return e.kind===`source`?r/128:e.kind===`composite`?Sn.number(r/128,i/128,n):t},e.az=function(e,t){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14],_=t[15],v=n*s-r*o,y=n*c-i*o,b=n*l-a*o,x=r*c-i*s,S=r*l-a*s,C=i*l-a*c,w=u*h-d*m,T=u*g-f*m,E=u*_-p*m,D=d*g-f*h,O=d*_-p*h,k=f*_-p*g,A=v*k-y*O+b*D+x*E-S*T+C*w;return A?(e[0]=(s*k-c*O+l*D)*(A=1/A),e[1]=(i*O-r*k-a*D)*A,e[2]=(h*C-g*S+_*x)*A,e[3]=(f*S-d*C-p*x)*A,e[4]=(c*E-o*k-l*T)*A,e[5]=(n*k-i*E+a*T)*A,e[6]=(g*b-m*C-_*y)*A,e[7]=(u*C-f*b+p*y)*A,e[8]=(o*O-s*E+l*w)*A,e[9]=(r*E-n*O-a*w)*A,e[10]=(m*S-h*b+_*v)*A,e[11]=(d*b-u*S-p*v)*A,e[12]=(s*T-o*D-c*w)*A,e[13]=(n*D-r*T+i*w)*A,e[14]=(h*y-m*x-g*v)*A,e[15]=(u*x-d*y+f*v)*A,e):null},e.b=me,e.b$=Ts,e.b0=function(e){var t=new f(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.b1=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},e.b2=function(e,t){var n=t[0],r=t[1],i=t[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e},e.b3=b,e.b4=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},e.b5=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e},e.b6=g,e.b7=function(e,t,n){let r=t[0]*n[0]+t[1]*n[1]+t[2]*n[2];return r===0?null:(-(e[0]*n[0]+e[1]*n[1]+e[2]*n[2])-n[3])/r},e.b8=S,e.b9=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e},e.bA=T,e.bB=function(e,t,n){var r=n[0],i=n[1],a=n[2],o=n[3],s=t[0],c=t[1],l=t[2],u=i*l-a*c,d=a*s-r*l,f=r*c-i*s;return e[0]=s+o*(u+=u)+i*(f+=f)-a*(d+=d),e[1]=c+o*d+a*u-r*f,e[2]=l+o*f+r*d-i*u,e},e.bC=function(e,t,n){let r=(i=[e[0],e[1],e[2],t[0],t[1],t[2],n[0],n[1],n[2]])[0]*((u=i[8])*(o=i[4])-(s=i[5])*(l=i[7]))+i[1]*(-u*(a=i[3])+s*(c=i[6]))+i[2]*(l*a-o*c);var i,a,o,s,c,l,u;if(r===0)return null;let d=b([],[t[0],t[1],t[2]],[n[0],n[1],n[2]]),f=b([],[n[0],n[1],n[2]],[e[0],e[1],e[2]]),p=b([],[e[0],e[1],e[2]],[t[0],t[1],t[2]]),m=y([],d,-e[3]);return v(m,m,y([],f,-t[3])),v(m,m,y([],p,-n[3])),y(m,m,1/r),m},e.bD=Mf,e.bE=function(){return new Float64Array(4)},e.bF=function(e,t,n,r){var i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),a[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),a[2]=i[2],e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e},e.bG=function(e,t,n,r){var i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[0],a[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),a[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e},e.bH=function(e,t,n,r){var i=[],a=[];return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],a[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),a[1]=i[1],a[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),e[0]=a[0]+n[0],e[1]=a[1]+n[1],e[2]=a[2]+n[2],e},e.bI=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[8],u=t[9],d=t[10],f=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-l*r,e[1]=o*i-u*r,e[2]=s*i-d*r,e[3]=c*i-f*r,e[8]=a*r+l*i,e[9]=o*r+u*i,e[10]=s*r+d*i,e[11]=c*r+f*i,e},e.bJ=function(e,t){let n=j(e,360),r=j(t,360),i=r-n,a=r>n?i-360:i+360;return Math.abs(i)<Math.abs(a)?i:a},e.bK=function(e){return e[0]=0,e[1]=0,e[2]=0,e},e.bL=function(e,t,n,r){let i=Math.sqrt(e*e+t*t),a=Math.sqrt(n*n+r*r);e/=i,t/=i,n/=a,r/=a;let o=Math.acos(e*n+t*r);return-t*n+e*r>0?o:-o},e.bM=function(e,t){let n=j(e,2*Math.PI),r=j(t,2*Math.PI);return Math.min(Math.abs(n-r),Math.abs(n-r+2*Math.PI),Math.abs(n-r-2*Math.PI))},e.bN=function(){let e={},t=P.$version;for(let n in P.$root){let r=P.$root[n];if(r.required){let i=null;i=n===`version`?t:r.type===`array`?[]:{},i!=null&&(e[n]=i)}}return e},e.bO=Me,e.bP=xa,e.bQ=function e(t,n){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],n[r]))return!1;return!0}if(typeof t==`object`&&t&&n!==null){if(typeof n!=`object`||Object.keys(t).length!==Object.keys(n).length)return!1;for(let r in t)if(!e(t[r],n[r]))return!1;return!0}return t===n},e.bR=De,e.bS=function(e){e=e.slice();let t=Object.create(null);for(let n=0;n<e.length;n++)t[e[n].id]=e[n];for(let n=0;n<e.length;n++)`ref`in e[n]&&(e[n]=Ve(e[n],t[e[n].ref]));return e},e.bT=function(e,t){if(e.type===`custom`)return new kf(e,t);switch(e.type){case`background`:return new Of(e,t);case`circle`:return new gc(e,t);case`color-relief`:return new Rc(e,t);case`fill`:return new Dl(e,t);case`fill-extrusion`:return new ql(e,t);case`heatmap`:return new Oc(e,t);case`hillshade`:return new jc(e,t);case`line`:return new fd(e,t);case`raster`:return new no(e,t);case`symbol`:return new Tf(e,t)}},e.bU=e=>e.type===`raster`,e.bV=ce,e.bW=function(e,t){if(!e)return[{command:`setStyle`,args:[t]}];let n=[];try{if(!F(e.version,t.version))return[{command:`setStyle`,args:[t]}];F(e.center,t.center)||n.push({command:`setCenter`,args:[t.center]}),F(e.state,t.state)||n.push({command:`setGlobalState`,args:[t.state]}),F(e.centerAltitude,t.centerAltitude)||n.push({command:`setCenterAltitude`,args:[t.centerAltitude]}),F(e.zoom,t.zoom)||n.push({command:`setZoom`,args:[t.zoom]}),F(e.bearing,t.bearing)||n.push({command:`setBearing`,args:[t.bearing]}),F(e.pitch,t.pitch)||n.push({command:`setPitch`,args:[t.pitch]}),F(e.roll,t.roll)||n.push({command:`setRoll`,args:[t.roll]}),F(e.sprite,t.sprite)||n.push({command:`setSprite`,args:[t.sprite]}),F(e.glyphs,t.glyphs)||n.push({command:`setGlyphs`,args:[t.glyphs]}),F(e.transition,t.transition)||n.push({command:`setTransition`,args:[t.transition]}),F(e.light,t.light)||n.push({command:`setLight`,args:[t.light]}),F(e.terrain,t.terrain)||n.push({command:`setTerrain`,args:[t.terrain]}),F(e.sky,t.sky)||n.push({command:`setSky`,args:[t.sky]}),F(e.projection,t.projection)||n.push({command:`setProjection`,args:[t.projection]});let r={},i=[];(function(e,t,n,r){let i;for(i in t||={},e||={})Object.prototype.hasOwnProperty.call(e,i)&&(Object.prototype.hasOwnProperty.call(t,i)||We(i,n,r));for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(Object.prototype.hasOwnProperty.call(e,i)?F(e[i],t[i])||(e[i].type===`geojson`&&t[i].type===`geojson`&&Ke(e,t,i)?He(n,{command:`setGeoJSONSourceData`,args:[i,t[i].data]}):Ge(i,t,n,r)):Ue(i,t,n))})(e.sources,t.sources,i,r);let a=[];e.layers&&e.layers.forEach((e=>{`source`in e&&r[e.source]?n.push({command:`removeLayer`,args:[e.id]}):a.push(e)})),n=n.concat(i),function(e,t,n){t||=[];let r=(e||=[]).map(Je),i=t.map(Je),a=e.reduce(Ye,{}),o=t.reduce(Ye,{}),s=r.slice(),c=Object.create(null),l,u,d,f,p;for(let e=0,t=0;e<r.length;e++)l=r[e],Object.prototype.hasOwnProperty.call(o,l)?t++:(He(n,{command:`removeLayer`,args:[l]}),s.splice(s.indexOf(l,t),1));for(let e=0,t=0;e<i.length;e++)l=i[i.length-1-e],s[s.length-1-e]!==l&&(Object.prototype.hasOwnProperty.call(a,l)?(He(n,{command:`removeLayer`,args:[l]}),s.splice(s.lastIndexOf(l,s.length-t),1)):t++,f=s[s.length-e],He(n,{command:`addLayer`,args:[o[l],f]}),s.splice(s.length-e,0,l),c[l]=!0);for(let e=0;e<i.length;e++)if(l=i[e],u=a[l],d=o[l],!c[l]&&!F(u,d))if(F(u.source,d.source)&&F(u[`source-layer`],d[`source-layer`])&&F(u.type,d.type)){for(p in qe(u.layout,d.layout,n,l,null,`setLayoutProperty`),qe(u.paint,d.paint,n,l,null,`setPaintProperty`),F(u.filter,d.filter)||He(n,{command:`setFilter`,args:[l,d.filter]}),F(u.minzoom,d.minzoom)&&F(u.maxzoom,d.maxzoom)||He(n,{command:`setLayerZoomRange`,args:[l,d.minzoom,d.maxzoom]}),u)Object.prototype.hasOwnProperty.call(u,p)&&p!==`layout`&&p!==`paint`&&p!==`filter`&&p!==`metadata`&&p!==`minzoom`&&p!==`maxzoom`&&(p.indexOf(`paint.`)===0?qe(u[p],d[p],n,l,p.slice(6),`setPaintProperty`):F(u[p],d[p])||He(n,{command:`setLayerProperty`,args:[l,p,d[p]]}));for(p in d)Object.prototype.hasOwnProperty.call(d,p)&&!Object.prototype.hasOwnProperty.call(u,p)&&p!==`layout`&&p!==`paint`&&p!==`filter`&&p!==`metadata`&&p!==`minzoom`&&p!==`maxzoom`&&(p.indexOf(`paint.`)===0?qe(u[p],d[p],n,l,p.slice(6),`setPaintProperty`):F(u[p],d[p])||He(n,{command:`setLayerProperty`,args:[l,p,d[p]]}))}else He(n,{command:`removeLayer`,args:[l]}),f=s[s.lastIndexOf(l)+1],He(n,{command:`addLayer`,args:[d,f]})}(a,t.layers,n)}catch(e){console.warn(`Unable to compute style diff:`,e),n=[{command:`setStyle`,args:[t]}]}return n},e.bX=function(e){let t=[],n=e.id;return n===void 0&&t.push({message:`layers.${n}: missing required property "id"`}),e.render===void 0&&t.push({message:`layers.${n}: missing required method "render"`}),e.renderingMode&&e.renderingMode!==`2d`&&e.renderingMode!==`3d`&&t.push({message:`layers.${n}: property "renderingMode" must be either "2d" or "3d"`}),t},e.bY=oe,e.bZ=se,e.b_=class extends Ss{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}},e.ba=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]},e.bb=Gf,e.bc=qf,e.bd=function(e,t,n,r,i){var a=1/Math.tan(t/2);if(e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){var o=1/(r-i);e[10]=(i+r)*o,e[14]=2*i*r*o}else e[10]=-1,e[14]=-2*r;return e},e.be=function(e){var t=new f(16);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},e.bf=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[0],o=t[1],s=t[2],c=t[3],l=t[4],u=t[5],d=t[6],f=t[7];return t!==e&&(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[0]=a*i+l*r,e[1]=o*i+u*r,e[2]=s*i+d*r,e[3]=c*i+f*r,e[4]=l*i-a*r,e[5]=u*i-o*r,e[6]=d*i-s*r,e[7]=f*i-c*r,e},e.bg=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+l*r,e[5]=o*i+u*r,e[6]=s*i+d*r,e[7]=c*i+f*r,e[8]=l*i-a*r,e[9]=u*i-o*r,e[10]=d*i-s*r,e[11]=f*i-c*r,e},e.bh=function(){let e=new Float32Array(16);return m(e),e},e.bi=function(){let e=new Float64Array(16);return m(e),e},e.bj=function(){return new Float64Array(16)},e.bk=function(e,t,n){let r=new Float64Array(4);return T(r,e,t-90,n),r},e.bl=function(e,t,n,r){var i,a,o,s,c,l=t[0],u=t[1],f=t[2],p=t[3],m=n[0],h=n[1],g=n[2],_=n[3];return(a=l*m+u*h+f*g+p*_)<0&&(a=-a,m=-m,h=-h,g=-g,_=-_),1-a>d?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-r)*i)/o,c=Math.sin(r*i)/o):(s=1-r,c=r),e[0]=s*l+c*m,e[1]=s*u+c*h,e[2]=s*f+c*g,e[3]=s*p+c*_,e},e.bm=function(e){let t=new Float64Array(9);var n,r,i,a,o,s,c,l,u,d=(i=(r=e)[0])*(c=i+i),f=(a=r[1])*c,p,m=(o=r[2])*c,h=o*(l=a+a),g,_=(s=r[3])*c,v=s*l,y=s*(u=o+o);(n=t)[0]=1-(p=a*l)-(g=o*u),n[3]=f-y,n[6]=m+v,n[1]=f+y,n[4]=1-d-g,n[7]=h-_,n[2]=m-v,n[5]=h+_,n[8]=1-d-p;let b=xe(-Math.asin(N(t[2],-1,1))),x,S;return Math.hypot(t[5],t[8])<.001?(x=0,S=-xe(Math.atan2(t[3],t[4]))):(x=xe(t[5]===0&&t[8]===0?0:Math.atan2(t[5],t[8])),S=xe(t[1]===0&&t[0]===0?0:Math.atan2(t[1],t[0]))),{roll:x,pitch:b+90,bearing:S}},e.bn=function(e,t){return e.roll==t.roll&&e.pitch==t.pitch&&e.bearing==t.bearing},e.bo=V,e.bp=Cs,e.bq=hl,e.br=gl,e.bs=pl,e.bt=ee,e.bu=M,e.bv=Xt,e.bw=function(e,t,n,r,i){return ee(r,i,N((e-t)/(n-t),0,1))},e.bx=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e},e.by=j,e.bz=function(){return new Float64Array(3)},e.c=Oe,e.c$=si,e.c0=class extends Ss{constructor(e,t){super(e,t),this.current=Es}set(e){if(e[12]!==this.current[12]||e[0]!==this.current[0])return this.current=e,void this.gl.uniformMatrix4fv(this.location,!1,e);for(let t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}}},e.c1=ws,e.c2=class extends Ss{constructor(e,t){super(e,t),this.current=[0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]||(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}},e.c3=class extends Ss{constructor(e,t){super(e,t),this.current=[0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]||(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}},e.c4=p,e.c5=function(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=-n,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},e.c6=function(e,t,n){var r=t[0],i=t[1],a=t[2];return e[0]=r*n[0]+i*n[3]+a*n[6],e[1]=r*n[1]+i*n[4]+a*n[7],e[2]=r*n[2]+i*n[5]+a*n[8],e},e.c7=function(e,t,n,r,i,a,o){var s=1/(t-n),c=1/(r-i),l=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*c,e[14]=(o+a)*l,e[15]=1,e},e.c8=class extends Ss{constructor(e,t){super(e,t),this.current=[]}set(e){if(e!=this.current){this.current=e;let t=new Float32Array(4*e.length);for(let n=0;n<e.length;n++)t[4*n]=e[n].r,t[4*n+1]=e[n].g,t[4*n+2]=e[n].b,t[4*n+3]=e[n].a;this.gl.uniform4fv(this.location,t)}}},e.c9=class extends Ss{constructor(e,t){super(e,t),this.current=[]}set(e){if(e!=this.current){this.current=e;let t=new Float32Array(e);this.gl.uniform1fv(this.location,t)}}},e.cA=function(e,t){return Se[t]&&`touches`in e},e.cB=function(e){return Se[e]||Ce[e]},e.cC=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e},e.cD=function(e,t){let{x:n,y:r}=Hf.fromLngLat(t);return!(e<0||e>25||r<0||r>=1||n<0||n>=1)},e.cE=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.cF=class extends lo{},e.cG=je,e.cH=function(e,t){Oe.REGISTERED_PROTOCOLS[e]=t},e.cI=function(e){delete Oe.REGISTERED_PROTOCOLS[e]},e.cJ=function(e,t){let n={};for(let r=0;r<e.length;r++){let i=t&&t[e[r].id]||Ei(e[r]);t&&(t[e[r].id]=i);let a=n[i];a||=n[i]=[],a.push(e[r])}let r=[];for(let e in n)r.push(n[e]);return r},e.cK=Y,e.cL=Yf,e.cM=Xm,e.cN=Zd,e.cO=function(t){var n;t.bucket.createArrays(),t.bucket.tilePixelRatio=O/(512*t.bucket.overscaling),t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],i=r.layout,a=r._unevaluatedLayout._values,o={layoutIconSize:a[`icon-size`].possiblyEvaluate(new Ia(t.bucket.zoom+1),t.canonical),layoutTextSize:a[`text-size`].possiblyEvaluate(new Ia(t.bucket.zoom+1),t.canonical),textMaxSize:a[`text-size`].possiblyEvaluate(new Ia(18))};if(t.bucket.textSizeData.kind===`composite`){let{minZoom:e,maxZoom:n}=t.bucket.textSizeData;o.compositeTextSizes=[a[`text-size`].possiblyEvaluate(new Ia(e),t.canonical),a[`text-size`].possiblyEvaluate(new Ia(n),t.canonical)]}if(t.bucket.iconSizeData.kind===`composite`){let{minZoom:e,maxZoom:n}=t.bucket.iconSizeData;o.compositeIconSizes=[a[`icon-size`].possiblyEvaluate(new Ia(e),t.canonical),a[`icon-size`].possiblyEvaluate(new Ia(n),t.canonical)]}let s=i.get(`text-line-height`)*xd,c=i.get(`text-rotation-alignment`)!==`viewport`&&i.get(`symbol-placement`)!==`point`,l=i.get(`text-keep-upright`),u=i.get(`text-size`);for(let a of t.bucket.features){let d=i.get(`text-font`).evaluate(a,{},t.canonical).join(`,`),f=u.evaluate(a,{},t.canonical),p=o.layoutTextSize.evaluate(a,{},t.canonical),m=o.layoutIconSize.evaluate(a,{},t.canonical),h={horizontal:{},vertical:void 0},g=a.text,_,v=[0,0];if(g){let n=g.toString(),o=i.get(`text-letter-spacing`).evaluate(a,{},t.canonical)*xd,u=Ea(n)?o:0,m=i.get(`text-anchor`).evaluate(a,{},t.canonical),_=Eh(r,a,t.canonical);if(!_){let e=i.get(`text-radial-offset`).evaluate(a,{},t.canonical);v=e?Th(m,[e*xd,wh]):i.get(`text-offset`).evaluate(a,{},t.canonical).map((e=>e*xd))}let y=c?`center`:i.get(`text-justify`).evaluate(a,{},t.canonical),b=i.get(`symbol-placement`)===`point`?i.get(`text-max-width`).evaluate(a,{},t.canonical)*xd:1/0,x=()=>{t.bucket.allowVerticalPlacement&&Ta(n)&&(h.vertical=$d(g,t.glyphMap,t.glyphPositions,t.imagePositions,d,b,s,m,`left`,u,v,e.ax.vertical,!0,p,f))};if(!c&&_){let n=new Set;if(y===`auto`)for(let e=0;e<_.values.length;e+=2)n.add(Dh(_.values[e]));else n.add(y);let r=!1;for(let i of n)if(!h.horizontal[i])if(r)h.horizontal[i]=h.horizontal[0];else{let n=$d(g,t.glyphMap,t.glyphPositions,t.imagePositions,d,b,s,`center`,i,u,v,e.ax.horizontal,!1,p,f);n&&(h.horizontal[i]=n,r=n.positionedLines.length===1)}x()}else{y===`auto`&&(y=Dh(m));let r=$d(g,t.glyphMap,t.glyphPositions,t.imagePositions,d,b,s,m,y,u,v,e.ax.horizontal,!1,p,f);r&&(h.horizontal[y]=r),x(),Ta(n)&&c&&l&&(h.vertical=$d(g,t.glyphMap,t.glyphPositions,t.imagePositions,d,b,s,m,y,u,v,e.ax.vertical,!1,p,f))}}let y=!1;if(a.icon?.name){let e=t.imageMap[a.icon.name];e&&(_=cf(t.imagePositions[a.icon.name],i.get(`icon-offset`).evaluate(a,{},t.canonical),i.get(`icon-anchor`).evaluate(a,{},t.canonical)),y=!!e.sdf,t.bucket.sdfIcons===void 0?t.bucket.sdfIcons=y:t.bucket.sdfIcons!==y&&ue(`Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer`),(e.pixelRatio!==t.bucket.pixelRatio||i.get(`icon-rotate`).constantOr(1)!==0)&&(t.bucket.iconsNeedLinear=!0))}let b=Ah(h.horizontal)||h.vertical;(n=t.bucket).iconsInText||(n.iconsInText=!!b&&b.iconsInText),(b||_)&&Oh(t.bucket,a,h,_,t.imageMap,o,p,m,v,y,t.canonical,t.subdivisionGranularity)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()},e.cP=Cl,e.cQ=Vl,e.cR=od,e.cS=function(e,t=``){let n=new Pd;return function(e,t,n=``){for(let r in e.layers)t.writeMessage(3,((e,t)=>Um(e,t,n)),e.layers[r])}(e,n,t),n.finish()},e.cT=function(e,t,n,r,i,a){let o=eh(e,t,n,i,0);return o=eh(o,t,r,a,1),o},e.cU=class{constructor(e){this.maxEntries=e,this.map=new Map}get(e){let t=this.map.get(e);return t!==void 0&&(this.map.delete(e),this.map.set(e,t)),t}set(e,t){if(this.map.has(e))this.map.delete(e);else if(this.map.size>=this.maxEntries){let e=this.map.keys().next().value;this.map.delete(e)}this.map.set(e,t)}clear(){this.map.clear()}},e.cV=Ll,e.cW=Pd,e.cX=Bm,e.cY=function(e,n,r,i,a){return t(this,void 0,void 0,(function*(){if(u())try{return yield ge(e,n,r,i,a)}catch{}return function(e,t,n,r,i){let a=e.width,o=e.height;_e&&ve||(_e=new OffscreenCanvas(a,o),ve=_e.getContext(`2d`,{willReadFrequently:!0})),_e.width=a,_e.height=o,ve.drawImage(e,0,0,a,o);let s=ve.getImageData(t,n,r,i);return ve.clearRect(0,0,a,o),s.data}(e,n,r,i,a)}))},e.cZ=Ic,e.c_=class{constructor(e,t){this.layers={[Hm]:this},this.name=Hm,this.version=t?t.version:1,this.extent=t?t.extent:4096,this.length=e.length,this.features=e}feature(e){return new Vm(this.features[e],this.extent)}},e.ca=class extends So{},e.cb=vd,e.cc=class extends wo{},e.cd=Dc,e.ce=function(e){return e<=1?1:2**Math.ceil(Math.log(e)/Math.LN2)},e.cf=Ec,e.cg=function(e,t,n){var r=t[0],i=t[1],a=t[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return e[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/(o||=1),e[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,e[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,e},e.ch=class extends uo{},e.ci=class extends jo{},e.cj=function(e,t){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.ck=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],p=e[10],m=e[11],h=e[12],g=e[13],_=e[14],v=e[15],y=t[0],b=t[1],x=t[2],S=t[3],C=t[4],w=t[5],T=t[6],E=t[7],D=t[8],O=t[9],k=t[10],A=t[11],j=t[12],ee=t[13],M=t[14],te=t[15];return Math.abs(n-y)<=d*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(r-b)<=d*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=d*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-S)<=d*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(o-C)<=d*Math.max(1,Math.abs(o),Math.abs(C))&&Math.abs(s-w)<=d*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(c-T)<=d*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(l-E)<=d*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(u-D)<=d*Math.max(1,Math.abs(u),Math.abs(D))&&Math.abs(f-O)<=d*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(p-k)<=d*Math.max(1,Math.abs(p),Math.abs(k))&&Math.abs(m-A)<=d*Math.max(1,Math.abs(m),Math.abs(A))&&Math.abs(h-j)<=d*Math.max(1,Math.abs(h),Math.abs(j))&&Math.abs(g-ee)<=d*Math.max(1,Math.abs(g),Math.abs(ee))&&Math.abs(_-M)<=d*Math.max(1,Math.abs(_),Math.abs(M))&&Math.abs(v-te)<=d*Math.max(1,Math.abs(v),Math.abs(te))},e.cl=function(e,t){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},e.cm=e=>e.type===`circle`,e.cn=e=>e.type===`heatmap`,e.co=e=>e.type===`line`,e.cp=e=>e.type===`fill`,e.cq=e=>e.type===`fill-extrusion`,e.cr=e=>e.type===`hillshade`,e.cs=e=>e.type===`color-relief`,e.ct=e=>e.type===`background`,e.cu=e=>e.type===`custom`,e.cv=te,e.cw=function(e,t,n){if(t<=0)return e;let r=1/t;return n===void 0||Math.abs(n)<1e-10?Math.round(e*r)/r:(n>0?Math.ceil(e*r-1e-9):Math.floor(e*r+1e-10))/r},e.cx=function(e,t,n){let r=D(t.x-n.x,t.y-n.y),i=D(e.x-n.x,e.y-n.y);var a,o;return xe(Math.atan2(r[0]*i[1]-r[1]*i[0],(a=r)[0]*(o=i)[0]+a[1]*o[1]))},e.cy=ne,e.cz=function(e,t){if(!Ce[t])return!1;let n=(e?.target)?.ownerDocument?.defaultView||window;return e instanceof n.MouseEvent||e instanceof n.WheelEvent},e.d=A,e.d0=class{constructor(e,t){let n=(t=this.options=Object.assign({},td,t)).debug;if(n&&console.time(`preprocess data`),t.maxZoom<0||t.maxZoom>24)throw Error(`maxZoom should be in the 0-24 range`);if(t.promoteId&&t.generateId)throw Error(`promoteId and generateId cannot be used together.`);let r=cu(e,t);n&&(console.timeEnd(`preprocess data`),console.log(`index: maxZoom: %d, maxPoints: %d`,t.indexMaxZoom,t.indexMaxPoints),console.time(`generate tiles`)),r=Nu(r,t),t.updateable&&(this.source=r),this.initializeIndex(r,t)}initializeIndex(e,t){this.tileIndex=t.cluster?new Bu(t.clusterOptions):new $u(t),e.length&&this.tileIndex.initialize(e)}getTile(e,t,n){return t=+t,n=+n,(e=+e)<0||e>24?null:this.tileIndex.getTile(e,t,n)}updateData(e,t){let n=this.options;if(!n.updateable)throw Error("to update tile geojson `updateable` option must be set to true");let{affected:r,source:i}=function(e,t,n){let r=function(e,t){return e?{removeAll:e.removeAll,remove:new Set(e.remove||[]),add:new Map(e.add?.map((e=>[t.promoteId?e.properties[t.promoteId]:e.id,e]))),update:new Map(e.update?.map((e=>[e.id,e])))}:{remove:new Set,add:new Map,update:new Map}}(t,n),i=[];if(r.removeAll&&(i=e,e=[]),r.remove.size||r.add.size){let t=[];for(let n of e)(r.remove.has(n.id)||r.add.has(n.id))&&t.push(n);if(t.length){i.push(...t);let n=new Set(t.map((e=>e.id)));e=e.filter((e=>!n.has(e.id)))}if(r.add.size){let t=cu({type:`FeatureCollection`,features:Array.from(r.add.values())},n);t=Nu(t,n),i.push(...t),e.push(...t)}}if(r.update.size){let t=new Map,a=[];for(let n of e)r.update.has(n.id)?t.set(n.id,[...t.get(n.id)||[],n]):a.push(n);for(let[e,o]of r.update){let r=t.get(e);if(!r||r.length===0)continue;let s=Lu(r,o,n);i.push(...r,...s),a.push(...s)}e=a}return{affected:i,source:e}}(this.source,e,n);t&&({affected:r,source:i}=this.filterUpdate(i,r,t)),r.length&&(this.source=i,this.tileIndex.updateIndex(i,r,n))}filterUpdate(e,t,n){let r=new Set;for(let i of e)i.id!=null&&(n(mu(i))||(t.push(i),r.add(i.id)));return{affected:t,source:e=e.filter((e=>!r.has(e.id)))}}getData(){if(!this.options.updateable)throw Error("to retrieve data the `updateable` option must be set to true");return{type:`FeatureCollection`,features:this.source.map((e=>mu(e)))}}updateClusterOptions(e,t){let n=this.options.cluster;this.options.cluster=e,this.options.clusterOptions=t,n==e?this.tileIndex.updateIndex(this.source,[],this.options):this.initializeIndex(this.source,this.options)}getClusterExpansionZoom(e){return this.tileIndex.getClusterExpansionZoom(e)}getClusterChildren(e){return this.tileIndex.getChildren(e)}getClusterLeaves(e,t,n){return this.tileIndex.getLeaves(e,t,n)}},e.d1=Fa,e.e=ie,e.f=Pe,e.g=ke,e.h=e=>t(void 0,void 0,void 0,(function*(){if(e.byteLength===0)return createImageBitmap(new ImageData(1,1));let t=new Blob([new Uint8Array(e)],{type:`image/png`});try{return createImageBitmap(t)}catch(e){throw Error(`Could not load image because of ${A(e).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),e.i=fe,e.j=e=>new Promise(((t,n)=>{let r=new Image;r.onload=()=>{t(r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame((()=>r.src=he))},r.onerror=()=>n(Error(`Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`));let i=new Blob([new Uint8Array(e)],{type:`image/png`});r.src=e.byteLength?URL.createObjectURL(i):he})),e.k=(e,t)=>Ne(ie(e,{type:`json`}),t),e.l=Re,e.m=Ne,e.n=Le,e.o=(e,t)=>Ne(ie(e,{type:`arrayBuffer`}),t),e.p=Yd,e.q=function(e){return new Pd(e).readFields(Kd,[])},e.r=function(e){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(e))},e.s=ye,e.t=Cc,e.u=Xa,e.v=sa,e.w=ue,e.x=P,e.y=Va,e.z=la})),n(`worker`,[`./shared`],(function(e){class t{constructor(e,t){this.keyCache={},e&&this.replace(e,t)}replace(e,t){this._layerConfigs={},this._layers={},this.update(e,[],t)}update(t,n,r){for(let n of t){this._layerConfigs[n.id]=n;let t=this._layers[n.id]=e.bT(n,r);t._featureFilter=e.ah(t.filter,r),this.keyCache[n.id]&&delete this.keyCache[n.id]}for(let e of n)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};let i=e.cJ(Object.values(this._layerConfigs),this.keyCache);for(let t of i){let n=t.map((e=>this._layers[e.id])),r=n[0];if(r.isHidden())continue;let i=r.source||``,a=this.familiesBySource[i];a||=this.familiesBySource[i]={};let o=r.sourceLayer||e.ag,s=a[o];s||=a[o]=[],s.push(n)}}}class n{constructor(t){let n={},r=[];for(let e in t){let i=t[e],a=n[e]={};for(let e in i){let t=i[+e];if(!t||t.bitmap.width===0||t.bitmap.height===0)continue;let n={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};r.push(n),a[e]={rect:n,metrics:t.metrics}}}let{w:i,h:a}=e.p(r),o=new e.t({width:i||1,height:a||1});for(let r in t){let i=t[r];for(let t in i){let a=i[+t];if(!a||a.bitmap.width===0||a.bitmap.height===0)continue;let s=n[r][t].rect;e.t.copy(a.bitmap,o,{x:0,y:0},{x:s.x+1,y:s.y+1},a.bitmap)}}this.image=o,this.positions=n}}e.cK(`GlyphAtlas`,n);class r{constructor(t){this.tileID=new e.a3(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}parse(t,r,a,o,s){return e._(this,void 0,void 0,(function*(){this.status=`parsing`,this.data=t,this.collisionBoxArray=new e.ae;let c=new e.cL(Object.keys(t.layers).sort()),l=new e.cM(this.tileID,this.promoteId);l.bucketLayerIDs=[];let u={},d={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:a,subdivisionGranularity:s},f=r.familiesBySource[this.source];for(let n in f){let r=t.layers[n];if(!r)continue;r.version===1&&e.w(`Vector tile source "${this.source}" layer "${n}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let o=c.encode(n),s=[];for(let e=0;e<r.length;e++){let t=r.feature(e),i=l.getId(t,n);s.push({feature:t,id:i,index:e,sourceLayerIndex:o})}for(let t of f[n]){let n=t[0];n.source!==this.source&&e.w(`layer.source = ${n.source} does not equal this.source = ${this.source}`),n.isHidden(this.zoom,!0)||(i(t,this.zoom,a),(u[n.id]=n.createBucket({index:l.bucketLayerIDs.length,layers:t,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:o,sourceID:this.source})).populate(s,d,this.tileID.canonical),l.bucketLayerIDs.push(t.map((e=>e.id))))}}let p=e.bY(d.glyphDependencies,(e=>Object.keys(e).map(Number)));for(let e of this.inFlightDependencies)e?.abort();this.inFlightDependencies=[];let m=Promise.resolve({});if(Object.keys(p).length){let e=new AbortController;this.inFlightDependencies.push(e),m=o.sendAsync({type:`GG`,data:{stacks:p,source:this.source,tileID:this.tileID,type:`glyphs`}},e)}let h=Object.keys(d.iconDependencies),g=Promise.resolve({});if(h.length){let e=new AbortController;this.inFlightDependencies.push(e),g=o.sendAsync({type:`GI`,data:{icons:h,source:this.source,tileID:this.tileID,type:`icons`}},e)}let _=Object.keys(d.patternDependencies),v=Promise.resolve({});if(_.length){let e=new AbortController;this.inFlightDependencies.push(e),v=o.sendAsync({type:`GI`,data:{icons:_,source:this.source,tileID:this.tileID,type:`patterns`}},e)}let y=d.dashDependencies,b=Promise.resolve({});if(Object.keys(y).length){let e=new AbortController;this.inFlightDependencies.push(e),b=o.sendAsync({type:`GDA`,data:{dashes:y}},e)}let[x,S,C,w]=yield Promise.all([m,g,v,b]),T=new n(x),E=new e.cN(S,C);for(let t in u){let n=u[t];n instanceof e.af?(i(n.layers,this.zoom,a),e.cO({bucket:n,glyphMap:x,glyphPositions:T.positions,imageMap:S,imagePositions:E.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:d.subdivisionGranularity})):n.hasDependencies&&(n instanceof e.cP||n instanceof e.cQ||n instanceof e.cR)&&(i(n.layers,this.zoom,a),n.addFeatures(d,this.tileID.canonical,E.patternPositions,w))}return this.status=`done`,{buckets:Object.values(u).filter((e=>!e.isEmpty())),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:T.image,imageAtlas:E,dashPositions:w,glyphMap:this.returnDependencies?x:null,iconMap:this.returnDependencies?S:null,glyphPositions:this.returnDependencies?T.positions:null}}))}}function i(t,n,r){let i=new e.J(n);for(let e of t)e.recalculate(i,r)}class a{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(e,t){this.loading[e]=t}finishLoading(e){delete this.loading[e]}abort(e){let t=this.loading[e];t!=null&&t.abort&&(t.abort.abort(),delete this.loading[e])}setParsing(e,t){this.parsing[e]=t}consumeParsing(e){let t=this.parsing[e];if(t)return delete this.parsing[e],t}clearParsing(e){delete this.parsing[e]}markLoaded(e,t){this.loaded[e]=t}getLoaded(e){let t=this.loaded[e];if(t)return t}removeLoaded(e){delete this.loaded[e]}clearLoaded(){this.loaded={}}}class o{constructor(e){this.start=`${e}#start`,this.end=`${e}#end`,this.measure=e,performance.mark(this.start)}finish(){performance.mark(this.end);let e=performance.getEntriesByName(this.measure);return e.length===0&&(performance.measure(this.measure,this.start,this.end),e=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),e}}class s{constructor(e,t,n,r,i){this.type=e,this.properties=n||{},this.extent=i,this.pointsArray=t,this.id=r}loadGeometry(){return this.pointsArray.map((t=>t.map((t=>new e.P(t.x,t.y)))))}}class c{constructor(e,t,n){this.version=2,this._myFeatures=e,this.name=t,this.length=e.length,this.extent=n}feature(e){return this._myFeatures[e]}}class l{constructor(){this.layers={}}addLayer(e){this.layers[e.name]=e}}function u(t){let n=e.cS(t);return n.byteOffset===0&&n.byteLength===n.buffer.byteLength||(n=new Uint8Array(n)),{vectorTile:t,rawData:n.buffer}}function d(t,n,r){let{extent:i}=t,a=2**(r.z-n.z),o=(r.x-n.x*a)*i,l=(r.y-n.y*a)*i,u=[];for(let n=0;n<t.length;n++){let r=t.feature(n),c=r.loadGeometry();for(let e of c)for(let t of e)t.x=t.x*a-o,t.y=t.y*a-l;c=e.cT(c,r.type,-128,-128,i+128,i+128),c.length!==0&&u.push(new s(r.type,c,r.properties,r.id,i))}return new c(u,t.name,i)}class f{constructor(t,n,r){this.actor=t,this.layerIndex=n,this.availableImages=r,this.tileState=new a,this.overzoomedTileResultCache=new e.cU(1e3)}loadVectorTile(t,n){try{return{vectorTile:t.encoding===`mlt`?new e.cX(n):new e.cV(new e.cW(n)),rawData:n}}catch(r){let i=new Uint8Array(n),a=`Unable to parse the tile at ${t.request.url}, `;throw a+=i[0]===31&&i[1]===139?`please make sure the data is not gzipped and that you have configured the relevant header in the server`:`got error: ${e.d(r).message}`,Error(a)}}loadTile(t){return e._(this,void 0,void 0,(function*(){let{uid:n,overzoomParameters:i}=t;i&&(t.request=i.overzoomRequest);let a=this._startRequestTiming(t),o=new r(t);this.tileState.startLoading(n,o);let s=new AbortController;o.abort=s;try{let r=yield e.o(t.request,s);if(t.etag&&t.etag===r.etag)return this.tileState.finishLoading(n),this._getEtagUnmodifiedResult(r,a);let c=this.loadVectorTile(t,r.data);if(this.tileState.finishLoading(n),!c)return null;let{vectorTile:l,rawData:u}=c;i&&({vectorTile:l,rawData:u}=this._getOverzoomTile(t,l));let d=this._getExpiryData(r),f=this._finishRequestTiming(a);o.vectorTile=l,this.tileState.markLoaded(n,o);let p={rawData:u,cacheControl:d,resourceTiming:f};this.tileState.setParsing(n,p);try{return yield this._parseWorkerTile(o,t,p)}finally{this.tileState.clearParsing(n)}}catch(e){throw this.tileState.finishLoading(n),o.status=`done`,this.tileState.markLoaded(n,o),e}}))}_getEtagUnmodifiedResult(t,n){let r=this._getExpiryData(t),i=this._finishRequestTiming(n);return e.e({etagUnmodified:!0},r,i)}_parseWorkerTile(t,n,r){return e._(this,void 0,void 0,(function*(){let i=yield t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,n.subdivisionGranularity);if(r){let{rawData:t,cacheControl:a,resourceTiming:o}=r;i=e.e({rawTileData:t.slice(0),encoding:n.encoding},i,a,o)}return i}))}_getExpiryData({expires:e,cacheControl:t,etag:n}){let r={};return e&&(r.expires=e),t&&(r.cacheControl=t),n&&(r.etag=n),r}_startRequestTiming(e){if(e.request?.collectResourceTiming)return new o(e.request.url)}_finishRequestTiming(e){let t=e?.finish();return t?{resourceTiming:JSON.parse(JSON.stringify(t))}:{}}_getOverzoomTile(e,t){let{tileID:n,source:r,overzoomParameters:i}=e,{maxZoomTileID:a}=i,o=`${a.key}_${n.key}_${e.request?.url}`,s=this.overzoomedTileResultCache.get(o);if(s)return s;let c=new l,f=this.layerIndex.familiesBySource[r];for(let e in f){let r=t.layers[e];if(!r)continue;let i=d(r,a,n.canonical);i.length>0&&c.addLayer(i)}let p=u(c);return this.overzoomedTileResultCache.set(o,p),p}reloadTile(t){return e._(this,void 0,void 0,(function*(){let e=t.uid,n=this.tileState.getLoaded(e);if(!n)throw Error(`Should not be trying to reload a tile that was never loaded or has been removed`);if(n.showCollisionBoxes=t.showCollisionBoxes,n.status===`parsing`){let r=this.tileState.consumeParsing(e);return yield this._parseWorkerTile(n,t,r)}if(n.status===`done`&&n.vectorTile)return yield this._parseWorkerTile(n,t)}))}abortTile(t){return e._(this,void 0,void 0,(function*(){this.tileState.abort(t.uid)}))}removeTile(t){return e._(this,void 0,void 0,(function*(){this.tileState.removeLoaded(t.uid)}))}}class p{constructor(){this.loaded={}}loadTile(t){return e._(this,void 0,void 0,(function*(){let{uid:n,encoding:r,rawImageData:i,redFactor:a,greenFactor:o,blueFactor:s,baseShift:c}=t,l=i.width+2,u=i.height+2,d=e.b(i)?new e.R({width:l,height:u},yield e.cY(i,-1,-1,l,u)):i,f=new e.cZ(n,d,r,a,o,s,c);return this.loaded=this.loaded||{},this.loaded[n]=f,f}))}removeTile(e){let t=this.loaded,n=e.uid;t!=null&&t[n]&&delete t[n]}}class m{constructor(e,t,n,r=h){this.actor=e,this.layerIndex=t,this.availableImages=n,this.tileState=new a,this._createGeoJSONIndex=r}loadVectorTile(t){if(!this._geoJSONIndex)throw Error(`Unable to parse the data into a cluster or geojson`);let{z:n,x:r,y:i}=t.tileID.canonical,a=this._geoJSONIndex.getTile(n,r,i);return a?u(new e.c_(a.features,{version:2,extent:e.a6})):null}loadTile(t){return e._(this,void 0,void 0,(function*(){let{uid:e}=t,n=new r(t);n.abort=new AbortController;try{let r=this.loadVectorTile(t);if(!r)return null;let{vectorTile:i,rawData:a}=r;n.vectorTile=i,this.tileState.markLoaded(e,n);let o={rawData:a};this.tileState.setParsing(e,o);try{return yield this._parseWorkerTile(n,t,o)}finally{this.tileState.clearParsing(e)}}catch(t){throw n.status=`done`,this.tileState.markLoaded(e,n),t}}))}_reloadLoadedTile(t){return e._(this,void 0,void 0,(function*(){let e=t.uid,n=this.tileState.getLoaded(e);if(!n)throw Error(`Should not be trying to reload a tile that was never loaded or has been removed`);if(n.showCollisionBoxes=t.showCollisionBoxes,n.status===`parsing`){let r=this.tileState.consumeParsing(e);return yield this._parseWorkerTile(n,t,r)}if(n.status===`done`&&n.vectorTile)return yield this._parseWorkerTile(n,t)}))}_parseWorkerTile(t,n,r){return e._(this,void 0,void 0,(function*(){let i=yield t.parse(t.vectorTile,this.layerIndex,this.availableImages,this.actor,n.subdivisionGranularity);if(r){let{rawData:t}=r;i=e.e({rawTileData:t.slice(0),encoding:`mvt`},i)}return i}))}abortTile(t){return e._(this,void 0,void 0,(function*(){this.tileState.abort(t.uid)}))}removeTile(t){return e._(this,void 0,void 0,(function*(){this.tileState.removeLoaded(t.uid)}))}loadData(t){return e._(this,void 0,void 0,(function*(){var n;(n=this._pendingRequest)==null||n.abort();let r=this._startRequestTiming(t);this._pendingRequest=new AbortController;try{yield this.loadAndProcessGeoJSON(t,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let e={};return t.request&&(e.data=t.data),this._finishRequestTiming(r,t,e),e}catch(t){if(delete this._pendingRequest,!e.$(t))throw t;return{abandoned:!0}}}))}_startRequestTiming(e){if(e.request?.collectResourceTiming)return new o(e.request.url)}_finishRequestTiming(e,t,n){let r=e?.finish();r&&(n.resourceTiming={[t.source]:JSON.parse(JSON.stringify(r))})}reloadTile(e){return this.tileState.getLoaded(e.uid)?this._reloadLoadedTile(e):this.loadTile(e)}loadAndProcessGeoJSON(t,n){return e._(this,void 0,void 0,(function*(){if(t.request&&(t.data=(yield e.k(t.request,n)).data),t.data)return t.data=this._filterGeoJSON(t.data,t.filter),void(this._geoJSONIndex=this._createGeoJSONIndex(t.data,t));if(t.dataDiff)return this._geoJSONIndex??=this._createGeoJSONIndex({type:`FeatureCollection`,features:[]},t),void this._geoJSONIndex.updateData(t.dataDiff,this._getFilterPredicate(t.filter));if(t.updateCluster&&this._geoJSONIndex.updateClusterOptions(t.geojsonVtOptions.cluster,g(t)),this._geoJSONIndex==null)throw Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)}))}_filterGeoJSON(e,t){if(e.type!==`FeatureCollection`)return e;let n=this._getFilterPredicate(t);return n?{type:`FeatureCollection`,features:e.features.filter((e=>n(e)))}:e}_getFilterPredicate(t){if(typeof t!=`boolean`&&!t?.length)return;let n=e.c$(t,{type:`boolean`,"property-type":`data-driven`,overridable:!1,transition:!1});if(n.result===`error`)throw Error(n.value.map((e=>`${e.key}: ${e.message}`)).join(`, `));return e=>n.value.evaluate({zoom:0},e)}removeSource(t){return e._(this,void 0,void 0,(function*(){var e;(e=this._pendingRequest)==null||e.abort()}))}getClusterExpansionZoom(e){return this._geoJSONIndex.getClusterExpansionZoom(e.clusterId)}getClusterChildren(e){return this._geoJSONIndex.getClusterChildren(e.clusterId)}getClusterLeaves(e){return this._geoJSONIndex.getClusterLeaves(e.clusterId,e.limit,e.offset)}}function h(t,n){let r=e.e(n.geojsonVtOptions||{},{updateable:!0,clusterOptions:g(n)});return new e.d0(t,r)}function g({geojsonVtOptions:t,clusterProperties:n}){if(!n||!t.clusterOptions)return t.clusterOptions;let r={},i={},a={accumulated:null,zoom:0},o={properties:null},s=Object.keys(n);for(let t of s){let[a,o]=n[t],s=e.c$(o),c=e.c$(typeof a==`string`?[a,[`accumulated`],[`get`,t]]:a);r[t]=s.value,i[t]=c.value}return t.clusterOptions.map=e=>{o.properties=e;let t={};for(let e of s)t[e]=r[e].evaluate(a,o);return t},t.clusterOptions.reduce=(e,t)=>{o.properties=t;for(let t of s)a.accumulated=e[t],e[t]=i[t].evaluate(a,o)},t.clusterOptions}class _{constructor(t){this.self=t,this.actor=new e.N(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(e,t)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name "${e}" already registered.`);this.externalWorkerSourceTypes[e]=t},this.self.addProtocol=e.cH,this.self.removeProtocol=e.cI,this.self.registerRTLTextPlugin=t=>{e.d1.setMethods(t)},this.self.makeRequest=e.m,this.actor.registerMessageHandler(`LDT`,((e,t)=>this._getDEMWorkerSource(e,t.source).loadTile(t))),this.actor.registerMessageHandler(`RDT`,((t,n)=>e._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(t,n.source).removeTile(n)})))),this.actor.registerMessageHandler(`GCEZ`,((t,n)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,n.type,n.source).getClusterExpansionZoom(n)})))),this.actor.registerMessageHandler(`GCC`,((t,n)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,n.type,n.source).getClusterChildren(n)})))),this.actor.registerMessageHandler(`GCL`,((t,n)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,n.type,n.source).getClusterLeaves(n)})))),this.actor.registerMessageHandler(`LD`,((e,t)=>this._getWorkerSource(e,t.type,t.source).loadData(t))),this.actor.registerMessageHandler(`LT`,((e,t)=>this._getWorkerSource(e,t.type,t.source).loadTile(t))),this.actor.registerMessageHandler(`RT`,((e,t)=>this._getWorkerSource(e,t.type,t.source).reloadTile(t))),this.actor.registerMessageHandler(`AT`,((e,t)=>this._getWorkerSource(e,t.type,t.source).abortTile(t))),this.actor.registerMessageHandler(`RMT`,((e,t)=>this._getWorkerSource(e,t.type,t.source).removeTile(t))),this.actor.registerMessageHandler(`RS`,((t,n)=>e._(this,void 0,void 0,(function*(){if(!this.workerSources[t]?.[n.type]?.[n.source])return;let e=this.workerSources[t][n.type][n.source];delete this.workerSources[t][n.type][n.source],e.removeSource!==void 0&&e.removeSource(n)})))),this.actor.registerMessageHandler(`RM`,(t=>e._(this,void 0,void 0,(function*(){delete this.layerIndexes[t],delete this.availableImages[t],delete this.workerSources[t],delete this.demWorkerSources[t],this.globalStates.delete(t)})))),this.actor.registerMessageHandler(`SR`,((t,n)=>e._(this,void 0,void 0,(function*(){this.referrer=n})))),this.actor.registerMessageHandler(`SRPS`,((e,t)=>this._syncRTLPluginState(e,t))),this.actor.registerMessageHandler(`IS`,((t,n)=>e._(this,void 0,void 0,(function*(){this.self.importScripts(n)})))),this.actor.registerMessageHandler(`SI`,((e,t)=>this._setImages(e,t))),this.actor.registerMessageHandler(`UL`,((t,n)=>e._(this,void 0,void 0,(function*(){this._getLayerIndex(t).update(n.layers,n.removedIds,this._getGlobalState(t))})))),this.actor.registerMessageHandler(`UGS`,((t,n)=>e._(this,void 0,void 0,(function*(){let e=this._getGlobalState(t);for(let t in n)e[t]=n[t]})))),this.actor.registerMessageHandler(`SL`,((t,n)=>e._(this,void 0,void 0,(function*(){this._getLayerIndex(t).replace(n,this._getGlobalState(t))}))))}_getGlobalState(e){let t=this.globalStates.get(e);return t||(t={},this.globalStates.set(e,t)),t}_setImages(t,n){return e._(this,void 0,void 0,(function*(){this.availableImages[t]=n;for(let e in this.workerSources[t]){let r=this.workerSources[t][e];for(let e in r)r[e].availableImages=n}}))}_syncRTLPluginState(t,n){return e._(this,void 0,void 0,(function*(){return yield e.d1.syncState(n,this.self.importScripts)}))}_getAvailableImages(e){let t=this.availableImages[e];return t||=[],t}_getLayerIndex(e){let n=this.layerIndexes[e];return n||=this.layerIndexes[e]=new t,n}_getWorkerSource(e,t,n){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][n]){let r={sendAsync:(t,n)=>(t.targetMapId=e,this.actor.sendAsync(t,n))};switch(t){case`vector`:this.workerSources[e][t][n]=new f(r,this._getLayerIndex(e),this._getAvailableImages(e));break;case`geojson`:this.workerSources[e][t][n]=new m(r,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][t][n]=new this.externalWorkerSourceTypes[t](r,this._getLayerIndex(e),this._getAvailableImages(e))}}return this.workerSources[e][t][n]}_getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new p),this.demWorkerSources[e][t]}}return e.i(self)&&(self.worker=new _(self)),_})),n(`index`,[`exports`,`./shared`],(function(e,t){var n=`5.23.0`;function r(){var e=new t.A(4);return t.A!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}let i,a,o,s={frame(e,n,r,i){let a=i||window,o=a.requestAnimationFrame((e=>{s(),n(e)})),{unsubscribe:s}=t.s(e.signal,`abort`,(()=>{s(),a.cancelAnimationFrame(o),r(new t.a(e.signal.reason))}),!1)},frameAsync(e,t){return new Promise(((n,r)=>{this.frame(e,n,r,t)}))},getImageData(e,t=0){return this.getImageCanvasContext(e).getImageData(-t,-t,e.width+2*t,e.height+2*t)},getImageCanvasContext(e){let t=window.document.createElement(`canvas`),n=t.getContext(`2d`,{willReadFrequently:!0});if(!n)throw Error(`failed to create canvas 2d context`);return t.width=e.width,t.height=e.height,n.drawImage(e,0,0,e.width,e.height),n},resolveURL:e=>(i||=document.createElement(`a`),i.href=e,i.href),hardwareConcurrency:typeof navigator<`u`&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return o===void 0?!!matchMedia&&(a??=matchMedia(`(prefers-reduced-motion: reduce)`),a.matches):o},set prefersReducedMotion(e){o=e}},c=new class{constructor(){this._frozenAt=null}getCurrentTime(){return this._frozenAt===null?performance.now():this._frozenAt}setNow(e){this._frozenAt=e}restoreNow(){this._frozenAt=null}isFrozen(){return this._frozenAt!==null}};function l(){return c.getCurrentTime()}var u;class d{static create(e,t,n){let r=window.document.createElement(e);return t!==void 0&&(r.className=t),n&&n.appendChild(r),r}static createNS(e,t){return window.document.createElementNS(e,t)}static disableDrag(){d.docStyle&&d.selectProp&&(d.userSelect=d.docStyle[d.selectProp],d.docStyle[d.selectProp]=`none`)}static enableDrag(){d.docStyle&&d.selectProp&&(d.docStyle[d.selectProp]=d.userSelect)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener(`click`,d.suppressClickInternal,!0)}static suppressClick(){window.addEventListener(`click`,d.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener(`click`,d.suppressClickInternal,!0)}),0)}static getScale(e){let t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}static getPoint(e,n,r){let i=n.boundingClientRect;return new t.P((r.clientX-i.left)/n.x-e.clientLeft,(r.clientY-i.top)/n.y-e.clientTop)}static mousePos(e,t){let n=d.getScale(e);return d.getPoint(e,n,t)}static touchPos(e,t){let n=[],r=d.getScale(e);for(let i of t)n.push(d.getPoint(e,r,i));return n}static sanitize(e){let t=new DOMParser().parseFromString(e,`text/html`).body||document.createElement(`body`),n=t.querySelectorAll(`script`);for(let e of n)e.remove();return d.clean(t),t.innerHTML}static isPossiblyDangerous(e,t){let n=t.replace(/\s+/g,``).toLowerCase();return!(![`src`,`href`,`xlink:href`].includes(e)||!n.includes(`javascript:`)&&!n.includes(`data:`))||!!e.startsWith(`on`)||void 0}static clean(e){let t=e.children;for(let e of t)d.removeAttributes(e),d.clean(e)}static removeAttributes(e){for(let{name:t,value:n}of e.attributes)d.isPossiblyDangerous(t,n)&&e.removeAttribute(t)}}d.docStyle=typeof window<`u`&&window.document?.documentElement.style,d.selectProp=!d.docStyle||`userSelect`in d.docStyle?`userSelect`:`webkitUserSelect`,function(e){let n,r,i,a;e.resetRequestQueue=()=>{n=[],r=0,i=0,a={}},e.addThrottleControl=e=>{let t=i++;return a[t]=e,t},e.removeThrottleControl=e=>{delete a[e],s()},e.getImage=(e,r,i=!0)=>new Promise(((a,o)=>{e.headers||={},e.headers.accept=`image/webp,*/*`,t.e(e,{type:`image`}),n.push({abortController:r,requestParameters:e,supportImageRefresh:i,state:`queued`,onError:e=>{o(e)},onSuccess:e=>{a(e)}}),s()}));let o=e=>t._(this,void 0,void 0,(function*(){e.state=`running`;let{requestParameters:n,supportImageRefresh:i,onError:a,onSuccess:o,abortController:l}=e,u=!1===i&&!t.i(self)&&!t.g(n.url)&&(!n.headers||Object.keys(n.headers).reduce(((e,t)=>e&&t===`accept`),!0));r++;let d=u?c(n,l):t.m(n,l);try{let n=yield d;delete e.abortController,e.state=`completed`,n.data instanceof HTMLImageElement||t.b(n.data)?o(n):n.data&&o({data:yield(f=n.data,typeof createImageBitmap==`function`?t.h(f):t.j(f)),cacheControl:n.cacheControl,expires:n.expires})}catch(n){delete e.abortController,a(t.d(n))}finally{r--,s()}var f})),s=()=>{let e=(()=>{for(let e of Object.keys(a))if(a[e]())return!0;return!1})()?t.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let t=r;t<e&&n.length>0;t++){let e=n.shift();e.abortController.signal.aborted?t--:o(e)}},c=(e,n)=>new Promise(((r,i)=>{let a=new Image,o=e.url,s=e.credentials;s&&s===`include`?a.crossOrigin=`use-credentials`:(s&&s===`same-origin`||!t.f(o))&&(a.crossOrigin=`anonymous`),n.signal.addEventListener(`abort`,(()=>{a.src=``,i(new t.a(n.signal.reason))})),a.fetchPriority=`high`,a.onload=()=>{a.onerror=a.onload=null,r({data:a})},a.onerror=()=>{a.onerror=a.onload=null,n.signal.aborted||i(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.resetRequestQueue();class f{constructor(e){this._transformRequestFn=e??null}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function p(e){let t=[];if(typeof e==`string`)t.push({id:`default`,url:e});else if(e&&e.length>0){let n=[];for(let{id:r,url:i}of e){let e=`${r}${i}`;n.includes(e)||(n.push(e),t.push({id:r,url:i}))}}return t}function m(e,t,n){try{let r=new URL(e);return r.pathname+=`${t}${n}`,r.toString()}catch{throw Error(`Invalid sprite URL "${e}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function h(e){let{userImage:t}=e;return!(!t?.render||!t.render()||(e.data.replace(new Uint8Array(t.data.buffer)),0))}class g extends t.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}destroy(){this.atlasTexture&&=(this.atlasTexture.destroy(),null);for(let e of Object.keys(this.images))this.removeImage(e);this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(let{ids:e,promiseResolve:t}of this.requestors)t(this._getImagesForIds(e));this.requestors=[]}}getImage(e){let n=this.images[e];if(n&&!n.data&&n.spriteData){let e=n.spriteData;n.data=new t.R({width:e.width,height:e.height},e.context.getImageData(e.x,e.y,e.width,e.height).data),n.spriteData=null}return n}addImage(e,t){if(this.images[e])throw Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,t)&&(this.images[e]=t)}_validate(e,n){let r=!0,i=n.data||n.spriteData;return this._validateStretch(n.stretchX,i?.width)||(this.fire(new t.l(Error(`Image "${e}" has invalid "stretchX" value`))),r=!1),this._validateStretch(n.stretchY,i?.height)||(this.fire(new t.l(Error(`Image "${e}" has invalid "stretchY" value`))),r=!1),this._validateContent(n.content,n)||(this.fire(new t.l(Error(`Image "${e}" has invalid "content" value`))),r=!1),r}_validateStretch(e,t){if(!e)return!0;let n=0;for(let r of e){if(r[0]<n||r[1]<r[0]||t<r[1])return!1;n=r[1]}return!0}_validateContent(e,t){if(!e)return!0;if(e.length!==4)return!1;let n=t.spriteData,r=n?.width||t.data.width,i=n?.height||t.data.height;return!(e[0]<0||r<e[0]||e[1]<0||i<e[1]||e[2]<0||r<e[2]||e[3]<0||i<e[3]||e[2]<e[0]||!(e[3]>=e[1]))}updateImage(e,t,n=!0){let r=this.getImage(e);if(n&&(r.data.width!==t.data.width||r.data.height!==t.data.height))throw Error(`size mismatch between old image (${r.data.width}x${r.data.height}) and new image (${t.data.width}x${t.data.height}).`);t.version=r.version+1,this.images[e]=t,this.updatedImages[e]=!0}removeImage(e){var t;let n=this.images[e];delete this.images[e],delete this.patterns[e],(t=n.userImage)!=null&&t.onRemove&&n.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e){return new Promise(((t,n)=>{let r=!0;if(!this.isLoaded())for(let t of e)this.images[t]||(r=!1);this.isLoaded()||r?t(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:t})}))}_getImagesForIds(e){let n={};for(let r of e){let e=this.getImage(r);e||=(this.fire(new t.n(`styleimagemissing`,{id:r})),this.getImage(r)),e?n[r]={data:e.data.clone(),pixelRatio:e.pixelRatio,sdf:e.sdf,version:e.version,stretchX:e.stretchX,stretchY:e.stretchY,content:e.content,textFitWidth:e.textFitWidth,textFitHeight:e.textFitHeight,hasRenderCallback:!!e.userImage?.render}:t.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 n}getPixelSize(){let{width:e,height:t}=this.atlasImage;return{width:e,height:t}}getPattern(e){let n=this.patterns[e],r=this.getImage(e);if(!r)return null;if(n&&n.position.version===r.version)return n.position;if(n)n.position.version=r.version;else{let n={w:r.data.width+2,h:r.data.height+2,x:0,y:0},i=new t.I(n,r);this.patterns[e]={bin:n,position:i}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){let n=e.gl;this.atlasTexture?this.dirty&&=(this.atlasTexture.update(this.atlasImage),!1):this.atlasTexture=new t.T(e,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){let e=[];for(let t in this.patterns)e.push(this.patterns[t].bin);let{w:n,h:r}=t.p(e),i=this.atlasImage;i.resize({width:n||1,height:r||1});for(let e in this.patterns){let{bin:n}=this.patterns[e],r=n.x+1,a=n.y+1,o=this.getImage(e).data,s=o.width,c=o.height;t.R.copy(o,i,{x:0,y:0},{x:r,y:a},{width:s,height:c}),t.R.copy(o,i,{x:0,y:c-1},{x:r,y:a-1},{width:s,height:1}),t.R.copy(o,i,{x:0,y:0},{x:r,y:a+c},{width:s,height:1}),t.R.copy(o,i,{x:s-1,y:0},{x:r-1,y:a},{width:1,height:c}),t.R.copy(o,i,{x:0,y:0},{x:r+s,y:a},{width:1,height:c})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(let n of e){if(this.callbackDispatchedThisFrame[n])continue;this.callbackDispatchedThisFrame[n]=!0;let e=this.getImage(n);e||t.w(`Image with ID: "${n}" was not found`),h(e)&&this.updateImage(n,e)}}cloneImages(){let e={};for(let t in this.images){let n=this.images[t];e[t]=Object.assign(Object.assign({},n),{data:n.data?n.data.clone():null})}return e}}let _=0x56bc75e2d63100000;function v(e,t,n,r,i,a,o,s,c){for(let l=t;l<t+r;l++)y(e,n*a+l,a,i,o,s,c);for(let l=n;l<n+i;l++)y(e,l*a+t,1,r,o,s,c)}function y(e,t,n,r,i,a,o){a[0]=0,o[0]=-0x56bc75e2d63100000,o[1]=_,i[0]=e[t];for(let s=1,c=0,l=0;s<r;s++){i[s]=e[t+s*n];let r=s*s;do{let e=a[c];l=(i[s]-i[e]+r-e*e)/(s-e)/2}while(l<=o[c]&&--c>-1);c++,a[c]=s,o[c]=l,o[c+1]=_}for(let s=0,c=0;s<r;s++){for(;o[c+1]<s;)c++;let r=a[c],l=s-r;e[t+s*n]=i[r]+l*l}}let b=t.v.layout_symbol[`text-font`].default.join(`,`);class x{constructor(e,t,n){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={},this.lang=n}setURL(e){this.url=e}getGlyphs(e){return t._(this,void 0,void 0,(function*(){let t=[];for(let n in e)for(let r of e[n])t.push(this._getAndCacheGlyphsPromise(n,r));let n=yield Promise.all(t),r={};for(let{stack:e,id:t,glyph:i}of n)r[e]||(r[e]={}),r[e][t]=i&&{id:i.id,bitmap:i.bitmap.clone(),metrics:i.metrics};return r}))}_getAndCacheGlyphsPromise(e,n){return t._(this,void 0,void 0,(function*(){let t=this.entries[e];t||=this.entries[e]={glyphs:{},requests:{},ranges:{}};let r=t.glyphs[n];return r===void 0?!this.url||this._charUsesLocalIdeographFontFamily(n)?(r=t.glyphs[n]=this._drawGlyph(t,e,n),{stack:e,id:n,glyph:r}):yield this._downloadAndCacheRangePromise(e,n):{stack:e,id:n,glyph:r}}))}_downloadAndCacheRangePromise(e,n){return t._(this,void 0,void 0,(function*(){let r=this.entries[e],i=Math.floor(n/256);if(r.ranges[i])return{stack:e,id:n,glyph:null};r.requests[i]||(r.requests[i]=x.loadGlyphRange(e,i,this.url,this.requestManager));try{let t=yield r.requests[i];for(let e in t)r.glyphs[+e]=t[+e];return r.ranges[i]=!0,{stack:e,id:n,glyph:t[n]||null}}catch(a){let o=r.glyphs[n]=this._drawGlyph(r,e,n);return this._warnOnMissingGlyphRange(o,i,n,t.d(a)),{stack:e,id:n,glyph:o}}}))}_warnOnMissingGlyphRange(e,n,r,i){let a=256*n,o=a+255,s=r.toString(16).padStart(4,`0`).toUpperCase();t.w(`Unable to load glyph range ${n}, ${a}-${o}. Rendering codepoint U+${s} locally instead. ${i}`)}_charUsesLocalIdeographFontFamily(e){return!!this.localIdeographFontFamily&&t.r(e)}_drawGlyph(e,n,r){let i=n===b&&this.localIdeographFontFamily!==``&&this._charUsesLocalIdeographFontFamily(r),a=i?`ideographTinySDF`:`tinySDF`;e[a]||(e[a]=this._createTinySDF(i?this.localIdeographFontFamily:n));let o=e[a].draw(String.fromCodePoint(r)),s=/^\p{gc=Cf}+$/u.test(String.fromCodePoint(r));return{id:r,bitmap:new t.t({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(e){let t=e?e.split(`,`):[];t.push(`sans-serif`);let n=t.map((e=>/[-\w]+/.test(e)?e:`'${CSS.escape(e)}'`)).join(`,`);return new x.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:n,fontWeight:this._fontWeight(t[0]),fontStyle:this._fontStyle(t[0]),lang:this.lang})}_fontStyle(e){return/italic/i.test(e)?`italic`:/oblique/i.test(e)?`oblique`:`normal`}_fontWeight(e){let t={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},n;for(let[r,i]of Object.entries(t))RegExp(`\\b${r}\\b`,`i`).test(e)&&(n=`${i}`);return n}destroy(){for(let e in this.entries){let t=this.entries[e];t.tinySDF&&=null,t.ideographTinySDF&&=null,t.glyphs={},t.requests={},t.ranges={}}this.entries={}}}x.loadGlyphRange=function(e,n,r,i){return t._(this,void 0,void 0,(function*(){let a=256*n,o=a+255,s=yield i.transformRequest(r.replace(`{fontstack}`,e).replace(`{range}`,`${a}-${o}`),`Glyphs`),c=yield t.o(s,new AbortController);if(!c?.data)throw Error(`Could not load glyph range. range: ${n}, ${a}-${o}`);let l={};for(let e of t.q(c.data))l[e.id]=e;return l}))},x.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:n=8,cutoff:r=.25,fontFamily:i=`sans-serif`,fontWeight:a=`normal`,fontStyle:o=`normal`,lang:s=null}={}){this.buffer=t,this.cutoff=r,this.radius=n,this.lang=s;let c=this.size=e+4*t,l=this._createCanvas(c),u=this.ctx=l.getContext(`2d`,{willReadFrequently:!0});u.font=`${o} ${a} ${e}px ${i}`,u.textBaseline=`alphabetic`,u.textAlign=`left`,u.fillStyle=`black`,this.gridOuter=new Float64Array(c*c),this.gridInner=new Float64Array(c*c),this.f=new Float64Array(c),this.z=new Float64Array(c+1),this.v=new Uint16Array(c)}_createCanvas(e){let t=document.createElement(`canvas`);return t.width=t.height=e,t}draw(e){let{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:r,actualBoundingBoxLeft:i,actualBoundingBoxRight:a}=this.ctx.measureText(e),o=Math.ceil(n),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-i))),c=Math.min(this.size-this.buffer,o+Math.ceil(r)),l=s+2*this.buffer,u=c+2*this.buffer,d=Math.max(l*u,0),f=new Uint8ClampedArray(d),p={data:f,width:l,height:u,glyphWidth:s,glyphHeight:c,glyphTop:o,glyphLeft:0,glyphAdvance:t};if(s===0||c===0)return p;let{ctx:m,buffer:h,gridInner:g,gridOuter:y}=this;this.lang&&(m.lang=this.lang),m.clearRect(h,h,s,c),m.fillText(e,h,h+o);let b=m.getImageData(h,h,s,c);y.fill(_,0,d),g.fill(0,0,d);for(let e=0;e<c;e++)for(let t=0;t<s;t++){let n=b.data[4*(e*s+t)+3]/255;if(n===0)continue;let r=(e+h)*l+t+h;if(n===1)y[r]=0,g[r]=_;else{let e=.5-n;y[r]=e>0?e*e:0,g[r]=e<0?e*e:0}}v(y,0,0,l,u,l,this.f,this.v,this.z),v(g,h,h,s,c,l,this.f,this.v,this.z);for(let e=0;e<d;e++){let t=Math.sqrt(y[e])-Math.sqrt(g[e]);f[e]=Math.round(255-255*(t/this.radius+this.cutoff))}return p}};class S{constructor(){this.specification=t.x.light.position}possiblyEvaluate(e,n){return t.G(e.expression.evaluate(n))}interpolate(e,n,r){return{x:t.H.number(e.x,n.x,r),y:t.H.number(e.y,n.y,r),z:t.H.number(e.z,n.z,r)}}}let C;class w extends t.E{constructor(e){super(),C||=new t.u({anchor:new t.D(t.x.light.anchor),position:new S,color:new t.D(t.x.light.color),intensity:new t.D(t.x.light.intensity)}),this._transitionable=new t.y(C,void 0),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,n={}){if(!this._validate(t.z,e,n))for(let n in e){let r=e[n];n.endsWith(t.B)?this._transitionable.setTransition(n.slice(0,-t.B.length),r):this._transitionable.setValue(n,r)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,n,r){return!1!==r?.validate&&t.C(this,e.call(t.F,{value:n,style:{glyphs:!0,sprite:!0},styleSpec:t.x}))}}let T=new t.u({"sky-color":new t.D(t.x.sky[`sky-color`]),"horizon-color":new t.D(t.x.sky[`horizon-color`]),"fog-color":new t.D(t.x.sky[`fog-color`]),"fog-ground-blend":new t.D(t.x.sky[`fog-ground-blend`]),"horizon-fog-blend":new t.D(t.x.sky[`horizon-fog-blend`]),"sky-horizon-blend":new t.D(t.x.sky[`sky-horizon-blend`]),"atmosphere-blend":new t.D(t.x.sky[`atmosphere-blend`])});class E extends t.E{constructor(e){super(),this._transitionable=new t.y(T,void 0),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new t.J(0))}setSky(e,n={}){if(!this._validate(t.K,e,n)){e||={"sky-color":`transparent`,"horizon-color":`transparent`,"fog-color":`transparent`,"fog-ground-blend":1,"atmosphere-blend":0};for(let n in e){let r=e[n];n.endsWith(t.B)?this._transitionable.setTransition(n.slice(0,-t.B.length),r):this._transitionable.setValue(n,r)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,n,r={}){return!1!==r?.validate&&t.C(this,e.call(t.F,t.e({value:n,style:{glyphs:!0,sprite:!0},styleSpec:t.x})))}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}}class D{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,t){let n=e.join(`,`)+String(t);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(e,t)),this.dashEntry[n]}getDashRanges(e,t,n){let r=[],i=e.length%2==1?-e[e.length-1]*n:0,a=e[0]*n,o=!0;r.push({left:i,right:a,isDash:o,zeroLength:e[0]===0});let s=e[0];for(let t=1;t<e.length;t++){o=!o;let c=e[t];i=s*n,s+=c,a=s*n,r.push({left:i,right:a,isDash:o,zeroLength:c===0})}return r}addRoundDash(e,t,n){let r=t/2;for(let t=-n;t<=n;t++){let i=this.width*(this.nextRow+n+t),a=0,o=e[a];for(let s=0;s<this.width;s++){s/o.right>1&&(o=e[++a]);let c=Math.abs(s-o.left),l=Math.abs(s-o.right),u=Math.min(c,l),d,f=t/n*(r+1);if(o.isDash){let e=r-Math.abs(f);d=Math.sqrt(u*u+e*e)}else d=r-Math.sqrt(u*u+f*f);this.data[i+s]=Math.max(0,Math.min(255,d+128))}}}addRegularDash(e){for(let t=e.length-1;t>=0;--t){let n=e[t],r=e[t+1];n.zeroLength?e.splice(t,1):r&&r.isDash===n.isDash&&(r.left=n.left,e.splice(t,1))}let t=e[0],n=e[e.length-1];t.isDash===n.isDash&&(t.left=n.left-this.width,n.right=t.right+this.width);let r=this.width*this.nextRow,i=0,a=e[i];for(let t=0;t<this.width;t++){t/a.right>1&&(a=e[++i]);let n=Math.abs(t-a.left),o=Math.abs(t-a.right),s=Math.min(n,o);this.data[r+t]=Math.max(0,Math.min(255,(a.isDash?s:-s)+128))}}addDash(e,n){let r=n?7:0,i=2*r+1;if(this.nextRow+i>this.height)return t.w(`LineAtlas out of space`),null;let a=0;for(let t of e)a+=t;if(a!==0){let t=this.width/a,i=this.getDashRanges(e,this.width,t);n?this.addRoundDash(i,t,r):this.addRegularDash(i)}let o={y:this.nextRow+r,height:2*r,width:a};return this.nextRow+=i,this.dirty=!0,o}bind(e){let t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))}}let O=`maplibre_preloaded_worker_pool`;class k{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<k.workerCount;)this.workers.push(new Worker(t.c.WORKER_URL));return this.active[e]=!0,this.workers.slice()}release(e){if(delete this.active[e],this.numActive()===0){for(let e of this.workers)e.terminate();this.workers=null}}isPreloaded(){return!!this.active[O]}numActive(){return Object.keys(this.active).length}}let A=Math.floor(s.hardwareConcurrency/2),j,ee;function M(){return j||=new k,j}k.workerCount=t.L(globalThis)?Math.max(Math.min(A,3),1):1;class te{constructor(e,n){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=n;let r=this.workerPool.acquire(n);for(let e=0;e<r.length;e++){let i=new t.N(r[e],n);i.name=`Worker ${e}`,this.actors.push(i)}if(!this.actors.length)throw Error(`No actors found`)}broadcast(e,t){let n=[];for(let r of this.actors)n.push(r.sendAsync({type:e,data:t}));return Promise.all(n)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){for(let e of this.actors)e.remove();this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,t){for(let n of this.actors)n.registerMessageHandler(e,t)}unregisterMessageHandler(e){for(let t of this.actors)t.unregisterMessageHandler(e)}}function ne(){return ee||(ee=new te(M(),t.M),ee.registerMessageHandler(`GR`,((e,n,r)=>t.m(n,r)))),ee}function N(e,n){let r=t.O();return t.Q(r,r,[1,1,0]),t.S(r,r,[.5*e.width,.5*e.height,1]),e.calculatePosMatrix?t.U(r,r,e.calculatePosMatrix(n.toUnwrapped())):r}function re(e,t,n,r,i,a,o){let s=function(e,t,n){if(e)for(let r of e){let e=t[r];if(e?.source===n&&e.type===`fill-extrusion`)return!0}else for(let e in t){let r=t[e];if(r.source===n&&r.type===`fill-extrusion`)return!0}return!1}(i?.layers??null,t,e.id),c=a.maxPitchScaleFactor(),l=e.tilesIn(r,c,s);l.sort(ie);let u=[];for(let r of l)u.push({wrappedTileID:r.tileID.wrapped().key,queryResults:r.tile.queryRenderedFeatures(t,n,e.getState(),r.queryGeometry,r.cameraQueryGeometry,r.scale,i,a,c,N(a,r.tileID),o?(e,t)=>o(r.tileID,e,t):void 0)});return function(e,t){for(let n in e)for(let r of e[n])ae(r,t);return e}(function(e){let t={},n={};for(let r of e){let e=r.queryResults,i=r.wrappedTileID,a=n[i]=n[i]||{};for(let n in e){let r=e[n],i=a[n]=a[n]||{},o=t[n]=t[n]||[];for(let e of r)i[e.featureIndex]||(i[e.featureIndex]=!0,o.push(e))}}return t}(u),e)}function ie(e,t){let n=e.tileID,r=t.tileID;return n.overscaledZ-r.overscaledZ||n.canonical.y-r.canonical.y||n.wrap-r.wrap||n.canonical.x-r.canonical.x}function ae(e,t){let n=e.feature,r=t.getFeatureState(n.layer[`source-layer`],n.id);n.source=n.layer.source,n.layer[`source-layer`]&&(n.sourceLayer=n.layer[`source-layer`]),n.state=r}function oe(e,n,r,i){return t._(this,void 0,void 0,(function*(){let a=e;if(e.url?a=(yield t.k(yield n.transformRequest(e.url,`Source`),r)).data:yield s.frameAsync(r,i),!a)return null;let o=t.V(t.e(a,e),[`tiles`,`minzoom`,`maxzoom`,`attribution`,`bounds`,`scheme`,`tileSize`,`encoding`]);return`vector_layers`in a&&a.vector_layers&&(o.vectorLayerIds=a.vector_layers.map((e=>e.id))),o}))}class se{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof t.W?new t.W(e.lng,e.lat):t.W.convert(e),this}setSouthWest(e){return this._sw=e instanceof t.W?new t.W(e.lng,e.lat):t.W.convert(e),this}extend(e){let n=this._sw,r=this._ne,i,a;if(e instanceof t.W)i=e,a=e;else{if(!(e instanceof se))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(se.convert(e)):this.extend(t.W.convert(e)):e&&(`lng`in e||`lon`in e)&&`lat`in e?this.extend(t.W.convert(e)):this;if(i=e._sw,a=e._ne,!i||!a)return this}return n||r?(n.lng=Math.min(i.lng,n.lng),n.lat=Math.min(i.lat,n.lat),r.lng=Math.max(a.lng,r.lng),r.lat=Math.max(a.lat,r.lat)):(this._sw=new t.W(i.lng,i.lat),this._ne=new t.W(a.lng,a.lat)),this}getCenter(){return new t.W((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 t.W(this.getWest(),this.getNorth())}getSouthEast(){return new t.W(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(e){let{lng:n,lat:r}=t.W.convert(e),i=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&i}intersects(e){if(!((e=se.convert(e)).getNorth()>=this.getSouth()&&e.getSouth()<=this.getNorth()))return!1;let n=Math.abs(this.getEast()-this.getWest()),r=Math.abs(e.getEast()-e.getWest());if(n>=360||r>=360)return!0;let i=t.X(this.getWest(),-180,180),a=t.X(this.getEast(),-180,180),o=t.X(e.getWest(),-180,180),s=t.X(e.getEast(),-180,180),c=i>a,l=o>s;return!(!c||!l)||(c?s>=i||o<=a:l?a>=o||i<=s:o<=a&&s>=i)}static convert(e){return e instanceof se?e:e&&new se(e)}static fromLngLat(e,n=0){let r=360*n/40075017,i=r/Math.cos(Math.PI/180*e.lat);return new se(new t.W(e.lng-i,e.lat-r),new t.W(e.lng+i,e.lat+r))}adjustAntiMeridian(){let e=new t.W(this._sw.lng,this._sw.lat),n=new t.W(this._ne.lng,this._ne.lat);return new se(e,e.lng>n.lng?new t.W(n.lng+360,n.lat):n)}}class ce{constructor(e,t,n){this.bounds=se.convert(this.validateBounds(e)),this.minzoom=t||0,this.maxzoom=n||24}validateBounds(e){return Array.isArray(e)&&e.length===4?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){let n=2**e.z,r=Math.floor(t.Z(this.bounds.getWest())*n),i=Math.floor(t.Y(this.bounds.getNorth())*n),a=Math.ceil(t.Z(this.bounds.getEast())*n),o=Math.ceil(t.Y(this.bounds.getSouth())*n);return e.x>=r&&e.x<a&&e.y>=i&&e.y<o}}class le extends t.E{constructor(e,n,r,i){if(super(),this.id=e,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,t.e(this,t.V(n,[`url`,`scheme`,`tileSize`,`promoteId`,`encoding`])),this._options=t.e({type:`vector`},n),this._collectResourceTiming=n.collectResourceTiming,this.tileSize!==512)throw Error(`vector tile sources must have a tileSize of 512`);this.setEventedParent(i)}load(){return t._(this,arguments,void 0,(function*(e=!1){this._loaded=!1,this.fire(new t.n(`dataloading`,{dataType:`source`})),this._tileJSONRequest=new AbortController;try{let n=yield oe(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,n&&(t.e(this,n),n.bounds&&(this.tileBounds=new ce(n.bounds,this.minzoom,this.maxzoom)),this.fire(new t.n(`data`,{dataType:`source`,sourceDataType:`metadata`})),this.fire(new t.n(`data`,{dataType:`source`,sourceDataType:`content`,sourceDataChanged:e})))}catch(e){this._tileJSONRequest=null,this._loaded=!0,t.$(e)||this.fire(new t.l(t.d(e)))}}))}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load(!0)}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}onRemove(){this._tileJSONRequest&&=(this._tileJSONRequest.abort(),null)}serialize(){return t.e({},this._options)}loadTile(e){return t._(this,void 0,void 0,(function*(){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n={request:yield this.map._requestManager.transformRequest(t,`Tile`),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.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(e),etag:e.etag};n.request.collectResourceTiming=this._collectResourceTiming;let r=`RT`;if(e.actor&&e.state!==`expired`){if(e.state===`loading`)return new Promise(((t,n)=>{e.reloadPromise={resolve:t,reject:n}}))}else e.actor=this.dispatcher.getActor(),r=`LT`;e.abortController=new AbortController;try{let t=yield e.actor.sendAsync({type:r,data:n},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,t);let i={};return t!=null&&t.etagUnmodified&&(i.unmodified=!0),i}catch(t){if(delete e.abortController,e.aborted)return;if(t&&t.status!==404)throw t;this._afterTileLoadWorkerResponse(e,null)}}))}_getOverzoomParameters(e){return t._(this,void 0,void 0,(function*(){if(e.tileID.canonical.z<=this.maxzoom||this.map._zoomLevelsToOverscale===void 0)return;let t=e.tileID.scaledTo(this.maxzoom).canonical,n=t.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:t,overzoomRequest:yield this.map._requestManager.transformRequest(n,`Tile`)}}))}_afterTileLoadWorkerResponse(e,t){if(t!=null&&t.resourceTiming&&(e.resourceTiming=t.resourceTiming),t&&this.map._refreshExpiredTiles&&e.setExpiryData(t),e.etag=t?.etag,e.loadVectorData(t,this.map.painter),e.reloadPromise){let t=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(t.resolve).catch(t.reject)}}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:`AT`,data:{uid:e.uid,type:this.type,source:this.id}}))}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:`RMT`,data:{uid:e.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class ue extends t.E{constructor(e,n,r,i){super(),this.id=e,this.dispatcher=r,this.setEventedParent(i),this.type=`raster`,this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme=`xyz`,this.tileSize=512,this._loaded=!1,this._options=t.e({type:`raster`},n),t.e(this,t.V(n,[`url`,`scheme`,`tileSize`]))}load(){return t._(this,arguments,void 0,(function*(e=!1){this._loaded=!1,this.fire(new t.n(`dataloading`,{dataType:`source`})),this._tileJSONRequest=new AbortController;try{let n=yield oe(this._options,this.map._requestManager,this._tileJSONRequest,this.map._ownerWindow);this._tileJSONRequest=null,this._loaded=!0,n&&(t.e(this,n),n.bounds&&(this.tileBounds=new ce(n.bounds,this.minzoom,this.maxzoom)),this.fire(new t.n(`data`,{dataType:`source`,sourceDataType:`metadata`})),this.fire(new t.n(`data`,{dataType:`source`,sourceDataType:`content`,sourceDataChanged:e})))}catch(e){this._tileJSONRequest=null,this._loaded=!0,t.$(e)||this.fire(new t.l(t.d(e)))}}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&=(this._tileJSONRequest.abort(),null)}setSourceProperty(e){this._tileJSONRequest&&=(this._tileJSONRequest.abort(),null),e(),this.load(!0)}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}serialize(){return t.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return t._(this,void 0,void 0,(function*(){let n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{let r=yield u.getImage(yield this.map._requestManager.transformRequest(n,`Tile`),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state=`unloaded`);if(r?.data){this.map._refreshExpiredTiles&&(r.cacheControl||r.expires)&&e.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});let n=this.map.painter.context,i=n.gl,a=r.data;e.texture=this.map.painter.getTileTexture(a.width),e.texture?e.texture.update(a,{useMipmap:!0}):(e.texture=new t.T(n,a,i.RGBA,{useMipmap:!0}),e.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_NEAREST)),e.state=`loaded`}}catch(t){if(delete e.abortController,e.aborted)e.state=`unloaded`;else if(t)throw e.state=`errored`,t}}))}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)}))}hasTransition(){return!1}}class de extends ue{constructor(e,n,r,i){super(e,n,r,i),this.type=`raster-dem`,this.maxzoom=22,this._options=t.e({type:`raster-dem`},n),this.encoding=n.encoding||`mapbox`,this.redFactor=n.redFactor,this.greenFactor=n.greenFactor,this.blueFactor=n.blueFactor,this.baseShift=n.baseShift}loadTile(e){return t._(this,void 0,void 0,(function*(){let n=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r=yield this.map._requestManager.transformRequest(n,`Tile`);e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{let n=yield u.getImage(r,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state=`unloaded`);if(n?.data){let r=n.data;this.map._refreshExpiredTiles&&(n.cacheControl||n.expires)&&e.setExpiryData({cacheControl:n.cacheControl,expires:n.expires});let i=t.b(r)&&t.a0()?r:yield this.readImageNow(r),a={type:this.type,uid:e.uid,source:this.id,rawImageData:i,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(e.actor&&e.state!==`expired`&&e.state!==`reloading`)return;e.actor&&e.state!==`expired`||(e.actor=this.dispatcher.getActor()),e.dem=yield e.actor.sendAsync({type:`LDT`,data:a}),e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state=`loaded`}}catch(t){if(delete e.abortController,e.aborted)e.state=`unloaded`;else if(t)throw e.state=`errored`,t}}))}readImageNow(e){return t._(this,void 0,void 0,(function*(){if(typeof VideoFrame<`u`&&t.a1()){let n=e.width+2,r=e.height+2;try{return new t.R({width:n,height:r},yield t.a2(e,-1,-1,n,r))}catch{}}return s.getImageData(e,1)}))}_getNeighboringTiles(e){let n=e.canonical,r=2**n.z,i=(n.x-1+r)%r,a=n.x===0?e.wrap-1:e.wrap,o=(n.x+1+r)%r,s=n.x+1===r?e.wrap+1:e.wrap,c={};return c[new t.a3(e.overscaledZ,a,n.z,i,n.y).key]={backfilled:!1},c[new t.a3(e.overscaledZ,s,n.z,o,n.y).key]={backfilled:!1},n.y>0&&(c[new t.a3(e.overscaledZ,a,n.z,i,n.y-1).key]={backfilled:!1},c[new t.a3(e.overscaledZ,e.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},c[new t.a3(e.overscaledZ,s,n.z,o,n.y-1).key]={backfilled:!1}),n.y+1<r&&(c[new t.a3(e.overscaledZ,a,n.z,i,n.y+1).key]={backfilled:!1},c[new t.a3(e.overscaledZ,e.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},c[new t.a3(e.overscaledZ,s,n.z,o,n.y+1).key]={backfilled:!1}),c}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state=`unloaded`,e.actor&&(yield e.actor.sendAsync({type:`RDT`,data:{type:this.type,uid:e.uid,source:this.id}}))}))}}function fe(e,t){return t?e.properties[t]:e.id}function pe(e,t){let n={id:e.id};if(t.removeAllProperties&&(delete e.removeProperties,delete e.addOrUpdateProperties,delete t.removeProperties),t.removeProperties)for(let n of t.removeProperties){let t=e.addOrUpdateProperties.findIndex((e=>e.key===n));t>-1&&e.addOrUpdateProperties.splice(t,1)}return(e.removeAllProperties||t.removeAllProperties)&&(n.removeAllProperties=!0),(e.removeProperties||t.removeProperties)&&(n.removeProperties=[...e.removeProperties||[],...t.removeProperties||[]]),(e.addOrUpdateProperties||t.addOrUpdateProperties)&&(n.addOrUpdateProperties=[...e.addOrUpdateProperties||[],...t.addOrUpdateProperties||[]]),(e.newGeometry||t.newGeometry)&&(n.newGeometry=t.newGeometry||e.newGeometry),n}function me(e){if(!e)return{};let t={};return t.removeAll=e.removeAll,t.remove=new Set(e.remove||[]),t.add=new Map(e.add?.map((e=>[e.id,e]))),t.update=new Map(e.update?.map((e=>[e.id,e]))),t}function he(e){return e&&e.length!==0?typeof e[0]==`number`?[e]:e.flatMap((e=>he(e))):[]}function ge(e){return e.type===`GeometryCollection`?e.geometries.flatMap((e=>ge(e))):he(e.coordinates)}function _e(e){let t=new se,n;switch(e.type){case`FeatureCollection`:n=e.features.flatMap((e=>ge(e.geometry)));break;case`Feature`:n=ge(e.geometry);break;default:n=ge(e)}if(n.length===0)return t;for(let e of n){let[n,r]=e;t.extend([n,r])}return t}class ve extends t.E{constructor(e,n,r,i){super(),this.id=e,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:n.data},this.actor=r.getActor(),this.setEventedParent(i),this._data=typeof n.data==`string`?{url:n.data}:{geojson:n.data},this._options=t.e({},n),this._collectResourceTiming=n.collectResourceTiming,n.maxzoom!==void 0&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId,n.clusterMaxZoom!==void 0&&this.maxzoom<=n.clusterMaxZoom&&t.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${n.clusterMaxZoom}".`),this.workerOptions=t.e({source:this.id,geojsonVtOptions:{buffer:this._pixelsToTileUnits(n.buffer===void 0?128:n.buffer),tolerance:this._pixelsToTileUnits(n.tolerance===void 0?.375:n.tolerance),extent:t.a6,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1,promoteId:typeof n.promoteId==`string`?n.promoteId:void 0,cluster:n.cluster||!1,clusterOptions:{maxZoom:this._getClusterMaxZoom(n.clusterMaxZoom),minPoints:Math.max(2,n.clusterMinPoints||2),extent:t.a6,radius:this._pixelsToTileUnits(n.clusterRadius||50),log:!1,generateId:n.generateId||!1}},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions)}_hasPendingWorkerUpdate(){return this._pendingWorkerUpdate.data!==void 0||this._pendingWorkerUpdate.diff!==void 0||this._pendingWorkerUpdate.updateCluster}_pixelsToTileUnits(e){return e*(t.a6/this.tileSize)}_getClusterMaxZoom(e){let n=e?Math.round(e):this.maxzoom-1;return Number.isInteger(e)||e===void 0||t.w(`Integer expected for option 'clusterMaxZoom': provided value "${e}" rounded to "${n}"`),n}load(){return t._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(e){this.map=e,this.load()}setData(e,t){this._data=typeof e==`string`?{url:e}:{geojson:e},this._pendingWorkerUpdate={data:e};let n=this._updateWorkerData();return t?n:this}updateData(e,t){this._pendingWorkerUpdate.diff=function(e,t){if(!e)return t||{};if(!t)return e||{};let n=me(e),r=me(t);(function(e,t){t.removeAll&&(e.add.clear(),e.update.clear(),e.remove.clear(),t.remove.clear());for(let n of t.remove)e.add.delete(n),e.update.delete(n);for(let[n,r]of t.update){let i=e.update.get(n);i&&(t.update.set(n,pe(i,r)),e.update.delete(n))}})(n,r);let i={};if((n.removeAll||r.removeAll)&&(i.removeAll=!0),i.remove=new Set([...n.remove,...r.remove]),i.add=new Map([...n.add,...r.add]),i.update=new Map([...n.update,...r.update]),i.remove.size&&i.add.size)for(let e of i.add.keys())i.remove.delete(e);return function(e){let t={};return e.removeAll&&(t.removeAll=e.removeAll),e.remove&&(t.remove=Array.from(e.remove)),e.add&&(t.add=Array.from(e.add.values())),e.update&&(t.update=Array.from(e.update.values())),t}(i)}(this._pendingWorkerUpdate.diff,e);let n=this._updateWorkerData();return t?n:this}getData(){return t._(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 t._(this,void 0,void 0,(function*(){return _e(yield this.getData())}))}setClusterOptions(e){return this.workerOptions.geojsonVtOptions.cluster=e.cluster,e.clusterRadius!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.radius=this._pixelsToTileUnits(e.clusterRadius)),e.clusterMaxZoom!==void 0&&(this.workerOptions.geojsonVtOptions.clusterOptions.maxZoom=this._getClusterMaxZoom(e.clusterMaxZoom)),this._pendingWorkerUpdate.updateCluster=!0,this._updateWorkerData(),this}getClusterExpansionZoom(e){return this.actor.sendAsync({type:`GCEZ`,data:{type:this.type,clusterId:e,source:this.id}})}getClusterChildren(e){return this.actor.sendAsync({type:`GCC`,data:{type:this.type,clusterId:e,source:this.id}})}getClusterLeaves(e,t,n){return this.actor.sendAsync({type:`GCL`,data:{type:this.type,source:this.id,clusterId:e,limit:t,offset:n}})}_updateWorkerData(){return t._(this,void 0,void 0,(function*(){if(this._isUpdatingWorker)return;if(!this._hasPendingWorkerUpdate())return void t.w(`No pending worker updates for GeoJSONSource ${this.id}.`);let{data:e,diff:n,updateCluster:r}=this._pendingWorkerUpdate,i=this._getLoadGeoJSONParameters(e,n,r);e===void 0?n?this._pendingWorkerUpdate.diff=void 0:r&&(this._pendingWorkerUpdate.updateCluster=void 0):this._pendingWorkerUpdate.data=void 0,yield this._dispatchWorkerUpdate(i)}))}_getLoadGeoJSONParameters(e,n,r){return t._(this,void 0,void 0,(function*(){let i=t.e({type:this.type},this.workerOptions);return typeof e==`string`?(i.request=yield this.map._requestManager.transformRequest(s.resolveURL(e),`Source`),i.request.collectResourceTiming=this._collectResourceTiming,i):e===void 0?n?(i.dataDiff=n,i):r?(i.updateCluster=!0,i):void 0:(i.data=e,i)}))}_dispatchWorkerUpdate(e){return t._(this,void 0,void 0,(function*(){this._isUpdatingWorker=!0,this.fire(new t.n(`dataloading`,{dataType:`source`}));try{let n=yield e,r=yield this.actor.sendAsync({type:`LD`,data:n});if(this._isUpdatingWorker=!1,this._removed||r.abandoned)return void this.fire(new t.n(`dataabort`,{dataType:`source`}));r.data&&(this._data={geojson:r.data});let i=this._applyDiffToSource(n.dataDiff),a=this._getShouldReloadTileOptions(i),o={dataType:`source`};this._applyResourceTiming(o,r),this.fire(new t.n(`data`,Object.assign(Object.assign({},o),{sourceDataType:`metadata`}))),this.fire(new t.n(`data`,Object.assign(Object.assign({},o),{sourceDataType:`content`,shouldReloadTileOptions:a})))}catch(e){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new t.n(`dataabort`,{dataType:`source`}));this.fire(new t.l(t.d(e)))}finally{this._hasPendingWorkerUpdate()&&this._updateWorkerData()}}))}_applyResourceTiming(e,n){if(!this._collectResourceTiming)return;let r=n.resourceTiming?.[this.id];if(!r)return;let i=r.slice(0);i!=null&&i.length&&t.e(e,{resourceTiming:i})}_applyDiffToSource(e){if(!e)return;let t=typeof this.promoteId==`string`?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){let e=function(e,t){let n=new Map;if(e==null||e.type==null)return n;if(e.type===`Feature`){let r=fe(e,t);return r==null?void 0:(n.set(r,e),n)}if(e.type===`FeatureCollection`){let r=new Set;for(let i of e.features){let e=fe(i,t);if(e==null||r.has(e))return;r.add(e),n.set(e,i)}return n}}(this._data.geojson,t);if(!e)throw Error(`GeoJSONSource "${this.id}": GeoJSON data is not compatible with updateData`);this._data={updateable:e}}if(!this._data.updateable)return;let n=function(e,t,n){let r=[];if(t.removeAll)e.clear();else if(t.remove)for(let n of t.remove){let t=e.get(n);t&&(r.push(t.geometry),e.delete(n))}if(t.add)for(let i of t.add){let t=fe(i,n);if(t==null)continue;let a=e.get(t);a&&r.push(a.geometry),r.push(i.geometry),e.set(t,i)}if(t.update)for(let n of t.update){let t=e.get(n.id);if(!t)continue;let i=!!n.newGeometry,a=n.removeAllProperties||n.removeProperties?.length>0||n.addOrUpdateProperties?.length>0;if(!i&&!a)continue;r.push(t.geometry);let o=Object.assign({},t);if(e.set(n.id,o),i&&(r.push(n.newGeometry),o.geometry=n.newGeometry),a){if(o.properties=n.removeAllProperties?{}:Object.assign({},o.properties||{}),n.removeProperties)for(let e of n.removeProperties)delete o.properties[e];if(n.addOrUpdateProperties)for(let{key:e,value:t}of n.addOrUpdateProperties)o.properties[e]=t}}return r}(this._data.updateable,e,t);return e.removeAll||this._options.cluster?void 0:n}_getShouldReloadTileOptions(e){if(e)return{affectedBounds:e.filter(Boolean).map((e=>_e(e)))}}shouldReloadTile(e,{affectedBounds:n}){if(e.state===`loading`)return!0;if(e.state===`unloaded`)return!1;let{buffer:r,extent:i}=this.workerOptions.geojsonVtOptions,a=function({x:e,y:n,z:r},i=0){let a=t.a4((e-i)/2**r),o=t.a5((n+1+i)/2**r),s=t.a4((e+1+i)/2**r),c=t.a5((n-i)/2**r);return new se([a,o],[s,c])}(e.tileID.canonical,r/i);for(let e of n)if(a.intersects(e))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(e){return t._(this,void 0,void 0,(function*(){let t=e.actor?`RT`:`LT`;e.actor=this.actor;let n={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.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};e.abortController=new AbortController;let r=yield this.actor.sendAsync({type:t,data:n},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(r,this.map.painter,t===`RT`)}))}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:`RMT`,data:{uid:e.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 t.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 ye extends t.E{constructor(e,t,n,r){super(),this.flippedWindingOrder=!1,this.id=e,this.dispatcher=n,this.coordinates=t.coordinates,this.type=`image`,this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=t}load(e){return t._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new t.n(`dataloading`,{dataType:`source`})),this.url=this.options.url,this._request=new AbortController;try{let t=yield u.getImage(yield this.map._requestManager.transformRequest(this.url,`Image`),this._request);this._request=null,this._loaded=!0,t!=null&&t.data&&(this.image=t.data,e&&(this.coordinates=e),this._finishLoading())}catch(e){this._request=null,this._loaded=!0,t.$(e)||this.fire(new t.l(t.d(e)))}}))}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&=(this._request.abort(),null),this.options.url=e.url,this.load(e.coordinates).finally((()=>this.texture=null)),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.n(`data`,{dataType:`source`,sourceDataType:`metadata`})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&=(this._request.abort(),null)}setCoordinates(e){this.coordinates=e;let n=e.map(t.a7.fromLngLat);var r;return this.tileID=function(e){let n=t.a8.fromPoints(e),r=n.width(),i=n.height(),a=Math.max(0,Math.floor(-Math.log(Math.max(r,i))/Math.LN2)),o=2**a;return new t.aa(a,Math.floor((n.minX+n.maxX)/2*o),Math.floor((n.minY+n.maxY)/2*o))}(n),this.terrainTileRanges=this._getOverlappingTileRanges(n),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=n.map((e=>this.tileID.getTilePoint(e)._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 t.n(`data`,{dataType:`source`,sourceDataType:`content`})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;let e=this.map.painter.context,n=e.gl;this.texture||(this.texture=new t.T(e,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let r=!1;for(let e in this.tiles){let t=this.tiles[e];t.state!==`loaded`&&(t.state=`loaded`,t.texture=this.texture,r=!0)}r&&this.fire(new t.n(`data`,{dataType:`source`,sourceDataType:`idle`,sourceId:this.id}))}loadTile(e){return t._(this,void 0,void 0,(function*(){this.tileID?.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state=`errored`}))}serialize(){return{type:`image`,url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(e){let{minX:n,minY:r,maxX:i,maxY:a}=t.a8.fromPoints(e),o={};for(let e=0;e<=t.a9;e++){let t=2**e,s=Math.floor(n*t),c=Math.floor(r*t),l=Math.floor(i*t),u=Math.floor(a*t),d=(s%t+t)%t,f=l%t;o[e]={minWrap:Math.floor(s/t),maxWrap:Math.floor(l/t),minTileXWrapped:d,maxTileXWrapped:f,minTileY:c,maxTileY:u}}return o}}class be extends ye{constructor(e,t,n,r){super(e,t,n,r),this._onPlayingHandler=()=>{var e;(e=this.map)==null||e.triggerRepaint()},this.roundZoom=!0,this.type=`video`,this.options=t}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!1;let e=this.options;this.urls=[];for(let t of e.urls)this.urls.push((yield this.map._requestManager.transformRequest(t,`Source`)).url);try{let e=yield t.ab(this.urls);if(this._loaded=!0,!e)return;this.video=e,this.video.loop=!0,this.video.addEventListener(`playing`,this._onPlayingHandler),this.map&&this.video.play(),this._finishLoading()}catch(e){this.fire(new t.l(t.d(e)))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){let n=this.video.seekable;e<n.start(0)||e>n.end(0)?this.fire(new t.l(new t.ac(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,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(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let e=this.map.painter.context,n=e.gl;this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new t.T(e,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE));let r=!1;for(let e in this.tiles){let t=this.tiles[e];t.state!==`loaded`&&(t.state=`loaded`,t.texture=this.texture,r=!0)}r&&this.fire(new t.n(`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 xe extends ye{constructor(e,n,r,i){super(e,n,r,i),n.coordinates?Array.isArray(n.coordinates)&&n.coordinates.length===4&&!n.coordinates.some((e=>!Array.isArray(e)||e.length!==2||e.some((e=>typeof e!=`number`))))||this.fire(new t.l(new t.ac(`sources.${e}`,null,`"coordinates" property must be an array of 4 longitude/latitude array pairs`))):this.fire(new t.l(new t.ac(`sources.${e}`,null,`missing required property "coordinates"`))),n.animate&&typeof n.animate!=`boolean`&&this.fire(new t.l(new t.ac(`sources.${e}`,null,`optional "animate" property must be a boolean value`))),n.canvas?typeof n.canvas==`string`||n.canvas instanceof HTMLCanvasElement||this.fire(new t.l(new t.ac(`sources.${e}`,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 t.l(new t.ac(`sources.${e}`,null,`missing required property "canvas"`))),this.options=n,this.animate=n.animate===void 0||n.animate}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!0,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 t.l(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(),!1)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let n=this.map.painter.context,r=n.gl;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new t.T(n,this.canvas,r.RGBA,{premultiply:!0}),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let i=!1;for(let e in this.tiles){let t=this.tiles[e];t.state!==`loaded`&&(t.state=`loaded`,t.texture=this.texture,i=!0)}i&&this.fire(new t.n(`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(let e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}let Se={},Ce=e=>{switch(e){case`geojson`:return ve;case`image`:return ye;case`raster`:return ue;case`raster-dem`:return de;case`vector`:return le;case`video`:return be;case`canvas`:return xe}return Se[e]},we=`RTLPluginLoaded`;class Te extends t.E{constructor(){super(...arguments),this.status=`unavailable`,this.url=null,this.dispatcher=ne()}_syncState(e){return this.status=e,this.dispatcher.broadcast(`SRPS`,{pluginStatus:e,pluginURL:this.url}).catch((e=>{throw this.status=`error`,e}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status=`unavailable`,this.url=null}setRTLTextPlugin(e){return t._(this,arguments,void 0,(function*(e,t=!1){if(this.url)throw Error(`setRTLTextPlugin cannot be called multiple times.`);if(this.url=s.resolveURL(e),!this.url)throw Error(`requested url ${e} is invalid`);if(this.status===`unavailable`){if(!t)return this._requestImport();this.status=`deferred`,this._syncState(this.status)}else if(this.status===`requested`)return this._requestImport()}))}_requestImport(){return t._(this,void 0,void 0,(function*(){yield this._syncState(`loading`),this.status=`loaded`,this.fire(new t.n(we))}))}lazyLoad(){this.status===`unavailable`?this.status=`requested`:this.status===`deferred`&&this._requestImport()}}let Ee=null;function De(){return Ee||=new Te,Ee}var Oe,ke;(function(e){e[e.Base=0]=`Base`,e[e.Parent=1]=`Parent`})(Oe||={}),function(e){e[e.Departing=0]=`Departing`,e[e.Incoming=1]=`Incoming`}(ke||={});class Ae{constructor(e,n){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=e,this.uid=t.ad(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state=`loading`}isRenderable(e){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(e||!this.holdingForSymbolFade())}setCrossFadeLogic({fadingRole:e,fadingDirection:t,fadingParentID:n,fadeEndTime:r}){this.resetFadeLogic(),this.fadingRole=e,this.fadingDirection=t,this.fadingParentID=n,this.fadeEndTime=r}setSelfFadeLogic(e){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=e}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=l(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return this.state===`errored`||this.state===`loaded`||this.state===`reloading`}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,n,r){if(!0!==e?.etagUnmodified)if(this.hasData()&&this.unloadVectorData(),this.state=`loaded`,e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestEncoding=e.encoding,this.latestFeatureIndex.rawTileData=e.rawTileData,this.latestFeatureIndex.encoding=e.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(e,t){let n={};if(!t)return n;for(let r of e){let e=r.layerIds.map((e=>t.getLayer(e))).filter(Boolean);if(e.length!==0){r.layers=e,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(let t of e)n[t.id]=r}}return n}(e.buckets,n?.style),this.hasSymbolBuckets=!1;for(let e in this.buckets){let n=this.buckets[e];if(n instanceof t.af){if(this.hasSymbolBuckets=!0,!r)break;n.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let e in this.buckets){let n=this.buckets[e];if(n instanceof t.af&&n.hasRTLText){this.hasRTLText=!0,De().lazyLoad();break}}this.queryPadding=0;for(let e in this.buckets){let t=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(e).queryRadius(t))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),this.dashPositions=e.dashPositions}else this.collisionBoxArray=new t.ae;else this.state=`loaded`}unloadVectorData(){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&=null,this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.dashPositions&&=null,this.latestFeatureIndex=null,this.state=`unloaded`}getBucket(e){return this.buckets[e.id]}upload(e){for(let t in this.buckets){let n=this.buckets[t];n.uploadPending()&&n.upload(e)}let n=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new t.T(e,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&=(this.glyphAtlasTexture=new t.T(e,this.glyphAtlasImage,n.ALPHA),null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,n,r,i,a,o,s,c,l,u){return this.latestFeatureIndex?.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:l,transform:s,params:o,queryPadding:this.queryPadding*c,getElevation:u},e,t,n):{}}querySourceFeatures(e,n){let r=this.latestFeatureIndex;if(!r?.rawTileData)return;let i=r.loadVTLayers(),a=n?.sourceLayer?n.sourceLayer:``,o=i[t.ag]||i[a];if(!o)return;let s=t.ah(n?.filter,n?.globalState),{z:c,x:l,y:u}=this.tileID.canonical,d={z:c,x:l,y:u};for(let n=0;n<o.length;n++){let i=o.feature(n);if(s.needGeometry){let e=t.ai(i,!0);if(!s.filter(new t.J(this.tileID.overscaledZ),e,this.tileID.canonical))continue}else if(!s.filter(new t.J(this.tileID.overscaledZ),i))continue;let f=r.getId(i,a),p=new t.aj(i,c,l,u,f);p.tile=d,e.push(p)}}hasData(){return this.state===`loaded`||this.state===`reloading`||this.state===`expired`}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){let n=this.expirationTime;if(e.cacheControl){let n=t.ak(e.cacheControl);n[`max-age`]&&(this.expirationTime=Date.now()+1e3*n[`max-age`])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){let e=Date.now(),t=!1;if(this.expirationTime>e)t=!1;else if(n)if(this.expirationTime<n)t=!0;else{let r=this.expirationTime-n;r?this.expirationTime=e+Math.max(r,3e4):t=!0}else t=!0;t?(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(),2**31-1)}setFeatureState(e,n){if(!this.latestFeatureIndex?.rawTileData||Object.keys(e).length===0)return;let r=this.latestFeatureIndex.loadVTLayers();for(let i in this.buckets){if(!n.style.hasLayer(i))continue;let a=this.buckets[i],o=a.layers[0].sourceLayer||t.ag,s=r[o],c=e[o];if(!s||!c||Object.keys(c).length===0)continue;a.update(c,s,this.imageAtlas?.patternPositions||{},this.dashPositions||{});let l=(n?.style)?.getLayer(i);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(a)))}}holdingForSymbolFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<l()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(e){this.symbolFadeHoldUntil=l()+e}setDependencies(e,t){let n={};for(let e of t)n[e]=!0;this.dependencies[e]=n}hasDependency(e,t){for(let n of e){let e=this.dependencies[n];if(e){for(let n of t)if(e[n])return!0}}return!1}}class je{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(e,n,r){let i=String(n);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][i]=this.stateChanges[e][i]||{},t.e(this.stateChanges[e][i],r),this.deletedStates[e]===null){this.deletedStates[e]={};for(let t in this.state[e])t!==i&&(this.deletedStates[e][t]=null)}else if(this.deletedStates[e]?.[i]===null){this.deletedStates[e][i]={};for(let t in this.state[e][i])r[t]||(this.deletedStates[e][i][t]=null)}else for(let t in r)this.deletedStates[e]?.[i]?.[t]===null&&delete this.deletedStates[e][i][t]}removeFeatureState(e,t,n){if(this.deletedStates[e]===null)return;let r=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},n&&t!==void 0)this.deletedStates[e][r]!==null&&(this.deletedStates[e][r]=this.deletedStates[e][r]||{},this.deletedStates[e][r][n]=null);else if(t!==void 0)if(this.stateChanges[e]?.[r])for(n in this.deletedStates[e][r]={},this.stateChanges[e][r])this.deletedStates[e][r][n]=null;else this.deletedStates[e][r]=null;else this.deletedStates[e]=null}getState(e,n){let r=String(n),i=t.e({},(this.state[e]||{})[r],(this.stateChanges[e]||{})[r]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){let t=this.deletedStates[e][n];if(t===null)return{};for(let e in t)delete i[e]}return i}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(e,n){let r={};for(let e in this.stateChanges){this.state[e]=this.state[e]||{};let n={};for(let r in this.stateChanges[e])this.state[e][r]||(this.state[e][r]={}),t.e(this.state[e][r],this.stateChanges[e][r]),n[r]=this.state[e][r];r[e]=n}for(let e in this.deletedStates){this.state[e]=this.state[e]||{};let n={};if(this.deletedStates[e]===null)for(let t in this.state[e])n[t]={},this.state[e][t]={};else for(let t in this.deletedStates[e]){if(this.deletedStates[e][t]===null)this.state[e][t]={};else for(let n of Object.keys(this.deletedStates[e][t]))delete this.state[e][t][n];n[t]=this.state[e][t]}r[e]=r[e]||{},t.e(r[e],n)}this.stateChanges={},this.deletedStates={},Object.keys(r).length!==0&&(this.revision++,e.setFeatureState(r,n))}}let Me=89.25;function Ne(e,n){let r=t.al(n.lat,-t.am,t.am);return new t.P(t.Z(n.lng)*e,t.Y(r)*e)}function Pe(e,n){return new t.a7(n.x/e,n.y/e).toLngLat()}function Fe(e){return e.cameraToCenterDistance*Math.min(.85*Math.tan(t.an(90-e.pitch)),Math.tan(t.an(Me-e.pitch)))}function Ie(e,n){let r=e.canonical,i=n/t.ao(r.z),a=r.x+2**r.z*e.wrap,o=t.ap(new Float64Array(16));return t.Q(o,o,[a*i,r.y*i,0]),t.S(o,o,[i/t.a6,i/t.a6,1]),o}function Le(e,n,r,i,a){let o=t.a7.fromLngLat(e,n),s=a*t.aq(1,e.lat),{x:c,y:l,z:u}=Re(r,i);return new t.a7(o.x+s*-c,o.y+s*-l,o.z+s*-u)}function Re(e,n){let r=t.an(e),i=t.an(n),a=Math.cos(-r),o=Math.sin(r);return{x:o*Math.sin(i),y:-o*Math.cos(i),z:a}}function ze(e,t,n){let r=t.intersectsFrustum(e);if(!n||r===0)return r;let i=t.intersectsPlane(n);return i===0?0:r===2&&i===2?2:1}function P(e,t,n){let r=0,i=(n-t)/10;for(let a=0;a<10;a++)r+=i*Math.cos(t+(a+.5)/10*(n-t))**+e;return r}function Be(e,n){return function(r,i,a,o,s){let c=2*((e-1)/t.ar(Math.cos(t.an(Me-s))/Math.cos(t.an(Me)))-1),l=Math.acos(a/o),u=2*P(c-1,0,t.an(s/2)),d=Math.min(t.an(Me),l+t.an(s/2)),f=P(c-1,Math.min(d,l-t.an(s/2)),d),p=Math.atan(i/a),m=Math.hypot(i,a),h=r;return h+=t.ar(o/m/Math.max(.5,Math.cos(t.an(s/2)))),h+=c*t.ar(Math.cos(p))/2,h-=t.ar(Math.max(1,f/u/n))/2,h}}let Ve=Be(9.314,3);function F(e,n){let r=(n.roundZoom?Math.round:Math.floor)(e.zoom+t.ar(e.tileSize/n.tileSize));return Math.max(0,r)}function He(e,n){let r=e.getCameraFrustum(),i=e.getClippingPlane(),a=e.screenPointToMercatorCoordinate(e.getCameraPoint()),o=t.a7.fromLngLat(e.center,e.elevation);a.z=o.z+Math.cos(e.pitchInRadians)*e.cameraToCenterDistance/e.worldSize;let s=e.getCoveringTilesDetailsProvider(),c=s.allowVariableZoom(e,n),l=F(e,n),u=n.minzoom||0,d=n.maxzoom===void 0?e.maxZoom:n.maxzoom,f=Math.min(Math.max(0,l),d),p=2**f,m=[p*a.x,p*a.y,0],h=[p*o.x,p*o.y,0],g=Math.hypot(o.x-a.x,o.y-a.y),_=Math.abs(o.z-a.z),v=Math.hypot(g,_),y=e=>({zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}),b=[],x=[];if(e.renderWorldCopies&&s.allowWorldCopies())for(let e=1;e<=3;e++)b.push(y(-e)),b.push(y(e));for(b.push(y(0));b.length>0;){let p=b.pop(),g=p.x,y=p.y,S=p.fullyVisible,C={x:g,y,z:p.zoom},w=s.getTileBoundingVolume(C,p.wrap,e.elevation,n);if(!S){let e=ze(r,w,i);if(e===0)continue;S=e===2}let T=s.distanceToTile2d(a.x,a.y,C,w),E=l;c&&(E=(n.calculateTileZoom||Ve)(e.zoom+t.ar(e.tileSize/n.tileSize),T,_,v,e.fov)),E=(n.roundZoom?Math.round:Math.floor)(E),E=Math.max(0,E);let D=Math.min(E,d);if(p.wrap=s.getWrap(o,C,p.wrap),p.zoom>=D){if(p.zoom<u)continue;let e=f-p.zoom,r=m[0]-.5-(g<<e),i=m[1]-.5-(y<<e),a=n.reparseOverscaled?Math.max(p.zoom,E):p.zoom;x.push({tileID:new t.a3(p.zoom===d?a:p.zoom,p.wrap,p.zoom,g,y),distanceSq:t.as([h[0]-.5-g,h[1]-.5-y]),tileDistanceToCamera:Math.sqrt(r*r+i*i)})}else for(let e=0;e<4;e++)b.push({zoom:p.zoom+1,x:(g<<1)+e%2,y:(y<<1)+(e>>1),wrap:p.wrap,fullyVisible:S})}return x.sort(((e,t)=>e.distanceSq-t.distanceSq)).map((e=>e.tileID))}let Ue=t.a8.fromPoints([new t.P(0,0),new t.P(t.a6,t.a6)]);function We(e){return e===`raster`||e===`image`||e===`video`}function Ge(e,t,n,r,i,a,o){if(!t.hasData())return!1;let{tileID:s,fadingRole:c,fadingDirection:l,fadingParentID:u}=t;if(c===Oe.Base&&l===ke.Incoming&&u)return n[u.key]=u,!0;let d=Math.max(s.overscaledZ-i,a);for(let i=s.overscaledZ-1;i>=d;i--){let a=s.scaledTo(i),c=e.getLoadedTile(a);if(c)return t.setCrossFadeLogic({fadingRole:Oe.Base,fadingDirection:ke.Incoming,fadingParentID:c.tileID,fadeEndTime:r+o}),c.setCrossFadeLogic({fadingRole:Oe.Parent,fadingDirection:ke.Departing,fadeEndTime:r+o}),n[a.key]=a,!0}return!1}function Ke(e,t,n,r,i,a){if(!t.hasData())return!1;let o=t.tileID.children(i),s=qe(e,t,o,n,r,i,a);if(s)return!0;for(let c of o)qe(e,t,c.children(i),n,r,i,a)&&(s=!0);return s}function qe(e,t,n,r,i,a,o){if(n[0].overscaledZ>=a)return!1;let s=!1;for(let a of n){let n=e.getLoadedTile(a);if(!n)continue;let{fadingRole:c,fadingDirection:l,fadingParentID:u}=n;c===Oe.Base&&l===ke.Departing&&u||(n.setCrossFadeLogic({fadingRole:Oe.Base,fadingDirection:ke.Departing,fadingParentID:t.tileID,fadeEndTime:i+o}),t.setCrossFadeLogic({fadingRole:Oe.Parent,fadingDirection:ke.Incoming,fadeEndTime:i+o})),r[a.key]=a,s=!0}return s}function Je(e,t,n,r){let i=e.tileID;return!!e.selfFading||!e.hasData()&&!!t.has(i)&&(e.setSelfFadeLogic(n+r),!0)}function Ye(e,t){var n;e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0;let r=t.tileID.canonical.x-e.tileID.canonical.x,i=t.tileID.canonical.y-e.tileID.canonical.y,a=2**e.tileID.canonical.z,o=t.tileID.key;r===0&&i===0||Math.abs(i)>1||(Math.abs(r)>1&&(Math.abs(r+a)===1?r+=a:Math.abs(r-a)===1&&(r-=a)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,i),(n=e.neighboringTiles)!=null&&n[o]&&(e.neighboringTiles[o].backfilled=!0)))}class I{constructor(){this._tiles={}}handleWrapJump(e){let t={};for(let n in this._tiles){let r=this._tiles[n];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+e),t[r.tileID.key]=r}this._tiles=t}setFeatureState(e,t){for(let n in this._tiles)this._tiles[n].setFeatureState(e,t)}getAllTiles(){return Object.values(this._tiles)}getAllIds(e=!1){return e?Object.values(this._tiles).map((e=>e.tileID)).sort(t.au).map((e=>e.key)):Object.keys(this._tiles)}getTileById(e){return this._tiles[e]}setTile(e,t){this._tiles[e]=t}deleteTileById(e){delete this._tiles[e]}getLoadedTile(e){let t=this.getTileById(e.key);return t?.hasData()?t:null}isIdRenderable(e,t=!1){return this.getTileById(e)?.isRenderable(t)}getRenderableIds(e=0,n){let r=[];for(let e of this.getAllIds())this.isIdRenderable(e,n)&&r.push(this.getTileById(e));return n?r.sort(((n,r)=>{let i=n.tileID,a=r.tileID,o=new t.P(i.canonical.x,i.canonical.y)._rotate(-e),s=new t.P(a.canonical.x,a.canonical.y)._rotate(-e);return i.overscaledZ-a.overscaledZ||s.y-o.y||s.x-o.x})).map((e=>e.tileID.key)):r.map((e=>e.tileID)).sort(t.au).map((e=>e.key))}}class Xe extends t.E{constructor(e,n,r){super(),this.id=e,this.dispatcher=r,this.on(`data`,(e=>{this._dataHandler(e)})),this.on(`dataloading`,(()=>{this._sourceErrored=!1})),this.on(`error`,(()=>{this._sourceErrored=this._source.loaded()})),this._source=((e,t,n,r)=>{let i=new(Ce(t.type))(e,t,n,r);if(i.id!==e)throw Error(`Expected Source id to be ${e} instead of ${i.id}`);return i})(e,n,r,this),this._inViewTiles=new I,this._outOfViewCache=new t.av(0,(e=>this._unloadTile(e))),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new je,this._didEmitContent=!1,this._updated=!1}onAdd(e){var t;this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,(t=this._source)!=null&&t.onAdd&&this._source.onAdd(e)}onRemove(e){var t;for(let e of this._inViewTiles.getAllTiles())e.unloadVectorData();this.clearTiles(),(t=this._source)!=null&&t.onRemove&&this._source.onRemove(e),this._inViewTiles=new I}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let e of this._inViewTiles.getAllTiles())if(e.state!==`loaded`&&e.state!==`errored`)return!1;return!0}getSource(){return this._source}getState(){return this._state}pause(){this._paused=!0}resume(){if(!this._paused)return;let e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,n,r){return t._(this,void 0,void 0,(function*(){try{let t=yield this._source.loadTile(e);this._tileLoaded(e,n,r,t)}catch(n){e.state=`errored`,n.status===404?this.update(this.transform,this.terrain):this._source.fire(new t.l(t.d(n),{tile:e}))}}))}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new t.n(`dataabort`,{tile:e,coord:e.tileID,dataType:`source`}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._inViewTiles,this.map?this.map.painter:null);for(let t of this._inViewTiles.getAllTiles())t.upload(e),t.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(e){return this._inViewTiles.getRenderableIds(this.transform?.bearingInRadians,e)}hasRenderableParent(e){let t=e.overscaledZ-1;if(t>=this._source.minzoom){let n=this.getLoadedTile(e.scaledTo(t));if(n)return this._inViewTiles.isIdRenderable(n.tileID.key)}return!1}reload(e,t=void 0){if(this._paused)this._shouldReloadOnResume=!0;else{this._outOfViewCache.reset();for(let n of this._inViewTiles.getAllIds()){let r=this._inViewTiles.getTileById(n);t&&!this._source.shouldReloadTile(r,t)||(e?this._reloadTile(n,`expired`):r.state!==`errored`&&this._reloadTile(n,`reloading`))}}}_reloadTile(e,n){return t._(this,void 0,void 0,(function*(){let t=this._inViewTiles.getTileById(e);t&&(t.state!==`loading`&&(t.state=n),yield this._loadTile(t,e,n))}))}_tileLoaded(e,n,r,i){e.timeAdded=l(),e.selfFading&&(e.fadeEndTime=e.timeAdded+this._rasterFadeDuration),r===`expired`&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(n,e),i!=null&&i.unmodified||(this.getSource().type===`raster-dem`&&e.dem&&function(e,t){var n;let r=t.getRenderableIds();for(let i of r){if(!e.neighboringTiles?.[i])continue;let r=t.getTileById(i);e.neighboringTiles[i].backfilled||Ye(e,r),(n=r.neighboringTiles?.[e.tileID.key])!=null&&n.backfilled||Ye(r,e)}}(e,this._inViewTiles),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new t.n(`data`,{dataType:`source`,tile:e,coord:e.tileID})))}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._inViewTiles.getTileById(e)}_retainLoadedChildren(e,t){let n=this._getLoadedDescendents(t),r=new Set;for(let i of t){let t=n[i.key];if(!t?.length){r.add(i);continue}let a=i.overscaledZ+Xe.maxOverzooming,o=t.filter((e=>e.tileID.overscaledZ<=a));if(!o.length){r.add(i);continue}let s=Math.min(...o.map((e=>e.tileID.overscaledZ))),c=o.filter((e=>e.tileID.overscaledZ===s)).map((e=>e.tileID));for(let t of c)e[t.key]=t;this._areDescendentsComplete(c,s,i.overscaledZ)||r.add(i)}return r}_getLoadedDescendents(e){var t;let n={};for(let r of this._inViewTiles.getAllTiles().filter((e=>e.hasData())))for(let i of e)r.tileID.isChildOf(i)&&(n[t=i.key]||(n[t]=[])).push(r);return n}_areDescendentsComplete(e,t,n){return e.length===1&&e[0].isOverscaled()?e[0].overscaledZ===t:4**(t-n)===e.length}getLoadedTile(e){return this._inViewTiles.getLoadedTile(e)}updateCacheSize(e){let n=Math.ceil(e.width/this._source.tileSize)+1,r=Math.ceil(e.height/this._source.tileSize)+1,i=Math.floor(n*r*(this._maxTileCacheZoomLevels===null?t.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),a=typeof this._maxTileCacheSize==`number`?Math.min(this._maxTileCacheSize,i):i;this._outOfViewCache.setMaxSize(a)}handleWrapJump(e){let t=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);this._prevLng=e,t&&(this._inViewTiles.handleWrapJump(t),this._resetTileReloadTimers())}update(e,n){if(!this._sourceLoaded||this._paused)return;let r;this.transform=e,this.terrain=n,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?r=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((e=>new t.a3(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y))):(r=He(e,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.type===`vector`&&this.map._zoomLevelsToOverscale!==void 0?e.maxZoom-this.map._zoomLevelsToOverscale:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:n,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(r=r.filter((e=>this._source.hasTile(e))))):r=[],this.usedForTerrain&&(r=this._addTerrainIdealTiles(r));let i=r.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,i&&this.fire(new t.n(`data`,{sourceDataType:`idle`,dataType:`source`,sourceId:this.id}));let a=F(e,this._source),o=this._updateRetainedTiles(r,a),s=We(this._source.type);s&&this._rasterFadeDuration>0&&!n&&function(e,n,r,i,a,o,s){let c=l(),u=t.at(n);for(let t of n){let n=e.getTileById(t.key);n.fadingDirection!==ke.Departing&&n.fadeOpacity!==0||n.resetFadeLogic(),Ge(e,n,r,c,i,a,s)||Ke(e,n,r,c,o,s)||Je(n,u,c,s)||n.resetFadeLogic()}}(this._inViewTiles,r,o,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),s?this._cleanUpRasterTiles(o):this._cleanUpVectorTiles(o)}_cleanUpRasterTiles(e){for(let t of this._inViewTiles.getAllIds())e[t]||this._removeTile(t)}_cleanUpVectorTiles(e){for(let t of this._inViewTiles.getAllIds()){let n=this._inViewTiles.getTileById(t);e[t]?n.clearSymbolFadeHold():n.hasSymbolBuckets?n.holdingForSymbolFade()?n.symbolFadeFinished()&&this._removeTile(t):n.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(t)}}_addTerrainIdealTiles(e){let t=[];for(let n of e)if(n.canonical.z>this._source.minzoom){let e=n.scaledTo(n.canonical.z-1);t.push(e);let r=n.scaledTo(Math.max(this._source.minzoom,Math.min(n.canonical.z,5)));t.push(r)}return e.concat(t)}releaseSymbolFadeTiles(){for(let e of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(e).holdingForSymbolFade()&&this._removeTile(e)}_updateRetainedTiles(e,t){let n=new Set;for(let t of e)this._addTile(t).hasData()||n.add(t);let r=e.reduce(((e,t)=>(e[t.key]=t,e)),{}),i=this._retainLoadedChildren(r,n),a={},o=Math.max(t-Xe.maxUnderzooming,this._source.minzoom);for(let e of i){let t=this._inViewTiles.getTileById(e.key),n=t?.wasRequested();for(let i=e.overscaledZ-1;i>=o;--i){let o=e.scaledTo(i);if(a[o.key])break;if(a[o.key]=!0,t=this.getTile(o),!t&&n&&(t=this._addTile(o)),t){let e=t.hasData();if((e||!this.map?.cancelPendingTileRequestsWhileZooming||n)&&(r[o.key]=o),n=t.wasRequested(),e)break}}}return r}_addTile(e){let n=this._inViewTiles.getTileById(e.key);if(n)return n;n=this._outOfViewCache.getAndRemove(e),n&&(n.resetFadeLogic(),this._setTileReloadTimer(e.key,n),n.tileID=e,this._state.initializeTileState(n,this.map?this.map.painter:null));let r=n;return n||(n=new Ae(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(n,e.key,n.state)),n.uses++,this._inViewTiles.setTile(e.key,n),r||this._source.fire(new t.n(`dataloading`,{tile:n,coord:n.tileID,dataType:`source`})),n}_setTileReloadTimer(e,t){this._clearTileReloadTimer(e);let n=t.getExpiryTimeout();n&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,`expired`),delete this._timers[e]}),n))}_clearTileReloadTimer(e){let t=this._timers[e];t&&(clearTimeout(t),delete this._timers[e])}_resetTileReloadTimers(){for(let e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(let e of this._inViewTiles.getAllIds()){let t=this._inViewTiles.getTileById(e);this._setTileReloadTimer(e,t)}}refreshTiles(e){for(let t of this._inViewTiles.getAllIds()){let n=this._inViewTiles.getTileById(t);(this._inViewTiles.isIdRenderable(t)||n.state==`errored`)&&e.some((e=>e.equals(n.tileID.canonical)))&&this._reloadTile(t,`expired`)}}_removeTile(e){let t=this._inViewTiles.getTileById(e);t&&(t.uses--,this._inViewTiles.deleteTileById(e),this._clearTileReloadTimer(e),t.uses>0||(t.hasData()&&t.state!==`reloading`?this._outOfViewCache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}_dataHandler(e){e.dataType===`source`&&(e.sourceDataType===`metadata`?this._sourceLoaded=!0:e.sourceDataType===`content`&&this._sourceLoaded&&!this._paused&&(this.reload(e.sourceDataChanged,e.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let e of this._inViewTiles.getAllIds())this._removeTile(e);this._outOfViewCache.reset()}tilesIn(e,n,r){let i=[],a=this.transform;if(!a)return i;let o=a.getCoveringTilesDetailsProvider().allowWorldCopies(),s=r?a.getCameraQueryGeometry(e):e,c=e=>a.screenPointToMercatorCoordinate(e,this.terrain),l=this.transformBbox(e,c,!o),u=this.transformBbox(s,c,!o),d=this.getIds(),f=t.a8.fromPoints(u);for(let e of d){let r=this._inViewTiles.getTileById(e);if(r.holdingForSymbolFade())continue;let s=o?[r.tileID]:[r.tileID.unwrapTo(-1),r.tileID.unwrapTo(0)],c=2**(a.zoom-r.tileID.overscaledZ),d=n*r.queryPadding*t.a6/r.tileSize/c;for(let e of s){let n=f.map((n=>e.getTilePoint(new t.a7(n.x,n.y))));if(n.expandBy(d),n.intersects(Ue)){let t=l.map((t=>e.getTilePoint(t))),n=u.map((t=>e.getTilePoint(t)));i.push({tile:r,tileID:o?e:e.unwrapTo(0),queryGeometry:t,cameraQueryGeometry:n,scale:c})}}}return i}transformBbox(e,n,r){let i=e.map(n);if(r){let r=t.a8.fromPoints(e);r.shrinkBy(.001*Math.min(r.width(),r.height()));let a=r.map(n);t.a8.fromPoints(i).covers(a)||(i=i.map((e=>e.x>.5?new t.a7(e.x-1,e.y,e.z):e)))}return i}getVisibleCoordinates(e){let t=this.getRenderableIds(e).map((e=>this._inViewTiles.getTileById(e).tileID));return this.transform&&this.transform.populateCache(t),t}hasTransition(){return!!this._source.hasTransition()||We(this._source.type)&&function(e,t){if(t<=0)return!1;let n=l();for(let t of e.getAllTiles())if(t.fadeEndTime>=n)return!0;return!1}(this._inViewTiles,this._rasterFadeDuration)}setRasterFadeDuration(e){this._rasterFadeDuration=e}setFeatureState(e,n,r){this._state.updateState(e||=t.ag,n,r)}removeFeatureState(e,n,r){this._state.removeFeatureState(e||=t.ag,n,r)}getFeatureState(e,n){return this._state.getState(e||=t.ag,n)}setDependencies(e,t,n){let r=this._inViewTiles.getTileById(e);r&&r.setDependencies(t,n)}reloadTilesForDependencies(e,t){for(let n of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(n).hasDependency(e,t)&&this._reloadTile(n,`reloading`);this._outOfViewCache.filter((n=>!n.hasDependency(e,t)))}areTilesLoaded(){for(let e of this._inViewTiles.getAllTiles())if(e.state!==`loaded`&&e.state!==`errored`)return!1;return!0}}Xe.maxUnderzooming=10,Xe.maxOverzooming=3;class Ze{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let e=1;e<this.points.length;e++)this._distances[e]=this._distances[e-1]+this.points[e].dist(this.points[e-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(this.points.length===1)return this.points[0];e=t.al(e,0,1);let n=1,r=this._distances[n],i=e*this.paddedLength+this.padding;for(;r<i&&n<this._distances.length;)r=this._distances[++n];let a=n-1,o=this._distances[a],s=r-o,c=s>0?(i-o)/s:0;return this.points[a].mult(1-c).add(this.points[n].mult(c))}}function Qe(e,t){let n=!0;return e===`always`||e!==`never`&&t!==`never`||(n=!1),n}class $e{constructor(e,t,n){let r=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/n),this.yCellCount=Math.ceil(t/n);for(let e=0;e<this.xCellCount*this.yCellCount;e++)r.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,n,r,i){this._forEachCell(t,n,r,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)}insertCircle(e,t,n,r){this._forEachCell(t-r,n-r,t+r,n+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(n),this.circles.push(r)}_insertBoxCell(e,t,n,r,i,a){this.boxCells[i].push(a)}_insertCircleCell(e,t,n,r,i,a){this.circleCells[i].push(a)}_query(e,t,n,r,i,a,o){if(n<0||e>this.width||r<0||t>this.height)return[];let s=[];if(e<=0&&t<=0&&this.width<=n&&this.height<=r){if(i)return[{key:null,x1:e,y1:t,x2:n,y2:r}];for(let e=0;e<this.boxKeys.length;e++)s.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});for(let e=0;e<this.circleKeys.length;e++){let t=this.circles[3*e],n=this.circles[3*e+1],r=this.circles[3*e+2];s.push({key:this.circleKeys[e],x1:t-r,y1:n-r,x2:t+r,y2:n+r})}}else this._forEachCell(e,t,n,r,this._queryCell,s,{hitTest:i,overlapMode:a,seenUids:{box:{},circle:{}}},o);return s}query(e,t,n,r){return this._query(e,t,n,r,!1,null)}hitTest(e,t,n,r,i,a){return this._query(e,t,n,r,!0,i,a).length>0}hitTestCircle(e,t,n,r,i){let a=e-n,o=e+n,s=t-n,c=t+n;if(o<0||a>this.width||c<0||s>this.height)return!1;let l=[];return this._forEachCell(a,s,o,c,this._queryCellCircle,l,{hitTest:!0,overlapMode:r,circle:{x:e,y:t,radius:n},seenUids:{box:{},circle:{}}},i),l.length>0}_queryCell(e,t,n,r,i,a,o,s){let{seenUids:c,hitTest:l,overlapMode:u}=o,d=this.boxCells[i],f=1e-6;if(d!==null){let i=this.bboxes;for(let o of d)if(!c.box[o]){c.box[o]=!0;let d=4*o,p=this.boxKeys[o];if(e<=i[d+2]+f&&t<=i[d+3]+f&&n>=i[d+0]-f&&r>=i[d+1]-f&&(!s||s(p))&&(!l||!Qe(u,p.overlapMode))&&(a.push({key:p,x1:i[d],y1:i[d+1],x2:i[d+2],y2:i[d+3]}),l))return!0}}let p=this.circleCells[i];if(p!==null){let i=this.circles;for(let o of p)if(!c.circle[o]){c.circle[o]=!0;let d=3*o,f=this.circleKeys[o];if(this._circleAndRectCollide(i[d],i[d+1],i[d+2],e,t,n,r)&&(!s||s(f))&&(!l||!Qe(u,f.overlapMode))){let e=i[d],t=i[d+1],n=i[d+2];if(a.push({key:f,x1:e-n,y1:t-n,x2:e+n,y2:t+n}),l)return!0}}}return!1}_queryCellCircle(e,t,n,r,i,a,o,s){let{circle:c,seenUids:l,overlapMode:u}=o,d=this.boxCells[i];if(d!==null){let e=this.bboxes;for(let t of d)if(!l.box[t]){l.box[t]=!0;let n=4*t,r=this.boxKeys[t];if(this._circleAndRectCollide(c.x,c.y,c.radius,e[n+0],e[n+1],e[n+2],e[n+3])&&(!s||s(r))&&!Qe(u,r.overlapMode))return a.push(!0),!0}}let f=this.circleCells[i];if(f!==null){let e=this.circles;for(let t of f)if(!l.circle[t]){l.circle[t]=!0;let n=3*t,r=this.circleKeys[t];if(this._circlesCollide(e[n],e[n+1],e[n+2],c.x,c.y,c.radius)&&(!s||s(r))&&!Qe(u,r.overlapMode))return a.push(!0),!0}}}_forEachCell(e,t,n,r,i,a,o,s){let c=this._convertToXCellCoord(e),l=this._convertToYCellCoord(t),u=this._convertToXCellCoord(n),d=this._convertToYCellCoord(r);for(let f=c;f<=u;f++)for(let c=l;c<=d;c++)if(i.call(this,e,t,n,r,this.xCellCount*c+f,a,o,s))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,n,r,i,a){let o=r-e,s=i-t,c=n+a;return c*c>o*o+s*s}_circleAndRectCollide(e,t,n,r,i,a,o){let s=(a-r)/2,c=Math.abs(e-(r+s));if(c>s+n)return!1;let l=(o-i)/2,u=Math.abs(t-(i+l));if(u>l+n)return!1;if(c<=s||u<=l)return!0;let d=c-s,f=u-l;return d*d+f*f<=n*n}}function L(e,n,i){let a=t.O();if(!e){let{vecSouth:e,vecEast:t}=z(n),i=r();i[0]=t[0],i[1]=t[1],i[2]=e[0],i[3]=e[1],o=i,(f=(c=(s=i)[0])*(d=s[3])-(u=s[2])*(l=s[1]))&&(o[0]=d*(f=1/f),o[1]=-l*f,o[2]=-u*f,o[3]=c*f),a[0]=i[0],a[1]=i[1],a[4]=i[2],a[5]=i[3]}var o,s,c,l,u,d,f;return t.S(a,a,[1/i,1/i,1]),a}function R(e,n,r,i){if(e){let e=t.O();if(!n){let{vecSouth:t,vecEast:n}=z(r);e[0]=n[0],e[1]=n[1],e[4]=t[0],e[5]=t[1]}return t.S(e,e,[i,i,1]),e}return r.pixelsToClipSpaceMatrix}function z(e){let n=Math.cos(e.rollInRadians),r=Math.sin(e.rollInRadians),i=Math.cos(e.pitchInRadians),a=Math.cos(e.bearingInRadians),o=Math.sin(e.bearingInRadians),s=t.aA();s[0]=-a*i*r-o*n,s[1]=-o*i*r+a*n;let c=t.aB(s);c<1e-9?t.aC(s):t.aD(s,s,1/c);let l=t.aA();l[0]=a*i*n-o*r,l[1]=o*i*n+a*r;let u=t.aB(l);return u<1e-9?t.aC(l):t.aD(l,l,1/u),{vecEast:l,vecSouth:s}}function et(e,n,r,i){let a;i?(a=[e,n,i(e,n),1],t.aF(a,a,r)):(a=[e,n,0,1],gt(a,a,r));let o=a[3];return{point:new t.P(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function tt(e,t){return .5+e/t*.5}function nt(e,t){return e.x>=-t[0]&&e.x<=t[0]&&e.y>=-t[1]&&e.y<=t[1]}function B(e,n,r,i,a,o,s,c,l,u,d,f,p){let m=r?e.textSizeData:e.iconSizeData,h=t.aw(m,n.transform.zoom),g=[256/n.width*2+1,256/n.height*2+1],_=r?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;_.clear();let v=e.lineVertexArray,y=r?e.text.placedSymbolArray:e.icon.placedSymbolArray,b=n.transform.width/n.transform.height,x=!1;for(let r=0;r<y.length;r++){let S=y.get(r);if(S.hidden||S.writingMode===t.ax.vertical&&!x){ht(S.numGlyphs,_);continue}x=!1;let C=new t.P(S.anchorX,S.anchorY),w={getElevation:p,pitchedLabelPlaneMatrix:i,lineVertexArray:v,pitchWithMap:o,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:n.transform,tileAnchorPoint:C,unwrappedTileID:l,width:u,height:d,translation:f},T=ut(S.anchorX,S.anchorY,w);if(!nt(T.point,g)){ht(S.numGlyphs,_);continue}let E=tt(n.transform.cameraToCenterDistance,T.signedDistanceFromCamera),D=t.ay(m,h,S),O=o?D*n.transform.getPitchedTextCorrection(S.anchorX,S.anchorY,l)/E:D*E,k=at({projectionContext:w,pitchedLabelPlaneMatrixInverse:a,symbol:S,fontSize:O,flip:!1,keepUpright:s,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:_,aspectRatio:b,rotateToLine:c});x=k.useVertical,(k.notEnoughRoom||x||k.needsFlipping&&at({projectionContext:w,pitchedLabelPlaneMatrixInverse:a,symbol:S,fontSize:O,flip:!0,keepUpright:s,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:_,aspectRatio:b,rotateToLine:c}).notEnoughRoom)&&ht(S.numGlyphs,_)}r?e.text.dynamicLayoutVertexBuffer.updateData(_):e.icon.dynamicLayoutVertexBuffer.updateData(_)}function rt(e,t,n,r,i,a,o,s){let c=a.glyphStartIndex+a.numGlyphs,l=a.lineStartIndex,u=a.lineStartIndex+a.lineLength,d=t.getoffsetX(a.glyphStartIndex),f=t.getoffsetX(c-1),p=pt(e*d,n,r,i,a.segment,l,u,s,o);if(!p)return null;let m=pt(e*f,n,r,i,a.segment,l,u,s,o);return m?s.projectionCache.anyProjectionOccluded?null:{first:p,last:m}:null}function it(e,n,r,i){return e===t.ax.horizontal&&Math.abs(r.y-n.y)>Math.abs(r.x-n.x)*i?{useVertical:!0}:(e===t.ax.vertical?n.y<r.y:n.x>r.x)?{needsFlipping:!0}:null}function at(e){let{projectionContext:n,pitchedLabelPlaneMatrixInverse:r,symbol:i,fontSize:a,flip:o,keepUpright:s,glyphOffsetArray:c,dynamicLayoutVertexArray:l,aspectRatio:u,rotateToLine:d}=e,f=a/24,p=i.lineOffsetX*f,m=i.lineOffsetY*f,h;if(i.numGlyphs>1){let e=i.glyphStartIndex+i.numGlyphs,t=i.lineStartIndex,a=i.lineStartIndex+i.lineLength,l=rt(f,c,p,m,o,i,d,n);if(!l)return{notEnoughRoom:!0};let g=lt(l.first.point.x,l.first.point.y,n,r),_=lt(l.last.point.x,l.last.point.y,n,r);if(s&&!o){let e=it(i.writingMode,g,_,u);if(e)return e}h=[l.first];for(let r=i.glyphStartIndex+1;r<e-1;r++){let e=pt(f*c.getoffsetX(r),p,m,o,i.segment,t,a,n,d);if(!e)return{notEnoughRoom:!0};h.push(e)}h.push(l.last)}else{if(s&&!o){let e=ct(n.tileAnchorPoint.x,n.tileAnchorPoint.y,n).point,a=i.lineStartIndex+i.segment+1,o=new t.P(n.lineVertexArray.getx(a),n.lineVertexArray.gety(a)),s=ct(o.x,o.y,n),c=s.signedDistanceFromCamera>0?s.point:ot(n.tileAnchorPoint,o,e,1,n),l=lt(e.x,e.y,n,r),d=lt(c.x,c.y,n,r),f=it(i.writingMode,l,d,u);if(f)return f}let e=pt(f*c.getoffsetX(i.glyphStartIndex),p,m,o,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,n,d);if(!e||n.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};h=[e]}for(let e of h)t.aE(l,e.point,e.angle);return{}}function ot(e,t,n,r,i){let a=e.add(e.sub(t)._unit()),o=ct(a.x,a.y,i).point,s=n.sub(o);return n.add(s._mult(r/s.mag()))}function st(e,n,r){let i=n.projectionCache;if(i.projections[e])return i.projections[e];let a=new t.P(n.lineVertexArray.getx(e),n.lineVertexArray.gety(e)),o=ct(a.x,a.y,n);if(o.signedDistanceFromCamera>0)return i.projections[e]=o.point,i.anyProjectionOccluded=i.anyProjectionOccluded||o.isOccluded,o.point;let s=e-r.direction;return ot(r.distanceFromAnchor===0?n.tileAnchorPoint:new t.P(n.lineVertexArray.getx(s),n.lineVertexArray.gety(s)),a,r.previousVertex,r.absOffsetX-r.distanceFromAnchor+1,n)}function ct(e,t,n){let r=e+n.translation[0],i=t+n.translation[1],a;return n.pitchWithMap?(a=et(r,i,n.pitchedLabelPlaneMatrix,n.getElevation),a.isOccluded=!1):(a=n.transform.projectTileCoordinates(r,i,n.unwrappedTileID,n.getElevation),a.point.x=(.5*a.point.x+.5)*n.width,a.point.y=(.5*-a.point.y+.5)*n.height),a}function lt(e,n,r,i){if(r.pitchWithMap){let a=[e,n,0,1];return t.aF(a,a,i),r.transform.projectTileCoordinates(a[0]/a[3],a[1]/a[3],r.unwrappedTileID,r.getElevation).point}return{x:e/r.width*2-1,y:1-n/r.height*2}}function ut(e,t,n){return n.transform.projectTileCoordinates(e,t,n.unwrappedTileID,n.getElevation)}function dt(e,t,n){return e._unit()._perp()._mult(t*n)}function ft(e,n,r,i,a,o,s,c,l){if(c.projectionCache.offsets[e])return c.projectionCache.offsets[e];let u=r.add(n);if(e+l.direction<i||e+l.direction>=a)return c.projectionCache.offsets[e]=u,u;let d=st(e+l.direction,c,l),f=dt(d.sub(r),s,l.direction),p=r.add(f),m=d.add(f);return c.projectionCache.offsets[e]=t.aG(o,u,p,m)||u,c.projectionCache.offsets[e]}function pt(e,t,n,r,i,a,o,s,c){let l=r?e-t:e+t,u=l>0?1:-1,d=0;r&&(u*=-1,d=Math.PI),u<0&&(d+=Math.PI);let f,p=u>0?a+i:a+i+1;s.projectionCache.cachedAnchorPoint?f=s.projectionCache.cachedAnchorPoint:(f=ct(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=f);let m,h,g=f,_=f,v=0,y=0,b=Math.abs(l),x=[],S;for(;v+y<=b;){if(p+=u,p<a||p>=o)return null;v+=y,_=g,h=m;let e={absOffsetX:b,direction:u,distanceFromAnchor:v,previousVertex:_};if(g=st(p,s,e),n===0)x.push(_),S=g.sub(_);else{let t,r=g.sub(_);t=r.mag()===0?dt(st(p+u,s,e).sub(g),n,u):dt(r,n,u),h||=_.add(t),m=ft(p,t,g,a,o,h,n,s,e),x.push(h),S=m.sub(h)}y=S.mag()}let C=S._mult((b-v)/y)._add(h||_),w=d+Math.atan2(g.y-_.y,g.x-_.x);return x.push(C),{point:C,angle:c?w:0,path:x}}let mt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ht(e,t){for(let n=0;n<e;n++){let e=t.length;t.resize(e+4),t.float32.set(mt,3*e)}}function gt(e,t,n){let r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e[3]=n[3]*r+n[7]*i+n[15],e}class _t{constructor(e,t=new $e(e.width+200,e.height+200,25),n=new $e(e.width+200,e.height+200,25)){this.transform=e,this.grid=t,this.ignoredGrid=n,this.pitchFactor=Math.cos(e.pitch*Math.PI/180)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+100,this.screenBottomBoundary=e.height+100,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,t,n,r,i,a,o,s,c,l,u,d){let f=this.projectAndGetPerspectiveRatio(e.anchorPointX+s[0],e.anchorPointY+s[1],i,l,d),p=n*f.perspectiveRatio,m;if(a||o)m=this._projectCollisionBox(e,p,r,i,a,o,s,f,l,u,d);else{let t=f.x+(u?u.x*p:0),n=f.y+(u?u.y*p:0);m={allPointsOccluded:!1,box:[t+e.x1*p,n+e.y1*p,t+e.x2*p,n+e.y2*p]}}let[h,g,_,v]=m.box,y=a?m.allPointsOccluded:f.isOccluded,b=y;return b||=f.perspectiveRatio<this.perspectiveRatioCutoff,b||=!this.isInsideGrid(h,g,_,v),b||t!==`always`&&this.grid.hitTest(h,g,_,v,t,c)?{box:[h,g,_,v],placeable:!1,offscreen:!1,occluded:y}:{box:[h,g,_,v],placeable:!0,offscreen:this.isOffscreen(h,g,_,v),occluded:y}}placeCollisionCircles(e,n,r,i,a,o,s,c,l,u,d,f,p,m){let h=[],g=new t.P(n.anchorX,n.anchorY),_=this.getPerspectiveRatio(g.x,g.y,o,m),v=(l?a*this.transform.getPitchedTextCorrection(n.anchorX,n.anchorY,o)/_:a*_)/t.aK,y={getElevation:m,pitchedLabelPlaneMatrix:s,lineVertexArray:r,pitchWithMap:l,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=rt(v,i,n.lineOffsetX*v,n.lineOffsetY*v,!1,n,!1,y),x=!1,S=!1,C=!0;if(b){let n=.5*d*_+f,r=new t.P(-100,-100),i=new t.P(this.screenRightBoundary,this.screenBottomBoundary),a=new Ze,o=b.first,s=b.last,p=[];for(let e=o.path.length-1;e>=1;e--)p.push(o.path[e]);for(let e=1;e<s.path.length;e++)p.push(s.path[e]);let m=2.5*n;if(l){let e=this.projectPathToScreenSpace(p,y);p=e.some((e=>e.signedDistanceFromCamera<=0))?[]:e.map((e=>e.point))}let g=[];if(p.length>0){let e=p[0].clone(),n=p[0].clone();for(let t=1;t<p.length;t++)e.x=Math.min(e.x,p[t].x),e.y=Math.min(e.y,p[t].y),n.x=Math.max(n.x,p[t].x),n.y=Math.max(n.y,p[t].y);g=e.x>=r.x&&n.x<=i.x&&e.y>=r.y&&n.y<=i.y?[p]:n.x<r.x||e.x>i.x||n.y<r.y||e.y>i.y?[]:t.aH([p],r.x,r.y,i.x,i.y)}for(let t of g){a.reset(t,.25*n);let r=0;r=a.length<=.5*n?1:Math.ceil(a.paddedLength/m)+1;for(let t=0;t<r;t++){let i=t/Math.max(r-1,1),o=a.lerp(i),s=o.x+100,l=o.y+100;h.push(s,l,n,0);let d=s-n,f=l-n,p=s+n,m=l+n;if(C&&=this.isOffscreen(d,f,p,m),S||=this.isInsideGrid(d,f,p,m),e!==`always`&&this.grid.hitTestCircle(s,l,n,e,u)&&(x=!0,!c))return{circles:[],offscreen:!1,collisionDetected:x}}}}return{circles:!c&&x||!S||_<this.perspectiveRatioCutoff?[]:h,offscreen:C,collisionDetected:x}}projectPathToScreenSpace(e,n){return function(e){let t=0,n=0,r=0,i=0;for(let a=0;a<e.length;a++)e[a].isOccluded?(r=a+1,i=0):(i++,i>n&&(n=i,t=r));return e.slice(t,t+n)}(function(e,n){let r=t.O();return t.az(r,n.pitchedLabelPlaneMatrix),e.map((e=>{let t=et(e.x,e.y,r,n.getElevation),i=n.transform.projectTileCoordinates(t.point.x,t.point.y,n.unwrappedTileID,n.getElevation);return i.point.x=(.5*i.point.x+.5)*n.width,i.point.y=(.5*-i.point.y+.5)*n.height,i}))}(e,n))}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let n=[],r=new t.a8;for(let i of e){let e=new t.P(i.x+100,i.y+100);r.extend(e),n.push(e)}let{minX:i,minY:a,maxX:o,maxY:s}=r,c=this.grid.query(i,a,o,s).concat(this.ignoredGrid.query(i,a,o,s)),l={},u={};for(let e of c){let r=e.key;if(l[r.bucketInstanceId]===void 0&&(l[r.bucketInstanceId]={}),l[r.bucketInstanceId][r.featureIndex])continue;let i=[new t.P(e.x1,e.y1),new t.P(e.x2,e.y1),new t.P(e.x2,e.y2),new t.P(e.x1,e.y2)];t.aI(n,i)&&(l[r.bucketInstanceId][r.featureIndex]=!0,u[r.bucketInstanceId]===void 0&&(u[r.bucketInstanceId]=[]),u[r.bucketInstanceId].push(r.featureIndex))}return u}insertCollisionBox(e,t,n,r,i,a){(n?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:i,collisionGroupID:a,overlapMode:t},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,n,r,i,a){let o=n?this.ignoredGrid:this.grid,s={bucketInstanceId:r,featureIndex:i,collisionGroupID:a,overlapMode:t};for(let t=0;t<e.length;t+=4)o.insertCircle(s,e[t],e[t+1],e[t+2])}projectAndGetPerspectiveRatio(e,n,r,i,a){if(a){let r;i?(r=[e,n,i(e,n),1],t.aF(r,r,a)):(r=[e,n,0,1],gt(r,r,a));let o=r[3];return{x:(r[0]/o+1)/2*this.transform.width+100,y:(-r[1]/o+1)/2*this.transform.height+100,perspectiveRatio:.5+this.transform.cameraToCenterDistance/o*.5,isOccluded:!1,signedDistanceFromCamera:o}}{let t=this.transform.projectTileCoordinates(e,n,r,i);return{x:(t.point.x+1)/2*this.transform.width+100,y:(1-t.point.y)/2*this.transform.height+100,perspectiveRatio:.5+this.transform.cameraToCenterDistance/t.signedDistanceFromCamera*.5,isOccluded:t.isOccluded,signedDistanceFromCamera:t.signedDistanceFromCamera}}}getPerspectiveRatio(e,t,n,r){let i=this.transform.projectTileCoordinates(e,t,n,r);return .5+this.transform.cameraToCenterDistance/i.signedDistanceFromCamera*.5}isOffscreen(e,t,n,r){return n<100||e>=this.screenRightBoundary||r<100||t>this.screenBottomBoundary}isInsideGrid(e,t,n,r){return n>=0&&e<this.gridRightBoundary&&r>=0&&t<this.gridBottomBoundary}getViewportMatrix(){let e=t.ap([]);return t.Q(e,e,[-100,-100,0]),e}_projectCollisionBox(e,n,r,i,a,o,s,c,l,u,d){let f=1,p=0,m=0,h=1,g=e.anchorPointX+s[0],_=e.anchorPointY+s[1];if(o&&!a){let e=this.projectAndGetPerspectiveRatio(g+1,_,i,l,d),t=e.x-c.x,n=Math.atan((e.y-c.y)/t)+(t<0?Math.PI:0),r=Math.sin(n),a=Math.cos(n);f=a,p=r,m=-r,h=a}else if(!o&&a){let e=z(this.transform);f=e.vecEast[0],p=e.vecEast[1],m=e.vecSouth[0],h=e.vecSouth[1]}let v=c.x,y=c.y,b=n;a&&(v=g,y=_,b=2**-(this.transform.zoom-r.overscaledZ),b*=this.transform.getPitchedTextCorrection(g,_,i),u||(b*=t.al(.5+c.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),u&&(v+=f*u.x*b+m*u.y*b,y+=p*u.x*b+h*u.y*b);let x=e.x1*b,S=e.x2*b,C=(x+S)/2,w=e.y1*b,T=e.y2*b,E=(w+T)/2,D=[{offsetX:x,offsetY:w},{offsetX:C,offsetY:w},{offsetX:S,offsetY:w},{offsetX:S,offsetY:E},{offsetX:S,offsetY:T},{offsetX:C,offsetY:T},{offsetX:x,offsetY:T},{offsetX:x,offsetY:E}],O=[];for(let{offsetX:e,offsetY:n}of D)O.push(new t.P(v+f*e+m*n,y+p*e+h*n));let k=!1;if(a){let e=O.map((e=>this.projectAndGetPerspectiveRatio(e.x,e.y,i,l,d)));k=e.some((e=>!e.isOccluded)),O=e.map((e=>new t.P(e.x,e.y)))}else k=!0;return{box:t.aJ(O),allPointsOccluded:!k}}}class vt{constructor(e,t,n,r){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):r&&n?1:0,this.placed=n}isHidden(){return this.opacity===0&&!this.placed}}class yt{constructor(e,t,n,r,i){this.text=new vt(e?e.text:null,t,n,i),this.icon=new vt(e?e.icon:null,t,r,i)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class bt{constructor(e,t,n){this.text=e,this.icon=t,this.skipFade=n}}class xt{constructor(e,t,n,r,i){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=n,this.bucketIndex=r,this.tileID=i}}class St{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){let t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}}function Ct(e,n,r,i,a){let{horizontalAlign:o,verticalAlign:s}=t.aQ(e);return new t.P(-(o-.5)*n+i[0]*a,-(s-.5)*r+i[1]*a)}class wt{constructor(e,t,n,r,i){this.transform=e.clone(),this.terrain=t,this.collisionIndex=new _t(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new St(r),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=i,i&&(i.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){let t=this.terrain;return t?(n,r)=>t.getElevation(e,n,r):null}getBucketParts(e,n,r,i){let a=r.getBucket(n),o=r.latestFeatureIndex;if(!a||!o||n.id!==a.layerIds[0])return;let s=r.collisionBoxArray,c=a.layers[0].layout,l=a.layers[0].paint,u=2**(this.transform.zoom-r.tileID.overscaledZ),d=r.tileSize/t.a6,f=r.tileID.toUnwrapped(),p=c.get(`text-rotation-alignment`)===`map`,m=t.aL(r,1,this.transform.zoom),h=t.aM(this.collisionIndex.transform,r,l.get(`text-translate`),l.get(`text-translate-anchor`)),g=t.aM(this.collisionIndex.transform,r,l.get(`icon-translate`),l.get(`icon-translate-anchor`)),_=L(p,this.transform,m);this.retainedQueryData[a.bucketInstanceId]=new xt(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,r.tileID);let v={bucket:a,layout:c,translationText:h,translationIcon:g,unwrappedTileID:f,pitchedLabelPlaneMatrix:_,scale:u,textPixelRatio:d,holdingForFade:r.holdingForSymbolFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.aw(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(let t of a.sortKeyRanges){let{sortKey:n,symbolInstanceStart:r,symbolInstanceEnd:i}=t;e.push({sortKey:n,symbolInstanceStart:r,symbolInstanceEnd:i,parameters:v})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:v})}attemptAnchorPlacement(e,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){var x,S;let C=t.aN[e.textAnchor],w=[e.textOffset0,e.textOffset1],T=Ct(C,r,i,w,a),E=this.collisionIndex.placeCollisionBox(n,f,c,l,u,s,o,g,d.predicate,y,T,b);if((!v||this.collisionIndex.placeCollisionBox(v,f,c,l,u,s,o,_,d.predicate,y,T,b).placeable)&&E.placeable){let e;if((x=this.prevPlacement)!=null&&x.variableOffsets[p.crossTileID]&&(S=this.prevPlacement?.placements[p.crossTileID])!=null&&S.text&&(e=this.prevPlacement.variableOffsets[p.crossTileID].anchor),p.crossTileID===0)throw Error(`symbolInstance.crossTileID can't be 0`);return this.variableOffsets[p.crossTileID]={textOffset:w,width:r,height:i,anchor:C,textBoxScale:a,prevAnchor:e},this.markUsedJustification(m,C,p,h),m.allowVerticalPlacement&&(this.markUsedOrientation(m,h,p),this.placedOrientations[p.crossTileID]=h),{shift:T,placedGlyphBoxes:E}}}placeLayerBucketPart(e,n,r){let{bucket:i,layout:a,translationText:o,translationIcon:s,unwrappedTileID:c,pitchedLabelPlaneMatrix:l,textPixelRatio:u,holdingForFade:d,collisionBoxArray:f,partiallyEvaluatedTextSize:p,collisionGroup:m}=e.parameters,h=a.get(`text-optional`),g=a.get(`icon-optional`),_=t.aO(a,`text-overlap`,`text-allow-overlap`),v=_===`always`,y=t.aO(a,`icon-overlap`,`icon-allow-overlap`),b=y===`always`,x=a.get(`text-rotation-alignment`)===`map`,S=a.get(`text-pitch-alignment`)===`map`,C=a.get(`icon-text-fit`)!==`none`,w=a.get(`symbol-z-order`)===`viewport-y`,T=v&&(b||!i.hasIconData()||g),E=b&&(v||!i.hasTextData()||h);!i.collisionArrays&&f&&i.deserializeCollisionBoxes(f);let D=this.retainedQueryData[i.bucketInstanceId].tileID,O=this._getTerrainElevationFunc(D),k=this.transform.getFastPathSimpleProjectionMatrix(D),A=(e,f,b)=>{if(n[e.crossTileID])return;if(d)return void(this.placements[e.crossTileID]=new bt(!1,!1,!1));let w=!1,A=!1,j=!0,ee=null,M={box:null,placeable:!1,offscreen:null,occluded:!1},te={placeable:!1},ne=null,N=null,re=null,ie=0,ae=0,oe=0;f.textFeatureIndex?ie=f.textFeatureIndex:e.useRuntimeCollisionCircles&&(ie=e.featureIndex),f.verticalTextFeatureIndex&&(ae=f.verticalTextFeatureIndex);let se=f.textBox;if(se){let n=n=>{let r=t.ax.horizontal;if(i.allowVerticalPlacement&&!n&&this.prevPlacement){let t=this.prevPlacement.placedOrientations[e.crossTileID];t&&(this.placedOrientations[e.crossTileID]=t,r=t,this.markUsedOrientation(i,r,e))}return r},a=(n,r)=>{if(i.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&f.verticalTextBox){for(let e of i.writingModes)if(e===t.ax.vertical?(M=r(),te=M):M=n(),M?.placeable)break}else M=n()},l=e.textAnchorOffsetStartIndex,d=e.textAnchorOffsetEndIndex;if(d===l){let r=(t,n)=>{let r=this.collisionIndex.placeCollisionBox(t,_,u,D,c,S,x,o,m.predicate,O,void 0,k);return r!=null&&r.placeable&&(this.markUsedOrientation(i,n,e),this.placedOrientations[e.crossTileID]=n),r};a((()=>r(se,t.ax.horizontal)),(()=>{let n=f.verticalTextBox;return i.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&n?r(n,t.ax.vertical):{box:null,offscreen:null}})),n(M?.placeable)}else{let p=t.aN[this.prevPlacement?.variableOffsets[e.crossTileID]?.anchor],h=(t,n,a)=>{let f=t.x2-t.x1,h=t.y2-t.y1,g=e.textBoxScale,v=C&&y===`never`?n:null,b=null,T=_===`never`?1:2,E=`never`;p&&T++;for(let n=0;n<T;n++){for(let n=l;n<d;n++){let r=i.textAnchorOffsets.get(n);if(p&&r.textAnchor!==p)continue;let l=this.attemptAnchorPlacement(r,t,f,h,g,x,S,u,D,c,m,E,e,i,a,o,s,v,O);if(l&&(b=l.placedGlyphBoxes,b?.placeable))return w=!0,ee=l.shift,b}p?p=null:E=_}return r&&!b&&(b={box:this.collisionIndex.placeCollisionBox(se,`always`,u,D,c,S,x,o,m.predicate,O,void 0,k).box,offscreen:!1,placeable:!1,occluded:!1}),b};a((()=>h(se,f.iconBox,t.ax.horizontal)),(()=>{let n=f.verticalTextBox;return i.allowVerticalPlacement&&!M?.placeable&&e.numVerticalGlyphVertices>0&&n?h(n,f.verticalIconBox,t.ax.vertical):{box:null,occluded:!0,offscreen:null}})),M&&(w=M.placeable,j=M.offscreen);let g=n(M?.placeable);if(!w&&this.prevPlacement){let t=this.prevPlacement.variableOffsets[e.crossTileID];t&&(this.variableOffsets[e.crossTileID]=t,this.markUsedJustification(i,t.anchor,e,g))}}}if(ne=M,w=ne?.placeable,j=ne?.offscreen,e.useRuntimeCollisionCircles&&e.centerJustifiedTextSymbolIndex>=0){let n=i.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),s=t.ay(i.textSizeData,p,n),u=a.get(`text-padding`);N=this.collisionIndex.placeCollisionCircles(_,n,i.lineVertexArray,i.glyphOffsetArray,s,c,l,r,S,m.predicate,e.collisionCircleDiameter,u,o,O),N.circles.length&&N.collisionDetected&&!r&&t.w(`Collisions detected, but collision boxes are not shown`),w=v||N.circles.length>0&&!N.collisionDetected,j&&=N.offscreen}if(f.iconFeatureIndex&&(oe=f.iconFeatureIndex),f.iconBox){let e=e=>this.collisionIndex.placeCollisionBox(e,y,u,D,c,S,x,s,m.predicate,O,C&&ee?ee:void 0,k);te&&te.placeable&&f.verticalIconBox?(re=e(f.verticalIconBox),A=re.placeable):(re=e(f.iconBox),A=re.placeable),j&&=re.offscreen}let ce=h||e.numHorizontalGlyphVertices===0&&e.numVerticalGlyphVertices===0,le=g||e.numIconVertices===0;ce||le?le?ce||(A&&=w):w=A&&w:A=w=A&&w;let ue=A&&re.placeable;if(w&&ne.placeable&&this.collisionIndex.insertCollisionBox(ne.box,_,a.get(`text-ignore-placement`),i.bucketInstanceId,te&&te.placeable&&ae?ae:ie,m.ID),ue&&this.collisionIndex.insertCollisionBox(re.box,y,a.get(`icon-ignore-placement`),i.bucketInstanceId,oe,m.ID),N&&w&&this.collisionIndex.insertCollisionCircles(N.circles,_,a.get(`text-ignore-placement`),i.bucketInstanceId,ie,m.ID),r&&this.storeCollisionData(i.bucketInstanceId,b,f,ne,re,N),e.crossTileID===0)throw Error(`symbolInstance.crossTileID can't be 0`);if(i.bucketInstanceId===0)throw Error(`bucket.bucketInstanceId can't be 0`);this.placements[e.crossTileID]=new bt((w||T)&&!ne?.occluded,(A||E)&&!re?.occluded,j||i.justReloaded),n[e.crossTileID]=!0};if(w){if(e.symbolInstanceStart!==0)throw Error(`bucket.bucketInstanceId should be 0`);let t=i.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let e=t.length-1;e>=0;--e){let n=t[e];A(i.symbolInstances.get(n),i.collisionArrays[n],n)}}else for(let t=e.symbolInstanceStart;t<e.symbolInstanceEnd;t++)A(i.symbolInstances.get(t),i.collisionArrays[t],t);i.justReloaded=!1}storeCollisionData(e,t,n,r,i,a){if(n.textBox||n.iconBox){let a,o;this.collisionBoxArrays.has(e)?a=this.collisionBoxArrays.get(e):(a=new Map,this.collisionBoxArrays.set(e,a)),a.has(t)?o=a.get(t):(o={text:null,icon:null},a.set(t,o)),n.textBox&&(o.text=r.box),n.iconBox&&(o.icon=i.box)}if(a){let t=this.collisionCircleArrays[e];t===void 0&&(t=this.collisionCircleArrays[e]=[]);for(let e=0;e<a.circles.length;e+=4)t.push(a.circles[e+0]-100),t.push(a.circles[e+1]-100),t.push(a.circles[e+2]),t.push(+!!a.collisionDetected)}}markUsedJustification(e,n,r,i){let a;a=i===t.ax.vertical?r.verticalPlacedTextSymbolIndex:{left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex}[t.aP(n)];let o=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];for(let t of o)t>=0&&(e.text.placedSymbolArray.get(t).crossTileID=a>=0&&t!==a?0:r.crossTileID)}markUsedOrientation(e,n,r){let i=n===t.ax.horizontal||n===t.ax.horizontalOnly?n:0,a=n===t.ax.vertical?n:0,o=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];for(let t of o)e.text.placedSymbolArray.get(t).placedOrientation=i;r.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;let t=this.prevPlacement,n=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;let r=t?t.symbolFadeChange(e):1,i=t?t.opacities:{},a=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(let e in this.placements){let t=this.placements[e],a=i[e];a?(this.opacities[e]=new yt(a,r,t.text,t.icon),n=n||t.text!==a.text.placed||t.icon!==a.icon.placed):(this.opacities[e]=new yt(null,r,t.text,t.icon,t.skipFade),n=n||t.text||t.icon)}for(let e in i){let t=i[e];if(!this.opacities[e]){let i=new yt(t,r,!1,!1);i.isHidden()||(this.opacities[e]=i,n=n||t.text.placed||t.icon.placed)}}for(let e in a)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=a[e]);for(let e in o)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=o[e]);if(t&&t.lastPlacementChangeTime===void 0)throw Error(`Last placement time for previous placement is not defined`);n?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!=`number`&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){let n={};for(let r of t){let t=r.getBucket(e);t&&r.latestFeatureIndex&&e.id===t.layerIds[0]&&this.updateBucketOpacities(t,r.tileID,n,r.collisionBoxArray)}}updateBucketOpacities(e,n,r,i){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();let a=e.layers[0],o=a.layout,s=new yt(null,0,!1,!1,!0),c=o.get(`text-allow-overlap`),l=o.get(`icon-allow-overlap`),u=a._unevaluatedLayout.hasValue(`text-variable-anchor`)||a._unevaluatedLayout.hasValue(`text-variable-anchor-offset`),d=o.get(`text-rotation-alignment`)===`map`,f=o.get(`text-pitch-alignment`)===`map`,p=o.get(`icon-text-fit`)!==`none`,m=new yt(null,0,c&&(l||!e.hasIconData()||o.get(`icon-optional`)),l&&(c||!e.hasTextData()||o.get(`text-optional`)),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);let h=(e,t,n)=>{for(let r=0;r<t/4;r++)e.opacityVertexArray.emplaceBack(n);e.hasVisibleVertices=e.hasVisibleVertices||n!==jt},g=this.collisionBoxArrays.get(e.bucketInstanceId);for(let n=0;n<e.symbolInstances.length;n++){let i=e.symbolInstances.get(n),{numHorizontalGlyphVertices:a,numVerticalGlyphVertices:o,crossTileID:c}=i,l=this.opacities[c];r[c]?l=s:l||(l=m,this.opacities[c]=l),r[c]=!0;let _=i.numIconVertices>0,v=this.placedOrientations[i.crossTileID],y=v===t.ax.vertical,b=v===t.ax.horizontal||v===t.ax.horizontalOnly;if(a>0||o>0){let t=At(l.text);h(e.text,a,y?jt:t),h(e.text,o,b?jt:t);let n=l.text.isHidden(),r=[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex];for(let t of r)t>=0&&(e.text.placedSymbolArray.get(t).hidden=n||y?1:0);i.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).hidden=n||b?1:0);let s=this.variableOffsets[i.crossTileID];s&&this.markUsedJustification(e,s.anchor,i,v);let c=this.placedOrientations[i.crossTileID];c&&(this.markUsedJustification(e,`left`,i,c),this.markUsedOrientation(e,c,i))}if(_){let t=At(l.icon),n=!(p&&i.verticalPlacedIconSymbolIndex&&y);i.placedIconSymbolIndex>=0&&(h(e.icon,i.numIconVertices,n?t:jt),e.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=l.icon.isHidden()),i.verticalPlacedIconSymbolIndex>=0&&(h(e.icon,i.numVerticalIconVertices,n?jt:t),e.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=l.icon.isHidden())}let x=g?.has(n)?g.get(n):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){let r=e.collisionArrays[n];if(r){let n=new t.P(0,0);if(r.textBox||r.verticalTextBox){let t=!0;if(u){let e=this.variableOffsets[c];e?(n=Ct(e.anchor,e.width,e.height,e.textOffset,e.textBoxScale),d&&n._rotate(f?-this.transform.bearingInRadians:this.transform.bearingInRadians)):t=!1}if(r.textBox||r.verticalTextBox){let i;r.textBox&&(i=y),r.verticalTextBox&&(i=b),Tt(e.textCollisionBox.collisionVertexArray,l.text.placed,!t||i,x.text,n.x,n.y)}}if(r.iconBox||r.verticalIconBox){let t=!!(!b&&r.verticalIconBox),i;r.iconBox&&(i=t),r.verticalIconBox&&(i=!t),Tt(e.iconCollisionBox.collisionVertexArray,l.icon.placed,i,x.icon,p?n.x:0,p?n.y:0)}}}}if(e.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);e.bucketInstanceId in this.collisionCircleArrays&&(e.collisionCircleArray=this.collisionCircleArrays[e.bucketInstanceId],delete this.collisionCircleArrays[e.bucketInstanceId])}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){let n=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*n>e}setStale(){this.stale=!0}}function Tt(e,t,n,r,i,a){r&&r.length!==0||(r=[0,0,0,0]);let o=r[0]-100,s=r[1]-100,c=r[2]-100,l=r[3]-100;e.emplaceBack(+!!t,+!!n,i||0,a||0,o,s),e.emplaceBack(+!!t,+!!n,i||0,a||0,c,s),e.emplaceBack(+!!t,+!!n,i||0,a||0,c,l),e.emplaceBack(+!!t,+!!n,i||0,a||0,o,l)}let Et=2**25,Dt=2**24,Ot=2**17,kt=2**16;function At(e){if(e.opacity===0&&!e.placed)return 0;if(e.opacity===1&&e.placed)return 4294967295;let t=+!!e.placed,n=Math.floor(127*e.opacity);return n*Et+t*Dt+n*Ot+t*kt+n*512+t*256+n*2+t}let jt=0;class Mt{constructor(e){this._sortAcrossTiles=e.layout.get(`symbol-z-order`)!==`viewport-y`&&!e.layout.get(`symbol-sort-key`).isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,n,r,i){let a=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(a,r,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,i())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort(((e,t)=>e.sortKey-t.sortKey)));this._currentPartIndex<a.length;)if(t.placeLayerBucketPart(a[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,i())return!0;return!1}}class Nt{constructor(e,t,n,r,i,a,o,s){this.placement=new wt(e,t,a,o,s),this._currentPlacementIndex=n.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=i,this._done=!1}isDone(){return this._done}continuePlacement(e,n,r){let i=l(),a=()=>!this._forceFullPlacement&&l()-i>2;for(;this._currentPlacementIndex>=0;){let i=n[e[this._currentPlacementIndex]],o=this.placement.collisionIndex.transform.zoom;if(t.aR(i)&&i.layout&&(!i.minzoom||i.minzoom<=o)&&(!i.maxzoom||i.maxzoom>o)){if(this._inProgressLayer||=new Mt(i),this._inProgressLayer.continuePlacement(r[i.source],this.placement,this._showCollisionBoxes,i,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}let Pt=512/t.a6/2;class Ft{constructor(e,n,r){this.tileID=e,this.bucketInstanceId=r,this._symbolsByKey={};let i=new Map;for(let e=0;e<n.length;e++){let t=n.get(e),r=t.key,a=i.get(r);a?a.push(t):i.set(r,[t])}for(let[e,n]of i){let r={positions:n.map((e=>({x:Math.floor(e.anchorX*Pt),y:Math.floor(e.anchorY*Pt)}))),crossTileIDs:n.map((e=>e.crossTileID))};if(r.positions.length>128){let e=new t.aS(r.positions.length,16,Uint16Array);for(let{x:t,y:n}of r.positions)e.add(t,n);e.finish(),delete r.positions,r.index=e}this._symbolsByKey[e]=r}}getScaledCoordinates(e,n){let{x:r,y:i,z:a}=this.tileID.canonical,{x:o,y:s,z:c}=n.canonical,l=Pt/2**(c-a),u=(s*t.a6+e.anchorY)*l,d=i*t.a6*Pt;return{x:Math.floor((o*t.a6+e.anchorX)*l-r*t.a6*Pt),y:Math.floor(u-d)}}findMatches(e,t,n){let r=this.tileID.canonical.z<t.canonical.z?1:2**(this.tileID.canonical.z-t.canonical.z);for(let i=0;i<e.length;i++){let a=e.get(i);if(a.crossTileID)continue;let o=this._symbolsByKey[a.key];if(!o)continue;let s=this.getScaledCoordinates(a,t);if(o.index){let e=o.index.range(s.x-r,s.y-r,s.x+r,s.y+r).sort();for(let t of e){let e=o.crossTileIDs[t];if(!n[e]){n[e]=!0,a.crossTileID=e;break}}}else if(o.positions)for(let e=0;e<o.positions.length;e++){let t=o.positions[e],i=o.crossTileIDs[e];if(Math.abs(t.x-s.x)<=r&&Math.abs(t.y-s.y)<=r&&!n[i]){n[i]=!0,a.crossTileID=i;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:e})=>e))}}class It{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Lt{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let t=Math.round((e-this.lng)/360);if(t!==0)for(let e in this.indexes){let n=this.indexes[e],r={};for(let e in n){let i=n[e];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),r[i.tileID.key]=i}this.indexes[e]=r}this.lng=e}addBucket(e,t,n){if(this.indexes[e.overscaledZ]?.[e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let e=0;e<t.symbolInstances.length;e++)t.symbolInstances.get(e).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});let r=this.usedCrossTileIDs[e.overscaledZ];for(let n in this.indexes){let i=this.indexes[n];if(Number(n)>e.overscaledZ)for(let n in i){let a=i[n];a.tileID.isChildOf(e)&&a.findMatches(t.symbolInstances,e,r)}else{let a=i[e.scaledTo(Number(n)).key];a&&a.findMatches(t.symbolInstances,e,r)}}for(let e=0;e<t.symbolInstances.length;e++){let i=t.symbolInstances.get(e);i.crossTileID||(i.crossTileID=n.generate(),r[i.crossTileID]=!0)}return this.indexes[e.overscaledZ]===void 0&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Ft(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(let n of t.getCrossTileIDsLists())for(let t of n)delete this.usedCrossTileIDs[e][t]}removeStaleBuckets(e){let t=!1;for(let n in this.indexes){let r=this.indexes[n];for(let i in r)e[r[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,r[i]),delete r[i],t=!0)}return t}}class Rt{constructor(){this.layerIndexes={},this.crossTileIDs=new It,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,n){let r=this.layerIndexes[e.id];r===void 0&&(r=this.layerIndexes[e.id]=new Lt);let i=!1,a={};r.handleWrapJump(n);for(let n of t){let t=n.getBucket(e);e.id===t?.layerIds[0]&&(t.bucketInstanceId||=++this.maxBucketInstanceId,r.addBucket(n.tileID,t,this.crossTileIDs)&&(i=!0),a[t.bucketInstanceId]=!0)}return r.removeStaleBuckets(a)&&(i=!0),i}pruneUnusedLayers(e){let t={};for(let n of e)t[n]=!0;for(let e in this.layerIndexes)t[e]||delete this.layerIndexes[e]}}var zt=`void main() {fragColor=vec4(1.0);}`;let V={prelude:H(`#ifdef GL_ES
7
+ precision mediump float;
8
+ #else
9
+ #if !defined(lowp)
10
+ #define lowp
11
+ #endif
12
+ #if !defined(mediump)
13
+ #define mediump
14
+ #endif
15
+ #if !defined(highp)
16
+ #define highp
17
+ #endif
18
+ #endif
19
+ out highp vec4 fragColor;`,`#ifdef GL_ES
20
+ precision highp float;
21
+ #else
22
+ #if !defined(lowp)
23
+ #define lowp
24
+ #endif
25
+ #if !defined(mediump)
26
+ #define mediump
27
+ #endif
28
+ #if !defined(highp)
29
+ #define highp
30
+ #endif
31
+ #endif
32
+ vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
33
+ );}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
34
+ );}
35
+ #ifdef TERRAIN3D
36
+ uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;
37
+ #endif
38
+ const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {
39
+ #ifdef TERRAIN3D
40
+ highp 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));
41
+ #else
42
+ return 1.0;
43
+ #endif
44
+ }float calculate_visibility(vec4 pos) {
45
+ #ifdef TERRAIN3D
46
+ vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
47
+ #else
48
+ return 1.0;
49
+ #endif
50
+ }float ele(vec2 pos) {
51
+ #ifdef TERRAIN3D
52
+ vec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
53
+ #else
54
+ return 0.0;
55
+ #endif
56
+ }float get_elevation(vec2 pos) {
57
+ #ifdef TERRAIN3D
58
+ #ifdef GLOBE
59
+ if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}
60
+ #endif
61
+ vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;
62
+ #else
63
+ return 0.0;
64
+ #endif
65
+ }const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`),projectionMercator:H(``,`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:H(``,`#define GLOBE_RADIUS 6371008.8
66
+ uniform 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
67
+ );}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);
68
+ if (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
69
+ );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:H(`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;
70
+ #ifdef OVERDRAW_INSPECTOR
71
+ fragColor=vec4(1.0);
72
+ #endif
73
+ }`,`in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}`),backgroundPattern:H(`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;
74
+ #ifdef OVERDRAW_INSPECTOR
75
+ fragColor=vec4(1.0);
76
+ #endif
77
+ }`,`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:H(`in vec3 v_data;in float v_visibility;
78
+ #pragma mapbox: define highp vec4 color
79
+ #pragma mapbox: define mediump float radius
80
+ #pragma mapbox: define lowp float blur
81
+ #pragma mapbox: define lowp float opacity
82
+ #pragma mapbox: define highp vec4 stroke_color
83
+ #pragma mapbox: define mediump float stroke_width
84
+ #pragma mapbox: define lowp float stroke_opacity
85
+ void main() {
86
+ #pragma mapbox: initialize highp vec4 color
87
+ #pragma mapbox: initialize mediump float radius
88
+ #pragma mapbox: initialize lowp float blur
89
+ #pragma mapbox: initialize lowp float opacity
90
+ #pragma mapbox: initialize highp vec4 stroke_color
91
+ #pragma mapbox: initialize mediump float stroke_width
92
+ #pragma mapbox: initialize lowp float stroke_opacity
93
+ vec2 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;}
94
+ #ifdef OVERDRAW_INSPECTOR
95
+ fragColor=vec4(1.0);
96
+ #endif
97
+ }`,`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;
98
+ #pragma mapbox: define highp vec4 color
99
+ #pragma mapbox: define mediump float radius
100
+ #pragma mapbox: define lowp float blur
101
+ #pragma mapbox: define lowp float opacity
102
+ #pragma mapbox: define highp vec4 stroke_color
103
+ #pragma mapbox: define mediump float stroke_width
104
+ #pragma mapbox: define lowp float stroke_opacity
105
+ void main(void) {
106
+ #pragma mapbox: initialize highp vec4 color
107
+ #pragma mapbox: initialize mediump float radius
108
+ #pragma mapbox: initialize lowp float blur
109
+ #pragma mapbox: initialize lowp float opacity
110
+ #pragma mapbox: initialize highp vec4 stroke_color
111
+ #pragma mapbox: initialize mediump float stroke_width
112
+ #pragma mapbox: initialize lowp float stroke_opacity
113
+ vec2 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) {
114
+ #ifdef GLOBE
115
+ vec3 center_vector=projectToSphere(circle_center);
116
+ #endif
117
+ float 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 {
118
+ #ifdef GLOBE
119
+ vec4 projected_center=interpolateProjection(circle_center,center_vector,ele);
120
+ #else
121
+ vec4 projected_center=projectTileWithElevation(circle_center,ele);
122
+ #endif
123
+ corner_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);}
124
+ #ifdef GLOBE
125
+ vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);
126
+ #else
127
+ gl_Position=projectTileWithElevation(corner_position,ele);
128
+ #endif
129
+ } 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:H(zt,`in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}`),heatmap:H(`uniform highp float u_intensity;in vec2 v_extrude;
130
+ #pragma mapbox: define highp float weight
131
+ #define GAUSS_COEF 0.3989422804014327
132
+ void main() {
133
+ #pragma mapbox: initialize highp float weight
134
+ float 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);
135
+ #ifdef OVERDRAW_INSPECTOR
136
+ fragColor=vec4(1.0);
137
+ #endif
138
+ }`,`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;
139
+ #pragma mapbox: define highp float weight
140
+ #pragma mapbox: define mediump float radius
141
+ const highp float ZERO=1.0/255.0/16.0;
142
+ #define GAUSS_COEF 0.3989422804014327
143
+ void main(void) {
144
+ #pragma mapbox: initialize highp float weight
145
+ #pragma mapbox: initialize mediump float radius
146
+ vec2 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);
147
+ #ifdef GLOBE
148
+ vec2 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);
149
+ #else
150
+ gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));
151
+ #endif
152
+ }`),heatmapTexture:H(`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;
153
+ #ifdef OVERDRAW_INSPECTOR
154
+ fragColor=vec4(0.0);
155
+ #endif
156
+ }`,`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:H(`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:H(`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:H(`#ifdef GL_ES
157
+ precision highp float;
158
+ #endif
159
+ uniform 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
160
+ {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));
161
+ #ifdef OVERDRAW_INSPECTOR
162
+ fragColor=vec4(1.0);
163
+ #endif
164
+ }`,`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:H(`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:H(zt,`in vec2 a_pos;void main() {
165
+ #ifdef GLOBE
166
+ gl_Position=projectTileFor3D(a_pos,0.0);
167
+ #else
168
+ gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);
169
+ #endif
170
+ }`),fill:H(`#pragma mapbox: define highp vec4 color
171
+ #pragma mapbox: define lowp float opacity
172
+ void main() {
173
+ #pragma mapbox: initialize highp vec4 color
174
+ #pragma mapbox: initialize lowp float opacity
175
+ fragColor=color*opacity;
176
+ #ifdef OVERDRAW_INSPECTOR
177
+ fragColor=vec4(1.0);
178
+ #endif
179
+ }`,`uniform vec2 u_fill_translate;in vec2 a_pos;
180
+ #pragma mapbox: define highp vec4 color
181
+ #pragma mapbox: define lowp float opacity
182
+ void main() {
183
+ #pragma mapbox: initialize highp vec4 color
184
+ #pragma mapbox: initialize lowp float opacity
185
+ gl_Position=projectTile(a_pos+u_fill_translate,a_pos);}`),fillOutline:H(`in vec2 v_pos;
186
+ #ifdef GLOBE
187
+ in float v_depth;
188
+ #endif
189
+ #pragma mapbox: define highp vec4 outline_color
190
+ #pragma mapbox: define lowp float opacity
191
+ void main() {
192
+ #pragma mapbox: initialize highp vec4 outline_color
193
+ #pragma mapbox: initialize lowp float opacity
194
+ float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);
195
+ #ifdef GLOBE
196
+ if (v_depth > 1.0) {discard;}
197
+ #endif
198
+ #ifdef OVERDRAW_INSPECTOR
199
+ fragColor=vec4(1.0);
200
+ #endif
201
+ }`,`uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;
202
+ #ifdef GLOBE
203
+ out float v_depth;
204
+ #endif
205
+ #pragma mapbox: define highp vec4 outline_color
206
+ #pragma mapbox: define lowp float opacity
207
+ void main() {
208
+ #pragma mapbox: initialize highp vec4 outline_color
209
+ #pragma mapbox: initialize lowp float opacity
210
+ gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;
211
+ #ifdef GLOBE
212
+ v_depth=gl_Position.z/gl_Position.w;
213
+ #endif
214
+ }`),fillOutlinePattern:H(`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;
215
+ #ifdef GLOBE
216
+ in float v_depth;
217
+ #endif
218
+ #pragma mapbox: define lowp float opacity
219
+ #pragma mapbox: define lowp vec4 pattern_from
220
+ #pragma mapbox: define lowp vec4 pattern_to
221
+ void main() {
222
+ #pragma mapbox: initialize lowp float opacity
223
+ #pragma mapbox: initialize mediump vec4 pattern_from
224
+ #pragma mapbox: initialize mediump vec4 pattern_to
225
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=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;
226
+ #ifdef GLOBE
227
+ if (v_depth > 1.0) {discard;}
228
+ #endif
229
+ #ifdef OVERDRAW_INSPECTOR
230
+ fragColor=vec4(1.0);
231
+ #endif
232
+ }`,`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;
233
+ #ifdef GLOBE
234
+ out float v_depth;
235
+ #endif
236
+ #pragma mapbox: define lowp float opacity
237
+ #pragma mapbox: define lowp vec4 pattern_from
238
+ #pragma mapbox: define lowp vec4 pattern_to
239
+ #pragma mapbox: define lowp float pixel_ratio_from
240
+ #pragma mapbox: define lowp float pixel_ratio_to
241
+ void main() {
242
+ #pragma mapbox: initialize lowp float opacity
243
+ #pragma mapbox: initialize mediump vec4 pattern_from
244
+ #pragma mapbox: initialize mediump vec4 pattern_to
245
+ #pragma mapbox: initialize lowp float pixel_ratio_from
246
+ #pragma mapbox: initialize lowp float pixel_ratio_to
247
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=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;
248
+ #ifdef GLOBE
249
+ v_depth=gl_Position.z/gl_Position.w;
250
+ #endif
251
+ }`),fillPattern:H(`#ifdef GL_ES
252
+ precision highp float;
253
+ #endif
254
+ uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;
255
+ #pragma mapbox: define lowp float opacity
256
+ #pragma mapbox: define lowp vec4 pattern_from
257
+ #pragma mapbox: define lowp vec4 pattern_to
258
+ void main() {
259
+ #pragma mapbox: initialize lowp float opacity
260
+ #pragma mapbox: initialize mediump vec4 pattern_from
261
+ #pragma mapbox: initialize mediump vec4 pattern_to
262
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=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;
263
+ #ifdef OVERDRAW_INSPECTOR
264
+ fragColor=vec4(1.0);
265
+ #endif
266
+ }`,`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;
267
+ #pragma mapbox: define lowp float opacity
268
+ #pragma mapbox: define lowp vec4 pattern_from
269
+ #pragma mapbox: define lowp vec4 pattern_to
270
+ #pragma mapbox: define lowp float pixel_ratio_from
271
+ #pragma mapbox: define lowp float pixel_ratio_to
272
+ void main() {
273
+ #pragma mapbox: initialize lowp float opacity
274
+ #pragma mapbox: initialize mediump vec4 pattern_from
275
+ #pragma mapbox: initialize mediump vec4 pattern_to
276
+ #pragma mapbox: initialize lowp float pixel_ratio_from
277
+ #pragma mapbox: initialize lowp float pixel_ratio_to
278
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=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:H(`in vec4 v_color;void main() {fragColor=v_color;
279
+ #ifdef OVERDRAW_INSPECTOR
280
+ fragColor=vec4(1.0);
281
+ #endif
282
+ }`,`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;
283
+ #ifdef TERRAIN3D
284
+ in vec2 a_centroid;
285
+ #endif
286
+ out vec4 v_color;
287
+ #pragma mapbox: define highp float base
288
+ #pragma mapbox: define highp float height
289
+ #pragma mapbox: define highp vec4 color
290
+ void main() {
291
+ #pragma mapbox: initialize highp float base
292
+ #pragma mapbox: initialize highp float height
293
+ #pragma mapbox: initialize highp vec4 color
294
+ vec3 normal=a_normal_ed.xyz;
295
+ #ifdef TERRAIN3D
296
+ float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
297
+ #else
298
+ float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
299
+ #endif
300
+ base=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;
301
+ #ifdef GLOBE
302
+ vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
303
+ #else
304
+ gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
305
+ #endif
306
+ float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);
307
+ #ifdef GLOBE
308
+ mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);
309
+ #endif
310
+ directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:H(`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;
311
+ #pragma mapbox: define lowp float base
312
+ #pragma mapbox: define lowp float height
313
+ #pragma mapbox: define lowp vec4 pattern_from
314
+ #pragma mapbox: define lowp vec4 pattern_to
315
+ #pragma mapbox: define lowp float pixel_ratio_from
316
+ #pragma mapbox: define lowp float pixel_ratio_to
317
+ void main() {
318
+ #pragma mapbox: initialize lowp float base
319
+ #pragma mapbox: initialize lowp float height
320
+ #pragma mapbox: initialize mediump vec4 pattern_from
321
+ #pragma mapbox: initialize mediump vec4 pattern_to
322
+ #pragma mapbox: initialize lowp float pixel_ratio_from
323
+ #pragma mapbox: initialize lowp float pixel_ratio_to
324
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=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;
325
+ #ifdef OVERDRAW_INSPECTOR
326
+ fragColor=vec4(1.0);
327
+ #endif
328
+ }`,`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;
329
+ #ifdef TERRAIN3D
330
+ in vec2 a_centroid;
331
+ #endif
332
+ #ifdef GLOBE
333
+ out vec3 v_sphere_pos;
334
+ #endif
335
+ out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;
336
+ #pragma mapbox: define lowp float base
337
+ #pragma mapbox: define lowp float height
338
+ #pragma mapbox: define lowp vec4 pattern_from
339
+ #pragma mapbox: define lowp vec4 pattern_to
340
+ #pragma mapbox: define lowp float pixel_ratio_from
341
+ #pragma mapbox: define lowp float pixel_ratio_to
342
+ void main() {
343
+ #pragma mapbox: initialize lowp float base
344
+ #pragma mapbox: initialize lowp float height
345
+ #pragma mapbox: initialize mediump vec4 pattern_from
346
+ #pragma mapbox: initialize mediump vec4 pattern_to
347
+ #pragma mapbox: initialize lowp float pixel_ratio_from
348
+ #pragma mapbox: initialize lowp float pixel_ratio_to
349
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;
350
+ #ifdef TERRAIN3D
351
+ float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
352
+ #else
353
+ float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
354
+ #endif
355
+ base=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;
356
+ #ifdef GLOBE
357
+ vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
358
+ #else
359
+ gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
360
+ #endif
361
+ vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
362
+ ? a_pos
363
+ : 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:H(`#ifdef GL_ES
364
+ precision highp float;
365
+ #endif
366
+ uniform 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);
367
+ #ifdef OVERDRAW_INSPECTOR
368
+ fragColor=vec4(1.0);
369
+ #endif
370
+ }`,`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:H(`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];
371
+ #define PI 3.141592653589793
372
+ #define STANDARD 0
373
+ #define COMBINED 1
374
+ #define IGOR 2
375
+ #define MULTIDIRECTIONAL 3
376
+ #define BASIC 4
377
+ float 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
378
+ {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
379
+ {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);}
380
+ #ifdef OVERDRAW_INSPECTOR
381
+ fragColor=vec4(1.0);
382
+ #endif
383
+ }`,`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:H(`uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;
384
+ #ifdef GLOBE
385
+ in float v_depth;
386
+ #endif
387
+ #pragma mapbox: define highp vec4 color
388
+ #pragma mapbox: define lowp float blur
389
+ #pragma mapbox: define lowp float opacity
390
+ void main() {
391
+ #pragma mapbox: initialize highp vec4 color
392
+ #pragma mapbox: initialize lowp float blur
393
+ #pragma mapbox: initialize lowp float opacity
394
+ 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);fragColor=color*(alpha*opacity);
395
+ #ifdef GLOBE
396
+ if (v_depth > 1.0) {discard;}
397
+ #endif
398
+ #ifdef OVERDRAW_INSPECTOR
399
+ fragColor=vec4(1.0);
400
+ #endif
401
+ }`,`
402
+ #define scale 0.015873016
403
+ in 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;
404
+ #ifdef GLOBE
405
+ out float v_depth;
406
+ #endif
407
+ #pragma mapbox: define highp vec4 color
408
+ #pragma mapbox: define lowp float blur
409
+ #pragma mapbox: define lowp float opacity
410
+ #pragma mapbox: define mediump float gapwidth
411
+ #pragma mapbox: define lowp float offset
412
+ #pragma mapbox: define mediump float width
413
+ void main() {
414
+ #pragma mapbox: initialize highp vec4 color
415
+ #pragma mapbox: initialize lowp float blur
416
+ #pragma mapbox: initialize lowp float opacity
417
+ #pragma mapbox: initialize mediump float gapwidth
418
+ #pragma mapbox: initialize lowp float offset
419
+ #pragma mapbox: initialize mediump float width
420
+ float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);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;
421
+ #ifdef GLOBE
422
+ v_depth=gl_Position.z/gl_Position.w;
423
+ #endif
424
+ #ifdef TERRAIN3D
425
+ v_gamma_scale=1.0;
426
+ #else
427
+ float 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;
428
+ #endif
429
+ v_width2=vec2(outset,inset);}`),lineGradient:H(`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;
430
+ #ifdef GLOBE
431
+ in float v_depth;
432
+ #endif
433
+ #pragma mapbox: define lowp float blur
434
+ #pragma mapbox: define lowp float opacity
435
+ void main() {
436
+ #pragma mapbox: initialize lowp float blur
437
+ #pragma mapbox: initialize lowp float opacity
438
+ float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity);
439
+ #ifdef GLOBE
440
+ if (v_depth > 1.0) {discard;}
441
+ #endif
442
+ #ifdef OVERDRAW_INSPECTOR
443
+ fragColor=vec4(1.0);
444
+ #endif
445
+ }`,`
446
+ #define scale 0.015873016
447
+ in 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;
448
+ #ifdef GLOBE
449
+ out float v_depth;
450
+ #endif
451
+ #pragma mapbox: define lowp float blur
452
+ #pragma mapbox: define lowp float opacity
453
+ #pragma mapbox: define mediump float gapwidth
454
+ #pragma mapbox: define lowp float offset
455
+ #pragma mapbox: define mediump float width
456
+ void main() {
457
+ #pragma mapbox: initialize lowp float blur
458
+ #pragma mapbox: initialize lowp float opacity
459
+ #pragma mapbox: initialize mediump float gapwidth
460
+ #pragma mapbox: initialize lowp float offset
461
+ #pragma mapbox: initialize mediump float width
462
+ float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);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;
463
+ #ifdef GLOBE
464
+ v_depth=gl_Position.z/gl_Position.w;
465
+ #endif
466
+ #ifdef TERRAIN3D
467
+ v_gamma_scale=1.0;
468
+ #else
469
+ float 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;
470
+ #endif
471
+ v_width2=vec2(outset,inset);}`),linePattern:H(`#ifdef GL_ES
472
+ precision highp float;
473
+ #endif
474
+ uniform 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;
475
+ #ifdef GLOBE
476
+ in float v_depth;
477
+ #endif
478
+ #pragma mapbox: define lowp vec4 pattern_from
479
+ #pragma mapbox: define lowp vec4 pattern_to
480
+ #pragma mapbox: define lowp float pixel_ratio_from
481
+ #pragma mapbox: define lowp float pixel_ratio_to
482
+ #pragma mapbox: define lowp float blur
483
+ #pragma mapbox: define lowp float opacity
484
+ void main() {
485
+ #pragma mapbox: initialize mediump vec4 pattern_from
486
+ #pragma mapbox: initialize mediump vec4 pattern_to
487
+ #pragma mapbox: initialize lowp float pixel_ratio_from
488
+ #pragma mapbox: initialize lowp float pixel_ratio_to
489
+ #pragma mapbox: initialize lowp float blur
490
+ #pragma mapbox: initialize lowp float opacity
491
+ vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;
492
+ #ifdef GLOBE
493
+ if (v_depth > 1.0) {discard;}
494
+ #endif
495
+ #ifdef OVERDRAW_INSPECTOR
496
+ fragColor=vec4(1.0);
497
+ #endif
498
+ }`,`
499
+ #define scale 0.015873016
500
+ #define LINE_DISTANCE_SCALE 2.0
501
+ in 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;
502
+ #ifdef GLOBE
503
+ out float v_depth;
504
+ #endif
505
+ #pragma mapbox: define lowp float blur
506
+ #pragma mapbox: define lowp float opacity
507
+ #pragma mapbox: define lowp float offset
508
+ #pragma mapbox: define mediump float gapwidth
509
+ #pragma mapbox: define mediump float width
510
+ #pragma mapbox: define lowp float floorwidth
511
+ #pragma mapbox: define lowp vec4 pattern_from
512
+ #pragma mapbox: define lowp vec4 pattern_to
513
+ #pragma mapbox: define lowp float pixel_ratio_from
514
+ #pragma mapbox: define lowp float pixel_ratio_to
515
+ void main() {
516
+ #pragma mapbox: initialize lowp float blur
517
+ #pragma mapbox: initialize lowp float opacity
518
+ #pragma mapbox: initialize lowp float offset
519
+ #pragma mapbox: initialize mediump float gapwidth
520
+ #pragma mapbox: initialize mediump float width
521
+ #pragma mapbox: initialize lowp float floorwidth
522
+ #pragma mapbox: initialize mediump vec4 pattern_from
523
+ #pragma mapbox: initialize mediump vec4 pattern_to
524
+ #pragma mapbox: initialize lowp float pixel_ratio_from
525
+ #pragma mapbox: initialize lowp float pixel_ratio_to
526
+ float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);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;
527
+ #ifdef GLOBE
528
+ v_depth=gl_Position.z/gl_Position.w;
529
+ #endif
530
+ #ifdef TERRAIN3D
531
+ v_gamma_scale=1.0;
532
+ #else
533
+ float 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;
534
+ #endif
535
+ v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:H(`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;
536
+ #ifdef GLOBE
537
+ in float v_depth;
538
+ #endif
539
+ #pragma mapbox: define highp vec4 color
540
+ #pragma mapbox: define lowp float blur
541
+ #pragma mapbox: define lowp float opacity
542
+ #pragma mapbox: define mediump float width
543
+ #pragma mapbox: define lowp float floorwidth
544
+ #pragma mapbox: define mediump vec4 dasharray_from
545
+ #pragma mapbox: define mediump vec4 dasharray_to
546
+ void main() {
547
+ #pragma mapbox: initialize highp vec4 color
548
+ #pragma mapbox: initialize lowp float blur
549
+ #pragma mapbox: initialize lowp float opacity
550
+ #pragma mapbox: initialize mediump float width
551
+ #pragma mapbox: initialize lowp float floorwidth
552
+ #pragma mapbox: initialize mediump vec4 dasharray_from
553
+ #pragma mapbox: initialize mediump vec4 dasharray_to
554
+ float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=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);
555
+ #ifdef GLOBE
556
+ if (v_depth > 1.0) {discard;}
557
+ #endif
558
+ #ifdef OVERDRAW_INSPECTOR
559
+ fragColor=vec4(1.0);
560
+ #endif
561
+ }`,`
562
+ #define scale 0.015873016
563
+ #define LINE_DISTANCE_SCALE 2.0
564
+ in 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;
565
+ #ifdef GLOBE
566
+ out float v_depth;
567
+ #endif
568
+ #pragma mapbox: define highp vec4 color
569
+ #pragma mapbox: define lowp float blur
570
+ #pragma mapbox: define lowp float opacity
571
+ #pragma mapbox: define mediump float gapwidth
572
+ #pragma mapbox: define lowp float offset
573
+ #pragma mapbox: define mediump float width
574
+ #pragma mapbox: define lowp float floorwidth
575
+ #pragma mapbox: define mediump vec4 dasharray_from
576
+ #pragma mapbox: define mediump vec4 dasharray_to
577
+ void main() {
578
+ #pragma mapbox: initialize highp vec4 color
579
+ #pragma mapbox: initialize lowp float blur
580
+ #pragma mapbox: initialize lowp float opacity
581
+ #pragma mapbox: initialize mediump float gapwidth
582
+ #pragma mapbox: initialize lowp float offset
583
+ #pragma mapbox: initialize mediump float width
584
+ #pragma mapbox: initialize lowp float floorwidth
585
+ #pragma mapbox: initialize mediump vec4 dasharray_from
586
+ #pragma mapbox: initialize mediump vec4 dasharray_to
587
+ float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);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;
588
+ #ifdef GLOBE
589
+ v_depth=gl_Position.z/gl_Position.w;
590
+ #endif
591
+ #ifdef TERRAIN3D
592
+ v_gamma_scale=1.0;
593
+ #else
594
+ float 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;
595
+ #endif
596
+ float 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:H(`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;
597
+ #ifdef GLOBE
598
+ in float v_depth;
599
+ #endif
600
+ #pragma mapbox: define lowp float blur
601
+ #pragma mapbox: define lowp float opacity
602
+ #pragma mapbox: define mediump float width
603
+ #pragma mapbox: define lowp float floorwidth
604
+ #pragma mapbox: define mediump vec4 dasharray_from
605
+ #pragma mapbox: define mediump vec4 dasharray_to
606
+ void main() {
607
+ #pragma mapbox: initialize lowp float blur
608
+ #pragma mapbox: initialize lowp float opacity
609
+ #pragma mapbox: initialize mediump float width
610
+ #pragma mapbox: initialize lowp float floorwidth
611
+ #pragma mapbox: initialize mediump vec4 dasharray_from
612
+ #pragma mapbox: initialize mediump vec4 dasharray_to
613
+ float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=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);
614
+ #ifdef GLOBE
615
+ if (v_depth > 1.0) {discard;}
616
+ #endif
617
+ #ifdef OVERDRAW_INSPECTOR
618
+ fragColor=vec4(1.0);
619
+ #endif
620
+ }`,`
621
+ #define scale 0.015873016
622
+ #define LINE_DISTANCE_SCALE 2.0
623
+ in 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;
624
+ #ifdef GLOBE
625
+ out float v_depth;
626
+ #endif
627
+ #pragma mapbox: define lowp float blur
628
+ #pragma mapbox: define lowp float opacity
629
+ #pragma mapbox: define mediump float gapwidth
630
+ #pragma mapbox: define lowp float offset
631
+ #pragma mapbox: define mediump float width
632
+ #pragma mapbox: define lowp float floorwidth
633
+ #pragma mapbox: define mediump vec4 dasharray_from
634
+ #pragma mapbox: define mediump vec4 dasharray_to
635
+ void main() {
636
+ #pragma mapbox: initialize lowp float blur
637
+ #pragma mapbox: initialize lowp float opacity
638
+ #pragma mapbox: initialize mediump float gapwidth
639
+ #pragma mapbox: initialize lowp float offset
640
+ #pragma mapbox: initialize mediump float width
641
+ #pragma mapbox: initialize lowp float floorwidth
642
+ #pragma mapbox: initialize mediump vec4 dasharray_from
643
+ #pragma mapbox: initialize mediump vec4 dasharray_to
644
+ float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;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;
645
+ #ifdef GLOBE
646
+ v_depth=gl_Position.z/gl_Position.w;
647
+ #endif
648
+ #ifdef TERRAIN3D
649
+ v_gamma_scale=1.0;
650
+ #else
651
+ float 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;
652
+ #endif
653
+ float 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:H(`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);
654
+ #ifdef OVERDRAW_INSPECTOR
655
+ fragColor=vec4(1.0);
656
+ #endif
657
+ }`,`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;
658
+ #ifdef GLOBE
659
+ if (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}
660
+ #endif
661
+ v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}`),symbolIcon:H(`uniform sampler2D u_texture;in vec2 v_tex;in float v_total_opacity;void main() {fragColor=texture(u_texture,v_tex)*v_total_opacity;
662
+ #ifdef OVERDRAW_INSPECTOR
663
+ fragColor=vec4(1.0);
664
+ #endif
665
+ }`,`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;
666
+ #pragma mapbox: define lowp float opacity
667
+ void main() {
668
+ #pragma mapbox: initialize lowp float opacity
669
+ vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}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 ?
670
+ camera_to_anchor_distance/u_camera_to_center_distance :
671
+ u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=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;
672
+ #ifdef GLOBE
673
+ if(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);}
674
+ #endif
675
+ vec4 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:H(`#define SDF_PX 8.0
676
+ uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1;
677
+ #pragma mapbox: define highp vec4 fill_color
678
+ #pragma mapbox: define highp vec4 halo_color
679
+ #pragma mapbox: define lowp float halo_width
680
+ #pragma mapbox: define lowp float halo_blur
681
+ void main() {
682
+ #pragma mapbox: initialize highp vec4 fill_color
683
+ #pragma mapbox: initialize highp vec4 halo_color
684
+ #pragma mapbox: initialize lowp float halo_width
685
+ #pragma mapbox: initialize lowp float halo_blur
686
+ float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float 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);
687
+ #ifdef OVERDRAW_INSPECTOR
688
+ fragColor=vec4(1.0);
689
+ #endif
690
+ }`,`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;
691
+ #pragma mapbox: define highp vec4 fill_color
692
+ #pragma mapbox: define highp vec4 halo_color
693
+ #pragma mapbox: define lowp float opacity
694
+ #pragma mapbox: define lowp float halo_width
695
+ #pragma mapbox: define lowp float halo_blur
696
+ void main() {
697
+ #pragma mapbox: initialize highp vec4 fill_color
698
+ #pragma mapbox: initialize highp vec4 halo_color
699
+ #pragma mapbox: initialize lowp float opacity
700
+ #pragma mapbox: initialize lowp float halo_width
701
+ #pragma mapbox: initialize lowp float halo_blur
702
+ vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy/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 ?
703
+ camera_to_anchor_distance/u_camera_to_center_distance :
704
+ u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=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;
705
+ #ifdef GLOBE
706
+ if(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);}
707
+ #endif
708
+ vec4 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:H(`#define SDF_PX 8.0
709
+ #define SDF 1.0
710
+ #define ICON 0.0
711
+ uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec4 v_data1;
712
+ #pragma mapbox: define highp vec4 fill_color
713
+ #pragma mapbox: define highp vec4 halo_color
714
+ #pragma mapbox: define lowp float halo_width
715
+ #pragma mapbox: define lowp float halo_blur
716
+ void main() {
717
+ #pragma mapbox: initialize highp vec4 fill_color
718
+ #pragma mapbox: initialize highp vec4 halo_color
719
+ #pragma mapbox: initialize lowp float halo_width
720
+ #pragma mapbox: initialize lowp float halo_blur
721
+ float 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;
722
+ #ifdef OVERDRAW_INSPECTOR
723
+ fragColor=vec4(1.0);
724
+ #endif
725
+ return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=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);
726
+ #ifdef OVERDRAW_INSPECTOR
727
+ fragColor=vec4(1.0);
728
+ #endif
729
+ }`,`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;
730
+ #pragma mapbox: define highp vec4 fill_color
731
+ #pragma mapbox: define highp vec4 halo_color
732
+ #pragma mapbox: define lowp float opacity
733
+ #pragma mapbox: define lowp float halo_width
734
+ #pragma mapbox: define lowp float halo_blur
735
+ void main() {
736
+ #pragma mapbox: initialize highp vec4 fill_color
737
+ #pragma mapbox: initialize highp vec4 halo_color
738
+ #pragma mapbox: initialize lowp float opacity
739
+ #pragma mapbox: initialize lowp float halo_width
740
+ #pragma mapbox: initialize lowp float halo_blur
741
+ vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}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 ?
742
+ camera_to_anchor_distance/u_camera_to_center_distance :
743
+ u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=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;
744
+ #ifdef GLOBE
745
+ if(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);}
746
+ #endif
747
+ vec4 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:H(`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,ele-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:H(`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:H(`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:H(`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:H(`#ifdef GL_ES
748
+ precision highp float;
749
+ #endif
750
+ in 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
751
+ );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:H(`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 H(e,t){let n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=t.match(/in ([\w]+) ([\w]+)/g),i=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:e=e.replace(n,((e,t,n,r,i)=>(s[i]=!0,t===`define`?`\n#ifndef HAS_UNIFORM_u_${i}\nin ${n} ${r} ${i};\n#else\nuniform ${n} ${r} u_${i};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${i}\n ${n} ${r} ${i} = u_${i};\n#endif\n`))),vertexSource:t=t.replace(n,((e,t,n,r,i)=>{let a=r===`float`?`vec2`:`vec4`,o=i.match(/color/)?`color`:a;return s[i]?t===`define`?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nin ${n} ${a} a_${i};\nout ${n} ${r} ${i};\n#else\nuniform ${n} ${r} u_${i};\n#endif\n`:o===`vec4`?`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = a_${i};\n#else\n ${n} ${r} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${n} ${r} ${i} = u_${i};\n#endif\n`:t===`define`?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nin ${n} ${a} a_${i};\n#else\nuniform ${n} ${r} u_${i};\n#endif\n`:o===`vec4`?`\n#ifndef HAS_UNIFORM_u_${i}\n ${n} ${r} ${i} = a_${i};\n#else\n ${n} ${r} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${n} ${r} ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${n} ${r} ${i} = u_${i};\n#endif\n`})),staticAttributes:r,staticUniforms:o}}class Bt{constructor(e,t,n){this.vertexBuffer=e,this.indexBuffer=t,this.segments=n}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var Vt=t.aT([{name:`a_pos`,type:`Int16`,components:2}]);let Ht=`#define PROJECTION_MERCATOR`,Ut=`mercator`;class Wt{constructor(){this._cachedMesh=null}get name(){return`mercator`}get useSubdivision(){return!1}get shaderVariantName(){return Ut}get shaderDefine(){return Ht}get shaderPreludeCode(){return V.projectionMercator}get vertexShaderPreludeCode(){return V.projectionMercator.vertexSource}get subdivisionGranularity(){return t.aU.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(e){}getMeshFromTileID(e,n,r,i,a){if(this._cachedMesh)return this._cachedMesh;let o=new t.aV;o.emplaceBack(0,0),o.emplaceBack(t.a6,0),o.emplaceBack(0,t.a6),o.emplaceBack(t.a6,t.a6);let s=e.createVertexBuffer(o,Vt.members),c=t.aW.simpleSegment(0,0,4,2),l=new t.aX;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3);let u=e.createIndexBuffer(l);return this._cachedMesh=new Bt(s,u,c),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(e){}}class Gt{constructor(e=0,t=0,n=0,r=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(n)||n<0||isNaN(r)||r<0)throw Error(`Invalid value for edge-insets, top, bottom, left and right must all be numbers`);this.top=e,this.bottom=t,this.left=n,this.right=r}interpolate(e,n,r){return n.top!=null&&e.top!=null&&(this.top=t.H.number(e.top,n.top,r)),n.bottom!=null&&e.bottom!=null&&(this.bottom=t.H.number(e.bottom,n.bottom,r)),n.left!=null&&e.left!=null&&(this.left=t.H.number(e.left,n.left,r)),n.right!=null&&e.right!=null&&(this.right=t.H.number(e.right,n.right,r)),this}getCenter(e,n){let r=t.al((this.left+e-this.right)/2,0,e),i=t.al((this.top+n-this.bottom)/2,0,n);return new t.P(r,i)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new Gt(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Kt(e,t){if(!e.renderWorldCopies||e.lngRange)return;let n=t.lng-e.center.lng;t.lng+=n>180?-360:n<-180?360:0}function qt(e){return Math.max(0,Math.floor(e))}class Jt{constructor(e,n){this.applyConstrain=(e,t)=>this._constrainOverride===null?this._callbacks.defaultConstrain(e,t):this._constrainOverride(e,t),this._callbacks=e,this._tileSize=512,this._renderWorldCopies=n?.renderWorldCopies===void 0||!!n?.renderWorldCopies,this._minZoom=n?.minZoom||0,this._maxZoom=n?.maxZoom||22,this._minPitch=n?.minPitch==null?0:n?.minPitch,this._maxPitch=n?.maxPitch==null?60:n?.maxPitch,this._constrainOverride=n?.constrainOverride??null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new t.W(0,0),this._elevation=0,this._zoom=0,this._tileZoom=qt(this._zoom),this._scale=t.ao(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new Gt,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(e,n,r){this._constrainOverride=e.constrainOverride,this._latRange=e.latRange,this._lngRange=e.lngRange,this._width=e.width,this._height=e.height,this._center=e.center,this._elevation=e.elevation,this._minElevationForCurrentTile=e.minElevationForCurrentTile,this._zoom=e.zoom,this._tileZoom=qt(this._zoom),this._scale=t.ao(this._zoom),this._bearingInRadians=e.bearingInRadians,this._fovInRadians=e.fovInRadians,this._pitchInRadians=e.pitchInRadians,this._rollInRadians=e.rollInRadians,this._unmodified=e.unmodified,this._edgeInsets=new Gt(e.padding.top,e.padding.bottom,e.padding.left,e.padding.right),this._minZoom=e.minZoom,this._maxZoom=e.maxZoom,this._minPitch=e.minPitch,this._maxPitch=e.maxPitch,this._renderWorldCopies=e.renderWorldCopies,this._cameraToCenterDistance=e.cameraToCenterDistance,this._nearZ=e.nearZ,this._farZ=e.farZ,this._autoCalculateNearFarZ=!r&&e.autoCalculateNearFarZ,n&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(e){this._minElevationForCurrentTile=e}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(e){this._minZoom!==e&&(this._minZoom=e,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(e){this._minPitch!==e&&(this._minPitch=e,this.setPitch(Math.max(this.pitch,e)))}get maxPitch(){return this._maxPitch}setMaxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.setPitch(Math.min(this.pitch,e)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get constrainOverride(){return this._constrainOverride}setConstrainOverride(e){e===void 0&&(e=null),this._constrainOverride!==e&&(this._constrainOverride=e,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 t.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(e){let n=t.X(e,-180,180)*Math.PI/180;var i,a,o,s,c,l,u,d,f;this._bearingInRadians!==n&&(this._unmodified=!1,this._bearingInRadians=n,this._calcMatrices(),this._rotationMatrix=r(),i=this._rotationMatrix,o=-this._bearingInRadians,s=(a=this._rotationMatrix)[0],c=a[1],l=a[2],u=a[3],d=Math.sin(o),f=Math.cos(o),i[0]=s*f+l*d,i[1]=c*f+u*d,i[2]=s*-d+l*f,i[3]=c*-d+u*f)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(e){let n=t.al(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==n&&(this._unmodified=!1,this._pitchInRadians=n,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(e){let t=e/180*Math.PI;this._rollInRadians!==t&&(this._unmodified=!1,this._rollInRadians=t,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return t.aY(this._fovInRadians)}setFov(e){e=t.al(e,.1,150),this.fov!==e&&(this._unmodified=!1,this._fovInRadians=t.an(e),this._calcMatrices())}get zoom(){return this._zoom}setZoom(e){let n=this.applyConstrain(this._center,e).zoom;this._zoom!==n&&(this._unmodified=!1,this._zoom=n,this._tileZoom=Math.max(0,Math.floor(n)),this._scale=t.ao(n),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(e){e!==this._elevation&&(this._elevation=e,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,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(e,t){this._autoCalculateNearFarZ=!1,this._nearZ=e,this._farZ=t,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,n){this._unmodified=!1,this._edgeInsets.interpolate(e,t,n),this.constrainInternal(),this._calcMatrices()}resize(e,t,n=!0){this._width=e,this._height=t,n&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){return this._latRange?.length!==2||this._lngRange?.length!==2?null:new se([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]])}setMaxBounds(e){e?(this._lngRange=[e.getWest(),e.getEast()],this._latRange=[e.getSouth(),e.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-t.am,t.am])}getCameraQueryGeometry(e,n){if(n.length===1)return[n[0],e];{let{minX:r,minY:i,maxX:a,maxY:o}=t.a8.fromPoints(n).extend(e);return[new t.P(r,i),new t.P(a,i),new t.P(a,o),new t.P(r,o),new t.P(r,i)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let e=this._unmodified,{center:t,zoom:n}=this.applyConstrain(this.center,this.zoom);this.setCenter(t),this.setZoom(n),this._unmodified=e,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let e=t.ap(new Float64Array(16));t.S(e,e,[this._width/2,-this._height/2,1]),t.Q(e,e,[1,-1,0]),this._clipSpaceToPixelsMatrix=e,e=t.ap(new Float64Array(16)),t.S(e,e,[1,-1,1]),t.Q(e,e,[-1,-1,0]),t.S(e,e,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=e,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(e,n,r,i){let a=r===void 0?this.bearing:r,o=i=i===void 0?this.pitch:i,{distanceToCenter:s,clampedElevation:c}=this._distanceToCenterFromAltElevationPitch(n,this.elevation,o),{x:l,y:u}=Re(o,a),d=t.a7.fromLngLat(e,n),f,p,m=t.aZ(1,d.y),h=0;do{if(h+=1,h>10)break;p=s/m,f=new t.a7(d.x+l*p,d.y+u*p),m=1/f.meterInMercatorCoordinateUnits()}while(Math.abs(s-p*m)>1e-12);return{center:f.toLngLat(),elevation:c,zoom:t.ar(this.height/2/Math.tan(this.fovInRadians/2)/p/this.tileSize)}}recalculateZoomAndCenter(e){if(this.elevation-e==0)return;let n=1/this.worldSize,r=t.aq(1,this.center.lat)*this.worldSize,i=t.a7.fromLngLat(this.center,this.elevation),a=i.x/n,o=i.y/n,s=i.z/n,c=this.pitch,l=this.bearing,{x:u,y:d,z:f}=Re(c,l),p=this.cameraToCenterDistance,m=a+p*-u,h=o+p*-d,g=s+p*f,{distanceToCenter:_,clampedElevation:v}=this._distanceToCenterFromAltElevationPitch(g/r,e,c),y=_*r,b=new t.a7((m+u*y)*n,(h+d*y)*n,0).toLngLat(),x=t.aq(1,b.lat),S=t.ar(this.height/2/Math.tan(this.fovInRadians/2)/_/x/this.tileSize);this._elevation=v,this._center=b,this.setZoom(S)}_distanceToCenterFromAltElevationPitch(e,n,r){let i=-Math.cos(t.an(r)),a=e-n,o,s=n;return i*a>=0||Math.abs(i)<.1?(o=1e4,s=e+o*i):o=-a/i,{distanceToCenter:o,clampedElevation:s}}getCameraPoint(){let e=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(e*Math.sin(this.rollInRadians),e*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){let e=t.aq(1,this.center.lat)*this.worldSize;return Le(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/e).toLngLat()}getMercatorTileCoordinates(e){if(!e)return[0,0,1,1];let n=e.canonical.z>=0?1<<e.canonical.z:2**e.canonical.z;return[e.canonical.x/n,e.canonical.y/n,1/n/t.a6,1/n/t.a6]}}class Yt{constructor(e,n){this.min=e,this.max=n,this.center=t.a_([],t.a$([],this.min,this.max),.5)}quadrant(e){let n=[e%2==0,e<2],r=t.b0(this.min),i=t.b0(this.max);for(let e=0;e<n.length;e++)r[e]=n[e]?this.min[e]:this.center[e],i[e]=n[e]?this.center[e]:this.max[e];return i[2]=this.max[2],new Yt(r,i)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersectsFrustum(e){let t=!0;for(let n of e.planes){let e=this.intersectsPlane(n);if(e===0)return 0;e===1&&(t=!1)}return t?2:e.aabb.min[0]>this.max[0]||e.aabb.min[1]>this.max[1]||e.aabb.min[2]>this.max[2]||e.aabb.max[0]<this.min[0]||e.aabb.max[1]<this.min[1]||e.aabb.max[2]<this.min[2]?0:1}intersectsPlane(e){let t=e[3],n=e[3];for(let r=0;r<3;r++)e[r]>0?(t+=e[r]*this.min[r],n+=e[r]*this.max[r]):(n+=e[r]*this.min[r],t+=e[r]*this.max[r]);return t>=0?2:n<0?0:1}}class Xt{distanceToTile2d(e,t,n,r){let i=r,a=i.distanceX([e,t]),o=i.distanceY([e,t]);return Math.hypot(a,o)}getWrap(e,t,n){return n}getTileBoundingVolume(e,n,r,i){let a=0,o=0;if(i?.terrain){let s=new t.a3(e.z,n,e.z,e.x,e.y),c=i.terrain.getMinMaxElevation(s);a=c.minElevation??Math.min(0,r),o=c.maxElevation??Math.max(0,r)}let s=1<<e.z;return new Yt([n+e.x/s,e.y/s,a],[n+(e.x+1)/s,(e.y+1)/s,o])}allowVariableZoom(e,n){let r=e.fov*(Math.abs(Math.cos(e.rollInRadians))*e.height+Math.abs(Math.sin(e.rollInRadians))*e.width)/e.height,i=t.al(78.5-r/2,0,60);return!!n.terrain||e.pitch>i}allowWorldCopies(){return!0}prepareNextFrame(){}}class Zt{constructor(e,t,n){this.points=e,this.planes=t,this.aabb=n}static fromInvProjectionMatrix(e,n=1,r=0,i,a){let 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=2**r,c=[[-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(e,n,r,i){let a=t.aF([],e,n),o=1/a[3]/r*i;return t.b5(a,a,[o,o,1/a[3],o])}(r,e,n,s)));i&&function(e,n,r,i){let a=i?4:0,o=i?0:4,s=0,c=[],l=[];for(let n=0;n<4;n++){let r=t.b1([],e[n+o],e[n+a]),i=t.b6(r);t.a_(r,r,1/i),c.push(i),l.push(r)}for(let n=0;n<4;n++){let i=t.b7(e[n+a],l[n],r);s=i!==null&&i>=0?Math.max(s,i):Math.max(s,c[n])}let u=function(e,n){let r=t.b1([],e[n[0]],e[n[1]]),i=t.b1([],e[n[2]],e[n[1]]),a=[0,0,0,0];return t.b2(a,t.b3([],r,i)),a[3]=-t.b4(a,e[n[0]]),a}(e,n),d=function(e,n){let r=t.b8(e),i=t.b9([],e,1/r),a=t.b1([],n,t.a_([],i,t.b4(n,i))),o=t.b8(a);if(o>0){let e=Math.sqrt(1-i[3]*i[3]),r=t.a_([],i,-i[3]),s=t.a$([],r,t.a_([],a,e/o));return t.ba(n,s)}return null}(r,u);if(d!==null){let e=d/t.b4(l[0],u);s=Math.min(s,e)}for(let t=0;t<4;t++){let n=Math.min(s,c[t]);e[t+o]=[e[t+a][0]+l[t][0]*n,e[t+a][1]+l[t][1]*n,e[t+a][2]+l[t][2]*n,1]}}(c,o[0],i,a);let l=o.map((e=>{let n=t.b1([],c[e[0]],c[e[1]]),r=t.b1([],c[e[2]],c[e[1]]),i=t.b2([],t.b3([],n,r)),a=-t.b4(i,c[e[1]]);return i.concat(a)})),u=[1/0,1/0,1/0],d=[-1/0,-1/0,-1/0];for(let e of c)for(let t=0;t<3;t++)u[t]=Math.min(u[t],e[t]),d[t]=Math.max(d[t],e[t]);return new Zt(c,l,new Yt(u,d))}}class Qt{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(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,t,n){this._helper.interpolatePadding(e,t,n)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,t,n=!0){this._helper.resize(e,t,n)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}setConstrainOverride(e){this._helper.setConstrainOverride(e)}overrideNearFarZ(e,t){this._helper.overrideNearFarZ(e,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}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(e,t){}constructor(e){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(e,n)=>{n=t.al(+n,this.minZoom,this.maxZoom);let r={center:new t.W(e.lng,e.lat),zoom:n},i=this._helper._lngRange;!this._helper._renderWorldCopies&&i===null&&(i=[-179.9999999999,179.9999999999]);let a=this.tileSize*t.ao(r.zoom),o=0,s=a,c=0,l=a,u=0,d=0,{x:f,y:p}=this.size;if(this._helper._latRange){let e=this._helper._latRange;o=t.Y(e[1])*a,s=t.Y(e[0])*a,s-o<p&&(u=p/(s-o))}i&&(c=t.X(t.Z(i[0])*a,0,a),l=t.X(t.Z(i[1])*a,0,a),l<c&&(l+=a),l-c<f&&(d=f/(l-c)));let{x:m,y:h}=Ne(a,e),g,_,v=Math.max(d||0,u||0);if(v)return r.center=Pe(a,new t.P(d?(l+c)/2:m,u?(s+o)/2:h)).wrap(),r.zoom+=t.ar(v),r;if(this._helper._latRange){let e=p/2;h-e<o&&(_=o+e),h+e>s&&(_=s-e)}if(i){let e=(c+l)/2,n=m;this._helper._renderWorldCopies&&(n=t.X(m,e-a/2,e+a/2));let r=f/2;n-r<c&&(g=c+r),n+r>l&&(g=l-r)}return(g!==void 0||_!==void 0)&&(r.center=Pe(a,new t.P(g??m,_??h)).wrap()),r},this.applyConstrain=(e,t)=>this._helper.applyConstrain(e,t),this._helper=new Jt({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(e,t)=>this.defaultConstrain(e,t)},e),this._coveringTilesDetailsProvider=new Xt}clone(){let e=new Qt;return e.apply(this,!1),e}apply(e,t,n){this._helper.apply(e,t,n)}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(e){let n=[new t.bb(0,e)];if(this._helper._renderWorldCopies){let r=this.screenPointToMercatorCoordinate(new t.P(0,0)),i=this.screenPointToMercatorCoordinate(new t.P(this._helper._width,0)),a=this.screenPointToMercatorCoordinate(new t.P(this._helper._width,this._helper._height)),o=this.screenPointToMercatorCoordinate(new t.P(0,this._helper._height)),s=Math.floor(Math.min(r.x,i.x,a.x,o.x)),c=Math.floor(Math.max(r.x,i.x,a.x,o.x));for(let r=s-1;r<=c+1;r++)r!==0&&n.push(new t.bb(r,e))}return n}getCameraFrustum(){return Zt.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){let t=this.screenPointToLocation(this.centerPoint,e),n=e?e.getElevationForLngLatZoom(t,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(n)}setLocationAtPoint(e,n){let r=t.aq(this.elevation,this.center.lat),i=this.screenPointToMercatorCoordinateAtZ(n,r),a=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,r),o=t.a7.fromLngLat(e),s=new t.a7(o.x-(i.x-a.x),o.y-(i.y-a.y));this.setCenter(s?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(e,n){return n?this.coordinatePoint(t.a7.fromLngLat(e),n.getElevationForLngLat(e,this),this._pixelMatrix3D):this.coordinatePoint(t.a7.fromLngLat(e))}screenPointToLocation(e,t){return this.screenPointToMercatorCoordinate(e,t)?.toLngLat()}screenPointToMercatorCoordinate(e,t){if(t){let n=t.pointCoordinate(e);if(n!=null)return n}return this.screenPointToMercatorCoordinateAtZ(e)}screenPointToMercatorCoordinateAtZ(e,n){let r=n||0,i=[e.x,e.y,0,1],a=[e.x,e.y,1,1];t.aF(i,i,this._pixelMatrixInverse),t.aF(a,a,this._pixelMatrixInverse);let o=i[3],s=a[3],c=i[1]/o,l=a[1]/s,u=i[2]/o,d=a[2]/s,f=u===d?0:(r-u)/(d-u);return new t.a7(t.H.number(i[0]/o,a[0]/s,f)/this.worldSize,t.H.number(c,l,f)/this.worldSize,r)}coordinatePoint(e,n=0,r=this._pixelMatrix){let i=[e.x*this.worldSize,e.y*this.worldSize,n,1];return t.aF(i,i,r),new t.P(i[0]/i[3],i[1]/i[3])}getBounds(){let e=Math.max(0,this._helper._height/2-Fe(this));return new se().extend(this.screenPointToLocation(new t.P(0,e))).extend(this.screenPointToLocation(new t.P(this._helper._width,e))).extend(this.screenPointToLocation(new t.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new t.P(0,this._helper._height)))}isPointOnMapSurface(e,t){return t?t.pointCoordinate(e)!=null:e.y>this.height/2-Fe(this)}calculatePosMatrix(e,n=!1,r){let i=e.key??t.bc(e.wrap,e.canonical.z,e.canonical.z,e.canonical.x,e.canonical.y),a=n?this._alignedPosMatrixCache:this._posMatrixCache;if(a.has(i)){let e=a.get(i);return r?e.f32:e.f64}let o=Ie(e,this.worldSize);t.U(o,n?this._alignedProjMatrix:this._viewProjMatrix,o);let s={f64:o,f32:new Float32Array(o)};return a.set(i,s),r?s.f32:s.f64}calculateFogMatrix(e){let n=e.key,r=this._fogMatrixCacheF32;if(r.has(n))return r.get(n);let i=Ie(e,this.worldSize);return t.U(i,this._fogMatrix,i),r.set(n,new Float32Array(i)),r.get(n)}calculateCenterFromCameraLngLatAlt(e,t,n,r){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,n,r)}_calculateNearFarZIfNeeded(e,n,r){if(!this._helper.autoCalculateNearFarZ)return;let i=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),a=e-i*this._helper._pixelPerMeter/Math.cos(n),o=i<0?a:e,s=Math.PI/2+this.pitchInRadians,c=t.an(this.fov)*(Math.abs(Math.cos(t.an(this.roll)))*this.height+Math.abs(Math.sin(t.an(this.roll)))*this.width)/this.height*(.5+r.y/this.height),l=Math.sin(c)*o/Math.sin(t.al(Math.PI-s-c,.01,Math.PI-.01)),u=Fe(this),d=Math.atan(u/this._helper.cameraToCenterDistance),f=t.an(.75),p=d>f?2*d*(.5+r.y/(2*u)):f,m=Math.sin(p)*o/Math.sin(t.al(Math.PI-s-p,.01,Math.PI-.01)),h=Math.min(l,m);this._helper._farZ=1.01*(Math.cos(Math.PI/2-n)*h+o),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;let e=this.centerOffset,n=Ne(this.worldSize,this.center),r=n.x,i=n.y;this._helper._pixelPerMeter=t.aq(1,this.center.lat)*this.worldSize;let a=t.an(Math.min(this.pitch,Me)),o=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(a)),s;this._calculateNearFarZIfNeeded(o,a,e),s=new Float64Array(16),t.bd(s,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),t.az(this._invProjMatrix,s),s[8]=2*-e.x/this._helper._width,s[9]=2*e.y/this._helper._height,this._projectionMatrix=t.be(s),t.S(s,s,[1,-1,1]),t.Q(s,s,[0,0,-this._helper.cameraToCenterDistance]),t.bf(s,s,-this.rollInRadians),t.bg(s,s,this.pitchInRadians),t.bf(s,s,-this.bearingInRadians),t.Q(s,s,[-r,-i,0]),this._mercatorMatrix=t.S([],s,[this.worldSize,this.worldSize,this.worldSize]),t.S(s,s,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=t.U(new Float64Array(16),this.clipSpaceToPixelsMatrix,s),t.Q(s,s,[0,0,-this.elevation]),this._viewProjMatrix=s,this._invViewProjMatrix=t.az([],s);let c=[0,0,-1,1];t.aF(c,c,this._invViewProjMatrix),this._cameraPosition=[c[0]/c[3],c[1]/c[3],c[2]/c[3]],this._fogMatrix=new Float64Array(16),t.bd(this._fogMatrix,this.fovInRadians,this.width/this.height,o,this._helper._farZ),this._fogMatrix[8]=2*-e.x/this.width,this._fogMatrix[9]=2*e.y/this.height,t.S(this._fogMatrix,this._fogMatrix,[1,-1,1]),t.Q(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),t.bf(this._fogMatrix,this._fogMatrix,-this.rollInRadians),t.bg(this._fogMatrix,this._fogMatrix,this.pitchInRadians),t.bf(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),t.Q(this._fogMatrix,this._fogMatrix,[-r,-i,0]),t.S(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),t.Q(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=t.U(new Float64Array(16),this.clipSpaceToPixelsMatrix,s);let l=this._helper._width%2/2,u=this._helper._height%2/2,d=Math.cos(this.bearingInRadians),f=Math.sin(-this.bearingInRadians),p=r-Math.round(r)+d*l+f*u,m=i-Math.round(i)+d*u+f*l,h=new Float64Array(s);if(t.Q(h,h,[p>.5?p-1:p,m>.5?m-1:m,0]),this._alignedProjMatrix=h,s=t.az(new Float64Array(16),this._pixelMatrix),!s)throw 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;let e=this.screenPointToMercatorCoordinate(new t.P(0,0)),n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.aF(n,n,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){let e=t.aq(1,this.center.lat)*this.worldSize;return Le(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/e).toLngLat()}lngLatToCameraDepth(e,n){let r=t.a7.fromLngLat(e),i=[r.x*this.worldSize,r.y*this.worldSize,n,1];return t.aF(i,i,this._viewProjMatrix),i[2]/i[3]}getProjectionData(e){let{overscaledTileID:n,aligned:r,applyTerrainMatrix:i}=e,a=this._helper.getMercatorTileCoordinates(n),o=n?this.calculatePosMatrix(n,r,!0):null,s;return s=n?.terrainRttPosMatrix32f&&i?n.terrainRttPosMatrix32f:o||t.bh(),{mainMatrix:s,tileMercatorCoords:a,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:s}}isLocationOccluded(e){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(e,t,n){return 1}transformLightDirection(e){return t.b0(e)}getRayDirectionFromPixel(e){throw Error(`Not implemented.`)}projectTileCoordinates(e,n,r,i){let a=this.calculatePosMatrix(r),o;i?(o=[e,n,i(e,n),1],t.aF(o,o,a)):(o=[e,n,0,1],gt(o,o,a));let s=o[3];return{point:new t.P(o[0]/s,o[1]/s),signedDistanceFromCamera:s,isOccluded:!1}}populateCache(e){for(let t of e)this.calculatePosMatrix(t)}getMatrixForModel(e,n){let r=t.a7.fromLngLat(e,n),i=r.meterInMercatorCoordinateUnits(),a=t.bi();return t.Q(a,a,[r.x,r.y,r.z]),t.bf(a,a,Math.PI),t.bg(a,a,Math.PI/2),t.S(a,a,[-i,i,i]),a}getProjectionDataForCustomLayer(e=!0){let n=new t.a3(0,0,0,0,0),r=this.getProjectionData({overscaledTileID:n,applyGlobeMatrix:e}),i=Ie(n,this.worldSize);t.U(i,this._viewProjMatrix,i),r.tileMercatorCoords=[0,0,1,1];let a=[t.a6,t.a6,this.worldSize/this._helper.pixelsPerMeter],o=t.bj();return t.S(o,i,a),r.fallbackMatrix=o,r.mainMatrix=o,r}getFastPathSimpleProjectionMatrix(e){return this.calculatePosMatrix(e)}}function $t(){t.w(`Map cannot fit within canvas with the given bounds, padding, and/or offset.`)}function en(e){if(e.useSlerp)if(e.k<1){let n=t.bk(e.startEulerAngles.roll,e.startEulerAngles.pitch,e.startEulerAngles.bearing),r=t.bk(e.endEulerAngles.roll,e.endEulerAngles.pitch,e.endEulerAngles.bearing),i=new Float64Array(4);t.bl(i,n,r,e.k);let a=t.bm(i);e.tr.setRoll(a.roll),e.tr.setPitch(a.pitch),e.tr.setBearing(a.bearing)}else e.tr.setRoll(e.endEulerAngles.roll),e.tr.setPitch(e.endEulerAngles.pitch),e.tr.setBearing(e.endEulerAngles.bearing);else e.tr.setRoll(t.H.number(e.startEulerAngles.roll,e.endEulerAngles.roll,e.k)),e.tr.setPitch(t.H.number(e.startEulerAngles.pitch,e.endEulerAngles.pitch,e.k)),e.tr.setBearing(t.H.number(e.startEulerAngles.bearing,e.endEulerAngles.bearing,e.k))}function tn(e,n,r,i,a){let o=a.padding,s=Ne(a.worldSize,r.getNorthWest()),c=Ne(a.worldSize,r.getNorthEast()),l=Ne(a.worldSize,r.getSouthEast()),u=Ne(a.worldSize,r.getSouthWest()),d=t.an(-i),f=s.rotate(d),p=c.rotate(d),m=l.rotate(d),h=u.rotate(d),g=new t.P(Math.max(f.x,p.x,h.x,m.x),Math.max(f.y,p.y,h.y,m.y)),_=new t.P(Math.min(f.x,p.x,h.x,m.x),Math.min(f.y,p.y,h.y,m.y)),v=g.sub(_),y=(a.width-(o.left+o.right+n.left+n.right))/v.x,b=(a.height-(o.top+o.bottom+n.top+n.bottom))/v.y;if(b<0||y<0)return void $t();let x=Math.min(t.ar(a.scale*Math.min(y,b)),e.maxZoom),S=t.P.convert(e.offset),C=new t.P((n.left-n.right)/2,(n.top-n.bottom)/2).rotate(t.an(i)),w=S.add(C).mult(a.scale/t.ao(x));return{center:Pe(a.worldSize,s.add(l).div(2).sub(w)),zoom:x,bearing:i}}class nn{get useGlobeControls(){return!1}handlePanInertia(e,t){let n=e.mag(),r=Math.abs(Fe(t));return{easingOffset:e.mult(Math.min(.75*r/n,1)),easingCenter:t.center}}handleMapControlsRollPitchBearingZoom(e,t){e.bearingDelta&&t.setBearing(t.bearing+e.bearingDelta),e.pitchDelta&&t.setPitch(t.pitch+e.pitchDelta),e.rollDelta&&t.setRoll(t.roll+e.rollDelta),e.zoomDelta&&t.setZoom(t.zoom+e.zoomDelta)}handleMapControlsPan(e,t,n){e.around.distSqr(t.centerPoint)<.01||t.setLocationAtPoint(n,e.around)}cameraForBoxAndBearing(e,t,n,r,i){return tn(e,t,n,r,i)}handleJumpToCenterZoom(e,n){e.zoom!==(n.zoom===void 0?e.zoom:+n.zoom)&&e.setZoom(+n.zoom),n.center!==void 0&&e.setCenter(t.W.convert(n.center))}handleEaseTo(e,n){let r=e.zoom,i=e.padding,a={roll:e.roll,pitch:e.pitch,bearing:e.bearing},o={roll:n.roll===void 0?e.roll:n.roll,pitch:n.pitch===void 0?e.pitch:n.pitch,bearing:n.bearing===void 0?e.bearing:n.bearing},s=n.zoom!==void 0,c=!e.isPaddingEqual(n.padding),l=!1,u=s?+n.zoom:e.zoom,d=e.centerPoint.add(n.offsetAsPoint),f=e.screenPointToLocation(d),{center:p,zoom:m}=e.applyConstrain(t.W.convert(n.center||f),u??r);Kt(e,p);let h=Ne(e.worldSize,f),g=Ne(e.worldSize,p).sub(h),_=t.ao(m-r);return l=m!==r,{easeFunc:s=>{if(l&&e.setZoom(t.H.number(r,m,s)),t.bn(a,o)||en({startEulerAngles:a,endEulerAngles:o,tr:e,k:s,useSlerp:a.roll!=o.roll}),c&&(e.interpolatePadding(i,n.padding,s),d=e.centerPoint.add(n.offsetAsPoint)),n.around)e.setLocationAtPoint(n.around,n.aroundPoint);else{let n=t.ao(e.zoom-r),i=(m>r?Math.min(2,_):Math.max(.5,_))**(1-s),a=Pe(e.worldSize,h.add(g.mult(s*i)).mult(n));e.setLocationAtPoint(e.renderWorldCopies?a.wrap():a,d)}},isZooming:l,elevationCenter:p}}handleFlyTo(e,n){let r=n.zoom!==void 0,i=e.zoom,a=e.applyConstrain(t.W.convert(n.center||n.locationAtOffset),r?+n.zoom:i),o=a.center,s=a.zoom;Kt(e,o);let c=Ne(e.worldSize,n.locationAtOffset),l=Ne(e.worldSize,o).sub(c),u=l.mag(),d=t.ao(s-i),f;if(n.minZoom!==void 0){let r=Math.min(+n.minZoom,i,s),a=e.applyConstrain(o,r).zoom;f=t.ao(a-i)}return{easeFunc:(n,r,a,u)=>{e.setZoom(n===1?s:i+t.ar(r));let d=n===1?o:Pe(e.worldSize,c.add(l.mult(a)).mult(r));e.setLocationAtPoint(e.renderWorldCopies?d.wrap():d,u)},scaleOfZoom:d,targetCenter:o,scaleOfMinZoom:f,pixelPathLength:u}}}class U{constructor(e,t,n){this.blendFunction=e,this.blendColor=t,this.mask=n}}U.Replace=[1,0],U.disabled=new U(U.Replace,t.bo.transparent,[!1,!1,!1,!1]),U.unblended=new U(U.Replace,t.bo.transparent,[!0,!0,!0,!0]),U.alphaBlended=new U([1,771],t.bo.transparent,[!0,!0,!0,!0]);let rn=2305;class W{constructor(e,t,n){this.enable=e,this.mode=t,this.frontFace=n}}W.disabled=new W(!1,1029,rn),W.backCCW=new W(!0,1029,rn),W.frontCCW=new W(!0,1028,rn);class G{constructor(e,t,n){this.func=e,this.mask=t,this.range=n}}G.ReadOnly=!1,G.ReadWrite=!0,G.disabled=new G(519,G.ReadOnly,[0,1]);let an=7680;class K{constructor(e,t,n,r,i,a){this.test=e,this.ref=t,this.mask=n,this.fail=r,this.depthFail=i,this.pass=a}}K.disabled=new K({func:519,mask:0},0,0,an,an,an);let on=new WeakMap;function sn(e){if(on.has(e))return on.get(e);{let t=e.getParameter(e.VERSION)?.startsWith(`WebGL 2.0`);return on.set(e,t),t}}class cn{get awaitingQuery(){return!!this._readbackQueue}constructor(e){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=e;let n=e.context,r=n.gl;this._texFormat=r.RGBA,this._texType=r.UNSIGNED_BYTE;let i=new t.aV;i.emplaceBack(-1,-1),i.emplaceBack(2,-1),i.emplaceBack(-1,2);let a=new t.aX;a.emplaceBack(0,1,2),this._fullscreenTriangle=new Bt(n.createVertexBuffer(i,Vt.members),n.createIndexBuffer(a),t.aW.simpleSegment(0,0,i.length,a.length)),this._resultBuffer=new Uint8Array(4),n.activeTexture.set(r.TEXTURE1);let 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=n.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(o),sn(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(){let e=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),e.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(e,t){let n=this._updateCount;return this._readbackQueue?n>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():n>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(e,t),this._updateCount++,this._measuredError}_bindFramebuffer(){let e=this._cachedRenderContext.context,t=e.gl;e.activeTexture.set(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,this._fbo.colorAttachment.get()),e.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(e,n){let r=this._cachedRenderContext.context,i=r.gl;if(this._bindFramebuffer(),r.viewport.set([0,0,this._texWidth,this._texHeight]),r.clear({color:t.bo.transparent}),this._cachedRenderContext.useProgram(`projectionErrorMeasurement`).draw(r,i.TRIANGLES,G.disabled,K.disabled,U.unblended,W.disabled,((e,t)=>({u_input:e,u_output_expected:t}))(e,n),null,null,`$clipping`,this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&sn(i)){i.bindBuffer(i.PIXEL_PACK_BUFFER,this._pbo),i.readBuffer(i.COLOR_ATTACHMENT0),i.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),i.bindBuffer(i.PIXEL_PACK_BUFFER,null);let e=i.fenceSync(i.SYNC_GPU_COMMANDS_COMPLETE,0);i.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:e}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){let e=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&sn(e)){let n=e.clientWaitSync(this._readbackQueue.sync,0,0);if(n===e.WAIT_FAILED)return t.w(`WebGL2 clientWaitSync failed.`),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(n===e.TIMEOUT_EXPIRED)return;e.bindBuffer(e.PIXEL_PACK_BUFFER,this._pbo),e.getBufferSubData(e.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),e.bindBuffer(e.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),e.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=cn._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(e){let t=0;return t+=e[0]/256,t+=e[1]/65536,t+=e[2]/16777216,e[3]<127&&(t=-t),t/128}}let ln=t.a6/128;function un(e,n){let r=e.granularity===void 0?1:Math.max(e.granularity,1),i=r+(e.generateBorders?2:0),a=r+(e.extendToNorthPole||e.generateBorders?1:0)+(e.extendToSouthPole||e.generateBorders?1:0),o=i+1,s=a+1,c=e.generateBorders?-1:0,l=e.generateBorders||e.extendToNorthPole?-1:0,u=r+ +!!e.generateBorders,d=r+(e.generateBorders||e.extendToSouthPole?1:0),f=o*s,p=i*a*6,m=o*s>65536;if(m&&n===`16bit`)throw Error(`Granularity is too large and meshes would not fit inside 16 bit vertex indices.`);let h=m||n===`32bit`,g=new Int16Array(2*f),_=0;for(let n=l;n<=d;n++)for(let i=c;i<=u;i++){let a=i/r*t.a6;i===-1&&(a=-ln),i===r+1&&(a=t.a6+ln);let o=n/r*t.a6;n===-1&&(o=e.extendToNorthPole?t.bq:-ln),n===r+1&&(o=e.extendToSouthPole?t.br:t.a6+ln),g[_++]=a,g[_++]=o}let v=h?new Uint32Array(p):new Uint16Array(p),y=0;for(let e=0;e<a;e++)for(let t=0;t<i;t++){let n=t+1+e*o,r=t+(e+1)*o,i=t+1+(e+1)*o;v[y++]=t+e*o,v[y++]=r,v[y++]=n,v[y++]=n,v[y++]=r,v[y++]=i}return{vertices:g.buffer.slice(0),indices:v.buffer.slice(0),uses32bitIndices:h}}let dn=new t.aU({fill:new t.bs(128,2),line:new t.bs(512,0),tile:new t.bs(128,32),stencil:new t.bs(128,1),circle:3});class fn{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 V.projectionGlobe}get vertexShaderPreludeCode(){return V.projectionMercator.vertexSource}get subdivisionGranularity(){return dn}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(e){this._errorMeasurement||=new cn(e);let n=t.Y(this._errorQueryLatitudeDegrees),r=2*Math.atan(Math.exp(Math.PI-n*Math.PI*2))-.5*Math.PI,i=this._errorMeasurement.updateErrorLoop(n,r),a=l();i!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=i,this._errorMeasurementLastChangeTime=a);let o=Math.min(Math.max((a-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=t.bt(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,t.bu(o))}_getMeshKey(e){return`${e.granularity.toString(36)}_${e.generateBorders?`b`:``}${e.extendToNorthPole?`n`:``}${e.extendToSouthPole?`s`:``}`}getMeshFromTileID(e,t,n,r,i){let a=(i===`stencil`?dn.stencil:dn.tile).getGranularityForZoomLevel(t.z);return this._getMesh(e,{granularity:a,generateBorders:n,extendToNorthPole:t.y===0&&r,extendToSouthPole:t.y===(1<<t.z)-1&&r})}_getMesh(e,n){let r=this._getMeshKey(n);if(r in this._tileMeshCache)return this._tileMeshCache[r];let i=function(e,n){let r=un(n,`16bit`),i=t.aV.deserialize({arrayBuffer:r.vertices,length:r.vertices.byteLength/2/2}),a=t.aX.deserialize({arrayBuffer:r.indices,length:r.indices.byteLength/2/3});return new Bt(e.createVertexBuffer(i,Vt.members),e.createIndexBuffer(a),t.aW.simpleSegment(0,0,i.length,a.length))}(e,n);return this._tileMeshCache[r]=i,i}recalculate(e){}hasTransition(){let e=l(),t=!1;return t||=(e-this._errorMeasurementLastChangeTime)/1e3<.7,t||=this._errorMeasurement?.awaitingQuery,t}setErrorQueryLatitudeDegrees(e){this._errorQueryLatitudeDegrees=e}}let pn=new t.u({type:new t.D(t.x.projection.type)});class mn extends t.E{constructor(e){super(),this._transitionable=new t.y(pn,void 0),this.setProjection(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new t.J(0)),this._mercatorProjection=new Wt,this._verticalPerspectiveProjection=new fn}get transitionState(){let e=this.properties.get(`type`);if(typeof e==`string`&&e===`mercator`)return 0;if(typeof e==`string`&&e===`vertical-perspective`)return 1;if(e instanceof t.bv){if(e.from===`vertical-perspective`&&e.to===`mercator`)return 1-e.transition;if(e.from===`mercator`&&e.to===`vertical-perspective`)return e.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(e){this._mercatorProjection.updateGPUdependent(e),this._verticalPerspectiveProjection.updateGPUdependent(e)}getMeshFromTileID(e,t,n,r,i){return this.currentProjection.getMeshFromTileID(e,t,n,r,i)}setProjection(e){this._transitionable.setValue(`type`,e?.type||`mercator`)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}setErrorQueryLatitudeDegrees(e){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(e),this._mercatorProjection.setErrorQueryLatitudeDegrees(e)}}function hn(e){let t=vn(e.worldSize,e.center.lat);return 2*Math.PI*t}function gn(e,n,r,i,a){let o=1/(1<<a),s=n/t.a6*o+i*o,c=t.by((e/t.a6*o+r*o)*Math.PI*2+Math.PI,2*Math.PI),l=2*Math.atan(Math.exp(Math.PI-s*Math.PI*2))-.5*Math.PI,u=Math.cos(l),d=new Float64Array(3);return d[0]=Math.sin(c)*u,d[1]=Math.sin(l),d[2]=Math.cos(c)*u,d}function _n(e){return function(e,t){let n=Math.cos(t),r=new Float64Array(3);return r[0]=Math.sin(e)*n,r[1]=Math.sin(t),r[2]=Math.cos(e)*n,r}(e.lng*Math.PI/180,e.lat*Math.PI/180)}function vn(e,t){return e/(2*Math.PI)/Math.cos(t*Math.PI/180)}function yn(e){let n=Math.asin(e[1])/Math.PI*180,r=Math.sqrt(e[0]*e[0]+e[2]*e[2]);if(r>1e-6){let i=e[0]/r,a=Math.acos(e[2]/r),o=(i>0?a:-a)/Math.PI*180;return new t.W(t.X(o,-180,180),n)}return new t.W(0,n)}function bn(e){return Math.cos(e*Math.PI/180)}function xn(e,n){let r=bn(e),i=bn(n);return t.ar(i/r)}function Sn(e,n){let r=e.rotate(n.bearingInRadians),i=n.zoom+xn(n.center.lat,0),a=t.bt(1/bn(n.center.lat),1/bn(Math.min(Math.abs(n.center.lat),60)),t.bw(i,7,3,0,1)),o=360/hn({worldSize:n.worldSize,center:{lat:n.center.lat}});return new t.W(n.center.lng-r.x*o*a,t.al(n.center.lat+r.y*o,-t.am,t.am))}function Cn(e){let t=.5*e,n=Math.sin(t),r=Math.cos(t);return Math.log(n+r)-Math.log(r-n)}function wn(e,n,r,i){let a=e.lat+r*i;if(Math.abs(r)>1){let o=(Math.sign(e.lat+r)===Math.sign(e.lat)?Math.abs(e.lat):-Math.abs(e.lat))*Math.PI/180,s=Math.abs(e.lat+r)*Math.PI/180,c=Cn(o+i*(s-o)),l=Cn(o),u=Cn(s);return new t.W(e.lng+n*((c-l)/(u-l)),a)}return new t.W(e.lng+n*i,a)}class Tn{constructor(e){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=e}swapBuffers(){if(!this._hadAnyChanges)return;let e=this._cachePrevious;this._cachePrevious=this._cache,this._cache=e,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(e,t,n,r){let i=`${e.z}_${e.x}_${e.y}_${r?.terrain?`t`:``}`,a=this._cache.get(i);if(a)return a;let o=this._cachePrevious.get(i);if(o)return this._cache.set(i,o),o;let s=this._boundingVolumeFactory(e,t,n,r);return this._cache.set(i,s),this._hadAnyChanges=!0,s}}class En{constructor(e,t,n,r){this.min=n,this.max=r,this.points=e,this.planes=t}static fromAabb(e,t){let n=[];for(let r=0;r<8;r++)n.push([1&~r?e[0]:t[0],(r>>1&1)==1?t[1]:e[1],(r>>2&1)==1?t[2]:e[2]]);return new En(n,[[-1,0,0,t[0]],[1,0,0,-e[0]],[0,-1,0,t[1]],[0,1,0,-e[1]],[0,0,-1,t[2]],[0,0,1,-e[2]]],e,t)}static fromCenterSizeAngles(e,n,r){let i=t.bA([],r[0],r[1],r[2]),a=t.bB([],[n[0],0,0],i),o=t.bB([],[0,n[1],0],i),s=t.bB([],[0,0,n[2]],i),c=[...e],l=[...e];for(let t=0;t<8;t++)for(let n=0;n<3;n++){let r=e[n]+a[n]*(1&~t?-1:1)+o[n]*((t>>1&1)==1?1:-1)+s[n]*((t>>2&1)==1?1:-1);c[n]=Math.min(c[n],r),l[n]=Math.max(l[n],r)}let u=[];for(let n=0;n<8;n++){let r=[...e];t.a$(r,r,t.a_([],a,1&~n?-1:1)),t.a$(r,r,t.a_([],o,(n>>1&1)==1?1:-1)),t.a$(r,r,t.a_([],s,(n>>2&1)==1?1:-1)),u.push(r)}return new En(u,[[...a,-t.b4(a,u[0])],[...o,-t.b4(o,u[0])],[...s,-t.b4(s,u[0])],[-a[0],-a[1],-a[2],-t.b4(a,u[7])],[-o[0],-o[1],-o[2],-t.b4(o,u[7])],[-s[0],-s[1],-s[2],-t.b4(s,u[7])]],c,l)}intersectsFrustum(e){let t=!0,n=this.points.length,r=this.planes.length,i=e.planes.length,a=e.points.length;for(let r=0;r<i;r++){let i=e.planes[r],a=0;for(let e=0;e<n;e++){let t=this.points[e];i[0]*t[0]+i[1]*t[1]+i[2]*t[2]+i[3]>=0&&a++}if(a===0)return 0;a<n&&(t=!1)}if(t)return 2;for(let t=0;t<r;t++){let n=this.planes[t],r=0;for(let t=0;t<a;t++){let i=e.points[t];n[0]*i[0]+n[1]*i[1]+n[2]*i[2]+n[3]>=0&&r++}if(r===0)return 0}return 1}intersectsPlane(e){let t=this.points.length,n=0;for(let r=0;r<t;r++){let t=this.points[r];e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]>=0&&n++}return n===t?2:n===0?0:1}}function Dn(e,t,n){let r=e-t;return r<0?-r:Math.max(0,r-n)}function On(e,t,n,r,i){let a=e-n,o;return o=a<0?Math.min(-a,1+a-i):a>i?Math.min(Math.max(a-i,0),1-a):0,Math.max(o,Dn(t,r,i))}class kn{constructor(){this._boundingVolumeCache=new Tn(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(e,t,n,r){let i=1<<n.z,a=1/i,o=n.x/i,s=n.y/i,c=2;return c=Math.min(c,On(e,t,o,s,a)),c=Math.min(c,On(e,t,o+.5,-s-a,a)),c=Math.min(c,On(e,t,o+.5,2-s-a,a)),c}getWrap(e,t,n){let r=1<<t.z,i=1/r,a=t.x/r,o=Dn(e.x,a,i),s=Dn(e.x,a-1,i),c=Dn(e.x,a+1,i),l=Math.min(o,s,c);return l===c?1:l===s?-1:0}allowVariableZoom(e,t){return F(e,t)>4}allowWorldCopies(){return!1}getTileBoundingVolume(e,t,n,r){return this._boundingVolumeCache.getTileBoundingVolume(e,t,n,r)}_computeTileBoundingVolume(e,n,r,i){let a=0,o=0;if(i?.terrain){let s=new t.a3(e.z,n,e.z,e.x,e.y),c=i.terrain.getMinMaxElevation(s);a=c.minElevation??Math.min(0,r),o=c.maxElevation??Math.max(0,r)}if(a/=t.bD,o/=t.bD,a+=1,o+=1,e.z<=0)return En.fromAabb([-o,-o,-o],[o,o,o]);if(e.z===1)return En.fromAabb([e.x===0?-o:0,e.y===0?0:-o,-o],[e.x===0?0:o,e.y===0?o:0,o]);{let n=[gn(0,0,e.x,e.y,e.z),gn(t.a6,0,e.x,e.y,e.z),gn(t.a6,t.a6,e.x,e.y,e.z),gn(0,t.a6,e.x,e.y,e.z)],r=[];for(let e of n)r.push(t.a_([],e,o));if(o!==a)for(let e of n)r.push(t.a_([],e,a));e.y===0&&r.push([0,1,0]),e.y===(1<<e.z)-1&&r.push([0,-1,0]);let i=[1,1,1],s=[-1,-1,-1];for(let e of r)for(let t=0;t<3;t++)i[t]=Math.min(i[t],e[t]),s[t]=Math.max(s[t],e[t]);let c=gn(t.a6/2,t.a6/2,e.x,e.y,e.z),l=t.b3([],[0,1,0],c);t.b2(l,l);let u=t.b3([],c,l);t.b2(u,u);let d=t.b3([],n[2],n[1]);t.b2(d,d);let f=t.b3([],n[0],n[3]);t.b2(f,f),r.push(t.a_([],c,o)),e.y>=(1<<e.z)/2&&r.push(t.a_([],gn(t.a6/2,0,e.x,e.y,e.z),o)),e.y<(1<<e.z)/2&&r.push(t.a_([],gn(t.a6/2,t.a6,e.x,e.y,e.z),o));let p=An(c,r),m=An(u,r),h=[-c[0],-c[1],-c[2],p.max],g=[c[0],c[1],c[2],-p.min],_=[-u[0],-u[1],-u[2],m.max],v=[u[0],u[1],u[2],-m.min],y=[...d,0],b=[...f,0],x=[];return e.y===0?x.push(t.bC(b,y,h),t.bC(b,y,g)):x.push(t.bC(_,y,h),t.bC(_,y,g),t.bC(_,b,h),t.bC(_,b,g)),e.y===(1<<e.z)-1?x.push(t.bC(b,y,h),t.bC(b,y,g)):x.push(t.bC(v,y,h),t.bC(v,y,g),t.bC(v,b,h),t.bC(v,b,g)),new En(x,[h,g,_,v,y,b],i,s)}}}function An(e,n){let r=1/0,i=-1/0;for(let a of n){let n=t.b4(e,a);r=Math.min(r,n),i=Math.max(i,n)}return{min:r,max:i}}class jn{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(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,t,n){this._helper.interpolatePadding(e,t,n)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,t){this._helper.resize(e,t)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}setConstrainOverride(e){this._helper.setConstrainOverride(e)}overrideNearFarZ(e,t){this._helper.overrideNearFarZ(e,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}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(e){}constructor(e){this._cachedClippingPlane=t.bE(),this._projectionMatrix=t.bi(),this._globeViewProjMatrix32f=t.bh(),this._globeViewProjMatrixNoCorrection=t.bi(),this._globeViewProjMatrixNoCorrectionInverted=t.bi(),this._globeProjMatrixInverted=t.bi(),this._cameraPosition=t.bz(),this._globeLatitudeErrorCorrectionRadians=0,this.defaultConstrain=(e,n)=>{let r=t.al(e.lat,-t.am,t.am),i=t.al(+n,this.minZoom+xn(0,r),this.maxZoom);return{center:new t.W(e.lng,r),zoom:i}},this.applyConstrain=(e,t)=>this._helper.applyConstrain(e,t),this._helper=new Jt({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(e,t)=>this.defaultConstrain(e,t)},e),this._coveringTilesDetailsProvider=new kn}clone(){let e=new jn;return e.apply(this,!1),e}apply(e,t,n){this._globeLatitudeErrorCorrectionRadians=n||0,this._helper.apply(e,t)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let e=t.bz();return e[0]=this._cameraPosition[0],e[1]=this._cameraPosition[1],e[2]=this._cameraPosition[2],e}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(e){let{overscaledTileID:t,applyGlobeMatrix:n}=e,r=this._helper.getMercatorTileCoordinates(t);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:r,clippingPlane:this._cachedClippingPlane,projectionTransition:+!!n,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(e){let n=this.pitchInRadians,r=this.cameraToCenterDistance/e,i=Math.sin(n)*r,a=Math.cos(n)*r+1,o=1/Math.sqrt(i*i+a*a)*1,s=-i,c=a,l=Math.sqrt(s*s+c*c);s/=l,c/=l;let u=[0,s,c];t.bF(u,u,[0,0,0],-this.bearingInRadians),t.bG(u,u,[0,0,0],-1*this.center.lat*Math.PI/180),t.bH(u,u,[0,0,0],this.center.lng*Math.PI/180);let d=1/t.b6(u);return t.a_(u,u,d),[...u,-o*d]}isLocationOccluded(e){return!this.isSurfacePointVisible(_n(e))}transformLightDirection(e){let n=this._helper._center.lng*Math.PI/180,r=this._helper._center.lat*Math.PI/180,i=Math.cos(r),a=[Math.sin(n)*i,Math.sin(r),Math.cos(n)*i],o=[a[2],0,-a[0]],s=[0,0,0];t.b3(s,o,a),t.b2(o,o),t.b2(s,s);let c=[0,0,0];return t.b2(c,[o[0]*e[0]+s[0]*e[1]+a[0]*e[2],o[1]*e[0]+s[1]*e[1]+a[1]*e[2],o[2]*e[0]+s[2]*e[1]+a[2]*e[2]]),c}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(e,n,r){let i=function(e,n,r){let i=1/(1<<r.z);return new t.a7(e/t.a6*i+r.x*i,n/t.a6*i+r.y*i)}(e,n,r.canonical),a=(o=i.y,[t.by(i.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(e,n,r,i){let a=r.canonical,o=gn(e,n,a.x,a.y,a.z),s=1+(i?i(e,n):0)/t.bD,c=[o[0]*s,o[1]*s,o[2]*s,1];t.aF(c,c,this._globeViewProjMatrixNoCorrection);let l=this._cachedClippingPlane,u=l[0]*o[0]+l[1]*o[1]+l[2]*o[2]+l[3]<0;return{point:new t.P(c[0]/c[3],c[1]/c[3]),signedDistanceFromCamera:c[3],isOccluded:u}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;let e=vn(this.worldSize,this.center.lat),n=t.bj(),r=t.bj();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*e),t.bd(n,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let i=this.centerOffset;n[8]=2*-i.x/this._helper._width,n[9]=2*i.y/this._helper._height,this._projectionMatrix=t.be(n),this._globeProjMatrixInverted=t.bj(),t.az(this._globeProjMatrixInverted,n),t.Q(n,n,[0,0,-this.cameraToCenterDistance]),t.bf(n,n,this.rollInRadians),t.bg(n,n,-this.pitchInRadians),t.bf(n,n,this.bearingInRadians),t.Q(n,n,[0,0,-e]);let a=t.bz();a[0]=e,a[1]=e,a[2]=e,t.bg(r,n,this.center.lat*Math.PI/180),t.bI(r,r,-this.center.lng*Math.PI/180),t.S(r,r,a),this._globeViewProjMatrixNoCorrection=r,t.bg(n,n,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),t.bI(n,n,-this.center.lng*Math.PI/180),t.S(n,n,a),this._globeViewProjMatrix32f=new Float32Array(n),this._globeViewProjMatrixNoCorrectionInverted=t.bj(),t.az(this._globeViewProjMatrixNoCorrectionInverted,r);let o=t.bz();this._cameraPosition=t.bz(),this._cameraPosition[2]=this.cameraToCenterDistance/e,t.bF(this._cameraPosition,this._cameraPosition,o,-this.rollInRadians),t.bG(this._cameraPosition,this._cameraPosition,o,this.pitchInRadians),t.bF(this._cameraPosition,this._cameraPosition,o,-this.bearingInRadians),t.a$(this._cameraPosition,this._cameraPosition,[0,0,1]),t.bG(this._cameraPosition,this._cameraPosition,o,-this.center.lat*Math.PI/180),t.bH(this._cameraPosition,this._cameraPosition,o,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(e);let s=t.be(this._globeViewProjMatrixNoCorrectionInverted);t.S(s,s,[1,1,-1]),this._cachedFrustum=Zt.fromInvProjectionMatrix(s,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(e){t.w(`calculateFogMatrix is not supported on globe projection.`);let n=t.bj();return t.ap(n),n}getVisibleUnwrappedCoordinates(e){return[new t.bb(0,e)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){e&&t.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(e,n){if(!this._globeViewProjMatrixNoCorrection)return 1;let r=_n(e);t.a_(r,r,1+n/t.bD);let i=t.bE();return t.aF(i,[r[0],r[1],r[2],1],this._globeViewProjMatrixNoCorrection),i[2]/i[3]}populateCache(e){}getBounds(){let e=.5*this.width,n=.5*this.height,r=[new t.P(0,0),new t.P(e,0),new t.P(this.width,0),new t.P(this.width,n),new t.P(this.width,this.height),new t.P(e,this.height),new t.P(0,this.height),new t.P(0,n)],i=[];for(let e of r)i.push(this.unprojectScreenPoint(e));let a=0,o=0,s=0,c=0,l=this.center;for(let e of i){let n=t.bJ(l.lng,e.lng),r=t.bJ(l.lat,e.lat);n<o&&(o=n),n>a&&(a=n),r<c&&(c=r),r>s&&(s=r)}let u=[l.lng+o,l.lat+c,l.lng+a,l.lat+s];return this.isSurfacePointOnScreen([0,1,0])&&(u[3]=90,u[0]=-180,u[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(u[1]=-90,u[0]=-180,u[2]=180),new se(u)}calculateCenterFromCameraLngLatAlt(e,t,n,r){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,n,r)}setLocationAtPoint(e,n){let r=_n(this.unprojectScreenPoint(n)),i=_n(e),a=t.bz();t.bK(a);let o=t.bz();t.bH(o,r,a,-this.center.lng*Math.PI/180),t.bG(o,o,a,this.center.lat*Math.PI/180);let s=i[0]*i[0]+i[2]*i[2],c=o[0]*o[0];if(s<c)return;let l=Math.sqrt(s-c),u=-l,d=t.bL(i[0],i[2],o[0],l),f=t.bL(i[0],i[2],o[0],u),p=t.bz();t.bH(p,i,a,-d);let m=t.bL(p[1],p[2],o[1],o[2]),h=t.bz();t.bH(h,i,a,-f);let g=t.bL(h[1],h[2],o[1],o[2]),_=.5*Math.PI,v=m>=-_&&m<=_,y=g>=-_&&g<=_,b,x;if(v&&y){let e=this.center.lng*Math.PI/180,n=this.center.lat*Math.PI/180;t.bM(d,e)+t.bM(m,n)<t.bM(f,e)+t.bM(g,n)?(b=d,x=m):(b=f,x=g)}else if(v)b=d,x=m;else{if(!y)return;b=f,x=g}let S=b/Math.PI*180,C=x/Math.PI*180,w=this.center.lat;this.setCenter(new t.W(S,t.al(C,-90,90))),this.setZoom(this.zoom+xn(w,this.center.lat))}locationToScreenPoint(e,n){let r=_n(e);if(n){let i=n.getElevationForLngLatZoom(e,this._helper._tileZoom);t.a_(r,r,1+i/t.bD)}return this._projectSurfacePointToScreen(r)}_projectSurfacePointToScreen(e){let n=t.bE();return t.aF(n,[...e,1],this._globeViewProjMatrixNoCorrection),n[0]/=n[3],n[1]/=n[3],new t.P((.5*n[0]+.5)*this.width,(.5*-n[1]+.5)*this.height)}screenPointToMercatorCoordinate(e,n){if(n){let t=n.pointCoordinate(e);if(t)return t}return t.a7.fromLngLat(this.unprojectScreenPoint(e))}screenPointToLocation(e,t){return this.screenPointToMercatorCoordinate(e,t)?.toLngLat()}isPointOnMapSurface(e,t){let n=this._cameraPosition,r=this.getRayDirectionFromPixel(e);return!!this.rayPlanetIntersection(n,r)}getRayDirectionFromPixel(e){let n=t.bE();n[0]=e.x/this.width*2-1,n[1]=-1*(e.y/this.height*2-1),n[2]=1,n[3]=1,t.aF(n,n,this._globeViewProjMatrixNoCorrectionInverted),n[0]/=n[3],n[1]/=n[3],n[2]/=n[3];let r=t.bz();r[0]=n[0]-this._cameraPosition[0],r[1]=n[1]-this._cameraPosition[1],r[2]=n[2]-this._cameraPosition[2];let i=t.bz();return t.b2(i,r),i}isSurfacePointVisible(e){let t=this._cachedClippingPlane;return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]>=0}isSurfacePointOnScreen(e){if(!this.isSurfacePointVisible(e))return!1;let n=t.bE();return t.aF(n,[...e,1],this._globeViewProjMatrixNoCorrection),n[0]/=n[3],n[1]/=n[3],n[2]/=n[3],n[0]>-1&&n[0]<1&&n[1]>-1&&n[1]<1&&n[2]>-1&&n[2]<1}rayPlanetIntersection(e,n){let r=t.b4(e,n),i=t.bz(),a=t.bz();t.a_(a,n,r),t.b1(i,e,a);let o=1-t.b4(i,i);if(o<0)return null;let s=t.b4(e,e)-1,c=-r+(r<0?1:-1)*Math.sqrt(o),l=s/c,u=c;return{tMin:Math.min(l,u),tMax:Math.max(l,u)}}unprojectScreenPoint(e){let n=this._cameraPosition,r=this.getRayDirectionFromPixel(e),i=this.rayPlanetIntersection(n,r);if(i){let e=t.bz();t.a$(e,n,[r[0]*i.tMin,r[1]*i.tMin,r[2]*i.tMin]);let a=t.bz();return t.b2(a,e),yn(a)}let a=this._cachedClippingPlane,o=a[0]*r[0]+a[1]*r[1]+a[2]*r[2],s=-t.ba(a,n)/o,c=t.bz();if(s>0)t.a$(c,n,[r[0]*s,r[1]*s,r[2]*s]);else{let e=t.bz();t.a$(e,n,[2*r[0],2*r[1],2*r[2]]);let i=t.ba(this._cachedClippingPlane,e);t.b1(c,e,[this._cachedClippingPlane[0]*i,this._cachedClippingPlane[1]*i,this._cachedClippingPlane[2]*i])}let l=function(e){let n=t.bz();return n[0]=e[0]*-e[3],n[1]=e[1]*-e[3],n[2]=e[2]*-e[3],{center:n,radius:Math.sqrt(1-e[3]*e[3])}}(a);return yn(function(e,n,r){let i=t.bz();t.b1(i,r,e);let a=t.bz();return t.bx(a,e,i,n/t.b8(i)),a}(l.center,l.radius,c))}getMatrixForModel(e,n){let r=t.W.convert(e),i=1/t.bD,a=t.bi();return t.bI(a,a,r.lng/180*Math.PI),t.bg(a,a,-r.lat/180*Math.PI),t.Q(a,a,[0,0,1+n/t.bD]),t.bg(a,a,.5*Math.PI),t.S(a,a,[i,i,i]),a}getProjectionDataForCustomLayer(e=!0){let n=this.getProjectionData({overscaledTileID:new t.a3(0,0,0,0,0),applyGlobeMatrix:e});return n.tileMercatorCoords=[0,0,1,1],n}getFastPathSimpleProjectionMatrix(e){}}class Mn{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(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,t,n){this._helper.interpolatePadding(e,t,n)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,t,n=!0){this._helper.resize(e,t,n)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}setConstrainOverride(e){this._helper.setConstrainOverride(e)}overrideNearFarZ(e,t){this._helper.overrideNearFarZ(e,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}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(e,t){this._globeness=e,this._globeLatitudeErrorCorrectionRadians=t,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(e){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this.defaultConstrain=(e,t)=>this.currentTransform.defaultConstrain(e,t),this.applyConstrain=(e,t)=>this._helper.applyConstrain(e,t),this._helper=new Jt({calcMatrices:()=>this._calcMatrices(),defaultConstrain:(e,t)=>this.defaultConstrain(e,t)},e),this._globeness=1,this._mercatorTransform=new Qt,this._verticalPerspectiveTransform=new jn}clone(){let e=new Mn;return e._globeness=this._globeness,e._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,e.apply(this,!1),e}apply(e,t){this._helper.apply(e,t),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(e){let t=this._mercatorTransform.getProjectionData(e),n=this._verticalPerspectiveTransform.getProjectionData(e);return{mainMatrix:this.isGlobeRendering?n.mainMatrix:t.mainMatrix,clippingPlane:n.clippingPlane,tileMercatorCoords:n.tileMercatorCoords,projectionTransition:e.applyGlobeMatrix?this._globeness:0,fallbackMatrix:t.fallbackMatrix}}isLocationOccluded(e){return this.currentTransform.isLocationOccluded(e)}transformLightDirection(e){return this.currentTransform.transformLightDirection(e)}getPixelScale(){return t.bt(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return t.bt(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(e,n,r){let i=this._mercatorTransform.getPitchedTextCorrection(e,n,r),a=this._verticalPerspectiveTransform.getPitchedTextCorrection(e,n,r);return t.bt(i,a,this._globeness)}projectTileCoordinates(e,t,n,r){return this.currentTransform.projectTileCoordinates(e,t,n,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(e){return this.currentTransform.calculateFogMatrix(e)}getVisibleUnwrappedCoordinates(e){return this.currentTransform.getVisibleUnwrappedCoordinates(e)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(e){this._mercatorTransform.recalculateZoomAndCenter(e),this._verticalPerspectiveTransform.recalculateZoomAndCenter(e)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,t){return this.currentTransform.lngLatToCameraDepth(e,t)}populateCache(e){this._mercatorTransform.populateCache(e),this._verticalPerspectiveTransform.populateCache(e)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(e,t,n,r){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,n,r)}setLocationAtPoint(e,t){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(e,t),void this.apply(this._mercatorTransform,!1);this._verticalPerspectiveTransform.setLocationAtPoint(e,t),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(e,t){return this.currentTransform.locationToScreenPoint(e,t)}screenPointToMercatorCoordinate(e,t){return this.currentTransform.screenPointToMercatorCoordinate(e,t)}screenPointToLocation(e,t){return this.currentTransform.screenPointToLocation(e,t)}isPointOnMapSurface(e,t){return this.currentTransform.isPointOnMapSurface(e,t)}getRayDirectionFromPixel(e){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(e)}getMatrixForModel(e,t){return this.currentTransform.getMatrixForModel(e,t)}getProjectionDataForCustomLayer(e=!0){let t=this._mercatorTransform.getProjectionDataForCustomLayer(e);if(!this.isGlobeRendering)return t;let n=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(e);return n.fallbackMatrix=t.mainMatrix,n}getFastPathSimpleProjectionMatrix(e){return this.currentTransform.getFastPathSimpleProjectionMatrix(e)}}class Nn{get useGlobeControls(){return!0}handlePanInertia(e,n){let r=Sn(e,n);return Math.abs(r.lng-n.center.lng)>180&&(r.lng=n.center.lng+179.5*Math.sign(r.lng-n.center.lng)),{easingCenter:r,easingOffset:new t.P(0,0)}}handleMapControlsRollPitchBearingZoom(e,n){let r=e.around,i=n.screenPointToLocation(r);e.bearingDelta&&n.setBearing(n.bearing+e.bearingDelta),e.pitchDelta&&n.setPitch(n.pitch+e.pitchDelta),e.rollDelta&&n.setRoll(n.roll+e.rollDelta);let a=n.zoom;e.zoomDelta&&n.setZoom(n.zoom+e.zoomDelta);let o=n.zoom-a;if(o===0)return;let s=t.bJ(n.center.lng,i.lng),c=s/(Math.abs(s/180)+1),l=t.bJ(n.center.lat,i.lat),u=n.getRayDirectionFromPixel(r),d=n.cameraPosition,f=-1*t.b4(d,u),p=t.bz();t.a$(p,d,[u[0]*f,u[1]*f,u[2]*f]);let m=t.b6(p)-1,h=Math.exp(.5*-Math.max(m-.3,0)),g=vn(n.worldSize,n.center.lat)/Math.min(n.width,n.height),_=t.bw(g,.9,.5,1,.25),v=(1-t.ao(-o))*Math.min(h,_),y=n.center.lat,b=n.zoom,x=new t.W(n.center.lng+c*v,t.al(n.center.lat+l*v,-t.am,t.am));n.setLocationAtPoint(i,r);let S=n.center,C=t.bw(Math.abs(s),45,85,0,1),w=t.bw(g,.75,.35,0,1),T=Math.max(C,w)**.25,E=t.bJ(S.lng,x.lng),D=t.bJ(S.lat,x.lat);n.setCenter(new t.W(S.lng+E*T,S.lat+D*T).wrap()),n.setZoom(b+xn(y,n.center.lat))}handleMapControlsPan(e,t,n){if(!e.panDelta)return;let r=t.center.lat,i=t.zoom;t.setCenter(Sn(e.panDelta,t).wrap()),t.setZoom(i+xn(r,t.center.lat))}cameraForBoxAndBearing(e,n,r,i,a){let o=tn(e,n,r,i,a),s=n.left/a.width*2-1,c=(a.width-n.right)/a.width*2-1,l=n.top/a.height*-2+1,u=(a.height-n.bottom)/a.height*-2+1,d=t.bJ(r.getWest(),r.getEast())<0,f=d?r.getEast():r.getWest(),p=d?r.getWest():r.getEast(),m=Math.max(r.getNorth(),r.getSouth()),h=Math.min(r.getNorth(),r.getSouth()),g=f+.5*t.bJ(f,p),_=m+.5*t.bJ(m,h),v=a.clone();v.setCenter(o.center),v.setBearing(o.bearing),v.setPitch(0),v.setRoll(0),v.setZoom(o.zoom);let y=v.modelViewProjectionMatrix,b=[_n(r.getNorthWest()),_n(r.getNorthEast()),_n(r.getSouthWest()),_n(r.getSouthEast()),_n(new t.W(p,_)),_n(new t.W(f,_)),_n(new t.W(g,m)),_n(new t.W(g,h))],x=_n(o.center),S=1/0;for(let e of b)s<0&&(S=Nn.getLesserNonNegativeNonNull(S,Nn.solveVectorScale(e,x,y,`x`,s))),c>0&&(S=Nn.getLesserNonNegativeNonNull(S,Nn.solveVectorScale(e,x,y,`x`,c))),l>0&&(S=Nn.getLesserNonNegativeNonNull(S,Nn.solveVectorScale(e,x,y,`y`,l))),u<0&&(S=Nn.getLesserNonNegativeNonNull(S,Nn.solveVectorScale(e,x,y,`y`,u)));if(Number.isFinite(S)&&S!==0)return o.zoom=Math.min(v.zoom+t.ar(S),e.maxZoom),o;$t()}handleJumpToCenterZoom(e,n){let r=e.center.lat,i=e.applyConstrain(n.center?t.W.convert(n.center):e.center,e.zoom).center;e.setCenter(i.wrap());let a=n.zoom===void 0?e.zoom+xn(r,i.lat):+n.zoom;e.zoom!==a&&e.setZoom(a)}handleEaseTo(e,n){let r=e.zoom,i=e.center,a=e.padding,o={roll:e.roll,pitch:e.pitch,bearing:e.bearing},s={roll:n.roll===void 0?e.roll:n.roll,pitch:n.pitch===void 0?e.pitch:n.pitch,bearing:n.bearing===void 0?e.bearing:n.bearing},c=n.zoom!==void 0,l=!e.isPaddingEqual(n.padding),u=!1,d=n.center?t.W.convert(n.center):i,f=e.applyConstrain(d,r).center;Kt(e,f);let p=e.clone();p.setCenter(f),p.setZoom(c?+n.zoom:r+xn(i.lat,d.lat)),p.setBearing(n.bearing);let m=new t.P(t.al(e.centerPoint.x+n.offsetAsPoint.x,0,e.width),t.al(e.centerPoint.y+n.offsetAsPoint.y,0,e.height));p.setLocationAtPoint(f,m);let h=(n.offset&&n.offsetAsPoint.mag())>0?p.center:f,g=c?+n.zoom:r+xn(i.lat,h.lat),_=r+xn(i.lat,0),v=g+xn(h.lat,0),y=t.bJ(i.lng,h.lng),b=t.bJ(i.lat,h.lat),x=t.ao(v-_);return u=g!==r,{easeFunc:r=>{if(t.bn(o,s)||en({startEulerAngles:o,endEulerAngles:s,tr:e,k:r,useSlerp:o.roll!=s.roll}),l&&e.interpolatePadding(a,n.padding,r),n.around)t.w(`Easing around a point is not supported under globe projection.`),e.setLocationAtPoint(n.around,n.aroundPoint);else{let t=wn(i,y,b,r*(v>_?Math.min(2,x):Math.max(.5,x))**(1-r));e.setCenter(t.wrap())}if(u){let n=t.H.number(_,v,r)+xn(0,e.center.lat);e.setZoom(n)}},isZooming:u,elevationCenter:h}}handleFlyTo(e,n){let r=n.zoom!==void 0,i=e.center,a=e.zoom,o=e.padding,s=!e.isPaddingEqual(n.padding),c=e.applyConstrain(t.W.convert(n.center||n.locationAtOffset),a).center,l=r?+n.zoom:e.zoom+xn(e.center.lat,c.lat),u=e.clone();u.setCenter(c),u.setZoom(l),u.setBearing(n.bearing);let d=new t.P(t.al(e.centerPoint.x+n.offsetAsPoint.x,0,e.width),t.al(e.centerPoint.y+n.offsetAsPoint.y,0,e.height));u.setLocationAtPoint(c,d);let f=u.center;Kt(e,f);let p=function(e,n,r){let i=_n(n),a=_n(r),o=t.b4(i,a),s=Math.acos(o),c=hn(e);return s/(2*Math.PI)*c}(e,i,f),m=a+xn(i.lat,0),h=l+xn(f.lat,0),g=t.ao(h-m),_;if(typeof n.minZoom==`number`){let r=+n.minZoom+xn(f.lat,0),i=Math.min(r,m,h)+xn(0,f.lat),a=e.applyConstrain(f,i).zoom+xn(f.lat,0);_=t.ao(a-m)}let v=t.bJ(i.lng,f.lng),y=t.bJ(i.lat,f.lat);return{easeFunc:(r,a,c,u)=>{let d=wn(i,v,y,c);s&&e.interpolatePadding(o,n.padding,r);let p=r===1?f:d;e.setCenter(p.wrap());let h=m+t.ar(a);e.setZoom(r===1?l:h+xn(0,p.lat))},scaleOfZoom:g,targetCenter:f,scaleOfMinZoom:_,pixelPathLength:p}}static solveVectorScale(e,t,n,r,i){let a=r===`x`?[n[0],n[4],n[8],n[12]]:[n[1],n[5],n[9],n[13]],o=[n[3],n[7],n[11],n[15]],s=e[0]*a[0]+e[1]*a[1]+e[2]*a[2],c=e[0]*o[0]+e[1]*o[1]+e[2]*o[2],l=t[0]*a[0]+t[1]*a[1]+t[2]*a[2],u=t[0]*o[0]+t[1]*o[1]+t[2]*o[2];return l+i*c===s+i*u||o[3]*(s-l)+a[3]*(u-c)+s*u==l*c?null:(l+a[3]-i*u-i*o[3])/(l-s-i*u+i*c)}static getLesserNonNegativeNonNull(e,t){return t!==null&&t>=0&&t<e?t:e}}class Pn{constructor(e){this._globe=e,this._mercatorCameraHelper=new nn,this._verticalPerspectiveCameraHelper=new Nn}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(e,t){return this.currentHelper.handlePanInertia(e,t)}handleMapControlsRollPitchBearingZoom(e,t){this.currentHelper.handleMapControlsRollPitchBearingZoom(e,t)}handleMapControlsPan(e,t,n){this.currentHelper.handleMapControlsPan(e,t,n)}cameraForBoxAndBearing(e,t,n,r,i){return this.currentHelper.cameraForBoxAndBearing(e,t,n,r,i)}handleJumpToCenterZoom(e,t){this.currentHelper.handleJumpToCenterZoom(e,t)}handleEaseTo(e,t){return this.currentHelper.handleEaseTo(e,t)}handleFlyTo(e,t){return this.currentHelper.handleFlyTo(e,t)}}let Fn=(e,n)=>t.C(e,n?.filter((e=>e.identifier!==`source.canvas`))),In=t.bN();class Ln extends t.E{constructor(e,n={}){super(),this._rtlPluginLoaded=()=>{for(let e in this.tileManagers){let t=this.tileManagers[e].getSource().type;t!==`vector`&&t!==`geojson`||this.tileManagers[e].reload()}},this.map=e,this.dispatcher=new te(M(),e._getMapId()),this.dispatcher.registerMessageHandler(`GG`,((e,t)=>this.getGlyphs(e,t))),this.dispatcher.registerMessageHandler(`GI`,((e,t)=>this.getImages(e,t))),this.dispatcher.registerMessageHandler(`GDA`,((e,t)=>this.getDashes(e,t))),this.imageManager=new g,this.imageManager.setEventedParent(this);let r=e._container?.lang||typeof document<`u`&&document.documentElement?.lang||void 0;this.glyphManager=new x(e._requestManager,n.localIdeographFontFamily,r),this.lineAtlas=new D(256,512),this.crossTileSymbolIndex=new Rt,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast(`SR`,t.bO()),De().on(we,this._rtlPluginLoaded),this.on(`data`,(e=>{if(e.dataType!==`source`||e.sourceDataType!==`metadata`)return;let t=this.tileManagers[e.sourceId];if(!t)return;let n=t.getSource();if(n?.vectorLayerIds)for(let e in this._layers){let t=this._layers[e];t.source===n.id&&this._validateLayer(t)}}))}_setInitialValues(){this._spritesImagesIds={},this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new t.bP,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(this.crossTileSymbolIndex?.constructor||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(e,n){this._checkLoaded();let r=n===null?this.stylesheet.state?.[e]?.default??null:n;if(t.bQ(r,this._globalState[e]))return this;this._globalState[e]=r,this._applyGlobalStateChanges([e])}getGlobalState(){return this._globalState}setGlobalState(e){this._checkLoaded();let n=[];for(let r in e)!t.bQ(this._globalState[r],e[r].default)&&(n.push(r),this._globalState[r]=e[r].default);this._applyGlobalStateChanges(n)}_applyGlobalStateChanges(e){if(e.length===0)return;let t=new Set,n={};for(let r of e){n[r]=this._globalState[r];for(let e in this._layers){let n=this._layers[e],i=n.getLayoutAffectingGlobalStateRefs(),a=n.getPaintAffectingGlobalStateRefs(),o=n.getVisibilityAffectingGlobalStateRefs();if(i.has(r)&&t.add(n.source),a.has(r))for(let{name:e,value:t}of a.get(r))this._updatePaintProperty(n,e,t);o!=null&&o.has(r)&&(n.recalculateVisibility(),this._updateLayer(n))}}this.dispatcher.broadcast(`UGS`,n);for(let e in this.tileManagers)t.has(e)&&(this._reloadSource(e),this._changed=!0)}loadURL(e){return t._(this,arguments,void 0,(function*(e,n={},r){this.fire(new t.n(`dataloading`,{dataType:`style`})),n.validate=typeof n.validate!=`boolean`||n.validate,this._loadStyleRequest=new AbortController;let i=this._loadStyleRequest;try{let a=yield this.map._requestManager.transformRequest(e,`Style`);t.bR(i.signal);let o=yield t.k(a,i);this._loadStyleRequest===i&&(this._loadStyleRequest=null),this._load(o.data,n,r)}catch(e){this._loadStyleRequest===i&&(this._loadStyleRequest=null),e&&!i.signal.aborted&&this.fire(new t.l(t.d(e)))}}))}loadJSON(e,n={},r){this.fire(new t.n(`dataloading`,{dataType:`style`})),this._frameRequest=new AbortController,s.frameAsync(this._frameRequest,this.map._ownerWindow).then((()=>{this._frameRequest=null,n.validate=!1!==n.validate,this._load(e,n,r)})).catch((()=>{}))}loadEmpty(){this.fire(new t.n(`dataloading`,{dataType:`style`})),this._load(In,{validate:!1})}_load(e,n,r){let i=n.transformStyle?n.transformStyle(r,e):e;if(!n.validate||!Fn(this,t.F(i))){i=Object.assign({},i),this._loaded=!0,this.stylesheet=i;for(let e in i.sources)this.addSource(e,i.sources[e],{validate:!1});i.sprite?this._loadSprite(i.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(i.glyphs),this._createLayers(),this.light=new w(this.stylesheet.light),this._setProjectionInternal(this.stylesheet.projection?.type||`mercator`),this.sky=new E(this.stylesheet.sky),this.map.setTerrain(this.stylesheet.terrain??null),this.fire(new t.n(`data`,{dataType:`style`})),this.fire(new t.n(`style.load`))}}_createLayers(){let e=t.bS(this.stylesheet.layers);this.setGlobalState(this.stylesheet.state??null),this.dispatcher.broadcast(`SL`,e),this._order=e.map((e=>e.id)),this._layers={},this._serializedLayers=null;for(let n of e){let e=t.bT(n,this._globalState);if(e.setEventedParent(this,{layer:{id:n.id}}),this._layers[n.id]=e,t.bU(e)&&this.tileManagers[e.source]){let t=n.paint?.[`raster-fade-duration`]??e.paint.get(`raster-fade-duration`);this.tileManagers[e.source].setRasterFadeDuration(t)}}}_loadSprite(e,n=!1,r=void 0){this.imageManager.setLoaded(!1);let i=new AbortController,a;this._spriteRequest=i,function(e,n,r,i){return t._(this,void 0,void 0,(function*(){let a=p(e),o=r>1?`@2x`:``,c={},l={};for(let{id:e,url:r}of a){let a=yield n.transformRequest(m(r,o,`.json`),`SpriteJSON`);c[e]=t.k(a,i);let s=yield n.transformRequest(m(r,o,`.png`),`SpriteImage`);l[e]=u.getImage(s,i)}return yield Promise.all([...Object.values(c),...Object.values(l)]),function(e,n){return t._(this,void 0,void 0,(function*(){let t={};for(let r in e){t[r]={};let i=s.getImageCanvasContext((yield n[r]).data),a=(yield e[r]).data;for(let e in a){let{width:n,height:o,x:s,y:c,sdf:l,pixelRatio:u,stretchX:d,stretchY:f,content:p,textFitWidth:m,textFitHeight:h}=a[e];t[r][e]={data:null,pixelRatio:u,sdf:l,stretchX:d,stretchY:f,content:p,textFitWidth:m,textFitHeight:h,spriteData:{width:n,height:o,x:s,y:c,context:i}}}}return t}))}(c,l)}))}(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((e=>{if(this._spriteRequest=null,e)for(let t in e){this._spritesImagesIds[t]=[];let r=this._spritesImagesIds[t]?this._spritesImagesIds[t].filter((t=>!(t in e))):[];for(let e of r)this.imageManager.removeImage(e),this._changedImages[e]=!0;for(let r in e[t]){let i=t==="default"?r:`${t}:${r}`;this._spritesImagesIds[t].push(i),i in this.imageManager.images?this.imageManager.updateImage(i,e[t][r],!1):this.imageManager.addImage(i,e[t][r]),n&&(this._changedImages[i]=!0)}}})).catch((e=>{this._spriteRequest=null,a=e,i.signal.aborted||this.fire(new t.l(a))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast(`SI`,this._availableImages),this.fire(new t.n(`data`,{dataType:`style`})),r&&r(a)}))}_unloadSprite(){for(let e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast(`SI`,this._availableImages),this.fire(new t.n(`data`,{dataType:`style`}))}_validateLayer(e){let n=this.tileManagers[e.source];if(!n)return;let r=e.sourceLayer;if(!r)return;let i=n.getSource();(i.type===`geojson`||i.vectorLayerIds&&!i.vectorLayerIds.includes(r))&&this.fire(new t.l(Error(`Source layer "${r}" does not exist on source "${i.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let e in this.tileManagers)if(!this.tileManagers[e].loaded())return!1;return this.imageManager.isLoaded()}_serializeByIds(e,n=!1){let r=this._serializedAllLayers();if(!e||e.length===0)return Object.values(n?t.bV(r):r);let i=[];for(let a of e)if(r[a]){let e=n?t.bV(r[a]):r[a];i.push(e)}return i}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};let t=Object.keys(this._layers);for(let n of t){let t=this._layers[n];t.type!==`custom`&&(e[n]=t.serialize())}return e}hasTransitions(){if(this.light?.hasTransition()||this.sky?.hasTransition()||this.projection?.hasTransition())return!0;for(let e in this.tileManagers)if(this.tileManagers[e].hasTransition())return!0;for(let e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw Error(`Style is not done loading.`)}update(e){if(!this._loaded)return;let n=this._changed;if(n){let t=Object.keys(this._updatedLayers),n=Object.keys(this._removedLayers);(t.length||n.length)&&this._updateWorkerLayers(t,n);for(let e in this._updatedSources){let t=this._updatedSources[e];if(t===`reload`)this._reloadSource(e);else{if(t!==`clear`)throw Error(`Invalid action ${t}`);this._clearSource(e)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let t in this._updatedPaintProps)this._layers[t].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}let r={};for(let e in this.tileManagers){let t=this.tileManagers[e];r[e]=t.used,t.used=!1}for(let t of this._order){let n=this._layers[t];n.recalculate(e,this._availableImages),!n.isHidden(e.zoom)&&n.source&&(this.tileManagers[n.source].used=!0)}for(let e in r){let n=this.tileManagers[e];!!r[e]!=!!n.used&&n.fire(new t.n(`data`,{sourceDataType:`visibility`,dataType:`source`,sourceId:e}))}this.light.recalculate(e),this.sky.recalculate(e),this.projection.recalculate(e),this.z=e.zoom,n&&this.fire(new t.n(`data`,{dataType:`style`}))}_updateTilesForChangedImages(){let e=Object.keys(this._changedImages);if(e.length){for(let t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies([`icons`,`patterns`],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let e in this.tileManagers)this.tileManagers[e].reloadTilesForDependencies([`glyphs`],[``]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,t){this.dispatcher.broadcast(`UL`,{layers:this._serializeByIds(e,!1),removedIds:t})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,n={}){var r;this._checkLoaded();let i=this.serialize();if(e=n.transformStyle?n.transformStyle(i,e):e,((r=n.validate)==null||r)&&Fn(this,t.F(e)))return!1;(e=t.bV(e)).layers=t.bS(e.layers);let a=t.bW(i,e),o=this._getOperationsToPerform(a);if(o.unimplemented.length>0)throw Error(`Unimplemented: ${o.unimplemented.join(`, `)}.`);if(o.operations.length===0)return!1;for(let e of o.operations)e();return this.stylesheet=e,this._serializedLayers=null,this.fire(new t.n(`style.load`,{style:this})),!0}_getOperationsToPerform(e){let t=[],n=[];for(let r of e)switch(r.command){case`setCenter`:case`setZoom`:case`setBearing`:case`setPitch`:case`setRoll`:continue;case`addLayer`:t.push((()=>this.addLayer.apply(this,r.args)));break;case`removeLayer`:t.push((()=>this.removeLayer.apply(this,r.args)));break;case`setPaintProperty`:t.push((()=>this.setPaintProperty.apply(this,r.args)));break;case`setLayoutProperty`:t.push((()=>this.setLayoutProperty.apply(this,r.args)));break;case`setFilter`:t.push((()=>this.setFilter.apply(this,r.args)));break;case`addSource`:t.push((()=>this.addSource.apply(this,r.args)));break;case`removeSource`:t.push((()=>this.removeSource.apply(this,r.args)));break;case`setLayerZoomRange`:t.push((()=>this.setLayerZoomRange.apply(this,r.args)));break;case`setLight`:t.push((()=>this.setLight.apply(this,r.args)));break;case`setGeoJSONSourceData`:t.push((()=>this.setGeoJSONSourceData.apply(this,r.args)));break;case`setGlyphs`:t.push((()=>this.setGlyphs.apply(this,r.args)));break;case`setSprite`:t.push((()=>this.setSprite.apply(this,r.args)));break;case`setTerrain`:t.push((()=>this.map.setTerrain.apply(this,r.args)));break;case`setSky`:t.push((()=>this.setSky.apply(this,r.args)));break;case`setProjection`:this.setProjection.apply(this,r.args);break;case`setGlobalState`:t.push((()=>this.setGlobalState.apply(this,r.args)));break;case`setTransition`:t.push((()=>{}));break;default:n.push(r.command)}return{operations:t,unimplemented:n}}addImage(e,n){if(this.getImage(e))return this.fire(new t.l(Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,n),this._afterImageUpdated(e)}updateImage(e,t){this.imageManager.updateImage(e,t)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new t.l(Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast(`SI`,this._availableImages),this.fire(new t.n(`data`,{dataType:`style`}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,n,r={}){var i;if(this._checkLoaded(),this.tileManagers[e]!==void 0)throw Error(`Source "${e}" already exists.`);if(!n.type)throw Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(`, `)}.`);if([`vector`,`raster`,`geojson`,`video`,`image`].includes(n.type)&&this._validate(t.F.source,`sources.${e}`,n,null,r))return;(i=this.map)!=null&&i._collectResourceTiming&&(n.collectResourceTiming=!0);let a=this.tileManagers[e]=new Xe(e,n,this.dispatcher);a.style=this,a.setEventedParent(this,(()=>({isSourceLoaded:a.loaded(),source:a.serialize(),sourceId:e}))),a.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.tileManagers[e]===void 0)throw Error(`There is no source with this ID=${e}`);for(let n in this._layers)if(this._layers[n].source===e)return this.fire(new t.l(Error(`Source "${e}" cannot be removed while layer "${n}" is using it.`)));let n=this.tileManagers[e];delete this.tileManagers[e],delete this._updatedSources[e],n.fire(new t.n(`data`,{sourceDataType:`metadata`,dataType:`source`,sourceId:e})),n.setEventedParent(null),n.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,t){if(this._checkLoaded(),this.tileManagers[e]===void 0)throw Error(`There is no source with this ID=${e}`);let n=this.tileManagers[e].getSource();if(n.type!==`geojson`)throw Error(`geojsonSource.type is ${n.type}, which is !== 'geojson`);n.setData(t),this._changed=!0}getSource(e){return this.tileManagers[e]?.getSource()}addLayer(e,n,r={}){this._checkLoaded();let i=e.id;if(this.getLayer(i))return void this.fire(new t.l(Error(`Layer "${i}" already exists on this map.`)));let a;if(e.type===`custom`){if(Fn(this,t.bX(e)))return;a=t.bT(e,this._globalState)}else{if(`source`in e&&typeof e.source==`object`&&(this.addSource(i,e.source),e=t.bV(e),e=t.e(e,{source:i})),this._validate(t.F.layer,`layers.${i}`,e,{arrayIndex:-1},r))return;a=t.bT(e,this._globalState),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}})}let o=n?this._order.indexOf(n):this._order.length;if(n&&o===-1)this.fire(new t.l(Error(`Cannot add layer "${i}" before non-existing layer "${n}".`)));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&a.type!==`custom`){let e=this._removedLayers[i];delete this._removedLayers[i],e.type===a.type?(this._updatedSources[a.source]=`reload`,this.tileManagers[a.source].pause()):this._updatedSources[a.source]=`clear`}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}moveLayer(e,n){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new t.l(Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===n)return;let r=this._order.indexOf(e);this._order.splice(r,1);let i=n?this._order.indexOf(n):this._order.length;n&&i===-1?this.fire(new t.l(Error(`Cannot move layer "${e}" before non-existing layer "${n}".`))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();let n=this._layers[e];if(!n)return void this.fire(new t.l(Error(`Cannot remove non-existing layer "${e}".`)));n.setEventedParent(null);let r=this._order.indexOf(e);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=n,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],n.onRemove&&n.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,n,r){this._checkLoaded();let i=this.getLayer(e);i?i.minzoom===n&&i.maxzoom===r||(n!=null&&(i.minzoom=n),r!=null&&(i.maxzoom=r),this._updateLayer(i)):this.fire(new t.l(Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,n,r={}){this._checkLoaded();let i=this.getLayer(e);if(i){if(!t.bQ(i.filter,n))return n==null?(i.setFilter(void 0),void this._updateLayer(i)):void(this._validate(t.F.filter,`layers.${i.id}.filter`,n,null,r)||(i.setFilter(t.bV(n)),this._updateLayer(i)))}else this.fire(new t.l(Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return t.bV(this.getLayer(e).filter)}setLayoutProperty(e,n,r,i={}){this._checkLoaded();let a=this.getLayer(e);a?t.bQ(a.getLayoutProperty(n),r)||(a.setLayoutProperty(n,r,i),this._updateLayer(a)):this.fire(new t.l(Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,n){let r=this.getLayer(e);if(r)return r.getLayoutProperty(n);this.fire(new t.l(Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,n,r,i={}){this._checkLoaded();let a=this.getLayer(e);a?t.bQ(a.getPaintProperty(n),r)||this._updatePaintProperty(a,n,r,i):this.fire(new t.l(Error(`Cannot style non-existing layer "${e}".`)))}_updatePaintProperty(e,n,r,i={}){e.setPaintProperty(n,r,i)&&this._updateLayer(e),t.bU(e)&&n===`raster-fade-duration`&&this.tileManagers[e.source].setRasterFadeDuration(r),this._changed=!0,this._updatedPaintProps[e.id]=!0,this._serializedLayers=null}getPaintProperty(e,t){return this.getLayer(e).getPaintProperty(t)}setFeatureState(e,n){this._checkLoaded();let r=e.source,i=e.sourceLayer,a=this.tileManagers[r];if(a===void 0)return void this.fire(new t.l(Error(`The source '${r}' does not exist in the map's style.`)));let o=a.getSource().type;o===`geojson`&&i?this.fire(new t.l(Error(`GeoJSON sources cannot have a sourceLayer parameter.`))):o!==`vector`||i?(e.id===void 0&&this.fire(new t.l(Error(`The feature id parameter must be provided.`))),a.setFeatureState(i,e.id,n)):this.fire(new t.l(Error(`The sourceLayer parameter must be provided for vector source types.`)))}removeFeatureState(e,n){this._checkLoaded();let r=e.source,i=this.tileManagers[r];if(i===void 0)return void this.fire(new t.l(Error(`The source '${r}' does not exist in the map's style.`)));let a=i.getSource().type,o=a===`vector`?e.sourceLayer:void 0;a!==`vector`||o?n&&typeof e.id!=`string`&&typeof e.id!=`number`?this.fire(new t.l(Error(`A feature id is required to remove its specific state property.`))):i.removeFeatureState(o,e.id,n):this.fire(new t.l(Error(`The sourceLayer parameter must be provided for vector source types.`)))}getFeatureState(e){this._checkLoaded();let n=e.source,r=e.sourceLayer,i=this.tileManagers[n];if(i!==void 0)return i.getSource().type!==`vector`||r?(e.id===void 0&&this.fire(new t.l(Error(`The feature id parameter must be provided.`))),i.getFeatureState(r,e.id)):void this.fire(new t.l(Error(`The sourceLayer parameter must be provided for vector source types.`)));this.fire(new t.l(Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return t.e({duration:300,delay:0},this.stylesheet?.transition)}serialize(){if(!this._loaded)return;let e=t.bY(this.tileManagers,(e=>e.serialize())),n=this._serializeByIds(this._order,!0),r=this.map.getTerrain()||void 0,i=this.stylesheet;return t.bZ({version:i.version,name:i.name,metadata:i.metadata,light:i.light,sky:i.sky,center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,sprite:i.sprite,glyphs:i.glyphs,transition:i.transition,projection:i.projection,sources:e,layers:n,terrain:r},(e=>e!==void 0))}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.tileManagers[e.source].getSource().type!==`raster`&&(this._updatedSources[e.source]=`reload`,this.tileManagers[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){let t=e=>this._layers[e].type===`fill-extrusion`,n={},r=[];for(let i=this._order.length-1;i>=0;i--){let a=this._order[i];if(t(a)){n[a]=i;for(let t of e){let e=t[a];if(e)for(let t of e)r.push(t)}}}r.sort(((e,t)=>t.intersectionZ-e.intersectionZ));let i=[];for(let a=this._order.length-1;a>=0;a--){let o=this._order[a];if(t(o))for(let e=r.length-1;e>=0;e--){let t=r[e].feature;if(n[t.layer.id]<a)break;i.push(t),r.pop()}else for(let t of e){let e=t[o];if(e)for(let t of e)i.push(t.feature)}}return i}queryRenderedFeatures(e,n,r){n!=null&&n.filter&&this._validate(t.F.filter,`queryRenderedFeatures.filter`,n.filter,null,n);let i={};if(n?.layers){if(!(Array.isArray(n.layers)||n.layers instanceof Set))return this.fire(new t.l(Error(`parameters.layers must be an Array or a Set of strings`))),[];for(let e of n.layers){let n=this._layers[e];if(!n)return this.fire(new t.l(Error(`The layer '${e}' does not exist in the map's style and cannot be queried for features.`))),[];i[n.source]=!0}}let a=[];n.availableImages=this._availableImages;let o=this._serializedAllLayers(),s=n.layers instanceof Set?n.layers:Array.isArray(n.layers)?new Set(n.layers):null,c=Object.assign(Object.assign({},n),{layers:s,globalState:this._globalState});for(let t in this.tileManagers)n.layers&&!i[t]||a.push(re(this.tileManagers[t],this._layers,o,e,c,r,this.map.terrain?(e,t,n)=>this.map.terrain.getElevation(e,t,n):void 0));return this.placement&&a.push(function(e,t,n,r,i,a,o){let s={},c=a.queryRenderedSymbols(r),l=[];for(let e of Object.keys(c).map(Number))l.push(o[e]);l.sort(ie);for(let n of l){let r=n.featureIndex.lookupSymbolFeatures(c[n.bucketInstanceId],t,n.bucketIndex,n.sourceLayerIndex,{filterSpec:i.filter,globalState:i.globalState},i.layers,i.availableImages,e);for(let e in r){let t=s[e]=s[e]||[],i=r[e];i.sort(((e,t)=>{let r=n.featureSortOrder;if(r){let n=r.indexOf(e.featureIndex);return r.indexOf(t.featureIndex)-n}return t.featureIndex-e.featureIndex}));for(let e of i)t.push(e)}}return function(e,t,n){for(let r in e)for(let i of e[r])ae(i,n[t[r].source]);return e}(s,e,n)}(this._layers,o,this.tileManagers,e,c,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(e,n){n!=null&&n.filter&&this._validate(t.F.filter,`querySourceFeatures.filter`,n.filter,null,n);let r=this.tileManagers[e];return r?function(e,t){let n=e.getRenderableIds().map((t=>e.getTileByID(t))),r=[],i={};for(let e of n){let n=e.tileID.canonical.key;i[n]||(i[n]=!0,e.querySourceFeatures(r,t))}return r}(r,n?Object.assign(Object.assign({},n),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(e,n={}){this._checkLoaded();let r=this.light.getLight(),i=!1;for(let n in e)if(!t.bQ(e[n],r[n])){i=!0;break}if(!i)return;let a={now:l(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,n),this.light.updateTransitions(a)}getProjection(){return this.stylesheet?.projection}setProjection(e){this._checkLoaded();let t=e??{type:`mercator`};if(this.stylesheet.projection=e,this.projection){if(this.projection.name===t.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(t.type)}getSky(){return this.stylesheet?.sky}setSky(e,n={}){this._checkLoaded();let r=this.getSky(),i=!1;if(!e&&!r)return;if(e&&!r)i=!0;else if(!e&&r)i=!0;else for(let n in e)if(!t.bQ(e[n],r[n])){i=!0;break}if(!i)return;let a={now:l(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,n),this.sky.updateTransitions(a)}_setProjectionInternal(e){let n=function(e,n){let r={constrainOverride:n};if(Array.isArray(e)){let t=new mn({type:e});return{projection:t,transform:new Mn(r),cameraHelper:new Pn(t)}}switch(e){case`mercator`:return{projection:new Wt,transform:new Qt(r),cameraHelper:new nn};case`globe`:{let e=new mn({type:[`interpolate`,[`linear`],[`zoom`],11,`vertical-perspective`,12,`mercator`]});return{projection:e,transform:new Mn(r),cameraHelper:new Pn(e)}}case`vertical-perspective`:return{projection:new fn,transform:new jn(r),cameraHelper:new Nn};default:return t.w(`Unknown projection name: ${e}. Falling back to mercator projection.`),{projection:new Wt,transform:new Qt(r),cameraHelper:new nn}}}(e,this.map.transformConstrain);this.projection=n.projection,this.map.migrateProjection(n.transform,n.cameraHelper);for(let e in this.tileManagers)this.tileManagers[e].reload()}_validate(e,n,r,i,a={}){return!1!==a?.validate&&Fn(this,e.call(t.F,t.e({key:n,style:this.serialize(),value:r,styleSpec:t.x},i)))}_remove(e=!0){this._frameRequest&&=(this._frameRequest.abort(),null),this._loadStyleRequest&&=(this._loadStyleRequest.abort(),null),this._spriteRequest&&=(this._spriteRequest.abort(),null),De().off(we,this._rtlPluginLoaded);for(let e in this._layers)this._layers[e].setEventedParent(null);for(let e in this.tileManagers){let t=this.tileManagers[e];t.setEventedParent(null),t.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast(`RM`,void 0),this.dispatcher.remove(e)}_clearSource(e){this.tileManagers[e].clearTiles()}_reloadSource(e){this.tileManagers[e].resume(),this.tileManagers[e].reload()}_updateSources(e){for(let t in this.tileManagers)this.tileManagers[t].update(e,this.map.terrain)}_generateCollisionBoxes(){for(let e in this.tileManagers)this._reloadSource(e)}_updatePlacement(e,t,n,r,i=!1){let a=!1,o=!1,s={};for(let t of this._order){let n=this._layers[t];if(n.type!==`symbol`)continue;if(!s[n.source]){let e=this.tileManagers[n.source];s[n.source]=e.getRenderableIds(!0).map((t=>e.getTileByID(t))).sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)))}let r=this.crossTileSymbolIndex.addLayer(n,s[n.source],e.center.lng);a||=r}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((i=i||this._layerOrderChanged||n===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(l(),e.zoom))&&(this.pauseablePlacement=new Nt(e,this.map.terrain,this._order,i,t,n,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(l()),o=!0),a&&this.pauseablePlacement.placement.setStale()),o||a)for(let e of this._order){let t=this._layers[e];t.type===`symbol`&&this.placement.updateLayerOpacities(t,s[t.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(l())}_releaseSymbolFadeTiles(){for(let e in this.tileManagers)this.tileManagers[e].releaseSymbolFadeTiles()}getImages(e,n){return t._(this,void 0,void 0,(function*(){let e=yield this.imageManager.getImages(n.icons);this._updateTilesForChangedImages();let t=this.tileManagers[n.source];return t&&t.setDependencies(n.tileID.key,n.type,n.icons),e}))}getGlyphs(e,n){return t._(this,void 0,void 0,(function*(){let e=yield this.glyphManager.getGlyphs(n.stacks),t=this.tileManagers[n.source];return t&&t.setDependencies(n.tileID.key,n.type,[``]),e}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,n={}){this._checkLoaded(),e&&this._validate(t.F.glyphs,`glyphs`,e,null,n)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}getDashes(e,n){return t._(this,void 0,void 0,(function*(){let e={};for(let[t,r]of Object.entries(n.dashes))e[t]=this.lineAtlas.getDash(r.dasharray,r.round);return e}))}addSprite(e,n,r={},i){this._checkLoaded();let a=[{id:e,url:n}],o=[...p(this.stylesheet.sprite),...a];this._validate(t.F.sprite,`sprite`,o,null,r)||(this.stylesheet.sprite=o,this._loadSprite(a,!0,i))}removeSprite(e){this._checkLoaded();let n=p(this.stylesheet.sprite);if(n.find((t=>t.id===e))){if(this._spritesImagesIds[e])for(let t of this._spritesImagesIds[e])this.imageManager.removeImage(t),this._changedImages[t]=!0;n.splice(n.findIndex((t=>t.id===e)),1),this.stylesheet.sprite=n.length>0?n:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast(`SI`,this._availableImages),this.fire(new t.n(`data`,{dataType:`style`}))}else this.fire(new t.l(Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return p(this.stylesheet.sprite)}setSprite(e,n={},r){this._checkLoaded(),e&&this._validate(t.F.sprite,`sprite`,e,null,n)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,r):(this._unloadSprite(),r&&r(null)))}destroy(){this._frameRequest&&=(this._frameRequest.abort(),null),this._loadStyleRequest&&=(this._loadStyleRequest.abort(),null),this._spriteRequest&&=(this._spriteRequest.abort(),null);for(let e in this.tileManagers){let t=this.tileManagers[e];t.setEventedParent(null),t.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this._availableImages=[],this._spritesImagesIds={}),this.glyphManager&&this.glyphManager.destroy();for(let e in this._layers){let t=this._layers[e];t.setEventedParent(null),t.onRemove&&t.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 Rn=t.aT([{name:`a_pos`,type:`Int16`,components:2},{name:`a_texture_pos`,type:`Int16`,components:2}]);class zn{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,n,r,i,a,o,s,c){this.context=e;let l=this.boundPaintVertexBuffers.length!==r.length;for(let e=0;!l&&e<r.length;e++)this.boundPaintVertexBuffers[e]!==r[e]&&(l=!0);!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==n||l||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==c?this.freshBind(t,n,r,i,a,o,s,c):(e.bindVertexArray.set(this.vao),o&&o.bind(),i!=null&&i.dynamicDraw&&i.bind(),s&&s.bind(),c&&c.bind())}freshBind(e,t,n,r,i,a,o,s){let c=e.numAttributes,l=this.context,u=l.gl;this.vao&&this.destroy(),this.vao=l.createVertexArray(),l.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=r,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o,this.boundDynamicVertexBuffer3=s,t.enableAttributes(u,e);for(let t of n)t.enableAttributes(u,e);a&&a.enableAttributes(u,e),o&&o.enableAttributes(u,e),s&&s.enableAttributes(u,e),t.bind(),t.setVertexAttribPointers(u,e,i);for(let t of n)t.bind(),t.setVertexAttribPointers(u,e,i);a&&(a.bind(),a.setVertexAttribPointers(u,e,i)),r&&r.bind(),o&&(o.bind(),o.setVertexAttribPointers(u,e,i)),s&&(s.bind(),s.setVertexAttribPointers(u,e,i)),l.currentNumAttributes=c}destroy(){this.vao&&=(this.context.deleteVertexArray(this.vao),null)}}let Bn=(e,n,r,i,a)=>({u_texture:0,u_ele_delta:e,u_fog_matrix:n,u_fog_color:r?r.properties.get(`fog-color`):t.bo.white,u_fog_ground_blend:r?r.properties.get(`fog-ground-blend`):1,u_fog_ground_blend_opacity:a?0:r?r.calculateFogBlendOpacity(i):0,u_horizon_color:r?r.properties.get(`horizon-color`):t.bo.white,u_horizon_fog_blend:r?r.properties.get(`horizon-fog-blend`):1,u_is_globe_mode:+!!a}),Vn={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 Hn(e){let t=[];for(let n of e){if(n===null)continue;let e=n.split(` `);t.push(e.pop())}return t}class Un{constructor(e,n,r,i,a,o,s,c,l=[]){let u=e.gl;this.program=u.createProgram();let d=Hn(n.staticAttributes),f=r?r.getBinderAttributes():[],p=d.concat(f),m=V.prelude.staticUniforms?Hn(V.prelude.staticUniforms):[],h=s.staticUniforms?Hn(s.staticUniforms):[],g=n.staticUniforms?Hn(n.staticUniforms):[],_=r?r.getBinderUniforms():[],v=m.concat(h).concat(g).concat(_),y=[];for(let e of v)y.includes(e)||y.push(e);let b=r?r.defines():[];sn(u)&&b.unshift(`#version 300 es`),a&&b.push(`#define OVERDRAW_INSPECTOR;`),o&&b.push(`#define TERRAIN3D;`),c&&b.push(c),l&&b.push(...l);let x=b.concat(V.prelude.fragmentSource,s.fragmentSource,n.fragmentSource).join(`
752
+ `),S=b.concat(V.prelude.vertexSource,s.vertexSource,n.vertexSource).join(`
753
+ `);sn(u)||(x=function(e){return e.replace(/\bin\s/g,`varying `).replace(`out highp vec4 fragColor;`,``).replace(/fragColor/g,`gl_FragColor`).replace(/texture\(/g,`texture2D(`)}(x),S=function(e){return e.replace(/\bin\s/g,`attribute `).replace(/\bout\s/g,`varying `).replace(/texture\(/g,`texture2D(`)}(S));let C=u.createShader(u.FRAGMENT_SHADER);if(u.isContextLost())return void(this.failedToCreate=!0);if(u.shaderSource(C,x),u.compileShader(C),!u.getShaderParameter(C,u.COMPILE_STATUS))throw Error(`Could not compile fragment shader: ${u.getShaderInfoLog(C)}`);u.attachShader(this.program,C);let w=u.createShader(u.VERTEX_SHADER);if(u.isContextLost())return void(this.failedToCreate=!0);if(u.shaderSource(w,S),u.compileShader(w),!u.getShaderParameter(w,u.COMPILE_STATUS))throw Error(`Could not compile vertex shader: ${u.getShaderInfoLog(w)}`);u.attachShader(this.program,w),this.attributes={};let T={};this.numAttributes=p.length;for(let e=0;e<this.numAttributes;e++)p[e]&&(u.bindAttribLocation(this.program,e,p[e]),this.attributes[p[e]]=e);if(u.linkProgram(this.program),!u.getProgramParameter(this.program,u.LINK_STATUS))throw Error(`Program failed to link: ${u.getProgramInfoLog(this.program)}`);u.deleteShader(w),u.deleteShader(C);for(let e of y)if(e&&!T[e]){let t=u.getUniformLocation(this.program,e);t&&(T[e]=t)}this.fixedUniforms=i(e,T),this.terrainUniforms=((e,n)=>({u_depth:new t.b_(e,n.u_depth),u_terrain:new t.b_(e,n.u_terrain),u_terrain_dim:new t.bp(e,n.u_terrain_dim),u_terrain_matrix:new t.c0(e,n.u_terrain_matrix),u_terrain_unpack:new t.c1(e,n.u_terrain_unpack),u_terrain_exaggeration:new t.bp(e,n.u_terrain_exaggeration)}))(e,T),this.projectionUniforms=((e,n)=>({u_projection_matrix:new t.c0(e,n.u_projection_matrix),u_projection_tile_mercator_coords:new t.c1(e,n.u_projection_tile_mercator_coords),u_projection_clipping_plane:new t.c1(e,n.u_projection_clipping_plane),u_projection_transition:new t.bp(e,n.u_projection_transition),u_projection_fallback_matrix:new t.c0(e,n.u_projection_fallback_matrix)}))(e,T),this.binderUniforms=r?r.getUniforms(e,T):[]}draw(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let y=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(n),e.setStencilMode(r),e.setColorMode(i),e.setCullFace(a),s){e.activeTexture.set(y.TEXTURE2),y.bindTexture(y.TEXTURE_2D,s.depthTexture),e.activeTexture.set(y.TEXTURE3),y.bindTexture(y.TEXTURE_2D,s.texture);for(let e in this.terrainUniforms)this.terrainUniforms[e].set(s[e])}if(c)for(let e in c)this.projectionUniforms[Vn[e]].set(c[e]);if(o)for(let e in this.fixedUniforms)this.fixedUniforms[e].set(o[e]);h&&h.setUniforms(e,this.binderUniforms,p,{zoom:m});let b=0;switch(t){case y.LINES:b=2;break;case y.TRIANGLES:b=3;break;case y.LINE_STRIP:b=1}for(let n of f.get()){let r=n.vaos||={};(r[l]||(r[l]=new zn)).bind(e,this,u,h?h.getPaintVertexBuffers():[],d,n.vertexOffset,g,_,v),y.drawElements(t,n.primitiveLength*b,y.UNSIGNED_SHORT,n.primitiveOffset*b*2)}}}function Wn(e,n,r){let i=1/t.aL(r,1,n.transform.tileZoom),a=2**r.tileID.overscaledZ,o=r.tileSize*2**n.transform.tileZoom/a,s=o*(r.tileID.canonical.x+r.tileID.wrap*a),c=o*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[i,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[s>>16,c>>16],u_pixel_coord_lower:[65535&s,65535&c]}}let Gn=(e,n,r,i)=>{let a=e.style.light,o=a.properties.get(`position`),s=[o.x,o.y,o.z],c=t.c4();a.properties.get(`anchor`)===`viewport`&&t.c5(c,e.transform.bearingInRadians),t.c6(s,s,c);let l=e.transform.transformLightDirection(s),u=a.properties.get(`color`);return{u_lightpos:s,u_lightpos_globe:l,u_lightintensity:a.properties.get(`intensity`),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+n,u_opacity:r,u_fill_translate:i}},Kn=(e,n,r,i,a,o,s)=>t.e(Gn(e,n,r,i),Wn(o,e,s),{u_height_factor:-(2**a.overscaledZ)/s.tileSize/8}),qn=(e,n,r,i)=>t.e(Wn(n,e,r),{u_fill_translate:i}),Jn=(e,t)=>({u_world:e,u_fill_translate:t}),Yn=(e,n,r,i,a)=>t.e(qn(e,n,r,a),{u_world:i}),Xn=(e,n,r,i,a)=>{let o=e.transform,s,c,l=0;if(r.paint.get(`circle-pitch-alignment`)===`map`){let e=t.aL(n,1,o.zoom);s=!0,c=[e,e],l=e/(t.a6*2**n.tileID.overscaledZ)*2*Math.PI*a}else s=!1,c=o.pixelsToGLUnits;return{u_camera_to_center_distance:o.cameraToCenterDistance,u_scale_with_map:+(r.paint.get(`circle-pitch-scale`)===`map`),u_pitch_with_map:+s,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:c,u_globe_extrude_scale:l,u_translate:i}},Zn=e=>({u_pixel_extrude_scale:[1/e.width,1/e.height]}),Qn=e=>({u_viewport_size:[e.width,e.height]}),$n=(e,t=1)=>({u_color:e,u_overlay:0,u_overlay_scale:t}),er=(e,n,r,i)=>{let a=t.aL(e,1,n)/(t.a6*2**e.tileID.overscaledZ)*2*Math.PI*i;return{u_extrude_scale:t.aL(e,1,n),u_intensity:r,u_globe_extrude_scale:a}},tr=(e,n,r,i)=>{let a=t.O();t.c7(a,0,e.width,e.height,0,0,1);let o=e.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:r,u_color_ramp:i,u_opacity:n.paint.get(`heatmap-opacity`)}},nr=(e,t,n)=>{let r=n.paint.get(`hillshade-accent-color`),i;switch(n.paint.get(`hillshade-method`)){case`basic`:i=4;break;case`combined`:i=1;break;case`igor`:i=2;break;case`multidirectional`:i=3;break;default:i=0}let a=n.getIlluminationProperties();for(let t=0;t<a.directionRadians.length;t++)n.paint.get(`hillshade-illumination-anchor`)===`viewport`&&(a.directionRadians[t]+=e.transform.bearingInRadians);return{u_image:0,u_latrange:ir(0,t.tileID),u_exaggeration:n.paint.get(`hillshade-exaggeration`),u_altitudes:a.altitudeRadians,u_azimuths:a.directionRadians,u_accent:r,u_method:i,u_highlights:a.highlightColor,u_shadows:a.shadowColor}},rr=(e,n)=>{let r=n.stride,i=t.O();return t.c7(i,0,t.a6,-t.a6,0,0,1),t.Q(i,i,[0,-t.a6,0]),{u_matrix:i,u_image:1,u_dimension:[r,r],u_zoom:e.overscaledZ,u_unpack:n.getUnpackVector()}};function ir(e,n){let r=2**n.canonical.z,i=n.canonical.y;return[new t.a7(0,i/r).toLngLat().lat,new t.a7(0,(i+1)/r).toLngLat().lat]}let ar=(e,t,n=0)=>({u_image:0,u_unpack:t.getUnpackVector(),u_dimension:[t.stride,t.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:n,u_opacity:e.paint.get(`color-relief-opacity`)}),or=(e,n,r,i)=>{let a=e.transform;return{u_translation:fr(e,n,r),u_ratio:i/t.aL(n,1,a.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},sr=(e,n,r,i,a)=>t.e(or(e,n,r,i),{u_image:0,u_image_height:a}),cr=(e,n,r,i,a)=>{let o=e.transform,s=dr(n,o);return{u_translation:fr(e,n,r),u_texsize:n.imageAtlasTexture.size,u_ratio:i/t.aL(n,1,o.zoom),u_device_pixel_ratio:e.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]]}},lr=(e,n,r,i,a)=>{let o=dr(n,e.transform);return t.e(or(e,n,r,i),{u_tileratio:o,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image:0,u_mix:a.t,u_lineatlas_width:e.lineAtlas.width,u_lineatlas_height:e.lineAtlas.height})},ur=(e,n,r,i,a,o)=>{let s=dr(n,e.transform);return t.e(or(e,n,r,i),{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:e.lineAtlas.width,u_lineatlas_height:e.lineAtlas.height})};function dr(e,n){return 1/t.aL(e,1,n.tileZoom)}function fr(e,n,r){return t.aM(e.transform,n,r.paint.get(`line-translate`),r.paint.get(`line-translate-anchor`))}let pr=(e,t,n,r,i)=>{return{u_tl_parent:e,u_scale_parent:t,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.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:mr(r.paint.get(`raster-hue-rotate`)),u_coords_top:[i[0].x,i[0].y,i[1].x,i[1].y],u_coords_bottom:[i[3].x,i[3].y,i[2].x,i[2].y]};var a,o};function mr(e){e*=Math.PI/180;let t=Math.sin(e),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}let hr=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=o.transform;return{u_is_size_zoom_constant:+(e===`constant`||e===`source`),u_is_size_feature_constant:+(e===`constant`||e===`camera`),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:p.cameraToCenterDistance,u_pitch:p.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:p.width/p.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_label_plane_matrix:s,u_coord_matrix:c,u_is_text:+u,u_pitch_with_map:+r,u_is_along_line:i,u_is_variable_anchor:a,u_texsize:d,u_texture:0,u_translation:l,u_pitched_scale:f}},gr=(e,n,r,i,a,o,s,c,l,u,d,f,p,m)=>{let h=s.transform;return t.e(hr(e,n,r,i,a,o,s,c,l,u,d,f,m),{u_gamma_scale:i?Math.cos(h.pitch*Math.PI/180)*h.cameraToCenterDistance:1,u_device_pixel_ratio:s.pixelRatio,u_is_halo:1})},_r=(e,n,r,i,a,o,s,c,l,u,d,f,p)=>t.e(gr(e,n,r,i,a,o,s,c,l,u,!0,d,0,p),{u_texsize_icon:f,u_texture_icon:1}),vr=(e,t)=>({u_opacity:e,u_color:t}),yr=(e,n,r,i,a)=>t.e(function(e,n,r,i){let a=r.imageManager.getPattern(e.from.toString()),o=r.imageManager.getPattern(e.to.toString()),{width:s,height:c}=r.imageManager.getPixelSize(),l=2**i.tileID.overscaledZ,u=i.tileSize*2**r.transform.tileZoom/l,d=u*(i.tileID.canonical.x+i.tileID.wrap*l),f=u*i.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,c],u_mix:n.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:n.fromScale,u_scale_b:n.toScale,u_tile_units_to_pixels:1/t.aL(i,1,r.transform.tileZoom),u_pixel_coord_upper:[d>>16,f>>16],u_pixel_coord_lower:[65535&d,65535&f]}}(r,a,n,i),{u_opacity:e}),br=(e,t)=>{},xr={fillExtrusion:(e,n)=>({u_lightpos:new t.c2(e,n.u_lightpos),u_lightpos_globe:new t.c2(e,n.u_lightpos_globe),u_lightintensity:new t.bp(e,n.u_lightintensity),u_lightcolor:new t.c2(e,n.u_lightcolor),u_vertical_gradient:new t.bp(e,n.u_vertical_gradient),u_opacity:new t.bp(e,n.u_opacity),u_fill_translate:new t.c3(e,n.u_fill_translate)}),fillExtrusionPattern:(e,n)=>({u_lightpos:new t.c2(e,n.u_lightpos),u_lightpos_globe:new t.c2(e,n.u_lightpos_globe),u_lightintensity:new t.bp(e,n.u_lightintensity),u_lightcolor:new t.c2(e,n.u_lightcolor),u_vertical_gradient:new t.bp(e,n.u_vertical_gradient),u_height_factor:new t.bp(e,n.u_height_factor),u_opacity:new t.bp(e,n.u_opacity),u_fill_translate:new t.c3(e,n.u_fill_translate),u_image:new t.b_(e,n.u_image),u_texsize:new t.c3(e,n.u_texsize),u_pixel_coord_upper:new t.c3(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.c3(e,n.u_pixel_coord_lower),u_scale:new t.c2(e,n.u_scale),u_fade:new t.bp(e,n.u_fade)}),fill:(e,n)=>({u_fill_translate:new t.c3(e,n.u_fill_translate)}),fillPattern:(e,n)=>({u_image:new t.b_(e,n.u_image),u_texsize:new t.c3(e,n.u_texsize),u_pixel_coord_upper:new t.c3(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.c3(e,n.u_pixel_coord_lower),u_scale:new t.c2(e,n.u_scale),u_fade:new t.bp(e,n.u_fade),u_fill_translate:new t.c3(e,n.u_fill_translate)}),fillOutline:(e,n)=>({u_world:new t.c3(e,n.u_world),u_fill_translate:new t.c3(e,n.u_fill_translate)}),fillOutlinePattern:(e,n)=>({u_world:new t.c3(e,n.u_world),u_image:new t.b_(e,n.u_image),u_texsize:new t.c3(e,n.u_texsize),u_pixel_coord_upper:new t.c3(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.c3(e,n.u_pixel_coord_lower),u_scale:new t.c2(e,n.u_scale),u_fade:new t.bp(e,n.u_fade),u_fill_translate:new t.c3(e,n.u_fill_translate)}),circle:(e,n)=>({u_camera_to_center_distance:new t.bp(e,n.u_camera_to_center_distance),u_scale_with_map:new t.b_(e,n.u_scale_with_map),u_pitch_with_map:new t.b_(e,n.u_pitch_with_map),u_extrude_scale:new t.c3(e,n.u_extrude_scale),u_device_pixel_ratio:new t.bp(e,n.u_device_pixel_ratio),u_globe_extrude_scale:new t.bp(e,n.u_globe_extrude_scale),u_translate:new t.c3(e,n.u_translate)}),collisionBox:(e,n)=>({u_pixel_extrude_scale:new t.c3(e,n.u_pixel_extrude_scale)}),collisionCircle:(e,n)=>({u_viewport_size:new t.c3(e,n.u_viewport_size)}),debug:(e,n)=>({u_color:new t.b$(e,n.u_color),u_overlay:new t.b_(e,n.u_overlay),u_overlay_scale:new t.bp(e,n.u_overlay_scale)}),depth:br,clippingMask:br,heatmap:(e,n)=>({u_extrude_scale:new t.bp(e,n.u_extrude_scale),u_intensity:new t.bp(e,n.u_intensity),u_globe_extrude_scale:new t.bp(e,n.u_globe_extrude_scale)}),heatmapTexture:(e,n)=>({u_matrix:new t.c0(e,n.u_matrix),u_world:new t.c3(e,n.u_world),u_image:new t.b_(e,n.u_image),u_color_ramp:new t.b_(e,n.u_color_ramp),u_opacity:new t.bp(e,n.u_opacity)}),hillshade:(e,n)=>({u_image:new t.b_(e,n.u_image),u_latrange:new t.c3(e,n.u_latrange),u_exaggeration:new t.bp(e,n.u_exaggeration),u_altitudes:new t.c9(e,n.u_altitudes),u_azimuths:new t.c9(e,n.u_azimuths),u_accent:new t.b$(e,n.u_accent),u_method:new t.b_(e,n.u_method),u_shadows:new t.c8(e,n.u_shadows),u_highlights:new t.c8(e,n.u_highlights)}),hillshadePrepare:(e,n)=>({u_matrix:new t.c0(e,n.u_matrix),u_image:new t.b_(e,n.u_image),u_dimension:new t.c3(e,n.u_dimension),u_zoom:new t.bp(e,n.u_zoom),u_unpack:new t.c1(e,n.u_unpack)}),colorRelief:(e,n)=>({u_image:new t.b_(e,n.u_image),u_unpack:new t.c1(e,n.u_unpack),u_dimension:new t.c3(e,n.u_dimension),u_elevation_stops:new t.b_(e,n.u_elevation_stops),u_color_stops:new t.b_(e,n.u_color_stops),u_color_ramp_size:new t.b_(e,n.u_color_ramp_size),u_opacity:new t.bp(e,n.u_opacity)}),line:(e,n)=>({u_translation:new t.c3(e,n.u_translation),u_ratio:new t.bp(e,n.u_ratio),u_device_pixel_ratio:new t.bp(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.c3(e,n.u_units_to_pixels)}),lineGradient:(e,n)=>({u_translation:new t.c3(e,n.u_translation),u_ratio:new t.bp(e,n.u_ratio),u_device_pixel_ratio:new t.bp(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.c3(e,n.u_units_to_pixels),u_image:new t.b_(e,n.u_image),u_image_height:new t.bp(e,n.u_image_height)}),linePattern:(e,n)=>({u_translation:new t.c3(e,n.u_translation),u_texsize:new t.c3(e,n.u_texsize),u_ratio:new t.bp(e,n.u_ratio),u_device_pixel_ratio:new t.bp(e,n.u_device_pixel_ratio),u_image:new t.b_(e,n.u_image),u_units_to_pixels:new t.c3(e,n.u_units_to_pixels),u_scale:new t.c2(e,n.u_scale),u_fade:new t.bp(e,n.u_fade)}),lineSDF:(e,n)=>({u_translation:new t.c3(e,n.u_translation),u_ratio:new t.bp(e,n.u_ratio),u_device_pixel_ratio:new t.bp(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.c3(e,n.u_units_to_pixels),u_image:new t.b_(e,n.u_image),u_mix:new t.bp(e,n.u_mix),u_tileratio:new t.bp(e,n.u_tileratio),u_crossfade_from:new t.bp(e,n.u_crossfade_from),u_crossfade_to:new t.bp(e,n.u_crossfade_to),u_lineatlas_width:new t.bp(e,n.u_lineatlas_width),u_lineatlas_height:new t.bp(e,n.u_lineatlas_height)}),lineGradientSDF:(e,n)=>({u_translation:new t.c3(e,n.u_translation),u_ratio:new t.bp(e,n.u_ratio),u_device_pixel_ratio:new t.bp(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.c3(e,n.u_units_to_pixels),u_image:new t.b_(e,n.u_image),u_image_height:new t.bp(e,n.u_image_height),u_tileratio:new t.bp(e,n.u_tileratio),u_crossfade_from:new t.bp(e,n.u_crossfade_from),u_crossfade_to:new t.bp(e,n.u_crossfade_to),u_image_dash:new t.b_(e,n.u_image_dash),u_mix:new t.bp(e,n.u_mix),u_lineatlas_width:new t.bp(e,n.u_lineatlas_width),u_lineatlas_height:new t.bp(e,n.u_lineatlas_height)}),raster:(e,n)=>({u_tl_parent:new t.c3(e,n.u_tl_parent),u_scale_parent:new t.bp(e,n.u_scale_parent),u_buffer_scale:new t.bp(e,n.u_buffer_scale),u_fade_t:new t.bp(e,n.u_fade_t),u_opacity:new t.bp(e,n.u_opacity),u_image0:new t.b_(e,n.u_image0),u_image1:new t.b_(e,n.u_image1),u_brightness_low:new t.bp(e,n.u_brightness_low),u_brightness_high:new t.bp(e,n.u_brightness_high),u_saturation_factor:new t.bp(e,n.u_saturation_factor),u_contrast_factor:new t.bp(e,n.u_contrast_factor),u_spin_weights:new t.c2(e,n.u_spin_weights),u_coords_top:new t.c1(e,n.u_coords_top),u_coords_bottom:new t.c1(e,n.u_coords_bottom)}),symbolIcon:(e,n)=>({u_is_size_zoom_constant:new t.b_(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.b_(e,n.u_is_size_feature_constant),u_size_t:new t.bp(e,n.u_size_t),u_size:new t.bp(e,n.u_size),u_camera_to_center_distance:new t.bp(e,n.u_camera_to_center_distance),u_pitch:new t.bp(e,n.u_pitch),u_rotate_symbol:new t.b_(e,n.u_rotate_symbol),u_aspect_ratio:new t.bp(e,n.u_aspect_ratio),u_fade_change:new t.bp(e,n.u_fade_change),u_label_plane_matrix:new t.c0(e,n.u_label_plane_matrix),u_coord_matrix:new t.c0(e,n.u_coord_matrix),u_is_text:new t.b_(e,n.u_is_text),u_pitch_with_map:new t.b_(e,n.u_pitch_with_map),u_is_along_line:new t.b_(e,n.u_is_along_line),u_is_variable_anchor:new t.b_(e,n.u_is_variable_anchor),u_texsize:new t.c3(e,n.u_texsize),u_texture:new t.b_(e,n.u_texture),u_translation:new t.c3(e,n.u_translation),u_pitched_scale:new t.bp(e,n.u_pitched_scale)}),symbolSDF:(e,n)=>({u_is_size_zoom_constant:new t.b_(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.b_(e,n.u_is_size_feature_constant),u_size_t:new t.bp(e,n.u_size_t),u_size:new t.bp(e,n.u_size),u_camera_to_center_distance:new t.bp(e,n.u_camera_to_center_distance),u_pitch:new t.bp(e,n.u_pitch),u_rotate_symbol:new t.b_(e,n.u_rotate_symbol),u_aspect_ratio:new t.bp(e,n.u_aspect_ratio),u_fade_change:new t.bp(e,n.u_fade_change),u_label_plane_matrix:new t.c0(e,n.u_label_plane_matrix),u_coord_matrix:new t.c0(e,n.u_coord_matrix),u_is_text:new t.b_(e,n.u_is_text),u_pitch_with_map:new t.b_(e,n.u_pitch_with_map),u_is_along_line:new t.b_(e,n.u_is_along_line),u_is_variable_anchor:new t.b_(e,n.u_is_variable_anchor),u_texsize:new t.c3(e,n.u_texsize),u_texture:new t.b_(e,n.u_texture),u_gamma_scale:new t.bp(e,n.u_gamma_scale),u_device_pixel_ratio:new t.bp(e,n.u_device_pixel_ratio),u_is_halo:new t.b_(e,n.u_is_halo),u_translation:new t.c3(e,n.u_translation),u_pitched_scale:new t.bp(e,n.u_pitched_scale)}),symbolTextAndIcon:(e,n)=>({u_is_size_zoom_constant:new t.b_(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.b_(e,n.u_is_size_feature_constant),u_size_t:new t.bp(e,n.u_size_t),u_size:new t.bp(e,n.u_size),u_camera_to_center_distance:new t.bp(e,n.u_camera_to_center_distance),u_pitch:new t.bp(e,n.u_pitch),u_rotate_symbol:new t.b_(e,n.u_rotate_symbol),u_aspect_ratio:new t.bp(e,n.u_aspect_ratio),u_fade_change:new t.bp(e,n.u_fade_change),u_label_plane_matrix:new t.c0(e,n.u_label_plane_matrix),u_coord_matrix:new t.c0(e,n.u_coord_matrix),u_is_text:new t.b_(e,n.u_is_text),u_pitch_with_map:new t.b_(e,n.u_pitch_with_map),u_is_along_line:new t.b_(e,n.u_is_along_line),u_is_variable_anchor:new t.b_(e,n.u_is_variable_anchor),u_texsize:new t.c3(e,n.u_texsize),u_texsize_icon:new t.c3(e,n.u_texsize_icon),u_texture:new t.b_(e,n.u_texture),u_texture_icon:new t.b_(e,n.u_texture_icon),u_gamma_scale:new t.bp(e,n.u_gamma_scale),u_device_pixel_ratio:new t.bp(e,n.u_device_pixel_ratio),u_is_halo:new t.b_(e,n.u_is_halo),u_translation:new t.c3(e,n.u_translation),u_pitched_scale:new t.bp(e,n.u_pitched_scale)}),background:(e,n)=>({u_opacity:new t.bp(e,n.u_opacity),u_color:new t.b$(e,n.u_color)}),backgroundPattern:(e,n)=>({u_opacity:new t.bp(e,n.u_opacity),u_image:new t.b_(e,n.u_image),u_pattern_tl_a:new t.c3(e,n.u_pattern_tl_a),u_pattern_br_a:new t.c3(e,n.u_pattern_br_a),u_pattern_tl_b:new t.c3(e,n.u_pattern_tl_b),u_pattern_br_b:new t.c3(e,n.u_pattern_br_b),u_texsize:new t.c3(e,n.u_texsize),u_mix:new t.bp(e,n.u_mix),u_pattern_size_a:new t.c3(e,n.u_pattern_size_a),u_pattern_size_b:new t.c3(e,n.u_pattern_size_b),u_scale_a:new t.bp(e,n.u_scale_a),u_scale_b:new t.bp(e,n.u_scale_b),u_pixel_coord_upper:new t.c3(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.c3(e,n.u_pixel_coord_lower),u_tile_units_to_pixels:new t.bp(e,n.u_tile_units_to_pixels)}),terrain:(e,n)=>({u_texture:new t.b_(e,n.u_texture),u_ele_delta:new t.bp(e,n.u_ele_delta),u_fog_matrix:new t.c0(e,n.u_fog_matrix),u_fog_color:new t.b$(e,n.u_fog_color),u_fog_ground_blend:new t.bp(e,n.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.bp(e,n.u_fog_ground_blend_opacity),u_horizon_color:new t.b$(e,n.u_horizon_color),u_horizon_fog_blend:new t.bp(e,n.u_horizon_fog_blend),u_is_globe_mode:new t.bp(e,n.u_is_globe_mode)}),terrainDepth:(e,n)=>({u_ele_delta:new t.bp(e,n.u_ele_delta)}),terrainCoords:(e,n)=>({u_texture:new t.b_(e,n.u_texture),u_terrain_coords_id:new t.bp(e,n.u_terrain_coords_id),u_ele_delta:new t.bp(e,n.u_ele_delta)}),projectionErrorMeasurement:(e,n)=>({u_input:new t.bp(e,n.u_input),u_output_expected:new t.bp(e,n.u_output_expected)}),atmosphere:(e,n)=>({u_sun_pos:new t.c2(e,n.u_sun_pos),u_atmosphere_blend:new t.bp(e,n.u_atmosphere_blend),u_globe_position:new t.c2(e,n.u_globe_position),u_globe_radius:new t.bp(e,n.u_globe_radius),u_inv_proj_matrix:new t.c0(e,n.u_inv_proj_matrix)}),sky:(e,n)=>({u_sky_color:new t.b$(e,n.u_sky_color),u_horizon_color:new t.b$(e,n.u_horizon_color),u_horizon:new t.c3(e,n.u_horizon),u_horizon_normal:new t.c3(e,n.u_horizon_normal),u_sky_horizon_blend:new t.bp(e,n.u_sky_horizon_blend),u_sky_blend:new t.bp(e,n.u_sky_blend)})};class Sr{constructor(e,t,n){this.context=e;let r=e.gl;this.buffer=r.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||t.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){let t=this.context.gl;if(!this.dynamicDraw)throw Error(`Attempted to update data while not in dynamic mode.`);this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let Cr={Int8:`BYTE`,Uint8:`UNSIGNED_BYTE`,Int16:`SHORT`,Uint16:`UNSIGNED_SHORT`,Int32:`INT`,Uint32:`UNSIGNED_INT`,Float32:`FLOAT`};class wr{constructor(e,t,n,r){this.length=t.length,this.attributes=n,this.itemSize=t.bytesPerElement,this.dynamicDraw=r,this.context=e;let i=e.gl;this.buffer=i.createBuffer(),e.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||t.freeBufferAfterUpload()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);let t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let n of this.attributes){let r=t.attributes[n.name];r!==void 0&&e.enableVertexAttribArray(r)}}setVertexAttribPointers(e,t,n){for(let r of this.attributes){let i=t.attributes[r.name];i!==void 0&&e.vertexAttribPointer(i,r.components,e[Cr[r.type]],!1,this.itemSize,r.offset+this.itemSize*(n||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class q{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Tr extends q{getDefault(){return t.bo.transparent}set(e){let t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Er extends q{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class Dr extends q{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class Or extends q{getDefault(){return[!0,!0,!0,!0]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class kr extends q{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class Ar extends q{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class jr extends q{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){let t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class Mr extends q{getDefault(){let e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class Nr extends q{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class Pr extends q{getDefault(){return[0,1]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class Fr extends q{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class Ir extends q{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class Lr extends q{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class Rr extends q{getDefault(){let e=this.gl;return[e.ONE,e.ZERO]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class zr extends q{getDefault(){return t.bo.transparent}set(e){let t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Br extends q{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class Vr extends q{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class Hr extends q{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class Ur extends q{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class Wr extends q{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class Gr extends q{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class Kr extends q{getDefault(){let e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class qr extends q{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class Jr extends q{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Yr extends q{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class Xr extends q{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class J extends q{getDefault(){return null}set(e){let t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Zr extends q{getDefault(){return null}set(e){var t;if(e===this.current&&!this.dirty)return;let n=this.gl;sn(n)?n.bindVertexArray(e):(t=n.getExtension(`OES_vertex_array_object`))==null||t.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class Qr extends q{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class $r extends q{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class ei extends q{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class ti extends q{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class ni extends ti{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class ri extends ti{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class ii extends ti{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}let ai=`Framebuffer is not complete`;class oi{constructor(e,t,n,r,i){this.context=e,this.width=t,this.height=n;let a=e.gl,o=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new ni(e,o),r)this.depthAttachment=i?new ii(e,o):new ri(e,o);else if(i)throw Error(`Stencil cannot be set without depth`);if(a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw Error(ai)}destroy(){let e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){let t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}}class si{constructor(e){if(this.gl=e,this.clearColor=new Tr(this),this.clearDepth=new Er(this),this.clearStencil=new Dr(this),this.colorMask=new Or(this),this.depthMask=new kr(this),this.stencilMask=new Ar(this),this.stencilFunc=new jr(this),this.stencilOp=new Mr(this),this.stencilTest=new Nr(this),this.depthRange=new Pr(this),this.depthTest=new Fr(this),this.depthFunc=new Ir(this),this.blend=new Lr(this),this.blendFunc=new Rr(this),this.blendColor=new zr(this),this.blendEquation=new Br(this),this.cullFace=new Vr(this),this.cullFaceSide=new Hr(this),this.frontFace=new Ur(this),this.program=new Wr(this),this.activeTexture=new Gr(this),this.viewport=new Kr(this),this.bindFramebuffer=new qr(this),this.bindRenderbuffer=new Jr(this),this.bindTexture=new Yr(this),this.bindVertexBuffer=new Xr(this),this.bindElementBuffer=new J(this),this.bindVertexArray=new Zr(this),this.pixelStoreUnpack=new Qr(this),this.pixelStoreUnpackPremultiplyAlpha=new $r(this),this.pixelStoreUnpackFlipY=new ei(this),this.extTextureFilterAnisotropic=e.getExtension(`EXT_texture_filter_anisotropic`),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),sn(e)){this.HALF_FLOAT=e.HALF_FLOAT;let t=e.getExtension(`EXT_color_buffer_half_float`);this.RGBA16F=e.RGBA16F??t?.RGBA16F_EXT,this.RGB16F=e.RGB16F??t?.RGB16F_EXT,e.getExtension(`EXT_color_buffer_float`)}else{e.getExtension(`EXT_color_buffer_half_float`),e.getExtension(`OES_texture_half_float_linear`);let t=e.getExtension(`OES_texture_half_float`);this.HALF_FLOAT=t?.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(e,t){return new Sr(this,e,t)}createVertexBuffer(e,t,n){return new wr(this,e,t,n)}createRenderbuffer(e,t,n){let r=this.gl,i=r.createRenderbuffer();return this.bindRenderbuffer.set(i),r.renderbufferStorage(r.RENDERBUFFER,e,t,n),this.bindRenderbuffer.set(null),i}createFramebuffer(e,t,n,r){return new oi(this,e,t,n,r)}clear({color:e,depth:t,stencil:n}){let r=this.gl,i=0;e&&(i|=r.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),t!==void 0&&(i|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),n!==void 0&&(i|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(n),this.stencilMask.set(255)),r.clear(i)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){t.bQ(e.blendFunction,U.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){return sn(this.gl)?this.gl.createVertexArray():this.gl.getExtension(`OES_vertex_array_object`)?.createVertexArrayOES()}deleteVertexArray(e){var t;sn(this.gl)?this.gl.deleteVertexArray(e):(t=this.gl.getExtension(`OES_vertex_array_object`))==null||t.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}let ci;function li(e,n,r,i,a){let o=e.context,s=e.transform,c=o.gl,l=e.useProgram(`collisionBox`),u=[],d=0,f=0;for(let t of i){let i=n.getTile(t).getBucket(r);if(!i)continue;let p=a?i.textCollisionBox:i.iconCollisionBox,m=i.collisionCircleArray;m.length>0&&(u.push({circleArray:m,circleOffset:f,coord:t}),d+=m.length/4,f=d),p&&l.draw(o,c.LINES,G.disabled,K.disabled,e.colorModeForRenderPass(),W.disabled,Zn(e.transform),e.style.map.terrain?.getTerrainData(t),s.getProjectionData({overscaledTileID:t,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),r.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,null,e.transform.zoom,null,null,p.collisionVertexBuffer)}if(!a||!u.length)return;let p=e.useProgram(`collisionCircle`),m=new t.ca;m.resize(4*d),m._trim();let h=0;for(let e of u)for(let t=0;t<e.circleArray.length/4;t++){let n=4*t,r=e.circleArray[n+0],i=e.circleArray[n+1],a=e.circleArray[n+2],o=e.circleArray[n+3];m.emplace(h++,r,i,a,o,0),m.emplace(h++,r,i,a,o,1),m.emplace(h++,r,i,a,o,2),m.emplace(h++,r,i,a,o,3)}(!ci||ci.length<2*d)&&(ci=function(e){let n=2*e,r=new t.cc;r.resize(n),r._trim();for(let e=0;e<n;e++){let t=6*e;r.uint16[t+0]=4*e+0,r.uint16[t+1]=4*e+1,r.uint16[t+2]=4*e+2,r.uint16[t+3]=4*e+2,r.uint16[t+4]=4*e+3,r.uint16[t+5]=4*e+0}return r}(d));let g=o.createIndexBuffer(ci,!0),_=o.createVertexBuffer(m,t.cb.members,!0);for(let n of u){let i=Qn(e.transform);p.draw(o,c.TRIANGLES,G.disabled,K.disabled,e.colorModeForRenderPass(),W.disabled,i,e.style.map.terrain?.getTerrainData(n.coord),null,r.id,_,g,t.aW.simpleSegment(0,2*n.circleOffset,n.circleArray.length,n.circleArray.length/2),null,e.transform.zoom,null,null,null)}_.destroy(),g.destroy()}let ui=t.ap(new Float32Array(16));function di(e,n,r,i,a,o){let{horizontalAlign:s,verticalAlign:c}=t.aQ(e);return new t.P((-(s-.5)*n/a+i[0])*o,(-(c-.5)*r/a+i[1])*o)}function fi(e,n,r,i,a,o){let s=n.tileAnchorPoint.add(new t.P(n.translation[0],n.translation[1]));if(n.pitchWithMap){let e=i.mult(o);r||(e=e.rotate(-a));let t=s.add(e);return et(t.x,t.y,n.pitchedLabelPlaneMatrix,n.getElevation).point}if(r){let t=ct(n.tileAnchorPoint.x+1,n.tileAnchorPoint.y,n).point.sub(e),r=Math.atan(t.y/t.x)+(t.x<0?Math.PI:0);return e.add(i.rotate(r))}return e.add(i)}function pi(e,n,r,i,a,o,s,c,l,u,d,f){let p=e.text.placedSymbolArray,m=e.text.dynamicLayoutVertexArray,h=e.icon.dynamicLayoutVertexArray,g={};m.clear();for(let h=0;h<p.length;h++){let _=p.get(h),v=_.hidden||!_.crossTileID||e.allowVerticalPlacement&&!_.placedOrientation?null:i[_.crossTileID];if(v){let i=new t.P(_.anchorX,_.anchorY),p={getElevation:f,width:a.width,height:a.height,pitchedLabelPlaneMatrix:o,pitchWithMap:r,transform:a,tileAnchorPoint:i,translation:u,unwrappedTileID:d},h=r?ut(i.x,i.y,p):ct(i.x,i.y,p),y=tt(a.cameraToCenterDistance,h.signedDistanceFromCamera),b=t.ay(e.textSizeData,c,_)*y/t.aK;r&&(b*=e.tilePixelRatio/s);let{width:x,height:S,anchor:C,textOffset:w,textBoxScale:T}=v,E=di(C,x,S,w,T,b),D=a.getPitchedTextCorrection(i.x+u[0],i.y+u[1],d),O=fi(h.point,p,n,E,-a.bearingInRadians,D),k=e.allowVerticalPlacement&&_.placedOrientation===t.ax.vertical?Math.PI/2:0;for(let e=0;e<_.numGlyphs;e++)t.aE(m,O,k);l&&_.associatedIconIndex>=0&&(g[_.associatedIconIndex]={shiftedAnchor:O,angle:k})}else ht(_.numGlyphs,m)}if(l){h.clear();let n=e.icon.placedSymbolArray;for(let e=0;e<n.length;e++){let r=n.get(e);if(r.hidden)ht(r.numGlyphs,h);else{let n=g[e];if(n)for(let e=0;e<r.numGlyphs;e++)t.aE(h,n.shiftedAnchor,n.angle);else ht(r.numGlyphs,h)}}e.icon.dynamicLayoutVertexBuffer.updateData(h)}e.text.dynamicLayoutVertexBuffer.updateData(m)}function mi(e,t,n){return n.iconsInText&&t?`symbolTextAndIcon`:e?`symbolSDF`:`symbolIcon`}function hi(e,n,r,i,a,o,s,c,l,u,d,f,p){let m=e.context,h=m.gl,g=e.transform,_=c===`map`,v=l===`map`,y=c!==`viewport`&&r.layout.get(`symbol-placement`)!==`point`,b=_&&!v&&!y,x=!r.layout.get(`symbol-sort-key`).isConstant(),S=!1,C=e.getDepthModeForSublayer(0,G.ReadOnly),w=r._unevaluatedLayout.hasValue(`text-variable-anchor`)||r._unevaluatedLayout.hasValue(`text-variable-anchor-offset`),T=[],E=g.getCircleRadiusCorrection();for(let c of i){let i=n.getTile(c),l=i.getBucket(r);if(!l)continue;let d=a?l.text:l.icon;if(!d?.segments.get().length||!d.hasVisibleVertices)continue;let f=d.programConfigurations.get(r.id),m=a||l.sdfIcons,C=a?l.textSizeData:l.iconSizeData,D=v||g.pitch!==0,O=e.useProgram(mi(m,a,l),f),k=t.aw(C,g.zoom),A=e.style.map.terrain?.getTerrainData(c),j,ee,M,te,ne=[0,0],N=null;if(a)ee=i.glyphAtlasTexture,M=h.LINEAR,j=i.glyphAtlasTexture.size,l.iconsInText&&(ne=i.imageAtlasTexture.size,N=i.imageAtlasTexture,te=D||e.options.rotating||e.options.zooming||C.kind===`composite`||C.kind===`camera`?h.LINEAR:h.NEAREST);else{let t=r.layout.get(`icon-size`).constantOr(0)!==1||l.iconsNeedLinear;ee=i.imageAtlasTexture,M=m||e.options.rotating||e.options.zooming||t||D?h.LINEAR:h.NEAREST,j=i.imageAtlasTexture.size}let re=t.aL(i,1,e.transform.zoom),ie=L(_,e.transform,re),ae=t.O();t.az(ae,ie);let oe=R(v,_,e.transform,re),se=t.aM(g,i,o,s),ce=g.getProjectionData({overscaledTileID:c,applyGlobeMatrix:!p,applyTerrainMatrix:!0}),le=w&&l.hasTextData(),ue=r.layout.get(`icon-text-fit`)!==`none`&&le&&l.hasIconData();if(y){let t=e.style.map.terrain?(t,n)=>e.style.map.terrain.getElevation(c,t,n):null;B(l,e,a,ie,ae,v,u,r.layout.get(`text-rotation-alignment`)===`map`,c.toUnwrapped(),g.width,g.height,se,t)}let de=a&&w||ue,fe=y||de?ui:v?ie:e.transform.clipSpaceToPixelsMatrix,pe=m&&r.paint.get(a?`text-halo-width`:`icon-halo-width`).constantOr(1)!==0,me;me=m?l.iconsInText?_r(C.kind,k,b,v,y,de,e,fe,oe,se,j,ne,E):gr(C.kind,k,b,v,y,de,e,fe,oe,se,a,j,0,E):hr(C.kind,k,b,v,y,de,e,fe,oe,se,a,j,E);let he={program:O,buffers:d,uniformValues:me,projectionData:ce,atlasTexture:ee,atlasTextureIcon:N,atlasInterpolation:M,atlasInterpolationIcon:te,isSDF:m,hasHalo:pe};if(x&&l.canOverlap){S=!0;let e=d.segments.get();for(let n of e)T.push({segments:new t.aW([n]),sortKey:n.sortKey,state:he,terrainData:A})}else T.push({segments:d.segments,sortKey:0,state:he,terrainData:A})}S&&T.sort(((e,t)=>e.sortKey-t.sortKey));for(let t of T){let n=t.state;if(m.activeTexture.set(h.TEXTURE0),n.atlasTexture.bind(n.atlasInterpolation,h.CLAMP_TO_EDGE),n.atlasTextureIcon&&(m.activeTexture.set(h.TEXTURE1),n.atlasTextureIcon&&n.atlasTextureIcon.bind(n.atlasInterpolationIcon,h.CLAMP_TO_EDGE)),n.isSDF){let i=n.uniformValues;n.hasHalo&&(i.u_is_halo=1,gi(n.buffers,t.segments,r,e,n.program,C,d,f,i,n.projectionData,t.terrainData)),i.u_is_halo=0}gi(n.buffers,t.segments,r,e,n.program,C,d,f,n.uniformValues,n.projectionData,t.terrainData)}}function gi(e,t,n,r,i,a,o,s,c,l,u){let d=r.context;i.draw(d,d.gl.TRIANGLES,a,o,s,W.backCCW,c,u,l,n.id,e.layoutVertexBuffer,e.indexBuffer,t,n.paint,r.transform.zoom,e.programConfigurations.get(n.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function _i(e,n,r,i,a){let o=e.context,s=o.gl,c=K.disabled,l=new U([s.ONE,s.ONE],t.bo.transparent,[!0,!0,!0,!0]),u=n.getBucket(r);if(!u)return;let d=i.key,f=r.heatmapFbos.get(d);f||(f=yi(o,n.tileSize,n.tileSize),r.heatmapFbos.set(d,f)),o.bindFramebuffer.set(f.framebuffer),o.viewport.set([0,0,n.tileSize,n.tileSize]),o.clear({color:t.bo.transparent});let p=u.programConfigurations.get(r.id),m=e.useProgram(`heatmap`,p,!a),h=e.transform.getProjectionData({overscaledTileID:n.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),g=e.style.map.terrain.getTerrainData(i);m.draw(o,s.TRIANGLES,G.disabled,c,l,W.disabled,er(n,e.transform.zoom,r.paint.get(`heatmap-intensity`),1),g,h,r.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,r.paint,e.transform.zoom,p)}function vi(e,t,n,r,i){let a=e.context,o=a.gl,s=e.transform;a.setColorMode(e.colorModeForRenderPass());let c=bi(a,t),l=n.key,u=t.heatmapFbos.get(l);if(!u)return;a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,u.colorAttachment.get()),a.activeTexture.set(o.TEXTURE1),c.bind(o.LINEAR,o.CLAMP_TO_EDGE);let d=s.getProjectionData({overscaledTileID:n,applyTerrainMatrix:i,applyGlobeMatrix:!r});e.useProgram(`heatmapTexture`).draw(a,o.TRIANGLES,G.disabled,K.disabled,e.colorModeForRenderPass(),W.disabled,tr(e,t,0,1),null,d,t.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments,t.paint,s.zoom),u.destroy(),t.heatmapFbos.delete(l)}function yi(e,t,n){let r=e.gl,i=r.createTexture();r.bindTexture(r.TEXTURE_2D,i),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.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR);let a=e.HALF_FLOAT??r.UNSIGNED_BYTE,o=e.RGBA16F??r.RGBA;r.texImage2D(r.TEXTURE_2D,0,o,t,n,0,r.RGBA,a,null);let s=e.createFramebuffer(t,n,!1,!1);return s.colorAttachment.set(i),s}function bi(e,n){return n.colorRampTexture||=new t.T(e,n.colorRamp,e.gl.RGBA),n.colorRampTexture}function xi(e,n,r,i,a,o,s,c){let l=256;if(a.stepInterpolant){let i=n.getSource().maxzoom,a=s.canonical.z===i?Math.ceil(1<<e.transform.maxZoom-s.canonical.z):1;l=t.al(t.ce(o.maxLineLength/t.a6*1024*a),256,r.maxTextureSize)}return c.gradient=t.cf({expression:a.gradientExpression(),evaluationKey:`lineProgress`,resolution:l,image:c.gradient||void 0,clips:o.lineClipsArray}),c.texture?c.texture.update(c.gradient):c.texture=new t.T(r,c.gradient,i.RGBA),c.version=a.gradientVersion,c.texture}function Si(e,t,n,r,i){e.activeTexture.set(t.TEXTURE0),n.imageAtlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE),r.updatePaintBuffers(i)}function Ci(e,t,n,r,i,a){(i||e.lineAtlas.dirty)&&(t.activeTexture.set(n.TEXTURE0),e.lineAtlas.bind(t)),r.updatePaintBuffers(a)}function wi(e,t,n,r,i,a,o){let s=a.gradients[i.id],c=s.texture;i.gradientVersion!==s.version&&(c=xi(e,t,n,r,i,a,o,s)),n.activeTexture.set(r.TEXTURE0),c.bind(i.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE)}function Ti(e,t,n,r,i,a,o,s,c){let l=a.gradients[i.id],u=l.texture;i.gradientVersion!==l.version&&(u=xi(e,t,n,r,i,a,o,l)),n.activeTexture.set(r.TEXTURE0),u.bind(i.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE),n.activeTexture.set(r.TEXTURE1),e.lineAtlas.bind(n),s.updatePaintBuffers(c)}function Ei(e,t,n,r,i){if(!n||!r?.imageAtlas)return;let a=r.imageAtlas.patternPositions,o=a[n.to.toString()],s=a[n.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){let e=i.getPaintProperty(t);o=a[e],s=a[e]}o&&s&&e.setConstantPatternPositions(o,s)}function Di(e,n,r,i,a,o,s,c){let l=e.context.gl,u=`fill-pattern`,d=r.paint.get(u),f=d?.constantOr(1),p=r.getCrossfadeParameters(),m,h,g,_,v,y=e.transform,b=r.paint.get(`fill-translate`),x=r.paint.get(`fill-translate-anchor`);s?(h=f&&!r.getPaintProperty(`fill-outline-color`)?`fillOutlinePattern`:`fillOutline`,m=l.LINES):(h=f?`fillPattern`:`fill`,m=l.TRIANGLES);let S=d.constantOr(null);for(let d of i){let i=n.getTile(d);if(f&&!i.patternsLoaded())continue;let C=i.getBucket(r);if(!C)continue;let w=C.programConfigurations.get(r.id),T=e.useProgram(h,w),E=e.style.map.terrain?.getTerrainData(d);f&&(e.context.activeTexture.set(l.TEXTURE0),i.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),w.updatePaintBuffers(p)),Ei(w,u,S,i,r);let D=y.getProjectionData({overscaledTileID:d,applyGlobeMatrix:!c,applyTerrainMatrix:!0}),O=t.aM(y,i,b,x);if(s){_=C.indexBuffer2,v=C.segments2;let t=[l.drawingBufferWidth,l.drawingBufferHeight];g=h===`fillOutlinePattern`&&f?Yn(e,p,i,t,O):Jn(t,O)}else _=C.indexBuffer,v=C.segments,g=f?qn(e,p,i,O):{u_fill_translate:O};let k=e.stencilModeForClipping(d);T.draw(e.context,m,a,k,o,W.backCCW,g,E,D,r.id,C.layoutVertexBuffer,_,v,r.paint,e.transform.zoom,w)}}function Oi(e,n,r,i,a,o,s,c){let l=e.context,u=l.gl,d=`fill-extrusion-pattern`,f=r.paint.get(d),p=f.constantOr(1),m=r.getCrossfadeParameters(),h=r.paint.get(`fill-extrusion-opacity`),g=f.constantOr(null),_=e.transform;for(let f of i){let i=n.getTile(f),v=i.getBucket(r);if(!v)continue;let y=e.style.map.terrain?.getTerrainData(f),b=v.programConfigurations.get(r.id),x=e.useProgram(p?`fillExtrusionPattern`:`fillExtrusion`,b);p&&(e.context.activeTexture.set(u.TEXTURE0),i.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),b.updatePaintBuffers(m));let S=_.getProjectionData({overscaledTileID:f,applyGlobeMatrix:!c,applyTerrainMatrix:!0});Ei(b,d,g,i,r);let C=t.aM(_,i,r.paint.get(`fill-extrusion-translate`),r.paint.get(`fill-extrusion-translate-anchor`)),w=r.paint.get(`fill-extrusion-vertical-gradient`),T=p?Kn(e,w,h,C,f,m,i):Gn(e,w,h,C);x.draw(l,l.gl.TRIANGLES,a,o,s,W.backCCW,T,y,S,r.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,r.paint,e.transform.zoom,b,e.style.map.terrain&&v.centroidVertexBuffer)}}function ki(e,t,n,r,i,a,o,s,c){let l=e.style.projection,u=e.context,d=e.transform,f=u.gl,p=[`#define NUM_ILLUMINATION_SOURCES ${n.paint.get(`hillshade-highlight-color`).values.length}`],m=e.useProgram(`hillshade`,null,!1,p),h=!e.options.moving;for(let p of r){let r=t.getTile(p),g=r.fbo;if(!g)continue;let _=l.getMeshFromTileID(u,p.canonical,s,!0,`raster`),v=e.style.map.terrain?.getTerrainData(p);u.activeTexture.set(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,g.colorAttachment.get());let y=d.getProjectionData({overscaledTileID:p,aligned:h,applyGlobeMatrix:!c,applyTerrainMatrix:!0});m.draw(u,f.TRIANGLES,a,i[p.overscaledZ],o,W.backCCW,nr(e,r,n),v,y,n.id,_.vertexBuffer,_.indexBuffer,_.segments)}}function Ai(e,n,r,i,a,o,s,c,l){let u=e.style.projection,d=e.context,f=e.transform,p=d.gl,m=e.useProgram(`colorRelief`),h=!e.options.moving,g=r.paint.get(`resampling`)===`nearest`?p.NEAREST:p.LINEAR,_=!0,v=0;for(let y of i){let i=n.getTile(y),b=i.dem;if(_){let e=p.getParameter(p.MAX_TEXTURE_SIZE),{elevationTexture:t,colorTexture:n}=r.getColorRampTextures(d,e,b.getUnpackVector());d.activeTexture.set(p.TEXTURE1),t.bind(p.NEAREST,p.CLAMP_TO_EDGE),d.activeTexture.set(p.TEXTURE4),n.bind(p.LINEAR,p.CLAMP_TO_EDGE),_=!1,v=t.size[0]}if(!b?.data)continue;let x=b.stride,S=b.getPixels();if(d.activeTexture.set(p.TEXTURE0),d.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||e.getTileTexture(x),i.demTexture){let e=i.demTexture;e.update(S,{premultiply:!1}),e.bind(g,p.CLAMP_TO_EDGE)}else i.demTexture=new t.T(d,S,p.RGBA,{premultiply:!1}),i.demTexture.bind(g,p.CLAMP_TO_EDGE);let C=u.getMeshFromTileID(d,y.canonical,c,!0,`raster`),w=e.style.map.terrain?.getTerrainData(y),T=f.getProjectionData({overscaledTileID:y,aligned:h,applyGlobeMatrix:!l,applyTerrainMatrix:!0});m.draw(d,p.TRIANGLES,o,a[y.overscaledZ],s,W.backCCW,ar(r,i.dem,v),w,T,r.id,C.vertexBuffer,C.indexBuffer,C.segments)}}let ji=[new t.P(0,0),new t.P(t.a6,0),new t.P(t.a6,t.a6),new t.P(0,t.a6)];function Mi(e,t,n,r,i,a,o,s,c=!1,l=!1){let u=r[r.length-1].overscaledZ,d=e.context,f=d.gl,p=e.useProgram(`raster`),m=e.transform,h=e.style.projection,g=e.colorModeForRenderPass(),_=!e.options.moving,v=n.paint.get(`raster-opacity`),y=n.paint.get(`resampling`)===`nearest`||n.paint.get(`raster-resampling`)===`nearest`?f.NEAREST:f.LINEAR,b=n.paint.get(`raster-fade-duration`),x=!!e.style.map.terrain;for(let S of r){let r=e.getDepthModeForSublayer(S.overscaledZ-u,v===1?G.ReadWrite:G.ReadOnly,f.LESS),C=t.getTile(S);d.activeTexture.set(f.TEXTURE0),C.texture.bind(y,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),d.activeTexture.set(f.TEXTURE1);let{parentTile:w,parentScaleBy:T,parentTopLeft:E,fadeValues:D}=Ni(C,t,b,x);C.fadeOpacity=D.tileOpacity,w?(w.fadeOpacity=D.parentTileOpacity,w.texture.bind(y,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST)):C.texture.bind(y,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),C.texture.useMipmap&&d.extTextureFilterAnisotropic&&e.transform.pitch>e.options.anisotropicFilterPitch&&f.texParameterf(f.TEXTURE_2D,d.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,d.extTextureFilterAnisotropicMax);let O=e.style.map.terrain?.getTerrainData(S),k=m.getProjectionData({overscaledTileID:S,aligned:_,applyGlobeMatrix:!l,applyTerrainMatrix:!0}),A=pr(E,T,D.fadeMix,n,s),j=h.getMeshFromTileID(d,S.canonical,a,o,`raster`);p.draw(d,f.TRIANGLES,r,i?i[S.overscaledZ]:K.disabled,g,c?W.frontCCW:W.backCCW,A,O,k,n.id,j.vertexBuffer,j.indexBuffer,j.segments)}}function Ni(e,n,r,i){let a={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(r===0||i)return a;if(e.fadingParentID){let i=n.getLoadedTile(e.fadingParentID);if(!i)return a;let o=2**(i.tileID.overscaledZ-e.tileID.overscaledZ);return{parentTile:i,parentScaleBy:o,parentTopLeft:[e.tileID.canonical.x*o%1,e.tileID.canonical.y*o%1],fadeValues:function(e,n,r){let i=l(),a=(i-n.timeAdded)/r,o=e.fadingDirection===ke.Incoming,s=t.al((i-e.timeAdded)/r,0,1),c=t.al(1-a,0,1),u=o?s:c;return{tileOpacity:u,parentTileOpacity:o?c:s,fadeMix:{opacity:1,mix:1-u}}}(e,i,r)}}return e.selfFading?{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:function(e,n){let r=(l()-e.timeAdded)/n,i=t.al(r,0,1);return{tileOpacity:i,fadeMix:{opacity:i,mix:0}}}(e,r)}:a}let Pi=new t.bo(1,0,0,1),Fi=new t.bo(0,1,0,1),Ii=new t.bo(0,0,1,1),Li=new t.bo(1,0,1,1),Ri=new t.bo(0,1,1,1);function zi(e,t,n,r){Vi(e,0,t+n/2,e.transform.width,n,r)}function Bi(e,t,n,r){Vi(e,t-n/2,0,n,e.transform.height,r)}function Vi(e,t,n,r,i,a){let o=e.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(t*e.pixelRatio,n*e.pixelRatio,r*e.pixelRatio,i*e.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function Hi(e,n,r){let i=e.context,a=i.gl,o=e.useProgram(`debug`),s=G.disabled,c=K.disabled,l=e.colorModeForRenderPass(),u=`$debug`,d=e.style.map.terrain?.getTerrainData(r);i.activeTexture.set(a.TEXTURE0);let f=n.getTileByID(r.key).latestRawTileData,p=Math.floor((f?.byteLength||0)/1024),m=n.getTile(r).tileSize,h=512/Math.min(m,512)*(r.overscaledZ/e.transform.zoom)*.5,g=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(g+=` => ${r.overscaledZ}`),function(e,t){e.initDebugOverlayCanvas();let n=e.debugOverlayCanvas,r=e.context.gl,i=e.debugOverlayCanvas.getContext(`2d`);i.clearRect(0,0,n.width,n.height),i.shadowColor=`white`,i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle=`white`,i.textBaseline=`top`,i.font=`bold 36px Open Sans, sans-serif`,i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(n),e.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(e,`${g} ${p}kB`);let _=e.transform.getProjectionData({overscaledTileID:r,applyGlobeMatrix:!0,applyTerrainMatrix:!0});o.draw(i,a.TRIANGLES,s,c,U.alphaBlended,W.disabled,$n(t.bo.transparent,h),null,_,u,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),o.draw(i,a.LINE_STRIP,s,c,l,W.disabled,$n(t.bo.red),d,_,u,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}function Ui(e,t,n,r){let{isRenderingGlobe:i}=r,a=e.context,o=a.gl,s=e.transform,c=e.colorModeForRenderPass(),l=e.getDepthModeFor3D(),u=e.useProgram(`terrain`);a.bindFramebuffer.set(null),a.viewport.set([0,0,e.width,e.height]);for(let r of n){let n=t.getTerrainMesh(r.tileID),d=e.renderToTexture.getTexture(r),f=t.getTerrainData(r.tileID);a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,d.texture);let p=Bn(t.getMeshFrameDelta(s.zoom),s.calculateFogMatrix(r.tileID.toUnwrapped()),e.style.sky,s.pitch,i),m=s.getProjectionData({overscaledTileID:r.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});u.draw(a,o.TRIANGLES,l,K.disabled,c,W.backCCW,p,f,m,`terrain`,n.vertexBuffer,n.indexBuffer,n.segments)}}function Wi(e,n){if(!n.mesh){let r=new t.aV;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(1,1),r.emplaceBack(-1,1);let i=new t.aX;i.emplaceBack(0,1,2),i.emplaceBack(0,2,3),n.mesh=new Bt(e.createVertexBuffer(r,Vt.members),e.createIndexBuffer(i),t.aW.simpleSegment(0,0,r.length,i.length))}return n.mesh}let Gi={symbol:function(e,n,r,i,a,o){if(e.renderPass!==`translucent`)return;let{isRenderingToTexture:s}=o,c=K.disabled,l=e.colorModeForRenderPass();(r._unevaluatedLayout.hasValue(`text-variable-anchor`)||r._unevaluatedLayout.hasValue(`text-variable-anchor-offset`))&&function(e,n,r,i,a,o,s,c,l){let u=n.transform,d=n.style.map.terrain,f=a===`map`,p=o===`map`;for(let a of e){let e=i.getTile(a),o=e.getBucket(r);if(!(o?.text)?.segments.get().length)continue;let m=t.aw(o.textSizeData,u.zoom),h=t.aL(e,1,n.transform.zoom),g=L(f,n.transform,h),_=r.layout.get(`icon-text-fit`)!==`none`&&o.hasIconData();if(m){let n=2**(u.zoom-e.tileID.overscaledZ),r=d?(e,t)=>d.getElevation(a,e,t):null;pi(o,f,p,l,u,g,n,m,_,t.aM(u,e,s,c),a.toUnwrapped(),r)}}}(i,e,r,n,r.layout.get(`text-rotation-alignment`),r.layout.get(`text-pitch-alignment`),r.paint.get(`text-translate`),r.paint.get(`text-translate-anchor`),a),r.paint.get(`icon-opacity`).constantOr(1)!==0&&hi(e,n,r,i,!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`),c,l,s),r.paint.get(`text-opacity`).constantOr(1)!==0&&hi(e,n,r,i,!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`),c,l,s),n.map.showCollisionBoxes&&(li(e,n,r,i,!0),li(e,n,r,i,!1))},circle:function(e,n,r,i,a){if(e.renderPass!==`translucent`)return;let{isRenderingToTexture:o}=a,s=r.paint.get(`circle-opacity`),c=r.paint.get(`circle-stroke-width`),l=r.paint.get(`circle-stroke-opacity`),u=!r.layout.get(`circle-sort-key`).isConstant();if(s.constantOr(1)===0&&(c.constantOr(1)===0||l.constantOr(1)===0))return;let d=e.context,f=d.gl,p=e.transform,m=e.getDepthModeForSublayer(0,G.ReadOnly),h=K.disabled,g=e.colorModeForRenderPass(),_=[],v=p.getCircleRadiusCorrection();for(let a of i){let i=n.getTile(a),s=i.getBucket(r);if(!s)continue;let c=r.paint.get(`circle-translate`),l=r.paint.get(`circle-translate-anchor`),d=t.aM(p,i,c,l),f=s.programConfigurations.get(r.id),m=e.useProgram(`circle`,f),h=s.layoutVertexBuffer,g=s.indexBuffer,y=e.style.map.terrain?.getTerrainData(a),b={programConfiguration:f,program:m,layoutVertexBuffer:h,indexBuffer:g,uniformValues:Xn(e,i,r,d,v),terrainData:y,projectionData:p.getProjectionData({overscaledTileID:a,applyGlobeMatrix:!o,applyTerrainMatrix:!0})};if(u){let e=s.segments.get();for(let n of e)_.push({segments:new t.aW([n]),sortKey:n.sortKey,state:b})}else _.push({segments:s.segments,sortKey:0,state:b})}u&&_.sort(((e,t)=>e.sortKey-t.sortKey));for(let t of _){let{programConfiguration:n,program:i,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:c,projectionData:l}=t.state;i.draw(d,f.TRIANGLES,m,h,g,W.backCCW,s,c,l,r.id,a,o,t.segments,r.paint,e.transform.zoom,n)}},heatmap:function(e,n,r,i,a){if(r.paint.get(`heatmap-opacity`)===0)return;let o=e.context,{isRenderingToTexture:s,isRenderingGlobe:c}=a;if(e.style.map.terrain){for(let t of i){let i=n.getTile(t);n.hasRenderableParent(t)||(e.renderPass===`offscreen`?_i(e,i,r,t,c):e.renderPass===`translucent`&&vi(e,r,t,s,c))}o.viewport.set([0,0,e.width,e.height])}else e.renderPass===`offscreen`?function(e,n,r,i){let a=e.context,o=a.gl,s=e.transform,c=K.disabled,l=new U([o.ONE,o.ONE],t.bo.transparent,[!0,!0,!0,!0]);(function(e,n,r){let i=e.gl;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,n.width/4,n.height/4]);let a=r.heatmapFbos.get(t.cd);a?(i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer)):(a=yi(e,n.width/4,n.height/4),r.heatmapFbos.set(t.cd,a))})(a,e,r),a.clear({color:t.bo.transparent});for(let t of i){if(n.hasRenderableParent(t))continue;let i=n.getTile(t),u=i.getBucket(r);if(!u)continue;let d=u.programConfigurations.get(r.id),f=e.useProgram(`heatmap`,d),p=s.getProjectionData({overscaledTileID:t,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),m=s.getCircleRadiusCorrection();f.draw(a,o.TRIANGLES,G.disabled,c,l,W.backCCW,er(i,s.zoom,r.paint.get(`heatmap-intensity`),m),null,p,r.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,r.paint,s.zoom,d)}a.viewport.set([0,0,e.width,e.height])}(e,n,r,i):e.renderPass===`translucent`&&function(e,n){let r=e.context,i=r.gl;r.setColorMode(e.colorModeForRenderPass());let a=n.heatmapFbos.get(t.cd);a&&(r.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),r.activeTexture.set(i.TEXTURE1),bi(r,n).bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram(`heatmapTexture`).draw(r,i.TRIANGLES,G.disabled,K.disabled,e.colorModeForRenderPass(),W.disabled,tr(e,n,0,1),null,null,n.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,n.paint,e.transform.zoom))}(e,r)},line:function(e,t,n,r,i){if(e.renderPass!==`translucent`)return;let{isRenderingToTexture:a}=i,o=n.paint.get(`line-opacity`),s=n.paint.get(`line-width`);if(o.constantOr(1)===0||s.constantOr(1)===0)return;let c=e.getDepthModeForSublayer(0,G.ReadOnly),l=e.colorModeForRenderPass(),u=n.paint.get(`line-dasharray`),d=u.constantOr(1),f=n.paint.get(`line-pattern`),p=f.constantOr(1),m=n.paint.get(`line-gradient`),h=n.getCrossfadeParameters(),g;g=p?`linePattern`:d&&m?`lineGradientSDF`:d?`lineSDF`:m?`lineGradient`:`line`;let _=e.context,v=_.gl,y=e.transform,b=!0;for(let i of r){let r=t.getTile(i);if(p&&!r.patternsLoaded())continue;let o=r.getBucket(n);if(!o)continue;let s=o.programConfigurations.get(n.id),x=e.context.program.get(),S=e.useProgram(g,s),C=b||S.program!==x,w=e.style.map.terrain?.getTerrainData(i),T=f.constantOr(null),E=u?.constantOr(null);if(T&&r.imageAtlas){let e=r.imageAtlas,t=e.patternPositions[T.to.toString()],n=e.patternPositions[T.from.toString()];t&&n&&s.setConstantPatternPositions(t,n)}else if(E){let t=n.layout.get(`line-cap`).constantOr(null)===`round`,r=e.lineAtlas.getDash(E.to,t),i=e.lineAtlas.getDash(E.from,t);s.setConstantDashPositions(r,i)}let D=y.getProjectionData({overscaledTileID:i,applyGlobeMatrix:!a,applyTerrainMatrix:!0}),O=y.getPixelScale(),k;p?(k=cr(e,r,n,O,h),Si(_,v,r,s,h)):d&&m?(k=ur(e,r,n,O,h,o.lineClipsArray.length),Ti(e,t,_,v,n,o,i,s,h)):d?(k=lr(e,r,n,O,h),Ci(e,_,v,s,C,h)):m?(k=sr(e,r,n,O,o.lineClipsArray.length),wi(e,t,_,v,n,o,i)):k=or(e,r,n,O);let A=e.stencilModeForClipping(i);S.draw(_,v.TRIANGLES,c,A,l,W.disabled,k,w,D,n.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,n.paint,e.transform.zoom,s,o.layoutVertexBuffer2),b=!1}},fill:function(e,n,r,i,a){let o=r.paint.get(`fill-color`),s=r.paint.get(`fill-opacity`);if(s.constantOr(1)===0)return;let{isRenderingToTexture:c}=a,l=e.colorModeForRenderPass(),u=r.paint.get(`fill-pattern`),d=e.opaquePassEnabledForLayer()&&!u.constantOr(1)&&o.constantOr(t.bo.transparent).a===1&&s.constantOr(0)===1?`opaque`:`translucent`;e.renderPass===d&&Di(e,n,r,i,e.getDepthModeForSublayer(1,e.renderPass===`opaque`?G.ReadWrite:G.ReadOnly),l,!1,c),e.renderPass===`translucent`&&r.paint.get(`fill-antialias`)&&Di(e,n,r,i,e.getDepthModeForSublayer(r.getPaintProperty(`fill-outline-color`)?2:0,G.ReadOnly),l,!0,c)},fillExtrusion:function(e,t,n,r,i){let a=n.paint.get(`fill-extrusion-opacity`);if(a===0)return;let{isRenderingToTexture:o}=i;if(e.renderPass===`translucent`){let i=new G(e.context.gl.LEQUAL,G.ReadWrite,e.depthRangeFor3D);if(a!==1||n.paint.get(`fill-extrusion-pattern`).constantOr(1))Oi(e,t,n,r,i,K.disabled,U.disabled,o),Oi(e,t,n,r,i,e.stencilModeFor3D(),e.colorModeForRenderPass(),o);else{let a=e.colorModeForRenderPass();Oi(e,t,n,r,i,K.disabled,a,o)}}},hillshade:function(e,n,r,i,a){if(e.renderPass!==`offscreen`&&e.renderPass!==`translucent`)return;let{isRenderingToTexture:o}=a,s=e.context,c=e.style.projection.useSubdivision,l=e.getDepthModeForSublayer(0,G.ReadOnly),u=e.colorModeForRenderPass();if(e.renderPass===`offscreen`)(function(e,n,r,i,a,o,s){let c=e.context,l=c.gl,u=i.paint.get(`resampling`)===`nearest`?l.NEAREST:l.LINEAR;for(let d of r){let r=n.getTile(d),f=r.dem;if(!f?.data||!r.needsHillshadePrepare)continue;let p=f.dim,m=f.stride,h=f.getPixels();if(c.activeTexture.set(l.TEXTURE1),c.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(m),r.demTexture){let e=r.demTexture;e.update(h,{premultiply:!1}),e.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new t.T(c,h,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);c.activeTexture.set(l.TEXTURE0);let g=r.fbo;if(!g){let e=new t.T(c,{width:p,height:p,data:null},l.RGBA);e.bind(u,l.CLAMP_TO_EDGE),g=r.fbo=c.createFramebuffer(p,p,!0,!1),g.colorAttachment.set(e.texture)}c.bindFramebuffer.set(g.framebuffer),c.viewport.set([0,0,p,p]),e.useProgram(`hillshadePrepare`).draw(c,l.TRIANGLES,a,o,s,W.disabled,rr(r.tileID,f),null,null,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}})(e,n,i,r,l,K.disabled,u),s.viewport.set([0,0,e.width,e.height]);else if(e.renderPass===`translucent`)if(c){let[t,a,s]=e.stencilConfigForOverlapTwoPass(i);ki(e,n,r,s,t,l,u,!1,o),ki(e,n,r,s,a,l,u,!0,o)}else{let[t,a]=e.getStencilConfigForOverlapAndUpdateStencilID(i);ki(e,n,r,a,t,l,u,!1,o)}},colorRelief:function(e,t,n,r,i){if(e.renderPass!==`translucent`||!r.length)return;let{isRenderingToTexture:a}=i,o=e.style.projection.useSubdivision,s=e.getDepthModeForSublayer(0,G.ReadOnly),c=e.colorModeForRenderPass();if(o){let[i,o,l]=e.stencilConfigForOverlapTwoPass(r);Ai(e,t,n,l,i,s,c,!1,a),Ai(e,t,n,l,o,s,c,!0,a)}else{let[i,o]=e.getStencilConfigForOverlapAndUpdateStencilID(r);Ai(e,t,n,o,i,s,c,!1,a)}},raster:function(e,t,n,r,i){if(e.renderPass!==`translucent`||n.paint.get(`raster-opacity`)===0||!r.length)return;let{isRenderingToTexture:a}=i,o=t.getSource(),s=e.style.projection.useSubdivision;if(o instanceof ye)Mi(e,t,n,r,null,!1,!1,o.tileCoords,o.flippedWindingOrder,a);else if(s){let[i,o,s]=e.stencilConfigForOverlapTwoPass(r);Mi(e,t,n,s,i,!1,!0,ji,!1,a),Mi(e,t,n,s,o,!0,!0,ji,!1,a)}else{let[i,o]=e.getStencilConfigForOverlapAndUpdateStencilID(r);Mi(e,t,n,o,i,!1,!0,ji,!1,a)}},background:function(e,t,n,r,i){let a=n.paint.get(`background-color`),o=n.paint.get(`background-opacity`);if(o===0)return;let{isRenderingToTexture:s}=i,c=e.context,l=c.gl,u=e.style.projection,d=e.transform,f=d.tileSize,p=n.paint.get(`background-pattern`);if(e.isPatternMissing(p))return;let m=!p&&a.a===1&&o===1&&e.opaquePassEnabledForLayer()?`opaque`:`translucent`;if(e.renderPass!==m)return;let h=K.disabled,g=e.getDepthModeForSublayer(0,m===`opaque`?G.ReadWrite:G.ReadOnly),_=e.colorModeForRenderPass(),v=e.useProgram(p?`backgroundPattern`:`background`),y=r||He(d,{tileSize:f,terrain:e.style.map.terrain});p&&(c.activeTexture.set(l.TEXTURE0),e.imageManager.bind(e.context));let b=n.getCrossfadeParameters();for(let t of y){let r=d.getProjectionData({overscaledTileID:t,applyGlobeMatrix:!s,applyTerrainMatrix:!0}),i=p?yr(o,e,p,{tileID:t,tileSize:f},b):vr(o,a),m=e.style.map.terrain?.getTerrainData(t),y=u.getMeshFromTileID(c,t.canonical,!1,!0,`raster`);v.draw(c,l.TRIANGLES,g,h,_,W.backCCW,i,m,r,n.id,y.vertexBuffer,y.indexBuffer,y.segments)}},sky:function(e,t){let n=e.context,r=n.gl,i=((e,t,n)=>{let r=Math.cos(t.rollInRadians),i=Math.sin(t.rollInRadians),a=Fe(t),o=t.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:e.properties.get(`sky-color`),u_horizon_color:e.properties.get(`horizon-color`),u_horizon:[(t.width/2-a*i)*n,(t.height/2+a*r)*n],u_horizon_normal:[-i,r],u_sky_horizon_blend:e.properties.get(`sky-horizon-blend`)*t.height/2*n,u_sky_blend:o}})(t,e.style.map.transform,e.pixelRatio),a=new G(r.LEQUAL,G.ReadWrite,[0,1]),o=K.disabled,s=e.colorModeForRenderPass(),c=e.useProgram(`sky`),l=Wi(n,t);c.draw(n,r.TRIANGLES,a,o,s,W.disabled,i,null,void 0,`sky`,l.vertexBuffer,l.indexBuffer,l.segments)},atmosphere:function(e,n,r){let i=e.context,a=i.gl,o=e.useProgram(`atmosphere`),s=new G(a.LEQUAL,G.ReadOnly,[0,1]),c=e.transform,l=function(e,n){let r=e.properties.get(`position`),i=[-r.x,-r.y,-r.z],a=t.ap(new Float64Array(16));return e.properties.get(`anchor`)===`map`&&(t.bf(a,a,n.rollInRadians),t.bg(a,a,-n.pitchInRadians),t.bf(a,a,n.bearingInRadians),t.bg(a,a,n.center.lat*Math.PI/180),t.bI(a,a,-n.center.lng*Math.PI/180)),t.cg(i,i,a),i}(r,e.transform),u=c.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),d=n.properties.get(`atmosphere-blend`)*u.projectionTransition;if(d===0)return;let f=vn(c.worldSize,c.center.lat),p=c.inverseProjectionMatrix,m=new Float64Array(4);m[3]=1,t.aF(m,m,c.modelViewProjectionMatrix),m[0]/=m[3],m[1]/=m[3],m[2]/=m[3],m[3]=1,t.aF(m,m,p),m[0]/=m[3],m[1]/=m[3],m[2]/=m[3],m[3]=1;let h=((e,t,n,r,i)=>({u_sun_pos:e,u_atmosphere_blend:t,u_globe_position:n,u_globe_radius:r,u_inv_proj_matrix:i}))(l,d,[m[0],m[1],m[2]],f,p),g=Wi(i,n);o.draw(i,a.TRIANGLES,s,K.disabled,U.alphaBlended,W.disabled,h,null,null,`atmosphere`,g.vertexBuffer,g.indexBuffer,g.segments)},custom:function(e,t,n,r){let{isRenderingGlobe:i}=r,a=e.context,o=n.implementation,s=e.style.projection,c=e.transform,l=c.getProjectionDataForCustomLayer(i),u={farZ:c.farZ,nearZ:c.nearZ,fov:c.fov*Math.PI/180,modelViewProjectionMatrix:c.modelViewProjectionMatrix,projectionMatrix:c.projectionMatrix,shaderData:{variantName:s.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;\nuniform mat4 u_projection_matrix;\n${s.shaderPreludeCode.vertexSource}`,define:s.shaderDefine},defaultProjectionData:l},d=o.renderingMode?o.renderingMode:`2d`;if(e.renderPass===`offscreen`){let t=o.prerender;t&&(e.setCustomLayerDefaults(),a.setColorMode(e.colorModeForRenderPass()),t.call(o,a.gl,u),a.setDirty(),e.setBaseState())}else if(e.renderPass===`translucent`){e.setCustomLayerDefaults(),a.setColorMode(e.colorModeForRenderPass()),a.setStencilMode(K.disabled);let t=d===`3d`?e.getDepthModeFor3D():e.getDepthModeForSublayer(0,G.ReadOnly);a.setDepthMode(t),o.render(a.gl,u),a.setDirty(),e.setBaseState(),a.bindFramebuffer.set(null)}},debug:function(e,t,n){for(let r of n)Hi(e,t,r)},debugPadding:function(e){let t=e.transform.padding;zi(e,e.transform.height-(t.top||0),3,Pi),zi(e,t.bottom||0,3,Fi),Bi(e,t.left||0,3,Ii),Bi(e,e.transform.width-(t.right||0),3,Li);let n=e.transform.centerPoint;(function(e,t,n,r){Vi(e,t-1,n-10,2,20,r),Vi(e,t-10,n-1,20,2,r)})(e,n.x,e.transform.height-n.y,Ri)},terrainDepth:function(e,n){let r=e.context,i=r.gl,a=e.transform,o=U.unblended,s=new G(i.LEQUAL,G.ReadWrite,[0,1]),c=n.tileManager.getRenderableTiles(),l=e.useProgram(`terrainDepth`);r.bindFramebuffer.set(n.getFramebuffer(`depth`).framebuffer),r.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),r.clear({color:t.bo.transparent,depth:1});for(let e of c){let t=n.getTerrainMesh(e.tileID),c=n.getTerrainData(e.tileID),u=a.getProjectionData({overscaledTileID:e.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),d={u_ele_delta:n.getMeshFrameDelta(a.zoom)};l.draw(r,i.TRIANGLES,s,K.disabled,o,W.backCCW,d,c,u,`terrain`,t.vertexBuffer,t.indexBuffer,t.segments)}r.bindFramebuffer.set(null),r.viewport.set([0,0,e.width,e.height])},terrainCoords:function(e,n){let r=e.context,i=r.gl,a=e.transform,o=U.unblended,s=new G(i.LEQUAL,G.ReadWrite,[0,1]),c=n.getCoordsTexture(),l=n.tileManager.getRenderableTiles(),u=e.useProgram(`terrainCoords`);r.bindFramebuffer.set(n.getFramebuffer(`coords`).framebuffer),r.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),r.clear({color:t.bo.transparent,depth:1}),n.coordsIndex=[];for(let e of l){let t=n.getTerrainMesh(e.tileID),l=n.getTerrainData(e.tileID);r.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,c.texture);let d={u_terrain_coords_id:(255-n.coordsIndex.length)/255,u_texture:0,u_ele_delta:n.getMeshFrameDelta(a.zoom)},f=a.getProjectionData({overscaledTileID:e.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});u.draw(r,i.TRIANGLES,s,K.disabled,o,W.backCCW,d,l,f,`terrain`,t.vertexBuffer,t.indexBuffer,t.segments),n.coordsIndex.push(e.tileID.key)}r.bindFramebuffer.set(null),r.viewport.set([0,0,e.width,e.height])}};class Ki{constructor(e,n){this.drawFunctions=Gi,this.context=new si(e),this.transform=n,this._tileTextures={},this.terrainFacilitator={depthDirty:!0,coordsDirty:!1,matrix:t.ap(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Xe.maxOverzooming+Xe.maxUnderzooming+1,this.depthEpsilon=1/2**16,this.crossTileSymbolIndex=new Rt}resize(e,t,n){if(this.width=Math.floor(e*n),this.height=Math.floor(t*n),this.pixelRatio=n,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let e of this.style._order)this.style._layers[e].resize()}setup(){let e=this.context,n=new t.aV;n.emplaceBack(0,0),n.emplaceBack(t.a6,0),n.emplaceBack(0,t.a6),n.emplaceBack(t.a6,t.a6),this.tileExtentBuffer=e.createVertexBuffer(n,Vt.members),this.tileExtentSegments=t.aW.simpleSegment(0,0,4,2);let r=new t.aV;r.emplaceBack(0,0),r.emplaceBack(t.a6,0),r.emplaceBack(0,t.a6),r.emplaceBack(t.a6,t.a6),this.debugBuffer=e.createVertexBuffer(r,Vt.members),this.debugSegments=t.aW.simpleSegment(0,0,4,5);let i=new t.ch;i.emplaceBack(0,0,0,0),i.emplaceBack(t.a6,0,t.a6,0),i.emplaceBack(0,t.a6,0,t.a6),i.emplaceBack(t.a6,t.a6,t.a6,t.a6),this.rasterBoundsBuffer=e.createVertexBuffer(i,Rn.members),this.rasterBoundsSegments=t.aW.simpleSegment(0,0,4,2);let a=new t.aV;a.emplaceBack(0,0),a.emplaceBack(t.a6,0),a.emplaceBack(0,t.a6),a.emplaceBack(t.a6,t.a6),this.rasterBoundsBufferPosOnly=e.createVertexBuffer(a,Vt.members),this.rasterBoundsSegmentsPosOnly=t.aW.simpleSegment(0,0,4,5);let o=new t.aV;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,Vt.members),this.viewportSegments=t.aW.simpleSegment(0,0,4,2);let s=new t.ci;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(s);let c=new t.aX;c.emplaceBack(1,0,2),c.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(c);let l=this.context.gl;this.stencilClearMode=new K({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.tileExtentMesh=new Bt(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let e=this.context,n=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let r=t.O();t.c7(r,0,this.width,this.height,0,0,1),t.S(r,r,[n.drawingBufferWidth,n.drawingBufferHeight,0]);let i={mainMatrix:r,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:r};this.useProgram(`clippingMask`,null,!0).draw(e,n.TRIANGLES,G.disabled,this.stencilClearMode,U.disabled,W.disabled,null,null,i,`$clipping`,this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,t,n){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t?.length)return;this.currentStencilSource=e.source,this.nextStencilID+t.length>256&&this.clearStencil();let r=this.context;r.setColorMode(U.disabled),r.setDepthMode(G.disabled);let i={};for(let e of t)i[e.key]=this.nextStencilID++;this._renderTileMasks(i,t,n,!0),this._renderTileMasks(i,t,n,!1),this._tileClippingMaskIDs=i}_renderTileMasks(e,t,n,r){let i=this.context,a=i.gl,o=this.style.projection,s=this.transform,c=this.useProgram(`clippingMask`);for(let l of t){let t=e[l.key],u=this.style.map.terrain?.getTerrainData(l),d=o.getMeshFromTileID(this.context,l.canonical,r,!0,`stencil`),f=s.getProjectionData({overscaledTileID:l,applyGlobeMatrix:!n,applyTerrainMatrix:!0});c.draw(i,a.TRIANGLES,G.disabled,new K({func:a.ALWAYS,mask:0},t,255,a.KEEP,a.KEEP,a.REPLACE),U.disabled,n?W.disabled:W.backCCW,null,u,f,`$clipping`,d.vertexBuffer,d.indexBuffer,d.segments)}}_renderTilesDepthBuffer(){let e=this.context,t=e.gl,n=this.style.projection,r=this.transform,i=this.useProgram(`depth`),a=this.getDepthModeFor3D(),o=He(r,{tileSize:r.tileSize});for(let s of o){let o=this.style.map.terrain?.getTerrainData(s),c=n.getMeshFromTileID(this.context,s.canonical,!0,!0,`raster`),l=r.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!0,applyTerrainMatrix:!0});i.draw(e,t.TRIANGLES,a,K.disabled,U.disabled,W.backCCW,null,o,l,`$clipping`,c.vertexBuffer,c.indexBuffer,c.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,t=this.context.gl;return new K({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){let t=this.context.gl;return new K({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){let t=this.context.gl,n=e.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),r=n[n.length-1].overscaledZ,i=n[0].overscaledZ-r+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();let e={};for(let n=0;n<i;n++)e[n+r]=new K({func:t.GEQUAL,mask:255},n+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=i,[e,n]}return[{[r]:K.disabled},n]}stencilConfigForOverlapTwoPass(e){let t=this.context.gl,n=e.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),r=n[n.length-1].overscaledZ,i=n[0].overscaledZ-r+1;if(this.clearStencil(),i>1){let e={},a={};for(let n=0;n<i;n++)e[n+r]=new K({func:t.GREATER,mask:255},i+1+n,255,t.KEEP,t.KEEP,t.REPLACE),a[n+r]=new K({func:t.GREATER,mask:255},1+n,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID=2*i+1,[e,a,n]}return this.nextStencilID=3,[{[r]:new K({func:t.GREATER,mask:255},2,255,t.KEEP,t.KEEP,t.REPLACE)},{[r]:new K({func:t.GREATER,mask:255},1,255,t.KEEP,t.KEEP,t.REPLACE)},n]}colorModeForRenderPass(){let e=this.context.gl;if(this._showOverdrawInspector){let n=1/8;return new U([e.CONSTANT_COLOR,e.ONE],new t.bo(n,n,n,0),[!0,!0,!0,!0])}return this.renderPass===`opaque`?U.unblended:U.alphaBlended}getDepthModeForSublayer(e,t,n){if(!this.opaquePassEnabledForLayer())return G.disabled;let r=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new G(n||this.context.gl.LEQUAL,t,[r,r])}getDepthModeFor3D(){return new G(this.context.gl.LEQUAL,G.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,n){var r;this.style=e,this.options=n,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(l()),this.imageManager.beginFrame();let i=this.style._order,a=this.style.tileManagers,o={},s={},c={},u={isRenderingToTexture:!1,isRenderingGlobe:e.projection?.transitionState>0};for(let e in a){let t=a[e];t.used&&t.prepare(this.context),o[e]=t.getVisibleCoordinates(!1),s[e]=o[e].slice().reverse(),c[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<i.length;e++)if(this.style._layers[i[e]].is3D()){this.opaquePassCutoff=e;break}this.maybeDrawDepth(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass=`offscreen`;for(let e of i){let t=this.style._layers[e];if(!t.hasOffscreenPass()||t.isHidden(this.transform.zoom))continue;let n=s[t.source];(t.type===`custom`||n.length)&&this.renderLayer(this,a[t.source],t,n,u)}if((r=this.style.projection)==null||r.updateGPUdependent({context:this.context,useProgram:e=>this.useProgram(e)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?t.bo.black:t.bo.transparent,depth:1}),this.clearStencil(),this.style.sky&&this.drawFunctions.sky(this,this.style.sky),this._showOverdrawInspector=n.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass=`opaque`,this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){let e=this.style._layers[i[this.currentLayer]],t=a[e.source],n=o[e.source];this._renderTileClippingMasks(e,n,!1),this.renderLayer(this,t,e,n,u)}this.renderPass=`translucent`;let d=!1;for(this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){let e=this.style._layers[i[this.currentLayer]],t=a[e.source];if(this.renderToTexture?.renderLayer(e,u))continue;this.opaquePassEnabledForLayer()||d||(d=!0,u.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let n=(e.type===`symbol`?c:s)[e.source];this._renderTileClippingMasks(e,o[e.source],!!this.renderToTexture),this.renderLayer(this,t,e,n,u)}if(u.isRenderingGlobe&&this.drawFunctions.atmosphere(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let e=function(e,t){let n=null,r=Object.values(e._layers).flatMap((n=>n.source&&!n.isHidden(t)?[e.tileManagers[n.source]]:[])),i=r.filter((e=>e.getSource().type===`vector`)),a=r.filter((e=>e.getSource().type!==`vector`)),o=e=>{(!n||n.getSource().maxzoom<e.getSource().maxzoom)&&(n=e)};for(let e of i)o(e);if(!n)for(let e of a)o(e);return n}(this.style,this.transform.zoom);e&&this.drawFunctions.debug(this,e,e.getVisibleCoordinates())}this.options.showPadding&&this.drawFunctions.debugPadding(this),this.context.setDefault()}maybeDrawDepth(e){if(!this.style?.map?.terrain)return;let n=this.terrainFacilitator.matrix,r=this.transform.modelViewProjectionMatrix,i=this.terrainFacilitator.depthDirty;i||=e?!t.cj(n,r):!t.ck(n,r),i||=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime),i&&(t.cl(n,r),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.depthDirty=!1,this.terrainFacilitator.coordsDirty=!0,this.drawFunctions.terrainDepth(this,this.style.map.terrain))}maybeDrawCoords(){var e;(e=this.style?.map)!=null&&e.terrain&&this.terrainFacilitator.coordsDirty&&(this.terrainFacilitator.coordsDirty=!1,this.drawFunctions.terrainCoords(this,this.style.map.terrain))}renderLayer(e,n,r,i,a){if(r.isHidden(this.transform.zoom)||r.type!==`background`&&r.type!==`custom`&&!(i||[]).length)return;this.id=r.id;let o=this.drawFunctions;t.aR(r)?o.symbol(e,n,r,i,this.style.placement.variableOffsets,a):t.cm(r)?o.circle(e,n,r,i,a):t.cn(r)?o.heatmap(e,n,r,i,a):t.co(r)?o.line(e,n,r,i,a):t.cp(r)?o.fill(e,n,r,i,a):t.cq(r)?o.fillExtrusion(e,n,r,i,a):t.cr(r)?o.hillshade(e,n,r,i,a):t.cs(r)?o.colorRelief(e,n,r,i,a):t.bU(r)?o.raster(e,n,r,i,a):t.ct(r)?o.background(e,n,r,i,a):t.cu(r)&&o.custom(e,n,r,a)}saveTileTexture(e){let t=this._tileTextures[e.size[0]];t?t.length<Ki.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?t.push(e):e.destroy():this._tileTextures[e.size[0]]=[e]}getTileTexture(e){let t=this._tileTextures[e];return t&&t.length>0?t.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;let t=this.imageManager.getPattern(e.from.toString()),n=this.imageManager.getPattern(e.to.toString());return!t||!n}useProgram(e,t,n=!1,r=[]){this.cache=this.cache||{};let i=!!this.style.map.terrain,a=this.style.projection,o=n?V.projectionMercator:a.shaderPreludeCode,s=n?Ht:a.shaderDefine,c=e+(t?t.cacheKey:``)+`/${n?Ut:a.shaderVariantName}`+(this._showOverdrawInspector?`/overdraw`:``)+(i?`/terrain`:``)+(r?`/${r.join(`/`)}`:``);return this.cache[c]||(this.cache[c]=new Un(this.context,V[e],t,xr[e],this._showOverdrawInspector,i,o,s,r)),this.cache[c]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas??(this.debugOverlayCanvas=document.createElement(`canvas`),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){var e,t;if(this._tileTextures){for(let e in this._tileTextures){let t=this._tileTextures[e];if(t)for(let e of t)e.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&&((e=this.tileExtentMesh.vertexBuffer)==null||e.destroy()),this.tileExtentMesh&&((t=this.tileExtentMesh.indexBuffer)==null||t.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.cache){for(let e in this.cache){let t=this.cache[e];t!=null&&t.program&&this.context.gl.deleteProgram(t.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:e,drawingBufferHeight:t}=this.context.gl;return this.width!==e||this.height!==t}}function qi(e,t){let n,r=!1,i=null,a=()=>{i=null,r&&=(e(...n),i=setTimeout(a,t),!1)};return(...e)=>(r=!0,n=e,i||a(),i)}Ki.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50;class Ji{constructor(e){this._getCurrentHash=()=>{let e=window.location.hash.replace(`#`,``);if(this._hashName){let t,n=e.split(`&`).map((e=>e.split(`=`)));for(let e of n)e[0]===this._hashName&&(t=e);return(t&&t[1]||``).split(`/`)}return e.split(`/`)},this._onHashChange=()=>{let e=this._getCurrentHash();if(!this._isValidHash(e))return!1;let t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0},this._updateHashUnthrottled=()=>{let e=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,e)},this._removeHash=()=>{let e=this._getCurrentHash();if(e.length===0)return;let t=e.join(`/`),n=t;n.split(`&`).length>0&&(n=n.split(`&`)[0]),this._hashName&&(n=`${this._hashName}=${t}`);let r=window.location.hash.replace(n,``);r.startsWith(`#&`)?r=r.slice(0,1)+r.slice(2):r===`#`&&(r=``);let i=window.location.href.replace(/(#.+)?$/,r);i=i.replace(`&&`,`&`),window.history.replaceState(window.history.state,null,i)},this._updateHash=qi(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,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(e){let t=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,r=10**Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.round(t.lng*r)/r,a=Math.round(t.lat*r)/r,o=this._map.getBearing(),s=this._map.getPitch(),c=``;if(c+=e?`/${i}/${a}/${n}`:`${n}/${a}/${i}`,(o||s)&&(c+=`/`+Math.round(10*o)/10),s&&(c+=`/${Math.round(s)}`),this._hashName){let e=this._hashName,t=!1,n=window.location.hash.slice(1).split(`&`).map((n=>{let r=n.split(`=`)[0];return r===e?(t=!0,`${r}=${c}`):n})).filter((e=>e));return t||n.push(`${e}=${c}`),`#${n.join(`&`)}`}return`#${c}`}_isValidHash(e){if(e.length<3||e.some(isNaN))return!1;try{new t.W(+e[2],+e[1])}catch{return!1}let n=+e[0],r=+(e[3]||0),i=+(e[4]||0);return n>=this._map.getMinZoom()&&n<=this._map.getMaxZoom()&&r>=-180&&r<=180&&i>=this._map.getMinPitch()&&i<=this._map.getMaxPitch()}}let Yi={linearity:.3,easing:t.cv(0,0,.3,1)},Xi=t.e({deceleration:2500,maxSpeed:1400},Yi),Zi=t.e({deceleration:20,maxSpeed:1400},Yi),Qi=t.e({deceleration:1e3,maxSpeed:360},Yi),$i=t.e({deceleration:1e3,maxSpeed:90},Yi),ea=t.e({deceleration:1e3,maxSpeed:360},Yi);class ta{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:l(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,t=l();for(;e.length>0&&t-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let n={zoom:0,bearing:0,pitch:0,roll:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:e}of this._inertiaBuffer)n.zoom+=e.zoomDelta||0,n.bearing+=e.bearingDelta||0,n.pitch+=e.pitchDelta||0,n.roll+=e.rollDelta||0,e.panDelta&&n.pan._add(e.panDelta),e.around&&(n.around=e.around),e.pinchAround&&(n.pinchAround=e.pinchAround);let r=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(n.pan.mag()){let a=ra(n.pan.mag(),r,t.e({},Xi,e||{})),o=n.pan.mult(a.amount/n.pan.mag()),s=this._map.cameraHelper.handlePanInertia(o,this._map.transform);i.center=s.easingCenter,i.offset=s.easingOffset,na(i,a)}if(n.zoom){let e=ra(n.zoom,r,Zi);i.zoom=t.cw(this._map.transform.zoom+e.amount,this._map.getZoomSnap(),e.amount),na(i,e)}if(n.bearing){let e=ra(n.bearing,r,Qi);i.bearing=this._map.transform.bearing+t.al(e.amount,-179,179),na(i,e)}if(n.pitch){let e=ra(n.pitch,r,$i);i.pitch=this._map.transform.pitch+e.amount,na(i,e)}if(n.roll){let e=ra(n.roll,r,ea);i.roll=this._map.transform.roll+t.al(e.amount,-179,179),na(i,e)}if(i.zoom||i.bearing){let e=n.pinchAround===void 0?n.around:n.pinchAround;i.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),t.e(i,{noMoveStart:!0})}}function na(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function ra(e,n,r){let{maxSpeed:i,linearity:a,deceleration:o}=r,s=t.al(e*a/(n/1e3),-i,i),c=Math.abs(s)/(o*a);return{easing:r.easing,duration:1e3*c,amount:c/2*s}}class ia extends t.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,r,i={}){r=r instanceof MouseEvent?r:new MouseEvent(e,r);let a=d.mousePos(n.getCanvas(),r),o=n.unproject(a);super(e,t.e({point:a,lngLat:o,originalEvent:r},i)),this._defaultPrevented=!1,this.target=n}}class aa extends t.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,n,r){let i=e===`touchend`?r.changedTouches:r.touches,a=d.touchPos(n.getCanvasContainer(),i),o=a.map((e=>n.unproject(e))),s=a.reduce(((e,t,n,r)=>e.add(t.div(r.length))),new t.P(0,0));super(e,{points:a,point:s,lngLats:o,lngLat:n.unproject(s),originalEvent:r}),this._defaultPrevented=!1}}class oa extends t.n{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,n){super(e,{originalEvent:n}),this._defaultPrevented=!1}}class sa{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new oa(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new ia(e.type,this._map,e))}mouseup(e){this._map.fire(new ia(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new ia(e.type,this._map,e))}dblclick(e){return this._firePreventable(new ia(e.type,this._map,e))}mouseover(e){this._map.fire(new ia(e.type,this._map,e))}mouseout(e){this._map.fire(new ia(e.type,this._map,e))}touchstart(e){return this._firePreventable(new aa(e.type,this._map,e))}touchmove(e){this._map.fire(new aa(e.type,this._map,e))}touchend(e){this._map.fire(new aa(e.type,this._map,e))}touchcancel(e){this._map.fire(new aa(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ca{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new ia(e.type,this._map,e))}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(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new ia(e.type,this._map,e)),this._map.listens(`contextmenu`)&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class la{constructor(e){this._map=e}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(e){return this.transform.screenPointToLocation(t.P.convert(e),this._map.terrain)}}class ua{constructor(e,t){this._map=e,this._tr=new la(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1,t.boxZoom&&typeof t.boxZoom==`object`&&(this._boxZoomEnd=t.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&e.button===0&&(d.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;let n=t;if(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)return;let r=this._startPos;this._lastPos=n,this._box||(this._box=d.create(`div`,`maplibregl-boxzoom`,this._container),this._container.classList.add(`maplibregl-crosshair`),this._fireEvent(`boxzoomstart`,e));let i=Math.min(r.x,n.x),a=Math.max(r.x,n.x),o=Math.min(r.y,n.y),s=Math.max(r.y,n.y);this._box.style.transform=`translate(${i}px,${o}px)`,this._box.style.width=a-i+`px`,this._box.style.height=s-o+`px`}mouseupWindow(e,n){if(!this._active||e.button!==0)return;let r=this._startPos,i=n;if(this.reset(),d.suppressClick(),r.x!==i.x||r.y!==i.y)return this._map.fire(new t.n(`boxzoomend`,{originalEvent:e})),this._boxZoomEnd?void this._boxZoomEnd(this._map,r,i,e):{cameraAnimation:e=>e.fitScreenCoordinates(r,i,this._tr.bearing,{linear:!0})};this._fireEvent(`boxzoomcancel`,e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent(`boxzoomcancel`,e))}reset(){this._active=!1,this._container.classList.remove(`maplibregl-crosshair`),this._box&&=(this._box.remove(),null),d.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,n){return this._map.fire(new t.n(e,{originalEvent:n}))}}function da(e,t){if(e.length!==t.length)throw Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);let n={};for(let r=0;r<e.length;r++)n[e[r].identifier]=t[r];return n}class fa{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,n,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=function(e){let n=new t.P(0,0);for(let t of e)n._add(t);return n.div(e.length)}(n),this.touches=da(r,n)))}touchmove(e,t,n){if(this.aborted||!this.centroid)return;let r=da(n,t);for(let e in this.touches){let t=r[e];(!t||t.dist(this.touches[e])>30)&&(this.aborted=!0)}}touchend(e,t,n){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){let e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class pa{constructor(e){this.singleTap=new fa(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,n){this.singleTap.touchstart(e,t,n)}touchmove(e,t,n){this.singleTap.touchmove(e,t,n)}touchend(e,t,n){let r=this.singleTap.touchend(e,t,n);if(r){let t=e.timeStamp-this.lastTime<500,n=!this.lastTap||this.lastTap.dist(r)<30;if(t&&n||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}class ma{constructor(e){this._tr=new la(e),this._zoomIn=new pa({numTouches:1,numTaps:2}),this._zoomOut=new pa({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,n){this._zoomIn.touchstart(e,t,n),this._zoomOut.touchstart(e,t,n)}touchmove(e,t,n){this._zoomIn.touchmove(e,t,n),this._zoomOut.touchmove(e,t,n)}touchend(e,n,r){let i=this._zoomIn.touchend(e,n,r),a=this._zoomOut.touchend(e,n,r),o=this._tr;return i?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:n=>n.easeTo({duration:300,zoom:t.cw(o.zoom+1,n.getZoomSnap()),around:o.unproject(i)},{originalEvent:e})}):a?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:n=>n.easeTo({duration:300,zoom:t.cw(o.zoom-1,n.getZoomSnap()),around:o.unproject(a)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ha{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){let t=this._moveFunction(...e);if(t.bearingDelta||t.pitchDelta||t.rollDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(e,t){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(t)?t[0]:t,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;let n=this._lastPoint;if(!n)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);let r=Array.isArray(t)?t[0]:t;return!this._moved&&r.dist(n)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=r,this._move(n,r))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&d.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let Y={0:1,2:2};class ga{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){this._eventButton=e.button}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(e,t){let n=Y[t];return e.buttons===void 0||(e.buttons&n)!==n}(e,this._eventButton)}isValidEndEvent(e){return e.button===this._eventButton}}class _a{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}class va{constructor(e=new ga({checkCorrectEvent:()=>!0}),t=new _a){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=t}_executeRelevantHandler(e,t,n){return e instanceof MouseEvent?t(e):typeof TouchEvent<`u`&&e instanceof TouchEvent?n(e):void 0}startMove(e){this._executeRelevantHandler(e,(e=>{this.mouseMoveStateManager.startMove(e)}),(e=>{this.oneFingerTouchMoveStateManager.startMove(e)}))}endMove(e){this._executeRelevantHandler(e,(e=>{this.mouseMoveStateManager.endMove(e)}),(e=>{this.oneFingerTouchMoveStateManager.endMove(e)}))}isValidStartEvent(e){return this._executeRelevantHandler(e,(e=>this.mouseMoveStateManager.isValidStartEvent(e)),(e=>this.oneFingerTouchMoveStateManager.isValidStartEvent(e)))}isValidMoveEvent(e){return this._executeRelevantHandler(e,(e=>this.mouseMoveStateManager.isValidMoveEvent(e)),(e=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(e)))}isValidEndEvent(e){return this._executeRelevantHandler(e,(e=>this.mouseMoveStateManager.isValidEndEvent(e)),(e=>this.oneFingerTouchMoveStateManager.isValidEndEvent(e)))}}let ya=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=e=>{e.preventDefault()}};class ba{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,t,n){return this._calculateTransform(e,t,n)}touchmove(e,t,n){if(this._active){if(!this._shouldBePrevented(n.length))return e.preventDefault(),this._calculateTransform(e,t,n);this._map.cooperativeGestures.notifyGestureBlocked(`touch_pan`,e)}}touchend(e,t,n){this._calculateTransform(e,t,n),this._active&&this._shouldBePrevented(n.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,n,r){r.length>0&&(this._active=!0);let i=da(r,n),a=new t.P(0,0),o=new t.P(0,0),s=0;for(let e in i){let t=i[e],n=this._touches[e];n&&(a._add(t),o._add(t.sub(n)),s++,i[e]=t)}if(this._touches=i,this._shouldBePrevented(s)||!o.mag())return;let c=o.div(s);return this._sum._add(c),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(s),panDelta:c}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class xa{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,t,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,n){if(!this._firstTwoTouches)return;e.preventDefault();let[r,i]=this._firstTwoTouches,a=Sa(n,t,r),o=Sa(n,t,i);if(!a||!o)return;let s=this._aroundCenter?null:a.add(o).div(2);return this._move([a,o],s,e)}touchend(e,t,n){if(!this._firstTwoTouches)return;let[r,i]=this._firstTwoTouches,a=Sa(n,t,r),o=Sa(n,t,i);a&&o||(this._active&&d.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around===`center`}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Sa(e,t,n){for(let r=0;r<e.length;r++)if(e[r].identifier===n)return t[r]}function Ca(e,t){return Math.log(e/t)/Math.LN2}class wa extends xa{constructor(){super(),this._zoomRate=1,this._zoomThreshold=.1}setZoomRate(e){this._zoomRate=e??1}setZoomThreshold(e){this._zoomThreshold=e??.1}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){let n=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(Ca(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:Ca(this._distance,n)*this._zoomRate,pinchAround:t}}}function Ta(e,t){return 180*e.angleWith(t)/Math.PI}class Ea extends xa{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t,n){let r=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Ta(this._vector,r),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());let t=25/(Math.PI*this._minDiameter)*360,n=Ta(e,this._startVector);return Math.abs(n)<t}}function Da(e){return Math.abs(e.y)>Math.abs(e.x)}class Oa extends xa{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,n){super.touchstart(e,t,n),this._currentTouchCount=n.length}_start(e){this._lastPoints=e,Da(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,n){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let r=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(r,i,n.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(r.y+i.y)/2*-.5}):void 0}gestureBeginsVertically(e,t,n){if(this._valid!==void 0)return this._valid;let r=e.mag()>=2,i=t.mag()>=2;if(!r&&!i)return;if(!r||!i)return this._firstMove===void 0&&(this._firstMove=n),n-this._firstMove<100&&void 0;let a=e.y>0==t.y>0;return Da(e)&&Da(t)&&a}}let ka={panStep:100,bearingStep:15,pitchStep:10};class Aa{constructor(e){this._tr=new la(e);let t=ka;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let n=0,r=0,i=0,a=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),a=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(r=0,i=0),{cameraAnimation:s=>{let c=this._tr;s.easeTo({duration:300,easeId:`keyboardHandler`,easing:ja,zoom:n?t.cw(c.zoom+n*(e.shiftKey?2:1),s.getZoomSnap()):c.zoom,bearing:c.bearing+r*this._bearingStep,pitch:c.pitch+i*this._pitchStep,offset:[-a*this._panStep,-o*this._panStep],center:c.center},{originalEvent:e})}}}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 ja(e){return e*(2-e)}let Ma=4.000244140625;class Na{constructor(e,t){this._onTimeout=e=>{this._type=`wheel`,this._delta-=this._lastValue,this._active||this._start(e)},this._map=e,this._tr=new la(e),this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around===`center`)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked(`wheel_zoom`,e);let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=l(),r=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,t!==0&&t%Ma==0?this._type=`wheel`:t!==0&&Math.abs(t)<4?this._type=`trackpad`:r>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(r*t)<200?`trackpad`:`wheel`,this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&=null,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let n=d.mousePos(this._map.getCanvas(),e),r=this._tr;this._aroundPoint=this._aroundCenter?r.transform.locationToScreenPoint(t.W.convert(r.center)):n,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let e=this._tr.transform;if(typeof this._lastExpectedZoom==`number`){let t=e.zoom-this._lastExpectedZoom;typeof this._startZoom==`number`&&(this._startZoom+=t),typeof this._targetZoom==`number`&&(this._targetZoom+=t)}if(this._delta!==0){let n=this._type===`wheel`&&Math.abs(this._delta)>Ma?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&r!==0&&(r=1/r);let i=typeof this._targetZoom==`number`?t.ao(this._targetZoom):e.scale,a=e.applyConstrain(e.getCameraLngLat(),t.ar(i*r)).zoom,o=this._map.getZoomSnap();if(this._type===`wheel`&&o>0){let n=t.cw(e.zoom,o);this._targetZoom=t.cw(a,o,a-n)}else this._targetZoom=a;this._type===`wheel`&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let n=typeof this._targetZoom==`number`?this._targetZoom:e.zoom,r=this._startZoom,i=this._easing,a,o=!1;if(this._type===`wheel`&&r&&i){let e=l()-this._lastWheelEventTime,s=Math.min((e+5)/200,1),c=i(s);a=t.H.number(r,n,c),s<1?this._frameId||=!0:o=!0}else a=n,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-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let n=t.cy;if(this._prevEase){let e=this._prevEase,r=(l()-e.start)/e.duration,i=e.easing(r+.01)-e.easing(r),a=.27/Math.sqrt(i*i+1e-4)*.01,o=Math.sqrt(.0729-a*a);n=t.cv(a,o,.25,1)}return this._prevEase={start:l(),duration:e,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Pa{constructor(e,t){this._clickZoom=e,this._tapZoom=t}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 Fa{constructor(e){this._tr=new la(e),this.reset()}reset(){this._active=!1}dblclick(e,n){return e.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:t.cw(this._tr.zoom+(e.shiftKey?-1:1),r.getZoomSnap()),around:this._tr.unproject(n)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ia{constructor(){this._tap=new pa({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(e){this._zoomRate=e??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,n){if(!this._swipePoint)if(this._tapTime){let r=t[0],i=e.timeStamp-this._tapTime<500,a=this._tapPoint.dist(r)<30;i&&a?n.length>0&&(this._swipePoint=r,this._swipeTouch=n[0].identifier):this.reset()}else this._tap.touchstart(e,t,n)}touchmove(e,t,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;let r=t[0],i=r.y-this._swipePoint.y;return this._swipePoint=r,e.preventDefault(),this._active=!0,{zoomDelta:i/128*this._zoomRate}}}else this._tap.touchmove(e,t,n)}touchend(e,t,n){if(this._tapTime)this._swipePoint&&n.length===0&&this.reset();else{let r=this._tap.touchend(e,t,n);r&&(this._tapTime=e.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 La{constructor(e,t,n){this._el=e,this._mousePan=t,this._touchPan=n}enable(e){this._inertiaOptions=e||{},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 Ra{constructor(e,t,n,r){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=t,this._mousePitch=n,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 za{constructor(e,t,n,r){this._el=e,this._touchZoom=t,this._touchRotate=n,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),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()}setZoomRate(e){this._touchZoom.setZoomRate(e),this._tapDragZoom.setZoomRate(e)}setZoomThreshold(e){this._touchZoom.setZoomThreshold(e)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Ba{constructor(e,t){this._bypassKey=navigator.userAgent.includes(`Mac`)?`metaKey`:`ctrlKey`,this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add(`maplibregl-cooperative-gestures`),this._container=d.create(`div`,`maplibregl-cooperative-gesture-screen`,e);let t=this._map._getUIString(`CooperativeGesturesHandler.WindowsHelpText`);this._bypassKey===`metaKey`&&(t=this._map._getUIString(`CooperativeGesturesHandler.MacHelpText`));let n=this._map._getUIString(`CooperativeGesturesHandler.MobileHelpText`),r=document.createElement(`div`);r.className=`maplibregl-desktop-message`,r.textContent=t,this._container.appendChild(r);let i=document.createElement(`div`);i.className=`maplibregl-mobile-message`,i.textContent=n,this._container.appendChild(i),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(e){return e[this._bypassKey]}notifyGestureBlocked(e,n){this._enabled&&(this._map.fire(new t.n(`cooperativegestureprevented`,{gestureType:e,originalEvent:n})),this._container.classList.add(`maplibregl-show`),setTimeout((()=>{this._container.classList.remove(`maplibregl-show`)}),100))}}let Va=e=>e.zoom||e.drag||e.roll||e.pitch||e.rotate;class Ha extends t.n{}function Ua(e){return e.panDelta?.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta||e.rollDelta}class Wa{get _ownerDocument(){return this._el?.ownerDocument||document}get _ownerWindow(){return this._el?.ownerDocument?.defaultView||window}constructor(e,n){this.handleWindowEvent=e=>{this.handleEvent(e,`${e.type}Window`)},this.handleEvent=(e,n)=>{if(e.type===`blur`)return void this.stop(!0);this._updatingCamera=!0;let r=e.type===`renderFrame`?void 0:e,i={needsRenderFrame:!1},a={},o={};for(let{handlerName:s,handler:c,allowed:l}of this._handlers){if(!c.isEnabled())continue;let u;if(this._blockedByActive(o,l,s))c.reset();else if(c[n||e.type]){if(t.cz(e,n||e.type)){let t=d.mousePos(this._map.getCanvas(),e);u=c[n||e.type](e,t)}else if(t.cA(e,n||e.type)){let t=this._getMapTouches(e.touches),r=d.touchPos(this._map.getCanvas(),t);u=c[n||e.type](e,r,t)}else t.cB(n||e.type)||(u=c[n||e.type](e));this.mergeHandlerResult(i,a,u,s,r),u!=null&&u.needsRenderFrame&&this._triggerRenderFrame()}(u||c.isActive())&&(o[s]=c)}let s={};for(let e in this._previousActiveHandlers)o[e]||(s[e]=r);this._previousActiveHandlers=o,(Object.keys(s).length||Ua(i))&&(this._changes.push([i,a,s]),this._triggerRenderFrame()),(Object.keys(o).length||Ua(i))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:c}=i;c&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],c(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ta(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n);let 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(let[e,t,n]of this._listeners)e.addEventListener(t,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,n)}destroy(){for(let[e,t,n]of this._listeners)e.removeEventListener(t,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,n)}_addDefaultHandlers(e){let n=this._map,r=n.getCanvasContainer();this._add(`mapEvent`,new sa(n,e));let i=n.boxZoom=new ua(n,e);this._add(`boxZoom`,i),e.interactive&&e.boxZoom&&i.enable();let a=n.cooperativeGestures=new Ba(n,e.cooperativeGestures);this._add(`cooperativeGestures`,a),e.cooperativeGestures&&a.enable();let o=new ma(n),s=new Fa(n);n.doubleClickZoom=new Pa(s,o),this._add(`tapZoom`,o),this._add(`clickZoom`,s),e.interactive&&e.doubleClickZoom&&n.doubleClickZoom.enable();let c=new Ia;this._add(`tapDragZoom`,c);let l=n.touchPitch=new Oa(n);this._add(`touchPitch`,l),e.interactive&&e.touchPitch&&n.touchPitch.enable(e.touchPitch);let u=()=>n.project(n.getCenter()),d=function({enable:e,clickTolerance:n,aroundCenter:r=!0,minPixelCenterThreshold:i=100,rotateDegreesPerPixelMoved:a=.8},o){return new ha({clickTolerance:n,move:(e,n)=>{let s=o();if(r&&Math.abs(s.y-e.y)>i)return{bearingDelta:t.cx(new t.P(e.x,n.y),n,s)};let c=(n.x-e.x)*a;return r&&n.y<s.y&&(c=-c),{bearingDelta:c}},moveStateManager:new ga({checkCorrectEvent:e=>e.button===0&&e.ctrlKey||e.button===2&&!e.ctrlKey}),enable:e,assignEvents:ya})}(e,u),f=function({enable:e,clickTolerance:t,pitchDegreesPerPixelMoved:n=-.5}){return new ha({clickTolerance:t,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:new ga({checkCorrectEvent:e=>e.button===0&&e.ctrlKey||e.button===2}),enable:e,assignEvents:ya})}(e),p=function({enable:e,clickTolerance:t,rollDegreesPerPixelMoved:n=.3},r){return new ha({clickTolerance:t,move:(e,t)=>{let i=r(),a=(t.x-e.x)*n;return t.y<i.y&&(a=-a),{rollDelta:a}},moveStateManager:new ga({checkCorrectEvent:e=>e.button===2&&e.ctrlKey}),enable:e,assignEvents:ya})}(e,u);n.dragRotate=new Ra(e,d,f,p),this._add(`mouseRotate`,d,[`mousePitch`]),this._add(`mousePitch`,f,[`mouseRotate`,`mouseRoll`]),this._add(`mouseRoll`,p,[`mousePitch`]),e.interactive&&e.dragRotate&&n.dragRotate.enable();let m=function({enable:e,clickTolerance:t}){return new ha({clickTolerance:t,move:(e,t)=>({around:t,panDelta:t.sub(e)}),activateOnStart:!0,moveStateManager:new ga({checkCorrectEvent:e=>e.button===0&&!e.ctrlKey}),enable:e,assignEvents:ya})}(e),h=new ba(e,n);n.dragPan=new La(r,m,h),this._add(`mousePan`,m),this._add(`touchPan`,h,[`touchZoom`,`touchRotate`]),e.interactive&&e.dragPan&&n.dragPan.enable(e.dragPan);let g=new Ea,_=new wa;n.touchZoomRotate=new za(r,_,g,c),this._add(`touchRotate`,g,[`touchPan`,`touchZoom`]),this._add(`touchZoom`,_,[`touchPan`,`touchRotate`]),e.interactive&&e.touchZoomRotate&&n.touchZoomRotate.enable(e.touchZoomRotate),this._add(`blockableMapEvent`,new ca(n));let v=n.scrollZoom=new Na(n,(()=>this._triggerRenderFrame()));this._add(`scrollZoom`,v,[`mousePan`]),e.interactive&&e.scrollZoom&&n.scrollZoom.enable(e.scrollZoom);let y=n.keyboard=new Aa(n);this._add(`keyboard`,y),e.interactive&&e.keyboard&&n.keyboard.enable()}_add(e,t,n){this._handlers.push({handlerName:e,handler:t,allowed:n}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(let{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Va(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,t,n){for(let r in e)if(r!==n&&!t?.includes(r))return!0;return!1}_getMapTouches(e){let t=[];for(let n of e)this._el.contains(n.target)&&t.push(n);return t}mergeHandlerResult(e,n,r,i,a){if(!r)return;t.e(e,r);let o={handlerName:i,originalEvent:r.originalEvent||a};r.zoomDelta!==void 0&&(n.zoom=o),r.panDelta!==void 0&&(n.drag=o),r.rollDelta!==void 0&&(n.roll=o),r.pitchDelta!==void 0&&(n.pitch=o),r.bearingDelta!==void 0&&(n.rotate=o)}_applyChanges(){let e={},n={},r={};for(let[i,a,o]of this._changes)i.panDelta&&(e.panDelta=(e.panDelta||new t.P(0,0))._add(i.panDelta)),i.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+i.pitchDelta),i.rollDelta&&(e.rollDelta=(e.rollDelta||0)+i.rollDelta),i.around!==void 0&&(e.around=i.around),i.pinchAround!==void 0&&(e.pinchAround=i.pinchAround),i.noInertia&&(e.noInertia=i.noInertia),t.e(n,a),t.e(r,o);this._updateMapTransform(e,n,r),this._changes=[]}_updateMapTransform(e,t,n){let r=this._map,i=r._getTransformForUpdate(),a=r.terrain;if(!(Ua(e)||a&&this._terrainMovement))return void this._fireEvents(t,n,!0);r._stop(!0);let{panDelta:o,zoomDelta:s,bearingDelta:c,pitchDelta:l,rollDelta:u,around:d,pinchAround:f}=e;f!==void 0&&(d=f),d||=r.transform.centerPoint,a&&!i.isPointOnMapSurface(d)&&(d=i.centerPoint);let p={panDelta:o,zoomDelta:s,rollDelta:u,pitchDelta:l,bearingDelta:c,around:d};this._map.cameraHelper.useGlobeControls&&!i.isPointOnMapSurface(d)&&(d=i.centerPoint);let m=d.distSqr(i.centerPoint)<.01?i.center:i.screenPointToLocation(o?d.sub(o):d);this._handleMapControls({terrain:a,tr:i,deltasForHelper:p,preZoomAroundLoc:m,combinedEventsInProgress:t,panDelta:o}),r._applyUpdatedTransform(i),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,n,!0)}_handleMapControls({terrain:e,tr:t,deltasForHelper:n,preZoomAroundLoc:r,combinedEventsInProgress:i,panDelta:a}){let o=this._map.cameraHelper;if(o.handleMapControlsRollPitchBearingZoom(n,t),e)return o.useGlobeControls?(this._terrainMovement||!i.drag&&!i.zoom||(this._terrainMovement=!0,this._map._elevationFreeze=!0),void o.handleMapControlsPan(n,t,r)):this._terrainMovement||!i.drag&&!i.zoom?void(i.drag&&this._terrainMovement&&a?t.setCenter(t.screenPointToLocation(t.centerPoint.sub(a))):o.handleMapControlsPan(n,t,r)):(this._terrainMovement=!0,this._map._elevationFreeze=!0,void o.handleMapControlsPan(n,t,r));o.handleMapControlsPan(n,t,r)}_fireEvents(e,n,r){let i=Va(this._eventsInProgress),a=Va(e),o={};for(let t in e){let{originalEvent:n}=e[t];this._eventsInProgress[t]||(o[`${t}start`]=n),this._eventsInProgress[t]=e[t]}!i&&a&&this._fireEvent(`movestart`,a.originalEvent);for(let e in o)this._fireEvent(e,o[e]);a&&this._fireEvent(`move`,a.originalEvent);for(let t in e){let{originalEvent:n}=e[t];this._fireEvent(t,n)}let c={},l;for(let e in this._eventsInProgress){let{handlerName:t,originalEvent:r}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=n[t]||r,c[`${e}end`]=l)}for(let e in c)this._fireEvent(e,c[e]);let u=Va(this._eventsInProgress),d=(i||a)&&!u;if(d&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let e=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&e.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(e)}if(r&&d){this._updatingCamera=!0;let e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),n=e=>e!==0&&-this._bearingSnap<e&&e<this._bearingSnap;!e||!e.essential&&s.prefersReducedMotion?(this._map.fire(new t.n(`moveend`,{originalEvent:l})),n(this._map.getBearing())&&this._map.resetNorth()):(n(e.bearing||this._map.getBearing())&&(e.bearing=0),e.freezeElevation=!0,this._map.easeTo(e,{originalEvent:l})),this._updatingCamera=!1}}_fireEvent(e,n){this._map.fire(new t.n(e,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{delete this._frameId,this.handleEvent(new Ha(`renderFrame`,{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Ga extends t.E{constructor(e,t,n){super(),this._renderFrameCallback=()=>{let e=Math.min((l()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=n.bearingSnap,this._zoomSnap=n.zoomSnap,this.cameraHelper=t,this.on(`moveend`,(()=>{delete this._requestedCameraState}))}migrateProjection(e,t){e.apply(this.transform,!0),this.transform=e,this.cameraHelper=t}getCenter(){return new t.W(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,t){return this.jumpTo({elevation:e},t),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,n,r){return e=t.P.convert(e).mult(-1),this.panTo(this.transform.center,t.e({offset:e},n),r)}panTo(e,n,r){return this.easeTo(t.e({center:e},n),r)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,n,r){return this.easeTo(t.e({zoom:e},n),r)}zoomIn(e,n){return this.zoomTo(t.cw(this.getZoom()+1,this._zoomSnap),e,n),this}zoomOut(e,n){return this.zoomTo(t.cw(this.getZoom()-1,this._zoomSnap),e,n),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,n){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new t.n(`movestart`,n)).fire(new t.n(`move`,n)).fire(new t.n(`moveend`,n))),this}getBearing(){return this.transform.bearing}setZoomSnap(e){return this._zoomSnap=e,this}getZoomSnap(){return this._zoomSnap}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,n,r){return this.easeTo(t.e({bearing:e},n),r)}resetNorth(e,n){return this.rotateTo(0,t.e({duration:1e3},e),n),this}resetNorthPitch(e,n){return this.easeTo(t.e({bearing:0,pitch:0,roll:0,duration:1e3},e),n),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}getRoll(){return this.transform.roll}setRoll(e,t){return this.jumpTo({roll:e},t),this}cameraForBounds(e,t){e=se.convert(e).adjustAntiMeridian();let n=t?.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),n,t)}_cameraForBoxAndBearing(e,n,r,i){let a={top:0,bottom:0,right:0,left:0};if(typeof(i=t.e({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding==`number`){let e=i.padding;i.padding={top:e,bottom:e,right:e,left:e}}let o=t.e(a,i.padding);i.padding=o;let s=this.transform,c=new se(e,n),l=this.cameraHelper.cameraForBoxAndBearing(i,o,c,r,s);return l&&this._zoomSnap&&(l.zoom=t.cw(l.zoom,this._zoomSnap,-1)),l}fitBounds(e,t,n){return this._fitInternal(this.cameraForBounds(e,t),t,n)}fitScreenCoordinates(e,n,r,i,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(t.P.convert(e)),this.transform.screenPointToLocation(t.P.convert(n)),r,i),i,a)}_fitInternal(e,n,r){return e?(delete(n=t.e(e,n)).padding,n.linear?this.easeTo(n,r):this.flyTo(n,r)):this}jumpTo(e,n){this.stop(),`zoom`in e&&this._zoomSnap&&(e.zoom=t.cw(e.zoom,this._zoomSnap));let r=this._getTransformForUpdate(),i=!1,a=!1,o=!1,s=r.zoom;this.terrain&&r.setElevation(this.terrain.getElevationForLngLatZoom(e.center?t.W.convert(e.center):r.center,e.zoom||r.tileZoom)),this.cameraHelper.handleJumpToCenterZoom(r,e);let c=r.zoom!==s;return`elevation`in e&&r.elevation!==+e.elevation&&r.setElevation(+e.elevation),`bearing`in e&&r.bearing!==+e.bearing&&(i=!0,r.setBearing(+e.bearing)),`pitch`in e&&r.pitch!==+e.pitch&&(a=!0,r.setPitch(+e.pitch)),`roll`in e&&r.roll!==+e.roll&&(o=!0,r.setRoll(+e.roll)),e.padding==null||r.isPaddingEqual(e.padding)||r.setPadding(e.padding),this._applyUpdatedTransform(r),this.fire(new t.n(`movestart`,n)).fire(new t.n(`move`,n)),c&&this.fire(new t.n(`zoomstart`,n)).fire(new t.n(`zoom`,n)).fire(new t.n(`zoomend`,n)),i&&this.fire(new t.n(`rotatestart`,n)).fire(new t.n(`rotate`,n)).fire(new t.n(`rotateend`,n)),a&&this.fire(new t.n(`pitchstart`,n)).fire(new t.n(`pitch`,n)).fire(new t.n(`pitchend`,n)),o&&this.fire(new t.n(`rollstart`,n)).fire(new t.n(`roll`,n)).fire(new t.n(`rollend`,n)),this.fire(new t.n(`moveend`,n))}calculateCameraOptionsFromTo(e,n,r,i=0){let a=t.a7.fromLngLat(e,n),o=t.a7.fromLngLat(r,i),s=o.x-a.x,c=o.y-a.y,l=o.z-a.z,u=Math.hypot(s,c,l);if(u===0)throw Error(`Can't calculate camera options with same From and To`);let d=Math.hypot(s,c),f=t.ar(this.transform.cameraToCenterDistance/u/this.transform.tileSize),p=180*Math.atan2(s,-c)/Math.PI,m=180*Math.acos(d/u)/Math.PI;return m=l<0?90-m:90+m,{center:o.toLngLat(),elevation:i,zoom:f,pitch:m,bearing:p}}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,n,r,i){let a=this.transform.calculateCenterFromCameraLngLatAlt(e,t,n,r);return{center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:n,pitch:r,roll:i}}easeTo(e,n){this._stop(!1,e.easeId),`zoom`in(e=t.e({offset:[0,0],duration:500,easing:t.cy},e))&&this._zoomSnap&&(e.zoom=t.cw(e.zoom,this._zoomSnap)),(!1===e.animate||!e.essential&&s.prefersReducedMotion)&&(e.duration=0);let r=this._getTransformForUpdate(),i=this.getBearing(),a=r.pitch,o=r.roll,c=`bearing`in e?this._normalizeBearing(e.bearing,i):i,l=`pitch`in e?+e.pitch:a,u=`roll`in e?this._normalizeBearing(e.roll,o):o,d=`padding`in e?e.padding:r.padding,f=t.P.convert(e.offset),p,m;e.around&&(p=t.W.convert(e.around),m=r.locationToScreenPoint(p));let h={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},g=this.cameraHelper.handleEaseTo(r,{bearing:c,pitch:l,roll:u,padding:d,around:p,aroundPoint:m,offsetAsPoint:f,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating=this._rotating||i!==c,this._pitching=this._pitching||l!==a,this._rolling=this._rolling||u!==o,this._padding=!r.isPaddingEqual(d),this._zooming=this._zooming||g.isZooming,this._easeId=e.easeId,this._prepareEase(n,e.noMoveStart,h),this.terrain&&this._prepareElevation(g.elevationCenter),this._ease((t=>{g.easeFunc(t),this.terrain&&!e.freezeElevation&&this._updateElevation(t),this._applyUpdatedTransform(r),this._fireMoveEvents(n)}),(t=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(n,t)}),e),this}_prepareEase(e,n,r={}){this._moving=!0,n||r.moving||this.fire(new t.n(`movestart`,e)),this._zooming&&!r.zooming&&this.fire(new t.n(`zoomstart`,e)),this._rotating&&!r.rotating&&this.fire(new t.n(`rotatestart`,e)),this._pitching&&!r.pitching&&this.fire(new t.n(`pitchstart`,e)),this._rolling&&!r.rolling&&this.fire(new t.n(`rollstart`,e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this._elevationStart!==void 0&&this._elevationCenter!==void 0||this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let n=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&n!==this._elevationTarget){let t=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(t-(n-(t*e+this._elevationStart))/(1-e)),this._elevationTarget=n}this.transform.setElevation(t.H.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||=this.transform.clone(),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};let t=e.getCameraLngLat(),n=e.getCameraAltitude(),r=this.terrain?this.terrain.getElevationForLngLatZoom(t,e.zoom):0;if(n<r){let n=this.calculateCameraOptionsFromTo(t,r,e.center,e.elevation);return{pitch:n.pitch,zoom:n.zoom}}return{}}_applyUpdatedTransform(e){let t=[];if(t.push((e=>this._elevateCameraIfInsideTerrain(e))),this.transformCameraUpdate&&t.push((e=>this.transformCameraUpdate(e))),!t.length)return;let n=e.clone();for(let e of t){let t=n.clone(),{center:r,zoom:i,roll:a,pitch:o,bearing:s,elevation:c}=e(t);r&&t.setCenter(r),c!==void 0&&t.setElevation(c),i!==void 0&&t.setZoom(i),a!==void 0&&t.setRoll(a),o!==void 0&&t.setPitch(o),s!==void 0&&t.setBearing(s),n.apply(t,!1)}this.transform.apply(n,!1)}_fireMoveEvents(e){this.fire(new t.n(`move`,e)),this._zooming&&this.fire(new t.n(`zoom`,e)),this._rotating&&this.fire(new t.n(`rotate`,e)),this._pitching&&this.fire(new t.n(`pitch`,e)),this._rolling&&this.fire(new t.n(`roll`,e))}_afterEase(e,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;let r=this._zooming,i=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 t.n(`zoomend`,e)),i&&this.fire(new t.n(`rotateend`,e)),a&&this.fire(new t.n(`pitchend`,e)),o&&this.fire(new t.n(`rollend`,e)),this.fire(new t.n(`moveend`,e))}flyTo(e,n){if(!e.essential&&s.prefersReducedMotion){let r=t.V(e,[`center`,`zoom`,`bearing`,`pitch`,`roll`,`elevation`,`padding`]);return this.jumpTo(r,n)}this.stop(),`zoom`in(e=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.cy},e))&&this._zoomSnap&&(e.zoom=t.cw(e.zoom,this._zoomSnap));let r=this._getTransformForUpdate(),i=r.bearing,a=r.pitch,o=r.roll,c=r.padding,l=`bearing`in e?this._normalizeBearing(e.bearing,i):i,u=`pitch`in e?+e.pitch:a,d=`roll`in e?this._normalizeBearing(e.roll,o):o,f=`padding`in e?e.padding:r.padding,p=t.P.convert(e.offset),m=r.centerPoint.add(p),h=r.screenPointToLocation(m),g=this.cameraHelper.handleFlyTo(r,{bearing:l,pitch:u,roll:d,padding:f,locationAtOffset:h,offsetAsPoint:p,center:e.center,minZoom:e.minZoom,zoom:e.zoom}),_=e.curve,v=Math.max(r.width,r.height),y=v/g.scaleOfZoom,b=g.pixelPathLength;typeof g.scaleOfMinZoom==`number`&&(_=Math.sqrt(v/g.scaleOfMinZoom/b*2));let x=_*_;function S(e){let t=(y*y-v*v+(e?-1:1)*x*x*b*b)/(2*(e?y:v)*x*b);return Math.log(Math.sqrt(t*t+1)-t)}function C(e){return(Math.exp(e)-Math.exp(-e))/2}function w(e){return(Math.exp(e)+Math.exp(-e))/2}let T=S(!1),E=function(e){return w(T)/w(T+_*e)},D=function(e){return v*((w(T)*(C(t=T+_*e)/w(t))-C(T))/x)/b;var t},O=(S(!0)-T)/_;if(Math.abs(b)<2e-6||!isFinite(O)){if(Math.abs(v-y)<1e-6)return this.easeTo(e,n);let t=y<v?-1:1;O=Math.abs(Math.log(y/v))/_,D=()=>0,E=e=>Math.exp(t*_*e)}return e.duration=`duration`in e?+e.duration:1e3*O/(`screenSpeed`in e?+e.screenSpeed/_:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=i!==l,this._pitching=u!==a,this._rolling=d!==o,this._padding=!r.isPaddingEqual(f),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(g.targetCenter),this._ease((s=>{let h=s*O,_=1/E(h),v=D(h);this._rotating&&r.setBearing(t.H.number(i,l,s)),this._pitching&&r.setPitch(t.H.number(a,u,s)),this._rolling&&r.setRoll(t.H.number(o,d,s)),this._padding&&(r.interpolatePadding(c,f,s),m=r.centerPoint.add(p)),g.easeFunc(s,_,v,m),this.terrain&&!e.freezeElevation&&this._updateElevation(s),this._applyUpdatedTransform(r),this._fireMoveEvents(n)}),(()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(n)}),e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){var n;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let e=this._onEaseEnd;delete this._onEaseEnd,e.call(this,t)}return e||(n=this.handlers)==null||n.stop(!1),this}_ease(e,t,n){!1===n.animate||n.duration===0?(e(1),t()):(this._easeStart=l(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,n){e=t.X(e,-180,180);let r=Math.abs(e-n);return Math.abs(e-360-n)<r&&(e-=360),Math.abs(e+360-n)<r&&(e+=360),e}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLat(t.W.convert(e),this.transform):null}}let Ka={compact:!0,customAttribution:`<a href="https://maplibre.org/" target="_blank">MapLibre</a>`};class X{constructor(e=Ka){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=e=>{!e||e.sourceDataType!==`metadata`&&e.sourceDataType!==`visibility`&&e.dataType!==`style`&&e.type!==`terrain`||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=e}getDefaultPosition(){return`bottom-right`}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=d.create(`details`,`maplibregl-ctrl maplibregl-ctrl-attrib`),this._compactButton=d.create(`summary`,`maplibregl-ctrl-attrib-button`,this._container),this._compactButton.addEventListener(`click`,this._toggleAttribution),this._setElementTitle(this._compactButton,`ToggleAttribution`),this._innerContainer=d.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(e,t){let n=this._map._getUIString(`AttributionControl.${t}`);e.title=n,e.setAttribute(`aria-label`,n)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map((e=>typeof e==`string`?e:``))):typeof this.options.customAttribution==`string`&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}let t=this._map.style.tileManagers;for(let n in t){let r=t[n];if(r.used||r.usedForTerrain){let t=r.getSource();t.attribution&&!e.includes(t.attribution)&&e.push(t.attribution)}}e=e.filter((e=>String(e).trim())),e.sort(((e,t)=>e.length-t.length)),e=e.filter(((t,n)=>{for(let r=n+1;r<e.length;r++)if(e[r].includes(t))return!1;return!0}));let n=e.join(` | `);n!==this._attribHTML&&(this._attribHTML=n,e.length?(this._innerContainer.innerHTML=d.sanitize(n),this._container.classList.remove(`maplibregl-attrib-empty`)):this._container.classList.add(`maplibregl-attrib-empty`),this._updateCompact(),this._editLink=null)}}class Z{constructor(e={}){this._updateCompact=()=>{let e=this._container.children;if(e.length){let t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&t.classList.add(`maplibregl-compact`):t.classList.remove(`maplibregl-compact`)}},this.options=e}getDefaultPosition(){return`bottom-left`}onAdd(e){this._map=e,this._compact=this.options?.compact,this._container=d.create(`div`,`maplibregl-ctrl`);let t=d.create(`a`,`maplibregl-ctrl-logo`);return t.target=`_blank`,t.rel=`noopener nofollow`,t.href=`https://maplibre.org/`,t.setAttribute(`aria-label`,this._map._getUIString(`LogoControl.Title`)),t.setAttribute(`rel`,`noopener nofollow`),this._container.appendChild(t),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(e){let t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){let t=this._currentlyRunning,n=t?this._queue.concat(t):this._queue;for(let t of n)if(t.id===e)return void(t.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw Error(`Attempting to run(), but is already running.`);let t=this._currentlyRunning=this._queue;this._queue=[];for(let n of t)if(!n.cancelled&&(n.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ja=t.aT([{name:`a_pos3d`,type:`Int16`,components:3}]);class Ya extends t.E{constructor(e){super(),this._lastTilesetChange=l(),this.tileManager=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null}getSource(){return this.tileManager._source}update(e,n){this.tileManager.update(e,n),this._renderableTilesKeys=[];let r={};for(let i of He(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:n,calculateTileZoom:this.tileManager._source.calculateTileZoom}))r[i.key]=!0,this._renderableTilesKeys.push(i.key),this._tiles[i.key]||(i.terrainRttPosMatrix32f=new Float64Array(16),t.c7(i.terrainRttPosMatrix32f,0,t.a6,t.a6,0,0,1),this._tiles[i.key]=new Ae(i,this.tileSize),this._lastTilesetChange=l());for(let e in this._tiles)r[e]||delete this._tiles[e]}freeRtt(e){for(let t in this._tiles){let n=this._tiles[t];(!e||n.tileID.equals(e)||n.tileID.isChildOf(e)||e.isChildOf(n.tileID))&&(n.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((e=>this.getTileByID(e)))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,t){return t?this._getTerrainCoordsForTileRanges(e,t):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){let n={};for(let r of this._renderableTilesKeys){let i=this._tiles[r].tileID,a=e.clone(),o=t.bj();if(i.canonical.equals(e.canonical))t.c7(o,0,t.a6,t.a6,0,0,1);else if(i.canonical.isChildOf(e.canonical)){let n=i.canonical.z-e.canonical.z,r=i.canonical.x-(i.canonical.x>>n<<n),a=i.canonical.y-(i.canonical.y>>n<<n),s=t.a6>>n;t.c7(o,0,s,s,0,0,1),t.Q(o,o,[-r*s,-a*s,0])}else{if(!e.canonical.isChildOf(i.canonical))continue;{let n=e.canonical.z-i.canonical.z,r=e.canonical.x-(e.canonical.x>>n<<n),a=e.canonical.y-(e.canonical.y>>n<<n),s=t.a6>>n;t.c7(o,0,t.a6,t.a6,0,0,1),t.Q(o,o,[r*s,a*s,0]),t.S(o,o,[1/2**n,1/2**n,0])}}a.terrainRttPosMatrix32f=new Float32Array(o),n[r]=a}return n}_getTerrainCoordsForTileRanges(e,n){let r={};for(let i of this._renderableTilesKeys){let a=this._tiles[i].tileID;if(!this._isWithinTileRanges(a,n))continue;let o=e.clone(),s=t.bj();if(a.canonical.z===e.canonical.z){let n=e.canonical.x-a.canonical.x+e.wrap*(1<<e.canonical.z),r=e.canonical.y-a.canonical.y;t.c7(s,0,t.a6,t.a6,0,0,1),t.Q(s,s,[n*t.a6,r*t.a6,0])}else if(a.canonical.z>e.canonical.z){let n=a.canonical.z-e.canonical.z,r=a.canonical.x-(a.canonical.x>>n<<n)+e.wrap*(1<<a.canonical.z),i=a.canonical.y-(a.canonical.y>>n<<n),o=e.canonical.x-(a.canonical.x>>n),c=e.canonical.y-(a.canonical.y>>n),l=t.a6>>n;t.c7(s,0,l,l,0,0,1),t.Q(s,s,[-r*l+o*t.a6,-i*l+c*t.a6,0])}else{let n=e.canonical.z-a.canonical.z,r=e.canonical.x-(e.canonical.x>>n<<n)+e.wrap*(1<<e.canonical.z),i=e.canonical.y-(e.canonical.y>>n<<n),o=(e.canonical.x>>n)-a.canonical.x,c=(e.canonical.y>>n)-a.canonical.y,l=t.a6<<n;t.c7(s,0,l,l,0,0,1),t.Q(s,s,[r*t.a6+o*l,i*t.a6+c*l,0])}o.terrainRttPosMatrix32f=new Float32Array(s),r[i]=o}return r}getSourceTile(e,t){let n=this.tileManager._source,r=e.overscaledZ-this.deltaZoom;if(r>n.maxzoom&&(r=n.maxzoom),r<n.minzoom)return;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(r).key);let i=this.findTileInCaches(this._sourceTileCache[e.key]);if(!i?.dem&&t)for(;r>=n.minzoom&&!i?.dem;)i=this.findTileInCaches(e.scaledTo(r--).key);return i}findTileInCaches(e){let t=this.tileManager.getTileByID(e);return t||(t=this.tileManager._outOfViewCache.getByKey(e),t)}anyTilesAfterTime(e=Date.now()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,t){let n=t[e.canonical.z];return!!n&&(e.wrap>n.minWrap||e.wrap<n.maxWrap||e.canonical.x>=n.minTileXWrapped&&e.canonical.x<=n.maxTileXWrapped&&e.canonical.y>=n.minTileY&&e.canonical.y<=n.maxTileY)}}class Xa{constructor(e,t,n){this._meshCache={},this.painter=e,this.tileManager=new Ya(t),this.options=n,this.exaggeration=typeof n.exaggeration==`number`?n.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}destroy(){this._fbo&&=(this._fbo.destroy(),null),this._fboCoordsTexture&&=(this._fboCoordsTexture.destroy(),null),this._fboDepthTexture&&=(this._fboDepthTexture.destroy(),null),this._emptyDemTexture&&=(this._emptyDemTexture.destroy(),null),this._emptyDepthTexture&&=(this._emptyDepthTexture.destroy(),null),this._coordsTexture&&=(this._coordsTexture.destroy(),null);for(let e in this._meshCache)this._meshCache[e].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(e,n,r,i=t.a6){let a=e.normalizeCoordinates(n,r,i);if(!a)return 0;let o=this.getTerrainData(a.tileID),s=o.tile?.dem;if(!s)return 0;let c=t.cC([],[a.x/i*t.a6,a.y/i*t.a6],o.u_terrain_matrix),l=[c[0]*s.dim,c[1]*s.dim],u=Math.floor(l[0]),d=Math.floor(l[1]),f=l[0]-u,p=l[1]-d;return s.get(u,d)*(1-f)*(1-p)+s.get(u+1,d)*f*(1-p)+s.get(u,d+1)*(1-f)*p+s.get(u+1,d+1)*f*p}getElevationForLngLatZoom(e,n){if(!t.cD(n,e.wrap()))return 0;let{tileID:r,mercatorX:i,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(e,n);return this.getElevation(r,i%t.a6,a%t.a6,t.a6)}getElevationForLngLat(e,t){let n=He(t,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),r=0;for(let e of n)e.canonical.z>r&&(r=Math.min(e.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(e,r)}getElevation(e,n,r,i=t.a6){return this.getDEMElevation(e,n,r,i)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){let e=this.painter.context,n=new t.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new t.T(e,n,e.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new t.T(e,new t.R({width:1,height:1}),e.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=t.ap([])}let n=this.tileManager.getSourceTile(e,!0);if(n?.dem&&(!n.demTexture||n.needsTerrainPrepare)){let e=this.painter.context;n.demTexture=this.painter.getTileTexture(n.dem.stride),n.demTexture?n.demTexture.update(n.dem.getPixels(),{premultiply:!1}):n.demTexture=new t.T(e,n.dem.getPixels(),e.gl.RGBA,{premultiply:!1}),n.demTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),n.needsTerrainPrepare=!1}let r=n&&n.toString()+n.tileID.key+e.key;if(r&&!this._demMatrixCache[r]){let i=this.tileManager.getSource().maxzoom,a=e.canonical.z-n.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=i?a=e.canonical.z-i:t.w(`cannot calculate elevation if elevation maxzoom > source.maxzoom`));let o=e.canonical.x-(e.canonical.x>>a<<a),s=e.canonical.y-(e.canonical.y>>a<<a),c=t.cE(new Float64Array(16),[1/(t.a6<<a),1/(t.a6<<a),0]);t.Q(c,c,[o*t.a6,s*t.a6,0]),this._demMatrixCache[r]={matrix:c,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:n?.dem?.dim||1,u_terrain_matrix:r?this._demMatrixCache[r].matrix:this._emptyDemMatrix,u_terrain_unpack:(n?.dem)?.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(n?.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:n}}getFramebuffer(e){let n=this.painter,r=n.width/devicePixelRatio,i=n.height/devicePixelRatio;return!this._fbo||this._fbo.width===r&&this._fbo.height===i||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new t.T(n.context,{width:r,height:i,data:null},n.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(n.context.gl.NEAREST,n.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new t.T(n.context,{width:r,height:i,data:null},n.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(n.context.gl.NEAREST,n.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=n.context.createFramebuffer(r,i,!0,!1),this._fbo.depthAttachment.set(n.context.createRenderbuffer(n.context.gl.DEPTH_COMPONENT16,r,i))),this._fbo.colorAttachment.set(e===`coords`?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let n=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let e=0,t=0;e<this._coordsTextureSize;e++)for(let r=0;r<this._coordsTextureSize;r++,t+=4)n[t+0]=255&r,n[t+1]=255&e,n[t+2]=r>>8<<4|e>>8,n[t+3]=0;let r=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(n.buffer)),i=new t.T(e,r,e.gl.RGBA,{premultiply:!1});return i.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=i,i}pointCoordinate(e){this.painter.maybeDrawDepth(!0),this.painter.maybeDrawCoords();let n=new Uint8Array(4),r=this.painter.context,i=r.gl,a=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),o=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),s=Math.round(this.painter.height/devicePixelRatio);r.bindFramebuffer.set(this.getFramebuffer(`coords`).framebuffer),i.readPixels(a,s-o-1,1,1,i.RGBA,i.UNSIGNED_BYTE,n),r.bindFramebuffer.set(null);let c=n[0]+(n[2]>>4<<8),l=n[1]+((15&n[2])<<8),u=this.coordsIndex[255-n[3]],d=u&&this.tileManager.getTileByID(u);if(!d)return null;let f=this._coordsTextureSize,p=(1<<d.tileID.canonical.z)*f;return new t.a7((d.tileID.canonical.x*f+c)/p+d.tileID.wrap,(d.tileID.canonical.y*f+l)/p,this.getElevation(d.tileID,c,l,f))}depthAtPoint(e){let t=new Uint8Array(4),n=this.painter.context,r=n.gl;return n.bindFramebuffer.set(this.getFramebuffer(`depth`).framebuffer),r.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,t),n.bindFramebuffer.set(null),(t[0]/16777216+t[1]/65536+t[2]/256+t[3])/256}getTerrainMesh(e){let n=this.painter.style.projection?.transitionState>0,r=n&&e.canonical.y===0,i=n&&e.canonical.y===(1<<e.canonical.z)-1,a=`m_${r?`n`:``}_${i?`s`:``}`;if(this._meshCache[a])return this._meshCache[a];let o=this.painter.context,s=new t.cF,c=new t.aX,l=this.meshSize,u=t.a6/l,d=l*l;for(let e=0;e<=l;e++)for(let t=0;t<=l;t++)s.emplaceBack(t*u,e*u,0);for(let e=0;e<d;e+=l+1)for(let t=0;t<l;t++)c.emplaceBack(t+e,l+t+e+1,l+t+e+2),c.emplaceBack(t+e,l+t+e+2,t+e+1);let f=s.length,p=f+(l+1),m=(l+1)*l,h=r?t.bq:0,g=+!r,_=i?t.br:t.a6,v=+!i;for(let e=0;e<=l;e++)s.emplaceBack(e*u,h,g);for(let e=0;e<=l;e++)s.emplaceBack(e*u,_,v);for(let e=0;e<l;e++)c.emplaceBack(m+e,p+e,p+e+1),c.emplaceBack(m+e,p+e+1,m+e+1),c.emplaceBack(0+e,f+e+1,f+e),c.emplaceBack(0+e,0+e+1,f+e+1);let y=s.length,b=y+2*(l+1);for(let e of[0,1])for(let n=0;n<=l;n++)for(let r of[0,1])s.emplaceBack(e*t.a6,n*u,r);for(let e=0;e<2*l;e+=2)c.emplaceBack(y+e,y+e+1,y+e+3),c.emplaceBack(y+e,y+e+3,y+e+2),c.emplaceBack(b+e,b+e+3,b+e+1),c.emplaceBack(b+e,b+e+2,b+e+3);let x=new Bt(o.createVertexBuffer(s,Ja.members),o.createIndexBuffer(c),t.aW.simpleSegment(0,0,s.length,c.length));return this._meshCache[a]=x,x}getMeshFrameDelta(e){return 2*Math.PI*t.bD/2**Math.max(e,0)/5}getMinTileElevationForLngLatZoom(e,n){if(!t.cD(n,e.wrap()))return 0;let{tileID:r}=this._getOverscaledTileIDFromLngLatZoom(e,n);return this.getMinMaxElevation(r).minElevation??0}getMinMaxElevation(e){let t=this.getTerrainData(e).tile,n={minElevation:null,maxElevation:null};return t!=null&&t.dem&&(n.minElevation=t.dem.min*this.exaggeration,n.maxElevation=t.dem.max*this.exaggeration),n}_getOverscaledTileIDFromLngLatZoom(e,n){let r=t.a7.fromLngLat(e.wrap()),i=(1<<n)*t.a6,a=r.x*i,o=r.y*i,s=Math.floor(a/t.a6),c=Math.floor(o/t.a6);return{tileID:new t.a3(n,0,n,s,c),mercatorX:a,mercatorY:o}}}class Za{constructor(e,t,n){this._context=e,this._size=t,this._tileSize=n,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){let n=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),r=new t.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),n.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),n.colorAttachment.set(r.texture),{id:e,fbo:n,texture:r,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((t=>e.id!==t)),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(let e of this._recentlyUsed)if(!this._objects[e].inUse)return this._objects[e];if(this._objects.length>=this._size)throw Error(`No free RenderPool available, call freeAllObjects() required!`);let e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(let e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some((e=>!e.inUse))}}let Qa={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class $a{constructor(e,t){this.painter=e,this.terrain=t,this.pool=new Za(e.context,30,t.tileManager.tileSize*t.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,t){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=e._order.filter((n=>!e._layers[n].isHidden(t))),this._coordsAscending={};for(let t in e.tileManagers){this._coordsAscending[t]={};let n=e.tileManagers[t].getVisibleCoordinates(),r=e.tileManagers[t].getSource(),i=r instanceof ye?r.terrainTileRanges:null;for(let e of n){let n=this.terrain.tileManager.getTerrainCoords(e,i);for(let e in n)this._coordsAscending[t][e]||(this._coordsAscending[t][e]=[]),this._coordsAscending[t][e].push(n[e])}}this._rttFingerprints={};for(let t of e._order){let n=e._layers[t],r=n.source;if(Qa[n.type]&&!this._rttFingerprints[r]){this._rttFingerprints[r]={};let t=e.tileManagers[r]?.getState().revision??0;for(let e in this._coordsAscending[r])this._rttFingerprints[r][e]=`${this._coordsAscending[r][e].map((e=>e.key)).sort().join()}#${t}`}}for(let e of this._renderableTiles)for(let t in this._rttFingerprints){let n=this._rttFingerprints[t][e.tileID.key];n&&n!==e.rttFingerprint[t]&&(e.rtt=[])}}renderLayer(e,n){if(e.isHidden(this.painter.transform.zoom))return!1;let r=Object.assign(Object.assign({},n),{isRenderingToTexture:!0}),i=e.type,a=this.painter,o=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(Qa[i]&&(this._prevType&&Qa[this._prevType]||this._stacks.push([]),this._prevType=i,this._stacks[this._stacks.length-1].push(e.id),!o))return!0;if(Qa[this._prevType]||Qa[i]&&o){this._prevType=i;let e=this._stacks.length-1,n=this._stacks[e]||[];for(let i of this._renderableTiles){if(this.pool.isFull()&&(Ui(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(i),i.rtt[e]){let t=this.pool.getObjectForId(i.rtt[e].id);if(t.stamp===i.rtt[e].stamp){this.pool.useObject(t);continue}}let o=this.pool.getOrCreateFreeObject();this.pool.useObject(o),this.pool.stampObject(o),i.rtt[e]={id:o.id,stamp:o.stamp},a.context.bindFramebuffer.set(o.fbo.framebuffer),a.context.clear({color:t.bo.transparent,stencil:0}),a.currentStencilSource=void 0;for(let e of n){let t=a.style._layers[e],n=t.source?this._coordsAscending[t.source][i.tileID.key]:[i.tileID];a.context.viewport.set([0,0,o.fbo.width,o.fbo.height]),a._renderTileClippingMasks(t,n,!0),a.renderLayer(a,a.style.tileManagers[t.source],t,n,r),t.source&&(i.rttFingerprint[t.source]=this._rttFingerprints[t.source][i.tileID.key])}}return Ui(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],this.pool.freeAllObjects(),Qa[i]}return!1}}let eo={"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`},to=n,no={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:Ka,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:t.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},ro=class extends Ga{get _ownerWindow(){return this._container?.ownerDocument?.defaultView||window}constructor(e){var n;let r=Object.assign(Object.assign(Object.assign({},no),e),{canvasContextAttributes:Object.assign(Object.assign({},no.canvasContextAttributes),e.canvasContextAttributes)});if(r.minZoom!=null&&r.maxZoom!=null&&r.minZoom>r.maxZoom)throw Error(`maxZoom must be greater than or equal to minZoom`);if(r.minPitch!=null&&r.maxPitch!=null&&r.minPitch>r.maxPitch)throw Error(`maxPitch must be greater than or equal to minPitch`);if(r.minPitch!=null&&r.minPitch<0)throw Error(`minPitch must be greater than or equal to 0`);if(r.maxPitch!=null&&r.maxPitch>180)throw Error(`maxPitch must be less than or equal to 180`);let i=new Qt,a=new nn;r.minZoom!==void 0&&i.setMinZoom(r.minZoom),r.maxZoom!==void 0&&i.setMaxZoom(r.maxZoom),r.minPitch!==void 0&&i.setMinPitch(r.minPitch),r.maxPitch!==void 0&&i.setMaxPitch(r.maxPitch),r.renderWorldCopies!==void 0&&i.setRenderWorldCopies(r.renderWorldCopies),r.transformConstrain!==null&&i.setConstrainOverride(r.transformConstrain),super(i,a,{bearingSnap:r.bearingSnap,zoomSnap:r.zoomSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new qa,this._controls=[],this._mapId=t.ad(),this._lostContextStyle={style:null,images:null},this._contextLost=e=>{if(e.preventDefault(),this._frameRequest&&=(this._frameRequest.abort(),null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),this.style){for(let e of Object.values(this.style._layers))if(e.type===`custom`&&console.warn(`Custom layer with id '${e.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),e._listeners)for(let[t]of Object.entries(e._listeners))console.warn(`Custom layer with id '${e.id}' had event listeners for event '${t}' 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 t.n(`webglcontextlost`,{originalEvent:e}))}else this.fire(new t.n(`webglcontextlost`,{originalEvent:e}))},this._contextRestored=e=>{this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style&&(this.style.imageManager.images=this._lostContextStyle.images),this._lostContextStyle={style:null,images:null},this._setupPainter(),this.resize(),this._update(),this._resizeInternal(),this.fire(new t.n(`webglcontextrestored`,{originalEvent:e}))},this._onMapScroll=e=>{if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=r.interactive,this._maxTileCacheSize=r.maxTileCacheSize,this._maxTileCacheZoomLevels=r.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},r.canvasContextAttributes),this._trackResize=!0===r.trackResize,this._bearingSnap=r.bearingSnap,this._zoomSnap=r.zoomSnap,this._centerClampedToGround=r.centerClampedToGround,this._refreshExpiredTiles=!0===r.refreshExpiredTiles,this._fadeDuration=r.fadeDuration,this._crossSourceCollisions=!0===r.crossSourceCollisions,this._collectResourceTiming=!0===r.collectResourceTiming,this._locale=Object.assign(Object.assign({},eo),r.locale),this._clickTolerance=r.clickTolerance,this._overridePixelRatio=r.pixelRatio,this._maxCanvasSize=r.maxCanvasSize,this._zoomLevelsToOverscale=r.experimentalZoomLevelsToOverscale,this.transformCameraUpdate=r.transformCameraUpdate,this.transformConstrain=r.transformConstrain,this.cancelPendingTileRequestsWhileZooming=!0===r.cancelPendingTileRequestsWhileZooming,this.setAnisotropicFilterPitch(r.anisotropicFilterPitch),r.reduceMotion!==void 0&&(s.prefersReducedMotion=r.reduceMotion),this._imageQueueHandle=u.addThrottleControl((()=>this.isMoving())),this._requestManager=new f(r.transformRequest),this._container=this._resolveContainer(r.container),r.maxBounds&&this.setMaxBounds(r.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.depthDirty=!0,this._update(!0)})),this.once(`idle`,(()=>this._idleTriggered=!0)),typeof window<`u`&&(this._ownerWindow.addEventListener(`online`,this._onWindowOnline,!1),this._setupResizeObserver()),this.handlers=new Wa(this,r),this._hash=r.hash?new Ji(typeof r.hash==`string`&&r.hash||void 0).addTo(this):void 0,(n=this._hash)!=null&&n._onHashChange()||(this.jumpTo({center:r.center,elevation:r.elevation,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch,roll:r.roll}),r.bounds&&(this.resize(),this.fitBounds(r.bounds,t.e({},r.fitBoundsOptions,{duration:0}))));let o=typeof r.style==`string`||r.style?.projection?.type!==`globe`;this.resize(null,o),this._localIdeographFontFamily=r.localIdeographFontFamily,this._validateStyle=r.validateStyle,r.style&&this.setStyle(r.style,{localIdeographFontFamily:r.localIdeographFontFamily}),r.attributionControl&&this.addControl(new X(typeof r.attributionControl==`boolean`?void 0:r.attributionControl)),r.maplibreLogo&&this.addControl(new Z,r.logoPosition),this.on(`style.load`,(()=>{if(o||this._resizeTransform(),this.transform.unmodified){let e=t.V(this.style.stylesheet,[`center`,`zoom`,`bearing`,`pitch`,`roll`]);this.jumpTo(e)}})),this.on(`data`,(e=>{this._update(e.dataType===`style`),this.fire(new t.n(`${e.dataType}data`,e))})),this.on(`dataloading`,(e=>{this.fire(new t.n(`${e.dataType}dataloading`,e))})),this.on(`dataabort`,(e=>{this.fire(new t.n(`sourcedataabort`,e))}))}_getMapId(){return this._mapId}setGlobalStateProperty(e,t){return this.style.setGlobalStateProperty(e,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(e,n){if(n===void 0&&(n=e.getDefaultPosition?e.getDefaultPosition():`top-right`),!e?.onAdd)return this.fire(new t.l(Error(`Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.`)));let r=e.onAdd(this);this._controls.push(e);let i=this._controlPositions[n];return n.includes(`bottom`)?i.insertBefore(r,i.firstChild):i.appendChild(r),this}removeControl(e){if(!e?.onRemove)return this.fire(new t.l(Error(`Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.`)));let n=this._controls.indexOf(e);return n>-1&&this._controls.splice(n,1),e.onRemove(this),this}hasControl(e){return this._controls.includes(e)}coveringTiles(e){return He(this.transform,e)}calculateCameraOptionsFromTo(e,t,n,r){return r==null&&this.terrain&&(r=this.terrain.getElevationForLngLat(n,this.transform)),super.calculateCameraOptionsFromTo(e,t,n,r)}resize(e,n=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(n);let r=!this._moving;return r&&(this.stop(),this.fire(new t.n(`movestart`,e)).fire(new t.n(`move`,e))),this.fire(new t.n(`resize`,e)),r&&this.fire(new t.n(`moveend`,e)),this}_resizeInternal(e=!0){let[t,n]=this._containerDimensions(),r=this._getClampedPixelRatio(t,n);if(this._resizeCanvas(t,n,r),this.painter.resize(t,n,r),this.painter.overLimit()){let e=this.painter.context.gl;this._maxCanvasSize=[e.drawingBufferWidth,e.drawingBufferHeight];let r=this._getClampedPixelRatio(t,n);this._resizeCanvas(t,n,r),this.painter.resize(t,n,r)}this._resizeTransform(e)}_resizeTransform(e=!0){var t;let[n,r]=this._containerDimensions();this.transform.resize(n,r,e),(t=this._requestedCameraState)==null||t.resize(n,r,e)}_getClampedPixelRatio(e,t){let{0:n,1:r}=this._maxCanvasSize,i=this.getPixelRatio(),a=e*i,o=t*i;return Math.min(a>n?n/a:1,o>r?r/o:1)*i}getPixelRatio(){return this._overridePixelRatio??devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){return this.transform.setMaxBounds(se.convert(e)),this._update()}setMinZoom(e){if((e??=-2)>=-2&&e<=this.transform.maxZoom){let n=this.transform.zoom,r=this._getTransformForUpdate();return r.setMinZoom(e),this._applyUpdatedTransform(r),this._update(),n!==this.transform.zoom&&this.fire(new t.n(`zoomstart`)).fire(new t.n(`zoom`)).fire(new t.n(`zoomend`)).fire(new t.n(`movestart`)).fire(new t.n(`move`)).fire(new t.n(`moveend`)),this}throw Error(`minZoom must be between -2 and the current maxZoom, inclusive`)}getMinZoom(){return this.transform.minZoom}setMaxZoom(e){if((e??=22)>=this.transform.minZoom){let n=this.transform.zoom,r=this._getTransformForUpdate();return r.setMaxZoom(e),this._applyUpdatedTransform(r),this._update(),n!==this.transform.zoom&&this.fire(new t.n(`zoomstart`)).fire(new t.n(`zoom`)).fire(new t.n(`zoomend`)).fire(new t.n(`movestart`)).fire(new t.n(`move`)).fire(new t.n(`moveend`)),this}throw Error(`maxZoom must be greater than the current minZoom`)}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if((e??=0)<0)throw Error(`minPitch must be greater than or equal to 0`);if(e>=0&&e<=this.transform.maxPitch){let n=this.transform.pitch,r=this._getTransformForUpdate();return r.setMinPitch(e),this._applyUpdatedTransform(r),this._update(),n!==this.transform.pitch&&this.fire(new t.n(`pitchstart`)).fire(new t.n(`pitch`)).fire(new t.n(`pitchend`)).fire(new t.n(`movestart`)).fire(new t.n(`move`)).fire(new t.n(`moveend`)),this}throw Error(`minPitch must be between 0 and the current maxPitch, inclusive`)}getMinPitch(){return this.transform.minPitch}setMaxPitch(e){if((e??=60)>180)throw Error(`maxPitch must be less than or equal to 180`);if(e>=this.transform.minPitch){let n=this.transform.pitch,r=this._getTransformForUpdate();return r.setMaxPitch(e),this._applyUpdatedTransform(r),this._update(),n!==this.transform.pitch&&this.fire(new t.n(`pitchstart`)).fire(new t.n(`pitch`)).fire(new t.n(`pitchend`)).fire(new t.n(`movestart`)).fire(new t.n(`move`)).fire(new t.n(`moveend`)),this}throw Error(`maxPitch must be greater than the current minPitch`)}getMaxPitch(){return this.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(e){if((e??=20)>180)throw Error(`anisotropicFilterPitch must be less than or equal to 180`);if(e<0)throw Error(`anisotropicFilterPitch must be greater than or equal to 0`);return this._anisotropicFilterPitch=e,this._update()}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.setRenderWorldCopies(e),this._update()}setTransformConstrain(e){return this.transform.setConstrainOverride(e),this._update()}project(e){return this.transform.locationToScreenPoint(t.W.convert(e),this.style&&this.terrain)}unproject(e){return this.transform.screenPointToLocation(t.P.convert(e),this.terrain)}isMoving(){return this._moving||this.handlers?.isMoving()}isZooming(){return this._zooming||this.handlers?.isZooming()}isRotating(){return this._rotating||this.handlers?.isRotating()}_createDelegatedListener(e,t,n){if(e===`mouseenter`||e===`mouseover`){let r=!1;return{layers:t,listener:n,delegates:{mousemove:i=>{let a=t.filter((e=>this.getLayer(e))),o=a.length===0?[]:this.queryRenderedFeatures(i.point,{layers:a});o.length?r||(r=!0,n.call(this,new ia(e,this,i.originalEvent,{features:o}))):r=!1},mouseout:()=>{r=!1}}}}if(e===`mouseleave`||e===`mouseout`){let r=!1;return{layers:t,listener:n,delegates:{mousemove:i=>{let a=t.filter((e=>this.getLayer(e)));(a.length===0?[]:this.queryRenderedFeatures(i.point,{layers:a})).length?r=!0:r&&(r=!1,n.call(this,new ia(e,this,i.originalEvent)))},mouseout:t=>{r&&(r=!1,n.call(this,new ia(e,this,t.originalEvent)))}}}}{let r=e=>{let r=t.filter((e=>this.getLayer(e))),i=r.length===0?[]:this.queryRenderedFeatures(e.point,{layers:r});i.length&&(e.features=i,n.call(this,e),delete e.features)};return{layers:t,listener:n,delegates:{[e]:r}}}}_saveDelegatedListener(e,t){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(t)}_removeDelegatedListener(e,t,n){if(!this._delegatedListeners?.[e])return;let r=this._delegatedListeners[e];for(let e=0;e<r.length;e++){let i=r[e];if(i.listener===n&&i.layers.length===t.length&&i.layers.every((e=>t.includes(e)))){for(let e in i.delegates)this.off(e,i.delegates[e]);r.splice(e,1);return}}}on(e,t,n){if(n===void 0)return super.on(e,t);let r=typeof t==`string`?[t]:t,i=this._createDelegatedListener(e,r,n);this._saveDelegatedListener(e,i);for(let e in i.delegates)this.on(e,i.delegates[e]);return{unsubscribe:()=>{this._removeDelegatedListener(e,r,n)}}}once(e,t,n){if(n===void 0)return super.once(e,t);let r=typeof t==`string`?[t]:t,i=this._createDelegatedListener(e,r,n);for(let t in i.delegates){let a=i.delegates[t];i.delegates[t]=(...t)=>{this._removeDelegatedListener(e,r,n),a(...t)}}this._saveDelegatedListener(e,i);for(let e in i.delegates)this.once(e,i.delegates[e]);return this}off(e,t,n){return n===void 0?super.off(e,t):(this._removeDelegatedListener(e,typeof t==`string`?[t]:t,n),this)}queryRenderedFeatures(e,n){if(!this.style)return[];let r,i=e instanceof t.P||Array.isArray(e),a=i?e:[[0,0],[this.transform.width,this.transform.height]];if(n=n||(i?{}:e)||{},a instanceof t.P||typeof a[0]==`number`)r=[t.P.convert(a)];else{let e=t.P.convert(a[0]),n=t.P.convert(a[1]);r=[e,new t.P(n.x,e.y),n,new t.P(e.x,n.y),e]}return this.style.queryRenderedFeatures(r,n,this.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,n){return!1!==(n=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},n)).diff&&n.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._updateStyle(e,n))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let t=this._locale[e];if(t==null)throw Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){var n,r;if((n=this._diffStyleRequest)==null||n.abort(),this._diffStyleRequest=null,t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once(`style.load`,(()=>this._updateStyle(e,t)));let i=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e?(this.style=new Ln(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof e==`string`?this.style.loadURL(e,t,i):this.style.loadJSON(e,t,i),this):(this._frameRequest&&=(this._frameRequest.abort(),null),(r=this.style?.projection)==null||r.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ln(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(e,n){return t._(this,void 0,void 0,(function*(){var r;if((r=this._diffStyleRequest)==null||r.abort(),typeof e==`string`){let r=e;this._diffStyleRequest=new AbortController;let i=this._diffStyleRequest;try{let e=yield this._requestManager.transformRequest(r,`Style`);if(i.signal.aborted)return void(this._diffStyleRequest=null);let a=yield t.k(e,i);this._diffStyleRequest=null,this._updateDiff(a.data,n)}catch(e){this._diffStyleRequest=null,t.$(e)||this.fire(new t.l(t.d(e)))}}else typeof e==`object`&&(this._diffStyleRequest=null,this._updateDiff(e,n))}))}_updateDiff(e,n){try{this.style.setState(e,n)&&this._update(!0)}catch(r){t.w(`Unable to perform style diff: ${t.d(r).message}. Rebuilding the style from scratch.`),this._updateStyle(e,n)}}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(){if(this.style)return this.style.loaded();t.w(`There is no style added to the map.`)}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){let n=this.style?.tileManagers[e];if(n!==void 0)return n.loaded();this.fire(new t.l(Error(`There is no tile manager with ID '${e}'`)))}setTerrain(e){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off(`data`,this._terrainDataCallback),e){let n=this.style.tileManagers[e.source];if(!n)throw Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);this.terrain===null&&n.reload();for(let n in this.style._layers){let r=this.style._layers[n];r.type===`hillshade`&&r.source===e.source&&t.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.`),r.type===`color-relief`&&r.source===e.source&&t.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 Xa(this.painter,n,e),this.painter.renderToTexture=new $a(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=t=>{t.dataType===`style`?this.terrain.tileManager.freeRtt():t.dataType===`source`&&t.tile&&(t.sourceId!==e.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))),t.source?.type===`image`?this.terrain.tileManager.freeRtt():this.terrain.tileManager.freeRtt(t.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 t.n(`terrain`,{terrain:e})),this}getTerrain(){return this.terrain?.options??null}areTilesLoaded(){let e=this.style?.tileManagers;for(let t of Object.values(e))if(!t.areTilesLoaded())return!1;return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style.getSource(e)}setSourceTileLodParams(e,t,n){if(n){let r=this.getSource(n);if(!r)throw Error(`There is no source with ID "${n}", cannot set LOD parameters`);r.calculateTileZoom=Be(Math.max(1,e),Math.max(1,t))}else for(let n in this.style.tileManagers)this.style.tileManagers[n].getSource().calculateTileZoom=Be(Math.max(1,e),Math.max(1,t));return this._update(!0),this}refreshTiles(e,n){let r=this.style.tileManagers[e];if(!r)throw Error(`There is no tile manager with ID "${e}", cannot refresh tile`);n===void 0?r.reload(!0):r.refreshTiles(n.map((e=>new t.aa(e.z,e.x,e.y))))}addImage(e,n,r={}){let{pixelRatio:i=1,sdf:a=!1,stretchX:o,stretchY:c,content:l,textFitWidth:u,textFitHeight:d}=r;if(this._lazyInitEmptyStyle(),!(n instanceof HTMLImageElement||t.b(n))){if(n.width===void 0||n.height===void 0)return this.fire(new t.l(Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:r,height:s,data:f}=n,p=n;return this.style.addImage(e,{data:new t.R({width:r,height:s},new Uint8Array(f)),pixelRatio:i,stretchX:o,stretchY:c,content:l,textFitWidth:u,textFitHeight:d,sdf:a,version:0,userImage:p}),p.onAdd&&p.onAdd(this,e),this}}{let{width:r,height:f,data:p}=s.getImageData(n);this.style.addImage(e,{data:new t.R({width:r,height:f},p),pixelRatio:i,stretchX:o,stretchY:c,content:l,textFitWidth:u,textFitHeight:d,sdf:a,version:0})}}updateImage(e,n){let r=this.style.getImage(e);if(!r)return this.fire(new t.l(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:i,height:a,data:o}=n instanceof HTMLImageElement||t.b(n)?s.getImageData(n):n;if(i===void 0||a===void 0)return this.fire(new t.l(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(i!==r.data.width||a!==r.data.height)return this.fire(new t.l(Error(`The width and height of the updated image must be that same as the previous version of the image`)));let c=!(n instanceof HTMLImageElement||t.b(n));return r.data.replace(o,c),this.style.updateImage(e,r),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new t.l(Error(`Missing required image id`))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(e){return t._(this,void 0,void 0,(function*(){return u.getImage(yield this._requestManager.transformRequest(e,`Image`),new AbortController)}))}listImages(){return this.style.listImages()}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style.getLayer(e)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(e,t,n){return this.style.setLayerZoomRange(e,t,n),this._update(!0)}setFilter(e,t,n={}){return this.style.setFilter(e,t,n),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,n,r={}){return this.style.setPaintProperty(e,t,n,r),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,n,r={}){return this.style.setLayoutProperty(e,t,n,r),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(e,t,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,n,(e=>{e||this._update(!0)})),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,(e=>{e||this._update(!0)})),this}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(e,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}_setupResizeObserver(){let e=!1,t=qi((e=>{this._trackResize&&!this._removed&&(this.resize(e),this.redraw())}),50),n=this._ownerWindow.ResizeObserver??ResizeObserver;this._resizeObserver=new n((n=>{e?t(n):e=!0})),this._resizeObserver.observe(this._container)}_resolveContainer(e){if(typeof e==`string`){let t=document.getElementById(e);if(!t)throw Error(`Container '${e}' not found.`);return t}if(e instanceof HTMLElement||e&&typeof e==`object`&&e.nodeType===1)return e;throw Error(`Invalid type: 'container' must be a String or HTMLElement.`)}_setupContainer(){let e=this._container;e.classList.add(`maplibregl-map`);let t=this._canvasContainer=d.create(`div`,`maplibregl-canvas-container`,e);this._interactive&&t.classList.add(`maplibregl-interactive`),this._canvas=d.create(`canvas`,`maplibregl-canvas`,t),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`);let n=this._containerDimensions(),r=this._getClampedPixelRatio(n[0],n[1]);this._resizeCanvas(n[0],n[1],r);let i=this._controlContainer=d.create(`div`,`maplibregl-control-container`,e),a=this._controlPositions={};for(let e of[`top-left`,`top-right`,`bottom-left`,`bottom-right`])a[e]=d.create(`div`,`maplibregl-ctrl-${e} `,i);this._container.addEventListener(`scroll`,this._onMapScroll,!1)}_resizeCanvas(e,t,n){this._canvas.width=Math.floor(n*e),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${t}px`}_setupPainter(){let e=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0}),t=null;this._canvas.addEventListener(`webglcontextcreationerror`,(n=>{t={requestedAttributes:e},n&&(t.statusMessage=n.statusMessage,t.type=n.type)}),{once:!0});let n=null;if(n=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,e):this._canvas.getContext(`webgl2`,e)||this._canvas.getContext(`webgl`,e),!n){let e=`Failed to initialize WebGL`;throw t?(t.message=e,Error(JSON.stringify(t))):Error(e)}this.painter=new Ki(n,this.transform)}migrateProjection(e,n){super.migrateProjection(e,n),this.painter.transform=e,this.fire(new t.n(`projectiontransition`,{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style?._loaded?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){var n;let r=this._idleTriggered?this._fadeDuration:0,i=this.style.projection?.transitionState>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let a=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let e=this.transform.zoom,n=l();this.style.zoomHistory.update(e,n);let i=new t.J(e,{now:n,fadeDuration:r,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),o=i.crossFadingFactor();o===1&&o===this._crossFadingFactor||(a=!0,this._crossFadingFactor=o),this.style.update(i)}let o=this.style.projection?.transitionState>0!==i;(n=this.style.projection)==null||n.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState(this.style.projection?.transitionState,this.style.projection?.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||o)&&(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?._updatePlacement(this.transform,this.showCollisionBoxes,r,this._crossSourceCollisions,o),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:r,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new t.n(`render`)),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.n(`load`))),this.style&&(this.style.hasTransitions()||a)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let s=this._sourcesDirty||this._styleDirty||this._placementDirty;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.n(`idle`)),!this._loaded||this._fullyLoaded||s||(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&=(this._frameRequest.abort(),null),this._render(0)),this}remove(){var e,n;this._hash&&this._hash.remove();for(let e of this._controls)e.onRemove(this);this._controls=[],this._frameRequest&&=(this._frameRequest.abort(),null),this._renderTaskQueue.clear(),(e=this._diffStyleRequest)==null||e.abort(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<`u`&&this._ownerWindow.removeEventListener(`online`,this._onWindowOnline,!1),u.removeThrottleControl(this._imageQueueHandle),(n=this._resizeObserver)==null||n.disconnect();let r=this.painter.context.gl.getExtension(`WEBGL_lose_context`);r!=null&&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 t.n(`remove`))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,s.frame(this._frameRequest,(e=>{this._frameRequest=null;try{this._render(e)}catch(e){if(!t.$(e)&&!function(e){return e.message===ai}(e))throw e}}),(()=>{}),this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return to}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(e){return this._lazyInitEmptyStyle(),this.style.setProjection(e),this._update(!0)}},io={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class ao{constructor(e,n,r=!1){this.mousedown=e=>{this.startMove(e,d.mousePos(this.element,e)),window.addEventListener(`mousemove`,this.mousemove),window.addEventListener(`mouseup`,this.mouseup)},this.mousemove=e=>{this.move(e,d.mousePos(this.element,e))},this.mouseup=e=>{this._rotatePitchHandler.dragEnd(e),this.offTemp()},this.touchstart=e=>{e.targetTouches.length===1?(this._startPos=this._lastPos=d.touchPos(this.element,e.targetTouches)[0],this.startMove(e,this._startPos),window.addEventListener(`touchmove`,this.touchmove,{passive:!1}),window.addEventListener(`touchend`,this.touchend)):this.reset()},this.touchmove=e=>{e.targetTouches.length===1?(this._lastPos=d.touchPos(this.element,e.targetTouches)[0],this.move(e,this._lastPos)):this.reset()},this.touchend=e=>{e.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=n;let i=new va;this._rotatePitchHandler=new ha({clickTolerance:3,move:(e,i)=>{let a=n.getBoundingClientRect(),o=new t.P((a.bottom-a.top)/2,(a.right-a.left)/2);return{bearingDelta:t.cx(new t.P(e.x,i.y),i,o),pitchDelta:r?-.5*(i.y-e.y):void 0}},moveStateManager:i,enable:!0,assignEvents:()=>{}}),this.map=e,n.addEventListener(`mousedown`,this.mousedown),n.addEventListener(`touchstart`,this.touchstart,{passive:!1}),n.addEventListener(`touchcancel`,this.reset)}startMove(e,t){this._rotatePitchHandler.dragStart(e,t),d.disableDrag()}move(e,t){let n=this.map,{bearingDelta:r,pitchDelta:i}=this._rotatePitchHandler.dragMove(e,t)||{};r&&n.setBearing(n.getBearing()+r),i&&n.setPitch(n.getPitch()+i)}off(){let e=this.element;e.removeEventListener(`mousedown`,this.mousedown),e.removeEventListener(`touchstart`,this.touchstart),window.removeEventListener(`touchmove`,this.touchmove),window.removeEventListener(`touchend`,this.touchend),e.removeEventListener(`touchcancel`,this.reset),this.offTemp()}offTemp(){d.enableDrag(),window.removeEventListener(`mousemove`,this.mousemove),window.removeEventListener(`mouseup`,this.mouseup),window.removeEventListener(`touchmove`,this.touchmove),window.removeEventListener(`touchend`,this.touchend)}}let oo;function so(e,n,r,i=!1){if(i||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return e?.wrap();let a=new t.W(e.lng,e.lat);if(e=new t.W(e.lng,e.lat),n){let i=new t.W(e.lng-360,e.lat),a=new t.W(e.lng+360,e.lat),o=r.locationToScreenPoint(e).distSqr(n);r.locationToScreenPoint(i).distSqr(n)<o?e=i:r.locationToScreenPoint(a).distSqr(n)<o&&(e=a)}for(;Math.abs(e.lng-r.center.lng)>180;){let t=r.locationToScreenPoint(e);if(t.x>=0&&t.y>=0&&t.x<=r.width&&t.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360}return e.lng!==a.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(e))?e:a}let co={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 lo(e,t,n){let r=e.classList;for(let e in co)r.remove(`maplibregl-${n}-anchor-${e}`);r.add(`maplibregl-${n}-anchor-${t}`)}class uo extends t.E{constructor(e){if(super(),this._onClick=e=>{this.fire(new t.n(`click`,{originalEvent:e}))},this._onKeyPress=e=>{e.code!==`Space`&&e.code!==`Enter`||this.togglePopup()},this._onMapClick=e=>{let t=e.originalEvent.target,n=this._element;this._popup&&(t===n||n.contains(t))&&this.togglePopup()},this._update=e=>{if(!this._map)return;let t=this._map.loaded()&&!this._map.isMoving();(e?.type===`terrain`||e?.type===`render`&&!t)&&this._map.once(`render`,this._update),this._lngLat=so(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 n=``;this._rotationAlignment===`viewport`||this._rotationAlignment===`auto`?n=`rotateZ(${this._rotation}deg)`:this._rotationAlignment===`map`&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let r=``;this._pitchAlignment===`viewport`||this._pitchAlignment===`auto`?r=`rotateX(0deg)`:this._pitchAlignment===`map`&&(r=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||e&&e.type!==`moveend`||(this._pos=this._pos.round()),this._element.style.transform=`${co[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${n}`,s.frameAsync(new AbortController,this._map._ownerWindow).then((()=>{this._updateOpacity(e?.type===`moveend`)})).catch((()=>{}))},this._onMove=e=>{if(!this._isDragging){let t=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents=`none`,this._state===`pending`&&(this._state=`active`,this.fire(new t.n(`dragstart`))),this.fire(new t.n(`drag`)))},this._onUp=()=>{this._element.style.pointerEvents=`auto`,this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off(`mousemove`,this._onMove),this._map.off(`touchmove`,this._onMove),this._state===`active`&&this.fire(new t.n(`dragend`)),this._state=`inactive`},this._addDragHandler=e=>{this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.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=e?.anchor||`center`,this._color=e?.color||`#3FB1CE`,this._scale=e?.scale||1,this._draggable=e?.draggable||!1,this._clickTolerance=e?.clickTolerance||0,this._subpixelPositioning=e?.subpixelPositioning||!1,this._isDragging=!1,this._state=`inactive`,this._rotation=e?.rotation||0,this._rotationAlignment=e?.rotationAlignment||`auto`,this._pitchAlignment=e?.pitchAlignment&&e.pitchAlignment!==`auto`?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e?.opacity,e?.opacityWhenCovered),e?.element)this._element=e.element,this._offset=t.P.convert(e?.offset||[0,0]);else{this._defaultMarker=!0,this._element=d.create(`div`);let n=d.createNS(`http://www.w3.org/2000/svg`,`svg`);n.setAttributeNS(null,`display`,`block`),n.setAttributeNS(null,`height`,`41px`),n.setAttributeNS(null,`width`,`27px`),n.setAttributeNS(null,`viewBox`,`0 0 27 41`);let r=d.createNS(`http://www.w3.org/2000/svg`,`g`);r.setAttributeNS(null,`stroke`,`none`),r.setAttributeNS(null,`stroke-width`,`1`),r.setAttributeNS(null,`fill`,`none`),r.setAttributeNS(null,`fill-rule`,`evenodd`);let i=d.createNS(`http://www.w3.org/2000/svg`,`g`);i.setAttributeNS(null,`fill-rule`,`nonzero`);let a=d.createNS(`http://www.w3.org/2000/svg`,`g`);a.setAttributeNS(null,`transform`,`translate(3.0, 29.0)`),a.setAttributeNS(null,`fill`,`#000000`);for(let e of[{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`}]){let t=d.createNS(`http://www.w3.org/2000/svg`,`ellipse`);t.setAttributeNS(null,`opacity`,`0.04`),t.setAttributeNS(null,`cx`,`10.5`),t.setAttributeNS(null,`cy`,`5.80029008`),t.setAttributeNS(null,`rx`,e.rx),t.setAttributeNS(null,`ry`,e.ry),a.appendChild(t)}let o=d.createNS(`http://www.w3.org/2000/svg`,`g`);o.setAttributeNS(null,`fill`,this._color);let s=d.createNS(`http://www.w3.org/2000/svg`,`path`);s.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`),o.appendChild(s);let c=d.createNS(`http://www.w3.org/2000/svg`,`g`);c.setAttributeNS(null,`opacity`,`0.25`),c.setAttributeNS(null,`fill`,`#000000`);let l=d.createNS(`http://www.w3.org/2000/svg`,`path`);l.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`),c.appendChild(l);let u=d.createNS(`http://www.w3.org/2000/svg`,`g`);u.setAttributeNS(null,`transform`,`translate(6.0, 7.0)`),u.setAttributeNS(null,`fill`,`#FFFFFF`);let f=d.createNS(`http://www.w3.org/2000/svg`,`g`);f.setAttributeNS(null,`transform`,`translate(8.0, 8.0)`);let p=d.createNS(`http://www.w3.org/2000/svg`,`circle`);p.setAttributeNS(null,`fill`,`#000000`),p.setAttributeNS(null,`opacity`,`0.25`),p.setAttributeNS(null,`cx`,`5.5`),p.setAttributeNS(null,`cy`,`5.5`),p.setAttributeNS(null,`r`,`5.4999962`);let m=d.createNS(`http://www.w3.org/2000/svg`,`circle`);m.setAttributeNS(null,`fill`,`#FFFFFF`),m.setAttributeNS(null,`cx`,`5.5`),m.setAttributeNS(null,`cy`,`5.5`),m.setAttributeNS(null,`r`,`5.4999962`),f.appendChild(p),f.appendChild(m),i.appendChild(a),i.appendChild(o),i.appendChild(c),i.appendChild(u),i.appendChild(f),n.appendChild(i),n.setAttributeNS(null,`height`,41*this._scale+`px`),n.setAttributeNS(null,`width`,27*this._scale+`px`),this._element.appendChild(n),this._offset=t.P.convert(e?.offset||[0,-14])}if(this._element.classList.add(`maplibregl-marker`),this._element.addEventListener(`dragstart`,(e=>{e.preventDefault()})),this._element.addEventListener(`mousedown`,(e=>{e.preventDefault()})),lo(this._element,this._anchor,`marker`),e?.className)for(let t of e.className.split(` `))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.hasAttribute(`aria-label`)||this._element.setAttribute(`aria-label`,e._getUIString(`Marker.Title`)),this._element.hasAttribute(`role`)||this._element.setAttribute(`role`,`button`),e.getCanvasContainer().appendChild(this._element),e.on(`move`,this._update),e.on(`moveend`,this._update),e.on(`terrain`,this._update),e.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(e){return this._lngLat=t.W.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener(`keypress`,this._onKeyPress),this._originalTabIndex||this._element.removeAttribute(`tabindex`)),e){if(!(`offset`in e.options)){let t=38.1,n=13.5,r=13.5/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[r,-1*(t-n+r)],"bottom-right":[-r,-1*(t-n+r)],left:[n,-1*(t-n)],right:[-13.5,-1*(t-n)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute(`tabindex`),this._originalTabIndex||this._element.setAttribute(`tabindex`,`0`),this._element.addEventListener(`keypress`,this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){let e=this._popup;return this._element.style.opacity===this._opacityWhenCovered||e&&(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map))),this}_updateOpacity(e=!1){var n;let r=this._map?.terrain,i=this._map.transform.isLocationOccluded(this._lngLat);if(!r||i){let e=i?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==e&&(this._element.style.opacity=e,this._element.classList.toggle(`maplibregl-marker-covered`,i));return}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}let a=this._map,o=a.terrain.depthAtPoint(this._pos),s=a.terrain.getElevationForLngLat(this._lngLat,a.transform);if(a.transform.lngLatToCameraDepth(this._lngLat,s)-o<.006)return this._element.style.opacity=this._opacity,void this._element.classList.remove(`maplibregl-marker-covered`);let c=-this._offset.y/a.transform.pixelsPerMeter,l=Math.sin(a.getPitch()*Math.PI/180)*c,u=a.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),d=a.transform.lngLatToCameraDepth(this._lngLat,s+l)-u>.006;(n=this._popup)!=null&&n.isOpen()&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity,this._element.classList.toggle(`maplibregl-marker-covered`,d)}getOffset(){return this._offset}setOffset(e){return this._offset=t.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(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(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||`auto`,this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!==`auto`?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return(this._opacity===void 0||e===void 0&&t===void 0)&&(this._opacity=`1`,this._opacityWhenCovered=`0.2`),e!==void 0&&(this._opacity=String(e)),t!==void 0&&(this._opacityWhenCovered=String(t)),this._map&&this._updateOpacity(!0),this}}let fo={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},po=0,mo=!1,ho={maxWidth:100,unit:`metric`};function go(e,t,n){let r=n?.maxWidth||100,i=e._container.clientHeight/2,a=e._container.clientWidth/2,o=e.unproject([a-r/2,i]),s=e.unproject([a+r/2,i]),c=Math.round(e.project(s).x-e.project(o).x),l=Math.min(r,c,e._container.clientWidth),u=o.distanceTo(s);if(n?.unit===`imperial`){let n=3.2808*u;n>5280?_o(t,l,n/5280,e._getUIString(`ScaleControl.Miles`)):_o(t,l,n,e._getUIString(`ScaleControl.Feet`))}else n?.unit===`nautical`?_o(t,l,u/1852,e._getUIString(`ScaleControl.NauticalMiles`)):u>=1e3?_o(t,l,u/1e3,e._getUIString(`ScaleControl.Kilometers`)):_o(t,l,u,e._getUIString(`ScaleControl.Meters`))}function _o(e,t,n,r){let i=function(e){let t=10**(`${Math.floor(e)}`.length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:n>=1?1:function(e){let t=10**Math.ceil(-Math.log(e)/Math.LN10);return Math.round(e*t)/t}(n),t*n}(n);e.style.width=i/n*t+`px`,e.innerHTML=`${i}&nbsp;${r}`}let vo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:``,maxWidth:`240px`,subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0},yo=[`a[href]`,`[tabindex]:not([tabindex='-1'])`,`[contenteditable]:not([contenteditable='false'])`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`].join(`, `);function bo(e){if(e){if(typeof e==`number`){let n=Math.round(Math.abs(e)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,e),"top-left":new t.P(n,n),"top-right":new t.P(-n,n),bottom:new t.P(0,-e),"bottom-left":new t.P(n,-n),"bottom-right":new t.P(-n,-n),left:new t.P(e,0),right:new t.P(-e,0)}}if(e instanceof t.P||Array.isArray(e)){let n=t.P.convert(e);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:t.P.convert(e.center||[0,0]),top:t.P.convert(e.top||[0,0]),"top-left":t.P.convert(e[`top-left`]||[0,0]),"top-right":t.P.convert(e[`top-right`]||[0,0]),bottom:t.P.convert(e.bottom||[0,0]),"bottom-left":t.P.convert(e[`bottom-left`]||[0,0]),"bottom-right":t.P.convert(e[`bottom-right`]||[0,0]),left:t.P.convert(e.left||[0,0]),right:t.P.convert(e.right||[0,0])}}return bo(new t.P(0,0))}let xo=n;e.AJAXError=t.cG,e.EXTENT=t.a6,e.Event=t.n,e.Evented=t.E,e.LngLat=t.W,e.MercatorCoordinate=t.a7,e.Point=t.P,e.addProtocol=t.cH,e.config=t.c,e.removeProtocol=t.cI,e.AttributionControl=X,e.BoxZoomHandler=ua,e.CanvasSource=xe,e.CooperativeGesturesHandler=Ba,e.DoubleClickZoomHandler=Pa,e.DragPanHandler=La,e.DragRotateHandler=Ra,e.EdgeInsets=Gt,e.FullscreenControl=class extends t.E{constructor(e={}){var n;super(),this._onFullscreenChange=()=>{let e=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;e?.shadowRoot?.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=(n=e.pseudo)!=null&&n,e!=null&&e.container&&(e.container instanceof HTMLElement?this._container=e.container:t.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(e){return this._map=e,this._container||=this._map.getContainer(),this._controlContainer=d.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(){let e=this._fullscreenButton=d.create(`button`,`maplibregl-ctrl-fullscreen`,this._controlContainer);d.create(`span`,`maplibregl-ctrl-icon`,e).setAttribute(`aria-hidden`,`true`),e.type=`button`,this._updateTitle(),this._fullscreenButton.addEventListener(`click`,this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let e=this._getTitle();this._fullscreenButton.setAttribute(`aria-label`,e),this._fullscreenButton.title=e}_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 t.n(`fullscreenstart`)),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.n(`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()}},e.GeoJSONSource=ve,e.GeolocateControl=class extends t.E{constructor(e){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.n(`outofmaxbounds`,e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,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 Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!==`OFF`&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!==`ACTIVE_LOCK`||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove(`maplibregl-user-location-dot-stale`),this.fire(new t.n(`geolocate`,e)),this._finish()}},this._updateCamera=e=>{let n=new t.W(e.coords.longitude,e.coords.latitude),r=e.coords.accuracy,i=this._map.getBearing(),a=t.e({bearing:i},this.options.fitBoundsOptions),o=se.fromLngLat(n,r);this._map.fitBounds(o,a,{geolocateSource:!0})},this._updateMarker=e=>{if(e){let n=new t.W(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=e.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=e=>{if(this._map){if(e.code===1){this._watchState=`OFF`,this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-waiting`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-active`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-active-error`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-background`),this._geolocateButton.classList.remove(`maplibregl-ctrl-geolocate-background-error`),this._geolocateButton.disabled=!0;let e=this._map._getUIString(`GeolocateControl.LocationNotAvailable`);this._geolocateButton.title=e,this._geolocateButton.setAttribute(`aria-label`,e),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&mo)return;this._setErrorState()}this._watchState!==`OFF`&&this.options.showUserLocation&&this._dotElement.classList.add(`maplibregl-user-location-dot-stale`),this.fire(new t.n(`error`,e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=e=>{if(!this._map)return;let n=e?.[0]instanceof ResizeObserverEntry;e.geolocateSource||this._watchState!==`ACTIVE_LOCK`||n||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 t.n(`trackuserlocationend`)),this.fire(new t.n(`userlocationlostfocus`)))},this._setupUI=()=>{this._map&&(this._container.addEventListener(`contextmenu`,(e=>{e.preventDefault()})),this._geolocateButton=d.create(`button`,`maplibregl-ctrl-geolocate`,this._container),d.create(`span`,`maplibregl-ctrl-icon`,this._geolocateButton).setAttribute(`aria-hidden`,`true`),this._geolocateButton.type=`button`,this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(!1===e){t.w(`Geolocation support is not available so the GeolocateControl will be disabled.`);let e=this._map._getUIString(`GeolocateControl.LocationNotAvailable`);this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute(`aria-label`,e)}else{let e=this._map._getUIString(`GeolocateControl.FindMyLocation`);this._geolocateButton.disabled=!1,this._geolocateButton.title=e,this._geolocateButton.setAttribute(`aria-label`,e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute(`aria-pressed`,`false`),this._watchState=`OFF`),this.options.showUserLocation&&(this._dotElement=d.create(`div`,`maplibregl-user-location-dot`),this._userLocationDotMarker=new uo({element:this._dotElement}),this._circleElement=d.create(`div`,`maplibregl-user-location-accuracy-circle`),this._accuracyCircleMarker=new uo({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=t.e({},fo,e)}onAdd(e){return this._map=e,this._container=d.create(`div`,`maplibregl-ctrl maplibregl-ctrl-group`),this._setupUI(),function(){return t._(this,arguments,void 0,(function*(e=!1){if(oo!==void 0&&!e)return oo;if(window.navigator.permissions===void 0)return oo=!!window.navigator.geolocation,oo;try{oo=(yield window.navigator.permissions.query({name:`geolocation`})).state!==`denied`}catch{oo=!!window.navigator.geolocation}return oo}))}().then((e=>this._finishSetupUI(e))),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),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,po=0,mo=!1}_isOutOfMapMaxBounds(e){let t=this._map.getMaxBounds(),n=e.coords;return t&&(n.longitude<t.getWest()||n.longitude>t.getEast()||n.latitude<t.getSouth()||n.latitude>t.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 Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let e=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&e))return;let t=this._map.project(e),n=this._map.unproject([t.x+100,t.y]),r=e.distanceTo(n)/100,i=2*this._accuracy/r;this._circleElement.style.width=`${i.toFixed(2)}px`,this._circleElement.style.height=`${i.toFixed(2)}px`}trigger(){if(!this._setup)return t.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 t.n(`trackuserlocationstart`));break;case`WAITING_ACTIVE`:case`ACTIVE_LOCK`:case`ACTIVE_ERROR`:case`BACKGROUND_ERROR`:po--,mo=!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 t.n(`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 t.n(`trackuserlocationstart`)),this.fire(new t.n(`userlocationfocus`));break;default:throw 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 Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState===`OFF`&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let e;this._geolocateButton.classList.add(`maplibregl-ctrl-geolocate-waiting`),this._geolocateButton.setAttribute(`aria-pressed`,`true`),po++,po>1?(e={maximumAge:6e5,timeout:0},mo=!0):(e=this.options.positionOptions,mo=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}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)}},e.GlobeControl=class{constructor(){this._toggleProjection=()=>{let e=this._map.getProjection()?.type;this._map.setProjection(e!==`mercator`&&e?{type:`mercator`}:{type:`globe`}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{this._globeButton.classList.remove(`maplibregl-ctrl-globe`),this._globeButton.classList.remove(`maplibregl-ctrl-globe-enabled`),this._map.getProjection()?.type===`globe`?(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(e){return this._map=e,this._container=d.create(`div`,`maplibregl-ctrl maplibregl-ctrl-group`),this._globeButton=d.create(`button`,`maplibregl-ctrl-globe`,this._container),d.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}},e.Hash=Ji,e.ImageSource=ye,e.KeyboardHandler=Aa,e.LngLatBounds=se,e.LogoControl=Z,e.Map=ro,e.MapLibreMap=ro,e.MapMouseEvent=ia,e.MapTouchEvent=aa,e.MapWheelEvent=oa,e.Marker=uo,e.NavigationControl=class{constructor(e){this._updateZoomButtons=()=>{let e=this._map.getZoom(),t=e===this._map.getMaxZoom(),n=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute(`aria-disabled`,t.toString()),this._zoomOutButton.setAttribute(`aria-disabled`,n.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/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.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=(e,t)=>{let n=this._map._getUIString(`NavigationControl.${t}`);e.title=n,e.setAttribute(`aria-label`,n)},this.options=t.e({},io,e),this._container=d.create(`div`,`maplibregl-ctrl maplibregl-ctrl-group`),this._container.addEventListener(`contextmenu`,(e=>e.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton(`maplibregl-ctrl-zoom-in`,(e=>this._map.zoomIn({},{originalEvent:e}))),d.create(`span`,`maplibregl-ctrl-icon`,this._zoomInButton).setAttribute(`aria-hidden`,`true`),this._zoomOutButton=this._createButton(`maplibregl-ctrl-zoom-out`,(e=>this._map.zoomOut({},{originalEvent:e}))),d.create(`span`,`maplibregl-ctrl-icon`,this._zoomOutButton).setAttribute(`aria-hidden`,`true`)),this.options.showCompass&&(this._compass=this._createButton(`maplibregl-ctrl-compass`,(e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})})),this._compassIcon=d.create(`span`,`maplibregl-ctrl-icon`,this._compass),this._compassIcon.setAttribute(`aria-hidden`,`true`))}onAdd(e){return this._map=e,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 ao(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(e,t){let n=d.create(`button`,e,this._container);return n.type=`button`,n.addEventListener(`click`,t),n}},e.Popup=class extends t.E{constructor(e){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(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 t.n(`close`))),this),this._update=e=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=d.create(`div`,`maplibregl-popup`,this._map.getContainer()),this._tip=d.create(`div`,`maplibregl-popup-tip`,this._container),this._container.appendChild(this._content),this.options.className)for(let e of this.options.className.split(` `))this._container.classList.add(e);this._closeButton&&this._closeButton.setAttribute(`aria-label`,this._map._getUIString(`Popup.Close`)),this._trackPointer&&this._container.classList.add(`maplibregl-popup-track-pointer`)}let t;if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=so(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),e&&`point`in e&&e.point&&(t=e.point),this._trackPointer&&!t)return;let n=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationToScreenPoint(this._lngLat));let r=this.options.anchor,i=bo(this.options.offset);if(!r){let e=this._container.offsetWidth,t=this._container.offsetHeight,a=function(e){return e?{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}:{top:0,right:0,bottom:0,left:0}}(this.options.padding),o;o=n.y+i.bottom.y<t+a.top?[`top`]:n.y>this._map.transform.height-t-a.bottom?[`bottom`]:[],n.x<e/2+a.left?o.push(`left`):n.x>this._map.transform.width-e/2-a.right&&o.push(`right`),r=o.length===0?`bottom`:o.join(`-`)}let a=n.add(i[r]);this.options.subpixelPositioning||(a=a.round()),this._container.style.transform=`${co[r]} translate(${a.x}px,${a.y}px)`,lo(this._container,r,`popup`),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(vo),e)}addTo(e){return this._map&&this.remove(),this._map=e,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 t.n(`open`)),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.W.convert(e),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(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){let t=document.createDocumentFragment(),n=document.createElement(`body`),r;for(n.innerHTML=e;r=n.firstChild,r;)t.appendChild(r);return this.setDOMContent(t)}getMaxWidth(){return this._container?.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=d.create(`div`,`maplibregl-popup-content`,this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(e){return this._container&&this._container.classList.add(e),this}removeClassName(e){return this._container&&this._container.classList.remove(e),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){if(this._container)return this._container.classList.toggle(e)}setSubpixelPositioning(e){this.options.subpixelPositioning=e}setPadding(e){this.options.padding=e,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=d.create(`button`,`maplibregl-popup-close-button`,this._content),this._closeButton.type=`button`,this._closeButton.innerHTML=`&#215;`,this._closeButton.addEventListener(`click`,this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let e=this._container.querySelector(yo);e&&e.focus()}},e.RasterDEMTileSource=de,e.RasterTileSource=ue,e.ScaleControl=class{constructor(e){this._onMove=()=>{go(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,go(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},ho),e)}getDefaultPosition(){return`bottom-left`}onAdd(e){return this._map=e,this._container=d.create(`div`,`maplibregl-ctrl maplibregl-ctrl-scale`,e.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}},e.ScrollZoomHandler=Na,e.Style=Ln,e.TerrainControl=class{constructor(e){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=e}onAdd(e){return this._map=e,this._container=d.create(`div`,`maplibregl-ctrl maplibregl-ctrl-group`),this._terrainButton=d.create(`button`,`maplibregl-ctrl-terrain`,this._container),d.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}},e.TwoFingersTouchPitchHandler=Oa,e.TwoFingersTouchRotateHandler=Ea,e.TwoFingersTouchZoomHandler=wa,e.TwoFingersTouchZoomRotateHandler=za,e.VectorTileSource=le,e.VideoSource=be,e.addSourceType=(e,n)=>t._(void 0,void 0,void 0,(function*(){if(Ce(e))throw Error(`A source type called "${e}" already exists.`);((e,t)=>{Se[e]=t})(e,n)})),e.clearPrewarmedResources=function(){let e=j;e&&(e.isPreloaded()&&e.numActive()===1?(e.release(O),j=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()`))},e.createTileMesh=un,e.getGlobalDispatcher=ne,e.getMaxParallelImageRequests=function(){return t.c.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return De().getRTLTextPluginStatus()},e.getVersion=function(){return xo},e.getWorkerCount=function(){return k.workerCount},e.getWorkerUrl=function(){return t.c.WORKER_URL},e.importScriptInWorkers=function(e){return ne().broadcast(`IS`,e)},e.isTimeFrozen=function(){return c.isFrozen()},e.now=l,e.prewarm=function(){M().acquire(O)},e.restoreNow=function(){c.restoreNow()},e.setMaxParallelImageRequests=function(e){t.c.MAX_PARALLEL_IMAGE_REQUESTS=e},e.setNow=function(e){c.setNow(e)},e.setRTLTextPlugin=function(e,t){return De().setRTLTextPlugin(e,t)},e.setWorkerCount=function(e){k.workerCount=e},e.setWorkerUrl=function(e){t.c.WORKER_URL=e}})),e}))}))();let r=`https://gis.yarrow.uz`,i=`https://api.yarrow.uz`,a=null;function o(e){if(!e)throw Error(`apiKey is required`);a=e}function s(){if(!a)throw Error(`Yarrow API key not configured`);return a}let c=`yarrow:user_token`;function l(){if(typeof crypto<`u`&&typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(16);if(typeof crypto<`u`&&crypto.getRandomValues)crypto.getRandomValues(e);else for(let t=0;t<16;t++)e[t]=Math.floor(Math.random()*256);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e,e=>e.toString(16).padStart(2,`0`));return`${t.slice(0,4).join(``)}-${t.slice(4,6).join(``)}-${t.slice(6,8).join(``)}-${t.slice(8,10).join(``)}-${t.slice(10,16).join(``)}`}function u(){try{let e=localStorage.getItem(c);if(e)return e;let t=l();return localStorage.setItem(c,t),t}catch{return l()}}function d(e){try{let t=u();fetch(`${i}/api/tracking/track-dau`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({api_key:e,sdk_type:`javascript`,user_token:t})}).catch(()=>{})}catch{}}var f=`data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg2IiBoZWlnaHQ9IjUzIiB2aWV3Qm94PSIwIDAgMTg2IDUzIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KPHJlY3Qgd2lkdGg9IjU3IiBoZWlnaHQ9IjUzIiBmaWxsPSJ1cmwoI3BhdHRlcm4wXzFfODgpIi8+CjxyZWN0IHg9IjU3IiB5PSI2IiB3aWR0aD0iMTI4LjIxMSIgaGVpZ2h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E4SUFnREFBRHd3QTVieE5CRkFBQUFRelFoZXN3SEFBQVlPcW9qQVFBQVBMRFZrUUFBQUJnaVd4SkdJQVlBQURCRTdhb2pDY29BQUFEUzRjWlZnU1FGWVJnbXpRemJUQnNVKzExaHdyUkJmemNBQUVBYWt1SVpkMTQwSVF6RElHSGhwR2tBQUFEb2p3M0dndjhEU0RVSnRYZmx1djhBQUFBQVNVVk9SSzVDWUlJPSIvPgo8L2RlZnM+Cjwvc3ZnPgo=`;let p=`bottom-left`,m=`data-yarrow-brand-badge-root`,h=`data-yarrow-brand-badge-theme`,g=e=>{switch(e){case`top-left`:case`top-right`:case`bottom-left`:case`bottom-right`:return e;default:return p}};var _=class{constructor(){this.state={theme:`light`,position:p}}mount(e,t){this.state=t,this.container=e,this.teardown(!1),getComputedStyle(e).position===`static`&&e.style.setProperty(`position`,`relative`,`important`);let n=this.host??e.querySelector(`[${m}]`)??this.createHost();this.host=n;let r=()=>{if(!this.host||!this.container)return;let e=this.host;this.container.contains(e)||this.container.appendChild(e),e.removeAttribute(`hidden`),e.setAttribute(m,`1`),e.setAttribute(h,this.state.theme),this.applyHostStyles(e)};r(),this.observer=new MutationObserver(()=>{r()}),this.observer.observe(e,{childList:!0}),this.enforcerInterval=setInterval(()=>{r()},1e3)}update(e){this.state=e,this.host&&(this.host.setAttribute(h,this.state.theme),this.applyHostStyles(this.host))}getHostElement(){return this.host}teardown(e=!0){this.observer?.disconnect(),this.observer=void 0,this.enforcerInterval&&=(clearInterval(this.enforcerInterval),void 0),e&&this.host?.isConnected&&this.host.remove(),e&&(this.host=void 0,this.container=void 0)}getHostInlineStyle(){let e=``;switch(this.state.position){case`top-left`:e=`top: 6px !important; left: 6px !important;`;break;case`top-right`:e=`top: 6px !important; right: 6px !important;`;break;case`bottom-right`:e=`bottom: 6px !important; right: 6px !important;`;break;default:e=`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`,e].join(`; `)}applyHostStyles(e){let t=this.getHostInlineStyle();e.getAttribute(`style`)!==t&&e.setAttribute(`style`,t)}createHost(){let e=document.createElement(`div`);e.setAttribute(m,`1`),e.setAttribute(h,this.state.theme),e.setAttribute(`aria-hidden`,`true`),e.removeAttribute(`hidden`),this.applyHostStyles(e);let t=e.attachShadow({mode:`closed`}),n=document.createElement(`style`);n.textContent=`
754
+ :host {
755
+ all: initial;
756
+ }
757
+ .badge {
758
+ display: inline-flex !important;
759
+ align-items: center !important;
760
+ justify-content: center !important;
761
+ background: rgba(255, 255, 255, 0.416) !important;
762
+ backdrop-filter: blur(4px) !important;
763
+ border: 1px solid rgba(255, 255, 255, 0.3) !important;
764
+ border-radius: 16px !important;
765
+ box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07) !important;
766
+ padding: 2px 10px !important;
767
+ }
768
+ :host([data-yarrow-brand-badge-theme="dark"]) .badge {
769
+ background: rgba(15, 23, 42, 0.416) !important;
770
+ border: 1px solid rgba(255, 255, 255, 0.16) !important;
771
+ box-shadow: 0 2px 12px rgba(2, 6, 23, 0.5) !important;
772
+ }
773
+ img {
774
+ display: block !important;
775
+ width: 106px !important;
776
+ height: auto !important;
777
+ max-width: none !important;
778
+ opacity: 1 !important;
779
+ visibility: visible !important;
780
+ }
781
+ `;let r=document.createElement(`div`);r.className=`badge`;let i=document.createElement(`img`);return i.src=f,i.alt=`Yarrow`,i.draggable=!1,r.appendChild(i),t.append(n,r),e}};let v=[`#3b82f6`,`#10b981`,`#f59e0b`,`#ef4444`,`#8b5cf6`],y=1440*60*1e3,b=`yarrow-cache-v1-tile`,x=`yarrow-cache-v1-icon`,S=`x-yarrow-cached-at`,C=new Set([`Tile`,`Style`,`Glyphs`,`SpriteImage`,`SpriteJSON`,`Source`]),w=()=>typeof globalThis<`u`&&globalThis.caches!==void 0&&typeof globalThis.caches.open==`function`,T=e=>{let t=typeof e?.lifespanDays==`number`&&Number.isFinite(e.lifespanDays)&&e.lifespanDays>0?e.lifespanDays:30;return{enabled:e?.enabled??!1,lifespanDays:t}},E=(e,t)=>/^https?:\/\//i.test(e)?e:t?new URL(e,t).toString():typeof window<`u`?new URL(e,window.location.origin).toString():e,D=(e,t)=>`yarrowcache://resource?u=${encodeURIComponent(e)}&ttl=${t}`,O=e=>{let t=e.headers.get(S);if(!t)return null;let n=Number(t);return Number.isFinite(n)?n:null},k=async e=>({data:await e.arrayBuffer(),cacheControl:e.headers.get(`cache-control`),expires:e.headers.get(`expires`),contentType:e.headers.get(`content-type`)}),A=async(e,t,n)=>{let r=await fetch(e,{method:n?.method??`GET`,headers:n?.headers,body:n?.body,credentials:n?.credentials,signal:t.signal});if(!r.ok)throw Error(`Request failed: ${r.status} ${r.statusText}`);return k(r)},j=async(e,t,n)=>{let r=new Headers;n.contentType&&r.set(`content-type`,n.contentType),n.cacheControl&&r.set(`cache-control`,n.cacheControl),n.expires&&r.set(`expires`,n.expires),r.set(S,Date.now().toString()),await e.put(t,new Response(n.data.slice(0),{status:200,headers:r}))},ee=async(e,t,n,r,i)=>{if(!w())return A(e,r,i);let a=await caches.open(t),o=await a.match(e);if(o){let t=O(o);if(!(t===null||Date.now()-t>n))return k(o);try{let t=await A(e,r,i);return await j(a,e,t),t}catch{return k(o)}}let s=await A(e,r,i);return await j(a,e,s),s},M=()=>30*y,te=e=>e?C.has(e):!1;var ne=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NDAgNjQwIj48IS0tIUZvbnQgQXdlc29tZSBGcmVlIDcuMi4wIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlL2ZyZWUgQ29weXJpZ2h0IDIwMjYgRm9udGljb25zLCBJbmMuLS0+PHBhdGggZD0iTTUyOCAzMjBDNTI4IDIwNS4xIDQzNC45IDExMiAzMjAgMTEyQzIwNS4xIDExMiAxMTIgMjA1LjEgMTEyIDMyMEMxMTIgNDM0LjkgMjA1LjEgNTI4IDMyMCA1MjhDNDM0LjkgNTI4IDUyOCA0MzQuOSA1MjggMzIwek02NCAzMjBDNjQgMTc4LjYgMTc4LjYgNjQgMzIwIDY0QzQ2MS40IDY0IDU3NiAxNzguNiA1NzYgMzIwQzU3NiA0NjEuNCA0NjEuNCA1NzYgMzIwIDU3NkMxNzguNiA1NzYgNjQgNDYxLjQgNjQgMzIwek0zNzAuNyAzODkuMUwyMjYuNCA0NDQuNkMyMDcgNDUyLjEgMTg3LjkgNDMzIDE5NS40IDQxMy42TDI1MC45IDI2OS4zQzI1NC4yIDI2MC44IDI2MC44IDI1NC4yIDI2OS4zIDI1MC45TDQxMy42IDE5NS40QzQzMyAxODcuOSA0NTIuMSAyMDcgNDQ0LjYgMjI2LjRMMzg5LjEgMzcwLjdDMzg1LjggMzc5LjIgMzc5LjIgMzg1LjggMzcwLjcgMzg5LjF6TTM1MiAzMjBDMzUyIDMwMi4zIDMzNy43IDI4OCAzMjAgMjg4QzMwMi4zIDI4OCAyODggMzAyLjMgMjg4IDMyMEMyODggMzM3LjcgMzAyLjMgMzUyIDMyMCAzNTJDMzM3LjcgMzUyIDM1MiAzMzcuNyAzNTIgMzIweiIvPjwvc3ZnPg==`;let N={enabled:!1,position:`right`,zoom:!0,compass:!0},re=e=>{let t=e?.position,n=N.position;return t===`left`||t===`left-top`||t===`left-bottom`||t===`right`||t===`right-top`||t===`right-bottom`?n=t:t===`top-left`||t===`bottom-left`?n=t===`top-left`?`left-top`:`left-bottom`:(t===`top-right`||t===`bottom-right`)&&(n=t===`top-right`?`right-top`:`right-bottom`),{enabled:e?.enabled??N.enabled,position:n,zoom:e?.zoom??N.zoom,compass:e?.compass??N.compass}};var ie=class{constructor(){this.inset={top:0,right:0,bottom:0,left:0},this.state={theme:`light`,controls:N}}mount(e,t){this.map=e,this.update(t)}update(e){if(this.state=e,!this.map||!e.controls.enabled){this.teardown(!0);return}let t=this.map.getContainer();getComputedStyle(t).position===`static`&&t.style.setProperty(`position`,`relative`,`important`),this.host||(this.createDom(t),this.attachMapListeners()),this.host&&(this.host.dataset.yarrowTheme=this.state.theme,this.applyHostPosition(this.host),this.renderVisibleButtons(),this.updateCompassNeedle())}setInset(e){this.inset={top:e?.top??0,right:e?.right??0,bottom:e?.bottom??0,left:e?.left??0},this.host&&this.applyHostPosition(this.host)}teardown(e=!0){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,e&&this.host?.isConnected&&this.host.remove(),e&&(this.host=void 0)}createDom(e){let t=document.createElement(`div`);t.setAttribute(`data-yarrow-controls-root`,`1`),t.dataset.yarrowTheme=this.state.theme;let n=t.attachShadow({mode:`closed`}),r=document.createElement(`style`);r.textContent=`
782
+ :host {
783
+ all: initial;
784
+ }
785
+ .group {
786
+ display: flex;
787
+ flex-direction: column;
788
+ gap: 6px;
789
+ }
790
+ button {
791
+ all: unset;
792
+ width: 36px;
793
+ height: 36px;
794
+ border-radius: 16px;
795
+ display: inline-flex;
796
+ align-items: center;
797
+ justify-content: center;
798
+ cursor: pointer;
799
+ box-sizing: border-box;
800
+ font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
801
+ font-weight: 700;
802
+ font-size: 18px;
803
+ line-height: 1;
804
+ color: #0f172a;
805
+ background: rgba(255, 255, 255, 0.416);
806
+ backdrop-filter: blur(4px);
807
+ border: 1px solid rgba(255, 255, 255, 0.3);
808
+ box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
809
+ }
810
+ button:hover {
811
+ background: rgba(255, 255, 255, 0.6);
812
+ }
813
+ button:active {
814
+ transform: translateY(1px);
815
+ }
816
+ .needle {
817
+ width: 32px;
818
+ height: 32px;
819
+ display: block;
820
+ filter: none;
821
+ transition: transform 120ms linear;
822
+ }
823
+ :host([data-yarrow-theme="dark"]) button {
824
+ color: #f8fafc;
825
+ background: rgba(15, 23, 42, 0.416);
826
+ border: 1px solid rgba(255, 255, 255, 0.16);
827
+ box-shadow: 0 2px 12px rgba(2, 6, 23, 0.5);
828
+ }
829
+ :host([data-yarrow-theme="dark"]) button:hover {
830
+ background: rgba(15, 23, 42, 0.68);
831
+ }
832
+ :host([data-yarrow-theme="dark"]) .needle {
833
+ filter: invert(1);
834
+ }
835
+ `;let i=document.createElement(`div`);i.className=`group`;let a=document.createElement(`button`);a.type=`button`,a.ariaLabel=`Zoom in`,a.textContent=`+`,this.onZoomInClick=()=>{this.map?.zoomIn({duration:200})},a.addEventListener(`click`,this.onZoomInClick);let o=document.createElement(`button`);o.type=`button`,o.ariaLabel=`Zoom out`,o.textContent=`-`,this.onZoomOutClick=()=>{this.map?.zoomOut({duration:200})},o.addEventListener(`click`,this.onZoomOutClick);let s=document.createElement(`button`);s.type=`button`,s.ariaLabel=`Reset north`;let c=document.createElement(`img`);c.className=`needle`,c.src=ne,c.alt=``,c.draggable=!1,s.appendChild(c),this.onCompassClick=()=>{this.map?.easeTo({bearing:0,pitch:0,duration:250})},s.addEventListener(`click`,this.onCompassClick),i.append(a,o,s),n.append(r,i),e.appendChild(t),this.host=t,this.zoomInButton=a,this.zoomOutButton=o,this.compassButton=s,this.compassNeedle=c}applyHostPosition(e){let t=8+this.inset.top,n=8+this.inset.right,r=8+this.inset.bottom,i=8+this.inset.left,a=``,o=`transform: translateY(-50%) !important`;switch(this.state.controls.position){case`left`:a=`top: 50% !important; left: ${i}px !important;`;break;case`left-top`:a=`top: ${t}px !important; left: ${i}px !important;`,o=`transform: none !important`;break;case`left-bottom`:a=`bottom: ${r}px !important; left: ${i}px !important;`,o=`transform: none !important`;break;case`right-top`:a=`top: ${t}px !important; right: ${n}px !important;`,o=`transform: none !important`;break;case`right-bottom`:a=`bottom: ${r}px !important; right: ${n}px !important;`,o=`transform: none !important`;break;default:a=`top: 50% !important; right: ${n}px !important;`}e.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;let e=this.state.controls.zoom,t=this.state.controls.compass;this.zoomInButton.style.display=e?`inline-flex`:`none`,this.zoomOutButton.style.display=e?`inline-flex`:`none`,this.compassButton.style.display=t?`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)`)}},ae=class{constructor(e){let{container:t,center:n,zoom:r=10,minZoom:i=0,maxZoom:a=19,theme:o=`light`,cache:s={},brandBadgePosition:c=p,controls:l={},excludePoiLayer:u=!1,apiKey:d}=e;if(!d)throw Error(`apiKey is required`);this.container=t,this.center=n,this.zoom=r,this.minZoom=i,this.maxZoom=a,this.theme=o,this.cache=T(s),this.brandBadgePosition=g(c),this.controls=re(l),this.excludePoiLayer=u,this.apiKey=d}},oe=class{constructor(e,t){this.getMap=e,this.getLayers=t,this.iconHandlers=[],this.layerHandlers=[],this.backgroundColor=null,this.styleListener=null}detach(e){let t=this.getMap();if(!t){e.length=0;return}for(let n of e)t.off(`mouseenter`,n.layerName,n.mouseenter),t.off(`mouseleave`,n.layerName,n.mouseleave),t.off(`click`,n.layerName,n.click);e.length=0}onMoveEnd(e){this.getMap()?.on(`moveend`,()=>{let t=this.getMap(),n=t?.getCenter(),r=t?.getZoom();n&&r!==void 0&&e(n.lat,n.lng,r)})}onMapClick(e){this.getMap()?.on(`click`,t=>{e(t.lngLat.lat,t.lngLat.lng)})}onIconClick(e,t){let n=this.getLayers(),r=[];switch(e){case`pois`:r=n.filter(e=>e.type===`node_tile`).map(e=>e.name);break;case`buildings`:r=n.filter(e=>e.type===`polygon_tile`).map(e=>e.name);break}this.detach(this.iconHandlers);let i=this.getMap();i&&r.forEach(e=>{let n=()=>{i.getCanvas().style.cursor=`pointer`},r=()=>{i.getCanvas().style.cursor=``},a=e=>{e.features?.[0]?.properties&&t(e.lngLat.lat,e.lngLat.lng,e.features[0].properties)};i.on(`mouseenter`,e,n),i.on(`mouseleave`,e,r),i.on(`click`,e,a),this.iconHandlers.push({layerName:e,mouseenter:n,mouseleave:r,click:a})})}onLayerClick(e,t){let n=this.getLayers().filter(t=>e===`buildings`&&t.type===`polygon_tile`||e===`pois`&&t.type===`node_tile`).map(e=>e.name);this.detach(this.layerHandlers);let r=this.getMap();r&&n.forEach(e=>{let n=()=>{r.getCanvas().style.cursor=`pointer`},i=()=>{r.getCanvas().style.cursor=``},a=e=>{e.features?.[0]?.properties&&t(e.lngLat.lat,e.lngLat.lng,e.features[0].properties)};r.on(`mouseenter`,e,n),r.on(`mouseleave`,e,i),r.on(`click`,e,a),this.layerHandlers.push({layerName:e,mouseenter:n,mouseleave:i,click:a})})}changeBackgroundColor(e){let t=this.getMap();if(!t)return;this.backgroundColor=e;let n=()=>{let e=this.backgroundColor;e!=null&&t.isStyleLoaded()&&t.getLayer(`background`)&&t.setPaintProperty(`background`,`background-color`,e)};this.styleListener||(this.styleListener=()=>n(),t.on(`styledata`,this.styleListener)),n()}},se=class{constructor(e,t){this.getMap=e,this.setLayers=t,this.layers=[]}getLayers(){return this.layers}setLayersArray(e){this.layers=e,this.setLayers&&this.setLayers(e)}addSource(e,t){let n=this.getMap();if(!n)return;let r=n.getSource(e);if(r){typeof r.setData==`function`?r.setData(t):console.warn(`Source "${e}" already exists and does not support setData.`);return}n.addSource(e,{type:`geojson`,data:t})}updateSourceData(e,t){let n=this.getMap();if(!n)return;let r=n.getSource(e);if(r&&typeof r.setData==`function`){r.setData(t);return}this.addSource(e,t)}addLayer(e,t,n,r={},i={},a={},o={}){let s=this.getMap();if(!s)return;let c=o.sourceId??e;s.getLayer(e)&&s.removeLayer(e),o.sourceId?s.getSource(c)?n&&this.updateSourceData(c,n):this.addSource(c,n):(s.getSource(e)&&s.removeSource(e),this.addSource(e,n));let l={id:e,type:t,source:c,paint:r,layout:Object.fromEntries(Object.entries(i??{}).filter(([e])=>e!==`icon-image-data`)),...o.filter?{filter:o.filter}:{}};if(`icon-image`in i&&`icon-image-data`in i){let e=new Image;e.src=String(i[`icon-image-data`]),a.width&&(e.width=a.width),a.height&&(e.height=a.height),e.onload=()=>{let t=String(i[`icon-image`]);s.hasImage(t)||s.addImage(t,e)}}s.addLayer(l)}removeLayer(e){let t=this.getMap();if(!t)return;let n=t.getLayer(e),r=n?.source??e;n&&t.removeLayer(e),t.getSource(r)&&(t.getStyle().layers?.some(e=>`source`in e&&e.source===r)||t.removeSource(r))}setFeatureState(e,t){this.getMap()?.setFeatureState(e,t)}queryRenderedFeatures(e,t){let n=this.getMap();return n?n.queryRenderedFeatures(e,t):[]}},ce=class{constructor(e){this.getMap=e}addMarker(e,t={}){let r=this.getMap();if(!r)return console.warn(`Map not initialized`),null;let i=new n.Marker({element:t.element,color:t.color||`#FF0000`,draggable:t.draggable||!1,anchor:t.anchor||`bottom`}).setLngLat([e[0],e[1]]).addTo(r);return t.onClick&&i.getElement().addEventListener(`click`,t.onClick),i}removeMarker(e){if(!e){console.warn(`No marker provided to remove`);return}e.remove()}},le=class{constructor(e){this.getMap=e}zoomTo(e,t,n){this.getMap()?.flyTo({center:[t,e],zoom:n,speed:1})}fitBounds(e){let t=this.getBoundingBox(e),n=.003;Math.abs(t.xMax-t.xMin)<n&&(t.xMin-=n/2,t.xMax+=n/2),Math.abs(t.yMax-t.yMin)<n&&(t.yMin-=n/2,t.yMax+=n/2),this.getMap()?.fitBounds([[t.xMin,t.yMin],[t.xMax,t.yMax]],{padding:50,duration:1e3})}getBoundingBox(e){let t={xMin:180,yMin:180,xMax:-180,yMax:-180},n=e=>{let[n,r]=e;t.xMin=Math.min(t.xMin,n),t.xMax=Math.max(t.xMax,n),t.yMin=Math.min(t.yMin,r),t.yMax=Math.max(t.yMax,r)},r=e=>Array.isArray(e)&&e.length>=2&&typeof e[0]==`number`&&typeof e[1]==`number`;for(let t of e.features){let e=t.geometry?.type,i=t.geometry?.coordinates;if(e===`Point`&&r(i))n(i);else if(e===`LineString`&&Array.isArray(i))for(let e of i)r(e)&&n(e);else if(e===`Polygon`&&Array.isArray(i)){for(let e of i)if(Array.isArray(e))for(let t of e)r(t)&&n(t)}}return t}};let ue=[`#22c55e`,`#aaaaaa`,`#cccccc`,`#dddddd`,`#eeeeee`],de=()=>{if(typeof document>`u`)return;let e=document.getElementById(`hover-popup`);e&&e.remove()},fe=(e,t=[`route`])=>{for(let n of t)for(let t=0;t<5;t++)e(`${n}-${t}`),e(`${n}-label-${t}`);de()},pe=e=>e.map(e=>{let t=e.geometry.coordinates.map(e=>[e.lng,e.lat]);return{...e,geometry:{...e.geometry,coordinates:t}}}),me=e=>{let t=s();if(!t)return e;try{let n=new URL(e);return n.searchParams.set(`api_key`,t),n.toString()}catch{return e}};var he=class{constructor(e,t,n,r){this.getMap=e,this.addLayer=t,this.removeLayer=n,this.fitBounds=r,this.usedLayerPrefixes=new Set}async buildRoute(e){let{profile:t,coordinates:n,routeColor:r=ue[0],routeWidth:i=5,routeOpacity:a=1,alternativeColor:o=ue[1],alternativeWidth:s=2.5,alternativeOpacity:c=.5,routeLineCap:l=`round`,routeLineJoin:u=`round`,fitBounds:d=!0,clearOldRoutes:f=!0,language:p,layerPrefix:m=`route`,onRouteClick:h,onRouteHover:g}=e;if(n.length<2)throw Error(`At least two coordinates are required to build a route.`);try{let e=me(`https://api.yarrow.uz/api/routing/route`),_=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`,...p?{"Accept-Language":p}:{}},body:JSON.stringify({profile:t.toUpperCase(),coordinates:n.map(e=>({lng:e[0],lat:e[1]}))})});if(!_.ok)throw Error(`Request failed: ${_.status} ${_.statusText}`);let v=await _.json();if(!v.success)return console.warn(`⚠️ Маршрут не найден`),{features:[],directions:[],meta:{profile:t,totalRoutes:0,bestRouteIndex:0,duration:0,distance:0}};let y=v.data.path?.features||[];if(y=pe(y),!y.length)return console.warn(`⚠️ Нет фич для отображения маршрута`),{features:[],directions:[],meta:{profile:t,totalRoutes:0,bestRouteIndex:0,duration:0,distance:0}};let b=v.data.directions?.routes?.map(e=>e.properties||[])||[];f&&fe(this.removeLayer,this.usedLayerPrefixes),this.usedLayerPrefixes.add(m);let x=this.getMap(),S=y[0]?.properties.duration||0,C=y[0]?.properties.distance||0;return y.forEach((e,t)=>{let n=`${m}-${t}`,d=t===0;if(this.addLayer(n,`line`,{type:`FeatureCollection`,features:[e]},{"line-color":d?r:o,"line-width":d?i:s,"line-opacity":d?a:c},{"line-cap":l,"line-join":u}),x&&(h||g)){let r=r=>({feature:e,index:t,isBest:d,layerId:n,lngLat:{lng:r.lngLat.lng,lat:r.lngLat.lat},originalEvent:r});h&&x.on(`click`,n,e=>h(r(e))),g&&(x.on(`mouseenter`,n,e=>{x.getCanvas().style.cursor=`pointer`,g(r(e))}),x.on(`mouseleave`,n,()=>{x.getCanvas().style.cursor=``,g(null)}))}}),d&&x&&this.fitBounds({type:`FeatureCollection`,features:[y[0]]}),{features:y,directions:b,meta:{profile:t,totalRoutes:y.length,bestRouteIndex:0,duration:S,distance:C}}}catch(e){throw console.error(`❌ Ошибка при построении маршрута:`,e),e}}async buildRouteWithLabels(e,t,n){console.warn(`⚠️ buildRouteWithLabels() is deprecated and will be removed in upcoming releases. Use buildRoute() instead. See docs: https://yarrow.uz/docs/routing`);let r=await this.buildRoute({profile:n,coordinates:[e,t]});return{features:r.features,directions:r.directions[0]||[]}}async buildMultiSegmentRouteWithLabels(e,t,n){console.warn(`⚠️ buildMultiSegmentRouteWithLabels() is deprecated and will be removed in upcoming releases. Use buildRoute() instead. See docs: https://yarrow.uz/docs/routing`);let r=await this.buildRoute({profile:t,coordinates:e,language:n});return{features:r.features,directions:r.directions}}clearAllRoutes(){fe(this.removeLayer,this.usedLayerPrefixes),this.usedLayerPrefixes.clear();let e=document.getElementById(`hover-popup`);e&&e.remove(),console.log(`✅ All routes cleared`)}},ge=class{constructor(e){this.addLayer=e}renderRoutes(e,t=`route`){e.forEach((e,n)=>{this.addLayer(`${t}-${n}`,`line`,{type:`FeatureCollection`,features:[e]},{"line-color":v[n%v.length],"line-width":4,"line-opacity":.8},{"line-join":`round`,"line-cap":`round`})})}};let _e=e=>{let t=s();if(!t)return e;try{let n=new URL(e);return n.searchParams.set(`api_key`,t),n.toString()}catch{return e}},ve=(e,t,n,r)=>{let i=e=>e*Math.PI/180,a=i(e),o=i(n),s=i(n-e),c=i(r-t),l=Math.sin(s/2)**2+Math.cos(a)*Math.cos(o)*Math.sin(c/2)**2;return 6371e3*(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)))};var ye=class{constructor(e,t,n,r){this.getMap=e,this.fitBounds=t,this.addLayer=n,this.removeLayer=r}highlightSearchResults(e,t={}){let n=1e3,r=0,a=null,o=null,s=null,c=!0,l=null,u=!1,d=!1,f=`${t.layerName||`search-results`}-icons`,p=t.layerName||`search-results`,m=e=>{if(e.features?.length&&e.features[0].properties){let n=e.features[0];t.onIconClick?.(e.lngLat.lat,e.lngLat.lng,n.properties)}},h=()=>{let e=this.getMap();!e||!u||(e.off(`click`,f,m),e.off(`mouseenter`,f,_),e.off(`mouseleave`,f,v),u=!1)},g=()=>{d=!0,l&&=(l.abort(),null);let e=this.getMap();e&&(h(),e.getLayer(f)&&this.removeLayer(f),e.getLayer(`${f}-label`)&&this.removeLayer(`${f}-label`),e.getLayer(p)&&this.removeLayer(p),e.off(`moveend`,y),o&&=(clearTimeout(o),null),s&&=(clearTimeout(s),null),t.onLoadingStateChange?.(!1))},_=()=>{let e=this.getMap();e&&(e.getCanvas().style.cursor=`pointer`)},v=()=>{let e=this.getMap();e&&(e.getCanvas().style.cursor=``)},y=()=>{!this.getMap()||!a||(o&&clearTimeout(o),o=setTimeout(()=>{let e=this.getMap();if(!e||!a)return;let n=e.getCenter(),r=n.lat,i=n.lng,o=ve(a[0],a[1],r,i);o>=500&&(console.log(`Map moved ${o.toFixed(2)}m, refetching...`),t.onLoadingStateChange?.(`rerender`),x())},250))},b=async(t,n,r)=>{let a=_e(`${i}/api/search/`),o=new URL(a);o.searchParams.set(`q`,e),o.searchParams.set(`lat`,String(t)),o.searchParams.set(`lng`,String(n)),o.searchParams.set(`country`,`Uzbekistan`),o.searchParams.set(`sort_by`,`relevance`),o.searchParams.set(`page`,`1`),o.searchParams.set(`page_size`,`15`);let s=await fetch(o.toString(),{headers:{"Content-Type":`application/json`},signal:r});if(!s.ok)throw Error(`Request failed: ${s.status} ${s.statusText}`);return((await s.json())?.results||[]).map(e=>({id:e.id,name:e.name,icon_img:e.icon_img,latitude:e.address?.location?.lat,longitude:e.address?.location?.lng}))},x=async()=>{let e=this.getMap();if(!e)return;let n=e.getCenter(),r=n.lat,i=n.lng;l&&l.abort();let o=new AbortController;l=o;let g;try{g=await b(r,i,o.signal)}catch(e){if(o.signal.aborted)return;console.error(`Error fetching search results:`,e),t.onLoadingStateChange?.(!1);return}if(o.signal.aborted||d)return;l===o&&(l=null),t.onLoadingStateChange?.(!1),t.onResultsUpdate?.(g),a=[r,i];let y={layerName:p,iconImage:`geo-icon`,pulseAnimation:!1,zoomToResults:!0,onIconClick:void 0,...t};h(),this.removeLayer(p),this.removeLayer(f),this.removeLayer(`${f}-label`);let x=g.filter(e=>typeof e.latitude==`number`&&typeof e.longitude==`number`).map(e=>({type:`Feature`,geometry:{type:`Point`,coordinates:[e.longitude,e.latitude]},properties:{...e,id:e.id||Math.random().toString(36).substring(2)}}));if(x.length===0){console.warn(`No valid search results to display`);return}let S={type:`FeatureCollection`,features:x};s&&clearTimeout(s),s=setTimeout(()=>{if(s=null,d)return;let e=this.getMap();if(e)try{if(y.iconImage&&(g.some(e=>e.icon_img)?(this.addLayer(f,`symbol`,S,{"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}),e.on(`click`,f,m),e.on(`mouseenter`,f,_),e.on(`mouseleave`,f,v),u=!0):(this.addLayer(f,`circle`,S,{"circle-radius":10,"circle-color":`#f97316`,"circle-stroke-width":2,"circle-stroke-color":`#ffffff`}),this.addLayer(`${f}-label`,`symbol`,S,{"text-halo-color":`#ffffff`,"text-halo-width":2},{"text-field":[`get`,`name`],"text-size":12,"text-offset":[0,1.5],"text-anchor":`top`,"text-font":[`Open Sans Bold`,`Arial Unicode MS Bold`]}),e.on(`click`,f,m),e.on(`mouseenter`,f,_),e.on(`mouseleave`,f,v),u=!0)),c&&y.zoomToResults&&x.length>0)try{this.fitBounds(S)}catch(e){console.warn(`Failed to zoom to search results`,e)}c=!1}catch(e){console.error(`Error rendering search results:`,e)}},0)},S=()=>{let e=this.getMap();if(!e){r<30?(console.warn(`Map not available. Retrying in ${n/1e3}s...`),r++,setTimeout(S,n)):(console.error(`Map instance never became available. Aborting highlight.`),t.onLoadingStateChange?.(!1));return}t.onLoadingStateChange?.(`firstRender`),x(),e.on(`moveend`,y)};return S(),g}},be=class{constructor(e,t,n,r,i,a,o,s,c,l,u){this.getMap=e,this.config=t,this.fetchJson=n,this.fixStyle=r,this.getIconsMap=i,this.addIconsToMap=a,this.badgeController=o,this.controlsController=s,this.syncCollision=c,this.updateLayersArray=l,this.setLayers=u,this.layers=[]}setLayersArray(e){this.layers=e,this.setLayers&&this.setLayers(e)}async changeStyles(e){let t=this.getMap();if(!t)throw Error(`Map not initialized`);try{let n=`/styles/`;e===`satellite`?n=`/styles/satellite/`:e===`hybrid`&&(n=`/styles/hybrid/`),this.config.theme===`dark`&&(n+=n.includes(`?`)?`&dark=true`:`?dark=true`);let r=await this.fetchJson(n,`yarrow-cache-v1-tile`);if(!r)throw Error(`Failed to fetch style data`);return this.fixStyle(r),t.setStyle(r),r.layers&&this.updateLayersArray(r),t.once(`styledata`,async()=>{try{let e=await this.getIconsMap();await this.addIconsToMap(e)}catch(e){console.error(`Error re-adding icons after style change:`,e)}}),r}catch(e){throw console.error(`Error changing styles:`,e),e}}async changeTheme(e){let t=this.getMap();if(!t)throw Error(`Map not initialized`);try{this.config.theme=e,this.badgeController.update({theme:this.config.theme,position:this.config.brandBadgePosition}),this.controlsController.update({theme:this.config.theme,controls:this.config.controls}),this.syncCollision();let n=e===`dark`?`/styles/?dark=true`:`/styles/`,r=await this.fetchJson(n,`yarrow-cache-v1-tile`);if(!r)throw Error(`Failed to fetch style data`);return this.fixStyle(r),t.setStyle(r),r.layers&&this.updateLayersArray(r),t.once(`styledata`,async()=>{try{let e=await this.getIconsMap();await this.addIconsToMap(e)}catch(e){console.error(`Error re-adding icons after theme change:`,e)}}),r}catch(e){throw console.error(`Error changing theme:`,e),e}}changeBrandBadgePosition(e){let t=g(e);return this.config.brandBadgePosition=t,this.badgeController.update({theme:this.config.theme,position:this.config.brandBadgePosition}),this.syncCollision(),t}getControlsInsetForCollision(e,t,n){let r=Math.max(0,Math.ceil(n)+8);return r<=0?{}:t===`top-left`&&e===`left-top`||t===`top-right`&&e===`right-top`?{top:r}:t===`bottom-left`&&e===`left-bottom`||t===`bottom-right`&&e===`right-bottom`?{bottom:r}:{}}};e.YarrowMap=class e{static{this.isCacheProtocolRegistered=!1}constructor(e){this.layers=[],this.badgeController=new _,this.controlsController=new ie,this.config=e,this.ensureCacheProtocol(),o(e.apiKey)}ensureCacheProtocol(){e.isCacheProtocolRegistered||=((0,n.addProtocol)(`yarrowcache`,async(e,t)=>{let n=new URL(e.url),i=n.searchParams.get(`u`),a=n.searchParams.get(`ttl`);if(!i)throw Error(`Missing cache target URL`);let o=E(i,r),s=Number(a),c=await ee(o,b,Number.isFinite(s)&&s>0?s:M(),t,e);return{data:c.data,cacheControl:c.cacheControl,expires:c.expires}}),!0)}get cacheLifespanMs(){return this.config.cache.lifespanDays*y}isCacheEnabled(){return this.config.cache.enabled}transformRequestForCache(e,t){return!this.isCacheEnabled()||!t||!te(t)?{url:e}:{url:D(E(e,r),this.cacheLifespanMs)}}async fetchJson(e,t){let n=E(e,r),i=this.addApiKeyToUrl(n);if(!this.isCacheEnabled()){let e=await fetch(i);if(!e.ok)throw Error(`Request failed: ${e.status} ${e.statusText}`);return e.json()}let a=new AbortController,o=await ee(i,t,this.cacheLifespanMs,a),s=new TextDecoder().decode(o.data);return JSON.parse(s)}addApiKeyToUrl(e){let t=s();if(!t)return e;try{let n=new URL(e);return n.searchParams.set(`api_key`,t),n.toString()}catch{return e}}loadImageFromSrc(e,t=!0){return new Promise((n,r)=>{let i=new Image;t&&(i.crossOrigin=`anonymous`),i.onload=()=>n(i),i.onerror=()=>r(Error(`Failed to load icon image: ${e}`)),i.src=e})}async loadIconImage(e){if(!this.isCacheEnabled())return this.loadImageFromSrc(e);let t=new AbortController,n=await ee(E(e,r),x,this.cacheLifespanMs,t),i=new Blob([n.data],{type:n.contentType||`image/png`}),a=URL.createObjectURL(i);try{return await this.loadImageFromSrc(a,!1)}finally{URL.revokeObjectURL(a)}}async getIconsMap(){return(await this.fetchJson(`/icons-image`,x)).reduce((e,t)=>(e[t.icon_image_name]=t.icon_image_url,e),{})}async addIconsToMap(e){let t=this.map;t&&await Promise.all(Object.entries(e).map(async([e,n])=>{if(!(!t||t.hasImage(e)))try{let r=await this.loadIconImage(n);t&&!t.hasImage(e)&&t.addImage(e,r)}catch(t){console.error(`Error loading icon "${e}":`,t)}}))}patchMapRemoveForBadgeCleanup(){if(!this.map)return;let e=this.map,t=e.remove.bind(e);e.remove=(()=>(this.stopBadgeCollisionObserver(),this.badgeController.teardown(!0),this.controlsController.teardown(!0),t()))}getControlsInsetForCollision(e,t,n){let r=Math.max(0,Math.ceil(n)+8);return r<=0?{}:t===`top-left`&&(e===`left`||e===`left-top`)||t===`top-right`&&(e===`right`||e===`right-top`)?{top:r}:t===`bottom-left`&&(e===`left`||e===`left-bottom`)||t===`bottom-right`&&(e===`right`||e===`right-bottom`)?{bottom:r}:{}}syncOverlayCollisionInset(){if(!this.config.controls.enabled){this.controlsController.setInset();return}let e=this.badgeController.getHostElement(),t=e?.getBoundingClientRect().height??0;if(!e?.isConnected||t<=0){this.controlsController.setInset();return}this.controlsController.setInset(this.getControlsInsetForCollision(this.config.controls.position,this.config.brandBadgePosition,t))}stopBadgeCollisionObserver(){this.badgeResizeObserver?.disconnect(),this.badgeResizeObserver=void 0}startBadgeCollisionObserver(){this.stopBadgeCollisionObserver();let e=this.badgeController.getHostElement();!e||typeof window>`u`||window.ResizeObserver===void 0||(this.badgeResizeObserver=new window.ResizeObserver(()=>{this.syncOverlayCollisionInset()}),this.badgeResizeObserver.observe(e))}fixStyle(e){if(e&&(e.glyphs=`https://fonts.openmaptiles.org/{fontstack}/{range}.pbf`,console.log(`✅ YarrowSDK: Glyphs URL forced to:`,e.glyphs),e.layers)){let t=0;e.layers.forEach(e=>{let n=e;n.type===`symbol`&&(n.layout||={},(n.layout[`text-font`]?.[0]||``).toLowerCase().includes(`bold`)?n.layout[`text-font`]=[`Open Sans Bold`]:n.layout[`text-font`]=[`Open Sans Regular`],t++)}),console.log(`✅ YarrowSDK: Aggressively fixed fonts for ${t} symbol layers`)}}updateLayersArray(e){this.layers=[],e.layers&&e.layers.forEach(e=>{let t=e;t.source&&t[`source-layer`]&&this.layers.push({type:t[`source-layer`],name:t.id})})}storePoiLayerConfig(e){if(!e.layers||!e.sources)return;let t=e.layers.filter(e=>e.source===`node_tile`),n=e.sources?.node_tile;t.length>0&&(this.poiLayerConfig=t[0]),n&&(this.poiSourceConfig={type:n.type,tiles:n.tiles})}removePoiLayerFromStyle(e){!e.layers||!e.sources||(e.layers=e.layers.filter(e=>e.source!==`node_tile`),delete e.sources?.node_tile)}async init(){d(this.config.apiKey);let e=await this.getIconsMap(),t=this.config.theme===`dark`?`/styles/?dark=true`:`/styles/`,r=await this.fetchJson(t,b);this.updateLayersArray(r),this.storePoiLayerConfig(r),this.config.excludePoiLayer&&this.removePoiLayerFromStyle(r),this.layerManager=new se(()=>this.map,e=>{this.layers=e}),this.markerManager=new ce(()=>this.map),this.navigationManager=new le(()=>this.map),this.eventManager=new oe(()=>this.map,()=>this.layers),this.stylesManager=new be(()=>this.map,this.config,(e,t)=>this.fetchJson(e,t),e=>this.fixStyle(e),()=>this.getIconsMap(),e=>this.addIconsToMap(e),this.badgeController,this.controlsController,()=>this.syncOverlayCollisionInset(),e=>this.updateLayersArray(e),e=>{this.layers=e}),this.routingRenderer=new ge((e,t,n,r,i,a,o)=>this.layerManager.addLayer(e,t,n,r,i,a,o)),this.routingBuilder=new he(()=>this.map,(e,t,n,r,i,a,o)=>this.layerManager.addLayer(e,t,n,r,i,a,o),e=>this.layerManager.removeLayer(e),e=>this.navigationManager.fitBounds(e)),this.searchManager=new ye(()=>this.map,e=>this.navigationManager.fitBounds(e),(e,t,n,r,i,a,o)=>this.layerManager.addLayer(e,t,n,r,i,a,o),e=>this.layerManager.removeLayer(e)),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:(e,t)=>this.transformRequestForCache(e,t)}),this.patchMapRemoveForBadgeCleanup(),this.badgeController.mount(this.map.getContainer(),{theme:this.config.theme,position:this.config.brandBadgePosition}),this.controlsController.mount(this.map,{theme:this.config.theme,controls:this.config.controls}),this.syncOverlayCollisionInset(),this.startBadgeCollisionObserver(),this.map._controls.forEach(e=>{this.map?.removeControl(e)}),this.map.on(`load`,async()=>{await this.addIconsToMap(e)})}async clearCache(){w()&&await Promise.all([caches.delete(b),caches.delete(x)])}async changeStyles(e){return this.stylesManager.changeStyles(e)}async changeTheme(e){return this.stylesManager.changeTheme(e)}changeBrandBadgePosition(e){return this.stylesManager.changeBrandBadgePosition(e)}enablePoiLayer(){!this.map||this.map.getLayer(`pois_tile_layer`)||this.poiSourceConfig&&this.poiLayerConfig&&(this.map.getSource(`node_tile`)||this.map.addSource(`node_tile`,{type:`vector`,tiles:this.poiSourceConfig.tiles}),this.map.addLayer(this.poiLayerConfig))}disablePoiLayer(){this.map&&this.map.getLayer(`pois_tile_layer`)&&this.map.removeLayer(`pois_tile_layer`)}zoomTo(e,t,n){this.navigationManager.zoomTo(e,t,n)}fitBounds(e){this.navigationManager.fitBounds(e)}getBoundingBox(e){return this.navigationManager.getBoundingBox(e)}onMoveEnd(e){this.eventManager.onMoveEnd(e)}onMapClick(e){this.eventManager.onMapClick(e)}onIconClick(e,t){this.eventManager.onIconClick(e,t)}onLayerClick(e,t){this.eventManager.onLayerClick(e,t)}changeBackgroundColor(e){this.eventManager.changeBackgroundColor(e)}addSource(e,t){this.layerManager.addSource(e,t)}updateSourceData(e,t){this.layerManager.updateSourceData(e,t)}addLayer(e,t,n,r={},i={},a={},o={}){this.layerManager.addLayer(e,t,n,r,i,a,o)}removeLayer(e){this.layerManager.removeLayer(e)}setFeatureState(e,t){this.layerManager.setFeatureState(e,t)}queryRenderedFeatures(e,t){return this.layerManager.queryRenderedFeatures(e,t)}addMarker(e,t={}){return this.markerManager.addMarker(e,t)}removeMarker(e){this.markerManager.removeMarker(e)}renderRoutes(e,t=`route`){this.routingRenderer.renderRoutes(e,t)}async buildRoute(e){return this.routingBuilder.buildRoute(e)}async buildRouteWithLabels(e,t,n){return this.routingBuilder.buildRouteWithLabels(e,t,n)}async buildMultiSegmentRouteWithLabels(e,t,n){return this.routingBuilder.buildMultiSegmentRouteWithLabels(e,t,n)}clearAllRoutes(){this.routingBuilder.clearAllRoutes()}highlightSearchResults(e,t={}){return this.searchManager.highlightSearchResults(e,t)}},e.YarrowMapConfig=ae});