Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Updated to latest mapbox GL and bug fix for loading error on certain mapsettings.json

Rich Turner8e0e087f8043
diff --git a/client/src/main/java/org/openremote/app/client/widget/MapWidget.java b/client/src/main/java/org/openremote/app/client/widget/MapWidget.java
index 4d1b5fa77..d6db86d27 100644
--- a/client/src/main/java/org/openremote/app/client/widget/MapWidget.java
+++ b/client/src/main/java/org/openremote/app/client/widget/MapWidget.java
@@ -19,13 +19,10 @@
*/
package org.openremote.app.client.widget;
-import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.dom.client.Document;
import com.google.gwt.user.client.ui.FlowPanel;
-import elemental2.dom.DomGlobal;
import jsinterop.base.Any;
import org.openremote.app.client.AppSecurity;
-import org.openremote.app.client.OpenRemoteApp;
import org.openremote.app.client.interop.mapbox.*;
import org.openremote.model.geo.GeoJSON;
import org.openremote.model.geo.GeoJSONFeatureCollection;
@@ -174,9 +171,8 @@ public class MapWidget extends FlowPanel {
mapOptions.put("container", hostElementId);
mapOptions.put("attributionControl", true);
Any mapOptionsAny = mapOptions.asAny();
- addAuthorization(mapOptionsAny, security);
- mapboxMap = new MapboxMap(mapOptionsAny);
+ mapboxMap = initMap(mapOptionsAny, security);
mapboxMap.on(EventType.LOAD, eventData -> {
initFeatureLayers();
@@ -287,12 +283,17 @@ public class MapWidget extends FlowPanel {
return sourceOptions;
}
- public static native void addAuthorization(Any mapOptions, AppSecurity security) /*-{
- mapOptions.transformRequest = function(url, resourceType) {
- return {
- url: url,
- headers: { 'Authorization': 'Bearer ' + security.keycloak.token }
- }
+ public static native MapboxMap initMap(Any mapOptions, AppSecurity security) /*-{
+
+ // No explanation for this without adding transform outside of JSNI map fails to load
+ mapOptions.transformRequest = $wnd.transformMapRequest(security);
+
+ // No explanation for this without doing this map fails to load with certain styles
+ for (var i=0; i<mapOptions.style.layers.length; i++) {
+ var layer = mapOptions.style.layers[i];
+ delete layer.metadata;
}
+
+ return new $wnd.mapboxgl.Map(mapOptions)
}-*/;
}
diff --git a/client/src/main/webapp/index.html b/client/src/main/webapp/index.html
index 6b2b3e703..8655beeca 100644
--- a/client/src/main/webapp/index.html
+++ b/client/src/main/webapp/index.html
@@ -19,8 +19,8 @@
let app = e.detail.app;
Promise.all([
- app.load.css("/shared/map/mapbox-gl-js/0.42.2/mapbox-gl.css"),
- app.load.js("/shared/map/mapbox-gl-js/0.42.2/mapbox-gl.js"),
+ app.load.css("/shared/map/mapbox-gl-js/1.2.1/mapbox-gl.css"),
+ app.load.js("/shared/map/mapbox-gl-js/1.2.1/mapbox-gl.js"),
app.load.js("/static/node_modules/chart.js/dist/Chart.js"),
@@ -31,6 +31,15 @@
app.set("error", e);
});
});
+
+ window.transformMapRequest = function(security) {
+ return (url, resourceType) => {
+ return {
+ url: url,
+ headers: {Authorization: 'Bearer ' + security.keycloak.token}
+ }
+ };
+ };
</script>
<style type="text/css">
diff --git a/deployment/manager/shared/map/mapbox-gl-js/0.42.2/mapbox-gl.css b/deployment/manager/shared/map/mapbox-gl-js/0.42.2/mapbox-gl.css
deleted file mode 100644
index e4000ff8c..000000000
--- a/deployment/manager/shared/map/mapbox-gl-js/0.42.2/mapbox-gl.css
+++ /dev/null
@@ -1,437 +0,0 @@
-.mapboxgl-map {
- font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;
- overflow: hidden;
- position: relative;
- -webkit-tap-highlight-color: rgba(0,0,0,0);
-}
-.mapboxgl-map:-webkit-full-screen {
- width: 100%;
- height: 100%;
-}
-
-.mapboxgl-missing-css {
- display: none;
-}
-
-.mapboxgl-canvas-container.mapboxgl-interactive,
-.mapboxgl-ctrl-nav-compass {
- cursor: -webkit-grab;
- cursor: -moz-grab;
- cursor: grab;
-}
-.mapboxgl-canvas-container.mapboxgl-interactive:active,
-.mapboxgl-ctrl-nav-compass:active {
- cursor: -webkit-grabbing;
- cursor: -moz-grabbing;
- cursor: grabbing;
-}
-
-.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate {
- -ms-touch-action: pan-x pan-y;
- touch-action: pan-x pan-y;
-}
-.mapboxgl-canvas-container.mapboxgl-touch-drag-pan {
- -ms-touch-action: pinch-zoom;
-}
-.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan {
- -ms-touch-action: none;
- touch-action: none;
-}
-.mapboxgl-ctrl-top-left,
-.mapboxgl-ctrl-top-right,
-.mapboxgl-ctrl-bottom-left,
-.mapboxgl-ctrl-bottom-right { position:absolute; pointer-events:none; z-index:2; }
-.mapboxgl-ctrl-top-left { top:0; left:0; }
-.mapboxgl-ctrl-top-right { top:0; right:0; }
-.mapboxgl-ctrl-bottom-left { bottom:0; left:0; }
-.mapboxgl-ctrl-bottom-right { right:0; bottom:0; }
-
-.mapboxgl-ctrl { clear:both; pointer-events:auto }
-.mapboxgl-ctrl-top-left .mapboxgl-ctrl { margin:10px 0 0 10px; float:left; }
-.mapboxgl-ctrl-top-right .mapboxgl-ctrl{ margin:10px 10px 0 0; float:right; }
-.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl { margin:0 0 10px 10px; float:left; }
-.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl { margin:0 10px 10px 0; float:right; }
-
-.mapboxgl-ctrl-group {
- border-radius: 4px;
- -moz-box-shadow: 0px 0px 2px rgba(0,0,0,0.1);
- -webkit-box-shadow: 0px 0px 2px rgba(0,0,0,0.1);
- box-shadow: 0px 0px 0px 2px rgba(0,0,0,0.1);
- overflow: hidden;
- background: #fff;
-}
-.mapboxgl-ctrl-group > button {
- width: 30px;
- height: 30px;
- display: block;
- padding: 0;
- outline: none;
- border: none;
- border-bottom: 1px solid #ddd;
- box-sizing: border-box;
- background-color: rgba(0,0,0,0);
- cursor: pointer;
-}
-/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */
-.mapboxgl-ctrl > button::-moz-focus-inner {
- border: 0;
- padding: 0;
-}
-.mapboxgl-ctrl > button:last-child {
- border-bottom: 0;
-}
-.mapboxgl-ctrl > button:hover {
- background-color: rgba(0,0,0,0.05);
-}
-.mapboxgl-ctrl-icon,
-.mapboxgl-ctrl-icon > .mapboxgl-ctrl-compass-arrow {
- speak: none;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-.mapboxgl-ctrl-icon {
- padding: 5px;
-}
-.mapboxgl-ctrl-icon.mapboxgl-ctrl-zoom-out {
- background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20viewBox%3D%270%200%2020%2020%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%0A%20%20%3Cpath%20style%3D%27fill%3A%23333333%3B%27%20d%3D%27m%207%2C9%20c%20-0.554%2C0%20-1%2C0.446%20-1%2C1%200%2C0.554%200.446%2C1%201%2C1%20l%206%2C0%20c%200.554%2C0%201%2C-0.446%201%2C-1%200%2C-0.554%20-0.446%2C-1%20-1%2C-1%20z%27%20%2F%3E%0A%3C%2Fsvg%3E%0A");
-}
-.mapboxgl-ctrl-icon.mapboxgl-ctrl-zoom-in {
- background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20viewBox%3D%270%200%2020%2020%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%0A%20%20%3Cpath%20style%3D%27fill%3A%23333333%3B%27%20d%3D%27M%2010%206%20C%209.446%206%209%206.4459904%209%207%20L%209%209%20L%207%209%20C%206.446%209%206%209.446%206%2010%20C%206%2010.554%206.446%2011%207%2011%20L%209%2011%20L%209%2013%20C%209%2013.55401%209.446%2014%2010%2014%20C%2010.554%2014%2011%2013.55401%2011%2013%20L%2011%2011%20L%2013%2011%20C%2013.554%2011%2014%2010.554%2014%2010%20C%2014%209.446%2013.554%209%2013%209%20L%2011%209%20L%2011%207%20C%2011%206.4459904%2010.554%206%2010%206%20z%27%20%2F%3E%0A%3C%2Fsvg%3E%0A");
-}
-.mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate {
- background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D%270%200%2020%2020%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%0D%0A%20%20%3Cpath%20style%3D%27fill%3A%23333%3B%27%20d%3D%27M10%204C9%204%209%205%209%205L9%205.1A5%205%200%200%200%205.1%209L5%209C5%209%204%209%204%2010%204%2011%205%2011%205%2011L5.1%2011A5%205%200%200%200%209%2014.9L9%2015C9%2015%209%2016%2010%2016%2011%2016%2011%2015%2011%2015L11%2014.9A5%205%200%200%200%2014.9%2011L15%2011C15%2011%2016%2011%2016%2010%2016%209%2015%209%2015%209L14.9%209A5%205%200%200%200%2011%205.1L11%205C11%205%2011%204%2010%204zM10%206.5A3.5%203.5%200%200%201%2013.5%2010%203.5%203.5%200%200%201%2010%2013.5%203.5%203.5%200%200%201%206.5%2010%203.5%203.5%200%200%201%2010%206.5zM10%208.3A1.8%201.8%200%200%200%208.3%2010%201.8%201.8%200%200%200%2010%2011.8%201.8%201.8%200%200%200%2011.8%2010%201.8%201.8%200%200%200%2010%208.3z%27%20%2F%3E%0D%0A%3C%2Fsvg%3E");
-}
-.mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate:disabled {
- background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D%270%200%2020%2020%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%0D%0A%20%20%3Cpath%20style%3D%27fill%3A%23aaa%3B%27%20d%3D%27M10%204C9%204%209%205%209%205L9%205.1A5%205%200%200%200%205.1%209L5%209C5%209%204%209%204%2010%204%2011%205%2011%205%2011L5.1%2011A5%205%200%200%200%209%2014.9L9%2015C9%2015%209%2016%2010%2016%2011%2016%2011%2015%2011%2015L11%2014.9A5%205%200%200%200%2014.9%2011L15%2011C15%2011%2016%2011%2016%2010%2016%209%2015%209%2015%209L14.9%209A5%205%200%200%200%2011%205.1L11%205C11%205%2011%204%2010%204zM10%206.5A3.5%203.5%200%200%201%2013.5%2010%203.5%203.5%200%200%201%2010%2013.5%203.5%203.5%200%200%201%206.5%2010%203.5%203.5%200%200%201%2010%206.5zM10%208.3A1.8%201.8%200%200%200%208.3%2010%201.8%201.8%200%200%200%2010%2011.8%201.8%201.8%200%200%200%2011.8%2010%201.8%201.8%200%200%200%2010%208.3z%27%20%2F%3E%0D%0A%3C%2Fsvg%3E");
-}
-.mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active {
- background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D%270%200%2020%2020%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%0D%0A%20%20%3Cpath%20style%3D%27fill%3A%2333b5e5%3B%27%20d%3D%27M10%204C9%204%209%205%209%205L9%205.1A5%205%200%200%200%205.1%209L5%209C5%209%204%209%204%2010%204%2011%205%2011%205%2011L5.1%2011A5%205%200%200%200%209%2014.9L9%2015C9%2015%209%2016%2010%2016%2011%2016%2011%2015%2011%2015L11%2014.9A5%205%200%200%200%2014.9%2011L15%2011C15%2011%2016%2011%2016%2010%2016%209%2015%209%2015%209L14.9%209A5%205%200%200%200%2011%205.1L11%205C11%205%2011%204%2010%204zM10%206.5A3.5%203.5%200%200%201%2013.5%2010%203.5%203.5%200%200%201%2010%2013.5%203.5%203.5%200%200%201%206.5%2010%203.5%203.5%200%200%201%2010%206.5zM10%208.3A1.8%201.8%200%200%200%208.3%2010%201.8%201.8%200%200%200%2010%2011.8%201.8%201.8%200%200%200%2011.8%2010%201.8%201.8%200%200%200%2010%208.3z%27%20%2F%3E%0D%0A%3C%2Fsvg%3E");
-}
-.mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error {
- background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D%270%200%2020%2020%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%0D%0A%20%20%3Cpath%20style%3D%27fill%3A%23e58978%3B%27%20d%3D%27M10%204C9%204%209%205%209%205L9%205.1A5%205%200%200%200%205.1%209L5%209C5%209%204%209%204%2010%204%2011%205%2011%205%2011L5.1%2011A5%205%200%200%200%209%2014.9L9%2015C9%2015%209%2016%2010%2016%2011%2016%2011%2015%2011%2015L11%2014.9A5%205%200%200%200%2014.9%2011L15%2011C15%2011%2016%2011%2016%2010%2016%209%2015%209%2015%209L14.9%209A5%205%200%200%200%2011%205.1L11%205C11%205%2011%204%2010%204zM10%206.5A3.5%203.5%200%200%201%2013.5%2010%203.5%203.5%200%200%201%2010%2013.5%203.5%203.5%200%200%201%206.5%2010%203.5%203.5%200%200%201%2010%206.5zM10%208.3A1.8%201.8%200%200%200%208.3%2010%201.8%201.8%200%200%200%2010%2011.8%201.8%201.8%200%200%200%2011.8%2010%201.8%201.8%200%200%200%2010%208.3z%27%20%2F%3E%0D%0A%3C%2Fsvg%3E");
-}
-.mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background {
- background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D%270%200%2020%2020%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%0A%20%20%3Cpath%20style%3D%27fill%3A%2333b5e5%3B%27%20d%3D%27M%2010%2C4%20C%209%2C4%209%2C5%209%2C5%20L%209%2C5.1%20C%207.0357113%2C5.5006048%205.5006048%2C7.0357113%205.1%2C9%20L%205%2C9%20c%200%2C0%20-1%2C0%20-1%2C1%200%2C1%201%2C1%201%2C1%20l%200.1%2C0%20c%200.4006048%2C1.964289%201.9357113%2C3.499395%203.9%2C3.9%20L%209%2C15%20c%200%2C0%200%2C1%201%2C1%201%2C0%201%2C-1%201%2C-1%20l%200%2C-0.1%20c%201.964289%2C-0.400605%203.499395%2C-1.935711%203.9%2C-3.9%20l%200.1%2C0%20c%200%2C0%201%2C0%201%2C-1%20C%2016%2C9%2015%2C9%2015%2C9%20L%2014.9%2C9%20C%2014.499395%2C7.0357113%2012.964289%2C5.5006048%2011%2C5.1%20L%2011%2C5%20c%200%2C0%200%2C-1%20-1%2C-1%20z%20m%200%2C2.5%20c%201.932997%2C0%203.5%2C1.5670034%203.5%2C3.5%200%2C1.932997%20-1.567003%2C3.5%20-3.5%2C3.5%20C%208.0670034%2C13.5%206.5%2C11.932997%206.5%2C10%206.5%2C8.0670034%208.0670034%2C6.5%2010%2C6.5%20Z%27%20%2F%3E%0A%3C%2Fsvg%3E");
-}
-.mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error {
- background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D%270%200%2020%2020%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%0A%20%20%3Cpath%20style%3D%27fill%3A%23e54e33%3B%27%20d%3D%27M%2010%2C4%20C%209%2C4%209%2C5%209%2C5%20L%209%2C5.1%20C%207.0357113%2C5.5006048%205.5006048%2C7.0357113%205.1%2C9%20L%205%2C9%20c%200%2C0%20-1%2C0%20-1%2C1%200%2C1%201%2C1%201%2C1%20l%200.1%2C0%20c%200.4006048%2C1.964289%201.9357113%2C3.499395%203.9%2C3.9%20L%209%2C15%20c%200%2C0%200%2C1%201%2C1%201%2C0%201%2C-1%201%2C-1%20l%200%2C-0.1%20c%201.964289%2C-0.400605%203.499395%2C-1.935711%203.9%2C-3.9%20l%200.1%2C0%20c%200%2C0%201%2C0%201%2C-1%20C%2016%2C9%2015%2C9%2015%2C9%20L%2014.9%2C9%20C%2014.499395%2C7.0357113%2012.964289%2C5.5006048%2011%2C5.1%20L%2011%2C5%20c%200%2C0%200%2C-1%20-1%2C-1%20z%20m%200%2C2.5%20c%201.932997%2C0%203.5%2C1.5670034%203.5%2C3.5%200%2C1.932997%20-1.567003%2C3.5%20-3.5%2C3.5%20C%208.0670034%2C13.5%206.5%2C11.932997%206.5%2C10%206.5%2C8.0670034%208.0670034%2C6.5%2010%2C6.5%20Z%27%20%2F%3E%0A%3C%2Fsvg%3E");
-}
-.mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting {
- -webkit-animation: mapboxgl-spin 2s infinite linear;
- -moz-animation: mapboxgl-spin 2s infinite linear;
- -o-animation: mapboxgl-spin 2s infinite linear;
- -ms-animation: mapboxgl-spin 2s infinite linear;
- animation: mapboxgl-spin 2s infinite linear;
-}
-
-@-webkit-keyframes mapboxgl-spin {
- 0% { -webkit-transform: rotate(0deg); }
- 100% { -webkit-transform: rotate(360deg); }
-}
-@-moz-keyframes mapboxgl-spin {
- 0% { -moz-transform: rotate(0deg); }
- 100% { -moz-transform: rotate(360deg); }
-}
-@-o-keyframes mapboxgl-spin {
- 0% { -o-transform: rotate(0deg); }
- 100% { -o-transform: rotate(360deg); }
-}
-@-ms-keyframes mapboxgl-spin {
- 0% { -ms-transform: rotate(0deg); }
- 100% { -ms-transform: rotate(360deg); }
-}
-@keyframes mapboxgl-spin {
- 0% { transform: rotate(0deg); }
- 100% { transform: rotate(360deg); }
-}
-.mapboxgl-ctrl-icon.mapboxgl-ctrl-fullscreen {
- background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4wLjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4KCjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgdmVyc2lvbj0iMS4xIgogICBpZD0iTGF5ZXJfMSIKICAgeD0iMHB4IgogICB5PSIwcHgiCiAgIHZpZXdCb3g9IjAgMCAyMCAyMCIKICAgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjAgMjA7IgogICB4bWw6c3BhY2U9InByZXNlcnZlIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjkxIHIxMzcyNSIKICAgc29kaXBvZGk6ZG9jbmFtZT0iZnVsbHNjcmVlbi5zdmciPjxtZXRhZGF0YQogICAgIGlkPSJtZXRhZGF0YTQxODUiPjxyZGY6UkRGPjxjYzpXb3JrCiAgICAgICAgIHJkZjphYm91dD0iIj48ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZvcm1hdD48ZGM6dHlwZQogICAgICAgICAgIHJkZjpyZXNvdXJjZT0iaHR0cDovL3B1cmwub3JnL2RjL2RjbWl0eXBlL1N0aWxsSW1hZ2UiIC8+PGRjOnRpdGxlPjwvZGM6dGl0bGU+PC9jYzpXb3JrPjwvcmRmOlJERj48L21ldGFkYXRhPjxkZWZzCiAgICAgaWQ9ImRlZnM0MTgzIiAvPjxzb2RpcG9kaTpuYW1lZHZpZXcKICAgICBwYWdlY29sb3I9IiNmZmZmZmYiCiAgICAgYm9yZGVyY29sb3I9IiM2NjY2NjYiCiAgICAgYm9yZGVyb3BhY2l0eT0iMSIKICAgICBvYmplY3R0b2xlcmFuY2U9IjEwIgogICAgIGdyaWR0b2xlcmFuY2U9IjEwIgogICAgIGd1aWRldG9sZXJhbmNlPSIxMCIKICAgICBpbmtzY2FwZTpwYWdlb3BhY2l0eT0iMCIKICAgICBpbmtzY2FwZTpwYWdlc2hhZG93PSIyIgogICAgIGlua3NjYXBlOndpbmRvdy13aWR0aD0iMTQ3MSIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSI2OTUiCiAgICAgaWQ9Im5hbWVkdmlldzQxODEiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlua3NjYXBlOnpvb209IjExLjMxMzcwOCIKICAgICBpbmtzY2FwZTpjeD0iMTQuNjk4MjgiCiAgICAgaW5rc2NhcGU6Y3k9IjEwLjUyNjY4OSIKICAgICBpbmtzY2FwZTp3aW5kb3cteD0iNjk3IgogICAgIGlua3NjYXBlOndpbmRvdy15PSIyOTgiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMCIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJMYXllcl8xIgogICAgIGlua3NjYXBlOnNuYXAtYmJveD0idHJ1ZSIKICAgICBpbmtzY2FwZTpiYm94LXBhdGhzPSJ0cnVlIgogICAgIGlua3NjYXBlOm9iamVjdC1wYXRocz0idHJ1ZSIKICAgICBpbmtzY2FwZTpiYm94LW5vZGVzPSJ0cnVlIgogICAgIGlua3NjYXBlOm9iamVjdC1ub2Rlcz0idHJ1ZSI+PGlua3NjYXBlOmdyaWQKICAgICAgIHR5cGU9Inh5Z3JpZCIKICAgICAgIGlkPSJncmlkNjA3NiIgLz48L3NvZGlwb2RpOm5hbWVkdmlldz48cGF0aAogICAgIGQ9Ik0gNSA0IEMgNC41IDQgNCA0LjUgNCA1IEwgNCA2IEwgNCA5IEwgNC41IDkgTCA1Ljc3NzM0MzggNy4yOTY4NzUgQyA2Ljc3NzEzMTkgOC4wNjAyMTMxIDcuODM1NzY1IDguOTU2NTcyOCA4Ljg5MDYyNSAxMCBDIDcuODI1NzEyMSAxMS4wNjMzIDYuNzc2MTc5MSAxMS45NTE2NzUgNS43ODEyNSAxMi43MDcwMzEgTCA0LjUgMTEgTCA0IDExIEwgNCAxNSBDIDQgMTUuNSA0LjUgMTYgNSAxNiBMIDkgMTYgTCA5IDE1LjUgTCA3LjI3MzQzNzUgMTQuMjA1MDc4IEMgOC4wNDI4OTMxIDEzLjE4Nzg4NiA4LjkzOTU0NDEgMTIuMTMzNDgxIDkuOTYwOTM3NSAxMS4wNjgzNTkgQyAxMS4wNDIzNzEgMTIuMTQ2OTkgMTEuOTQyMDkzIDEzLjIxMTIgMTIuNzA3MDMxIDE0LjIxODc1IEwgMTEgMTUuNSBMIDExIDE2IEwgMTQgMTYgTCAxNSAxNiBDIDE1LjUgMTYgMTYgMTUuNSAxNiAxNSBMIDE2IDE0IEwgMTYgMTEgTCAxNS41IDExIEwgMTQuMjA1MDc4IDEyLjcyNjU2MiBDIDEzLjE3Nzk4NSAxMS45NDk2MTcgMTIuMTEyNzE4IDExLjA0MzU3NyAxMS4wMzcxMDkgMTAuMDA5NzY2IEMgMTIuMTUxODU2IDguOTgxMDYxIDEzLjIyNDM0NSA4LjA3OTg2MjQgMTQuMjI4NTE2IDcuMzA0Njg3NSBMIDE1LjUgOSBMIDE2IDkgTCAxNiA1IEMgMTYgNC41IDE1LjUgNCAxNSA0IEwgMTEgNCBMIDExIDQuNSBMIDEyLjcwMzEyNSA1Ljc3NzM0MzggQyAxMS45MzI2NDcgNi43ODY0ODM0IDExLjAyNjY5MyA3Ljg1NTQ3MTIgOS45NzA3MDMxIDguOTE5OTIxOSBDIDguOTU4NDczOSA3LjgyMDQ5NDMgOC4wNjk4NzY3IDYuNzYyNzE4OCA3LjMwNDY4NzUgNS43NzE0ODQ0IEwgOSA0LjUgTCA5IDQgTCA2IDQgTCA1IDQgeiAiCiAgICAgaWQ9InBhdGg0MTY5IiAvPjwvc3ZnPg==");
-}
-.mapboxgl-ctrl-icon.mapboxgl-ctrl-shrink {
- background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4wLjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4KCjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c29kaXBvZGk9Imh0dHA6Ly9zb2RpcG9kaS5zb3VyY2Vmb3JnZS5uZXQvRFREL3NvZGlwb2RpLTAuZHRkIgogICB4bWxuczppbmtzY2FwZT0iaHR0cDovL3d3dy5pbmtzY2FwZS5vcmcvbmFtZXNwYWNlcy9pbmtzY2FwZSIKICAgdmVyc2lvbj0iMS4xIgogICBpZD0iTGF5ZXJfMSIKICAgeD0iMHB4IgogICB5PSIwcHgiCiAgIHZpZXdCb3g9IjAgMCAyMCAyMCIKICAgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjAgMjA7IgogICB4bWw6c3BhY2U9InByZXNlcnZlIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIwLjkxIHIxMzcyNSIKICAgc29kaXBvZGk6ZG9jbmFtZT0ic2hyaW5rLnN2ZyI+PG1ldGFkYXRhCiAgICAgaWQ9Im1ldGFkYXRhMTkiPjxyZGY6UkRGPjxjYzpXb3JrCiAgICAgICAgIHJkZjphYm91dD0iIj48ZGM6Zm9ybWF0PmltYWdlL3N2Zyt4bWw8L2RjOmZvcm1hdD48ZGM6dHlwZQogICAgICAgICAgIHJkZjpyZXNvdXJjZT0iaHR0cDovL3B1cmwub3JnL2RjL2RjbWl0eXBlL1N0aWxsSW1hZ2UiIC8+PGRjOnRpdGxlPjwvZGM6dGl0bGU+PC9jYzpXb3JrPjwvcmRmOlJERj48L21ldGFkYXRhPjxkZWZzCiAgICAgaWQ9ImRlZnMxNyIgLz48c29kaXBvZGk6bmFtZWR2aWV3CiAgICAgcGFnZWNvbG9yPSIjZmZmZmZmIgogICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IgogICAgIGJvcmRlcm9wYWNpdHk9IjEiCiAgICAgb2JqZWN0dG9sZXJhbmNlPSIxMCIKICAgICBncmlkdG9sZXJhbmNlPSIxMCIKICAgICBndWlkZXRvbGVyYW5jZT0iMTAiCiAgICAgaW5rc2NhcGU6cGFnZW9wYWNpdHk9IjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTp3aW5kb3ctd2lkdGg9IjIwMjEiCiAgICAgaW5rc2NhcGU6d2luZG93LWhlaWdodD0iOTA4IgogICAgIGlkPSJuYW1lZHZpZXcxNSIKICAgICBzaG93Z3JpZD0iZmFsc2UiCiAgICAgaW5rc2NhcGU6em9vbT0iMSIKICAgICBpbmtzY2FwZTpjeD0iNC45NTAxMDgyIgogICAgIGlua3NjYXBlOmN5PSIxMC44NTQ3NDciCiAgICAgaW5rc2NhcGU6d2luZG93LXg9IjAiCiAgICAgaW5rc2NhcGU6d2luZG93LXk9IjAiCiAgICAgaW5rc2NhcGU6d2luZG93LW1heGltaXplZD0iMCIKICAgICBpbmtzY2FwZTpjdXJyZW50LWxheWVyPSJMYXllcl8xIgogICAgIGlua3NjYXBlOnNuYXAtYmJveD0idHJ1ZSIKICAgICBpbmtzY2FwZTpiYm94LXBhdGhzPSJ0cnVlIgogICAgIGlua3NjYXBlOnNuYXAtYmJveC1lZGdlLW1pZHBvaW50cz0idHJ1ZSIKICAgICBpbmtzY2FwZTpiYm94LW5vZGVzPSJ0cnVlIgogICAgIGlua3NjYXBlOnNuYXAtYmJveC1taWRwb2ludHM9InRydWUiCiAgICAgaW5rc2NhcGU6b2JqZWN0LXBhdGhzPSJ0cnVlIgogICAgIGlua3NjYXBlOm9iamVjdC1ub2Rlcz0idHJ1ZSI+PGlua3NjYXBlOmdyaWQKICAgICAgIHR5cGU9Inh5Z3JpZCIKICAgICAgIGlkPSJncmlkNDE0NyIgLz48L3NvZGlwb2RpOm5hbWVkdmlldz48cGF0aAogICAgIHN0eWxlPSJmaWxsOiMwMDAwMDAiCiAgICAgZD0iTSA0LjI0MjE4NzUgMy40OTIxODc1IEEgMC43NTAwNzUgMC43NTAwNzUgMCAwIDAgMy43MTg3NSA0Ljc4MTI1IEwgNS45NjQ4NDM4IDcuMDI3MzQzOCBMIDQgOC41IEwgNCA5IEwgOCA5IEMgOC41MDAwMDEgOC45OTk5OTg4IDkgOC40OTk5OTkyIDkgOCBMIDkgNCBMIDguNSA0IEwgNy4wMTc1NzgxIDUuOTU1MDc4MSBMIDQuNzgxMjUgMy43MTg3NSBBIDAuNzUwMDc1IDAuNzUwMDc1IDAgMCAwIDQuMjQyMTg3NSAzLjQ5MjE4NzUgeiBNIDE1LjczNDM3NSAzLjQ5MjE4NzUgQSAwLjc1MDA3NSAwLjc1MDA3NSAwIDAgMCAxNS4yMTg3NSAzLjcxODc1IEwgMTIuOTg0Mzc1IDUuOTUzMTI1IEwgMTEuNSA0IEwgMTEgNCBMIDExIDggQyAxMSA4LjQ5OTk5OTIgMTEuNDk5OTk5IDguOTk5OTk4OCAxMiA5IEwgMTYgOSBMIDE2IDguNSBMIDE0LjAzNTE1NiA3LjAyNzM0MzggTCAxNi4yODEyNSA0Ljc4MTI1IEEgMC43NTAwNzUgMC43NTAwNzUgMCAwIDAgMTUuNzM0Mzc1IDMuNDkyMTg3NSB6IE0gNCAxMSBMIDQgMTEuNSBMIDUuOTY0ODQzOCAxMi45NzI2NTYgTCAzLjcxODc1IDE1LjIxODc1IEEgMC43NTEzMDA5NiAwLjc1MTMwMDk2IDAgMSAwIDQuNzgxMjUgMTYuMjgxMjUgTCA3LjAyNzM0MzggMTQuMDM1MTU2IEwgOC41IDE2IEwgOSAxNiBMIDkgMTIgQyA5IDExLjUwMDAwMSA4LjUwMDAwMSAxMS4wMDAwMDEgOCAxMSBMIDQgMTEgeiBNIDEyIDExIEMgMTEuNDk5OTk5IDExLjAwMDAwMSAxMSAxMS41MDAwMDEgMTEgMTIgTCAxMSAxNiBMIDExLjUgMTYgTCAxMi45NzI2NTYgMTQuMDM1MTU2IEwgMTUuMjE4NzUgMTYuMjgxMjUgQSAwLjc1MTMwMDk2IDAuNzUxMzAwOTYgMCAxIDAgMTYuMjgxMjUgMTUuMjE4NzUgTCAxNC4wMzUxNTYgMTIuOTcyNjU2IEwgMTYgMTEuNSBMIDE2IDExIEwgMTIgMTEgeiAiCiAgICAgaWQ9InBhdGg3IiAvPjwvc3ZnPg==");
-}
-.mapboxgl-ctrl-icon.mapboxgl-ctrl-compass > .mapboxgl-ctrl-compass-arrow {
- width: 20px;
- height: 20px;
- margin: 5px;
- background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%0A%09%3Cpolygon%20fill%3D%27%23333333%27%20points%3D%276%2C9%2010%2C1%2014%2C9%27%2F%3E%0A%09%3Cpolygon%20fill%3D%27%23CCCCCC%27%20points%3D%276%2C11%2010%2C19%2014%2C11%20%27%2F%3E%0A%3C%2Fsvg%3E");
- background-repeat: no-repeat;
- display: inline-block;
-}
-
-a.mapboxgl-ctrl-logo {
- width: 85px;
- height: 21px;
- margin: 0 0 -3px -3px;
- display: block;
- background-repeat: no-repeat;
- cursor: pointer;
- background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiAgIHZpZXdCb3g9IjAgMCA4NC40OSAyMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgODQuNDkgMjE7IiB4bWw6c3BhY2U9InByZXNlcnZlIj48Zz4gIDxwYXRoIGNsYXNzPSJzdDAiIHN0eWxlPSJvcGFjaXR5OjAuOTsgZmlsbDogI0ZGRkZGRjsgZW5hYmxlLWJhY2tncm91bmQ6IG5ldzsiIGQ9Ik04My4yNSwxNC4yNmMwLDAuMTItMC4wOSwwLjIxLTAuMjEsMC4yMWgtMS42MWMtMC4xMywwLTAuMjQtMC4wNi0wLjMtMC4xN2wtMS40NC0yLjM5bC0xLjQ0LDIuMzkgICAgYy0wLjA2LDAuMTEtMC4xOCwwLjE3LTAuMywwLjE3aC0xLjYxYy0wLjA0LDAtMC4wOC0wLjAxLTAuMTItMC4wM2MtMC4wOS0wLjA2LTAuMTMtMC4xOS0wLjA2LTAuMjhsMCwwbDIuNDMtMy42OEw3Ni4yLDYuODQgICAgYy0wLjAyLTAuMDMtMC4wMy0wLjA3LTAuMDMtMC4xMmMwLTAuMTIsMC4wOS0wLjIxLDAuMjEtMC4yMWgxLjYxYzAuMTMsMCwwLjI0LDAuMDYsMC4zLDAuMTdsMS40MSwyLjM2bDEuNC0yLjM1ICAgIGMwLjA2LTAuMTEsMC4xOC0wLjE3LDAuMy0wLjE3SDgzYzAuMDQsMCwwLjA4LDAuMDEsMC4xMiwwLjAzYzAuMDksMC4wNiwwLjEzLDAuMTksMC4wNiwwLjI4bDAsMGwtMi4zNywzLjYzbDIuNDMsMy42NyAgICBDODMuMjQsMTQuMTgsODMuMjUsMTQuMjIsODMuMjUsMTQuMjZ6Ii8+ICA8cGF0aCBjbGFzcz0ic3QwIiBzdHlsZT0ib3BhY2l0eTowLjk7IGZpbGw6ICNGRkZGRkY7IGVuYWJsZS1iYWNrZ3JvdW5kOiBuZXc7IiBkPSJNNjYuMjQsOS41OWMtMC4zOS0xLjg4LTEuOTYtMy4yOC0zLjg0LTMuMjhjLTEuMDMsMC0yLjAzLDAuNDItMi43MywxLjE4VjMuNTFjMC0wLjEzLTAuMS0wLjIzLTAuMjMtMC4yM2gtMS40ICAgIGMtMC4xMywwLTAuMjMsMC4xMS0wLjIzLDAuMjN2MTAuNzJjMCwwLjEzLDAuMSwwLjIzLDAuMjMsMC4yM2gxLjRjMC4xMywwLDAuMjMtMC4xMSwwLjIzLTAuMjNWMTMuNWMwLjcxLDAuNzUsMS43LDEuMTgsMi43MywxLjE4ICAgIGMxLjg4LDAsMy40NS0xLjQxLDMuODQtMy4yOUM2Ni4zNywxMC43OSw2Ni4zNywxMC4xOCw2Ni4yNCw5LjU5TDY2LjI0LDkuNTl6IE02Mi4wOCwxM2MtMS4zMiwwLTIuMzktMS4xMS0yLjQxLTIuNDh2LTAuMDYgICAgYzAuMDItMS4zOCwxLjA5LTIuNDgsMi40MS0yLjQ4czIuNDIsMS4xMiwyLjQyLDIuNTFTNjMuNDEsMTMsNjIuMDgsMTN6Ii8+ICA8cGF0aCBjbGFzcz0ic3QwIiBzdHlsZT0ib3BhY2l0eTowLjk7IGZpbGw6ICNGRkZGRkY7IGVuYWJsZS1iYWNrZ3JvdW5kOiBuZXc7IiBkPSJNNzEuNjcsNi4zMmMtMS45OC0wLjAxLTMuNzIsMS4zNS00LjE2LDMuMjljLTAuMTMsMC41OS0wLjEzLDEuMTksMCwxLjc3YzAuNDQsMS45NCwyLjE3LDMuMzIsNC4xNywzLjMgICAgYzIuMzUsMCw0LjI2LTEuODcsNC4yNi00LjE5Uzc0LjA0LDYuMzIsNzEuNjcsNi4zMnogTTcxLjY1LDEzLjAxYy0xLjMzLDAtMi40Mi0xLjEyLTIuNDItMi41MXMxLjA4LTIuNTIsMi40Mi0yLjUyICAgIGMxLjMzLDAsMi40MiwxLjEyLDIuNDIsMi41MVM3Mi45OSwxMyw3MS42NSwxMy4wMUw3MS42NSwxMy4wMXoiLz4gIDxwYXRoIGNsYXNzPSJzdDEiIHN0eWxlPSJvcGFjaXR5OjAuMzU7IGVuYWJsZS1iYWNrZ3JvdW5kOm5ldzsiIGQ9Ik02Mi4wOCw3Ljk4Yy0xLjMyLDAtMi4zOSwxLjExLTIuNDEsMi40OHYwLjA2QzU5LjY4LDExLjksNjAuNzUsMTMsNjIuMDgsMTNzMi40Mi0xLjEyLDIuNDItMi41MSAgICBTNjMuNDEsNy45OCw2Mi4wOCw3Ljk4eiBNNjIuMDgsMTEuNzZjLTAuNjMsMC0xLjE0LTAuNTYtMS4xNy0xLjI1di0wLjA0YzAuMDEtMC42OSwwLjU0LTEuMjUsMS4xNy0xLjI1ICAgIGMwLjYzLDAsMS4xNywwLjU3LDEuMTcsMS4yN0M2My4yNCwxMS4yLDYyLjczLDExLjc2LDYyLjA4LDExLjc2eiIvPiAgPHBhdGggY2xhc3M9InN0MSIgc3R5bGU9Im9wYWNpdHk6MC4zNTsgZW5hYmxlLWJhY2tncm91bmQ6bmV3OyIgZD0iTTcxLjY1LDcuOThjLTEuMzMsMC0yLjQyLDEuMTItMi40MiwyLjUxUzcwLjMyLDEzLDcxLjY1LDEzczIuNDItMS4xMiwyLjQyLTIuNTFTNzIuOTksNy45OCw3MS42NSw3Ljk4eiAgICAgTTcxLjY1LDExLjc2Yy0wLjY0LDAtMS4xNy0wLjU3LTEuMTctMS4yN2MwLTAuNywwLjUzLTEuMjYsMS4xNy0xLjI2czEuMTcsMC41NywxLjE3LDEuMjdDNzIuODIsMTEuMjEsNzIuMjksMTEuNzYsNzEuNjUsMTEuNzZ6IiAgICAvPiAgPHBhdGggY2xhc3M9InN0MCIgc3R5bGU9Im9wYWNpdHk6MC45OyBmaWxsOiAjRkZGRkZGOyBlbmFibGUtYmFja2dyb3VuZDogbmV3OyIgZD0iTTQ1Ljc0LDYuNTNoLTEuNGMtMC4xMywwLTAuMjMsMC4xMS0wLjIzLDAuMjN2MC43M2MtMC43MS0wLjc1LTEuNy0xLjE4LTIuNzMtMS4xOCAgICBjLTIuMTcsMC0zLjk0LDEuODctMy45NCw0LjE5czEuNzcsNC4xOSwzLjk0LDQuMTljMS4wNCwwLDIuMDMtMC40MywyLjczLTEuMTl2MC43M2MwLDAuMTMsMC4xLDAuMjMsMC4yMywwLjIzaDEuNCAgICBjMC4xMywwLDAuMjMtMC4xMSwwLjIzLTAuMjNWNi43NGMwLTAuMTItMC4wOS0wLjIyLTAuMjItMC4yMkM0NS43NSw2LjUzLDQ1Ljc1LDYuNTMsNDUuNzQsNi41M3ogTTQ0LjEyLDEwLjUzICAgIEM0NC4xMSwxMS45LDQzLjAzLDEzLDQxLjcxLDEzcy0yLjQyLTEuMTItMi40Mi0yLjUxczEuMDgtMi41MiwyLjQtMi41MmMxLjMzLDAsMi4zOSwxLjExLDIuNDEsMi40OEw0NC4xMiwxMC41M3oiLz4gIDxwYXRoIGNsYXNzPSJzdDEiIHN0eWxlPSJvcGFjaXR5OjAuMzU7IGVuYWJsZS1iYWNrZ3JvdW5kOm5ldzsiIGQ9Ik00MS43MSw3Ljk4Yy0xLjMzLDAtMi40MiwxLjEyLTIuNDIsMi41MVM0MC4zNywxMyw0MS43MSwxM3MyLjM5LTEuMTEsMi40MS0yLjQ4di0wLjA2ICAgIEM0NC4xLDkuMDksNDMuMDMsNy45OCw0MS43MSw3Ljk4eiBNNDAuNTUsMTAuNDljMC0wLjcsMC41Mi0xLjI3LDEuMTctMS4yN2MwLjY0LDAsMS4xNCwwLjU2LDEuMTcsMS4yNXYwLjA0ICAgIGMtMC4wMSwwLjY4LTAuNTMsMS4yNC0xLjE3LDEuMjRDNDEuMDgsMTEuNzUsNDAuNTUsMTEuMTksNDAuNTUsMTAuNDl6Ii8+ICA8cGF0aCBjbGFzcz0ic3QwIiBzdHlsZT0ib3BhY2l0eTowLjk7IGZpbGw6ICNGRkZGRkY7IGVuYWJsZS1iYWNrZ3JvdW5kOiBuZXc7IiBkPSJNNTIuNDEsNi4zMmMtMS4wMywwLTIuMDMsMC40Mi0yLjczLDEuMThWNi43NWMwLTAuMTMtMC4xLTAuMjMtMC4yMy0wLjIzaC0xLjRjLTAuMTMsMC0wLjIzLDAuMTEtMC4yMywwLjIzICAgIHYxMC43MmMwLDAuMTMsMC4xLDAuMjMsMC4yMywwLjIzaDEuNGMwLjEzLDAsMC4yMy0wLjEsMC4yMy0wLjIzVjEzLjVjMC43MSwwLjc1LDEuNywxLjE4LDIuNzQsMS4xOGMyLjE3LDAsMy45NC0xLjg3LDMuOTQtNC4xOSAgICBTNTQuNTgsNi4zMiw1Mi40MSw2LjMyeiBNNTIuMDgsMTMuMDFjLTEuMzIsMC0yLjM5LTEuMTEtMi40Mi0yLjQ4di0wLjA3YzAuMDItMS4zOCwxLjA5LTIuNDksMi40LTIuNDljMS4zMiwwLDIuNDEsMS4xMiwyLjQxLDIuNTEgICAgUzUzLjQsMTMsNTIuMDgsMTMuMDFMNTIuMDgsMTMuMDF6Ii8+ICA8cGF0aCBjbGFzcz0ic3QxIiBzdHlsZT0ib3BhY2l0eTowLjM1OyBlbmFibGUtYmFja2dyb3VuZDpuZXc7IiBkPSJNNTIuMDgsNy45OGMtMS4zMiwwLTIuMzksMS4xMS0yLjQyLDIuNDh2MC4wNmMwLjAzLDEuMzgsMS4xLDIuNDgsMi40MiwyLjQ4czIuNDEtMS4xMiwyLjQxLTIuNTEgICAgUzUzLjQsNy45OCw1Mi4wOCw3Ljk4eiBNNTIuMDgsMTEuNzZjLTAuNjMsMC0xLjE0LTAuNTYtMS4xNy0xLjI1di0wLjA0YzAuMDEtMC42OSwwLjU0LTEuMjUsMS4xNy0xLjI1YzAuNjMsMCwxLjE3LDAuNTgsMS4xNywxLjI3ICAgIFM1Mi43MiwxMS43Niw1Mi4wOCwxMS43NnoiLz4gIDxwYXRoIGNsYXNzPSJzdDAiIHN0eWxlPSJvcGFjaXR5OjAuOTsgZmlsbDogI0ZGRkZGRjsgZW5hYmxlLWJhY2tncm91bmQ6IG5ldzsiIGQ9Ik0zNi4wOCwxNC4yNGMwLDAuMTMtMC4xLDAuMjMtMC4yMywwLjIzaC0xLjQxYy0wLjEzLDAtMC4yMy0wLjExLTAuMjMtMC4yM1Y5LjY4YzAtMC45OC0wLjc0LTEuNzEtMS42Mi0xLjcxICAgIGMtMC44LDAtMS40NiwwLjctMS41OSwxLjYybDAuMDEsNC42NmMwLDAuMTMtMC4xMSwwLjIzLTAuMjMsMC4yM2gtMS40MWMtMC4xMywwLTAuMjMtMC4xMS0wLjIzLTAuMjNWOS42OCAgICBjMC0wLjk4LTAuNzQtMS43MS0xLjYyLTEuNzFjLTAuODUsMC0xLjU0LDAuNzktMS42LDEuOHY0LjQ4YzAsMC4xMy0wLjEsMC4yMy0wLjIzLDAuMjNoLTEuNGMtMC4xMywwLTAuMjMtMC4xMS0wLjIzLTAuMjNWNi43NCAgICBjMC4wMS0wLjEzLDAuMS0wLjIyLDAuMjMtMC4yMmgxLjRjMC4xMywwLDAuMjIsMC4xMSwwLjIzLDAuMjJWNy40YzAuNS0wLjY4LDEuMy0xLjA5LDIuMTYtMS4xaDAuMDNjMS4wOSwwLDIuMDksMC42LDIuNiwxLjU1ICAgIGMwLjQ1LTAuOTUsMS40LTEuNTUsMi40NC0xLjU2YzEuNjIsMCwyLjkzLDEuMjUsMi45LDIuNzhMMzYuMDgsMTQuMjR6Ii8+ICA8cGF0aCBjbGFzcz0ic3QxIiBzdHlsZT0ib3BhY2l0eTowLjM1OyBlbmFibGUtYmFja2dyb3VuZDpuZXc7IiBkPSJNODQuMzQsMTMuNTlsLTAuMDctMC4xM2wtMS45Ni0yLjk5bDEuOTQtMi45NWMwLjQ0LTAuNjcsMC4yNi0xLjU2LTAuNDEtMi4wMmMtMC4wMiwwLTAuMDMsMC0wLjA0LTAuMDEgICAgYy0wLjIzLTAuMTUtMC41LTAuMjItMC43OC0wLjIyaC0xLjYxYy0wLjU2LDAtMS4wOCwwLjI5LTEuMzcsMC43OEw3OS43Miw2LjZsLTAuMzQtMC41NkM3OS4wOSw1LjU2LDc4LjU3LDUuMjcsNzgsNS4yN2gtMS42ICAgIGMtMC42LDAtMS4xMywwLjM3LTEuMzUsMC45MmMtMi4xOS0xLjY2LTUuMjgtMS40Ny03LjI2LDAuNDVjLTAuMzUsMC4zNC0wLjY1LDAuNzItMC44OSwxLjE0Yy0wLjktMS42Mi0yLjU4LTIuNzItNC41LTIuNzIgICAgYy0wLjUsMC0xLjAxLDAuMDctMS40OCwwLjIzVjMuNTFjMC0wLjgyLTAuNjYtMS40OC0xLjQ3LTEuNDhoLTEuNGMtMC44MSwwLTEuNDcsMC42Ni0xLjQ3LDEuNDd2My43NSAgICBjLTAuOTUtMS4zNi0yLjUtMi4xOC00LjE3LTIuMTljLTAuNzQsMC0xLjQ2LDAuMTYtMi4xMiwwLjQ3Yy0wLjI0LTAuMTctMC41NC0wLjI2LTAuODQtMC4yNmgtMS40Yy0wLjQ1LDAtMC44NywwLjIxLTEuMTUsMC41NiAgICBjLTAuMDItMC4wMy0wLjA0LTAuMDUtMC4wNy0wLjA4Yy0wLjI4LTAuMy0wLjY4LTAuNDctMS4wOS0wLjQ3aC0xLjM5Yy0wLjMsMC0wLjYsMC4wOS0wLjg0LDAuMjZjLTAuNjctMC4zLTEuMzktMC40Ni0yLjEyLTAuNDYgICAgYy0xLjgzLDAtMy40MywxLTQuMzcsMi41Yy0wLjItMC40Ni0wLjQ4LTAuODktMC44My0xLjI1Yy0wLjgtMC44MS0xLjg5LTEuMjUtMy4wMi0xLjI1aC0wLjAxYy0wLjg5LDAuMDEtMS43NSwwLjMzLTIuNDYsMC44OCAgICBjLTAuNzQtMC41Ny0xLjY0LTAuODgtMi41Ny0wLjg4SDI4LjFjLTAuMjksMC0wLjU4LDAuMDMtMC44NiwwLjExYy0wLjI4LDAuMDYtMC41NiwwLjE2LTAuODIsMC4yOGMtMC4yMS0wLjEyLTAuNDUtMC4xOC0wLjctMC4xOCAgICBoLTEuNGMtMC44MiwwLTEuNDcsMC42Ni0xLjQ3LDEuNDd2Ny41YzAsMC44MiwwLjY2LDEuNDcsMS40NywxLjQ3aDEuNGMwLjgyLDAsMS40OC0wLjY2LDEuNDgtMS40OGwwLDBWOS43OSAgICBjMC4wMy0wLjM2LDAuMjMtMC41OSwwLjM2LTAuNTljMC4xOCwwLDAuMzgsMC4xOCwwLjM4LDAuNDd2NC41N2MwLDAuODIsMC42NiwxLjQ3LDEuNDcsMS40N2gxLjQxYzAuODIsMCwxLjQ3LTAuNjYsMS40Ny0xLjQ3ICAgIGwtMC4wMS00LjU3YzAuMDYtMC4zMiwwLjI1LTAuNDcsMC4zNS0wLjQ3YzAuMTgsMCwwLjM4LDAuMTgsMC4zOCwwLjQ3djQuNTdjMCwwLjgyLDAuNjYsMS40NywxLjQ3LDEuNDdoMS40MSAgICBjMC44MiwwLDEuNDctMC42NiwxLjQ3LTEuNDd2LTAuMzhjMC45NiwxLjI5LDIuNDYsMi4wNiw0LjA2LDIuMDZjMC43NCwwLDEuNDYtMC4xNiwyLjEyLTAuNDdjMC4yNCwwLjE3LDAuNTQsMC4yNiwwLjg0LDAuMjZoMS4zOSAgICBjMC4zLDAsMC42LTAuMDksMC44NC0wLjI2djIuMDFjMCwwLjgyLDAuNjYsMS40NywxLjQ3LDEuNDdoMS40YzAuODIsMCwxLjQ3LTAuNjYsMS40Ny0xLjQ3di0xLjc3YzAuNDgsMC4xNSwwLjk5LDAuMjMsMS40OSwwLjIyICAgIGMxLjcsMCwzLjIyLTAuODcsNC4xNy0yLjJ2MC41MmMwLDAuODIsMC42NiwxLjQ3LDEuNDcsMS40N2gxLjRjMC4zLDAsMC42LTAuMDksMC44NC0wLjI2YzAuNjYsMC4zMSwxLjM5LDAuNDcsMi4xMiwwLjQ3ICAgIGMxLjkyLDAsMy42LTEuMSw0LjQ5LTIuNzNjMS41NCwyLjY1LDQuOTUsMy41Myw3LjU4LDEuOThjMC4xOC0wLjExLDAuMzYtMC4yMiwwLjUzLTAuMzZjMC4yMiwwLjU1LDAuNzYsMC45MSwxLjM1LDAuOUg3OCAgICBjMC41NiwwLDEuMDgtMC4yOSwxLjM3LTAuNzhsMC4zNy0wLjYxbDAuMzcsMC42MWMwLjI5LDAuNDgsMC44MSwwLjc4LDEuMzgsMC43OGgxLjZjMC44MSwwLDEuNDYtMC42NiwxLjQ1LTEuNDYgICAgQzg0LjQ5LDE0LjAyLDg0LjQ0LDEzLjgsODQuMzQsMTMuNTlMODQuMzQsMTMuNTl6IE0zNS44NiwxNC40N2gtMS40MWMtMC4xMywwLTAuMjMtMC4xMS0wLjIzLTAuMjNWOS42OCAgICBjMC0wLjk4LTAuNzQtMS43MS0xLjYyLTEuNzFjLTAuOCwwLTEuNDYsMC43LTEuNTksMS42MmwwLjAxLDQuNjZjMCwwLjEzLTAuMSwwLjIzLTAuMjMsMC4yM2gtMS40MWMtMC4xMywwLTAuMjMtMC4xMS0wLjIzLTAuMjMgICAgVjkuNjhjMC0wLjk4LTAuNzQtMS43MS0xLjYyLTEuNzFjLTAuODUsMC0xLjU0LDAuNzktMS42LDEuOHY0LjQ4YzAsMC4xMy0wLjEsMC4yMy0wLjIzLDAuMjNoLTEuNGMtMC4xMywwLTAuMjMtMC4xMS0wLjIzLTAuMjMgICAgVjYuNzRjMC4wMS0wLjEzLDAuMTEtMC4yMiwwLjIzLTAuMjJoMS40YzAuMTMsMCwwLjIyLDAuMTEsMC4yMywwLjIyVjcuNGMwLjUtMC42OCwxLjMtMS4wOSwyLjE2LTEuMWgwLjAzICAgIGMxLjA5LDAsMi4wOSwwLjYsMi42LDEuNTVjMC40NS0wLjk1LDEuNC0xLjU1LDIuNDQtMS41NmMxLjYyLDAsMi45MywxLjI1LDIuOSwyLjc4bDAuMDEsNS4xNkMzNi4wOSwxNC4zNiwzNS45OCwxNC40NiwzNS44NiwxNC40NyAgICBMMzUuODYsMTQuNDd6IE00NS45NywxNC4yNGMwLDAuMTMtMC4xLDAuMjMtMC4yMywwLjIzaC0xLjRjLTAuMTMsMC0wLjIzLTAuMTEtMC4yMy0wLjIzVjEzLjVjLTAuNywwLjc2LTEuNjksMS4xOC0yLjcyLDEuMTggICAgYy0yLjE3LDAtMy45NC0xLjg3LTMuOTQtNC4xOXMxLjc3LTQuMTksMy45NC00LjE5YzEuMDMsMCwyLjAyLDAuNDMsMi43MywxLjE4VjYuNzRjMC0wLjEzLDAuMS0wLjIzLDAuMjMtMC4yM2gxLjQgICAgYzAuMTItMC4wMSwwLjIyLDAuMDgsMC4yMywwLjIxYzAsMC4wMSwwLDAuMDEsMCwwLjAydjcuNTFoLTAuMDFWMTQuMjR6IE01Mi40MSwxNC42N2MtMS4wMywwLTIuMDItMC40My0yLjczLTEuMTh2My45NyAgICBjMCwwLjEzLTAuMSwwLjIzLTAuMjMsMC4yM2gtMS40Yy0wLjEzLDAtMC4yMy0wLjEtMC4yMy0wLjIzVjYuNzVjMC0wLjEzLDAuMS0wLjIyLDAuMjMtMC4yMmgxLjRjMC4xMywwLDAuMjMsMC4xMSwwLjIzLDAuMjN2MC43MyAgICBjMC43MS0wLjc2LDEuNy0xLjE4LDIuNzMtMS4xOGMyLjE3LDAsMy45NCwxLjg2LDMuOTQsNC4xOFM1NC41OCwxNC42Nyw1Mi40MSwxNC42N3ogTTY2LjI0LDExLjM5Yy0wLjM5LDEuODctMS45NiwzLjI5LTMuODQsMy4yOSAgICBjLTEuMDMsMC0yLjAyLTAuNDMtMi43My0xLjE4djAuNzNjMCwwLjEzLTAuMSwwLjIzLTAuMjMsMC4yM2gtMS40Yy0wLjEzLDAtMC4yMy0wLjExLTAuMjMtMC4yM1YzLjUxYzAtMC4xMywwLjEtMC4yMywwLjIzLTAuMjMgICAgaDEuNGMwLjEzLDAsMC4yMywwLjExLDAuMjMsMC4yM3YzLjk3YzAuNzEtMC43NSwxLjctMS4xOCwyLjczLTEuMTdjMS44OCwwLDMuNDUsMS40LDMuODQsMy4yOEM2Ni4zNywxMC4xOSw2Ni4zNywxMC44LDY2LjI0LDExLjM5ICAgIEw2Ni4yNCwxMS4zOUw2Ni4yNCwxMS4zOXogTTcxLjY3LDE0LjY4Yy0yLDAuMDEtMy43My0xLjM1LTQuMTctMy4zYy0wLjEzLTAuNTktMC4xMy0xLjE5LDAtMS43N2MwLjQ0LTEuOTQsMi4xNy0zLjMxLDQuMTctMy4zICAgIGMyLjM2LDAsNC4yNiwxLjg3LDQuMjYsNC4xOVM3NC4wMywxNC42OCw3MS42NywxNC42OEw3MS42NywxNC42OHogTTgzLjA0LDE0LjQ3aC0xLjYxYy0wLjEzLDAtMC4yNC0wLjA2LTAuMy0wLjE3bC0xLjQ0LTIuMzkgICAgbC0xLjQ0LDIuMzljLTAuMDYsMC4xMS0wLjE4LDAuMTctMC4zLDAuMTdoLTEuNjFjLTAuMDQsMC0wLjA4LTAuMDEtMC4xMi0wLjAzYy0wLjA5LTAuMDYtMC4xMy0wLjE5LTAuMDYtMC4yOGwwLDBsMi40My0zLjY4ICAgIEw3Ni4yLDYuODRjLTAuMDItMC4wMy0wLjAzLTAuMDctMC4wMy0wLjEyYzAtMC4xMiwwLjA5LTAuMjEsMC4yMS0wLjIxaDEuNjFjMC4xMywwLDAuMjQsMC4wNiwwLjMsMC4xN2wxLjQxLDIuMzZsMS40MS0yLjM2ICAgIGMwLjA2LTAuMTEsMC4xOC0wLjE3LDAuMy0wLjE3aDEuNjFjMC4wNCwwLDAuMDgsMC4wMSwwLjEyLDAuMDNjMC4wOSwwLjA2LDAuMTMsMC4xOSwwLjA2LDAuMjhsMCwwbC0yLjM4LDMuNjRsMi40MywzLjY3ICAgIGMwLjAyLDAuMDMsMC4wMywwLjA3LDAuMDMsMC4xMkM4My4yNSwxNC4zOCw4My4xNiwxNC40Nyw4My4wNCwxNC40N0w4My4wNCwxNC40N0w4My4wNCwxNC40N3oiLz4gIDxwYXRoIGNsYXNzPSJzdDAiIHN0eWxlPSJvcGFjaXR5OjAuOTsgZmlsbDogI0ZGRkZGRjsgZW5hYmxlLWJhY2tncm91bmQ6IG5ldzsiIGQ9Ik0xMC41LDEuMjRjLTUuMTEsMC05LjI1LDQuMTUtOS4yNSw5LjI1czQuMTUsOS4yNSw5LjI1LDkuMjVzOS4yNS00LjE1LDkuMjUtOS4yNSAgICBDMTkuNzUsNS4zOCwxNS42MSwxLjI0LDEwLjUsMS4yNHogTTE0Ljg5LDEyLjc3Yy0xLjkzLDEuOTMtNC43OCwyLjMxLTYuNywyLjMxYy0wLjcsMC0xLjQxLTAuMDUtMi4xLTAuMTZjMCwwLTEuMDItNS42NCwyLjE0LTguODEgICAgYzAuODMtMC44MywxLjk1LTEuMjgsMy4xMy0xLjI4YzEuMjcsMCwyLjQ5LDAuNTEsMy4zOSwxLjQyQzE2LjU5LDguMDksMTYuNjQsMTEsMTQuODksMTIuNzd6Ii8+ICA8cGF0aCBjbGFzcz0ic3QxIiBzdHlsZT0ib3BhY2l0eTowLjM1OyBlbmFibGUtYmFja2dyb3VuZDpuZXc7IiBkPSJNMTAuNS0wLjAxQzQuNy0wLjAxLDAsNC43LDAsMTAuNDlzNC43LDEwLjUsMTAuNSwxMC41UzIxLDE2LjI5LDIxLDEwLjQ5QzIwLjk5LDQuNywxNi4zLTAuMDEsMTAuNS0wLjAxeiAgICAgTTEwLjUsMTkuNzRjLTUuMTEsMC05LjI1LTQuMTUtOS4yNS05LjI1czQuMTQtOS4yNiw5LjI1LTkuMjZzOS4yNSw0LjE1LDkuMjUsOS4yNUMxOS43NSwxNS42MSwxNS42MSwxOS43NCwxMC41LDE5Ljc0eiIvPiAgPHBhdGggY2xhc3M9InN0MSIgc3R5bGU9Im9wYWNpdHk6MC4zNTsgZW5hYmxlLWJhY2tncm91bmQ6bmV3OyIgZD0iTTE0Ljc0LDYuMjVDMTIuOSw0LjQxLDkuOTgsNC4zNSw4LjIzLDYuMWMtMy4xNiwzLjE3LTIuMTQsOC44MS0yLjE0LDguODFzNS42NCwxLjAyLDguODEtMi4xNCAgICBDMTYuNjQsMTEsMTYuNTksOC4wOSwxNC43NCw2LjI1eiBNMTIuNDcsMTAuMzRsLTAuOTEsMS44N2wtMC45LTEuODdMOC44LDkuNDNsMS44Ni0wLjlsMC45LTEuODdsMC45MSwxLjg3bDEuODYsMC45TDEyLjQ3LDEwLjM0eiIgICAgLz4gIDxwb2x5Z29uIGNsYXNzPSJzdDAiIHN0eWxlPSJvcGFjaXR5OjAuOTsgZmlsbDogI0ZGRkZGRjsgZW5hYmxlLWJhY2tncm91bmQ6IG5ldzsiIHBvaW50cz0iMTQuMzMsOS40MyAxMi40NywxMC4zNCAxMS41NiwxMi4yMSAxMC42NiwxMC4zNCA4LjgsOS40MyAxMC42Niw4LjUzIDExLjU2LDYuNjYgMTIuNDcsOC41MyAgICIvPjwvZz48L3N2Zz4=);
-}
-
-.mapboxgl-ctrl.mapboxgl-ctrl-attrib {
- padding: 0 5px;
- background-color: rgba(255, 255, 255, .5);
- margin: 0;
-}
-.mapboxgl-ctrl-attrib.mapboxgl-compact {
- padding-top: 2px;
- padding-bottom: 2px;
- margin: 0 10px 10px 10px;
- position: relative;
- padding-right: 24px;
- background-color: #fff;
- border-radius: 3px 12px 12px 3px;
- visibility: hidden;
-}
-.mapboxgl-ctrl-attrib.mapboxgl-compact:hover {
- visibility: visible;
-}
-.mapboxgl-ctrl-attrib.mapboxgl-compact:after {
- content: '';
- cursor: pointer;
- position: absolute;
- bottom: 0;
- right: 0;
- background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D%270%200%2020%2020%27%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%3E%0D%0A%09%3Cpath%20fill%3D%27%23333333%27%20fill-rule%3D%27evenodd%27%20d%3D%27M4%2C10a6%2C6%200%201%2C0%2012%2C0a6%2C6%200%201%2C0%20-12%2C0%20M9%2C7a1%2C1%200%201%2C0%202%2C0a1%2C1%200%201%2C0%20-2%2C0%20M9%2C10a1%2C1%200%201%2C1%202%2C0l0%2C3a1%2C1%200%201%2C1%20-2%2C0%27%20%2F%3E%0D%0A%3C%2Fsvg%3E");
- background-color: rgba(255, 255, 255, .5);
- width: 24px;
- height: 24px;
- box-sizing: border-box;
- visibility: visible;
- border-radius: 12px;
-}
-.mapboxgl-ctrl-attrib a {
- color: rgba(0,0,0,0.75);
- text-decoration: none;
-}
-.mapboxgl-ctrl-attrib a:hover {
- color: inherit;
- text-decoration: underline;
-}
-/* stylelint-disable */
-.mapboxgl-ctrl-attrib .mapbox-improve-map {
- font-weight: bold;
- margin-left: 2px;
-}
-/*stylelint-enable*/
-.mapboxgl-ctrl-scale {
- background-color: rgba(255,255,255,0.75);
- font-size: 10px;
- border-width: medium 2px 2px;
- border-style: none solid solid;
- border-color: #333;
- padding: 0 5px;
- color: #333;
- box-sizing: border-box;
-}
-
-.mapboxgl-popup {
- position: absolute;
- top: 0;
- left: 0;
- display: -webkit-flex;
- display: flex;
- will-change: transform;
- pointer-events: none;
-}
-.mapboxgl-popup-anchor-top,
-.mapboxgl-popup-anchor-top-left,
-.mapboxgl-popup-anchor-top-right {
- -webkit-flex-direction: column;
- flex-direction: column;
-}
-.mapboxgl-popup-anchor-bottom,
-.mapboxgl-popup-anchor-bottom-left,
-.mapboxgl-popup-anchor-bottom-right {
- -webkit-flex-direction: column-reverse;
- flex-direction: column-reverse;
-}
-.mapboxgl-popup-anchor-left {
- -webkit-flex-direction: row;
- flex-direction: row;
-}
-.mapboxgl-popup-anchor-right {
- -webkit-flex-direction: row-reverse;
- flex-direction: row-reverse;
-}
-.mapboxgl-popup-tip {
- width: 0;
- height: 0;
- border: 10px solid transparent;
- z-index: 1;
-}
-.mapboxgl-popup-anchor-top .mapboxgl-popup-tip {
- -webkit-align-self: center;
- align-self: center;
- border-top: none;
- border-bottom-color: #fff;
-}
-.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip {
- -webkit-align-self: flex-start;
- align-self: flex-start;
- border-top: none;
- border-left: none;
- border-bottom-color: #fff;
-}
-.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip {
- -webkit-align-self: flex-end;
- align-self: flex-end;
- border-top: none;
- border-right: none;
- border-bottom-color: #fff;
-}
-.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip {
- -webkit-align-self: center;
- align-self: center;
- border-bottom: none;
- border-top-color: #fff;
-}
-.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip {
- -webkit-align-self: flex-start;
- align-self: flex-start;
- border-bottom: none;
- border-left: none;
- border-top-color: #fff;
-}
-.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip {
- -webkit-align-self: flex-end;
- align-self: flex-end;
- border-bottom: none;
- border-right: none;
- border-top-color: #fff;
-}
-.mapboxgl-popup-anchor-left .mapboxgl-popup-tip {
- -webkit-align-self: center;
- align-self: center;
- border-left: none;
- border-right-color: #fff;
-}
-.mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
- -webkit-align-self: center;
- align-self: center;
- border-right: none;
- border-left-color: #fff;
-}
-.mapboxgl-popup-close-button {
- position: absolute;
- right: 0;
- top: 0;
- border: none;
- border-radius: 0 3px 0 0;
- cursor: pointer;
- background-color: rgba(0,0,0,0);
-}
-.mapboxgl-popup-close-button:hover {
- background-color: rgba(0,0,0,0.05);
-}
-.mapboxgl-popup-content {
- position: relative;
- background: #fff;
- border-radius: 3px;
- box-shadow: 0 1px 2px rgba(0,0,0,0.10);
- padding: 10px 10px 15px;
- pointer-events: auto;
-}
-.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content {
- border-top-left-radius: 0;
-}
-.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content {
- border-top-right-radius: 0;
-}
-.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content {
- border-bottom-left-radius: 0;
-}
-.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content {
- border-bottom-right-radius: 0;
-}
-
-.mapboxgl-marker {
- position: absolute;
- top: 0;
- left: 0;
- will-change: transform;
-}
-
-.mapboxgl-user-location-dot {
- background-color: #1DA1F2;
- width: 16px;
- height: 16px;
- border-radius: 50%;
- box-shadow: 0 0 2px rgba(0,0,0,0.25);
- border: 2px solid #fff;
-}
-.mapboxgl-user-location-dot:after {
- content: '';
- display: block;
- box-shadow: #1DA1F2 0 0 0 2px;
- width: 16px;
- height: 16px;
- border-radius: 50%;
- position: relative;
- z-index: -1;
-
- -webkit-animation: mapboxgl-user-location-dot-pulse 2s;
- -moz-animation: mapboxgl-user-location-dot-pulse 2s;
- -ms-animation: mapboxgl-user-location-dot-pulse 2s;
- animation: mapboxgl-user-location-dot-pulse 2s;
-
- -webkit-animation-iteration-count: infinite;
- -moz-animation-iteration-count: infinite;
- -ms-animation-iteration-count: infinite;
- animation-iteration-count: infinite;
-}
-@-webkit-keyframes mapboxgl-user-location-dot-pulse {
- 0% { -webkit-box-shadow: 0 0 0 0 rgba(29, 161, 242, 0.8); }
- 70% { -webkit-box-shadow: 0 0 0 15px rgba(29, 161, 242, 0); }
- 242% { -webkit-box-shadow: 0 0 0 0 rgba(29, 161, 242, 0); }
-}
-@-ms-keyframes mapboxgl-user-location-dot-pulse {
- 0% { -ms-box-shadow: 0 0 0 0 rgba(29, 161, 242, 0.8); }
- 70% { -ms-box-shadow: 0 0 0 15px rgba(29, 161, 242, 0); }
- 242% { -ms-box-shadow: 0 0 0 0 rgba(29, 161, 242, 0); }
-}
-@keyframes mapboxgl-user-location-dot-pulse {
- 0% {
- -moz-box-shadow: 0 0 0 0 rgba(29, 161, 242, 0.8);
- box-shadow: 0 0 0 0 rgba(29, 161, 242, 0.4);
- }
- 70% {
- -moz-box-shadow: 0 0 0 15px rgba(29, 161, 242, 0);
- box-shadow: 0 0 0 15px rgba(29, 161, 242, 0);
- }
- 100% {
- -moz-box-shadow: 0 0 0 0 rgba(29, 161, 242, 0);
- box-shadow: 0 0 0 0 rgba(29, 161, 242, 0);
- }
-}
-.mapboxgl-user-location-dot-stale {
- background-color: #aaa;
-}
-.mapboxgl-user-location-dot-stale:after {
- display: none
-}
-
-.mapboxgl-crosshair,
-.mapboxgl-crosshair .mapboxgl-interactive,
-.mapboxgl-crosshair .mapboxgl-interactive:active {
- cursor: crosshair;
-}
-.mapboxgl-boxzoom {
- position: absolute;
- top: 0;
- left: 0;
- width: 0;
- height: 0;
- background: #fff;
- border: 2px dotted #202020;
- opacity: 0.5;
-}
-
-@media print {
-/* stylelint-disable */
- .mapbox-improve-map {
- display:none;
- }
-/* stylelint-enable */
-}
diff --git a/deployment/manager/shared/map/mapbox-gl-js/0.42.2/mapbox-gl.js b/deployment/manager/shared/map/mapbox-gl-js/0.42.2/mapbox-gl.js
deleted file mode 100644
index 44366ec2d..000000000
--- a/deployment/manager/shared/map/mapbox-gl-js/0.42.2/mapbox-gl.js
+++ /dev/null
@@ -1,547 +0,0 @@
-(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.mapboxgl = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
-!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):t.glMatrix=n()}(this,function(){"use strict";function t(t,n,r){var e=n[0],a=n[1],o=n[2];return t[0]=e*r[0]+a*r[3]+o*r[6],t[1]=e*r[1]+a*r[4]+o*r[7],t[2]=e*r[2]+a*r[5]+o*r[8],t}function n(t,n,r){var e=n[0],a=n[1],o=n[2],u=n[3];return t[0]=r[0]*e+r[4]*a+r[8]*o+r[12]*u,t[1]=r[1]*e+r[5]*a+r[9]*o+r[13]*u,t[2]=r[2]*e+r[6]*a+r[10]*o+r[14]*u,t[3]=r[3]*e+r[7]*a+r[11]*o+r[15]*u,t}function r(){var t=new Float32Array(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function e(t,n,r){var e=n[0],a=n[1],o=n[2],u=n[3],i=Math.sin(r),c=Math.cos(r);return t[0]=e*c+o*i,t[1]=a*c+u*i,t[2]=e*-i+o*c,t[3]=a*-i+u*c,t}function a(t,n,r){var e=n[0],a=n[1],o=n[2],u=n[3],i=r[0],c=r[1];return t[0]=e*i,t[1]=a*i,t[2]=o*c,t[3]=u*c,t}function o(){var t=new Float32Array(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function u(t,n){var r=Math.sin(n),e=Math.cos(n);return t[0]=e,t[1]=r,t[2]=0,t[3]=-r,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function i(){var t=new Float32Array(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function f(t,n){var r=n[0],e=n[1],a=n[2],o=n[3],u=n[4],i=n[5],c=n[6],f=n[7],v=n[8],s=n[9],l=n[10],M=n[11],h=n[12],m=n[13],y=n[14],d=n[15],p=r*i-e*u,w=r*c-a*u,A=r*f-o*u,F=e*c-a*i,x=e*f-o*i,b=a*f-o*c,g=v*m-s*h,j=v*y-l*h,R=v*d-M*h,X=s*y-l*m,Z=s*d-M*m,k=l*d-M*y,q=p*k-w*Z+A*X+F*R-x*j+b*g;return q?(q=1/q,t[0]=(i*k-c*Z+f*X)*q,t[1]=(a*Z-e*k-o*X)*q,t[2]=(m*b-y*x+d*F)*q,t[3]=(l*x-s*b-M*F)*q,t[4]=(c*R-u*k-f*j)*q,t[5]=(r*k-a*R+o*j)*q,t[6]=(y*A-h*b-d*w)*q,t[7]=(v*b-l*A+M*w)*q,t[8]=(u*Z-i*R+f*g)*q,t[9]=(e*R-r*Z-o*g)*q,t[10]=(h*x-m*A+d*p)*q,t[11]=(s*A-v*x-M*p)*q,t[12]=(i*j-u*X-c*g)*q,t[13]=(r*X-e*j+a*g)*q,t[14]=(m*w-h*F-y*p)*q,t[15]=(v*F-s*w+l*p)*q,t):null}function v(t,n,r){var e=n[0],a=n[1],o=n[2],u=n[3],i=n[4],c=n[5],f=n[6],v=n[7],s=n[8],l=n[9],M=n[10],h=n[11],m=n[12],y=n[13],d=n[14],p=n[15],w=r[0],A=r[1],F=r[2],x=r[3];return t[0]=w*e+A*i+F*s+x*m,t[1]=w*a+A*c+F*l+x*y,t[2]=w*o+A*f+F*M+x*d,t[3]=w*u+A*v+F*h+x*p,w=r[4],A=r[5],F=r[6],x=r[7],t[4]=w*e+A*i+F*s+x*m,t[5]=w*a+A*c+F*l+x*y,t[6]=w*o+A*f+F*M+x*d,t[7]=w*u+A*v+F*h+x*p,w=r[8],A=r[9],F=r[10],x=r[11],t[8]=w*e+A*i+F*s+x*m,t[9]=w*a+A*c+F*l+x*y,t[10]=w*o+A*f+F*M+x*d,t[11]=w*u+A*v+F*h+x*p,w=r[12],A=r[13],F=r[14],x=r[15],t[12]=w*e+A*i+F*s+x*m,t[13]=w*a+A*c+F*l+x*y,t[14]=w*o+A*f+F*M+x*d,t[15]=w*u+A*v+F*h+x*p,t}function s(t,n,r){var e,a,o,u,i,c,f,v,s,l,M,h,m=r[0],y=r[1],d=r[2];return n===t?(t[12]=n[0]*m+n[4]*y+n[8]*d+n[12],t[13]=n[1]*m+n[5]*y+n[9]*d+n[13],t[14]=n[2]*m+n[6]*y+n[10]*d+n[14],t[15]=n[3]*m+n[7]*y+n[11]*d+n[15]):(e=n[0],a=n[1],o=n[2],u=n[3],i=n[4],c=n[5],f=n[6],v=n[7],s=n[8],l=n[9],M=n[10],h=n[11],t[0]=e,t[1]=a,t[2]=o,t[3]=u,t[4]=i,t[5]=c,t[6]=f,t[7]=v,t[8]=s,t[9]=l,t[10]=M,t[11]=h,t[12]=e*m+i*y+s*d+n[12],t[13]=a*m+c*y+l*d+n[13],t[14]=o*m+f*y+M*d+n[14],t[15]=u*m+v*y+h*d+n[15]),t}function l(t,n,r){var e=r[0],a=r[1],o=r[2];return t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t[3]=n[3]*e,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=n[7]*a,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=n[11]*o,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t}function M(t,n,r){var e=Math.sin(r),a=Math.cos(r),o=n[4],u=n[5],i=n[6],c=n[7],f=n[8],v=n[9],s=n[10],l=n[11];return n!==t&&(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[4]=o*a+f*e,t[5]=u*a+v*e,t[6]=i*a+s*e,t[7]=c*a+l*e,t[8]=f*a-o*e,t[9]=v*a-u*e,t[10]=s*a-i*e,t[11]=l*a-c*e,t}function h(t,n,r){var e=Math.sin(r),a=Math.cos(r),o=n[0],u=n[1],i=n[2],c=n[3],f=n[4],v=n[5],s=n[6],l=n[7];return n!==t&&(t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=o*a+f*e,t[1]=u*a+v*e,t[2]=i*a+s*e,t[3]=c*a+l*e,t[4]=f*a-o*e,t[5]=v*a-u*e,t[6]=s*a-i*e,t[7]=l*a-c*e,t}function m(t,n,r,e,a){var o=1/Math.tan(n/2),u=1/(e-a);return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(a+e)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*a*e*u,t[15]=0,t}function y(t,n,r,e,a,o,u){var i=1/(n-r),c=1/(e-a),f=1/(o-u);return t[0]=-2*i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*f,t[11]=0,t[12]=(n+r)*i,t[13]=(a+e)*c,t[14]=(u+o)*f,t[15]=1,t}(function(){var t=new Float32Array(3);t[0]=0,t[1]=0,t[2]=0})(),function(){var t=new Float32Array(4);t[0]=0,t[1]=0,t[2]=0,t[3]=0}();return{vec3:{transformMat3:t},vec4:{transformMat4:n},mat2:{create:r,rotate:e,scale:a},mat3:{create:o,fromRotation:u},mat4:{create:i,identity:c,translate:s,scale:l,multiply:v,perspective:m,rotateX:M,rotateZ:h,invert:f,ortho:y}}});
-},{}],2:[function(_dereq_,module,exports){
-"use strict";function Point(t,n){this.x=t,this.y=n}module.exports=Point,Point.prototype={clone:function(){return new Point(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,n){return this.clone()._rotateAround(t,n)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var n=t.x-this.x,i=t.y-this.y;return n*n+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},_matMult:function(t){var n=t[0]*this.x+t[1]*this.y,i=t[2]*this.x+t[3]*this.y;return this.x=n,this.y=i,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var n=Math.cos(t),i=Math.sin(t),s=n*this.x-i*this.y,r=i*this.x+n*this.y;return this.x=s,this.y=r,this},_rotateAround:function(t,n){var i=Math.cos(t),s=Math.sin(t),r=n.x+i*(this.x-n.x)-s*(this.y-n.y),h=n.y+s*(this.x-n.x)+i*(this.y-n.y);return this.x=r,this.y=h,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Point.convert=function(t){return t instanceof Point?t:Array.isArray(t)?new Point(t[0],t[1]):t};
-},{}],3:[function(_dereq_,module,exports){
-!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ShelfPack=e()}(this,function(){function t(t,e,i){i=i||{},this.w=t||64,this.h=e||64,this.autoResize=!!i.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function e(t,e,i){this.x=0,this.y=t,this.w=this.free=e,this.h=i}function i(t,e,i,s,h,n,r){this.id=t,this.x=e,this.y=i,this.w=s,this.h=h,this.maxw=n||s,this.maxh=r||h,this.refcount=0}return t.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var i,s,h,n,r=[],f=0;f<t.length;f++)if(i=t[f].w||t[f].width,s=t[f].h||t[f].height,h=t[f].id,i&&s){if(!(n=this.packOne(i,s,h)))continue;e.inPlace&&(t[f].x=n.x,t[f].y=n.y,t[f].id=n.id),r.push(n)}return this.shrink(),r},t.prototype.packOne=function(t,i,s){var h,n,r,f,o={freebin:-1,shelf:-1,waste:1/0},a=0;if("string"==typeof s||"number"==typeof s){if(h=this.getBin(s))return this.ref(h),h;"number"==typeof s&&(this.maxId=Math.max(s,this.maxId))}else s=++this.maxId;for(f=0;f<this.freebins.length;f++){if(h=this.freebins[f],i===h.maxh&&t===h.maxw)return this.allocFreebin(f,t,i,s);i>h.maxh||t>h.maxw||i<=h.maxh&&t<=h.maxw&&(r=h.maxw*h.maxh-t*i)<o.waste&&(o.waste=r,o.freebin=f)}for(f=0;f<this.shelves.length;f++)if(n=this.shelves[f],a+=n.h,!(t>n.free)){if(i===n.h)return this.allocShelf(f,t,i,s);i>n.h||i<n.h&&(r=(n.h-i)*t)<o.waste&&(o.freebin=-1,o.waste=r,o.shelf=f)}if(-1!==o.freebin)return this.allocFreebin(o.freebin,t,i,s);if(-1!==o.shelf)return this.allocShelf(o.shelf,t,i,s);if(i<=this.h-a&&t<=this.w)return n=new e(a,this.w,i),this.allocShelf(this.shelves.push(n)-1,t,i,s);if(this.autoResize){var u,l,c,p;return u=l=this.h,c=p=this.w,(c<=u||t>c)&&(p=2*Math.max(t,c)),(u<c||i>u)&&(l=2*Math.max(i,u)),this.resize(p,l),this.packOne(t,i,s)}return null},t.prototype.allocFreebin=function(t,e,i,s){var h=this.freebins.splice(t,1)[0];return h.id=s,h.w=e,h.h=i,h.refcount=0,this.bins[s]=h,this.ref(h),h},t.prototype.allocShelf=function(t,e,i,s){var h=this.shelves[t],n=h.alloc(e,i,s);return this.bins[s]=n,this.ref(n),n},t.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,e=0,i=0;i<this.shelves.length;i++){var s=this.shelves[i];e+=s.h,t=Math.max(s.w-s.free,t)}this.resize(t,e)}},t.prototype.getBin=function(t){return this.bins[t]},t.prototype.ref=function(t){if(1==++t.refcount){var e=t.h;this.stats[e]=1+(0|this.stats[e])}return t.refcount},t.prototype.unref=function(t){return 0===t.refcount?0:(0==--t.refcount&&(this.stats[t.h]--,delete this.bins[t.id],this.freebins.push(t)),t.refcount)},t.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var i=0;i<this.shelves.length;i++)this.shelves[i].resize(t);return!0},e.prototype.alloc=function(t,e,s){if(t>this.free||e>this.h)return null;var h=this.x;return this.x+=t,this.free-=t,new i(s,h,this.y,t,e,t,this.h)},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t});
-},{}],4:[function(_dereq_,module,exports){
-"use strict";function TinySDF(t,i,s,e,h,r){this.fontSize=t||24,this.buffer=void 0===i?3:i,this.cutoff=e||.25,this.fontFamily=h||"sans-serif",this.fontWeight=r||"normal",this.radius=s||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function edt(t,i,s,e,h,r,a){for(var n=0;n<i;n++){for(var o=0;o<s;o++)e[o]=t[o*i+n];for(edt1d(e,h,r,a,s),o=0;o<s;o++)t[o*i+n]=h[o]}for(o=0;o<s;o++){for(n=0;n<i;n++)e[n]=t[o*i+n];for(edt1d(e,h,r,a,i),n=0;n<i;n++)t[o*i+n]=Math.sqrt(h[n])}}function edt1d(t,i,s,e,h){s[0]=0,e[0]=-INF,e[1]=+INF;for(var r=1,a=0;r<h;r++){for(var n=(t[r]+r*r-(t[s[a]]+s[a]*s[a]))/(2*r-2*s[a]);n<=e[a];)a--,n=(t[r]+r*r-(t[s[a]]+s[a]*s[a]))/(2*r-2*s[a]);a++,s[a]=r,e[a]=n,e[a+1]=+INF}for(r=0,a=0;r<h;r++){for(;e[a+1]<r;)a++;i[r]=(r-s[a])*(r-s[a])+t[s[a]]}}module.exports=TinySDF;var INF=1e20;TinySDF.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var i=this.ctx.getImageData(0,0,this.size,this.size),s=new Uint8ClampedArray(this.size*this.size),e=0;e<this.size*this.size;e++){var h=i.data[4*e+3]/255;this.gridOuter[e]=1===h?0:0===h?INF:Math.pow(Math.max(0,.5-h),2),this.gridInner[e]=1===h?INF:0===h?0:Math.pow(Math.max(0,h-.5),2)}for(edt(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),edt(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),e=0;e<this.size*this.size;e++){var r=this.gridOuter[e]-this.gridInner[e];s[e]=Math.max(0,Math.min(255,Math.round(255-255*(r/this.radius+this.cutoff))))}return s};
-},{}],5:[function(_dereq_,module,exports){
-function UnitBezier(t,i,e,r){this.cx=3*t,this.bx=3*(e-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(r-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=e,this.p2y=r}module.exports=UnitBezier,UnitBezier.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},UnitBezier.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},UnitBezier.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},UnitBezier.prototype.solveCurveX=function(t,i){void 0===i&&(i=1e-6);var e,r,s,h,n;for(s=t,n=0;n<8;n++){if(h=this.sampleCurveX(s)-t,Math.abs(h)<i)return s;var u=this.sampleCurveDerivativeX(s);if(Math.abs(u)<1e-6)break;s-=h/u}if(e=0,r=1,(s=t)<e)return e;if(s>r)return r;for(;e<r;){if(h=this.sampleCurveX(s),Math.abs(h-t)<i)return s;t>h?e=s:r=s,s=.5*(r-e)+e}return s},UnitBezier.prototype.solve=function(t,i){return this.sampleCurveY(this.solveCurveX(t,i))};
-},{}],6:[function(_dereq_,module,exports){
-module.exports.VectorTile=_dereq_("./lib/vectortile.js"),module.exports.VectorTileFeature=_dereq_("./lib/vectortilefeature.js"),module.exports.VectorTileLayer=_dereq_("./lib/vectortilelayer.js");
-},{"./lib/vectortile.js":7,"./lib/vectortilefeature.js":8,"./lib/vectortilelayer.js":9}],7:[function(_dereq_,module,exports){
-"use strict";function VectorTile(e,r){this.layers=e.readFields(readTile,{},r)}function readTile(e,r,i){if(3===e){var t=new VectorTileLayer(i,i.readVarint()+i.pos);t.length&&(r[t.name]=t)}}var VectorTileLayer=_dereq_("./vectortilelayer");module.exports=VectorTile;
-},{"./vectortilelayer":9}],8:[function(_dereq_,module,exports){
-"use strict";function VectorTileFeature(e,t,r,a,i){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=a,this._values=i,e.readFields(readFeature,this,t)}function readFeature(e,t,r){1==e?t.id=r.readVarint():2==e?readTag(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function readTag(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var a=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[a]=i}}function classifyRings(e){var t=e.length;if(t<=1)return[e];for(var r,a,i=[],o=0;o<t;o++){var n=signedArea(e[o]);0!==n&&(void 0===a&&(a=n<0),a===n<0?(r&&i.push(r),r=[e[o]]):r.push(e[o]))}return r&&i.push(r),i}function signedArea(e){for(var t,r,a=0,i=0,o=e.length,n=o-1;i<o;n=i++)t=e[i],r=e[n],a+=(r.x-t.x)*(t.y+r.y);return a}var Point=_dereq_("@mapbox/point-geometry");module.exports=VectorTileFeature,VectorTileFeature.types=["Unknown","Point","LineString","Polygon"],VectorTileFeature.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,a=1,i=0,o=0,n=0,s=[];e.pos<r;){if(!i){var p=e.readVarint();a=7&p,i=p>>3}if(i--,1===a||2===a)o+=e.readSVarint(),n+=e.readSVarint(),1===a&&(t&&s.push(t),t=[]),t.push(new Point(o,n));else{if(7!==a)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&s.push(t),s},VectorTileFeature.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,a=0,i=0,o=0,n=1/0,s=-1/0,p=1/0,h=-1/0;e.pos<t;){if(!a){var u=e.readVarint();r=7&u,a=u>>3}if(a--,1===r||2===r)i+=e.readSVarint(),o+=e.readSVarint(),i<n&&(n=i),i>s&&(s=i),o<p&&(p=o),o>h&&(h=o);else if(7!==r)throw new Error("unknown command "+r)}return[n,p,s,h]},VectorTileFeature.prototype.toGeoJSON=function(e,t,r){function a(e){for(var t=0;t<e.length;t++){var r=e[t],a=180-360*(r.y+p)/n;e[t]=[360*(r.x+s)/n-180,360/Math.PI*Math.atan(Math.exp(a*Math.PI/180))-90]}}var i,o,n=this.extent*Math.pow(2,r),s=this.extent*e,p=this.extent*t,h=this.loadGeometry(),u=VectorTileFeature.types[this.type];switch(this.type){case 1:var d=[];for(i=0;i<h.length;i++)d[i]=h[i][0];h=d,a(h);break;case 2:for(i=0;i<h.length;i++)a(h[i]);break;case 3:for(h=classifyRings(h),i=0;i<h.length;i++)for(o=0;o<h[i].length;o++)a(h[i][o])}1===h.length?h=h[0]:u="Multi"+u;var f={type:"Feature",geometry:{type:u,coordinates:h},properties:this.properties};return"id"in this&&(f.id=this.id),f};
-},{"@mapbox/point-geometry":2}],9:[function(_dereq_,module,exports){
-"use strict";function VectorTileLayer(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(readLayer,this,t),this.length=this._features.length}function readLayer(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(readValueMessage(r))}function readValueMessage(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var a=e.readVarint()>>3;t=1===a?e.readString():2===a?e.readFloat():3===a?e.readDouble():4===a?e.readVarint64():5===a?e.readVarint():6===a?e.readSVarint():7===a?e.readBoolean():null}return t}var VectorTileFeature=_dereq_("./vectortilefeature.js");module.exports=VectorTileLayer,VectorTileLayer.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new VectorTileFeature(this._pbf,t,this.extent,this._keys,this._values)};
-},{"./vectortilefeature.js":8}],10:[function(_dereq_,module,exports){
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.WhooTS=e.WhooTS||{})}(this,function(e){function t(e,t,r,n,i,s){return s=s||{},e+"?"+["bbox="+o(r,n,i),"format="+(s.format||"image/png"),"service="+(s.service||"WMS"),"version="+(s.version||"1.1.1"),"request="+(s.request||"GetMap"),"srs="+(s.srs||"EPSG:3857"),"width="+(s.width||256),"height="+(s.height||256),"layers="+t].join("&")}function o(e,t,o){t=Math.pow(2,o)-t-1;var n=r(256*e,256*t,o),i=r(256*(e+1),256*(t+1),o);return n[0]+","+n[1]+","+i[0]+","+i[1]}function r(e,t,o){var r=2*Math.PI*6378137/256/Math.pow(2,o);return[e*r-2*Math.PI*6378137/2,t*r-2*Math.PI*6378137/2]}e.getURL=t,e.getTileBBox=o,e.getMercCoords=r,Object.defineProperty(e,"__esModule",{value:!0})});
-},{}],11:[function(_dereq_,module,exports){
-function clamp_css_byte(e){return e=Math.round(e),e<0?0:e>255?255:e}function clamp_css_float(e){return e<0?0:e>1?1:e}function parse_css_int(e){return clamp_css_byte("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function parse_css_float(e){return clamp_css_float("%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))}function css_hue_to_rgb(e,r,l){return l<0?l+=1:l>1&&(l-=1),6*l<1?e+(r-e)*l*6:2*l<1?r:3*l<2?e+(r-e)*(2/3-l)*6:e}function parseCSSColor(e){var r=e.replace(/ /g,"").toLowerCase();if(r in kCSSColorTable)return kCSSColorTable[r].slice();if("#"===r[0]){if(4===r.length){var l=parseInt(r.substr(1),16);return l>=0&&l<=4095?[(3840&l)>>4|(3840&l)>>8,240&l|(240&l)>>4,15&l|(15&l)<<4,1]:null}if(7===r.length){var l=parseInt(r.substr(1),16);return l>=0&&l<=16777215?[(16711680&l)>>16,(65280&l)>>8,255&l,1]:null}return null}var a=r.indexOf("("),t=r.indexOf(")");if(-1!==a&&t+1===r.length){var n=r.substr(0,a),s=r.substr(a+1,t-(a+1)).split(","),o=1;switch(n){case"rgba":if(4!==s.length)return null;o=parse_css_float(s.pop());case"rgb":return 3!==s.length?null:[parse_css_int(s[0]),parse_css_int(s[1]),parse_css_int(s[2]),o];case"hsla":if(4!==s.length)return null;o=parse_css_float(s.pop());case"hsl":if(3!==s.length)return null;var i=(parseFloat(s[0])%360+360)%360/360,u=parse_css_float(s[1]),g=parse_css_float(s[2]),d=g<=.5?g*(u+1):g+u-g*u,c=2*g-d;return[clamp_css_byte(255*css_hue_to_rgb(c,d,i+1/3)),clamp_css_byte(255*css_hue_to_rgb(c,d,i)),clamp_css_byte(255*css_hue_to_rgb(c,d,i-1/3)),o];default:return null}}return null}var kCSSColorTable={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{exports.parseCSSColor=parseCSSColor}catch(e){}
-},{}],12:[function(_dereq_,module,exports){
-"use strict";function earcut(e,n,r){r=r||2;var t=n&&n.length,i=t?n[0]*r:e.length,x=linkedList(e,0,i,r,!0),a=[];if(!x)return a;var o,l,u,s,v,f,y;if(t&&(x=eliminateHoles(e,n,x,r)),e.length>80*r){o=u=e[0],l=s=e[1];for(var d=r;d<i;d+=r)v=e[d],f=e[d+1],v<o&&(o=v),f<l&&(l=f),v>u&&(u=v),f>s&&(s=f);y=Math.max(u-o,s-l)}return earcutLinked(x,a,r,o,l,y),a}function linkedList(e,n,r,t,i){var x,a;if(i===signedArea(e,n,r,t)>0)for(x=n;x<r;x+=t)a=insertNode(x,e[x],e[x+1],a);else for(x=r-t;x>=n;x-=t)a=insertNode(x,e[x],e[x+1],a);return a&&equals(a,a.next)&&(removeNode(a),a=a.next),a}function filterPoints(e,n){if(!e)return e;n||(n=e);var r,t=e;do{if(r=!1,t.steiner||!equals(t,t.next)&&0!==area(t.prev,t,t.next))t=t.next;else{if(removeNode(t),(t=n=t.prev)===t.next)return null;r=!0}}while(r||t!==n);return n}function earcutLinked(e,n,r,t,i,x,a){if(e){!a&&x&&indexCurve(e,t,i,x);for(var o,l,u=e;e.prev!==e.next;)if(o=e.prev,l=e.next,x?isEarHashed(e,t,i,x):isEar(e))n.push(o.i/r),n.push(e.i/r),n.push(l.i/r),removeNode(e),e=l.next,u=l.next;else if((e=l)===u){a?1===a?(e=cureLocalIntersections(e,n,r),earcutLinked(e,n,r,t,i,x,2)):2===a&&splitEarcut(e,n,r,t,i,x):earcutLinked(filterPoints(e),n,r,t,i,x,1);break}}}function isEar(e){var n=e.prev,r=e,t=e.next;if(area(n,r,t)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(pointInTriangle(n.x,n.y,r.x,r.y,t.x,t.y,i.x,i.y)&&area(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function isEarHashed(e,n,r,t){var i=e.prev,x=e,a=e.next;if(area(i,x,a)>=0)return!1;for(var o=i.x<x.x?i.x<a.x?i.x:a.x:x.x<a.x?x.x:a.x,l=i.y<x.y?i.y<a.y?i.y:a.y:x.y<a.y?x.y:a.y,u=i.x>x.x?i.x>a.x?i.x:a.x:x.x>a.x?x.x:a.x,s=i.y>x.y?i.y>a.y?i.y:a.y:x.y>a.y?x.y:a.y,v=zOrder(o,l,n,r,t),f=zOrder(u,s,n,r,t),y=e.nextZ;y&&y.z<=f;){if(y!==e.prev&&y!==e.next&&pointInTriangle(i.x,i.y,x.x,x.y,a.x,a.y,y.x,y.y)&&area(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(y=e.prevZ;y&&y.z>=v;){if(y!==e.prev&&y!==e.next&&pointInTriangle(i.x,i.y,x.x,x.y,a.x,a.y,y.x,y.y)&&area(y.prev,y,y.next)>=0)return!1;y=y.prevZ}return!0}function cureLocalIntersections(e,n,r){var t=e;do{var i=t.prev,x=t.next.next;!equals(i,x)&&intersects(i,t,t.next,x)&&locallyInside(i,x)&&locallyInside(x,i)&&(n.push(i.i/r),n.push(t.i/r),n.push(x.i/r),removeNode(t),removeNode(t.next),t=e=x),t=t.next}while(t!==e);return t}function splitEarcut(e,n,r,t,i,x){var a=e;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&isValidDiagonal(a,o)){var l=splitPolygon(a,o);return a=filterPoints(a,a.next),l=filterPoints(l,l.next),earcutLinked(a,n,r,t,i,x),void earcutLinked(l,n,r,t,i,x)}o=o.next}a=a.next}while(a!==e)}function eliminateHoles(e,n,r,t){var i,x,a,o,l,u=[];for(i=0,x=n.length;i<x;i++)a=n[i]*t,o=i<x-1?n[i+1]*t:e.length,l=linkedList(e,a,o,t,!1),l===l.next&&(l.steiner=!0),u.push(getLeftmost(l));for(u.sort(compareX),i=0;i<u.length;i++)eliminateHole(u[i],r),r=filterPoints(r,r.next);return r}function compareX(e,n){return e.x-n.x}function eliminateHole(e,n){if(n=findHoleBridge(e,n)){var r=splitPolygon(n,e);filterPoints(r,r.next)}}function findHoleBridge(e,n){var r,t=n,i=e.x,x=e.y,a=-1/0;do{if(x<=t.y&&x>=t.next.y){var o=t.x+(x-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(o<=i&&o>a){if(a=o,o===i){if(x===t.y)return t;if(x===t.next.y)return t.next}r=t.x<t.next.x?t:t.next}}t=t.next}while(t!==n);if(!r)return null;if(i===a)return r.prev;var l,u=r,s=r.x,v=r.y,f=1/0;for(t=r.next;t!==u;)i>=t.x&&t.x>=s&&pointInTriangle(x<v?i:a,x,s,v,x<v?a:i,x,t.x,t.y)&&((l=Math.abs(x-t.y)/(i-t.x))<f||l===f&&t.x>r.x)&&locallyInside(t,e)&&(r=t,f=l),t=t.next;return r}function indexCurve(e,n,r,t){var i=e;do{null===i.z&&(i.z=zOrder(i.x,i.y,n,r,t)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,sortLinked(i)}function sortLinked(e){var n,r,t,i,x,a,o,l,u=1;do{for(r=e,e=null,x=null,a=0;r;){for(a++,t=r,o=0,n=0;n<u&&(o++,t=t.nextZ);n++);for(l=u;o>0||l>0&&t;)0===o?(i=t,t=t.nextZ,l--):0!==l&&t?r.z<=t.z?(i=r,r=r.nextZ,o--):(i=t,t=t.nextZ,l--):(i=r,r=r.nextZ,o--),x?x.nextZ=i:e=i,i.prevZ=x,x=i;r=t}x.nextZ=null,u*=2}while(a>1);return e}function zOrder(e,n,r,t,i){return e=32767*(e-r)/i,n=32767*(n-t)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),n=16711935&(n|n<<8),n=252645135&(n|n<<4),n=858993459&(n|n<<2),n=1431655765&(n|n<<1),e|n<<1}function getLeftmost(e){var n=e,r=e;do{n.x<r.x&&(r=n),n=n.next}while(n!==e);return r}function pointInTriangle(e,n,r,t,i,x,a,o){return(i-a)*(n-o)-(e-a)*(x-o)>=0&&(e-a)*(t-o)-(r-a)*(n-o)>=0&&(r-a)*(x-o)-(i-a)*(t-o)>=0}function isValidDiagonal(e,n){return e.next.i!==n.i&&e.prev.i!==n.i&&!intersectsPolygon(e,n)&&locallyInside(e,n)&&locallyInside(n,e)&&middleInside(e,n)}function area(e,n,r){return(n.y-e.y)*(r.x-n.x)-(n.x-e.x)*(r.y-n.y)}function equals(e,n){return e.x===n.x&&e.y===n.y}function intersects(e,n,r,t){return!!(equals(e,n)&&equals(r,t)||equals(e,t)&&equals(r,n))||area(e,n,r)>0!=area(e,n,t)>0&&area(r,t,e)>0!=area(r,t,n)>0}function intersectsPolygon(e,n){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==n.i&&r.next.i!==n.i&&intersects(r,r.next,e,n))return!0;r=r.next}while(r!==e);return!1}function locallyInside(e,n){return area(e.prev,e,e.next)<0?area(e,n,e.next)>=0&&area(e,e.prev,n)>=0:area(e,n,e.prev)<0||area(e,e.next,n)<0}function middleInside(e,n){var r=e,t=!1,i=(e.x+n.x)/2,x=(e.y+n.y)/2;do{r.y>x!=r.next.y>x&&i<(r.next.x-r.x)*(x-r.y)/(r.next.y-r.y)+r.x&&(t=!t),r=r.next}while(r!==e);return t}function splitPolygon(e,n){var r=new Node(e.i,e.x,e.y),t=new Node(n.i,n.x,n.y),i=e.next,x=n.prev;return e.next=n,n.prev=e,r.next=i,i.prev=r,t.next=r,r.prev=t,x.next=t,t.prev=x,t}function insertNode(e,n,r,t){var i=new Node(e,n,r);return t?(i.next=t.next,i.prev=t,t.next.prev=i,t.next=i):(i.prev=i,i.next=i),i}function removeNode(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 Node(e,n,r){this.i=e,this.x=n,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function signedArea(e,n,r,t){for(var i=0,x=n,a=r-t;x<r;x+=t)i+=(e[a]-e[x])*(e[x+1]+e[a+1]),a=x;return i}module.exports=earcut,earcut.deviation=function(e,n,r,t){var i=n&&n.length,x=i?n[0]*r:e.length,a=Math.abs(signedArea(e,0,x,r));if(i)for(var o=0,l=n.length;o<l;o++){var u=n[o]*r,s=o<l-1?n[o+1]*r:e.length;a-=Math.abs(signedArea(e,u,s,r))}var v=0;for(o=0;o<t.length;o+=3){var f=t[o]*r,y=t[o+1]*r,d=t[o+2]*r;v+=Math.abs((e[f]-e[d])*(e[y+1]-e[f+1])-(e[f]-e[y])*(e[d+1]-e[f+1]))}return 0===a&&0===v?0:Math.abs((v-a)/a)},earcut.flatten=function(e){for(var n=e[0][0].length,r={vertices:[],holes:[],dimensions:n},t=0,i=0;i<e.length;i++){for(var x=0;x<e[i].length;x++)for(var a=0;a<n;a++)r.vertices.push(e[i][x][a]);i>0&&(t+=e[i-1].length,r.holes.push(t))}return r};
-},{}],13:[function(_dereq_,module,exports){
-function geometry(r){if("Polygon"===r.type)return polygonArea(r.coordinates);if("MultiPolygon"===r.type){for(var e=0,n=0;n<r.coordinates.length;n++)e+=polygonArea(r.coordinates[n]);return e}return null}function polygonArea(r){var e=0;if(r&&r.length>0){e+=Math.abs(ringArea(r[0]));for(var n=1;n<r.length;n++)e-=Math.abs(ringArea(r[n]))}return e}function ringArea(r){var e=0;if(r.length>2){for(var n,t,o=0;o<r.length-1;o++)n=r[o],t=r[o+1],e+=rad(t[0]-n[0])*(2+Math.sin(rad(n[1]))+Math.sin(rad(t[1])));e=e*wgs84.RADIUS*wgs84.RADIUS/2}return e}function rad(r){return r*Math.PI/180}var wgs84=_dereq_("wgs84");module.exports.geometry=geometry,module.exports.ring=ringArea;
-},{"wgs84":49}],14:[function(_dereq_,module,exports){
-function rewind(r,e){switch(r&&r.type||null){case"FeatureCollection":return r.features=r.features.map(curryOuter(rewind,e)),r;case"Feature":return r.geometry=rewind(r.geometry,e),r;case"Polygon":case"MultiPolygon":return correct(r,e);default:return r}}function curryOuter(r,e){return function(n){return r(n,e)}}function correct(r,e){return"Polygon"===r.type?r.coordinates=correctRings(r.coordinates,e):"MultiPolygon"===r.type&&(r.coordinates=r.coordinates.map(curryOuter(correctRings,e))),r}function correctRings(r,e){e=!!e,r[0]=wind(r[0],e);for(var n=1;n<r.length;n++)r[n]=wind(r[n],!e);return r}function wind(r,e){return cw(r)===e?r:r.reverse()}function cw(r){return geojsonArea.ring(r)>=0}var geojsonArea=_dereq_("geojson-area");module.exports=rewind;
-},{"geojson-area":13}],15:[function(_dereq_,module,exports){
-"use strict";function clip(e,r,t,n,u,i,l,s){if(t/=r,n/=r,l>=t&&s<=n)return e;if(l>n||s<t)return null;for(var h=[],p=0;p<e.length;p++){var a,c,o=e[p],f=o.geometry,g=o.type;if(a=o.min[u],c=o.max[u],a>=t&&c<=n)h.push(o);else if(!(a>n||c<t)){var v=1===g?clipPoints(f,t,n,u):clipGeometry(f,t,n,u,i,3===g);v.length&&h.push(createFeature(o.tags,g,v,o.id))}}return h.length?h:null}function clipPoints(e,r,t,n){for(var u=[],i=0;i<e.length;i++){var l=e[i],s=l[n];s>=r&&s<=t&&u.push(l)}return u}function clipGeometry(e,r,t,n,u,i){for(var l=[],s=0;s<e.length;s++){var h,p,a,c=0,o=0,f=null,g=e[s],v=g.area,m=g.dist,w=g.outer,S=g.length,d=[];for(p=0;p<S-1;p++)h=f||g[p],f=g[p+1],c=o||h[n],o=f[n],c<r?o>t?(d.push(u(h,f,r),u(h,f,t)),i||(d=newSlice(l,d,v,m,w))):o>=r&&d.push(u(h,f,r)):c>t?o<r?(d.push(u(h,f,t),u(h,f,r)),i||(d=newSlice(l,d,v,m,w))):o<=t&&d.push(u(h,f,t)):(d.push(h),o<r?(d.push(u(h,f,r)),i||(d=newSlice(l,d,v,m,w))):o>t&&(d.push(u(h,f,t)),i||(d=newSlice(l,d,v,m,w))));h=g[S-1],c=h[n],c>=r&&c<=t&&d.push(h),a=d[d.length-1],i&&a&&(d[0][0]!==a[0]||d[0][1]!==a[1])&&d.push(d[0]),newSlice(l,d,v,m,w)}return l}function newSlice(e,r,t,n,u){return r.length&&(r.area=t,r.dist=n,void 0!==u&&(r.outer=u),e.push(r)),[]}module.exports=clip;var createFeature=_dereq_("./feature");
-},{"./feature":17}],16:[function(_dereq_,module,exports){
-"use strict";function convert(e,t){var r=[];if("FeatureCollection"===e.type)for(var o=0;o<e.features.length;o++)convertFeature(r,e.features[o],t);else"Feature"===e.type?convertFeature(r,e,t):convertFeature(r,{geometry:e},t);return r}function convertFeature(e,t,r){if(null!==t.geometry){var o,a,i,n,u=t.geometry,c=u.type,l=u.coordinates,s=t.properties,p=t.id;if("Point"===c)e.push(createFeature(s,1,[projectPoint(l)],p));else if("MultiPoint"===c)e.push(createFeature(s,1,project(l),p));else if("LineString"===c)e.push(createFeature(s,2,[project(l,r)],p));else if("MultiLineString"===c||"Polygon"===c){for(i=[],o=0;o<l.length;o++)n=project(l[o],r),"Polygon"===c&&(n.outer=0===o),i.push(n);e.push(createFeature(s,"Polygon"===c?3:2,i,p))}else if("MultiPolygon"===c){for(i=[],o=0;o<l.length;o++)for(a=0;a<l[o].length;a++)n=project(l[o][a],r),n.outer=0===a,i.push(n);e.push(createFeature(s,3,i,p))}else{if("GeometryCollection"!==c)throw new Error("Input data is not a valid GeoJSON object.");for(o=0;o<u.geometries.length;o++)convertFeature(e,{geometry:u.geometries[o],properties:s},r)}}}function project(e,t){for(var r=[],o=0;o<e.length;o++)r.push(projectPoint(e[o]));return t&&(simplify(r,t),calcSize(r)),r}function projectPoint(e){var t=Math.sin(e[1]*Math.PI/180),r=e[0]/360+.5,o=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return o=o<0?0:o>1?1:o,[r,o,0]}function calcSize(e){for(var t,r,o=0,a=0,i=0;i<e.length-1;i++)t=r||e[i],r=e[i+1],o+=t[0]*r[1]-r[0]*t[1],a+=Math.abs(r[0]-t[0])+Math.abs(r[1]-t[1]);e.area=Math.abs(o/2),e.dist=a}module.exports=convert;var simplify=_dereq_("./simplify"),createFeature=_dereq_("./feature");
-},{"./feature":17,"./simplify":19}],17:[function(_dereq_,module,exports){
-"use strict";function createFeature(e,t,a,n){var r={id:n||null,type:t,geometry:a,tags:e||null,min:[1/0,1/0],max:[-1/0,-1/0]};return calcBBox(r),r}function calcBBox(e){var t=e.geometry,a=e.min,n=e.max;if(1===e.type)calcRingBBox(a,n,t);else for(var r=0;r<t.length;r++)calcRingBBox(a,n,t[r]);return e}function calcRingBBox(e,t,a){for(var n,r=0;r<a.length;r++)n=a[r],e[0]=Math.min(n[0],e[0]),t[0]=Math.max(n[0],t[0]),e[1]=Math.min(n[1],e[1]),t[1]=Math.max(n[1],t[1])}module.exports=createFeature;
-},{}],18:[function(_dereq_,module,exports){
-"use strict";function geojsonvt(e,t){return new GeoJSONVT(e,t)}function GeoJSONVT(e,t){t=this.options=extend(Object.create(this.options),t);var i=t.debug;i&&console.time("preprocess data");var o=1<<t.maxZoom,n=convert(e,t.tolerance/(o*t.extent));this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=wrap(n,t.buffer/t.extent,intersectX),n.length&&this.splitTile(n,0,0,0),i&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function toID(e,t,i){return 32*((1<<e)*i+t)+e}function intersectX(e,t,i){return[i,(i-e[0])*(t[1]-e[1])/(t[0]-e[0])+e[1],1]}function intersectY(e,t,i){return[(i-e[1])*(t[0]-e[0])/(t[1]-e[1])+e[0],i,1]}function extend(e,t){for(var i in t)e[i]=t[i];return e}function isClippedSquare(e,t,i){var o=e.source;if(1!==o.length)return!1;var n=o[0];if(3!==n.type||n.geometry.length>1)return!1;var r=n.geometry[0].length;if(5!==r)return!1;for(var s=0;s<r;s++){var l=transform.point(n.geometry[0][s],t,e.z2,e.x,e.y);if(l[0]!==-i&&l[0]!==t+i||l[1]!==-i&&l[1]!==t+i)return!1}return!0}module.exports=geojsonvt;var convert=_dereq_("./convert"),transform=_dereq_("./transform"),clip=_dereq_("./clip"),wrap=_dereq_("./wrap"),createTile=_dereq_("./tile");GeoJSONVT.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,solidChildren:!1,tolerance:3,extent:4096,buffer:64,debug:0},GeoJSONVT.prototype.splitTile=function(e,t,i,o,n,r,s){for(var l=[e,t,i,o],a=this.options,u=a.debug,c=null;l.length;){o=l.pop(),i=l.pop(),t=l.pop(),e=l.pop();var p=1<<t,d=toID(t,i,o),m=this.tiles[d],f=t===a.maxZoom?0:a.tolerance/(p*a.extent);if(!m&&(u>1&&console.time("creation"),m=this.tiles[d]=createTile(e,p,i,o,f,t===a.maxZoom),this.tileCoords.push({z:t,x:i,y:o}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,i,o,m.numFeatures,m.numPoints,m.numSimplified),console.timeEnd("creation"));var h="z"+t;this.stats[h]=(this.stats[h]||0)+1,this.total++}if(m.source=e,n){if(t===a.maxZoom||t===n)continue;var x=1<<n-t;if(i!==Math.floor(r/x)||o!==Math.floor(s/x))continue}else if(t===a.indexMaxZoom||m.numPoints<=a.indexMaxPoints)continue;if(a.solidChildren||!isClippedSquare(m,a.extent,a.buffer)){m.source=null,u>1&&console.time("clipping");var g,v,M,T,b,y,S=.5*a.buffer/a.extent,Z=.5-S,q=.5+S,w=1+S;g=v=M=T=null,b=clip(e,p,i-S,i+q,0,intersectX,m.min[0],m.max[0]),y=clip(e,p,i+Z,i+w,0,intersectX,m.min[0],m.max[0]),b&&(g=clip(b,p,o-S,o+q,1,intersectY,m.min[1],m.max[1]),v=clip(b,p,o+Z,o+w,1,intersectY,m.min[1],m.max[1])),y&&(M=clip(y,p,o-S,o+q,1,intersectY,m.min[1],m.max[1]),T=clip(y,p,o+Z,o+w,1,intersectY,m.min[1],m.max[1])),u>1&&console.timeEnd("clipping"),e.length&&(l.push(g||[],t+1,2*i,2*o),l.push(v||[],t+1,2*i,2*o+1),l.push(M||[],t+1,2*i+1,2*o),l.push(T||[],t+1,2*i+1,2*o+1))}else n&&(c=t)}return c},GeoJSONVT.prototype.getTile=function(e,t,i){var o=this.options,n=o.extent,r=o.debug,s=1<<e;t=(t%s+s)%s;var l=toID(e,t,i);if(this.tiles[l])return transform.tile(this.tiles[l],n);r>1&&console.log("drilling down to z%d-%d-%d",e,t,i);for(var a,u=e,c=t,p=i;!a&&u>0;)u--,c=Math.floor(c/2),p=Math.floor(p/2),a=this.tiles[toID(u,c,p)];if(!a||!a.source)return null;if(r>1&&console.log("found parent tile z%d-%d-%d",u,c,p),isClippedSquare(a,n,o.buffer))return transform.tile(a,n);r>1&&console.time("drilling down");var d=this.splitTile(a.source,u,c,p,e,t,i);if(r>1&&console.timeEnd("drilling down"),null!==d){var m=1<<e-d;l=toID(d,Math.floor(t/m),Math.floor(i/m))}return this.tiles[l]?transform.tile(this.tiles[l],n):null};
-},{"./clip":15,"./convert":16,"./tile":20,"./transform":21,"./wrap":22}],19:[function(_dereq_,module,exports){
-"use strict";function simplify(t,i){var e,p,r,s,o=i*i,f=t.length,u=0,n=f-1,g=[];for(t[u][2]=1,t[n][2]=1;n;){for(p=0,e=u+1;e<n;e++)(r=getSqSegDist(t[e],t[u],t[n]))>p&&(s=e,p=r);p>o?(t[s][2]=p,g.push(u),g.push(s),u=s):(n=g.pop(),u=g.pop())}}function getSqSegDist(t,i,e){var p=i[0],r=i[1],s=e[0],o=e[1],f=t[0],u=t[1],n=s-p,g=o-r;if(0!==n||0!==g){var l=((f-p)*n+(u-r)*g)/(n*n+g*g);l>1?(p=s,r=o):l>0&&(p+=n*l,r+=g*l)}return n=f-p,g=u-r,n*n+g*g}module.exports=simplify;
-},{}],20:[function(_dereq_,module,exports){
-"use strict";function createTile(e,n,r,i,t,u){for(var a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z2:n,transformed:!1,min:[2,1],max:[-1,0]},m=0;m<e.length;m++){a.numFeatures++,addFeature(a,e[m],t,u);var s=e[m].min,l=e[m].max;s[0]<a.min[0]&&(a.min[0]=s[0]),s[1]<a.min[1]&&(a.min[1]=s[1]),l[0]>a.max[0]&&(a.max[0]=l[0]),l[1]>a.max[1]&&(a.max[1]=l[1])}return a}function addFeature(e,n,r,i){var t,u,a,m,s=n.geometry,l=n.type,o=[],f=r*r;if(1===l)for(t=0;t<s.length;t++)o.push(s[t]),e.numPoints++,e.numSimplified++;else for(t=0;t<s.length;t++)if(a=s[t],i||!(2===l&&a.dist<r||3===l&&a.area<f)){var d=[];for(u=0;u<a.length;u++)m=a[u],(i||m[2]>f)&&(d.push(m),e.numSimplified++),e.numPoints++;3===l&&rewind(d,a.outer),o.push(d)}else e.numPoints+=a.length;if(o.length){var g={geometry:o,type:l,tags:n.tags||null};null!==n.id&&(g.id=n.id),e.features.push(g)}}function rewind(e,n){signedArea(e)<0===n&&e.reverse()}function signedArea(e){for(var n,r,i=0,t=0,u=e.length,a=u-1;t<u;a=t++)n=e[t],r=e[a],i+=(r[0]-n[0])*(n[1]+r[1]);return i}module.exports=createTile;
-},{}],21:[function(_dereq_,module,exports){
-"use strict";function transformTile(r,t){if(r.transformed)return r;var n,e,o,f=r.z2,a=r.x,s=r.y;for(n=0;n<r.features.length;n++){var i=r.features[n],u=i.geometry;if(1===i.type)for(e=0;e<u.length;e++)u[e]=transformPoint(u[e],t,f,a,s);else for(e=0;e<u.length;e++){var m=u[e];for(o=0;o<m.length;o++)m[o]=transformPoint(m[o],t,f,a,s)}}return r.transformed=!0,r}function transformPoint(r,t,n,e,o){return[Math.round(t*(r[0]*n-e)),Math.round(t*(r[1]*n-o))]}exports.tile=transformTile,exports.point=transformPoint;
-},{}],22:[function(_dereq_,module,exports){
-"use strict";function wrap(r,e,t){var o=r,a=clip(r,1,-1-e,e,0,t,-1,2),s=clip(r,1,1-e,2+e,0,t,-1,2);return(a||s)&&(o=clip(r,1,-e,1+e,0,t,-1,2)||[],a&&(o=shiftFeatureCoords(a,1).concat(o)),s&&(o=o.concat(shiftFeatureCoords(s,-1)))),o}function shiftFeatureCoords(r,e){for(var t=[],o=0;o<r.length;o++){var a,s=r[o],i=s.type;if(1===i)a=shiftCoords(s.geometry,e);else{a=[];for(var u=0;u<s.geometry.length;u++)a.push(shiftCoords(s.geometry[u],e))}t.push(createFeature(s.tags,i,a,s.id))}return t}function shiftCoords(r,e){var t=[];t.area=r.area,t.dist=r.dist;for(var o=0;o<r.length;o++)t.push([r[o][0]+e,r[o][1],r[o][2]]);return t}var clip=_dereq_("./clip"),createFeature=_dereq_("./feature");module.exports=wrap;
-},{"./clip":15,"./feature":17}],23:[function(_dereq_,module,exports){
-"use strict";function GridIndex(t,r,e){var s=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],r=i[1],e=i[2],this.d=r+2*e;for(var h=0;h<this.d*this.d;h++){var n=i[NUM_PARAMS+h],o=i[NUM_PARAMS+h+1];s.push(n===o?null:i.subarray(n,o))}var l=i[NUM_PARAMS+s.length],a=i[NUM_PARAMS+s.length+1];this.keys=i.subarray(l,a),this.bboxes=i.subarray(a),this.insert=this._insertReadonly}else{this.d=r+2*e;for(var d=0;d<this.d*this.d;d++)s.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=t,this.padding=e,this.scale=r/t,this.uid=0;var f=e/r*t;this.min=-f,this.max=t+f}module.exports=GridIndex;var NUM_PARAMS=3;GridIndex.prototype.insert=function(t,r,e,s,i){this._forEachCell(r,e,s,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(r),this.bboxes.push(e),this.bboxes.push(s),this.bboxes.push(i)},GridIndex.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},GridIndex.prototype._insertCell=function(t,r,e,s,i,h){this.cells[i].push(h)},GridIndex.prototype.query=function(t,r,e,s){var i=this.min,h=this.max;if(t<=i&&r<=i&&h<=e&&h<=s)return Array.prototype.slice.call(this.keys);var n=[],o={};return this._forEachCell(t,r,e,s,this._queryCell,n,o),n},GridIndex.prototype._queryCell=function(t,r,e,s,i,h,n){var o=this.cells[i];if(null!==o)for(var l=this.keys,a=this.bboxes,d=0;d<o.length;d++){var f=o[d];if(void 0===n[f]){var u=4*f;t<=a[u+2]&&r<=a[u+3]&&e>=a[u+0]&&s>=a[u+1]?(n[f]=!0,h.push(l[f])):n[f]=!1}}},GridIndex.prototype._forEachCell=function(t,r,e,s,i,h,n){for(var o=this._convertToCellCoord(t),l=this._convertToCellCoord(r),a=this._convertToCellCoord(e),d=this._convertToCellCoord(s),f=o;f<=a;f++)for(var u=l;u<=d;u++){var y=this.d*u+f;if(i.call(this,t,r,e,s,y,h,n))return}},GridIndex.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},GridIndex.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,r=NUM_PARAMS+this.cells.length+1+1,e=0,s=0;s<this.cells.length;s++)e+=this.cells[s].length;var i=new Int32Array(r+e+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var h=r,n=0;n<t.length;n++){var o=t[n];i[NUM_PARAMS+n]=h,i.set(o,h),h+=o.length}return i[NUM_PARAMS+t.length]=h,i.set(this.keys,h),h+=this.keys.length,i[NUM_PARAMS+t.length+1]=h,i.set(this.bboxes,h),h+=this.bboxes.length,i.buffer};
-},{}],24:[function(_dereq_,module,exports){
-exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),o+=p+N>=1?n/f:n*Math.pow(2,1-N),o*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
-},{}],25:[function(_dereq_,module,exports){
-"use strict";function kdbush(t,i,e,s,n){return new KDBush(t,i,e,s,n)}function KDBush(t,i,e,s,n){i=i||defaultGetX,e=e||defaultGetY,n=n||Array,this.nodeSize=s||64,this.points=t,this.ids=new n(t.length),this.coords=new n(2*t.length);for(var r=0;r<t.length;r++)this.ids[r]=r,this.coords[2*r]=i(t[r]),this.coords[2*r+1]=e(t[r]);sort(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function defaultGetX(t){return t[0]}function defaultGetY(t){return t[1]}var sort=_dereq_("./sort"),range=_dereq_("./range"),within=_dereq_("./within");module.exports=kdbush,KDBush.prototype={range:function(t,i,e,s){return range(this.ids,this.coords,t,i,e,s,this.nodeSize)},within:function(t,i,e){return within(this.ids,this.coords,t,i,e,this.nodeSize)}};
-},{"./range":26,"./sort":27,"./within":28}],26:[function(_dereq_,module,exports){
-"use strict";function range(p,r,s,u,h,e,o){for(var a,t,n=[0,p.length-1,0],f=[];n.length;){var l=n.pop(),v=n.pop(),g=n.pop();if(v-g<=o)for(var i=g;i<=v;i++)a=r[2*i],t=r[2*i+1],a>=s&&a<=h&&t>=u&&t<=e&&f.push(p[i]);else{var c=Math.floor((g+v)/2);a=r[2*c],t=r[2*c+1],a>=s&&a<=h&&t>=u&&t<=e&&f.push(p[c]);var d=(l+1)%2;(0===l?s<=a:u<=t)&&(n.push(g),n.push(c-1),n.push(d)),(0===l?h>=a:e>=t)&&(n.push(c+1),n.push(v),n.push(d))}}return f}module.exports=range;
-},{}],27:[function(_dereq_,module,exports){
-"use strict";function sortKD(t,a,o,s,r,e){if(!(r-s<=o)){var f=Math.floor((s+r)/2);select(t,a,f,s,r,e%2),sortKD(t,a,o,s,f-1,e+1),sortKD(t,a,o,f+1,r,e+1)}}function select(t,a,o,s,r,e){for(;r>s;){if(r-s>600){var f=r-s+1,p=o-s+1,w=Math.log(f),m=.5*Math.exp(2*w/3),n=.5*Math.sqrt(w*m*(f-m)/f)*(p-f/2<0?-1:1);select(t,a,o,Math.max(s,Math.floor(o-p*m/f+n)),Math.min(r,Math.floor(o+(f-p)*m/f+n)),e)}var c=a[2*o+e],h=s,i=r;for(swapItem(t,a,s,o),a[2*r+e]>c&&swapItem(t,a,s,r);h<i;){for(swapItem(t,a,h,i),h++,i--;a[2*h+e]<c;)h++;for(;a[2*i+e]>c;)i--}a[2*s+e]===c?swapItem(t,a,s,i):(i++,swapItem(t,a,i,r)),i<=o&&(s=i+1),o<=i&&(r=i-1)}}function swapItem(t,a,o,s){swap(t,o,s),swap(a,2*o,2*s),swap(a,2*o+1,2*s+1)}function swap(t,a,o){var s=t[a];t[a]=t[o],t[o]=s}module.exports=sortKD;
-},{}],28:[function(_dereq_,module,exports){
-"use strict";function within(s,p,r,t,u,h){for(var i=[0,s.length-1,0],o=[],n=u*u;i.length;){var e=i.pop(),a=i.pop(),f=i.pop();if(a-f<=h)for(var v=f;v<=a;v++)sqDist(p[2*v],p[2*v+1],r,t)<=n&&o.push(s[v]);else{var l=Math.floor((f+a)/2),c=p[2*l],q=p[2*l+1];sqDist(c,q,r,t)<=n&&o.push(s[l]);var D=(e+1)%2;(0===e?r-u<=c:t-u<=q)&&(i.push(f),i.push(l-1),i.push(D)),(0===e?r+u>=c:t+u>=q)&&(i.push(l+1),i.push(a),i.push(D))}}return o}function sqDist(s,p,r,t){var u=s-r,h=p-t;return u*u+h*h}module.exports=within;
-},{}],29:[function(_dereq_,module,exports){
-function isObjectLike(r){return!!r&&"object"==typeof r}function arraySome(r,e){for(var a=-1,t=r.length;++a<t;)if(e(r[a],a,r))return!0;return!1}function baseIsEqual(r,e,a,t,o,n){return r===e||(null==r||null==e||!isObject(r)&&!isObjectLike(e)?r!==r&&e!==e:baseIsEqualDeep(r,e,baseIsEqual,a,t,o,n))}function baseIsEqualDeep(r,e,a,t,o,n,u){var c=isArray(r),s=isArray(e),i=arrayTag,g=arrayTag;c||(i=objToString.call(r),i==argsTag?i=objectTag:i!=objectTag&&(c=isTypedArray(r))),s||(g=objToString.call(e),g==argsTag?g=objectTag:g!=objectTag&&(s=isTypedArray(e)));var b=i==objectTag,l=g==objectTag,f=i==g;if(f&&!c&&!b)return equalByTag(r,e,i);if(!o){var y=b&&hasOwnProperty.call(r,"__wrapped__"),T=l&&hasOwnProperty.call(e,"__wrapped__");if(y||T)return a(y?r.value():r,T?e.value():e,t,o,n,u)}if(!f)return!1;n||(n=[]),u||(u=[]);for(var j=n.length;j--;)if(n[j]==r)return u[j]==e;n.push(r),u.push(e);var p=(c?equalArrays:equalObjects)(r,e,a,t,o,n,u);return n.pop(),u.pop(),p}function equalArrays(r,e,a,t,o,n,u){var c=-1,s=r.length,i=e.length;if(s!=i&&!(o&&i>s))return!1;for(;++c<s;){var g=r[c],b=e[c],l=t?t(o?b:g,o?g:b,c):void 0;if(void 0!==l){if(l)continue;return!1}if(o){if(!arraySome(e,function(r){return g===r||a(g,r,t,o,n,u)}))return!1}else if(g!==b&&!a(g,b,t,o,n,u))return!1}return!0}function equalByTag(r,e,a){switch(a){case boolTag:case dateTag:return+r==+e;case errorTag:return r.name==e.name&&r.message==e.message;case numberTag:return r!=+r?e!=+e:r==+e;case regexpTag:case stringTag:return r==e+""}return!1}function equalObjects(r,e,a,t,o,n,u){var c=keys(r),s=c.length;if(s!=keys(e).length&&!o)return!1;for(var i=s;i--;){var g=c[i];if(!(o?g in e:hasOwnProperty.call(e,g)))return!1}for(var b=o;++i<s;){g=c[i];var l=r[g],f=e[g],y=t?t(o?f:l,o?l:f,g):void 0;if(!(void 0===y?a(l,f,t,o,n,u):y))return!1;b||(b="constructor"==g)}if(!b){var T=r.constructor,j=e.constructor;if(T!=j&&"constructor"in r&&"constructor"in e&&!("function"==typeof T&&T instanceof T&&"function"==typeof j&&j instanceof j))return!1}return!0}function isObject(r){var e=typeof r;return!!r&&("object"==e||"function"==e)}var isArray=_dereq_("lodash.isarray"),isTypedArray=_dereq_("lodash.istypedarray"),keys=_dereq_("lodash.keys"),argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",stringTag="[object String]",objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objToString=objectProto.toString;module.exports=baseIsEqual;
-},{"lodash.isarray":33,"lodash.istypedarray":35,"lodash.keys":36}],30:[function(_dereq_,module,exports){
-function bindCallback(n,t,r){if("function"!=typeof n)return identity;if(void 0===t)return n;switch(r){case 1:return function(r){return n.call(t,r)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,c){return n.call(t,r,e,u,c)};case 5:return function(r,e,u,c,i){return n.call(t,r,e,u,c,i)}}return function(){return n.apply(t,arguments)}}function identity(n){return n}module.exports=bindCallback;
-},{}],31:[function(_dereq_,module,exports){
-function isObjectLike(t){return!!t&&"object"==typeof t}function getNative(t,o){var e=null==t?void 0:t[o];return isNative(e)?e:void 0}function isFunction(t){return isObject(t)&&objToString.call(t)==funcTag}function isObject(t){var o=typeof t;return!!t&&("object"==o||"function"==o)}function isNative(t){return null!=t&&(isFunction(t)?reIsNative.test(fnToString.call(t)):isObjectLike(t)&&reIsHostCtor.test(t))}var funcTag="[object Function]",reIsHostCtor=/^\[object .+?Constructor\]$/,objectProto=Object.prototype,fnToString=Function.prototype.toString,hasOwnProperty=objectProto.hasOwnProperty,objToString=objectProto.toString,reIsNative=RegExp("^"+fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");module.exports=getNative;
-},{}],32:[function(_dereq_,module,exports){
-function isArguments(t){return isArrayLikeObject(t)&&hasOwnProperty.call(t,"callee")&&(!propertyIsEnumerable.call(t,"callee")||objectToString.call(t)==argsTag)}function isArrayLike(t){return null!=t&&isLength(t.length)&&!isFunction(t)}function isArrayLikeObject(t){return isObjectLike(t)&&isArrayLike(t)}function isFunction(t){var e=isObject(t)?objectToString.call(t):"";return e==funcTag||e==genTag}function isLength(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=MAX_SAFE_INTEGER}function isObject(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function isObjectLike(t){return!!t&&"object"==typeof t}var MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",funcTag="[object Function]",genTag="[object GeneratorFunction]",objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,objectToString=objectProto.toString,propertyIsEnumerable=objectProto.propertyIsEnumerable;module.exports=isArguments;
-},{}],33:[function(_dereq_,module,exports){
-function isObjectLike(t){return!!t&&"object"==typeof t}function getNative(t,r){var e=null==t?void 0:t[r];return isNative(e)?e:void 0}function isLength(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=MAX_SAFE_INTEGER}function isFunction(t){return isObject(t)&&objToString.call(t)==funcTag}function isObject(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}function isNative(t){return null!=t&&(isFunction(t)?reIsNative.test(fnToString.call(t)):isObjectLike(t)&&reIsHostCtor.test(t))}var arrayTag="[object Array]",funcTag="[object Function]",reIsHostCtor=/^\[object .+?Constructor\]$/,objectProto=Object.prototype,fnToString=Function.prototype.toString,hasOwnProperty=objectProto.hasOwnProperty,objToString=objectProto.toString,reIsNative=RegExp("^"+fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),nativeIsArray=getNative(Array,"isArray"),MAX_SAFE_INTEGER=9007199254740991,isArray=nativeIsArray||function(t){return isObjectLike(t)&&isLength(t.length)&&objToString.call(t)==arrayTag};module.exports=isArray;
-},{}],34:[function(_dereq_,module,exports){
-function isEqual(a,l,i,e){i="function"==typeof i?bindCallback(i,e,3):void 0;var s=i?i(a,l):void 0;return void 0===s?baseIsEqual(a,l,i):!!s}var baseIsEqual=_dereq_("lodash._baseisequal"),bindCallback=_dereq_("lodash._bindcallback");module.exports=isEqual;
-},{"lodash._baseisequal":29,"lodash._bindcallback":30}],35:[function(_dereq_,module,exports){
-function isLength(a){return"number"==typeof a&&a>-1&&a%1==0&&a<=MAX_SAFE_INTEGER}function isObjectLike(a){return!!a&&"object"==typeof a}function isTypedArray(a){return isObjectLike(a)&&isLength(a.length)&&!!typedArrayTags[objectToString.call(a)]}var MAX_SAFE_INTEGER=9007199254740991,argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var objectProto=Object.prototype,objectToString=objectProto.toString;module.exports=isTypedArray;
-},{}],36:[function(_dereq_,module,exports){
-function baseProperty(e){return function(t){return null==t?void 0:t[e]}}function isArrayLike(e){return null!=e&&isLength(getLength(e))}function isIndex(e,t){return e="number"==typeof e||reIsUint.test(e)?+e:-1,t=null==t?MAX_SAFE_INTEGER:t,e>-1&&e%1==0&&e<t}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER}function shimKeys(e){for(var t=keysIn(e),r=t.length,n=r&&e.length,s=!!n&&isLength(n)&&(isArray(e)||isArguments(e)),o=-1,i=[];++o<r;){var u=t[o];(s&&isIndex(u,n)||hasOwnProperty.call(e,u))&&i.push(u)}return i}function isObject(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function keysIn(e){if(null==e)return[];isObject(e)||(e=Object(e));var t=e.length;t=t&&isLength(t)&&(isArray(e)||isArguments(e))&&t||0;for(var r=e.constructor,n=-1,s="function"==typeof r&&r.prototype===e,o=Array(t),i=t>0;++n<t;)o[n]=n+"";for(var u in e)i&&isIndex(u,t)||"constructor"==u&&(s||!hasOwnProperty.call(e,u))||o.push(u);return o}var getNative=_dereq_("lodash._getnative"),isArguments=_dereq_("lodash.isarguments"),isArray=_dereq_("lodash.isarray"),reIsUint=/^\d+$/,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty,nativeKeys=getNative(Object,"keys"),MAX_SAFE_INTEGER=9007199254740991,getLength=baseProperty("length"),keys=nativeKeys?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&isArrayLike(e)?shimKeys(e):isObject(e)?nativeKeys(e):[]}:shimKeys;module.exports=keys;
-},{"lodash._getnative":31,"lodash.isarguments":32,"lodash.isarray":33}],37:[function(_dereq_,module,exports){
-"use strict";function isSupported(e){return!!(isBrowser()&&isArraySupported()&&isFunctionSupported()&&isObjectSupported()&&isJSONSupported()&&isWorkerSupported()&&isUint8ClampedArraySupported()&&isWebGLSupportedCached(e&&e.failIfMajorPerformanceCaveat))}function isBrowser(){return"undefined"!=typeof window&&"undefined"!=typeof document}function isArraySupported(){return Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray}function isFunctionSupported(){return Function.prototype&&Function.prototype.bind}function isObjectSupported(){return Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions}function isJSONSupported(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function isWorkerSupported(){return"Worker"in window}function isUint8ClampedArraySupported(){return"Uint8ClampedArray"in window}function isWebGLSupportedCached(e){return void 0===isWebGLSupportedCache[e]&&(isWebGLSupportedCache[e]=isWebGLSupported(e)),isWebGLSupportedCache[e]}function isWebGLSupported(e){var t=document.createElement("canvas"),r=Object.create(isSupported.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=e,t.probablySupportsContext?t.probablySupportsContext("webgl",r)||t.probablySupportsContext("experimental-webgl",r):t.supportsContext?t.supportsContext("webgl",r)||t.supportsContext("experimental-webgl",r):t.getContext("webgl",r)||t.getContext("experimental-webgl",r)}"undefined"!=typeof module&&module.exports?module.exports=isSupported:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=isSupported);var isWebGLSupportedCache={};isSupported.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};
-},{}],38:[function(_dereq_,module,exports){
-"use strict";function Pbf(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}function readVarintRemainder(t,i,e){var r,s,n=e.buf;if(s=n[e.pos++],r=(112&s)>>4,s<128)return toNum(t,r,i);if(s=n[e.pos++],r|=(127&s)<<3,s<128)return toNum(t,r,i);if(s=n[e.pos++],r|=(127&s)<<10,s<128)return toNum(t,r,i);if(s=n[e.pos++],r|=(127&s)<<17,s<128)return toNum(t,r,i);if(s=n[e.pos++],r|=(127&s)<<24,s<128)return toNum(t,r,i);if(s=n[e.pos++],r|=(1&s)<<31,s<128)return toNum(t,r,i);throw new Error("Expected varint not more than 10 bytes")}function readPackedEnd(t){return t.type===Pbf.Bytes?t.readVarint()+t.pos:t.pos+1}function toNum(t,i,e){return e?4294967296*i+(t>>>0):4294967296*(i>>>0)+(t>>>0)}function writeBigVarint(t,i){var e,r;if(t>=0?(e=t%4294967296|0,r=t/4294967296|0):(e=~(-t%4294967296),r=~(-t/4294967296),4294967295^e?e=e+1|0:(e=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");i.realloc(10),writeBigVarintLow(e,r,i),writeBigVarintHigh(r,i)}function writeBigVarintLow(t,i,e){e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos++]=127&t|128,t>>>=7,e.buf[e.pos]=127&t}function writeBigVarintHigh(t,i){var e=(7&t)<<4;i.buf[i.pos++]|=e|((t>>>=3)?128:0),t&&(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),t&&(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),t&&(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),t&&(i.buf[i.pos++]=127&t|((t>>>=7)?128:0),t&&(i.buf[i.pos++]=127&t)))))}function makeRoomForExtraLength(t,i,e){var r=i<=16383?1:i<=2097151?2:i<=268435455?3:Math.ceil(Math.log(i)/(7*Math.LN2));e.realloc(r);for(var s=e.pos-1;s>=t;s--)e.buf[s+r]=e.buf[s]}function writePackedVarint(t,i){for(var e=0;e<t.length;e++)i.writeVarint(t[e])}function writePackedSVarint(t,i){for(var e=0;e<t.length;e++)i.writeSVarint(t[e])}function writePackedFloat(t,i){for(var e=0;e<t.length;e++)i.writeFloat(t[e])}function writePackedDouble(t,i){for(var e=0;e<t.length;e++)i.writeDouble(t[e])}function writePackedBoolean(t,i){for(var e=0;e<t.length;e++)i.writeBoolean(t[e])}function writePackedFixed32(t,i){for(var e=0;e<t.length;e++)i.writeFixed32(t[e])}function writePackedSFixed32(t,i){for(var e=0;e<t.length;e++)i.writeSFixed32(t[e])}function writePackedFixed64(t,i){for(var e=0;e<t.length;e++)i.writeFixed64(t[e])}function writePackedSFixed64(t,i){for(var e=0;e<t.length;e++)i.writeSFixed64(t[e])}function readUInt32(t,i){return(t[i]|t[i+1]<<8|t[i+2]<<16)+16777216*t[i+3]}function writeInt32(t,i,e){t[e]=i,t[e+1]=i>>>8,t[e+2]=i>>>16,t[e+3]=i>>>24}function readInt32(t,i){return(t[i]|t[i+1]<<8|t[i+2]<<16)+(t[i+3]<<24)}function readUtf8(t,i,e){for(var r="",s=i;s<e;){var n=t[s],o=null,a=n>239?4:n>223?3:n>191?2:1;if(s+a>e)break;var h,u,f;1===a?n<128&&(o=n):2===a?128==(192&(h=t[s+1]))&&(o=(31&n)<<6|63&h)<=127&&(o=null):3===a?(h=t[s+1],u=t[s+2],128==(192&h)&&128==(192&u)&&((o=(15&n)<<12|(63&h)<<6|63&u)<=2047||o>=55296&&o<=57343)&&(o=null)):4===a&&(h=t[s+1],u=t[s+2],f=t[s+3],128==(192&h)&&128==(192&u)&&128==(192&f)&&((o=(15&n)<<18|(63&h)<<12|(63&u)<<6|63&f)<=65535||o>=1114112)&&(o=null)),null===o?(o=65533,a=1):o>65535&&(o-=65536,r+=String.fromCharCode(o>>>10&1023|55296),o=56320|1023&o),r+=String.fromCharCode(o),s+=a}return r}function writeUtf8(t,i,e){for(var r,s,n=0;n<i.length;n++){if((r=i.charCodeAt(n))>55295&&r<57344){if(!s){r>56319||n+1===i.length?(t[e++]=239,t[e++]=191,t[e++]=189):s=r;continue}if(r<56320){t[e++]=239,t[e++]=191,t[e++]=189,s=r;continue}r=s-55296<<10|r-56320|65536,s=null}else s&&(t[e++]=239,t[e++]=191,t[e++]=189,s=null);r<128?t[e++]=r:(r<2048?t[e++]=r>>6|192:(r<65536?t[e++]=r>>12|224:(t[e++]=r>>18|240,t[e++]=r>>12&63|128),t[e++]=r>>6&63|128),t[e++]=63&r|128)}return e}module.exports=Pbf;var ieee754=_dereq_("ieee754");Pbf.Varint=0,Pbf.Fixed64=1,Pbf.Bytes=2,Pbf.Fixed32=5;var SHIFT_LEFT_32=4294967296,SHIFT_RIGHT_32=1/SHIFT_LEFT_32;Pbf.prototype={destroy:function(){this.buf=null},readFields:function(t,i,e){for(e=e||this.length;this.pos<e;){var r=this.readVarint(),s=r>>3,n=this.pos;this.type=7&r,t(s,i,this),this.pos===n&&this.skip(r)}return i},readMessage:function(t,i){return this.readFields(t,i,this.readVarint()+this.pos)},readFixed32:function(){var t=readUInt32(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=readInt32(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=readUInt32(this.buf,this.pos)+readUInt32(this.buf,this.pos+4)*SHIFT_LEFT_32;return this.pos+=8,t},readSFixed64:function(){var t=readUInt32(this.buf,this.pos)+readInt32(this.buf,this.pos+4)*SHIFT_LEFT_32;return this.pos+=8,t},readFloat:function(){var t=ieee754.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ieee754.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var i,e,r=this.buf;return e=r[this.pos++],i=127&e,e<128?i:(e=r[this.pos++],i|=(127&e)<<7,e<128?i:(e=r[this.pos++],i|=(127&e)<<14,e<128?i:(e=r[this.pos++],i|=(127&e)<<21,e<128?i:(e=r[this.pos],i|=(15&e)<<28,readVarintRemainder(i,t,this)))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,i=readUtf8(this.buf,this.pos,t);return this.pos=t,i},readBytes:function(){var t=this.readVarint()+this.pos,i=this.buf.subarray(this.pos,t);return this.pos=t,i},readPackedVarint:function(t,i){var e=readPackedEnd(this);for(t=t||[];this.pos<e;)t.push(this.readVarint(i));return t},readPackedSVarint:function(t){var i=readPackedEnd(this);for(t=t||[];this.pos<i;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){var i=readPackedEnd(this);for(t=t||[];this.pos<i;)t.push(this.readBoolean());return t},readPackedFloat:function(t){var i=readPackedEnd(this);for(t=t||[];this.pos<i;)t.push(this.readFloat());return t},readPackedDouble:function(t){var i=readPackedEnd(this);for(t=t||[];this.pos<i;)t.push(this.readDouble());return t},readPackedFixed32:function(t){var i=readPackedEnd(this);for(t=t||[];this.pos<i;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){var i=readPackedEnd(this);for(t=t||[];this.pos<i;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){var i=readPackedEnd(this);for(t=t||[];this.pos<i;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){var i=readPackedEnd(this);for(t=t||[];this.pos<i;)t.push(this.readSFixed64());return t},skip:function(t){var i=7&t;if(i===Pbf.Varint)for(;this.buf[this.pos++]>127;);else if(i===Pbf.Bytes)this.pos=this.readVarint()+this.pos;else if(i===Pbf.Fixed32)this.pos+=4;else{if(i!==Pbf.Fixed64)throw new Error("Unimplemented type: "+i);this.pos+=8}},writeTag:function(t,i){this.writeVarint(t<<3|i)},realloc:function(t){for(var i=this.length||16;i<this.pos+t;)i*=2;if(i!==this.length){var e=new Uint8Array(i);e.set(this.buf),this.buf=e,this.length=i}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),writeInt32(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),writeInt32(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),writeInt32(this.buf,-1&t,this.pos),writeInt32(this.buf,Math.floor(t*SHIFT_RIGHT_32),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),writeInt32(this.buf,-1&t,this.pos),writeInt32(this.buf,Math.floor(t*SHIFT_RIGHT_32),this.pos+4),this.pos+=8},writeVarint:function(t){if((t=+t||0)>268435455||t<0)return void writeBigVarint(t,this);this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var i=this.pos;this.pos=writeUtf8(this.buf,t,this.pos);var e=this.pos-i;e>=128&&makeRoomForExtraLength(i,e,this),this.pos=i-1,this.writeVarint(e),this.pos+=e},writeFloat:function(t){this.realloc(4),ieee754.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ieee754.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var i=t.length;this.writeVarint(i),this.realloc(i);for(var e=0;e<i;e++)this.buf[this.pos++]=t[e]},writeRawMessage:function(t,i){this.pos++;var e=this.pos;t(i,this);var r=this.pos-e;r>=128&&makeRoomForExtraLength(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,i,e){this.writeTag(t,Pbf.Bytes),this.writeRawMessage(i,e)},writePackedVarint:function(t,i){this.writeMessage(t,writePackedVarint,i)},writePackedSVarint:function(t,i){this.writeMessage(t,writePackedSVarint,i)},writePackedBoolean:function(t,i){this.writeMessage(t,writePackedBoolean,i)},writePackedFloat:function(t,i){this.writeMessage(t,writePackedFloat,i)},writePackedDouble:function(t,i){this.writeMessage(t,writePackedDouble,i)},writePackedFixed32:function(t,i){this.writeMessage(t,writePackedFixed32,i)},writePackedSFixed32:function(t,i){this.writeMessage(t,writePackedSFixed32,i)},writePackedFixed64:function(t,i){this.writeMessage(t,writePackedFixed64,i)},writePackedSFixed64:function(t,i){this.writeMessage(t,writePackedSFixed64,i)},writeBytesField:function(t,i){this.writeTag(t,Pbf.Bytes),this.writeBytes(i)},writeFixed32Field:function(t,i){this.writeTag(t,Pbf.Fixed32),this.writeFixed32(i)},writeSFixed32Field:function(t,i){this.writeTag(t,Pbf.Fixed32),this.writeSFixed32(i)},writeFixed64Field:function(t,i){this.writeTag(t,Pbf.Fixed64),this.writeFixed64(i)},writeSFixed64Field:function(t,i){this.writeTag(t,Pbf.Fixed64),this.writeSFixed64(i)},writeVarintField:function(t,i){this.writeTag(t,Pbf.Varint),this.writeVarint(i)},writeSVarintField:function(t,i){this.writeTag(t,Pbf.Varint),this.writeSVarint(i)},writeStringField:function(t,i){this.writeTag(t,Pbf.Bytes),this.writeString(i)},writeFloatField:function(t,i){this.writeTag(t,Pbf.Fixed32),this.writeFloat(i)},writeDoubleField:function(t,i){this.writeTag(t,Pbf.Fixed64),this.writeDouble(i)},writeBooleanField:function(t,i){this.writeVarintField(t,Boolean(i))}};
-},{"ieee754":24}],39:[function(_dereq_,module,exports){
-function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}function cleanUpNextTick(){draining&&currentQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}var process=module.exports={},cachedSetTimeout,cachedClearTimeout;!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var queue=[],draining=!1,currentQueue,queueIndex=-1;process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};
-},{}],40:[function(_dereq_,module,exports){
-"use strict";function partialSort(a,t,r,o,p){for(r=r||0,o=o||a.length-1,p=p||defaultCompare;o>r;){if(o-r>600){var f=o-r+1,e=t-r+1,l=Math.log(f),s=.5*Math.exp(2*l/3),i=.5*Math.sqrt(l*s*(f-s)/f)*(e-f/2<0?-1:1);partialSort(a,t,Math.max(r,Math.floor(t-e*s/f+i)),Math.min(o,Math.floor(t+(f-e)*s/f+i)),p)}var n=a[t],h=r,u=o;for(swap(a,r,t),p(a[o],n)>0&&swap(a,r,o);h<u;){for(swap(a,h,u),h++,u--;p(a[h],n)<0;)h++;for(;p(a[u],n)>0;)u--}0===p(a[r],n)?swap(a,r,u):(u++,swap(a,u,o)),u<=t&&(r=u+1),t<=u&&(o=u-1)}}function swap(a,t,r){var o=a[t];a[t]=a[r],a[r]=o}function defaultCompare(a,t){return a<t?-1:a>t?1:0}module.exports=partialSort;
-},{}],41:[function(_dereq_,module,exports){
-"use strict";function supercluster(t){return new SuperCluster(t)}function SuperCluster(t){this.options=extend(Object.create(this.options),t),this.trees=new Array(this.options.maxZoom+1)}function createCluster(t,e,n,o,i){return{x:t,y:e,zoom:1/0,id:o,properties:i,parentId:-1,numPoints:n}}function createPointCluster(t,e){var n=t.geometry.coordinates;return{x:lngX(n[0]),y:latY(n[1]),zoom:1/0,id:e,parentId:-1}}function getClusterJSON(t){return{type:"Feature",properties:getClusterProperties(t),geometry:{type:"Point",coordinates:[xLng(t.x),yLat(t.y)]}}}function getClusterProperties(t){var e=t.numPoints,n=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return extend(extend({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function lngX(t){return t/360+.5}function latY(t){var e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function xLng(t){return 360*(t-.5)}function yLat(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function extend(t,e){for(var n in e)t[n]=e[n];return t}function getX(t){return t.x}function getY(t){return t.y}var kdbush=_dereq_("kdbush");module.exports=supercluster,SuperCluster.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var n="prepare "+t.length+" points";e&&console.time(n),this.points=t;var o=t.map(createPointCluster);e&&console.timeEnd(n);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var r=+Date.now();this.trees[i+1]=kdbush(o,getX,getY,this.options.nodeSize,Float32Array),o=this._cluster(o,i),e&&console.log("z%d: %d clusters in %dms",i,o.length,+Date.now()-r)}return this.trees[this.options.minZoom]=kdbush(o,getX,getY,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var n=this.trees[this._limitZoom(e)],o=n.range(lngX(t[0]),latY(t[3]),lngX(t[2]),latY(t[1])),i=[],r=0;r<o.length;r++){var s=n.points[o[r]];i.push(s.numPoints?getClusterJSON(s):this.points[s.id])}return i},getChildren:function(t,e){for(var n=this.trees[e+1].points[t],o=this.options.radius/(this.options.extent*Math.pow(2,e)),i=this.trees[e+1].within(n.x,n.y,o),r=[],s=0;s<i.length;s++){var u=this.trees[e+1].points[i[s]];u.parentId===t&&r.push(u.numPoints?getClusterJSON(u):this.points[u.id])}return r},getLeaves:function(t,e,n,o){n=n||10,o=o||0;var i=[];return this._appendLeaves(i,t,e,n,o,0),i},getTile:function(t,e,n){var o=this.trees[this._limitZoom(t)],i=Math.pow(2,t),r=this.options.extent,s=this.options.radius,u=s/r,a=(n-u)/i,p=(n+1+u)/i,h={features:[]};return this._addTileFeatures(o.range((e-u)/i,a,(e+1+u)/i,p),o.points,e,n,i,h),0===e&&this._addTileFeatures(o.range(1-u/i,a,1,p),o.points,i,n,i,h),e===i-1&&this._addTileFeatures(o.range(0,a,u/i,p),o.points,-1,n,i,h),h.features.length?h:null},getClusterExpansionZoom:function(t,e){for(;e<this.options.maxZoom;){var n=this.getChildren(t,e);if(e++,1!==n.length)break;t=n[0].properties.cluster_id}return e},_appendLeaves:function(t,e,n,o,i,r){for(var s=this.getChildren(e,n),u=0;u<s.length;u++){var a=s[u].properties;if(a.cluster?r+a.point_count<=i?r+=a.point_count:r=this._appendLeaves(t,a.cluster_id,n+1,o,i,r):r<i?r++:t.push(s[u]),t.length===o)break}return r},_addTileFeatures:function(t,e,n,o,i,r){for(var s=0;s<t.length;s++){var u=e[t[s]];r.features.push({type:1,geometry:[[Math.round(this.options.extent*(u.x*i-n)),Math.round(this.options.extent*(u.y*i-o))]],tags:u.numPoints?getClusterProperties(u):this.points[u.id].properties})}},_limitZoom:function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},_cluster:function(t,e){for(var n=[],o=this.options.radius/(this.options.extent*Math.pow(2,e)),i=0;i<t.length;i++){var r=t[i];if(!(r.zoom<=e)){r.zoom=e;var s=this.trees[e+1],u=s.within(r.x,r.y,o),a=r.numPoints||1,p=r.x*a,h=r.y*a,l=null;this.options.reduce&&(l=this.options.initial(),this._accumulate(l,r));for(var c=0;c<u.length;c++){var d=s.points[u[c]];if(e<d.zoom){var m=d.numPoints||1;d.zoom=e,p+=d.x*m,h+=d.y*m,a+=m,d.parentId=i,this.options.reduce&&this._accumulate(l,d)}}1===a?n.push(r):(r.parentId=i,n.push(createCluster(p/a,h/a,a,i,l)))}}return n},_accumulate:function(t,e){var n=e.numPoints?e.properties:this.options.map(this.points[e.id].properties);this.options.reduce(t,n)}};
-},{"kdbush":25}],42:[function(_dereq_,module,exports){
-"use strict";function TinyQueue(t,i){if(!(this instanceof TinyQueue))return new TinyQueue(t,i);if(this.data=t||[],this.length=this.data.length,this.compare=i||defaultCompare,this.length>0)for(var e=this.length>>1;e>=0;e--)this._down(e)}function defaultCompare(t,i){return t<i?-1:t>i?1:0}module.exports=TinyQueue,TinyQueue.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t}},peek:function(){return this.data[0]},_up:function(t){for(var i=this.data,e=this.compare,h=i[t];t>0;){var n=t-1>>1,a=i[n];if(e(h,a)>=0)break;i[t]=a,t=n}i[t]=h},_down:function(t){for(var i=this.data,e=this.compare,h=this.length,n=h>>1,a=i[t];t<n;){var s=1+(t<<1),u=s+1,r=i[s];if(u<h&&e(i[u],r)<0&&(s=u,r=i[u]),e(r,a)>=0)break;i[t]=r,t=s}i[t]=a}};
-},{}],43:[function(_dereq_,module,exports){
-"function"==typeof Object.create?module.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function(t,e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t};
-},{}],44:[function(_dereq_,module,exports){
-module.exports=function(o){return o&&"object"==typeof o&&"function"==typeof o.copy&&"function"==typeof o.fill&&"function"==typeof o.readUInt8};
-},{}],45:[function(_dereq_,module,exports){
-(function (process,global){
-function inspect(e,r){var t={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),isBoolean(r)?t.showHidden=r:r&&exports._extend(t,r),isUndefined(t.showHidden)&&(t.showHidden=!1),isUndefined(t.depth)&&(t.depth=2),isUndefined(t.colors)&&(t.colors=!1),isUndefined(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=stylizeWithColor),formatValue(t,e,t.depth)}function stylizeWithColor(e,r){var t=inspect.styles[r];return t?"["+inspect.colors[t][0]+"m"+e+"["+inspect.colors[t][1]+"m":e}function stylizeNoColor(e,r){return e}function arrayToHash(e){var r={};return e.forEach(function(e,t){r[e]=!0}),r}function formatValue(e,r,t){if(e.customInspect&&r&&isFunction(r.inspect)&&r.inspect!==exports.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(t,e);return isString(n)||(n=formatValue(e,n,t)),n}var i=formatPrimitive(e,r);if(i)return i;var o=Object.keys(r),s=arrayToHash(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),isError(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return formatError(r);if(0===o.length){if(isFunction(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(isRegExp(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(isDate(r))return e.stylize(Date.prototype.toString.call(r),"date");if(isError(r))return formatError(r)}var c="",a=!1,l=["{","}"];if(isArray(r)&&(a=!0,l=["[","]"]),isFunction(r)){c=" [Function"+(r.name?": "+r.name:"")+"]"}if(isRegExp(r)&&(c=" "+RegExp.prototype.toString.call(r)),isDate(r)&&(c=" "+Date.prototype.toUTCString.call(r)),isError(r)&&(c=" "+formatError(r)),0===o.length&&(!a||0==r.length))return l[0]+c+l[1];if(t<0)return isRegExp(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var p;return p=a?formatArray(e,r,t,s,o):o.map(function(n){return formatProperty(e,r,t,s,n,a)}),e.seen.pop(),reduceToSingleString(p,c,l)}function formatPrimitive(e,r){if(isUndefined(r))return e.stylize("undefined","undefined");if(isString(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}return isNumber(r)?e.stylize(""+r,"number"):isBoolean(r)?e.stylize(""+r,"boolean"):isNull(r)?e.stylize("null","null"):void 0}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(e,r,t,n,i){for(var o=[],s=0,u=r.length;s<u;++s)hasOwnProperty(r,String(s))?o.push(formatProperty(e,r,t,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(formatProperty(e,r,t,n,i,!0))}),o}function formatProperty(e,r,t,n,i,o){var s,u,c;if(c=Object.getOwnPropertyDescriptor(r,i)||{value:r[i]},c.get?u=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(u=e.stylize("[Setter]","special")),hasOwnProperty(n,i)||(s="["+i+"]"),u||(e.seen.indexOf(c.value)<0?(u=isNull(t)?formatValue(e,c.value,null):formatValue(e,c.value,t-1),u.indexOf("\n")>-1&&(u=o?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n"))):u=e.stylize("[Circular]","special")),isUndefined(s)){if(o&&i.match(/^\d+$/))return u;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+u}function reduceToSingleString(e,r,t){var n=0;return e.reduce(function(e,r){return n++,r.indexOf("\n")>=0&&n++,e+r.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?t[0]+(""===r?"":r+"\n ")+" "+e.join(",\n ")+" "+t[1]:t[0]+r+" "+e.join(", ")+" "+t[1]}function isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNullOrUndefined(e){return null==e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isSymbol(e){return"symbol"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"==typeof e&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"==typeof e}function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return e<10?"0"+e.toString(10):e.toString(10)}function timestamp(){var e=new Date,r=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(":");return[e.getDate(),months[e.getMonth()],r].join(" ")}function hasOwnProperty(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var formatRegExp=/%[sdj%]/g;exports.format=function(e){if(!isString(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(inspect(arguments[t]));return r.join(" ")}for(var t=1,n=arguments,i=n.length,o=String(e).replace(formatRegExp,function(e){if("%%"===e)return"%";if(t>=i)return e;switch(e){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch(e){return"[Circular]"}default:return e}}),s=n[t];t<i;s=n[++t])isNull(s)||!isObject(s)?o+=" "+s:o+=" "+inspect(s);return o},exports.deprecate=function(e,r){function t(){if(!n){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),n=!0}return e.apply(this,arguments)}if(isUndefined(global.process))return function(){return exports.deprecate(e,r).apply(this,arguments)};if(!0===process.noDeprecation)return e;var n=!1;return t};var debugs={},debugEnviron;exports.debuglog=function(e){if(isUndefined(debugEnviron)&&(debugEnviron=process.env.NODE_DEBUG||""),e=e.toUpperCase(),!debugs[e])if(new RegExp("\\b"+e+"\\b","i").test(debugEnviron)){var r=process.pid;debugs[e]=function(){var t=exports.format.apply(exports,arguments);console.error("%s %d: %s",e,r,t)}}else debugs[e]=function(){};return debugs[e]},exports.inspect=inspect,inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=_dereq_("./support/isBuffer");var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))},exports.inherits=_dereq_("inherits"),exports._extend=function(e,r){if(!r||!isObject(r))return e;for(var t=Object.keys(r),n=t.length;n--;)e[t[n]]=r[t[n]];return e};
-}).call(this,_dereq_('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-
-},{"./support/isBuffer":44,"_process":39,"inherits":43}],46:[function(_dereq_,module,exports){
-function fromVectorTileJs(e){var r=new Pbf;return writeTile(e,r),r.finish()}function fromGeojsonVt(e){var r={};for(var t in e)r[t]=new GeoJSONWrapper(e[t].features),r[t].name=t;return fromVectorTileJs({layers:r})}function writeTile(e,r){for(var t in e.layers)r.writeMessage(3,writeLayer,e.layers[t])}function writeLayer(e,r){r.writeVarintField(15,e.version||1),r.writeStringField(1,e.name||""),r.writeVarintField(5,e.extent||4096);var t,i={keys:[],values:[],keycache:{},valuecache:{}};for(t=0;t<e.length;t++)i.feature=e.feature(t),r.writeMessage(2,writeFeature,i);var a=i.keys;for(t=0;t<a.length;t++)r.writeStringField(3,a[t]);var o=i.values;for(t=0;t<o.length;t++)r.writeMessage(4,writeValue,o[t])}function writeFeature(e,r){var t=e.feature;void 0!==t.id&&r.writeVarintField(1,t.id),r.writeMessage(2,writeProperties,e),r.writeVarintField(3,t.type),r.writeMessage(4,writeGeometry,t)}function writeProperties(e,r){var t=e.feature,i=e.keys,a=e.values,o=e.keycache,n=e.valuecache;for(var l in t.properties){var s=o[l];void 0===s&&(i.push(l),s=i.length-1,o[l]=s),r.writeVarint(s);var u=t.properties[l],f=typeof u;"string"!==f&&"boolean"!==f&&"number"!==f&&(u=JSON.stringify(u));var w=f+":"+u,v=n[w];void 0===v&&(a.push(u),v=a.length-1,n[w]=v),r.writeVarint(v)}}function command(e,r){return(r<<3)+(7&e)}function zigzag(e){return e<<1^e>>31}function writeGeometry(e,r){for(var t=e.loadGeometry(),i=e.type,a=0,o=0,n=t.length,l=0;l<n;l++){var s=t[l],u=1;1===i&&(u=s.length),r.writeVarint(command(1,u));for(var f=0;f<s.length;f++){1===f&&1!==i&&r.writeVarint(command(2,s.length-1));var w=s[f].x-a,v=s[f].y-o;r.writeVarint(zigzag(w)),r.writeVarint(zigzag(v)),a+=w,o+=v}}}function writeValue(e,r){var t=typeof e;"string"===t?r.writeStringField(1,e):"boolean"===t?r.writeBooleanField(7,e):"number"===t&&(e%1!=0?r.writeDoubleField(3,e):e<0?r.writeSVarintField(6,e):r.writeVarintField(5,e))}var Pbf=_dereq_("pbf"),GeoJSONWrapper=_dereq_("./lib/geojson_wrapper");module.exports=fromVectorTileJs,module.exports.fromVectorTileJs=fromVectorTileJs,module.exports.fromGeojsonVt=fromGeojsonVt,module.exports.GeoJSONWrapper=GeoJSONWrapper;
-},{"./lib/geojson_wrapper":47,"pbf":38}],47:[function(_dereq_,module,exports){
-"use strict";function GeoJSONWrapper(e){this.features=e,this.length=e.length}function FeatureWrapper(e){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=4096}var Point=_dereq_("@mapbox/point-geometry"),VectorTileFeature=_dereq_("@mapbox/vector-tile").VectorTileFeature;module.exports=GeoJSONWrapper,GeoJSONWrapper.prototype.feature=function(e){return new FeatureWrapper(this.features[e])},FeatureWrapper.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t<e.length;t++){for(var r=e[t],o=[],a=0;a<r.length;a++)o.push(new Point(r[a][0],r[a][1]));this.geometry.push(o)}return this.geometry},FeatureWrapper.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,o=1/0,a=-1/0,p=0;p<e.length;p++)for(var i=e[p],n=0;n<i.length;n++){var h=i[n];t=Math.min(t,h.x),r=Math.max(r,h.x),o=Math.min(o,h.y),a=Math.max(a,h.y)}return[t,o,r,a]},FeatureWrapper.prototype.toGeoJSON=VectorTileFeature.prototype.toGeoJSON;
-},{"@mapbox/point-geometry":2,"@mapbox/vector-tile":6}],48:[function(_dereq_,module,exports){
-var bundleFn=arguments[3],sources=arguments[4],cache=arguments[5],stringify=JSON.stringify;module.exports=function(r,e){function t(r){d[r]=!0;for(var e in sources[r][1]){var n=sources[r][1][e];d[n]||t(n)}}for(var n,o=Object.keys(cache),a=0,i=o.length;a<i;a++){var s=o[a],u=cache[s].exports;if(u===r||u&&u.default===r){n=s;break}}if(!n){n=Math.floor(Math.pow(16,8)*Math.random()).toString(16);for(var f={},a=0,i=o.length;a<i;a++){var s=o[a];f[s]=s}sources[n]=[Function(["require","module","exports"],"("+r+")(self)"),f]}var c=Math.floor(Math.pow(16,8)*Math.random()).toString(16),l={};l[n]=n,sources[c]=[Function(["require"],"var f = require("+stringify(n)+");(f.default ? f.default : f)(self);"),l];var d={};t(c);var g="("+bundleFn+")({"+Object.keys(d).map(function(r){return stringify(r)+":["+sources[r][0]+","+stringify(sources[r][1])+"]"}).join(",")+"},{},["+stringify(c)+"])",v=window.URL||window.webkitURL||window.mozURL||window.msURL,w=new Blob([g],{type:"text/javascript"});if(e&&e.bare)return w;var h=v.createObjectURL(w),b=new Worker(h);return b.objectURL=h,b};
-},{}],49:[function(_dereq_,module,exports){
-module.exports.RADIUS=6378137,module.exports.FLATTENING=1/298.257223563,module.exports.POLAR_RADIUS=6356752.3142;
-},{}],50:[function(_dereq_,module,exports){
-module.exports={"version":"0.42.2"}
-},{}],51:[function(_dereq_,module,exports){
-"use strict";var util=_dereq_("../util/util");module.exports={deserialize:function(e,r){var t={};if(!r)return t;for(var i=0,a=e;i<a.length;i+=1){var l=a[i],u=l.layerIds.map(function(e){return r.getLayer(e)}).filter(Boolean);if(0!==u.length)for(var n=u[0].createBucket(util.extend({layers:u},l)),o=0,f=u;o<f.length;o+=1){var s=f[o];t[s.id]=n}}return t}};
-},{"../util/util":266}],52:[function(_dereq_,module,exports){
-"use strict";function addCircleVertex(e,r,t,a,i){e.emplaceBack(2*r+(a+1)/2,2*t+(i+1)/2)}var ref=_dereq_("../segment"),SegmentVector=ref.SegmentVector,VertexBuffer=_dereq_("../../gl/vertex_buffer"),IndexBuffer=_dereq_("../../gl/index_buffer"),ref$1=_dereq_("../program_configuration"),ProgramConfigurationSet=ref$1.ProgramConfigurationSet,createVertexArrayType=_dereq_("../vertex_array_type"),ref$2=_dereq_("../index_array_type"),TriangleIndexArray=ref$2.TriangleIndexArray,loadGeometry=_dereq_("../load_geometry"),EXTENT=_dereq_("../extent"),circleInterface={layoutAttributes:[{name:"a_pos",components:2,type:"Int16"}],indexArrayType:TriangleIndexArray,paintAttributes:[{property:"circle-color"},{property:"circle-radius"},{property:"circle-blur"},{property:"circle-opacity"},{property:"circle-stroke-color"},{property:"circle-stroke-width"},{property:"circle-stroke-opacity"}]},LayoutVertexArrayType=createVertexArrayType(circleInterface.layoutAttributes),CircleBucket=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.index=e.index,this.layoutVertexArray=new LayoutVertexArrayType(e.layoutVertexArray),this.indexArray=new TriangleIndexArray(e.indexArray),this.segments=new SegmentVector(e.segments),this.programConfigurations=new ProgramConfigurationSet(this.constructor.programInterface,e.layers,e.zoom,e.programConfigurations)};CircleBucket.prototype.populate=function(e,r){for(var t=this,a=0,i=e;a<i.length;a+=1){var o=i[a],n=o.feature,y=o.index,u=o.sourceLayerIndex;if(t.layers[0]._featureFilter({zoom:t.zoom},n)){var s=loadGeometry(n);t.addFeature(n,s),r.featureIndex.insert(n,s,y,u,t.index)}}},CircleBucket.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},CircleBucket.prototype.serialize=function(e){return{zoom:this.zoom,layerIds:this.layers.map(function(e){return e.id}),layoutVertexArray:this.layoutVertexArray.serialize(e),indexArray:this.indexArray.serialize(e),programConfigurations:this.programConfigurations.serialize(e),segments:this.segments.get()}},CircleBucket.prototype.upload=function(e){this.layoutVertexBuffer=new VertexBuffer(e,this.layoutVertexArray),this.indexBuffer=new IndexBuffer(e,this.indexArray),this.programConfigurations.upload(e)},CircleBucket.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},CircleBucket.prototype.addFeature=function(e,r){for(var t=this,a=0,i=r;a<i.length;a+=1)for(var o=i[a],n=0,y=o;n<y.length;n+=1){var u=y[n],s=u.x,c=u.y;if(!(s<0||s>=EXTENT||c<0||c>=EXTENT)){var l=t.segments.prepareSegment(4,t.layoutVertexArray,t.indexArray),p=l.vertexLength;addCircleVertex(t.layoutVertexArray,s,c,-1,-1),addCircleVertex(t.layoutVertexArray,s,c,1,-1),addCircleVertex(t.layoutVertexArray,s,c,1,1),addCircleVertex(t.layoutVertexArray,s,c,-1,1),t.indexArray.emplaceBack(p,p+1,p+2),t.indexArray.emplaceBack(p,p+3,p+2),l.vertexLength+=4,l.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e)},CircleBucket.programInterface=circleInterface,module.exports=CircleBucket;
-},{"../../gl/index_buffer":71,"../../gl/vertex_buffer":72,"../extent":58,"../index_array_type":60,"../load_geometry":61,"../program_configuration":63,"../segment":65,"../vertex_array_type":66}],53:[function(_dereq_,module,exports){
-"use strict";var ref=_dereq_("../segment"),SegmentVector=ref.SegmentVector,VertexBuffer=_dereq_("../../gl/vertex_buffer"),IndexBuffer=_dereq_("../../gl/index_buffer"),ref$1=_dereq_("../program_configuration"),ProgramConfigurationSet=ref$1.ProgramConfigurationSet,createVertexArrayType=_dereq_("../vertex_array_type"),ref$2=_dereq_("../index_array_type"),LineIndexArray=ref$2.LineIndexArray,TriangleIndexArray=ref$2.TriangleIndexArray,loadGeometry=_dereq_("../load_geometry"),earcut=_dereq_("earcut"),classifyRings=_dereq_("../../util/classify_rings"),EARCUT_MAX_RINGS=500,fillInterface={layoutAttributes:[{name:"a_pos",components:2,type:"Int16"}],indexArrayType:TriangleIndexArray,indexArrayType2:LineIndexArray,paintAttributes:[{property:"fill-color"},{property:"fill-outline-color"},{property:"fill-opacity"}]},LayoutVertexArrayType=createVertexArrayType(fillInterface.layoutAttributes),FillBucket=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.index=e.index,this.layoutVertexArray=new LayoutVertexArrayType(e.layoutVertexArray),this.indexArray=new TriangleIndexArray(e.indexArray),this.indexArray2=new LineIndexArray(e.indexArray2),this.programConfigurations=new ProgramConfigurationSet(fillInterface,e.layers,e.zoom,e.programConfigurations),this.segments=new SegmentVector(e.segments),this.segments2=new SegmentVector(e.segments2)};FillBucket.prototype.populate=function(e,r){for(var t=this,i=0,a=e;i<a.length;i+=1){var n=a[i],o=n.feature,s=n.index,y=n.sourceLayerIndex;if(t.layers[0]._featureFilter({zoom:t.zoom},o)){var l=loadGeometry(o);t.addFeature(o,l),r.featureIndex.insert(o,l,s,y,t.index)}}},FillBucket.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},FillBucket.prototype.serialize=function(e){return{zoom:this.zoom,layerIds:this.layers.map(function(e){return e.id}),layoutVertexArray:this.layoutVertexArray.serialize(e),indexArray:this.indexArray.serialize(e),indexArray2:this.indexArray2.serialize(e),programConfigurations:this.programConfigurations.serialize(e),segments:this.segments.get(),segments2:this.segments2.get()}},FillBucket.prototype.upload=function(e){this.layoutVertexBuffer=new VertexBuffer(e,this.layoutVertexArray),this.indexBuffer=new IndexBuffer(e,this.indexArray),this.indexBuffer2=new IndexBuffer(e,this.indexArray2),this.programConfigurations.upload(e)},FillBucket.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},FillBucket.prototype.addFeature=function(e,r){for(var t=this,i=0,a=classifyRings(r,EARCUT_MAX_RINGS);i<a.length;i+=1){for(var n=a[i],o=0,s=0,y=n;s<y.length;s+=1){o+=y[s].length}for(var l=t.segments.prepareSegment(o,t.layoutVertexArray,t.indexArray),u=l.vertexLength,f=[],g=[],x=0,p=n;x<p.length;x+=1){var h=p[x];if(0!==h.length){h!==n[0]&&g.push(f.length/2);var d=t.segments2.prepareSegment(h.length,t.layoutVertexArray,t.indexArray2),c=d.vertexLength;t.layoutVertexArray.emplaceBack(h[0].x,h[0].y),t.indexArray2.emplaceBack(c+h.length-1,c),f.push(h[0].x),f.push(h[0].y);for(var m=1;m<h.length;m++)t.layoutVertexArray.emplaceBack(h[m].x,h[m].y),t.indexArray2.emplaceBack(c+m-1,c+m),f.push(h[m].x),f.push(h[m].y);d.vertexLength+=h.length,d.primitiveLength+=h.length}}for(var A=earcut(f,g),B=0;B<A.length;B+=3)t.indexArray.emplaceBack(u+A[B],u+A[B+1],u+A[B+2]);l.vertexLength+=o,l.primitiveLength+=A.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e)},FillBucket.programInterface=fillInterface,module.exports=FillBucket;
-},{"../../gl/index_buffer":71,"../../gl/vertex_buffer":72,"../../util/classify_rings":248,"../index_array_type":60,"../load_geometry":61,"../program_configuration":63,"../segment":65,"../vertex_array_type":66,"earcut":12}],54:[function(_dereq_,module,exports){
-"use strict";function addVertex(e,r,t,a,i,n,o,u){e.emplaceBack(r,t,2*Math.floor(a*FACTOR)+o,i*FACTOR*2,n*FACTOR*2,Math.round(u))}function isBoundaryEdge(e,r){return e.x===r.x&&(e.x<0||e.x>EXTENT)||e.y===r.y&&(e.y<0||e.y>EXTENT)}var ref=_dereq_("../segment"),SegmentVector=ref.SegmentVector,MAX_VERTEX_ARRAY_LENGTH=ref.MAX_VERTEX_ARRAY_LENGTH,VertexBuffer=_dereq_("../../gl/vertex_buffer"),IndexBuffer=_dereq_("../../gl/index_buffer"),ref$1=_dereq_("../program_configuration"),ProgramConfigurationSet=ref$1.ProgramConfigurationSet,createVertexArrayType=_dereq_("../vertex_array_type"),ref$2=_dereq_("../index_array_type"),TriangleIndexArray=ref$2.TriangleIndexArray,loadGeometry=_dereq_("../load_geometry"),EXTENT=_dereq_("../extent"),earcut=_dereq_("earcut"),classifyRings=_dereq_("../../util/classify_rings"),EARCUT_MAX_RINGS=500,fillExtrusionInterface={layoutAttributes:[{name:"a_pos",components:2,type:"Int16"},{name:"a_normal",components:3,type:"Int16"},{name:"a_edgedistance",components:1,type:"Int16"}],indexArrayType:TriangleIndexArray,paintAttributes:[{property:"fill-extrusion-base"},{property:"fill-extrusion-height"},{property:"fill-extrusion-color"}]},FACTOR=Math.pow(2,13),LayoutVertexArrayType=createVertexArrayType(fillExtrusionInterface.layoutAttributes),FillExtrusionBucket=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.index=e.index,this.layoutVertexArray=new LayoutVertexArrayType(e.layoutVertexArray),this.indexArray=new TriangleIndexArray(e.indexArray),this.programConfigurations=new ProgramConfigurationSet(fillExtrusionInterface,e.layers,e.zoom,e.programConfigurations),this.segments=new SegmentVector(e.segments)};FillExtrusionBucket.prototype.populate=function(e,r){for(var t=this,a=0,i=e;a<i.length;a+=1){var n=i[a],o=n.feature,u=n.index,s=n.sourceLayerIndex;if(t.layers[0]._featureFilter({zoom:t.zoom},o)){var y=loadGeometry(o);t.addFeature(o,y),r.featureIndex.insert(o,y,u,s,t.index)}}},FillExtrusionBucket.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},FillExtrusionBucket.prototype.serialize=function(e){return{zoom:this.zoom,layerIds:this.layers.map(function(e){return e.id}),layoutVertexArray:this.layoutVertexArray.serialize(e),indexArray:this.indexArray.serialize(e),programConfigurations:this.programConfigurations.serialize(e),segments:this.segments.get()}},FillExtrusionBucket.prototype.upload=function(e){this.layoutVertexBuffer=new VertexBuffer(e,this.layoutVertexArray),this.indexBuffer=new IndexBuffer(e,this.indexArray),this.programConfigurations.upload(e)},FillExtrusionBucket.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},FillExtrusionBucket.prototype.addFeature=function(e,r){for(var t=this,a=0,i=classifyRings(r,EARCUT_MAX_RINGS);a<i.length;a+=1){for(var n=i[a],o=0,u=0,s=n;u<s.length;u+=1){o+=s[u].length}for(var y=t.segments.prepareSegment(4,t.layoutVertexArray,t.indexArray),l=0,x=n;l<x.length;l+=1){var f=x[l];if(0!==f.length)for(var g=0,p=0;p<f.length;p++){var d=f[p];if(p>=1){var h=f[p-1];if(!isBoundaryEdge(d,h)){y.vertexLength+4>MAX_VERTEX_ARRAY_LENGTH&&(y=t.segments.prepareSegment(4,t.layoutVertexArray,t.indexArray));var A=d.sub(h)._perp()._unit();addVertex(t.layoutVertexArray,d.x,d.y,A.x,A.y,0,0,g),addVertex(t.layoutVertexArray,d.x,d.y,A.x,A.y,0,1,g),g+=h.dist(d),addVertex(t.layoutVertexArray,h.x,h.y,A.x,A.y,0,0,g),addVertex(t.layoutVertexArray,h.x,h.y,A.x,A.y,0,1,g);var c=y.vertexLength;t.indexArray.emplaceBack(c,c+1,c+2),t.indexArray.emplaceBack(c+1,c+2,c+3),y.vertexLength+=4,y.primitiveLength+=2}}}}y.vertexLength+o>MAX_VERTEX_ARRAY_LENGTH&&(y=t.segments.prepareSegment(o,t.layoutVertexArray,t.indexArray));for(var m=[],V=[],E=y.vertexLength,_=0,v=n;_<v.length;_+=1){var T=v[_];if(0!==T.length){T!==n[0]&&V.push(m.length/2);for(var B=0;B<T.length;B++){var R=T[B];addVertex(t.layoutVertexArray,R.x,R.y,0,0,1,1,0),m.push(R.x),m.push(R.y)}}}for(var I=earcut(m,V),C=0;C<I.length;C+=3)t.indexArray.emplaceBack(E+I[C],E+I[C+1],E+I[C+2]);y.primitiveLength+=I.length/3,y.vertexLength+=o}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e)},FillExtrusionBucket.programInterface=fillExtrusionInterface,module.exports=FillExtrusionBucket;
-},{"../../gl/index_buffer":71,"../../gl/vertex_buffer":72,"../../util/classify_rings":248,"../extent":58,"../index_array_type":60,"../load_geometry":61,"../program_configuration":63,"../segment":65,"../vertex_array_type":66,"earcut":12}],55:[function(_dereq_,module,exports){
-"use strict";var CircleBucket=_dereq_("./circle_bucket"),heatmapInterface={layoutAttributes:CircleBucket.programInterface.layoutAttributes,indexArrayType:CircleBucket.programInterface.indexArrayType,paintAttributes:[{property:"heatmap-weight"}]},HeatmapBucket=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(CircleBucket);HeatmapBucket.programInterface=heatmapInterface,module.exports=HeatmapBucket;
-},{"./circle_bucket":52}],56:[function(_dereq_,module,exports){
-"use strict";function addLineVertex(e,t,r,i,a,n,s){e.emplaceBack(t.x,t.y,i?1:0,a?1:-1,Math.round(EXTRUDE_SCALE*r.x)+128,Math.round(EXTRUDE_SCALE*r.y)+128,1+(0===n?0:n<0?-1:1)|(s*LINE_DISTANCE_SCALE&63)<<2,s*LINE_DISTANCE_SCALE>>6)}var ref=_dereq_("../segment"),SegmentVector=ref.SegmentVector,VertexBuffer=_dereq_("../../gl/vertex_buffer"),IndexBuffer=_dereq_("../../gl/index_buffer"),ref$1=_dereq_("../program_configuration"),ProgramConfigurationSet=ref$1.ProgramConfigurationSet,createVertexArrayType=_dereq_("../vertex_array_type"),ref$2=_dereq_("../index_array_type"),TriangleIndexArray=ref$2.TriangleIndexArray,loadGeometry=_dereq_("../load_geometry"),EXTENT=_dereq_("../extent"),vectorTileFeatureTypes=_dereq_("@mapbox/vector-tile").VectorTileFeature.types,EXTRUDE_SCALE=63,COS_HALF_SHARP_CORNER=Math.cos(Math.PI/180*37.5),SHARP_CORNER_OFFSET=15,LINE_DISTANCE_BUFFER_BITS=15,LINE_DISTANCE_SCALE=.5,MAX_LINE_DISTANCE=Math.pow(2,LINE_DISTANCE_BUFFER_BITS-1)/LINE_DISTANCE_SCALE,lineInterface={layoutAttributes:[{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],paintAttributes:[{property:"line-color"},{property:"line-blur"},{property:"line-opacity"},{property:"line-gap-width",name:"gapwidth"},{property:"line-offset"},{property:"line-width"},{property:"line-floorwidth"}],indexArrayType:TriangleIndexArray},LayoutVertexArrayType=createVertexArrayType(lineInterface.layoutAttributes),LineBucket=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.index=e.index,this.layoutVertexArray=new LayoutVertexArrayType(e.layoutVertexArray),this.indexArray=new TriangleIndexArray(e.indexArray),this.programConfigurations=new ProgramConfigurationSet(lineInterface,e.layers,e.zoom,e.programConfigurations),this.segments=new SegmentVector(e.segments)};LineBucket.prototype.populate=function(e,t){for(var r=this,i=0,a=e;i<a.length;i+=1){var n=a[i],s=n.feature,o=n.index,u=n.sourceLayerIndex;if(r.layers[0]._featureFilter({zoom:r.zoom},s)){var d=loadGeometry(s);r.addFeature(s,d),t.featureIndex.insert(s,d,o,u,r.index)}}},LineBucket.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},LineBucket.prototype.serialize=function(e){return{zoom:this.zoom,layerIds:this.layers.map(function(e){return e.id}),layoutVertexArray:this.layoutVertexArray.serialize(e),indexArray:this.indexArray.serialize(e),programConfigurations:this.programConfigurations.serialize(e),segments:this.segments.get()}},LineBucket.prototype.upload=function(e){this.layoutVertexBuffer=new VertexBuffer(e,this.layoutVertexArray),this.indexBuffer=new IndexBuffer(e,this.indexArray),this.programConfigurations.upload(e)},LineBucket.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},LineBucket.prototype.addFeature=function(e,t){for(var r=this,i=this.layers[0].layout,a=i.get("line-join").evaluate(e),n=i.get("line-cap"),s=i.get("line-miter-limit"),o=i.get("line-round-limit"),u=0,d=t;u<d.length;u+=1){var l=d[u];r.addLine(l,e,a,n,s,o)}},LineBucket.prototype.addLine=function(e,t,r,i,a,n){for(var s=this,o="Polygon"===vectorTileFeatureTypes[t.type],u=e.length;u>=2&&e[u-1].equals(e[u-2]);)u--;for(var d=0;d<u-1&&e[d].equals(e[d+1]);)d++;if(!(u<(o?3:2))){"bevel"===r&&(a=1.05);var l=SHARP_CORNER_OFFSET*(EXTENT/(512*this.overscaling)),y=e[d],h=this.segments.prepareSegment(10*u,this.layoutVertexArray,this.indexArray);this.distance=0;var p,c,f,x=i,m=o?"butt":i,g=!0,_=void 0,A=void 0,v=void 0,C=void 0;this.e1=this.e2=this.e3=-1,o&&(p=e[u-2],C=y.sub(p)._unit()._perp());for(var V=d;V<u;V++)if(!(A=o&&V===u-1?e[d+1]:e[V+1])||!e[V].equals(A)){C&&(v=C),p&&(_=p),p=e[V],C=A?A.sub(p)._unit()._perp():v,v=v||C;var L=v.add(C);0===L.x&&0===L.y||L._unit();var E=L.x*C.x+L.y*C.y,S=0!==E?1/E:1/0,I=E<COS_HALF_SHARP_CORNER&&_&&A;if(I&&V>d){var T=p.dist(_);if(T>2*l){var B=p.sub(p.sub(_)._mult(l/T)._round());s.distance+=B.dist(_),s.addCurrentVertex(B,s.distance,v.mult(1),0,0,!1,h),_=B}}var b=_&&A,N=b?r:A?x:m;if(b&&"round"===N&&(S<n?N="miter":S<=2&&(N="fakeround")),"miter"===N&&S>a&&(N="bevel"),"bevel"===N&&(S>2&&(N="flipbevel"),S<a&&(N="miter")),_&&(s.distance+=p.dist(_)),"miter"===N)L._mult(S),s.addCurrentVertex(p,s.distance,L,0,0,!1,h);else if("flipbevel"===N){if(S>100)L=C.clone().mult(-1);else{var k=v.x*C.y-v.y*C.x>0?-1:1,R=S*v.add(C).mag()/v.sub(C).mag();L._perp()._mult(R*k)}s.addCurrentVertex(p,s.distance,L,0,0,!1,h),s.addCurrentVertex(p,s.distance,L.mult(-1),0,0,!1,h)}else if("bevel"===N||"fakeround"===N){var F=v.x*C.y-v.y*C.x>0,q=-Math.sqrt(S*S-1);if(F?(f=0,c=q):(c=0,f=q),g||s.addCurrentVertex(p,s.distance,v,c,f,!1,h),"fakeround"===N){for(var P=Math.floor(8*(.5-(E-.5))),w=void 0,z=0;z<P;z++)w=C.mult((z+1)/(P+1))._add(v)._unit(),s.addPieSliceVertex(p,s.distance,w,F,h);s.addPieSliceVertex(p,s.distance,L,F,h);for(var D=P-1;D>=0;D--)w=v.mult((D+1)/(P+1))._add(C)._unit(),s.addPieSliceVertex(p,s.distance,w,F,h)}A&&s.addCurrentVertex(p,s.distance,C,-c,-f,!1,h)}else"butt"===N?(g||s.addCurrentVertex(p,s.distance,v,0,0,!1,h),A&&s.addCurrentVertex(p,s.distance,C,0,0,!1,h)):"square"===N?(g||(s.addCurrentVertex(p,s.distance,v,1,1,!1,h),s.e1=s.e2=-1),A&&s.addCurrentVertex(p,s.distance,C,-1,-1,!1,h)):"round"===N&&(g||(s.addCurrentVertex(p,s.distance,v,0,0,!1,h),s.addCurrentVertex(p,s.distance,v,1,1,!0,h),s.e1=s.e2=-1),A&&(s.addCurrentVertex(p,s.distance,C,-1,-1,!0,h),s.addCurrentVertex(p,s.distance,C,0,0,!1,h)));if(I&&V<u-1){var M=p.dist(A);if(M>2*l){var O=p.add(A.sub(p)._mult(l/M)._round());s.distance+=O.dist(p),s.addCurrentVertex(O,s.distance,C.mult(1),0,0,!1,h),p=O}}g=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t)}},LineBucket.prototype.addCurrentVertex=function(e,t,r,i,a,n,s){var o,u=this.layoutVertexArray,d=this.indexArray;o=r.clone(),i&&o._sub(r.perp()._mult(i)),addLineVertex(u,e,o,n,!1,i,t),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(d.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,o=r.mult(-1),a&&o._sub(r.perp()._mult(a)),addLineVertex(u,e,o,n,!0,-a,t),this.e3=s.vertexLength++,this.e1>=0&&this.e2>=0&&(d.emplaceBack(this.e1,this.e2,this.e3),s.primitiveLength++),this.e1=this.e2,this.e2=this.e3,t>MAX_LINE_DISTANCE/2&&(this.distance=0,this.addCurrentVertex(e,this.distance,r,i,a,n,s))},LineBucket.prototype.addPieSliceVertex=function(e,t,r,i,a){r=r.mult(i?-1:1);var n=this.layoutVertexArray,s=this.indexArray;addLineVertex(n,e,r,!1,i,0,t),this.e3=a.vertexLength++,this.e1>=0&&this.e2>=0&&(s.emplaceBack(this.e1,this.e2,this.e3),a.primitiveLength++),i?this.e2=this.e3:this.e1=this.e3},LineBucket.programInterface=lineInterface,module.exports=LineBucket;
-},{"../../gl/index_buffer":71,"../../gl/vertex_buffer":72,"../extent":58,"../index_array_type":60,"../load_geometry":61,"../program_configuration":63,"../segment":65,"../vertex_array_type":66,"@mapbox/vector-tile":6}],57:[function(_dereq_,module,exports){
-"use strict";function addVertex(e,t,r,i,o,a,n,s){e.emplaceBack(t,r,Math.round(64*i),Math.round(64*o),a,n,s?s[0]:void 0,s?s[1]:void 0)}function addDynamicAttributes(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}var Point=_dereq_("@mapbox/point-geometry"),ref=_dereq_("../segment"),SegmentVector=ref.SegmentVector,VertexBuffer=_dereq_("../../gl/vertex_buffer"),IndexBuffer=_dereq_("../../gl/index_buffer"),ref$1=_dereq_("../program_configuration"),ProgramConfigurationSet=ref$1.ProgramConfigurationSet,createVertexArrayType=_dereq_("../vertex_array_type"),ref$2=_dereq_("../index_array_type"),TriangleIndexArray=ref$2.TriangleIndexArray,LineIndexArray=ref$2.LineIndexArray,transformText=_dereq_("../../symbol/transform_text"),mergeLines=_dereq_("../../symbol/mergelines"),scriptDetection=_dereq_("../../util/script_detection"),loadGeometry=_dereq_("../load_geometry"),vectorTileFeatureTypes=_dereq_("@mapbox/vector-tile").VectorTileFeature.types,createStructArrayType=_dereq_("../../util/struct_array"),verticalizePunctuation=_dereq_("../../util/verticalize_punctuation"),Anchor=_dereq_("../../symbol/anchor"),OpacityState=_dereq_("../../symbol/opacity_state"),ref$3=_dereq_("../../symbol/symbol_size"),getSizeData=ref$3.getSizeData,PlacedSymbolArray=createStructArrayType({members:[{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:"hidden"}]}),GlyphOffsetArray=createStructArrayType({members:[{type:"Float32",name:"offsetX"}]}),LineVertexArray=createStructArrayType({members:[{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]}),layoutAttributes=[{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}],dynamicLayoutAttributes=[{name:"a_projected_pos",components:3,type:"Float32"}],placementOpacityAttributes=[{name:"a_fade_opacity",components:1,type:"Uint32"}],shaderOpacityAttributes=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}],collisionAttributes=[{name:"a_placed",components:2,type:"Uint8"}],symbolInterfaces={text:{layoutAttributes:layoutAttributes,dynamicLayoutAttributes:dynamicLayoutAttributes,indexArrayType:TriangleIndexArray,opacityAttributes:placementOpacityAttributes,paintAttributes:[{property:"text-color",name:"fill_color"},{property:"text-halo-color",name:"halo_color"},{property:"text-halo-width",name:"halo_width"},{property:"text-halo-blur",name:"halo_blur"},{property:"text-opacity",name:"opacity"}]},icon:{layoutAttributes:layoutAttributes,dynamicLayoutAttributes:dynamicLayoutAttributes,indexArrayType:TriangleIndexArray,opacityAttributes:placementOpacityAttributes,paintAttributes:[{property:"icon-color",name:"fill_color"},{property:"icon-halo-color",name:"halo_color"},{property:"icon-halo-width",name:"halo_width"},{property:"icon-halo-blur",name:"halo_blur"},{property:"icon-opacity",name:"opacity"}]},collisionBox:{layoutAttributes:[{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],indexArrayType:LineIndexArray,collisionAttributes:collisionAttributes},collisionCircle:{layoutAttributes:[{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],collisionAttributes:collisionAttributes,indexArrayType:TriangleIndexArray}},SymbolBuffers=function(e,t,r,i){this.programInterface=e;var o=createVertexArrayType(e.layoutAttributes),a=e.indexArrayType;if(this.layoutVertexArray=new o(i&&i.layoutVertexArray),this.indexArray=new a(i&&i.indexArray),this.programConfigurations=new ProgramConfigurationSet(e,t,r,i&&i.programConfigurations),this.segments=new SegmentVector(i&&i.segments),e.dynamicLayoutAttributes){var n=createVertexArrayType(e.dynamicLayoutAttributes);this.dynamicLayoutVertexArray=new n(i&&i.dynamicLayoutVertexArray)}if(e.opacityAttributes){var s=createVertexArrayType(e.opacityAttributes);this.opacityVertexArray=new s(i&&i.opacityVertexArray)}if(e.collisionAttributes){var l=createVertexArrayType(e.collisionAttributes);this.collisionVertexArray=new l(i&&i.collisionVertexArray)}};SymbolBuffers.prototype.serialize=function(e){return{layoutVertexArray:this.layoutVertexArray.serialize(e),indexArray:this.indexArray.serialize(e),programConfigurations:this.programConfigurations.serialize(e),segments:this.segments.get(),dynamicLayoutVertexArray:this.dynamicLayoutVertexArray&&this.dynamicLayoutVertexArray.serialize(e),opacityVertexArray:this.opacityVertexArray&&this.opacityVertexArray.serialize(e),collisionVertexArray:this.collisionVertexArray&&this.collisionVertexArray.serialize(e)}},SymbolBuffers.prototype.upload=function(e,t){this.layoutVertexBuffer=new VertexBuffer(e,this.layoutVertexArray),this.indexBuffer=new IndexBuffer(e,this.indexArray,t),this.programConfigurations.upload(e),this.programInterface.dynamicLayoutAttributes&&(this.dynamicLayoutVertexBuffer=new VertexBuffer(e,this.dynamicLayoutVertexArray,!0)),this.programInterface.opacityAttributes&&(this.opacityVertexBuffer=new VertexBuffer(e,this.opacityVertexArray,!0),this.opacityVertexBuffer.itemSize=1,this.opacityVertexBuffer.attributes=shaderOpacityAttributes),this.programInterface.collisionAttributes&&(this.collisionVertexBuffer=new VertexBuffer(e,this.collisionVertexArray,!0))},SymbolBuffers.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer&&this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer&&this.opacityVertexBuffer.destroy(),this.collisionVertexBuffer&&this.collisionVertexBuffer.destroy())};var SymbolBucket=function(e){if(this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.index=e.index,this.sdfIcons=e.sdfIcons,this.iconsNeedLinear=e.iconsNeedLinear,this.pixelRatio=e.pixelRatio,e.text){this.text=new SymbolBuffers(symbolInterfaces.text,e.layers,e.zoom,e.text),this.icon=new SymbolBuffers(symbolInterfaces.icon,e.layers,e.zoom,e.icon),this.collisionBox=new SymbolBuffers(symbolInterfaces.collisionBox,e.layers,e.zoom,e.collisionBox),this.collisionCircle=new SymbolBuffers(symbolInterfaces.collisionCircle,e.layers,e.zoom,e.collisionCircle),this.textSizeData=e.textSizeData,this.iconSizeData=e.iconSizeData,this.placedGlyphArray=new PlacedSymbolArray(e.placedGlyphArray),this.placedIconArray=new PlacedSymbolArray(e.placedIconArray),this.glyphOffsetArray=new GlyphOffsetArray(e.glyphOffsetArray),this.lineVertexArray=new LineVertexArray(e.lineVertexArray),this.symbolInstances=e.symbolInstances;var t=e.layers[0].layout;this.sortFeaturesByY=t.get("text-allow-overlap")||t.get("icon-allow-overlap")||t.get("text-ignore-placement")||t.get("icon-ignore-placement")}else{var r=this.layers[0],i=r._unevaluatedLayout._values;if(this.textSizeData=getSizeData(this.zoom,i["text-size"]),"composite"===this.textSizeData.functionType){var o=this.textSizeData.zoomRange,a=o.min,n=o.max;this.compositeTextSizes=[i["text-size"].possiblyEvaluate({zoom:a}),i["text-size"].possiblyEvaluate({zoom:n})]}if(this.iconSizeData=getSizeData(this.zoom,i["icon-size"]),"composite"===this.iconSizeData.functionType){var s=this.iconSizeData.zoomRange,l=s.min,y=s.max;this.compositeIconSizes=[i["icon-size"].possiblyEvaluate({zoom:l}),i["icon-size"].possiblyEvaluate({zoom:y})]}this.layoutTextSize=i["text-size"].possiblyEvaluate({zoom:this.zoom+1}),this.layoutIconSize=i["icon-size"].possiblyEvaluate({zoom:this.zoom+1}),this.textMaxSize=i["text-size"].possiblyEvaluate({zoom:18})}};SymbolBucket.prototype.createArrays=function(){this.text=new SymbolBuffers(symbolInterfaces.text,this.layers,this.zoom),this.icon=new SymbolBuffers(symbolInterfaces.icon,this.layers,this.zoom),this.collisionBox=new SymbolBuffers(symbolInterfaces.collisionBox,this.layers,this.zoom),this.collisionCircle=new SymbolBuffers(symbolInterfaces.collisionCircle,this.layers,this.zoom),this.placedGlyphArray=new PlacedSymbolArray,this.placedIconArray=new PlacedSymbolArray,this.glyphOffsetArray=new GlyphOffsetArray,this.lineVertexArray=new LineVertexArray},SymbolBucket.prototype.populate=function(e,t){var r=this,i=this.layers[0],o=i.layout,a=o.get("text-font").join(","),n=o.get("text-field"),s=o.get("icon-image"),l="constant"!==n.value.kind||n.value.value.length>0&&a.length>0,y="constant"!==s.value.kind||s.value.value&&s.value.value.length>0;if(this.features=[],l||y){for(var c=t.iconDependencies,u=t.glyphDependencies,p=u[a]=u[a]||{},x={zoom:this.zoom},m=0,h=e;m<h.length;m+=1){var d=h[m],f=d.feature,A=d.index,g=d.sourceLayerIndex;if(i._featureFilter(x,f)){var b=void 0;l&&(b=i.getValueAndResolveTokens("text-field",f),b=transformText(b,i,f));var B=void 0;if(y&&(B=i.getValueAndResolveTokens("icon-image",f)),b||B){var v={text:b,icon:B,index:A,sourceLayerIndex:g,geometry:loadGeometry(f),properties:f.properties,type:vectorTileFeatureTypes[f.type]};if(void 0!==f.id&&(v.id=f.id),r.features.push(v),B&&(c[B]=!0),b)for(var S="map"===o.get("text-rotation-alignment")&&"line"===o.get("symbol-placement"),z=scriptDetection.allowsVerticalWritingMode(b),V=0;V<b.length;V++)if(p[b.charCodeAt(V)]=!0,S&&z){var I=verticalizePunctuation.lookup[b.charAt(V)];I&&(p[I.charCodeAt(0)]=!0)}}}}"line"===o.get("symbol-placement")&&(this.features=mergeLines(this.features))}},SymbolBucket.prototype.isEmpty=function(){return 0===this.symbolInstances.length},SymbolBucket.prototype.serialize=function(e){return{zoom:this.zoom,layerIds:this.layers.map(function(e){return e.id}),sdfIcons:this.sdfIcons,iconsNeedLinear:this.iconsNeedLinear,textSizeData:this.textSizeData,iconSizeData:this.iconSizeData,placedGlyphArray:this.placedGlyphArray.serialize(e),placedIconArray:this.placedIconArray.serialize(e),glyphOffsetArray:this.glyphOffsetArray.serialize(e),lineVertexArray:this.lineVertexArray.serialize(e),text:this.text.serialize(e),icon:this.icon.serialize(e),collisionBox:this.collisionBox.serialize(e),collisionCircle:this.collisionCircle.serialize(e),symbolInstances:this.symbolInstances}},SymbolBucket.prototype.upload=function(e){this.text.upload(e,this.sortFeaturesByY),this.icon.upload(e,this.sortFeaturesByY),this.collisionBox.upload(e),this.collisionCircle.upload(e)},SymbolBucket.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()},SymbolBucket.prototype.addToLineVertexArray=function(e,t){var r=this,i=this.lineVertexArray.length;if(void 0!==e.segment){for(var o=e.dist(t[e.segment+1]),a=e.dist(t[e.segment]),n={},s=e.segment+1;s<t.length;s++)n[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:o},s<t.length-1&&(o+=t[s+1].dist(t[s]));for(var l=e.segment||0;l>=0;l--)n[l]={x:t[l].x,y:t[l].y,tileUnitDistanceFromAnchor:a},l>0&&(a+=t[l-1].dist(t[l]));for(var y=0;y<t.length;y++){var c=n[y];r.lineVertexArray.emplaceBack(c.x,c.y,c.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}},SymbolBucket.prototype.addSymbols=function(e,t,r,i,o,a,n,s,l,y,c){for(var u=this,p=e.indexArray,x=e.layoutVertexArray,m=e.dynamicLayoutVertexArray,h=e.segments.prepareSegment(4*t.length,e.layoutVertexArray,e.indexArray),d=this.glyphOffsetArray.length,f=h.vertexLength,A=0,g=t;A<g.length;A+=1){var b=g[A],B=b.tl,v=b.tr,S=b.bl,z=b.br,V=b.tex,I=h.vertexLength,_=b.glyphOffset[1];addVertex(x,s.x,s.y,B.x,_+B.y,V.x,V.y,r),addVertex(x,s.x,s.y,v.x,_+v.y,V.x+V.w,V.y,r),addVertex(x,s.x,s.y,S.x,_+S.y,V.x,V.y+V.h,r),addVertex(x,s.x,s.y,z.x,_+z.y,V.x+V.w,V.y+V.h,r),addDynamicAttributes(m,s,0),p.emplaceBack(I,I+1,I+2),p.emplaceBack(I+1,I+2,I+3),h.vertexLength+=4,h.primitiveLength+=2,u.glyphOffsetArray.emplaceBack(b.glyphOffset[0])}c.emplaceBack(s.x,s.y,d,this.glyphOffsetArray.length-d,f,l,y,s.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],n,!1),e.programConfigurations.populatePaintArrays(e.layoutVertexArray.length,a)},SymbolBucket.prototype._addCollisionDebugVertex=function(e,t,r,i,o){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,i.x,i.y,Math.round(o.x),Math.round(o.y))},SymbolBucket.prototype.addCollisionDebugVertices=function(e,t,r,i,o,a,n,s){var l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),y=l.vertexLength,c=o.layoutVertexArray,u=o.indexArray,p=o.collisionVertexArray;this._addCollisionDebugVertex(c,p,a,n.anchor,new Point(e,t)),this._addCollisionDebugVertex(c,p,a,n.anchor,new Point(r,t)),this._addCollisionDebugVertex(c,p,a,n.anchor,new Point(r,i)),this._addCollisionDebugVertex(c,p,a,n.anchor,new Point(e,i)),l.vertexLength+=4,s?(u.emplaceBack(y,y+1,y+2),u.emplaceBack(y,y+2,y+3),l.primitiveLength+=2):(u.emplaceBack(y,y+1),u.emplaceBack(y+1,y+2),u.emplaceBack(y+2,y+3),u.emplaceBack(y+3,y),l.primitiveLength+=4)},SymbolBucket.prototype.generateCollisionDebugBuffers=function(){for(var e=this,t=0,r=e.symbolInstances;t<r.length;t+=1){var i=r[t];i.textCollisionFeature={boxStartIndex:i.textBoxStartIndex,boxEndIndex:i.textBoxEndIndex},i.iconCollisionFeature={boxStartIndex:i.iconBoxStartIndex,boxEndIndex:i.iconBoxEndIndex};for(var o=0;o<2;o++){var a=i[0===o?"textCollisionFeature":"iconCollisionFeature"];if(a)for(var n=a.boxStartIndex;n<a.boxEndIndex;n++){var s=e.collisionBoxArray.get(n),l=s.x1,y=s.y1,c=s.x2,u=s.y2,p=s.radius>0;e.addCollisionDebugVertices(l,y,c,u,p?e.collisionCircle:e.collisionBox,s.anchorPoint,i,p)}}}},SymbolBucket.prototype.deserializeCollisionBoxes=function(e,t,r,i,o){for(var a={},n=t;n<r;n++){var s=e.get(n);if(0===s.radius){a.textBox={x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,anchorPointX:s.anchorPointX,anchorPointY:s.anchorPointY};break}a.textCircles||(a.textCircles=[]);a.textCircles.push(s.anchorPointX,s.anchorPointY,s.radius,s.signedDistanceFromAnchor,1)}for(var l=i;l<o;l++){var y=e.get(l);if(0===y.radius){a.iconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY};break}}return a},SymbolBucket.prototype.sortFeatures=function(e){var t=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&(this.sortedAngle=e,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var r=[],i=0;i<this.symbolInstances.length;i++)r.push(i);var o=Math.sin(e),a=Math.cos(e);r.sort(function(e,r){var i=t.symbolInstances[e],n=t.symbolInstances[r];return(o*i.anchor.x+a*i.anchor.y|0)-(o*n.anchor.x+a*n.anchor.y|0)||n.featureIndex-i.featureIndex}),this.text.indexArray.clear(),this.icon.indexArray.clear();for(var n=0,s=r;n<s.length;n+=1){for(var l=s[n],y=t.symbolInstances[l],c=0,u=y.placedTextSymbolIndices;c<u.length;c+=1)for(var p=u[c],x=t.placedGlyphArray.get(p),m=x.vertexStartIndex+4*x.numGlyphs,h=x.vertexStartIndex;h<m;h+=4)t.text.indexArray.emplaceBack(h,h+1,h+2),t.text.indexArray.emplaceBack(h+1,h+2,h+3);var d=t.placedIconArray.get(l);if(d.numGlyphs){var f=d.vertexStartIndex;t.icon.indexArray.emplaceBack(f,f+1,f+2),t.icon.indexArray.emplaceBack(f+1,f+2,f+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray.serialize()),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray.serialize())}},SymbolBucket.programInterfaces=symbolInterfaces,SymbolBucket.MAX_GLYPHS=65535,SymbolBucket.addDynamicAttributes=addDynamicAttributes,module.exports=SymbolBucket;
-},{"../../gl/index_buffer":71,"../../gl/vertex_buffer":72,"../../symbol/anchor":205,"../../symbol/mergelines":214,"../../symbol/opacity_state":215,"../../symbol/symbol_size":221,"../../symbol/transform_text":222,"../../util/script_detection":261,"../../util/struct_array":263,"../../util/verticalize_punctuation":268,"../index_array_type":60,"../load_geometry":61,"../program_configuration":63,"../segment":65,"../vertex_array_type":66,"@mapbox/point-geometry":2,"@mapbox/vector-tile":6}],58:[function(_dereq_,module,exports){
-"use strict";module.exports=8192;
-},{}],59:[function(_dereq_,module,exports){
-"use strict";function topDownFeatureComparator(e,r){return r-e}var Point=_dereq_("@mapbox/point-geometry"),loadGeometry=_dereq_("./load_geometry"),EXTENT=_dereq_("./extent"),featureFilter=_dereq_("../style-spec/feature_filter"),createStructArrayType=_dereq_("../util/struct_array"),Grid=_dereq_("grid-index"),DictionaryCoder=_dereq_("../util/dictionary_coder"),vt=_dereq_("@mapbox/vector-tile"),Protobuf=_dereq_("pbf"),GeoJSONFeature=_dereq_("../util/vectortile_to_geojson"),arraysIntersect=_dereq_("../util/util").arraysIntersect,TileCoord=_dereq_("../source/tile_coord"),FeatureIndexArray=createStructArrayType({members:[{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]}),FeatureIndex=function(e,r,t,a){this.coord=e,this.overscaling=r,this.x=e.x,this.y=e.y,this.z=e.z-Math.log(r)/Math.LN2,this.grid=t||new Grid(EXTENT,16,0),this.featureIndexArray=a||new FeatureIndexArray};FeatureIndex.deserialize=function(e,r){var t=e.coord,a=new FeatureIndex(new TileCoord(t.z,t.x,t.y,t.w),e.overscaling,new Grid(e.grid),new FeatureIndexArray(e.featureIndexArray));return a.rawTileData=r,a.bucketLayerIDs=e.bucketLayerIDs,a},FeatureIndex.prototype.insert=function(e,r,t,a,i){var o=this,n=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(t,a,i);for(var s=0;s<r.length;s++){for(var u=r[s],y=[1/0,1/0,-1/0,-1/0],d=0;d<u.length;d++){var l=u[d];y[0]=Math.min(y[0],l.x),y[1]=Math.min(y[1],l.y),y[2]=Math.max(y[2],l.x),y[3]=Math.max(y[3],l.y)}o.grid.insert(n,y[0],y[1],y[2],y[3])}},FeatureIndex.prototype.setCollisionIndex=function(e){this.collisionIndex=e},FeatureIndex.prototype.serialize=function(e){var r=this.grid.toArrayBuffer();return e&&e.push(r),{coord:this.coord,overscaling:this.overscaling,grid:r,featureIndexArray:this.featureIndexArray.serialize(e),bucketLayerIDs:this.bucketLayerIDs}},FeatureIndex.prototype.query=function(e,r){this.vtLayers||(this.vtLayers=new vt.VectorTile(new Protobuf(this.rawTileData)).layers,this.sourceLayerCoder=new DictionaryCoder(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]));for(var t={},a=e.params||{},i=EXTENT/e.tileSize/e.scale,o=featureFilter(a.filter),n=e.queryGeometry,s=e.additionalRadius*i,u=1/0,y=1/0,d=-1/0,l=-1/0,c=0;c<n.length;c++)for(var h=n[c],x=0;x<h.length;x++){var f=h[x];u=Math.min(u,f.x),y=Math.min(y,f.y),d=Math.max(d,f.x),l=Math.max(l,f.y)}var I=this.grid.query(u-s,y-s,d+s,l+s);I.sort(topDownFeatureComparator),this.filterMatching(t,I,this.featureIndexArray,n,o,a.layers,r,e.bearing,i);var v=this.collisionIndex?this.collisionIndex.queryRenderedSymbols(n,this.coord,e.tileSourceMaxZoom,EXTENT/e.tileSize,e.collisionBoxArray,e.sourceID):[];return v.sort(),this.filterMatching(t,v,e.collisionBoxArray,n,o,a.layers,r,e.bearing,i),t},FeatureIndex.prototype.filterMatching=function(e,r,t,a,i,o,n,s,u){for(var y,d=this,l=0;l<r.length;l++){var c=r[l];if(c!==y){y=c;var h=t.get(c),x=d.bucketLayerIDs[h.bucketIndex];if(!o||arraysIntersect(o,x)){var f=d.sourceLayerCoder.decode(h.sourceLayerIndex),I=d.vtLayers[f],v=I.feature(h.featureIndex);if(i({zoom:d.coord.z},v))for(var p=null,g=0;g<x.length;g++){var m=x[g];if(!(o&&o.indexOf(m)<0)){var F=n[m];if(F&&("symbol"===F.type||(p||(p=loadGeometry(v)),F.queryIntersectsFeature(a,v,p,d.z,s,u)))){var b=new GeoJSONFeature(v,d.z,d.x,d.y);b.layer=F.serialize();var L=e[m];void 0===L&&(L=e[m]=[]),L.push({featureIndex:c,feature:b})}}}}}}},FeatureIndex.prototype.hasLayer=function(e){for(var r=this,t=0,a=r.bucketLayerIDs;t<a.length;t+=1)for(var i=a[t],o=0,n=i;o<n.length;o+=1){var s=n[o];if(e===s)return!0}return!1},module.exports=FeatureIndex;
-},{"../source/tile_coord":112,"../style-spec/feature_filter":145,"../util/dictionary_coder":250,"../util/struct_array":263,"../util/util":266,"../util/vectortile_to_geojson":267,"./extent":58,"./load_geometry":61,"@mapbox/point-geometry":2,"@mapbox/vector-tile":6,"grid-index":23,"pbf":38}],60:[function(_dereq_,module,exports){
-"use strict";function createIndexArrayType(e){return createStructArrayType({members:[{type:"Uint16",name:"vertices",components:e}]})}var createStructArrayType=_dereq_("../util/struct_array");module.exports={LineIndexArray:createIndexArrayType(2),TriangleIndexArray:createIndexArrayType(3)};
-},{"../util/struct_array":263}],61:[function(_dereq_,module,exports){
-"use strict";function createBounds(e){return{min:-1*Math.pow(2,e-1),max:Math.pow(2,e-1)-1}}var util=_dereq_("../util/util"),EXTENT=_dereq_("./extent"),bounds=createBounds(16);module.exports=function(e){for(var t=EXTENT/e.extent,r=e.loadGeometry(),n=0;n<r.length;n++)for(var u=r[n],o=0;o<u.length;o++){var a=u[o];a.x=Math.round(a.x*t),a.y=Math.round(a.y*t),(a.x<bounds.min||a.x>bounds.max||a.y<bounds.min||a.y>bounds.max)&&util.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r};
-},{"../util/util":266,"./extent":58}],62:[function(_dereq_,module,exports){
-"use strict";var createStructArrayType=_dereq_("../util/struct_array"),PosArray=createStructArrayType({members:[{name:"a_pos",type:"Int16",components:2}]});module.exports=PosArray;
-},{"../util/struct_array":263}],63:[function(_dereq_,module,exports){
-"use strict";function packColor(r){return[packUint8ToFloat(255*r.r,255*r.g),packUint8ToFloat(255*r.b,255*r.a)]}var createVertexArrayType=_dereq_("./vertex_array_type"),packUint8ToFloat=_dereq_("../shaders/encode_attribute").packUint8ToFloat,VertexBuffer=_dereq_("../gl/vertex_buffer"),Color=_dereq_("../style-spec/util/color"),ConstantBinder=function(r,t,o,e){this.value=r,this.name=t,this.type=o,this.property=e,this.statistics={max:-1/0}};ConstantBinder.prototype.defines=function(){return["#define HAS_UNIFORM_u_"+this.name]},ConstantBinder.prototype.populatePaintArray=function(){},ConstantBinder.prototype.setUniforms=function(r,t,o,e){var i=e.constantOr(this.value);"color"===this.type?r.uniform4f(t.uniforms["u_"+this.name],i.r,i.g,i.b,i.a):r.uniform1f(t.uniforms["u_"+this.name],i)};var SourceExpressionBinder=function(r,t,o,e){this.expression=r,this.name=t,this.type=o,this.property=e,this.statistics={max:-1/0}};SourceExpressionBinder.prototype.defines=function(){return[]},SourceExpressionBinder.prototype.populatePaintArray=function(r,t,o,e){var i=this,n=this.expression.evaluate({zoom:0},e);if("color"===this.type)for(var a=packColor(n),s=t;s<o;s++){var p=r.get(s);p["a_"+i.name+"0"]=a[0],p["a_"+i.name+"1"]=a[1]}else{for(var u=t;u<o;u++){r.get(u)["a_"+i.name]=n}this.statistics.max=Math.max(this.statistics.max,n)}},SourceExpressionBinder.prototype.setUniforms=function(r,t){r.uniform1f(t.uniforms["a_"+this.name+"_t"],0)};var CompositeExpressionBinder=function(r,t,o,e,i,n){this.expression=r,this.name=t,this.type=o,this.property=e,this.useIntegerZoom=i,this.zoom=n,this.statistics={max:-1/0}};CompositeExpressionBinder.prototype.defines=function(){return[]},CompositeExpressionBinder.prototype.populatePaintArray=function(r,t,o,e){var i=this,n=this.expression.evaluate({zoom:this.zoom},e),a=this.expression.evaluate({zoom:this.zoom+1},e);if("color"===this.type)for(var s=packColor(n),p=packColor(a),u=t;u<o;u++){var f=r.get(u);f["a_"+i.name+"0"]=s[0],f["a_"+i.name+"1"]=s[1],f["a_"+i.name+"2"]=p[0],f["a_"+i.name+"3"]=p[1]}else{for(var c=t;c<o;c++){var m=r.get(c);m["a_"+i.name+"0"]=n,m["a_"+i.name+"1"]=a}this.statistics.max=Math.max(this.statistics.max,n,a)}},CompositeExpressionBinder.prototype.interpolationFactor=function(r){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(r),this.zoom,this.zoom+1):this.expression.interpolationFactor(r,this.zoom,this.zoom+1)},CompositeExpressionBinder.prototype.setUniforms=function(r,t,o){r.uniform1f(t.uniforms["a_"+this.name+"_t"],this.interpolationFactor(o.zoom))};var ProgramConfiguration=function(){this.binders={},this.cacheKey=""};ProgramConfiguration.createDynamic=function(r,t,o){for(var e=new ProgramConfiguration,i=[],n=0,a=r.paintAttributes||[];n<a.length;n+=1){var s=a[n],p=s.property,u=s.name||p.replace(t.type+"-","").replace(/-/g,"_"),f=t.paint.get(p),c=f.property.specification.type,m=f.property.useIntegerZoom;"constant"===f.value.kind?(e.binders[u]=new ConstantBinder(f.value,u,c,p),e.cacheKey+="/u_"+u):"source"===f.value.kind?(e.binders[u]=new SourceExpressionBinder(f.value,u,c,p),e.cacheKey+="/a_"+u,i.push({name:"a_"+u,type:"Float32",components:"color"===c?2:1})):(e.binders[u]=new CompositeExpressionBinder(f.value,u,c,p,m,o),e.cacheKey+="/z_"+u,i.push({name:"a_"+u,type:"Float32",components:"color"===c?4:2}))}return e.PaintVertexArray=createVertexArrayType(i),e.interface=r,e.layer=t,e},ProgramConfiguration.forBackgroundColor=function(r,t){var o=new ProgramConfiguration;return o.binders.color=new ConstantBinder(r,"color","color","background-color"),o.cacheKey+="/u_color",o.binders.opacity=new ConstantBinder(t,"opacity","number","background-opacity"),o.cacheKey+="/u_opacity",o},ProgramConfiguration.forBackgroundPattern=function(r){var t=new ProgramConfiguration;return t.binders.opacity=new ConstantBinder(r,"opacity","number","background-opacity"),t.cacheKey+="/u_opacity",t},ProgramConfiguration.forTileClippingMask=function(){return ProgramConfiguration.forBackgroundColor(Color.black,1)},ProgramConfiguration.prototype.populatePaintArray=function(r,t){var o=this,e=this.paintVertexArray;if(0!==e.bytesPerElement){var i=e.length;e.resize(r);for(var n in o.binders)o.binders[n].populatePaintArray(e,i,r,t)}},ProgramConfiguration.prototype.defines=function(){var r=this,t=[];for(var o in r.binders)t.push.apply(t,r.binders[o].defines());return t},ProgramConfiguration.prototype.setUniforms=function(r,t,o,e){var i=this;for(var n in i.binders){var a=i.binders[n];a.setUniforms(r,t,e,o.get(a.property))}},ProgramConfiguration.prototype.serialize=function(r){var t=this;if(0===this.paintVertexArray.length)return null;var o={};for(var e in t.binders)o[t.binders[e].property]=t.binders[e].statistics;return{array:this.paintVertexArray.serialize(r),type:this.paintVertexArray.constructor.serialize(),statistics:o}},ProgramConfiguration.deserialize=function(r,t,o,e){var i=ProgramConfiguration.createDynamic(r,t,o);return e&&(i.PaintVertexArray=createVertexArrayType(e.type.members),i.paintVertexArray=new i.PaintVertexArray(e.array),i.paintPropertyStatistics=e.statistics),i},ProgramConfiguration.prototype.upload=function(r){this.paintVertexArray&&(this.paintVertexBuffer=new VertexBuffer(r,this.paintVertexArray))},ProgramConfiguration.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var ProgramConfigurationSet=function(r,t,o,e){var i=this;if(this.programConfigurations={},e)for(var n=0,a=t;n<a.length;n+=1){var s=a[n];i.programConfigurations[s.id]=ProgramConfiguration.deserialize(r,s,o,e[s.id])}else for(var p=0,u=t;p<u.length;p+=1){var f=u[p],c=ProgramConfiguration.createDynamic(r,f,o);c.paintVertexArray=new c.PaintVertexArray,i.programConfigurations[f.id]=c}};ProgramConfigurationSet.prototype.populatePaintArrays=function(r,t){var o=this;for(var e in o.programConfigurations)o.programConfigurations[e].populatePaintArray(r,t)},ProgramConfigurationSet.prototype.serialize=function(r){var t=this,o={};for(var e in t.programConfigurations){var i=t.programConfigurations[e].serialize(r);i&&(o[e]=i)}return o},ProgramConfigurationSet.prototype.get=function(r){return this.programConfigurations[r]},ProgramConfigurationSet.prototype.upload=function(r){var t=this;for(var o in t.programConfigurations)t.programConfigurations[o].upload(r)},ProgramConfigurationSet.prototype.destroy=function(){var r=this;for(var t in r.programConfigurations)r.programConfigurations[t].destroy()},module.exports={ProgramConfiguration:ProgramConfiguration,ProgramConfigurationSet:ProgramConfigurationSet};
-},{"../gl/vertex_buffer":72,"../shaders/encode_attribute":96,"../style-spec/util/color":150,"./vertex_array_type":66}],64:[function(_dereq_,module,exports){
-"use strict";var createStructArrayType=_dereq_("../util/struct_array"),RasterBoundsArray=createStructArrayType({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]});module.exports=RasterBoundsArray;
-},{"../util/struct_array":263}],65:[function(_dereq_,module,exports){
-"use strict";var ref=_dereq_("../util/util"),warnOnce=ref.warnOnce,MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,SegmentVector=function(e){void 0===e&&(e=[]),this.segments=e};SegmentVector.prototype.prepareSegment=function(e,t,r){var n=this.segments[this.segments.length-1];return e>MAX_VERTEX_ARRAY_LENGTH&&warnOnce("Max vertices per segment is "+MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!n||n.vertexLength+e>module.exports.MAX_VERTEX_ARRAY_LENGTH)&&(n={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},this.segments.push(n)),n},SegmentVector.prototype.get=function(){return this.segments},SegmentVector.prototype.destroy=function(){for(var e=this,t=0,r=e.segments;t<r.length;t+=1){var n=r[t];for(var s in n.vaos)n.vaos[s].destroy()}},module.exports={SegmentVector:SegmentVector,MAX_VERTEX_ARRAY_LENGTH:MAX_VERTEX_ARRAY_LENGTH};
-},{"../util/util":266}],66:[function(_dereq_,module,exports){
-"use strict";function createVertexArrayType(r){return createStructArrayType({members:r,alignment:4})}var createStructArrayType=_dereq_("../util/struct_array");module.exports=createVertexArrayType;
-},{"../util/struct_array":263}],67:[function(_dereq_,module,exports){
-"use strict";var Coordinate=function(o,t,n){this.column=o,this.row=t,this.zoom=n};Coordinate.prototype.clone=function(){return new Coordinate(this.column,this.row,this.zoom)},Coordinate.prototype.zoomTo=function(o){return this.clone()._zoomTo(o)},Coordinate.prototype.sub=function(o){return this.clone()._sub(o)},Coordinate.prototype._zoomTo=function(o){var t=Math.pow(2,o-this.zoom);return this.column*=t,this.row*=t,this.zoom=o,this},Coordinate.prototype._sub=function(o){return o=o.zoomTo(this.zoom),this.column-=o.column,this.row-=o.row,this},module.exports=Coordinate;
-},{}],68:[function(_dereq_,module,exports){
-"use strict";var wrap=_dereq_("../util/util").wrap,LngLat=function(t,n){if(isNaN(t)||isNaN(n))throw new Error("Invalid LngLat object: ("+t+", "+n+")");if(this.lng=+t,this.lat=+n,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};LngLat.prototype.wrap=function(){return new LngLat(wrap(this.lng,-180,180),this.lat)},LngLat.prototype.toArray=function(){return[this.lng,this.lat]},LngLat.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},LngLat.prototype.toBounds=function(t){var n=360*t/40075017,r=n/Math.cos(Math.PI/180*this.lat);return new(_dereq_("./lng_lat_bounds"))(new LngLat(this.lng-r,this.lat-n),new LngLat(this.lng+r,this.lat+n))},LngLat.convert=function(t){if(t instanceof LngLat)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new LngLat(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new LngLat(Number(t.lng),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")},module.exports=LngLat;
-},{"../util/util":266,"./lng_lat_bounds":69}],69:[function(_dereq_,module,exports){
-"use strict";var LngLat=_dereq_("./lng_lat"),LngLatBounds=function(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};LngLatBounds.prototype.setNorthEast=function(t){return this._ne=t instanceof LngLat?new LngLat(t.lng,t.lat):LngLat.convert(t),this},LngLatBounds.prototype.setSouthWest=function(t){return this._sw=t instanceof LngLat?new LngLat(t.lng,t.lat):LngLat.convert(t),this},LngLatBounds.prototype.extend=function(t){var n,e,s=this._sw,o=this._ne;if(t instanceof LngLat)n=t,e=t;else{if(!(t instanceof LngLatBounds))return Array.isArray(t)?t.every(Array.isArray)?this.extend(LngLatBounds.convert(t)):this.extend(LngLat.convert(t)):this;if(n=t._sw,e=t._ne,!n||!e)return this}return s||o?(s.lng=Math.min(n.lng,s.lng),s.lat=Math.min(n.lat,s.lat),o.lng=Math.max(e.lng,o.lng),o.lat=Math.max(e.lat,o.lat)):(this._sw=new LngLat(n.lng,n.lat),this._ne=new LngLat(e.lng,e.lat)),this},LngLatBounds.prototype.getCenter=function(){return new LngLat((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},LngLatBounds.prototype.getSouthWest=function(){return this._sw},LngLatBounds.prototype.getNorthEast=function(){return this._ne},LngLatBounds.prototype.getNorthWest=function(){return new LngLat(this.getWest(),this.getNorth())},LngLatBounds.prototype.getSouthEast=function(){return new LngLat(this.getEast(),this.getSouth())},LngLatBounds.prototype.getWest=function(){return this._sw.lng},LngLatBounds.prototype.getSouth=function(){return this._sw.lat},LngLatBounds.prototype.getEast=function(){return this._ne.lng},LngLatBounds.prototype.getNorth=function(){return this._ne.lat},LngLatBounds.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},LngLatBounds.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},LngLatBounds.convert=function(t){return!t||t instanceof LngLatBounds?t:new LngLatBounds(t)},module.exports=LngLatBounds;
-},{"./lng_lat":68}],70:[function(_dereq_,module,exports){
-"use strict";var LngLat=_dereq_("./lng_lat"),Point=_dereq_("@mapbox/point-geometry"),Coordinate=_dereq_("./coordinate"),util=_dereq_("../util/util"),interp=_dereq_("../style-spec/util/interpolate").number,TileCoord=_dereq_("../source/tile_coord"),EXTENT=_dereq_("../data/extent"),glmatrix=_dereq_("@mapbox/gl-matrix"),vec4=glmatrix.vec4,mat4=glmatrix.mat4,mat2=glmatrix.mat2,Transform=function(t,i,o){this.tileSize=512,this._renderWorldCopies=void 0===o||o,this._minZoom=t||0,this._maxZoom=i||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={}},prototypeAccessors={minZoom:{},maxZoom:{},renderWorldCopies:{},worldSize:{},centerPoint:{},size:{},bearing:{},pitch:{},fov:{},zoom:{},center:{},unmodified:{},x:{},y:{},point:{}};Transform.prototype.clone=function(){var t=new Transform(this._minZoom,this._maxZoom,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._calcMatrices(),t},prototypeAccessors.minZoom.get=function(){return this._minZoom},prototypeAccessors.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},prototypeAccessors.maxZoom.get=function(){return this._maxZoom},prototypeAccessors.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},prototypeAccessors.renderWorldCopies.get=function(){return this._renderWorldCopies},prototypeAccessors.worldSize.get=function(){return this.tileSize*this.scale},prototypeAccessors.centerPoint.get=function(){return this.size._div(2)},prototypeAccessors.size.get=function(){return new Point(this.width,this.height)},prototypeAccessors.bearing.get=function(){return-this.angle/Math.PI*180},prototypeAccessors.bearing.set=function(t){var i=-util.wrap(t,-180,180)*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=mat2.create(),mat2.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},prototypeAccessors.pitch.get=function(){return this._pitch/Math.PI*180},prototypeAccessors.pitch.set=function(t){var i=util.clamp(t,0,60)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices())},prototypeAccessors.fov.get=function(){return this._fov/Math.PI*180},prototypeAccessors.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},prototypeAccessors.zoom.get=function(){return this._zoom},prototypeAccessors.zoom.set=function(t){var i=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==i&&(this._unmodified=!1,this._zoom=i,this.scale=this.zoomScale(i),this.tileZoom=Math.floor(i),this.zoomFraction=i-this.tileZoom,this._constrain(),this._calcMatrices())},prototypeAccessors.center.get=function(){return this._center},prototypeAccessors.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Transform.prototype.coveringZoomLevel=function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},Transform.prototype.getVisibleWrappedCoordinates=function(t){for(var i=this.pointCoordinate(new Point(0,0),0),o=this.pointCoordinate(new Point(this.width,0),0),e=Math.floor(i.column),r=Math.floor(o.column),n=[t],s=e;s<=r;s++)0!==s&&n.push(new TileCoord(t.z,t.x,t.y,s));return n},Transform.prototype.coveringTiles=function(t){var i=this.coveringZoomLevel(t),o=i;if(void 0!==t.minzoom&&i<t.minzoom)return[];void 0!==t.maxzoom&&i>t.maxzoom&&(i=t.maxzoom);var e=this.pointCoordinate(this.centerPoint,i),r=new Point(e.column-.5,e.row-.5),n=[this.pointCoordinate(new Point(0,0),i),this.pointCoordinate(new Point(this.width,0),i),this.pointCoordinate(new Point(this.width,this.height),i),this.pointCoordinate(new Point(0,this.height),i)];return TileCoord.cover(i,n,t.reparseOverscaled?o:i,this._renderWorldCopies).sort(function(t,i){return r.dist(t)-r.dist(i)})},Transform.prototype.resize=function(t,i){this.width=t,this.height=i,this.pixelsToGLUnits=[2/t,-2/i],this._constrain(),this._calcMatrices()},prototypeAccessors.unmodified.get=function(){return this._unmodified},Transform.prototype.zoomScale=function(t){return Math.pow(2,t)},Transform.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Transform.prototype.project=function(t){return new Point(this.lngX(t.lng),this.latY(t.lat))},Transform.prototype.unproject=function(t){return new LngLat(this.xLng(t.x),this.yLat(t.y))},prototypeAccessors.x.get=function(){return this.lngX(this.center.lng)},prototypeAccessors.y.get=function(){return this.latY(this.center.lat)},prototypeAccessors.point.get=function(){return new Point(this.x,this.y)},Transform.prototype.lngX=function(t){return(180+t)*this.worldSize/360},Transform.prototype.latY=function(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*this.worldSize/360},Transform.prototype.xLng=function(t){return 360*t/this.worldSize-180},Transform.prototype.yLat=function(t){var i=180-360*t/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(i*Math.PI/180))-90},Transform.prototype.setLocationAtPoint=function(t,i){var o=this.pointCoordinate(i)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(t)._sub(o)),this._renderWorldCopies&&(this.center=this.center.wrap())},Transform.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Transform.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Transform.prototype.locationCoordinate=function(t){return new Coordinate(this.lngX(t.lng)/this.tileSize,this.latY(t.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)},Transform.prototype.coordinateLocation=function(t){var i=t.zoomTo(this.zoom);return new LngLat(this.xLng(i.column*this.tileSize),this.yLat(i.row*this.tileSize))},Transform.prototype.pointCoordinate=function(t,i){void 0===i&&(i=this.tileZoom);var o=[t.x,t.y,0,1],e=[t.x,t.y,1,1];vec4.transformMat4(o,o,this.pixelMatrixInverse),vec4.transformMat4(e,e,this.pixelMatrixInverse);var r=o[3],n=e[3],s=o[0]/r,a=e[0]/n,h=o[1]/r,c=e[1]/n,m=o[2]/r,p=e[2]/n,l=m===p?0:(0-m)/(p-m);return new Coordinate(interp(s,a,l)/this.tileSize,interp(h,c,l)/this.tileSize,this.zoom)._zoomTo(i)},Transform.prototype.coordinatePoint=function(t){var i=t.zoomTo(this.zoom),o=[i.column*this.tileSize,i.row*this.tileSize,0,1];return vec4.transformMat4(o,o,this.pixelMatrix),new Point(o[0]/o[3],o[1]/o[3])},Transform.prototype.calculatePosMatrix=function(t,i){var o=t.id.toString();if(i&&(o+=i.toString()),this._posMatrixCache[o])return this._posMatrixCache[o];var e=t.toCoordinate(i),r=this.worldSize/this.zoomScale(e.zoom),n=mat4.identity(new Float64Array(16));return mat4.translate(n,n,[e.column*r,e.row*r,0]),mat4.scale(n,n,[r/EXTENT,r/EXTENT,1]),mat4.multiply(n,this.projMatrix,n),this._posMatrixCache[o]=new Float32Array(n),this._posMatrixCache[o]},Transform.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,i,o,e,r=-90,n=90,s=-180,a=180,h=this.size,c=this._unmodified;if(this.latRange){var m=this.latRange;r=this.latY(m[1]),n=this.latY(m[0]),t=n-r<h.y?h.y/(n-r):0}if(this.lngRange){var p=this.lngRange;s=this.lngX(p[0]),a=this.lngX(p[1]),i=a-s<h.x?h.x/(a-s):0}var l=Math.max(i||0,t||0);if(l)return this.center=this.unproject(new Point(i?(a+s)/2:this.x,t?(n+r)/2:this.y)),this.zoom+=this.scaleZoom(l),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var u=this.y,f=h.y/2;u-f<r&&(e=r+f),u+f>n&&(e=n-f)}if(this.lngRange){var d=this.x,g=h.x/2;d-g<s&&(o=s+g),d+g>a&&(o=a-g)}void 0===o&&void 0===e||(this.center=this.unproject(new Point(void 0!==o?o:this.x,void 0!==e?e:this.y))),this._unmodified=c,this._constraining=!1}},Transform.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var t=this._fov/2,i=Math.PI/2+this._pitch,o=Math.sin(t)*this.cameraToCenterDistance/Math.sin(Math.PI-i-t),e=Math.cos(Math.PI/2-this._pitch)*o+this.cameraToCenterDistance,r=1.01*e,n=new Float64Array(16);mat4.perspective(n,this._fov,this.width/this.height,1,r),mat4.scale(n,n,[1,-1,1]),mat4.translate(n,n,[0,0,-this.cameraToCenterDistance]),mat4.rotateX(n,n,this._pitch),mat4.rotateZ(n,n,this.angle),mat4.translate(n,n,[-this.x,-this.y,0]);var s=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));if(mat4.scale(n,n,[1,1,s,1]),this.projMatrix=n,n=mat4.create(),mat4.scale(n,n,[this.width/2,-this.height/2,1]),mat4.translate(n,n,[1,-1,0]),this.pixelMatrix=mat4.multiply(new Float64Array(16),n,this.projMatrix),!(n=mat4.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n,this._posMatrixCache={}}},Object.defineProperties(Transform.prototype,prototypeAccessors),module.exports=Transform;
-},{"../data/extent":58,"../source/tile_coord":112,"../style-spec/util/interpolate":154,"../util/util":266,"./coordinate":67,"./lng_lat":68,"@mapbox/gl-matrix":1,"@mapbox/point-geometry":2}],71:[function(_dereq_,module,exports){
-"use strict";var IndexBuffer=function(e,t,r){this.gl=e,this.buffer=e.createBuffer(),this.dynamicDraw=Boolean(r),this.unbindVAO(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.buffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?e.DYNAMIC_DRAW:e.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer};IndexBuffer.prototype.unbindVAO=function(){void 0===this.gl.extVertexArrayObject&&(this.gl.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object")),this.gl.extVertexArrayObject&&this.gl.extVertexArrayObject.bindVertexArrayOES(null)},IndexBuffer.prototype.bind=function(){this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this.buffer)},IndexBuffer.prototype.updateData=function(e){this.unbindVAO(),this.bind(),this.gl.bufferSubData(this.gl.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)},IndexBuffer.prototype.destroy=function(){this.buffer&&(this.gl.deleteBuffer(this.buffer),delete this.buffer)},module.exports=IndexBuffer;
-},{}],72:[function(_dereq_,module,exports){
-"use strict";var AttributeType={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},VertexBuffer=function(t,e,r){this.length=e.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.gl=t,this.buffer=t.createBuffer(),this.gl.bindBuffer(t.ARRAY_BUFFER,this.buffer),this.gl.bufferData(t.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?t.DYNAMIC_DRAW:t.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};VertexBuffer.prototype.bind=function(){this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer)},VertexBuffer.prototype.updateData=function(t){this.bind(),this.gl.bufferSubData(this.gl.ARRAY_BUFFER,0,t.arrayBuffer)},VertexBuffer.prototype.enableAttributes=function(t,e){for(var r=this,i=0;i<this.attributes.length;i++){var f=r.attributes[i],s=e.attributes[f.name];void 0!==s&&t.enableVertexAttribArray(s)}},VertexBuffer.prototype.setVertexAttribPointers=function(t,e,r){for(var i=this,f=0;f<this.attributes.length;f++){var s=i.attributes[f],u=e.attributes[s.name];void 0!==u&&t.vertexAttribPointer(u,s.components,t[AttributeType[s.type]],!1,i.itemSize,s.offset+i.itemSize*(r||0))}},VertexBuffer.prototype.destroy=function(){this.buffer&&(this.gl.deleteBuffer(this.buffer),delete this.buffer)},module.exports=VertexBuffer;
-},{}],73:[function(_dereq_,module,exports){
-"use strict";var supported=_dereq_("mapbox-gl-supported"),browser=_dereq_("./util/browser"),version=_dereq_("../package.json").version,Map=_dereq_("./ui/map"),NavigationControl=_dereq_("./ui/control/navigation_control"),GeolocateControl=_dereq_("./ui/control/geolocate_control"),AttributionControl=_dereq_("./ui/control/attribution_control"),ScaleControl=_dereq_("./ui/control/scale_control"),FullscreenControl=_dereq_("./ui/control/fullscreen_control"),Popup=_dereq_("./ui/popup"),Marker=_dereq_("./ui/marker"),Style=_dereq_("./style/style"),LngLat=_dereq_("./geo/lng_lat"),LngLatBounds=_dereq_("./geo/lng_lat_bounds"),Point=_dereq_("@mapbox/point-geometry"),Evented=_dereq_("./util/evented"),config=_dereq_("./util/config"),rtlTextPlugin=_dereq_("./source/rtl_text_plugin");module.exports={version:version,supported:supported,workerCount:Math.max(Math.floor(browser.hardwareConcurrency/2),1),setRTLTextPlugin:rtlTextPlugin.setRTLTextPlugin,Map:Map,NavigationControl:NavigationControl,GeolocateControl:GeolocateControl,AttributionControl:AttributionControl,ScaleControl:ScaleControl,FullscreenControl:FullscreenControl,Popup:Popup,Marker:Marker,Style:Style,LngLat:LngLat,LngLatBounds:LngLatBounds,Point:Point,Evented:Evented,config:config,get accessToken(){return config.ACCESS_TOKEN},set accessToken(o){config.ACCESS_TOKEN=o}};
-},{"../package.json":50,"./geo/lng_lat":68,"./geo/lng_lat_bounds":69,"./source/rtl_text_plugin":107,"./style/style":185,"./ui/control/attribution_control":225,"./ui/control/fullscreen_control":226,"./ui/control/geolocate_control":227,"./ui/control/navigation_control":229,"./ui/control/scale_control":230,"./ui/map":240,"./ui/marker":241,"./ui/popup":242,"./util/browser":245,"./util/config":249,"./util/evented":253,"@mapbox/point-geometry":2,"mapbox-gl-supported":37}],74:[function(_dereq_,module,exports){
-"use strict";function drawBackground(r,e,t){var a=t.paint.get("background-color"),i=t.paint.get("background-opacity");if(0!==i){var o=r.gl,l=r.transform,n=l.tileSize,s=t.paint.get("background-pattern"),u={zoom:l.zoom},f=s||1!==a.a||1!==i?"translucent":"opaque";if(r.renderPass===f){o.disable(o.STENCIL_TEST),r.setDepthSublayer(0);var p=new PossiblyEvaluated(fillLayerPaintProperties);p._values["background-color"]=new PossiblyEvaluatedPropertyValue(fillLayerPaintProperties.properties["fill-color"],{kind:"constant",value:a},u),p._values["background-opacity"]=new PossiblyEvaluatedPropertyValue(fillLayerPaintProperties.properties["fill-opacity"],{kind:"constant",value:i},u);var P;if(s){if(pattern.isPatternMissing(s,r))return;var g=ProgramConfiguration.forBackgroundPattern(i);P=r.useProgram("fillPattern",g),g.setUniforms(o,P,p,u),pattern.prepare(s,r,P),r.tileExtentPatternVAO.bind(o,P,r.tileExtentBuffer)}else{var d=ProgramConfiguration.forBackgroundColor(a,i);P=r.useProgram("fill",d),d.setUniforms(o,P,p,u),r.tileExtentVAO.bind(o,P,r.tileExtentBuffer)}for(var y=l.coveringTiles({tileSize:n}),c=0,v=y;c<v.length;c+=1){var m=v[c];s&&pattern.setTile({coord:m,tileSize:n},r,P),o.uniformMatrix4fv(P.uniforms.u_matrix,!1,r.transform.calculatePosMatrix(m)),o.drawArrays(o.TRIANGLE_STRIP,0,r.tileExtentBuffer.length)}}}}var pattern=_dereq_("./pattern"),ref=_dereq_("../data/program_configuration"),ProgramConfiguration=ref.ProgramConfiguration,ref$1=_dereq_("../style/properties"),PossiblyEvaluated=ref$1.PossiblyEvaluated,PossiblyEvaluatedPropertyValue=ref$1.PossiblyEvaluatedPropertyValue,fillLayerPaintProperties=_dereq_("../style/style_layer/fill_style_layer_properties").paint;module.exports=drawBackground;
-},{"../data/program_configuration":63,"../style/properties":183,"../style/style_layer/fill_style_layer_properties":194,"./pattern":90}],75:[function(_dereq_,module,exports){
-"use strict";function drawCircles(r,t,i,e){if("translucent"===r.renderPass){var a=i.paint.get("circle-opacity"),n=i.paint.get("circle-stroke-width"),s=i.paint.get("circle-stroke-opacity");if(0!==a.constantOr(1)||0!==n.constantOr(1)&&0!==s.constantOr(1)){var o=r.gl;r.setDepthSublayer(0),r.depthMask(!1),o.disable(o.STENCIL_TEST);for(var c=0;c<e.length;c++){var u=e[c],m=t.getTile(u),f=m.getBucket(i);if(f){var l=f.programConfigurations.get(i.id),p=r.useProgram("circle",l);if(l.setUniforms(o,p,i.paint,{zoom:r.transform.zoom}),o.uniform1f(p.uniforms.u_camera_to_center_distance,r.transform.cameraToCenterDistance),o.uniform1i(p.uniforms.u_scale_with_map,"map"===i.paint.get("circle-pitch-scale")?1:0),"map"===i.paint.get("circle-pitch-alignment")){o.uniform1i(p.uniforms.u_pitch_with_map,1);var _=pixelsToTileUnits(m,1,r.transform.zoom);o.uniform2f(p.uniforms.u_extrude_scale,_,_)}else o.uniform1i(p.uniforms.u_pitch_with_map,0),o.uniform2fv(p.uniforms.u_extrude_scale,r.transform.pixelsToGLUnits);o.uniformMatrix4fv(p.uniforms.u_matrix,!1,r.translatePosMatrix(u.posMatrix,m,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor"))),p.draw(o,o.TRIANGLES,i.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,l)}}}}}var pixelsToTileUnits=_dereq_("../source/pixels_to_tile_units");module.exports=drawCircles;
-},{"../source/pixels_to_tile_units":104}],76:[function(_dereq_,module,exports){
-"use strict";function drawCollisionDebugGeometry(o,i,e,r,l){for(var n=o.gl,s=l?o.useProgram("collisionCircle"):o.useProgram("collisionBox"),t=0;t<r.length;t++){var u=r[t],a=i.getTile(u),f=a.getBucket(e);if(f){var m=l?f.collisionCircle:f.collisionBox;if(m){n.uniformMatrix4fv(s.uniforms.u_matrix,!1,u.posMatrix),l||o.lineWidth(1),n.uniform1f(s.uniforms.u_camera_to_center_distance,o.transform.cameraToCenterDistance);var c=pixelsToTileUnits(a,1,o.transform.zoom),x=Math.pow(2,o.transform.zoom-a.coord.z);n.uniform1f(s.uniforms.u_pixels_to_tile_units,c),n.uniform2f(s.uniforms.u_extrude_scale,o.transform.pixelsToGLUnits[0]/(c*x),o.transform.pixelsToGLUnits[1]/(c*x)),s.draw(n,l?n.TRIANGLES:n.LINES,e.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,null,m.collisionVertexBuffer,null)}}}}function drawCollisionDebug(o,i,e,r){drawCollisionDebugGeometry(o,i,e,r,!1),drawCollisionDebugGeometry(o,i,e,r,!0)}var pixelsToTileUnits=_dereq_("../source/pixels_to_tile_units");module.exports=drawCollisionDebug;
-},{"../source/pixels_to_tile_units":104}],77:[function(_dereq_,module,exports){
-"use strict";function drawDebug(r,e,t){for(var a=0;a<t.length;a++)drawDebugTile(r,e,t[a])}function drawDebugTile(r,e,t){var a=r.gl;a.disable(a.STENCIL_TEST),r.lineWidth(1*browser.devicePixelRatio);var i=t.posMatrix,u=r.useProgram("debug");a.uniformMatrix4fv(u.uniforms.u_matrix,!1,i),a.uniform4f(u.uniforms.u_color,1,0,0,1),r.debugVAO.bind(a,u,r.debugBuffer),a.drawArrays(a.LINE_STRIP,0,r.debugBuffer.length);for(var o=createTextVerticies(t.toString(),50,200,5),n=new PosArray,f=0;f<o.length;f+=2)n.emplaceBack(o[f],o[f+1]);var l=new VertexBuffer(a,n);(new VertexArrayObject).bind(a,u,l),a.uniform4f(u.uniforms.u_color,1,1,1,1);for(var s=e.getTile(t).tileSize,m=EXTENT/(Math.pow(2,r.transform.zoom-t.z)*s),x=[[-1,-1],[-1,1],[1,-1],[1,1]],g=0;g<x.length;g++){var b=x[g];a.uniformMatrix4fv(u.uniforms.u_matrix,!1,mat4.translate([],i,[m*b[0],m*b[1],0])),a.drawArrays(a.LINES,0,l.length)}a.uniform4f(u.uniforms.u_color,0,0,0,1),a.uniformMatrix4fv(u.uniforms.u_matrix,!1,i),a.drawArrays(a.LINES,0,l.length)}function createTextVerticies(r,e,t,a){a=a||1;var i,u,o,n,f,l,s,m,x=[];for(i=0,u=r.length;i<u;i++)if(f=simplexFont[r[i]]){for(m=null,o=0,n=f[1].length;o<n;o+=2)-1===f[1][o]&&-1===f[1][o+1]?m=null:(l=e+f[1][o]*a,s=t-f[1][o+1]*a,m&&x.push(m.x,m.y,l,s),m={x:l,y:s});e+=f[0]*a}return x}var browser=_dereq_("../util/browser"),mat4=_dereq_("@mapbox/gl-matrix").mat4,EXTENT=_dereq_("../data/extent"),VertexBuffer=_dereq_("../gl/vertex_buffer"),VertexArrayObject=_dereq_("./vertex_array_object"),PosArray=_dereq_("../data/pos_array");module.exports=drawDebug;var simplexFont={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};
-},{"../data/extent":58,"../data/pos_array":62,"../gl/vertex_buffer":72,"../util/browser":245,"./vertex_array_object":95,"@mapbox/gl-matrix":1}],78:[function(_dereq_,module,exports){
-"use strict";function drawFill(t,r,e,a){var i=e.paint.get("fill-color"),l=e.paint.get("fill-opacity");if(0!==l.constantOr(1)){var n=t.gl;n.enable(n.STENCIL_TEST);var o=e.paint.get("fill-pattern")||1!==i.constantOr(Color.transparent).a||1!==l.constantOr(0)?"translucent":"opaque";t.renderPass===o&&(t.setDepthSublayer(1),t.depthMask("opaque"===t.renderPass),drawFillTiles(t,r,e,a,drawFillTile)),"translucent"===t.renderPass&&e.paint.get("fill-antialias")&&(t.lineWidth(2),t.depthMask(!1),t.setDepthSublayer(e.getPaintProperty("fill-outline-color")?2:0),drawFillTiles(t,r,e,a,drawStrokeTile))}}function drawFillTiles(t,r,e,a,i){if(!pattern.isPatternMissing(e.paint.get("fill-pattern"),t))for(var l=!0,n=0,o=a;n<o.length;n+=1){var s=o[n],f=r.getTile(s),u=f.getBucket(e);u&&(t.enableTileClippingMask(s),i(t,r,e,f,s,u,l),l=!1)}}function drawFillTile(t,r,e,a,i,l,n){var o=t.gl,s=l.programConfigurations.get(e.id);setFillProgram("fill",e.paint.get("fill-pattern"),t,s,e,a,i,n).draw(o,o.TRIANGLES,e.id,l.layoutVertexBuffer,l.indexBuffer,l.segments,s)}function drawStrokeTile(t,r,e,a,i,l,n){var o=t.gl,s=l.programConfigurations.get(e.id),f=e.getPaintProperty("fill-outline-color")?null:e.paint.get("fill-pattern"),u=setFillProgram("fillOutline",f,t,s,e,a,i,n);o.uniform2f(u.uniforms.u_world,o.drawingBufferWidth,o.drawingBufferHeight),u.draw(o,o.LINES,e.id,l.layoutVertexBuffer,l.indexBuffer2,l.segments2,s)}function setFillProgram(t,r,e,a,i,l,n,o){var s,f=e.currentProgram;return r?(s=e.useProgram(t+"Pattern",a),(o||s!==f)&&(a.setUniforms(e.gl,s,i.paint,{zoom:e.transform.zoom}),pattern.prepare(r,e,s)),pattern.setTile(l,e,s)):(s=e.useProgram(t,a),(o||s!==f)&&a.setUniforms(e.gl,s,i.paint,{zoom:e.transform.zoom})),e.gl.uniformMatrix4fv(s.uniforms.u_matrix,!1,e.translatePosMatrix(n.posMatrix,l,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"))),s}var pattern=_dereq_("./pattern"),Color=_dereq_("../style-spec/util/color");module.exports=drawFill;
-},{"../style-spec/util/color":150,"./pattern":90}],79:[function(_dereq_,module,exports){
-"use strict";function draw(r,t,i,e){if(0!==i.paint.get("fill-extrusion-opacity"))if("3d"===r.renderPass){var a=r.gl;a.disable(a.STENCIL_TEST),a.enable(a.DEPTH_TEST),r.clearColor(),r.depthMask(!0);for(var n=0;n<e.length;n++)drawExtrusion(r,t,i,e[n])}else"translucent"===r.renderPass&&drawExtrusionTexture(r,i)}function drawExtrusionTexture(r,t){var i=t.viewportFrame;if(i){var e=r.gl,a=r.useProgram("extrusionTexture");e.disable(e.STENCIL_TEST),e.disable(e.DEPTH_TEST),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,i.texture),e.uniform1f(a.uniforms.u_opacity,t.paint.get("fill-extrusion-opacity")),e.uniform1i(a.uniforms.u_image,0);var n=mat4.create();mat4.ortho(n,0,r.width,r.height,0,0,1),e.uniformMatrix4fv(a.uniforms.u_matrix,!1,n),e.uniform2f(a.uniforms.u_world,e.drawingBufferWidth,e.drawingBufferHeight),r.viewportVAO.bind(e,a,r.viewportBuffer),e.drawArrays(e.TRIANGLE_STRIP,0,4)}}function drawExtrusion(r,t,i,e){var a=t.getTile(e),n=a.getBucket(i);if(n){var o=r.gl,s=i.paint.get("fill-extrusion-pattern"),u=n.programConfigurations.get(i.id),f=r.useProgram(s?"fillExtrusionPattern":"fillExtrusion",u);if(u.setUniforms(o,f,i.paint,{zoom:r.transform.zoom}),s){if(pattern.isPatternMissing(s,r))return;pattern.prepare(s,r,f),pattern.setTile(a,r,f),o.uniform1f(f.uniforms.u_height_factor,-Math.pow(2,e.z)/a.tileSize/8)}r.gl.uniformMatrix4fv(f.uniforms.u_matrix,!1,r.translatePosMatrix(e.posMatrix,a,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor"))),setLight(f,r),f.draw(o,o.TRIANGLES,i.id,n.layoutVertexBuffer,n.indexBuffer,n.segments,u)}}function setLight(r,t){var i=t.gl,e=t.style.light,a=e.properties.get("position"),n=[a.x,a.y,a.z],o=mat3.create();"viewport"===e.properties.get("anchor")&&mat3.fromRotation(o,-t.transform.angle),vec3.transformMat3(n,n,o);var s=e.properties.get("color");i.uniform3fv(r.uniforms.u_lightpos,n),i.uniform1f(r.uniforms.u_lightintensity,e.properties.get("intensity")),i.uniform3f(r.uniforms.u_lightcolor,s.r,s.g,s.b)}var glMatrix=_dereq_("@mapbox/gl-matrix"),pattern=_dereq_("./pattern"),mat3=glMatrix.mat3,mat4=glMatrix.mat4,vec3=glMatrix.vec3;module.exports=draw;
-},{"./pattern":90,"@mapbox/gl-matrix":1}],80:[function(_dereq_,module,exports){
-"use strict";function drawHeatmap(e,r,t,a){if(!e.isOpaquePass&&0!==t.paint.get("heatmap-opacity")){var i=e.gl;e.setDepthSublayer(0),e.depthMask(!1),i.disable(i.STENCIL_TEST),renderToTexture(i,e,t),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.blendFunc(i.ONE,i.ONE);for(var u=0;u<a.length;u++){var T=a[u];if(!r.hasRenderableParent(T)){var E=r.getTile(T),n=E.getBucket(t);if(n){var o=n.programConfigurations.get(t.id),f=e.useProgram("heatmap",o),m=e.transform,x=m.zoom;o.setUniforms(i,f,t.paint,{zoom:x}),i.uniform1f(f.uniforms.u_radius,t.paint.get("heatmap-radius")),i.uniform1f(f.uniforms.u_extrude_scale,pixelsToTileUnits(E,1,x)),i.uniform1f(f.uniforms.u_intensity,t.paint.get("heatmap-intensity")),i.uniformMatrix4fv(f.uniforms.u_matrix,!1,T.posMatrix),f.draw(i,i.TRIANGLES,t.id,n.layoutVertexBuffer,n.indexBuffer,n.segments,o)}}}renderTextureToMap(i,e,t)}}function renderToTexture(e,r,t){e.activeTexture(e.TEXTURE1),e.viewport(0,0,r.width/4,r.height/4);var a=t.heatmapTexture,i=t.heatmapFbo;a?(e.bindTexture(e.TEXTURE_2D,a),e.bindFramebuffer(e.FRAMEBUFFER,i)):(a=t.heatmapTexture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),i=t.heatmapFbo=e.createFramebuffer(),bindTextureFramebuffer(e,r,a,i))}function bindTextureFramebuffer(e,r,t,a){e.texImage2D(e.TEXTURE_2D,0,e.RGBA,r.width/4,r.height/4,0,e.RGBA,r.extTextureHalfFloat?r.extTextureHalfFloat.HALF_FLOAT_OES:e.UNSIGNED_BYTE,null),e.bindFramebuffer(e.FRAMEBUFFER,a),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),r.extTextureHalfFloat&&e.checkFramebufferStatus(e.FRAMEBUFFER)!==e.FRAMEBUFFER_COMPLETE&&(r.extTextureHalfFloat=null,bindTextureFramebuffer(e,r,t,a))}function renderTextureToMap(e,r,t){e.bindFramebuffer(e.FRAMEBUFFER,null),e.activeTexture(e.TEXTURE2);var a=t.colorRampTexture;a||(a=t.colorRampTexture=new Texture(e,t.colorRamp,e.RGBA)),a.bind(e.LINEAR,e.CLAMP_TO_EDGE),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA);var i=r.useProgram("heatmapTexture");e.viewport(0,0,r.width,r.height),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.heatmapTexture);var u=t.paint.get("heatmap-opacity");e.uniform1f(i.uniforms.u_opacity,u),e.uniform1i(i.uniforms.u_image,1),e.uniform1i(i.uniforms.u_color_ramp,2);var T=mat4.create();mat4.ortho(T,0,r.width,r.height,0,0,1),e.uniformMatrix4fv(i.uniforms.u_matrix,!1,T),e.disable(e.DEPTH_TEST),e.uniform2f(i.uniforms.u_world,e.drawingBufferWidth,e.drawingBufferHeight),r.viewportVAO.bind(e,i,r.viewportBuffer),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.enable(e.DEPTH_TEST)}var mat4=_dereq_("@mapbox/gl-matrix").mat4,Texture=_dereq_("./texture"),pixelsToTileUnits=_dereq_("../source/pixels_to_tile_units");module.exports=drawHeatmap;
-},{"../source/pixels_to_tile_units":104,"./texture":93,"@mapbox/gl-matrix":1}],81:[function(_dereq_,module,exports){
-"use strict";function drawLineTile(i,e,r,t,n,a,o,u,f){var s,l,m,_,g=e.gl,p=n.paint.get("line-dasharray"),d=n.paint.get("line-pattern");if(u||f){var c=1/pixelsToTileUnits(r,1,e.transform.tileZoom);if(p){s=e.lineAtlas.getDash(p.from,"round"===n.layout.get("line-cap")),l=e.lineAtlas.getDash(p.to,"round"===n.layout.get("line-cap"));var x=s.width*p.fromScale,T=l.width*p.toScale;g.uniform2f(i.uniforms.u_patternscale_a,c/x,-s.height/2),g.uniform2f(i.uniforms.u_patternscale_b,c/T,-l.height/2),g.uniform1f(i.uniforms.u_sdfgamma,e.lineAtlas.width/(256*Math.min(x,T)*browser.devicePixelRatio)/2)}else if(d){if(m=e.imageManager.getPattern(d.from),_=e.imageManager.getPattern(d.to),!m||!_)return;g.uniform2f(i.uniforms.u_pattern_size_a,m.displaySize[0]*d.fromScale/c,_.displaySize[1]),g.uniform2f(i.uniforms.u_pattern_size_b,_.displaySize[0]*d.toScale/c,_.displaySize[1]);var h=e.imageManager.getPixelSize(),v=h.width,b=h.height;g.uniform2fv(i.uniforms.u_texsize,[v,b])}g.uniform2f(i.uniforms.u_gl_units_to_pixels,1/e.transform.pixelsToGLUnits[0],1/e.transform.pixelsToGLUnits[1])}u&&(p?(g.uniform1i(i.uniforms.u_image,0),g.activeTexture(g.TEXTURE0),e.lineAtlas.bind(g),g.uniform1f(i.uniforms.u_tex_y_a,s.y),g.uniform1f(i.uniforms.u_tex_y_b,l.y),g.uniform1f(i.uniforms.u_mix,p.t)):d&&(g.uniform1i(i.uniforms.u_image,0),g.activeTexture(g.TEXTURE0),e.imageManager.bind(g),g.uniform2fv(i.uniforms.u_pattern_tl_a,m.tl),g.uniform2fv(i.uniforms.u_pattern_br_a,m.br),g.uniform2fv(i.uniforms.u_pattern_tl_b,_.tl),g.uniform2fv(i.uniforms.u_pattern_br_b,_.br),g.uniform1f(i.uniforms.u_fade,d.t))),e.enableTileClippingMask(a);var y=e.translatePosMatrix(a.posMatrix,r,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"));g.uniformMatrix4fv(i.uniforms.u_matrix,!1,y),g.uniform1f(i.uniforms.u_ratio,1/pixelsToTileUnits(r,1,e.transform.zoom)),i.draw(g,g.TRIANGLES,n.id,t.layoutVertexBuffer,t.indexBuffer,t.segments,o)}var browser=_dereq_("../util/browser"),pixelsToTileUnits=_dereq_("../source/pixels_to_tile_units");module.exports=function(i,e,r,t){if("translucent"===i.renderPass){if(0!==r.paint.get("line-opacity").constantOr(1)){i.setDepthSublayer(0),i.depthMask(!1);var n=i.gl;n.enable(n.STENCIL_TEST);for(var a,o=r.paint.get("line-dasharray")?"lineSDF":r.paint.get("line-pattern")?"linePattern":"line",u=!0,f=0,s=t;f<s.length;f+=1){var l=s[f],m=e.getTile(l),_=m.getBucket(r);if(_){var g=_.programConfigurations.get(r.id),p=i.currentProgram,d=i.useProgram(o,g),c=u||d!==p,x=a!==m.coord.z;c&&g.setUniforms(i.gl,d,r.paint,{zoom:i.transform.zoom}),drawLineTile(d,i,m,_,r,l,g,c,x),a=m.coord.z,u=!1}}}}};
-},{"../source/pixels_to_tile_units":104,"../util/browser":245}],82:[function(_dereq_,module,exports){
-"use strict";function drawRaster(r,e,t,a){if("translucent"===r.renderPass&&0!==t.paint.get("raster-opacity")){var i=r.gl,n=e.getSource(),o=r.useProgram("raster");i.enable(i.DEPTH_TEST),r.depthMask(1===t.paint.get("raster-opacity")),i.depthFunc(i.LESS),i.disable(i.STENCIL_TEST),i.uniform1f(o.uniforms.u_brightness_low,t.paint.get("raster-brightness-min")),i.uniform1f(o.uniforms.u_brightness_high,t.paint.get("raster-brightness-max")),i.uniform1f(o.uniforms.u_saturation_factor,saturationFactor(t.paint.get("raster-saturation"))),i.uniform1f(o.uniforms.u_contrast_factor,contrastFactor(t.paint.get("raster-contrast"))),i.uniform3fv(o.uniforms.u_spin_weights,spinWeights(t.paint.get("raster-hue-rotate"))),i.uniform1f(o.uniforms.u_buffer_scale,1),i.uniform1i(o.uniforms.u_image0,0),i.uniform1i(o.uniforms.u_image1,1);for(var u=a.length&&a[0].z,s=0,f=a;s<f.length;s+=1){var d=f[s];r.setDepthSublayer(d.z-u);var m=e.getTile(d),c=r.transform.calculatePosMatrix(d,e.getSource().maxzoom);m.registerFadeDuration(t.paint.get("raster-fade-duration")),i.uniformMatrix4fv(o.uniforms.u_matrix,!1,c);var g=e.findLoadedParent(d,0,{}),_=getFadeValues(m,g,e,t,r.transform),p=void 0,E=void 0;if(i.activeTexture(i.TEXTURE0),m.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_NEAREST),i.activeTexture(i.TEXTURE1),g?(g.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_NEAREST),p=Math.pow(2,g.coord.z-m.coord.z),E=[m.coord.x*p%1,m.coord.y*p%1]):m.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE,i.LINEAR_MIPMAP_NEAREST),i.uniform2fv(o.uniforms.u_tl_parent,E||[0,0]),i.uniform1f(o.uniforms.u_scale_parent,p||1),i.uniform1f(o.uniforms.u_fade_t,_.mix),i.uniform1f(o.uniforms.u_opacity,_.opacity*t.paint.get("raster-opacity")),n instanceof ImageSource){var h=n.boundsBuffer;n.boundsVAO.bind(i,o,h),i.drawArrays(i.TRIANGLE_STRIP,0,h.length)}else if(m.maskedBoundsBuffer&&m.maskedIndexBuffer&&m.segments)o.draw(i,i.TRIANGLES,t.id,m.maskedBoundsBuffer,m.maskedIndexBuffer,m.segments);else{var l=r.rasterBoundsBuffer,A=r.rasterBoundsVAO;A.bind(i,o,l),i.drawArrays(i.TRIANGLE_STRIP,0,l.length)}}i.depthFunc(i.LEQUAL)}}function spinWeights(r){r*=Math.PI/180;var e=Math.sin(r),t=Math.cos(r);return[(2*t+1)/3,(-Math.sqrt(3)*e-t+1)/3,(Math.sqrt(3)*e-t+1)/3]}function contrastFactor(r){return r>0?1/(1-r):1+r}function saturationFactor(r){return r>0?1-1/(1.001-r):-r}function getFadeValues(r,e,t,a,i){var n=a.paint.get("raster-fade-duration");if(n>0){var o=Date.now(),u=(o-r.timeAdded)/n,s=e?(o-e.timeAdded)/n:-1,f=t.getSource(),d=i.coveringZoomLevel({tileSize:f.tileSize,roundZoom:f.roundZoom}),m=!e||Math.abs(e.coord.z-d)>Math.abs(r.coord.z-d),c=m&&r.refreshedUponExpiration?1:util.clamp(m?u:1-s,0,1);return r.refreshedUponExpiration&&u>=1&&(r.refreshedUponExpiration=!1),e?{opacity:1,mix:1-c}:{opacity:c,mix:0}}return{opacity:1,mix:0}}var util=_dereq_("../util/util"),ImageSource=_dereq_("../source/image_source");module.exports=drawRaster;
-},{"../source/image_source":102,"../util/util":266}],83:[function(_dereq_,module,exports){
-"use strict";function drawSymbols(t,e,i,o){if("translucent"===t.renderPass){var r=t.gl;r.disable(r.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),0!==i.paint.get("icon-opacity").constantOr(1)&&drawLayerSymbols(t,e,i,o,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright")),0!==i.paint.get("text-opacity").constantOr(1)&&drawLayerSymbols(t,e,i,o,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright")),e.map.showCollisionBoxes&&drawCollisionDebug(t,e,i,o)}}function drawLayerSymbols(t,e,i,o,r,a,n,s,u,l){var m=t.gl,f=t.transform,c="map"===s,_="map"===u,y=c&&"line"===i.layout.get("symbol-placement"),p=c&&!_&&!y,g=_;g?m.enable(m.DEPTH_TEST):m.disable(m.DEPTH_TEST);for(var x,d=0,b=o;d<b.length;d+=1){var T=b[d],S=e.getTile(T),h=S.getBucket(i);if(h){var z=r?h.text:h.icon;if(z&&z.segments.get().length){var v=z.programConfigurations.get(i.id),w=r||h.sdfIcons,E=r?h.textSizeData:h.iconSizeData;if(x||(x=t.useProgram(w?"symbolSDF":"symbolIcon",v),v.setUniforms(m,x,i.paint,{zoom:t.transform.zoom}),setSymbolDrawState(x,t,i,r,p,_,E)),m.activeTexture(m.TEXTURE0),m.uniform1i(x.uniforms.u_texture,0),r)S.glyphAtlasTexture.bind(m.LINEAR,m.CLAMP_TO_EDGE),m.uniform2fv(x.uniforms.u_texsize,S.glyphAtlasTexture.size);else{var M=1!==i.layout.get("icon-size").constantOr(0)||h.iconsNeedLinear,D=_||0!==f.pitch;S.iconAtlasTexture.bind(w||t.options.rotating||t.options.zooming||M||D?m.LINEAR:m.NEAREST,m.CLAMP_TO_EDGE),m.uniform2fv(x.uniforms.u_texsize,S.iconAtlasTexture.size)}t.enableTileClippingMask(T),m.uniformMatrix4fv(x.uniforms.u_matrix,!1,t.translatePosMatrix(T.posMatrix,S,a,n));var P=pixelsToTileUnits(S,1,t.transform.zoom),L=symbolProjection.getLabelPlaneMatrix(T.posMatrix,_,c,t.transform,P),C=symbolProjection.getGlCoordMatrix(T.posMatrix,_,c,t.transform,P);m.uniformMatrix4fv(x.uniforms.u_gl_coord_matrix,!1,t.translatePosMatrix(C,S,a,n,!0)),y?(m.uniformMatrix4fv(x.uniforms.u_label_plane_matrix,!1,identityMat4),symbolProjection.updateLineLabels(h,T.posMatrix,t,r,L,C,_,l)):m.uniformMatrix4fv(x.uniforms.u_label_plane_matrix,!1,L),m.uniform1f(x.uniforms.u_fade_change,t.options.collisionFadeDuration?(Date.now()-h.fadeStartTime)/t.options.collisionFadeDuration:1),drawTileSymbols(x,v,t,i,S,z,r,w,_)}}}g||m.enable(m.DEPTH_TEST)}function setSymbolDrawState(t,e,i,o,r,a,n){var s=e.gl,u=e.transform;s.uniform1i(t.uniforms.u_pitch_with_map,a?1:0),s.uniform1f(t.uniforms.u_is_text,o?1:0),s.uniform1f(t.uniforms.u_pitch,u.pitch/360*2*Math.PI);var l="constant"===n.functionType||"source"===n.functionType,m="constant"===n.functionType||"camera"===n.functionType;s.uniform1i(t.uniforms.u_is_size_zoom_constant,l?1:0),s.uniform1i(t.uniforms.u_is_size_feature_constant,m?1:0),s.uniform1f(t.uniforms.u_camera_to_center_distance,u.cameraToCenterDistance);var f=symbolSize.evaluateSizeForZoom(n,u.zoom,symbolLayoutProperties.properties[o?"text-size":"icon-size"]);void 0!==f.uSizeT&&s.uniform1f(t.uniforms.u_size_t,f.uSizeT),void 0!==f.uSize&&s.uniform1f(t.uniforms.u_size,f.uSize),s.uniform1f(t.uniforms.u_aspect_ratio,u.width/u.height),s.uniform1i(t.uniforms.u_rotate_symbol,r?1:0)}function drawTileSymbols(t,e,i,o,r,a,n,s,u){var l=i.gl,m=i.transform;if(s){var f=0!==o.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(1),c=u?Math.cos(m._pitch)*m.cameraToCenterDistance:1;l.uniform1f(t.uniforms.u_gamma_scale,c),f&&(l.uniform1f(t.uniforms.u_is_halo,1),drawSymbolElements(a,o,l,t)),l.uniform1f(t.uniforms.u_is_halo,0)}drawSymbolElements(a,o,l,t)}function drawSymbolElements(t,e,i,o){o.draw(i,i.TRIANGLES,e.id,t.layoutVertexBuffer,t.indexBuffer,t.segments,t.programConfigurations.get(e.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}var drawCollisionDebug=_dereq_("./draw_collision_debug"),pixelsToTileUnits=_dereq_("../source/pixels_to_tile_units"),symbolProjection=_dereq_("../symbol/projection"),symbolSize=_dereq_("../symbol/symbol_size"),mat4=_dereq_("@mapbox/gl-matrix").mat4,identityMat4=mat4.identity(new Float32Array(16)),symbolLayoutProperties=_dereq_("../style/style_layer/symbol_style_layer_properties").layout;module.exports=drawSymbols;
-},{"../source/pixels_to_tile_units":104,"../style/style_layer/symbol_style_layer_properties":202,"../symbol/projection":216,"../symbol/symbol_size":221,"./draw_collision_debug":76,"@mapbox/gl-matrix":1}],84:[function(_dereq_,module,exports){
-"use strict";function makeGlyphAtlas(a){var e=AlphaImage.create({width:0,height:0}),i={},t=new ShelfPack(0,0,{autoResize:!0});for(var h in a){var p=a[h],r=i[h]={};for(var m in p){var g=p[+m];if(g&&0!==g.bitmap.width&&0!==g.bitmap.height){var l=t.packOne(g.bitmap.width+2*padding,g.bitmap.height+2*padding);AlphaImage.resize(e,{width:t.w,height:t.h}),AlphaImage.copy(g.bitmap,e,{x:0,y:0},{x:l.x+padding,y:l.y+padding},g.bitmap),r[m]={rect:l,metrics:g.metrics}}}}return t.shrink(),AlphaImage.resize(e,{width:t.w,height:t.h}),{image:e,positions:i}}var ShelfPack=_dereq_("@mapbox/shelf-pack"),ref=_dereq_("../util/image"),AlphaImage=ref.AlphaImage,padding=1;module.exports={makeGlyphAtlas:makeGlyphAtlas};
-},{"../util/image":256,"@mapbox/shelf-pack":3}],85:[function(_dereq_,module,exports){
-"use strict";var loadGlyphRange=_dereq_("../style/load_glyph_range"),TinySDF=_dereq_("@mapbox/tiny-sdf"),isChar=_dereq_("../util/is_char_in_unicode_block"),ref=_dereq_("../util/util"),asyncAll=ref.asyncAll,ref$1=_dereq_("../util/image"),AlphaImage=ref$1.AlphaImage,GlyphManager=function(r,e){this.requestTransform=r,this.localIdeographFontFamily=e,this.entries={}};GlyphManager.prototype.setURL=function(r){this.url=r},GlyphManager.prototype.getGlyphs=function(r,e){var t=this,i=[];for(var a in r)for(var l=0,n=r[a];l<n.length;l+=1){var s=n[l];i.push({stack:a,id:s})}asyncAll(i,function(r,e){var i=r.stack,a=r.id,l=t.entries[i];l||(l=t.entries[i]={glyphs:{},requests:{}});var n=l.glyphs[a];if(void 0!==n)return void e(null,{stack:i,id:a,glyph:n});if(n=t._tinySDF(l,i,a))return void e(null,{stack:i,id:a,glyph:n});var s=Math.floor(a/256);if(256*s>65535)return void e(new Error("glyphs > 65535 not supported"));var o=l.requests[s];o||(o=l.requests[s]=[],loadGlyphRange(i,s,t.url,t.requestTransform,function(r,e){if(e)for(var t in e)l.glyphs[+t]=e[+t];for(var i=0,a=o;i<a.length;i+=1){(0,a[i])(r,e)}delete l.requests[s]})),o.push(function(r,t){r?e(r):t&&e(null,{stack:i,id:a,glyph:t[a]||null})})},function(r,t){if(r)e(r);else if(t){for(var i={},a=0,l=t;a<l.length;a+=1){var n=l[a],s=n.stack,o=n.id,h=n.glyph;(i[s]||(i[s]={}))[o]=h}e(null,i)}})},GlyphManager.prototype._tinySDF=function(r,e,t){var i=this.localIdeographFontFamily;if(i&&(isChar["CJK Unified Ideographs"](t)||isChar["Hangul Syllables"](t))){var a=r.tinySDF;if(!a){var l="400";/bold/i.test(e)?l="900":/medium/i.test(e)?l="500":/light/i.test(e)&&(l="200"),a=r.tinySDF=new TinySDF(24,3,8,.25,i,l)}return{id:t,bitmap:AlphaImage.create({width:30,height:30},a.draw(String.fromCharCode(t))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},module.exports=GlyphManager;
-},{"../style/load_glyph_range":179,"../util/image":256,"../util/is_char_in_unicode_block":258,"../util/util":266,"@mapbox/tiny-sdf":4}],86:[function(_dereq_,module,exports){
-"use strict";function imagePosition(a,e){var i=e.pixelRatio,t={x:a.x+padding,y:a.y+padding,w:a.w-2*padding,h:a.h-2*padding};return{pixelRatio:i,textureRect:t,tl:[t.x,t.y],br:[t.x+t.w,t.y+t.h],displaySize:[t.w/i,t.h/i]}}function makeImageAtlas(a){var e=RGBAImage.create({width:0,height:0}),i={},t=new ShelfPack(0,0,{autoResize:!0});for(var d in a){var g=a[d],n=t.packOne(g.data.width+2*padding,g.data.height+2*padding);RGBAImage.resize(e,{width:t.w,height:t.h}),RGBAImage.copy(g.data,e,{x:0,y:0},{x:n.x+padding,y:n.y+padding},g.data),i[d]=imagePosition(n,g)}return t.shrink(),RGBAImage.resize(e,{width:t.w,height:t.h}),{image:e,positions:i}}var ShelfPack=_dereq_("@mapbox/shelf-pack"),ref=_dereq_("../util/image"),RGBAImage=ref.RGBAImage,padding=1;module.exports={imagePosition:imagePosition,makeImageAtlas:makeImageAtlas};
-},{"../util/image":256,"@mapbox/shelf-pack":3}],87:[function(_dereq_,module,exports){
-"use strict";var ShelfPack=_dereq_("@mapbox/shelf-pack"),ref=_dereq_("../util/image"),RGBAImage=ref.RGBAImage,ref$1=_dereq_("./image_atlas"),imagePosition=ref$1.imagePosition,Texture=_dereq_("./texture"),padding=1,ImageManager=function(){this.images={},this.loaded=!1,this.requestors=[],this.shelfPack=new ShelfPack(64,64,{autoResize:!0}),this.patterns={},this.atlasImage=RGBAImage.create({width:64,height:64}),this.dirty=!0};ImageManager.prototype.isLoaded=function(){return this.loaded},ImageManager.prototype.setLoaded=function(e){var t=this;if(this.loaded!==e&&(this.loaded=e,e)){for(var a=0,i=t.requestors;a<i.length;a+=1){var r=i[a],s=r.ids,h=r.callback;t._notify(s,h)}this.requestors=[]}},ImageManager.prototype.getImage=function(e){return this.images[e]},ImageManager.prototype.addImage=function(e,t){this.images[e]=t},ImageManager.prototype.removeImage=function(e){delete this.images[e];var t=this.patterns[e];t&&(this.shelfPack.unref(t.bin),delete this.patterns[e])},ImageManager.prototype.getImages=function(e,t){var a=this,i=!0;if(!this.isLoaded())for(var r=0,s=e;r<s.length;r+=1){var h=s[r];a.images[h]||(i=!1)}this.isLoaded()||i?this._notify(e,t):this.requestors.push({ids:e,callback:t})},ImageManager.prototype._notify=function(e,t){for(var a=this,i={},r=0,s=e;r<s.length;r+=1){var h=s[r],g=a.images[h];g&&(i[h]=g)}t(null,i)},ImageManager.prototype.getPixelSize=function(){return{width:this.shelfPack.w,height:this.shelfPack.h}},ImageManager.prototype.getPattern=function(e){var t=this.patterns[e];if(t)return t.position;var a=this.getImage(e);if(!a)return null;var i=a.data.width+2*padding,r=a.data.height+2*padding,s=this.shelfPack.packOne(i,r);if(!s)return null;RGBAImage.resize(this.atlasImage,this.getPixelSize());var h=a.data,g=this.atlasImage,n=s.x+padding,o=s.y+padding,d=h.width,m=h.height;RGBAImage.copy(h,g,{x:0,y:0},{x:n,y:o},{width:d,height:m}),RGBAImage.copy(h,g,{x:0,y:m-1},{x:n,y:o-1},{width:d,height:1}),RGBAImage.copy(h,g,{x:0,y:0},{x:n,y:o+m},{width:d,height:1}),RGBAImage.copy(h,g,{x:d-1,y:0},{x:n-1,y:o},{width:1,height:m}),RGBAImage.copy(h,g,{x:0,y:0},{x:n+d,y:o},{width:1,height:m}),this.dirty=!0;var p=imagePosition(s,a);return this.patterns[e]={bin:s,position:p},p},ImageManager.prototype.bind=function(e){this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new Texture(e,this.atlasImage,e.RGBA),this.atlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE)},module.exports=ImageManager;
-},{"../util/image":256,"./image_atlas":86,"./texture":93,"@mapbox/shelf-pack":3}],88:[function(_dereq_,module,exports){
-"use strict";var util=_dereq_("../util/util"),LineAtlas=function(t,i){this.width=t,this.height=i,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}};LineAtlas.prototype.getDash=function(t,i){var e=t.join(",")+String(i);return this.positions[e]||(this.positions[e]=this.addDash(t,i)),this.positions[e]},LineAtlas.prototype.addDash=function(t,i){var e=this,h=i?7:0,s=2*h+1;if(this.nextRow+s>this.height)return util.warnOnce("LineAtlas out of space"),null;for(var a=0,r=0;r<t.length;r++)a+=t[r];for(var n=this.width/a,E=n/2,T=t.length%2==1,o=-h;o<=h;o++)for(var R=e.nextRow+h+o,d=e.width*R,u=T?-t[t.length-1]:0,x=t[0],l=1,_=0;_<this.width;_++){for(;x<_/n;)u=x,x+=t[l],T&&l===t.length-1&&(x+=t[0]),l++;var A=Math.abs(_-u*n),g=Math.abs(_-x*n),w=Math.min(A,g),D=l%2==1,U=void 0;if(i){var f=h?o/h*(E+1):0;if(D){var p=E-Math.abs(f);U=Math.sqrt(w*w+p*p)}else U=E-Math.sqrt(w*w+f*f)}else U=(D?1:-1)*w;e.data[3+4*(d+_)]=Math.max(0,Math.min(255,U+128))}var X={y:(this.nextRow+h+.5)/this.height,height:2*h/this.height,width:a};return this.nextRow+=s,this.dirty=!0,X},LineAtlas.prototype.bind=function(t){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.RGBA,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.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,this.data))},module.exports=LineAtlas;
-},{"../util/util":266}],89:[function(_dereq_,module,exports){
-"use strict";var browser=_dereq_("../util/browser"),mat4=_dereq_("@mapbox/gl-matrix").mat4,SourceCache=_dereq_("../source/source_cache"),EXTENT=_dereq_("../data/extent"),pixelsToTileUnits=_dereq_("../source/pixels_to_tile_units"),util=_dereq_("../util/util"),VertexBuffer=_dereq_("../gl/vertex_buffer"),VertexArrayObject=_dereq_("./vertex_array_object"),RasterBoundsArray=_dereq_("../data/raster_bounds_array"),PosArray=_dereq_("../data/pos_array"),ref=_dereq_("../data/program_configuration"),ProgramConfiguration=ref.ProgramConfiguration,CrossTileSymbolIndex=_dereq_("../symbol/cross_tile_symbol_index"),shaders=_dereq_("../shaders"),Program=_dereq_("./program"),RenderTexture=_dereq_("./render_texture"),updateTileMasks=_dereq_("./tile_mask"),draw={symbol:_dereq_("./draw_symbol"),circle:_dereq_("./draw_circle"),heatmap:_dereq_("./draw_heatmap"),line:_dereq_("./draw_line"),fill:_dereq_("./draw_fill"),"fill-extrusion":_dereq_("./draw_fill_extrusion"),raster:_dereq_("./draw_raster"),background:_dereq_("./draw_background"),debug:_dereq_("./draw_debug")},Painter=function(e,r){this.gl=e,this.transform=r,this._tileTextures={},this.setup(),this.numSublayers=SourceCache.maxUnderzooming+SourceCache.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.lineWidthRange=e.getParameter(e.ALIASED_LINE_WIDTH_RANGE),this.emptyProgramConfiguration=new ProgramConfiguration,this.crossTileSymbolIndex=new CrossTileSymbolIndex};Painter.prototype.resize=function(e,r){var t=this,i=this.gl;if(this.width=e*browser.devicePixelRatio,this.height=r*browser.devicePixelRatio,i.viewport(0,0,this.width,this.height),this.style)for(var a=0,s=t.style._order;a<s.length;a+=1){var n=s[a];t.style._layers[n].resize(i)}this.depthRbo&&(this.gl.deleteRenderbuffer(this.depthRbo),this.depthRbo=null)},Painter.prototype.setup=function(){var e=this.gl;e.enable(e.BLEND),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA),e.enable(e.STENCIL_TEST),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),this._depthMask=!1,e.depthMask(!1);var r=new PosArray;r.emplaceBack(0,0),r.emplaceBack(EXTENT,0),r.emplaceBack(0,EXTENT),r.emplaceBack(EXTENT,EXTENT),this.tileExtentBuffer=new VertexBuffer(e,r),this.tileExtentVAO=new VertexArrayObject,this.tileExtentPatternVAO=new VertexArrayObject;var t=new PosArray;t.emplaceBack(0,0),t.emplaceBack(EXTENT,0),t.emplaceBack(EXTENT,EXTENT),t.emplaceBack(0,EXTENT),t.emplaceBack(0,0),this.debugBuffer=new VertexBuffer(e,t),this.debugVAO=new VertexArrayObject;var i=new RasterBoundsArray;i.emplaceBack(0,0,0,0),i.emplaceBack(EXTENT,0,EXTENT,0),i.emplaceBack(0,EXTENT,0,EXTENT),i.emplaceBack(EXTENT,EXTENT,EXTENT,EXTENT),this.rasterBoundsBuffer=new VertexBuffer(e,i),this.rasterBoundsVAO=new VertexArrayObject;var a=new PosArray;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=new VertexBuffer(e,a),this.viewportVAO=new VertexArrayObject,this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=e.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&e.getExtension("OES_texture_half_float_linear")},Painter.prototype.clearColor=function(){var e=this.gl;e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},Painter.prototype.clearStencil=function(){var e=this.gl;e.colorMask(!1,!1,!1,!1),this.depthMask(!1),e.disable(e.DEPTH_TEST),e.enable(e.STENCIL_TEST),e.stencilMask(255),e.stencilOp(e.ZERO,e.ZERO,e.ZERO),e.stencilFunc(e.ALWAYS,0,255);var r=mat4.create();mat4.ortho(r,0,this.width,this.height,0,0,1),mat4.scale(r,r,[e.drawingBufferWidth,e.drawingBufferHeight,0]);var t=this.useProgram("fill",ProgramConfiguration.forTileClippingMask());e.uniformMatrix4fv(t.uniforms.u_matrix,!1,r),this.viewportVAO.bind(e,t,this.viewportBuffer),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.stencilMask(0),e.colorMask(!0,!0,!0,!0),this.depthMask(!0),e.enable(e.DEPTH_TEST)},Painter.prototype.clearDepth=function(){var e=this.gl;e.clearDepth(1),this.depthMask(!0),e.clear(e.DEPTH_BUFFER_BIT)},Painter.prototype._renderTileClippingMasks=function(e){var r=this,t=this.gl;t.colorMask(!1,!1,!1,!1),this.depthMask(!1),t.disable(t.DEPTH_TEST),t.enable(t.STENCIL_TEST),t.stencilMask(255),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE);var i=1;this._tileClippingMaskIDs={};for(var a=ProgramConfiguration.forTileClippingMask(),s=0,n=e;s<n.length;s+=1){var o=n[s],l=r._tileClippingMaskIDs[o.id]=i++;t.stencilFunc(t.ALWAYS,l,255);var h=r.useProgram("fill",a);t.uniformMatrix4fv(h.uniforms.u_matrix,!1,o.posMatrix),r.tileExtentVAO.bind(t,h,r.tileExtentBuffer),t.drawArrays(t.TRIANGLE_STRIP,0,r.tileExtentBuffer.length)}t.stencilMask(0),t.colorMask(!0,!0,!0,!0),this.depthMask(!0),t.enable(t.DEPTH_TEST)},Painter.prototype.enableTileClippingMask=function(e){var r=this.gl;r.stencilFunc(r.EQUAL,this._tileClippingMaskIDs[e.id],255)},Painter.prototype.render=function(e,r){var t=this;this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager;for(var i in e.sourceCaches){var a=t.style.sourceCaches[i];a.used&&a.prepare(t.gl)}var s=this.style._order,n=util.filterObject(this.style.sourceCaches,function(e){return"raster"===e._source.type});for(var o in n)!function(e){var r=n[e],i=r.getVisibleCoordinates(),a=i.map(function(e){return r.getTile(e)});updateTileMasks(a,t.gl)}(o);this.renderPass="3d";for(var l,h=!0,c=[],u=0;u<s.length;u++){var p=t.style._layers[s[u]];if(p.has3DPass()&&!p.isHidden(t.transform.zoom)&&(p.source!==(l&&l.id)&&(l=t.style.sourceCaches[p.source],c=[],l&&(t.clearStencil(),c=l.getVisibleCoordinates()),c.reverse()),c.length)){t._setup3DRenderbuffer();var d=p.viewportFrame||new RenderTexture(t);p.viewportFrame=d,d.bindWithDepth(t.depthRbo),h&&(t.clearDepth(),h=!1),t.renderLayer(t,l,p,c),d.unbind()}}this.clearColor(),this.clearDepth(),this.showOverdrawInspector(r.showOverdrawInspector),this.depthRange=(e._order.length+2)*this.numSublayers*this.depthEpsilon,this.renderPass="opaque";var f,g=[];for(this.currentLayer=s.length-1,this._showOverdrawInspector||this.gl.disable(this.gl.BLEND),this.currentLayer;this.currentLayer>=0;this.currentLayer--){var T=t.style._layers[s[t.currentLayer]];T.source!==(f&&f.id)&&(f=t.style.sourceCaches[T.source],g=[],f&&(t.clearStencil(),g=f.getVisibleCoordinates(),f.getSource().isTileClipped&&t._renderTileClippingMasks(g))),t.renderLayer(t,f,T,g)}this.renderPass="translucent";var E,_=[];for(this.gl.enable(this.gl.BLEND),this.currentLayer=0,this.currentLayer;this.currentLayer<s.length;this.currentLayer++){var m=t.style._layers[s[t.currentLayer]];m.source!==(E&&E.id)&&(E=t.style.sourceCaches[m.source],_=[],E&&(t.clearStencil(),_=E.getVisibleCoordinates(),E.getSource().isTileClipped&&t._renderTileClippingMasks(_)),_.reverse()),t.renderLayer(t,E,m,_)}if(this.options.showTileBoundaries){var y=this.style.sourceCaches[Object.keys(this.style.sourceCaches)[0]];y&&draw.debug(this,y,y.getVisibleCoordinates())}},Painter.prototype._setup3DRenderbuffer=function(){if(!this.depthRbo){var e=this.gl;this.depthRbo=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this.depthRbo),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,this.width,this.height),e.bindRenderbuffer(e.RENDERBUFFER,null)}this.depthRboAttached=!0},Painter.prototype.depthMask=function(e){e!==this._depthMask&&(this._depthMask=e,this.gl.depthMask(e))},Painter.prototype.renderLayer=function(e,r,t,i){t.isHidden(this.transform.zoom)||("background"===t.type||i.length)&&(this.id=t.id,draw[t.type](e,r,t,i))},Painter.prototype.setDepthSublayer=function(e){var r=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon,t=r-1+this.depthRange;this.gl.depthRange(t,r)},Painter.prototype.translatePosMatrix=function(e,r,t,i,a){if(!t[0]&&!t[1])return e;var s=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(s){var n=Math.sin(s),o=Math.cos(s);t=[t[0]*o-t[1]*n,t[0]*n+t[1]*o]}var l=[a?t[0]:pixelsToTileUnits(r,t[0],this.transform.zoom),a?t[1]:pixelsToTileUnits(r,t[1],this.transform.zoom),0],h=new Float32Array(16);return mat4.translate(h,e,l),h},Painter.prototype.saveTileTexture=function(e){var r=this._tileTextures[e.size[0]];r?r.push(e):this._tileTextures[e.size[0]]=[e]},Painter.prototype.getTileTexture=function(e){var r=this._tileTextures[e];return r&&r.length>0?r.pop():null},Painter.prototype.lineWidth=function(e){this.gl.lineWidth(util.clamp(e,this.lineWidthRange[0],this.lineWidthRange[1]))},Painter.prototype.showOverdrawInspector=function(e){if(e||this._showOverdrawInspector){this._showOverdrawInspector=e;var r=this.gl;if(e){r.blendFunc(r.CONSTANT_COLOR,r.ONE);r.blendColor(1/8,1/8,1/8,0),r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT)}else r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA)}},Painter.prototype._createProgramCached=function(e,r){this.cache=this.cache||{};var t=""+e+(r.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[t]||(this.cache[t]=new Program(this.gl,shaders[e],r,this._showOverdrawInspector)),this.cache[t]},Painter.prototype.useProgram=function(e,r){var t=this.gl,i=this._createProgramCached(e,r||this.emptyProgramConfiguration);return this.currentProgram!==i&&(t.useProgram(i.program),this.currentProgram=i),i},module.exports=Painter;
-},{"../data/extent":58,"../data/pos_array":62,"../data/program_configuration":63,"../data/raster_bounds_array":64,"../gl/vertex_buffer":72,"../shaders":97,"../source/pixels_to_tile_units":104,"../source/source_cache":109,"../symbol/cross_tile_symbol_index":211,"../util/browser":245,"../util/util":266,"./draw_background":74,"./draw_circle":75,"./draw_debug":77,"./draw_fill":78,"./draw_fill_extrusion":79,"./draw_heatmap":80,"./draw_line":81,"./draw_raster":82,"./draw_symbol":83,"./program":91,"./render_texture":92,"./tile_mask":94,"./vertex_array_object":95,"@mapbox/gl-matrix":1}],90:[function(_dereq_,module,exports){
-"use strict";var pixelsToTileUnits=_dereq_("../source/pixels_to_tile_units");exports.isPatternMissing=function(r,i){if(!r)return!1;var e=i.imageManager.getPattern(r.from),o=i.imageManager.getPattern(r.to);return!e||!o},exports.prepare=function(r,i,e){var o=i.gl,t=i.imageManager.getPattern(r.from),n=i.imageManager.getPattern(r.to);o.uniform1i(e.uniforms.u_image,0),o.uniform2fv(e.uniforms.u_pattern_tl_a,t.tl),o.uniform2fv(e.uniforms.u_pattern_br_a,t.br),o.uniform2fv(e.uniforms.u_pattern_tl_b,n.tl),o.uniform2fv(e.uniforms.u_pattern_br_b,n.br);var u=i.imageManager.getPixelSize(),a=u.width,f=u.height;o.uniform2fv(e.uniforms.u_texsize,[a,f]),o.uniform1f(e.uniforms.u_mix,r.t),o.uniform2fv(e.uniforms.u_pattern_size_a,t.displaySize),o.uniform2fv(e.uniforms.u_pattern_size_b,n.displaySize),o.uniform1f(e.uniforms.u_scale_a,r.fromScale),o.uniform1f(e.uniforms.u_scale_b,r.toScale),o.activeTexture(o.TEXTURE0),i.imageManager.bind(o)},exports.setTile=function(r,i,e){var o=i.gl;o.uniform1f(e.uniforms.u_tile_units_to_pixels,1/pixelsToTileUnits(r,1,i.transform.tileZoom));var t=Math.pow(2,r.coord.z),n=r.tileSize*Math.pow(2,i.transform.tileZoom)/t,u=n*(r.coord.x+r.coord.w*t),a=n*r.coord.y;o.uniform2f(e.uniforms.u_pixel_coord_upper,u>>16,a>>16),o.uniform2f(e.uniforms.u_pixel_coord_lower,65535&u,65535&a)};
-},{"../source/pixels_to_tile_units":104}],91:[function(_dereq_,module,exports){
-"use strict";var browser=_dereq_("../util/browser"),shaders=_dereq_("../shaders"),ref=_dereq_("../data/program_configuration"),ProgramConfiguration=ref.ProgramConfiguration,VertexArrayObject=_dereq_("./vertex_array_object"),Program=function(r,e,t,a){var o=this;this.gl=r,this.program=r.createProgram();var i=t.defines().concat("#define DEVICE_PIXEL_RATIO "+browser.devicePixelRatio.toFixed(1));a&&i.push("#define OVERDRAW_INSPECTOR;");var n=i.concat(shaders.prelude.fragmentSource,e.fragmentSource).join("\n"),s=i.concat(shaders.prelude.vertexSource,e.vertexSource).join("\n"),m=r.createShader(r.FRAGMENT_SHADER);r.shaderSource(m,n),r.compileShader(m),r.attachShader(this.program,m);var g=r.createShader(r.VERTEX_SHADER);r.shaderSource(g,s),r.compileShader(g),r.attachShader(this.program,g);for(var c=t.interface?t.interface.layoutAttributes:[],u=0;u<c.length;u++)r.bindAttribLocation(o.program,u,c[u].name);r.linkProgram(this.program),this.numAttributes=r.getProgramParameter(this.program,r.ACTIVE_ATTRIBUTES),this.attributes={},this.uniforms={};for(var h=0;h<this.numAttributes;h++){var f=r.getActiveAttrib(o.program,h);f&&(o.attributes[f.name]=r.getAttribLocation(o.program,f.name))}for(var d=r.getProgramParameter(this.program,r.ACTIVE_UNIFORMS),p=0;p<d;p++){var v=r.getActiveUniform(o.program,p);v&&(o.uniforms[v.name]=r.getUniformLocation(o.program,v.name))}};Program.prototype.draw=function(r,e,t,a,o,i,n,s,m){for(var g,c=this,u=(g={},g[r.LINES]=2,g[r.TRIANGLES]=3,g)[e],h=0,f=i.get();h<f.length;h+=1){var d=f[h],p=d.vaos||(d.vaos={});(p[t]||(p[t]=new VertexArrayObject)).bind(r,c,a,o,n&&n.paintVertexBuffer,d.vertexOffset,s,m),r.drawElements(e,d.primitiveLength*u,r.UNSIGNED_SHORT,d.primitiveOffset*u*2)}},module.exports=Program;
-},{"../data/program_configuration":63,"../shaders":97,"../util/browser":245,"./vertex_array_object":95}],92:[function(_dereq_,module,exports){
-"use strict";var RenderTexture=function(e){var E=this.gl=e.gl,t=this.texture=E.createTexture();E.bindTexture(E.TEXTURE_2D,t),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_S,E.CLAMP_TO_EDGE),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_T,E.CLAMP_TO_EDGE),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_MIN_FILTER,E.LINEAR),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_MAG_FILTER,E.LINEAR),E.texImage2D(E.TEXTURE_2D,0,E.RGBA,e.width,e.height,0,E.RGBA,E.UNSIGNED_BYTE,null),E.bindTexture(E.TEXTURE_2D,null);var r=this.fbo=E.createFramebuffer();E.bindFramebuffer(E.FRAMEBUFFER,r),E.framebufferTexture2D(E.FRAMEBUFFER,E.COLOR_ATTACHMENT0,E.TEXTURE_2D,t,0)};RenderTexture.prototype.bindWithDepth=function(e){var E=this.gl;E.bindFramebuffer(E.FRAMEBUFFER,this.fbo),this.attachedRbo!==e&&(E.framebufferRenderbuffer(E.FRAMEBUFFER,E.DEPTH_ATTACHMENT,E.RENDERBUFFER,e),this.attachedRbo=e)},RenderTexture.prototype.unbind=function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},module.exports=RenderTexture;
-},{}],93:[function(_dereq_,module,exports){
-"use strict";var ref=_dereq_("../util/window"),HTMLImageElement=ref.HTMLImageElement,HTMLCanvasElement=ref.HTMLCanvasElement,HTMLVideoElement=ref.HTMLVideoElement,ImageData=ref.ImageData,Texture=function(e,t,i){this.gl=e;var r=t.width,a=t.height;this.size=[r,a],this.format=i,this.texture=e.createTexture(),this.update(t)};Texture.prototype.update=function(e){var t=e.width,i=e.height;this.size=[t,i];var r=this,a=r.gl;a.bindTexture(a.TEXTURE_2D,this.texture),a.pixelStorei(a.UNPACK_ALIGNMENT,1),this.format===a.RGBA&&a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData?a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,a.UNSIGNED_BYTE,e):a.texImage2D(a.TEXTURE_2D,0,this.format,t,i,0,this.format,a.UNSIGNED_BYTE,e.data)},Texture.prototype.bind=function(e,t,i){var r=this,a=r.gl;a.bindTexture(a.TEXTURE_2D,this.texture),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,i||e),this.filter=e),t!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,t),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,t),this.wrap=t)},Texture.prototype.destroy=function(){this.gl.deleteTexture(this.texture),this.texture=null},module.exports=Texture;
-},{"../util/window":247}],94:[function(_dereq_,module,exports){
-"use strict";function computeTileMasks(o,r,e,i,s){for(var c=0;c<e.length;c++){var d=e[c];if(i.isLessThan(d.coord))break;if(r.id===d.coord.id)return;if(d.coord.isChildOf(r,d.sourceMaxZoom)){for(var n=r.children(1/0),t=0;t<n.length;t++){computeTileMasks(o,n[t],e.slice(c),i,s)}return}}var a=r.z-o.z,l=new TileCoord(a,r.x-(o.x<<a),r.y-(o.y<<a)).id;s[l]=s[l]||!0}var TileCoord=_dereq_("../source/tile_coord");module.exports=function(o,r){for(var e=o.sort(function(o,r){return o.coord.isLessThan(r.coord)?-1:r.coord.isLessThan(o.coord)?1:0}),i=0;i<e.length;i++){var s={},c=e[i],d=e.slice(i+1);computeTileMasks(c.coord.wrapped(),c.coord,d,new TileCoord(0,0,0,c.coord.w+1),s),c.setMask(s,r)}};
-},{"../source/tile_coord":112}],95:[function(_dereq_,module,exports){
-"use strict";var VertexArrayObject=function(){this.boundProgram=null,this.boundVertexBuffer=null,this.boundVertexBuffer2=null,this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};VertexArrayObject.prototype.bind=function(e,t,r,i,n,b,s,u){void 0===e.extVertexArrayObject&&(e.extVertexArrayObject=e.getExtension("OES_vertex_array_object"));var o=!this.vao||this.boundProgram!==t||this.boundVertexBuffer!==r||this.boundVertexBuffer2!==n||this.boundIndexBuffer!==i||this.boundVertexOffset!==b||this.boundDynamicVertexBuffer!==s||this.boundDynamicVertexBuffer2!==u;!e.extVertexArrayObject||o?(this.freshBind(e,t,r,i,n,b,s,u),this.gl=e):(e.extVertexArrayObject.bindVertexArrayOES(this.vao),s&&s.bind(),i&&i.dynamicDraw&&i.bind(),u&&u.bind())},VertexArrayObject.prototype.freshBind=function(e,t,r,i,n,b,s,u){var o,x=t.numAttributes;if(e.extVertexArrayObject)this.vao&&this.destroy(),this.vao=e.extVertexArrayObject.createVertexArrayOES(),e.extVertexArrayObject.bindVertexArrayOES(this.vao),o=0,this.boundProgram=t,this.boundVertexBuffer=r,this.boundVertexBuffer2=n,this.boundIndexBuffer=i,this.boundVertexOffset=b,this.boundDynamicVertexBuffer=s,this.boundDynamicVertexBuffer2=u;else{o=e.currentNumAttributes||0;for(var a=x;a<o;a++)e.disableVertexAttribArray(a)}r.enableAttributes(e,t),n&&n.enableAttributes(e,t),s&&s.enableAttributes(e,t),u&&u.enableAttributes(e,t),r.bind(),r.setVertexAttribPointers(e,t,b),n&&(n.bind(),n.setVertexAttribPointers(e,t,b)),s&&(s.bind(),s.setVertexAttribPointers(e,t,b)),i&&i.bind(),u&&(u.bind(),u.setVertexAttribPointers(e,t,b)),e.currentNumAttributes=x},VertexArrayObject.prototype.destroy=function(){this.vao&&(this.gl.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)},module.exports=VertexArrayObject;
-},{}],96:[function(_dereq_,module,exports){
-"use strict";var util=_dereq_("../util/util");exports.packUint8ToFloat=function(t,l){return t=util.clamp(Math.floor(t),0,255),l=util.clamp(Math.floor(l),0,255),256*t+l};
-},{"../util/util":266}],97:[function(_dereq_,module,exports){
-"use strict";var shaders={prelude:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n\n// Unpack a pair of values that have been packed into a single float.\n// The packed values are assumed to be 8-bit unsigned integers, and are\n// packed like so:\n// packedValue = floor(input[0]) * 256 + input[1],\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\n\nvec2 unpack_opacity(const float packedOpacity) {\n int intOpacity = int(packedOpacity) / 2;\n return vec2(float(intOpacity) / 127.0, mod(packedOpacity, 2.0));\n}\n\n// To minimize the number of attributes needed, we encode a 4-component\n// color into a pair of floats (i.e. a vec2) as follows:\n// [ floor(color.r * 255) * 256 + color.g * 255,\n// floor(color.b * 255) * 256 + color.g * 255 ]\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\n\n// Unpack a pair of paint values and interpolate between them.\nfloat unpack_mix_vec2(const vec2 packedValue, const float t) {\n return mix(packedValue[0], packedValue[1], t);\n}\n\n// Unpack a pair of paint values and interpolate between them.\nvec4 unpack_mix_vec4(const vec4 packedColors, const float t) {\n vec4 minColor = decode_color(vec2(packedColors[0], packedColors[1]));\n vec4 maxColor = decode_color(vec2(packedColors[2], packedColors[3]));\n return mix(minColor, maxColor, t);\n}\n\n// The offset depends on how many pixels are between the world origin and the edge of the tile:\n// vec2 offset = mod(pixel_coord, size)\n//\n// At high zoom levels there are a ton of pixels between the world origin and the edge of the tile.\n// The glsl spec only guarantees 16 bits of precision for highp floats. We need more than that.\n//\n// The pixel_coord is passed in as two 16 bit values:\n// pixel_coord_upper = floor(pixel_coord / 2^16)\n// pixel_coord_lower = mod(pixel_coord, 2^16)\n//\n// The offset is calculated in a series of steps that should preserve this precision:\nvec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,\n const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {\n\n vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);\n return (tile_units_to_pixels * pos + offset) / pattern_size;\n}\n"},circle:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec3 v_data;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize highp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n vec2 extrude = v_data.xy;\n float extrude_length = length(extrude);\n\n lowp float antialiasblur = v_data.z;\n float antialiased_blur = -max(blur, antialiasblur);\n\n float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0);\n\n float color_t = stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n extrude_length - radius / (radius + stroke_width)\n );\n\n gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform bool u_scale_with_map;\nuniform bool u_pitch_with_map;\nuniform vec2 u_extrude_scale;\nuniform highp float u_camera_to_center_distance;\n\nattribute vec2 a_pos;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec3 v_data;\n\nvoid main(void) {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize highp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n vec2 extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n vec2 circle_center = floor(a_pos * 0.5);\n if (u_pitch_with_map) {\n vec2 corner_position = circle_center;\n if (u_scale_with_map) {\n corner_position += extrude * (radius + stroke_width) * u_extrude_scale;\n } else {\n // Pitching the circle with the map effectively scales it with the map\n // To counteract the effect for pitch-scale: viewport, we rescale the\n // whole circle based on the pitch scaling effect at its central point\n vec4 projected_center = u_matrix * vec4(circle_center, 0, 1);\n corner_position += extrude * (radius + stroke_width) * u_extrude_scale * (projected_center.w / u_camera_to_center_distance);\n }\n\n gl_Position = u_matrix * vec4(corner_position, 0, 1);\n } else {\n gl_Position = u_matrix * vec4(circle_center, 0, 1);\n\n if (u_scale_with_map) {\n gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * u_camera_to_center_distance;\n } else {\n gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * gl_Position.w;\n }\n }\n\n // This is a minimum blur distance that serves as a faux-antialiasing for\n // the circle. since blur is a ratio of the circle's size and the intent is\n // to keep the blur at roughly 1px, the two are inversely related.\n lowp float antialiasblur = 1.0 / DEVICE_PIXEL_RATIO / (radius + stroke_width);\n\n v_data = vec3(extrude.x, extrude.y, antialiasblur);\n}\n"},heatmap:{fragmentSource:"#pragma mapbox: define highp float weight\n\nuniform highp float u_intensity;\nuniform highp float u_radius;\nvarying vec2 v_extrude;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main() {\n #pragma mapbox: initialize highp float weight\n\n // Kernel density estimation with a Gaussian kernel of size 5x5\n float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);\n float val = weight * u_intensity * GAUSS_COEF * exp(d);\n\n gl_FragColor = vec4(val, 1.0, 1.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#pragma mapbox: define highp float weight\n\nuniform mat4 u_matrix;\nuniform float u_extrude_scale;\nuniform float u_radius;\nuniform float u_opacity;\nuniform float u_intensity;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_extrude;\n\n// Effective \"0\" in the kernel density texture to adjust the kernel size to;\n// this empirically chosen number minimizes artifacts on overlapping kernels\n// for typical heatmap cases (assuming clustered source)\nconst highp float ZERO = 1.0 / 255.0 / 16.0;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main(void) {\n #pragma mapbox: initialize highp float weight\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n vec2 unscaled_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n // This 'extrude' comes in ranging from [-1, -1], to [1, 1]. We'll use\n // it to produce the vertices of a square mesh framing the point feature\n // we're adding to the kernel density texture. We'll also pass it as\n // a varying, so that the fragment shader can determine the distance of\n // each fragment from the point feature.\n // Before we do so, we need to scale it up sufficiently so that the\n // kernel falls effectively to zero at the edge of the mesh.\n // That is, we want to know S such that\n // weight * u_intensity * GAUSS_COEF * exp(-0.5 * 3.0^2 * S^2) == ZERO\n // Which solves to:\n // S = sqrt(-2.0 * log(ZERO / (weight * u_intensity * GAUSS_COEF))) / 3.0\n float S = sqrt(-2.0 * log(ZERO / weight / u_intensity / GAUSS_COEF)) / 3.0;\n\n // Pass the varying in units of u_radius\n v_extrude = S * unscaled_extrude;\n\n // Scale by u_radius and the zoom-based scale factor to produce actual\n // mesh position\n vec2 extrude = v_extrude * u_radius * u_extrude_scale;\n\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n vec4 pos = vec4(floor(a_pos * 0.5) + extrude, 0, 1);\n\n gl_Position = u_matrix * pos;\n}\n"},heatmapTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform sampler2D u_color_ramp;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n float t = texture2D(u_image, v_pos).r;\n vec4 color = texture2D(u_color_ramp, vec2(t, 0.5));\n gl_FragColor = color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n"},collisionBox:{fragmentSource:"\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n\n float alpha = 0.5;\n\n // Red = collision, hide label\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n gl_FragColor *= .1;\n }\n}",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n gl_Position.xy += a_extrude * u_extrude_scale * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n}\n"},collisionCircle:{fragmentSource:"\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n float alpha = 0.5;\n\n // Red = collision, hide label\n vec4 color = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n color = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n color *= .2;\n }\n\n float extrude_scale_length = length(v_extrude_scale);\n float extrude_length = length(v_extrude) * extrude_scale_length;\n float stroke_width = 3.0;\n float radius = v_radius * extrude_scale_length;\n\n float distance_to_edge = abs(extrude_length - radius);\n float opacity_t = smoothstep(-stroke_width, 0.0, -distance_to_edge);\n\n gl_FragColor = opacity_t * color;\n}\n",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\n\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = 0.5 + 0.5 * (camera_to_anchor_distance / u_camera_to_center_distance);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n\n highp float padding_factor = 1.2; // Pad the vertices slightly to make room for anti-alias blur\n gl_Position.xy += a_extrude * u_extrude_scale * padding_factor * gl_Position.w / collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n v_radius = abs(a_extrude.y); // We don't pitch the circles, so both units of the extrusion vector are equal in magnitude to the radius\n\n v_extrude = a_extrude * padding_factor;\n v_extrude_scale = u_extrude_scale * u_camera_to_center_distance / collision_perspective_ratio;\n}\n"},debug:{fragmentSource:"uniform highp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillOutlinePattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n\n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n 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);\n 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);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n 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);\n 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);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n gl_FragColor = v_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize highp vec4 color\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float ed = a_edgedistance; // use each attrib in order to not trip a VAO assert\n float t = mod(a_normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(a_normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n vec4 mixedColor = mix(color1, color2, u_mix);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\nuniform float u_height_factor;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec3 a_normal;\nattribute float a_edgedistance;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\nvarying float v_directional;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(a_normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = a_normal.x == 1.0 && a_normal.y == 0.0 && a_normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(a_edgedistance, z * u_height_factor); // extrusion side\n\n 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, pos);\n 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, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(a_normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (a_normal.y != 0.0) {\n directional *= clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0);\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_image, v_pos) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n"},line:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_width2.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",
-vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + ANTIALIASING;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform float u_fade_t;\nuniform float u_opacity;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n if (color0.a > 0.0) {\n color0.rgb = color0.rgb / color0.a;\n }\n if (color1.a > 0.0) {\n color1.rgb = color1.rgb / color1.a;\n }\n vec4 color = mix(color0, color1, u_fade_t);\n color.a *= u_opacity;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n // We are using Int16 for texture position coordinates to give us enough precision for\n // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n // as an arbitrarily high number to preserve adequate precision when rendering.\n // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n // so math for modifying either is consistent.\n v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},symbolIcon:{fragmentSource:"uniform sampler2D u_texture;\n\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n lowp float alpha = opacity * v_fade_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform float u_fade_change;\n\n#pragma mapbox: define lowp float opacity\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n\n float size;\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // See comments in symbol_sdf.vertex\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = 0.5 + 0.5 * distance_ratio;\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // See comments in symbol_sdf.vertex\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 64.0 * fontScale), 0.0, 1.0);\n\n v_tex = a_tex / u_texsize;\n vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n v_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n}\n"},symbolSDF:{fragmentSource:"#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO\n\nuniform bool u_is_halo;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform sampler2D u_texture;\nuniform highp float u_gamma_scale;\nuniform bool u_is_text;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 tex = v_data0.xy;\n float gamma_scale = v_data1.x;\n float size = v_data1.y;\n float fade_opacity = v_data1[2];\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n lowp vec4 color = fill_color;\n highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);\n lowp float buff = (256.0 - 64.0) / 256.0;\n if (u_is_halo) {\n color = halo_color;\n gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);\n buff = (6.0 - halo_width / fontScale) / SDF_PX;\n }\n\n lowp float dist = texture2D(u_texture, tex).a;\n highp float gamma_scaled = gamma * gamma_scale;\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n gl_FragColor = color * (alpha * opacity * fade_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\n// contents of a_size vary based on the type of property value\n// used for {text,icon}-size.\n// For constants, a_size is disabled.\n// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.\n// For composite functions:\n// [ text-size(lowerZoomStop, feature),\n// text-size(upperZoomStop, feature) ]\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\n\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_camera_to_center_distance;\nuniform float u_fade_change;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n float size;\n\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 10.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 10.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // If the label is pitched with the map, layout is done in pitched space,\n // which makes labels in the distance smaller relative to viewport space.\n // We counteract part of that effect by multiplying by the perspective ratio.\n // If the label isn't pitched with the map, we do layout in viewport space,\n // which makes labels in the distance larger relative to the features around\n // them. We counteract part of that effect by dividing by the perspective ratio.\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = 0.5 + 0.5 * distance_ratio;\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units\n // To figure out that angle in projected space, we draw a short horizontal line in tile\n // space, project it, and measure its angle in projected space.\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 64.0 * fontScale), 0.0, 1.0);\n float gamma_scale = gl_Position.w;\n\n vec2 tex = a_tex / u_texsize;\n vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n float interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n\n v_data0 = vec2(tex.x, tex.y);\n v_data1 = vec3(gamma_scale, size, interpolated_fade_opacity);\n}\n"}},re=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,loop=function(e){var n=shaders[e],a={};n.fragmentSource=n.fragmentSource.replace(re,function(e,n,t,o,i){return a[i]=!0,"define"===n?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+t+" "+o+" "+i+";\n#else\nuniform "+t+" "+o+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+t+" "+o+" "+i+" = u_"+i+";\n#endif\n"}),n.vertexSource=n.vertexSource.replace(re,function(e,n,t,o,i){var r="float"===o?"vec2":"vec4";return a[i]?"define"===n?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float a_"+i+"_t;\nattribute "+t+" "+r+" a_"+i+";\nvarying "+t+" "+o+" "+i+";\n#else\nuniform "+t+" "+o+" u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+r+"(a_"+i+", a_"+i+"_t);\n#else\n "+t+" "+o+" "+i+" = u_"+i+";\n#endif\n":"define"===n?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float a_"+i+"_t;\nattribute "+t+" "+r+" a_"+i+";\n#else\nuniform "+t+" "+o+" u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+t+" "+o+" "+i+" = unpack_mix_"+r+"(a_"+i+", a_"+i+"_t);\n#else\n "+t+" "+o+" "+i+" = u_"+i+";\n#endif\n"})};for(var programName in shaders)loop(programName);module.exports=shaders;
-},{}],98:[function(_dereq_,module,exports){
-"use strict";var ImageSource=_dereq_("./image_source"),window=_dereq_("../util/window"),CanvasSource=function(t){function i(i,n,s,a){t.call(this,i,n,s,a),this.options=n,this.animate=void 0===n.animate||n.animate}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.load=function(){if(this.canvas=this.canvas||window.document.getElementById(this.options.canvas),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions())return this.fire("error",new Error("Canvas dimensions cannot be less than or equal to zero."));this.play=function(){this._playing=!0,this.map._rerender()},this.pause=function(){this._playing=!1},this._finishLoading()},i.prototype.getCanvas=function(){return this.canvas},i.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},i.prototype.onRemove=function(){this.pause()},i.prototype.prepare=function(){var t=!1;this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||0!==Object.keys(this.tiles).length&&this._prepareImage(this.map.painter.gl,this.canvas,t)},i.prototype.serialize=function(){return{type:"canvas",canvas:this.canvas,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this._playing},i.prototype._hasInvalidDimensions=function(){for(var t=this,i=0,n=[t.canvas.width,t.canvas.height];i<n.length;i+=1){var s=n[i];if(isNaN(s)||s<=0)return!0}return!1},i}(ImageSource);module.exports=CanvasSource;
-},{"../util/window":247,"./image_source":102}],99:[function(_dereq_,module,exports){
-"use strict";function resolveURL(t){var e=window.document.createElement("a");return e.href=t,e.href}var Evented=_dereq_("../util/evented"),util=_dereq_("../util/util"),window=_dereq_("../util/window"),EXTENT=_dereq_("../data/extent"),ResourceType=_dereq_("../util/ajax").ResourceType,browser=_dereq_("../util/browser"),GeoJSONSource=function(t){function e(e,o,i,r){t.call(this),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this.dispatcher=i,this.setEventedParent(r),this._data=o.data,this._options=util.extend({},o),void 0!==o.maxzoom&&(this.maxzoom=o.maxzoom),o.type&&(this.type=o.type);var a=EXTENT/this.tileSize;this.workerOptions=util.extend({source:this.id,cluster:o.cluster||!1,geojsonVtOptions:{buffer:(void 0!==o.buffer?o.buffer:128)*a,tolerance:(void 0!==o.tolerance?o.tolerance:.375)*a,extent:EXTENT,maxZoom:this.maxzoom},superclusterOptions:{maxZoom:void 0!==o.clusterMaxZoom?Math.min(o.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:EXTENT,radius:(o.clusterRadius||50)*a,log:!1}},o.workerOptions)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=this;this.fire("dataloading",{dataType:"source"}),this._updateWorkerData(function(e){if(e)return void t.fire("error",{error:e});t.fire("data",{dataType:"source",sourceDataType:"metadata"})})},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.setData=function(t){var e=this;return this._data=t,this.fire("dataloading",{dataType:"source"}),this._updateWorkerData(function(t){if(t)return e.fire("error",{error:t});e.fire("data",{dataType:"source",sourceDataType:"content"})}),this},e.prototype._updateWorkerData=function(t){var e=this,o=util.extend({},this.workerOptions),i=this._data;"string"==typeof i?o.request=this.map._transformRequest(resolveURL(i),ResourceType.Source):o.data=JSON.stringify(i),this.workerID=this.dispatcher.send(this.type+".loadData",o,function(o){e._loaded=!0,t(o)},this.workerID)},e.prototype.loadTile=function(t,e){var o=this,i=void 0===t.workerID||"expired"===t.state?"loadTile":"reloadTile",r={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:browser.devicePixelRatio,overscaling:t.coord.z>this.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send(i,r,function(i,r){return t.unloadVectorData(),t.aborted?e(null):i?e(i):(t.loadVectorData(r,o.map.painter),e(null))},this.workerID)},e.prototype.abortTile=function(t){t.aborted=!0},e.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID)},e.prototype.onRemove=function(){this.dispatcher.broadcast("removeSource",{type:this.type,source:this.id})},e.prototype.serialize=function(){return util.extend({},this._options,{type:this.type,data:this._data})},e.prototype.hasTransition=function(){return!1},e}(Evented);module.exports=GeoJSONSource;
-},{"../data/extent":58,"../util/ajax":244,"../util/browser":245,"../util/evented":253,"../util/util":266,"../util/window":247}],100:[function(_dereq_,module,exports){
-"use strict";function loadGeoJSONTile(e,r){var t=e.source,o=e.coord;if(!this._geoJSONIndexes[t])return r(null,null);var n=this._geoJSONIndexes[t].getTile(Math.min(o.z,e.maxZoom),o.x,o.y);if(!n)return r(null,null);var u=new GeoJSONWrapper(n.features),i=vtpbf(u);0===i.byteOffset&&i.byteLength===i.buffer.byteLength||(i=new Uint8Array(i)),r(null,{vectorTile:u,rawData:i.buffer})}var ajax=_dereq_("../util/ajax"),rewind=_dereq_("geojson-rewind"),GeoJSONWrapper=_dereq_("./geojson_wrapper"),vtpbf=_dereq_("vt-pbf"),supercluster=_dereq_("supercluster"),geojsonvt=_dereq_("geojson-vt"),VectorTileWorkerSource=_dereq_("./vector_tile_worker_source"),GeoJSONWorkerSource=function(e){function r(r,t,o){e.call(this,r,t,loadGeoJSONTile),o&&(this.loadGeoJSON=o),this._geoJSONIndexes={}}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.loadData=function(e,r){var t=this;this.loadGeoJSON(e,function(o,n){if(o||!n)return r(o);if("object"!=typeof n)return r(new Error("Input data is not a valid GeoJSON object."));rewind(n,!0);try{t._geoJSONIndexes[e.source]=e.cluster?supercluster(e.superclusterOptions).load(n.features):geojsonvt(n,e.geojsonVtOptions)}catch(o){return r(o)}t.loaded[e.source]={},r(null)})},r.prototype.reloadTile=function(r,t){var o=this.loaded[r.source],n=r.uid;return o&&o[n]?e.prototype.reloadTile.call(this,r,t):this.loadTile(r,t)},r.prototype.loadGeoJSON=function(e,r){if(e.request)ajax.getJSON(e.request,r);else{if("string"!=typeof e.data)return r(new Error("Input data is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(e){return r(new Error("Input data is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(e,r){this._geoJSONIndexes[e.source]&&delete this._geoJSONIndexes[e.source],r()},r}(VectorTileWorkerSource);module.exports=GeoJSONWorkerSource;
-},{"../util/ajax":244,"./geojson_wrapper":101,"./vector_tile_worker_source":114,"geojson-rewind":14,"geojson-vt":18,"supercluster":41,"vt-pbf":46}],101:[function(_dereq_,module,exports){
-"use strict";var Point=_dereq_("@mapbox/point-geometry"),toGeoJSON=_dereq_("@mapbox/vector-tile").VectorTileFeature.prototype.toGeoJSON,EXTENT=_dereq_("../data/extent"),FeatureWrapper=function(e){this._feature=e,this.extent=EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};FeatureWrapper.prototype.loadGeometry=function(){var e=this;if(1===this._feature.type){for(var t=[],r=0,o=e._feature.geometry;r<o.length;r+=1){var a=o[r];t.push([new Point(a[0],a[1])])}return t}for(var i=[],p=0,n=e._feature.geometry;p<n.length;p+=1){for(var s=n[p],u=[],h=0,f=s;h<f.length;h+=1){var l=f[h];u.push(new Point(l[0],l[1]))}i.push(u)}return i},FeatureWrapper.prototype.toGeoJSON=function(e,t,r){return toGeoJSON.call(this,e,t,r)};var GeoJSONWrapper=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=EXTENT,this.length=e.length,this._features=e};GeoJSONWrapper.prototype.feature=function(e){return new FeatureWrapper(this._features[e])},module.exports=GeoJSONWrapper;
-},{"../data/extent":58,"@mapbox/point-geometry":2,"@mapbox/vector-tile":6}],102:[function(_dereq_,module,exports){
-"use strict";var util=_dereq_("../util/util"),window=_dereq_("../util/window"),TileCoord=_dereq_("./tile_coord"),LngLat=_dereq_("../geo/lng_lat"),Point=_dereq_("@mapbox/point-geometry"),Evented=_dereq_("../util/evented"),ajax=_dereq_("../util/ajax"),browser=_dereq_("../util/browser"),EXTENT=_dereq_("../data/extent"),RasterBoundsArray=_dereq_("../data/raster_bounds_array"),VertexBuffer=_dereq_("../gl/vertex_buffer"),VertexArrayObject=_dereq_("../render/vertex_array_object"),Texture=_dereq_("../render/texture"),ImageSource=function(t){function e(e,r,o,i){t.call(this),this.id=e,this.dispatcher=o,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this.setEventedParent(i),this.options=r,this.textureLoaded=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=this;this.fire("dataloading",{dataType:"source"}),this.url=this.options.url,ajax.getImage(this.map._transformRequest(this.url,ajax.ResourceType.Image),function(e,r){e?t.fire("error",{error:e}):r&&(t.image=browser.getImageData(r),t._finishLoading())})},e.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire("data",{dataType:"source",sourceDataType:"metadata"}))},e.prototype.onAdd=function(t){this.map=t,this.load()},e.prototype.setCoordinates=function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(LngLat.convert(t)).zoomTo(0)}),o=this.centerCoord=util.getCoordinatesCenter(r);o.column=Math.floor(o.column),o.row=Math.floor(o.row),this.coord=new TileCoord(o.zoom,o.column,o.row),this.minzoom=this.maxzoom=o.zoom;var i=r.map(function(t){var e=t.zoomTo(o.zoom);return new Point(Math.round((e.column-o.column)*EXTENT),Math.round((e.row-o.row)*EXTENT))});return this._boundsArray=new RasterBoundsArray,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,EXTENT,EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire("data",{dataType:"source",sourceDataType:"content"}),this},e.prototype.prepare=function(){0!==Object.keys(this.tiles).length&&this.image&&this._prepareImage(this.map.painter.gl,this.image)},e.prototype._prepareImage=function(t,e,r){var o=this;this.boundsBuffer||(this.boundsBuffer=new VertexBuffer(t,this._boundsArray)),this.boundsVAO||(this.boundsVAO=new VertexArrayObject),this.textureLoaded?r?this.texture.update(e):(e instanceof window.HTMLVideoElement||e instanceof window.ImageData||e instanceof window.HTMLCanvasElement)&&(this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,e)):(this.textureLoaded=!0,this.texture=new Texture(t,e,t.RGBA),this.texture.bind(t.LINEAR,t.CLAMP_TO_EDGE));for(var i in o.tiles){var a=o.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=o.texture)}},e.prototype.loadTile=function(t,e){this.coord&&this.coord.toString()===t.coord.toString()?(this.tiles[String(t.coord.w)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},e.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},e.prototype.hasTransition=function(){return!1},e}(Evented);module.exports=ImageSource;
-},{"../data/extent":58,"../data/raster_bounds_array":64,"../geo/lng_lat":68,"../gl/vertex_buffer":72,"../render/texture":93,"../render/vertex_array_object":95,"../util/ajax":244,"../util/browser":245,"../util/evented":253,"../util/util":266,"../util/window":247,"./tile_coord":112,"@mapbox/point-geometry":2}],103:[function(_dereq_,module,exports){
-"use strict";var util=_dereq_("../util/util"),ajax=_dereq_("../util/ajax"),browser=_dereq_("../util/browser"),normalizeURL=_dereq_("../util/mapbox").normalizeSourceURL;module.exports=function(r,e,o){var u=function(r,e){if(r)return o(r);if(e){var u=util.pick(e,["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds"]);e.vector_layers&&(u.vectorLayers=e.vector_layers,u.vectorLayerIds=u.vectorLayers.map(function(r){return r.id})),o(null,u)}};r.url?ajax.getJSON(e(normalizeURL(r.url),ajax.ResourceType.Source),u):browser.frame(function(){return u(null,r)})};
-},{"../util/ajax":244,"../util/browser":245,"../util/mapbox":260,"../util/util":266}],104:[function(_dereq_,module,exports){
-"use strict";var EXTENT=_dereq_("../data/extent");module.exports=function(e,t,r){return t*(EXTENT/(e.tileSize*Math.pow(2,r-e.coord.z)))};
-},{"../data/extent":58}],105:[function(_dereq_,module,exports){
-"use strict";function sortTilesIn(e,r){var o=e.coord,t=r.coord;return o.z-t.z||o.y-t.y||o.w-t.w||o.x-t.x}function mergeRenderedFeatureLayers(e){for(var r={},o={},t=0,n=e;t<n.length;t+=1){var u=n[t],a=u.queryResults,d=u.wrappedTileID,s=o[d]=o[d]||{};for(var i in a)for(var l=a[i],c=s[i]=s[i]||{},f=r[i]=r[i]||[],v=0,y=l;v<y.length;v+=1){var p=y[v];c[p.featureIndex]||(c[p.featureIndex]=!0,f.push(p.feature))}}return r}var TileCoord=_dereq_("./tile_coord");exports.rendered=function(e,r,o,t,n,u){var a=e.tilesIn(o);a.sort(sortTilesIn);for(var d=[],s=0,i=a;s<i.length;s+=1){var l=i[s];d.push({wrappedTileID:l.coord.wrapped().id,queryResults:l.tile.queryRenderedFeatures(r,l.queryGeometry,l.scale,t,u,e.id)})}return mergeRenderedFeatureLayers(d)},exports.source=function(e,r){for(var o=e.getRenderableIds().map(function(r){return e.getTileByID(r)}),t=[],n={},u=0;u<o.length;u++){var a=o[u],d=new TileCoord(Math.min(a.sourceMaxZoom,a.coord.z),a.coord.x,a.coord.y,0).id;n[d]||(n[d]=!0,a.querySourceFeatures(t,r))}return t};
-},{"./tile_coord":112}],106:[function(_dereq_,module,exports){
-"use strict";var util=_dereq_("../util/util"),ajax=_dereq_("../util/ajax"),Evented=_dereq_("../util/evented"),loadTileJSON=_dereq_("./load_tilejson"),normalizeURL=_dereq_("../util/mapbox").normalizeTileURL,TileBounds=_dereq_("./tile_bounds"),Texture=_dereq_("../render/texture"),RasterTileSource=function(e){function t(t,i,r,o){e.call(this),this.id=t,this.dispatcher=r,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=util.extend({},i),util.extend(this,util.pick(i,["url","scheme","tileSize"]))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.load=function(){var e=this;this.fire("dataloading",{dataType:"source"}),loadTileJSON(this._options,this.map._transformRequest,function(t,i){t?e.fire("error",t):i&&(util.extend(e,i),i.bounds&&(e.tileBounds=new TileBounds(i.bounds,e.minzoom,e.maxzoom)),e.fire("data",{dataType:"source",sourceDataType:"metadata"}),e.fire("data",{dataType:"source",sourceDataType:"content"}))})},t.prototype.onAdd=function(e){this.map=e,this.load()},t.prototype.serialize=function(){return util.extend({},this._options)},t.prototype.hasTile=function(e){return!this.tileBounds||this.tileBounds.contains(e,this.maxzoom)},t.prototype.loadTile=function(e,t){var i=this,r=normalizeURL(e.coord.url(this.tiles,null,this.scheme),this.url,this.tileSize);e.request=ajax.getImage(this.map._transformRequest(r,ajax.ResourceType.Tile),function(r,o){if(delete e.request,e.aborted)e.state="unloaded",t(null);else if(r)e.state="errored",t(r);else if(o){i.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var a=i.map.painter.gl;e.texture=i.map.painter.getTileTexture(o.width),e.texture?(e.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),a.texSubImage2D(a.TEXTURE_2D,0,0,0,a.RGBA,a.UNSIGNED_BYTE,o)):(e.texture=new Texture(a,o,a.RGBA),e.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.map.painter.extTextureFilterAnisotropic&&a.texParameterf(a.TEXTURE_2D,i.map.painter.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.map.painter.extTextureFilterAnisotropicMax)),a.generateMipmap(a.TEXTURE_2D),e.state="loaded",t(null)}})},t.prototype.abortTile=function(e,t){e.request&&(e.request.abort(),delete e.request),t()},t.prototype.unloadTile=function(e,t){e.texture&&this.map.painter.saveTileTexture(e.texture),t()},t.prototype.hasTransition=function(){return!1},t}(Evented);module.exports=RasterTileSource;
-},{"../render/texture":93,"../util/ajax":244,"../util/evented":253,"../util/mapbox":260,"../util/util":266,"./load_tilejson":103,"./tile_bounds":111}],107:[function(_dereq_,module,exports){
-"use strict";var ajax=_dereq_("../util/ajax"),Evented=_dereq_("../util/evented"),window=_dereq_("../util/window"),pluginRequested=!1,pluginBlobURL=null;module.exports.evented=new Evented,module.exports.registerForPluginAvailability=function(e){return pluginBlobURL?e({pluginBlobURL:pluginBlobURL,errorCallback:module.exports.errorCallback}):module.exports.evented.once("pluginAvailable",e),e},module.exports.createBlobURL=function(e){return window.URL.createObjectURL(new window.Blob([e.data],{type:"text/javascript"}))},module.exports.clearRTLTextPlugin=function(){pluginRequested=!1,pluginBlobURL=null},module.exports.setRTLTextPlugin=function(e,l){if(pluginRequested)throw new Error("setRTLTextPlugin cannot be called multiple times.");pluginRequested=!0,module.exports.errorCallback=l,ajax.getArrayBuffer({url:e},function(e,t){e?l(e):t&&(pluginBlobURL=module.exports.createBlobURL(t),module.exports.evented.fire("pluginAvailable",{pluginBlobURL:pluginBlobURL,errorCallback:l}))})},module.exports.applyArabicShaping=null,module.exports.processBidirectionalText=null;
-},{"../util/ajax":244,"../util/evented":253,"../util/window":247}],108:[function(_dereq_,module,exports){
-"use strict";var util=_dereq_("../util/util"),sourceTypes={vector:_dereq_("../source/vector_tile_source"),raster:_dereq_("../source/raster_tile_source"),geojson:_dereq_("../source/geojson_source"),video:_dereq_("../source/video_source"),image:_dereq_("../source/image_source"),canvas:_dereq_("../source/canvas_source")};exports.create=function(e,r,o,u){var s=new sourceTypes[r.type](e,r,o,u);if(s.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+s.id);return util.bindAll(["load","abort","unload","serialize","prepare"],s),s},exports.getType=function(e){return sourceTypes[e]},exports.setType=function(e,r){sourceTypes[e]=r};
-},{"../source/canvas_source":98,"../source/geojson_source":99,"../source/image_source":102,"../source/raster_tile_source":106,"../source/vector_tile_source":113,"../source/video_source":115,"../util/util":266}],109:[function(_dereq_,module,exports){
-"use strict";function coordinateToTilePoint(e,t,o){var i=o.zoomTo(Math.min(e.z,t));return new Point((i.column-(e.x+e.w*Math.pow(2,e.z)))*EXTENT,(i.row-e.y)*EXTENT)}function isRasterType(e){return"raster"===e||"image"===e||"video"===e}var createSource=_dereq_("./source").create,Tile=_dereq_("./tile"),Evented=_dereq_("../util/evented"),TileCoord=_dereq_("./tile_coord"),Cache=_dereq_("../util/lru_cache"),Coordinate=_dereq_("../geo/coordinate"),util=_dereq_("../util/util"),EXTENT=_dereq_("../data/extent"),Point=_dereq_("@mapbox/point-geometry"),SourceCache=function(e){function t(t,o,i){var r=this;e.call(this),this.id=t,this.dispatcher=i,this.on("data",function(e){"source"===e.dataType&&"metadata"===e.sourceDataType&&(r._sourceLoaded=!0),r._sourceLoaded&&!r._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(r.reload(),r.transform&&r.update(r.transform))}),this.on("error",function(){r._sourceErrored=!0}),this._source=createSource(t,o,i,this),this._tiles={},this._cache=new Cache(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._isIdRenderable=this._isIdRenderable.bind(this),this._coveredTiles={}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.onAdd=function(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(e)},t.prototype.onRemove=function(e){this._source&&this._source.onRemove&&this._source.onRemove(e)},t.prototype.loaded=function(){var e=this;if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;for(var t in e._tiles){var o=e._tiles[t];if("loaded"!==o.state&&"errored"!==o.state)return!1}return!0},t.prototype.getSource=function(){return this._source},t.prototype.pause=function(){this._paused=!0},t.prototype.getNeedsFullPlacement=function(){return this._needsFullPlacement},t.prototype.resume=function(){if(this._paused){var e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}},t.prototype._loadTile=function(e,t){return this._source.loadTile(e,t)},t.prototype._unloadTile=function(e){if(this._source.unloadTile)return this._source.unloadTile(e,function(){})},t.prototype._abortTile=function(e){if(this._source.abortTile)return this._source.abortTile(e,function(){})},t.prototype.serialize=function(){return this._source.serialize()},t.prototype.prepare=function(e){var t=this;this._source.prepare&&this._source.prepare();for(var o in t._tiles)t._tiles[o].upload(e)},t.prototype.getIds=function(){var e=this,t=function(t,o){var i=TileCoord.fromID(t),r=TileCoord.fromID(o),s=new Point(i.x,i.y).rotate(e.transform.angle),a=new Point(r.x,r.y).rotate(e.transform.angle);return i.z-r.z||a.y-s.y||a.x-s.x};return Object.keys(this._tiles).map(Number).sort(t)},t.prototype.getRenderableIds=function(){return this.getIds().filter(this._isIdRenderable)},t.prototype.hasRenderableParent=function(e){var t=this.findLoadedParent(e,0,{});return!!t&&this._isIdRenderable(t.coord.id)},t.prototype._isIdRenderable=function(e){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]},t.prototype.reload=function(){var e=this;if(this._paused)return void(this._shouldReloadOnResume=!0);this._cache.reset();for(var t in e._tiles)e._reloadTile(t,"reloading")},t.prototype._reloadTile=function(e,t){var o=this._tiles[e];o&&("loading"!==o.state&&(o.state=t),this._loadTile(o,this._tileLoaded.bind(this,o,e,t)))},t.prototype._tileLoaded=function(e,t,o,i){if(i)return e.state="errored",void(404!==i.status?this._source.fire("error",{tile:e,error:i}):this.update(this.transform));e.timeAdded=(new Date).getTime(),"expired"===o&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(t,e),this._source.fire("data",{dataType:"source",tile:e,coord:e.coord}),this.map&&(this.map.painter.tileExtentVAO.vao=null),this._updatePlacement(),this.map&&e.added(this.map.painter.crossTileSymbolIndex)},t.prototype.getTile=function(e){return this.getTileByID(e.id)},t.prototype.getTileByID=function(e){return this._tiles[e]},t.prototype.getZoom=function(e){return e.zoom+e.scaleZoom(e.tileSize/this._source.tileSize)},t.prototype._findLoadedChildren=function(e,t,o){var i=this,r=!1;for(var s in i._tiles){var a=i._tiles[s];if(!(o[s]||!a.hasData()||a.coord.z<=e.z||a.coord.z>t)){var n=Math.pow(2,Math.min(a.coord.z,i._source.maxzoom)-Math.min(e.z,i._source.maxzoom));if(Math.floor(a.coord.x/n)===e.x&&Math.floor(a.coord.y/n)===e.y)for(o[s]=!0,r=!0;a&&a.coord.z-1>e.z;){var d=a.coord.parent(i._source.maxzoom);if(!d)break;a=i._tiles[d.id],a&&a.hasData()&&(delete o[s],o[d.id]=!0)}}}return r},t.prototype.findLoadedParent=function(e,t,o){for(var i=this,r=e.z-1;r>=t;r--){var s=e.parent(i._source.maxzoom);if(!s)return;e=s;var a=String(e.id),n=i._tiles[a];if(n&&n.hasData())return o[a]=!0,n;if(i._cache.has(a))return o[a]=!0,i._cache.get(a)}},t.prototype.updateCacheSize=function(e){var t=Math.ceil(e.width/this._source.tileSize)+1,o=Math.ceil(e.height/this._source.tileSize)+1,i=t*o,r=Math.floor(5*i),s="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(s)},t.prototype.update=function(e){var o=this;if(this.transform=e,this._sourceLoaded&&!this._paused){this.updateCacheSize(e),this._coveredTiles={};var i;this.used?this._source.coord?i=e.getVisibleWrappedCoordinates(this._source.coord):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter(function(e){return o._source.hasTile(e)}))):i=[];var r=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(e)),s=Math.max(r-t.maxOverzooming,this._source.minzoom),a=Math.max(r+t.maxUnderzooming,this._source.minzoom),n=this._updateRetainedTiles(i,r),d={};if(isRasterType(this._source.type))for(var h=Object.keys(n),u=0;u<h.length;u++){var c=h[u],l=TileCoord.fromID(+c),m=o._tiles[c];if(m&&(void 0===m.fadeEndTime||m.fadeEndTime>=Date.now())){o._findLoadedChildren(l,a,n)&&(n[c]=!0);var _=o.findLoadedParent(l,s,d);_&&o._addTile(_.coord)}}var p;for(p in d)n[p]||(o._coveredTiles[p]=!0);for(p in d)n[p]=!0;for(var f=util.keysDifference(this._tiles,n),T=0;T<f.length;T++)o._removeTile(f[T])}},t.prototype._updateRetainedTiles=function(e,o){var i,r,s,a,n=this,d={},h={},u=Math.max(o-t.maxOverzooming,this._source.minzoom);for(i=0;i<e.length;i++){r=e[i],s=n._addTile(r);var c=!1;if(s.hasData())d[r.id]=!0;else{c=s.wasRequested(),d[r.id]=!0,a=!0;if(o+1>n._source.maxzoom){var l=r.children(n._source.maxzoom)[0],m=n.getTile(l);m&&m.hasData()?d[l.id]=!0:a=!1}else for(var _=r.children(n._source.maxzoom),p=0;p<_.length;p++){var f=_[p],T=f?n.getTile(f):null;T&&T.hasData()?d[f.id]=!0:a=!1}if(!a)for(var v=o-1;v>=u;--v){var y=r.scaledTo(v,n._source.maxzoom);if(h[y.id])break;if(h[y.id]=!0,s=n.getTile(y),!s&&c&&(s=n._addTile(y)),s&&(d[y.id]=!0,c=s.wasRequested(),s.hasData()))break}}}return d},t.prototype._addTile=function(e){var t=this._tiles[e.id];if(t)return t;(t=this._cache.getAndRemove(e.id))&&(this._updatePlacement(),this.map&&t.added(this.map.painter.crossTileSymbolIndex),this._cacheTimers[e.id]&&(clearTimeout(this._cacheTimers[e.id]),delete this._cacheTimers[e.id],this._setTileReloadTimer(e.id,t)));var o=Boolean(t);if(!o){var i=e.z,r=i>this._source.maxzoom?Math.pow(2,i-this._source.maxzoom):1;t=new Tile(e,this._source.tileSize*r,this._source.maxzoom),this._loadTile(t,this._tileLoaded.bind(this,t,e.id,t.state))}return t?(t.uses++,this._tiles[e.id]=t,o||this._source.fire("dataloading",{tile:t,coord:t.coord,dataType:"source"}),t):null},t.prototype._setTileReloadTimer=function(e,t){var o=this,i=t.getExpiryTimeout();i&&(this._timers[e]=setTimeout(function(){o._reloadTile(e,"expired"),delete o._timers[e]},i))},t.prototype._setCacheInvalidationTimer=function(e,t){var o=this,i=t.getExpiryTimeout();i&&(this._cacheTimers[e]=setTimeout(function(){o._cache.remove(e),delete o._cacheTimers[e]},i))},t.prototype._removeTile=function(e){var t=this._tiles[e];if(t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),!(t.uses>0)))if(this._updatePlacement(),this.map&&t.removed(this.map.painter.crossTileSymbolIndex),t.hasData()){t.coord=t.coord.wrapped();var o=t.coord.id;this._cache.add(o,t),this._setCacheInvalidationTimer(o,t)}else t.aborted=!0,this._abortTile(t),this._unloadTile(t)},t.prototype._updatePlacement=function(){this._needsFullPlacement=!0},t.prototype.clearTiles=function(){var e=this;this._shouldReloadOnResume=!1,this._paused=!1;for(var t in e._tiles)e._removeTile(t);this._cache.reset()},t.prototype.tilesIn=function(e){for(var t=this,o=[],i=this.getIds(),r=1/0,s=1/0,a=-1/0,n=-1/0,d=e[0].zoom,h=0;h<e.length;h++){var u=e[h];r=Math.min(r,u.column),s=Math.min(s,u.row),a=Math.max(a,u.column),n=Math.max(n,u.row)}for(var c=0;c<i.length;c++){var l=t._tiles[i[c]],m=TileCoord.fromID(i[c]),_=[coordinateToTilePoint(m,l.sourceMaxZoom,new Coordinate(r,s,d)),coordinateToTilePoint(m,l.sourceMaxZoom,new Coordinate(a,n,d))];if(_[0].x<EXTENT&&_[0].y<EXTENT&&_[1].x>=0&&_[1].y>=0){for(var p=[],f=0;f<e.length;f++)p.push(coordinateToTilePoint(m,l.sourceMaxZoom,e[f]));o.push({tile:l,coord:m,queryGeometry:[p],scale:Math.pow(2,t.transform.zoom-l.coord.z)})}}return o},t.prototype.commitPlacement=function(e,t){var o=this;this._needsFullPlacement=!1;for(var i=this.getIds(),r=0;r<i.length;r++){o.getTileByID(i[r]).commitPlacement(e,t,o.transform.angle)}},t.prototype.getVisibleCoordinates=function(){for(var e=this,t=this.getRenderableIds().map(TileCoord.fromID),o=0,i=t;o<i.length;o+=1){var r=i[o];r.posMatrix=e.transform.calculatePosMatrix(r,e._source.maxzoom)}return t},t.prototype.hasTransition=function(){var e=this;if(this._source.hasTransition())return!0;if(isRasterType(this._source.type))for(var t in e._tiles){var o=e._tiles[t];if(void 0!==o.fadeEndTime&&o.fadeEndTime>=Date.now())return!0}return!1},t}(Evented);SourceCache.maxOverzooming=10,SourceCache.maxUnderzooming=3,module.exports=SourceCache;
-},{"../data/extent":58,"../geo/coordinate":67,"../util/evented":253,"../util/lru_cache":259,"../util/util":266,"./source":108,"./tile":110,"./tile_coord":112,"@mapbox/point-geometry":2}],110:[function(_dereq_,module,exports){
-"use strict";var util=_dereq_("../util/util"),deserializeBucket=_dereq_("../data/bucket").deserialize,SymbolBucket=_dereq_("../data/bucket/symbol_bucket"),FeatureIndex=_dereq_("../data/feature_index"),vt=_dereq_("@mapbox/vector-tile"),Protobuf=_dereq_("pbf"),GeoJSONFeature=_dereq_("../util/vectortile_to_geojson"),featureFilter=_dereq_("../style-spec/feature_filter"),CollisionIndex=_dereq_("../symbol/collision_index"),CollisionBoxArray=_dereq_("../symbol/collision_box"),RasterBoundsArray=_dereq_("../data/raster_bounds_array"),TileCoord=_dereq_("./tile_coord"),EXTENT=_dereq_("../data/extent"),Point=_dereq_("@mapbox/point-geometry"),VertexBuffer=_dereq_("../gl/vertex_buffer"),IndexBuffer=_dereq_("../gl/index_buffer"),Texture=_dereq_("../render/texture"),ref=_dereq_("../data/segment"),SegmentVector=ref.SegmentVector,ref$1=_dereq_("../data/index_array_type"),TriangleIndexArray=ref$1.TriangleIndexArray,projection=_dereq_("../symbol/projection"),ref$2=_dereq_("../symbol/symbol_placement"),performSymbolPlacement=ref$2.performSymbolPlacement,updateOpacities=ref$2.updateOpacities,pixelsToTileUnits=_dereq_("../source/pixels_to_tile_units"),CLOCK_SKEW_RETRY_TIMEOUT=3e4,Tile=function(e,t,i){this.coord=e,this.uid=util.uniqueId(),this.uses=0,this.tileSize=t,this.sourceMaxZoom=i,this.buckets={},this.expirationTime=null,this.expiredRequestCount=0,this.state="loading"};Tile.prototype.registerFadeDuration=function(e){var t=e+this.timeAdded;t<Date.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},Tile.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Tile.prototype.loadVectorData=function(e,t){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!e)return void(this.collisionBoxArray=new CollisionBoxArray);e.rawTileData&&(this.rawTileData=e.rawTileData),this.collisionBoxArray=new CollisionBoxArray(e.collisionBoxArray),this.featureIndex=FeatureIndex.deserialize(e.featureIndex,this.rawTileData),this.buckets=deserializeBucket(e.buckets,t.style),e.iconAtlasImage&&(this.iconAtlasImage=e.iconAtlasImage),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),e.iconAtlasImage&&(this.iconAtlasImage=e.iconAtlasImage),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)},Tile.prototype.unloadVectorData=function(){var e=this;for(var t in e.buckets)e.buckets[t].destroy();this.buckets={},this.iconAtlasTexture&&this.iconAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.collisionBoxArray=null,this.featureIndex=null,this.state="unloaded"},Tile.prototype.added=function(e){var t=this;for(var i in t.buckets){var r=t.buckets[i];r instanceof SymbolBucket&&e.addTileLayer(i,t.coord,t.sourceMaxZoom,r.symbolInstances)}},Tile.prototype.removed=function(e){var t=this;for(var i in t.buckets){t.buckets[i]instanceof SymbolBucket&&e.removeTileLayer(i,t.coord,t.sourceMaxZoom)}},Tile.prototype.placeLayer=function(e,t,i,r){var a=this.getBucket(i),s=this.collisionBoxArray;if(a&&a instanceof SymbolBucket&&s){var o=t.transform.calculatePosMatrix(this.coord,this.sourceMaxZoom),n="map"===a.layers[0].layout.get("text-pitch-alignment"),l=EXTENT/this.tileSize,u=pixelsToTileUnits(this,1,t.transform.zoom),c=projection.getLabelPlaneMatrix(o,n,!0,t.transform,u);performSymbolPlacement(a,t,e,t.transform.zoom,l,o,c,this.coord.id,r,s)}},Tile.prototype.commitPlacement=function(e,t,i){var r=this;for(var a in r.buckets){var s=r.buckets[a];s instanceof SymbolBucket&&(updateOpacities(s,t),s.sortFeatures(i))}this.featureIndex&&this.featureIndex.setCollisionIndex(e)},Tile.prototype.getBucket=function(e){return this.buckets[e.id]},Tile.prototype.upload=function(e){var t=this;for(var i in t.buckets){var r=t.buckets[i];r.uploaded||(r.upload(e),r.uploaded=!0)}this.iconAtlasImage&&(this.iconAtlasTexture=new Texture(e,this.iconAtlasImage,e.RGBA),this.iconAtlasImage=null),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Texture(e,this.glyphAtlasImage,e.ALPHA),this.glyphAtlasImage=null)},Tile.prototype.queryRenderedFeatures=function(e,t,i,r,a,s){var o=this;if(!this.featureIndex)return{};var n=0;for(var l in e){var u=o.getBucket(e[l]);u&&(n=Math.max(n,e[l].queryRadius(u)))}return this.featureIndex.query({queryGeometry:t,scale:i,tileSize:this.tileSize,bearing:a,params:r,additionalRadius:n,tileSourceMaxZoom:this.sourceMaxZoom,collisionBoxArray:this.collisionBoxArray,sourceID:s},e)},Tile.prototype.querySourceFeatures=function(e,t){var i=this;if(this.rawTileData){this.vtLayers||(this.vtLayers=new vt.VectorTile(new Protobuf(this.rawTileData)).layers);var r=t?t.sourceLayer:"",a=this.vtLayers._geojsonTileLayer||this.vtLayers[r];if(a)for(var s=featureFilter(t&&t.filter),o={z:this.coord.z,x:this.coord.x,y:this.coord.y},n=0;n<a.length;n++){var l=a.feature(n);if(s({zoom:i.coord.z},l)){var u=new GeoJSONFeature(l,i.coord.z,i.coord.x,i.coord.y);u.tile=o,e.push(u)}}}},Tile.prototype.clearMask=function(){this.segments&&(this.segments.destroy(),delete this.segments),this.maskedBoundsBuffer&&(this.maskedBoundsBuffer.destroy(),delete this.maskedBoundsBuffer),this.maskedIndexBuffer&&(this.maskedIndexBuffer.destroy(),delete this.maskedIndexBuffer)},Tile.prototype.setMask=function(e,t){var i=this;if(!util.deepEqual(this.mask,e)&&(this.mask=e,this.clearMask(),!util.deepEqual(e,{0:!0}))){var r=new RasterBoundsArray,a=new TriangleIndexArray;this.segments=new SegmentVector,this.segments.prepareSegment(0,r,a);for(var s=Object.keys(e),o=0;o<s.length;o++){var n=TileCoord.fromID(+s[o]),l=EXTENT>>n.z,u=new Point(n.x*l,n.y*l),c=new Point(u.x+l,u.y+l),h=i.segments.prepareSegment(4,r,a);r.emplaceBack(u.x,u.y,u.x,u.y),r.emplaceBack(c.x,u.y,c.x,u.y),r.emplaceBack(u.x,c.y,u.x,c.y),r.emplaceBack(c.x,c.y,c.x,c.y);var d=h.vertexLength;a.emplaceBack(d,d+1,d+2),a.emplaceBack(d+1,d+2,d+3),h.vertexLength+=4,h.primitiveLength+=2}this.maskedBoundsBuffer=new VertexBuffer(t,r),this.maskedIndexBuffer=new IndexBuffer(t,a)}},Tile.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Tile.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var i=util.parseCacheControl(e.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var r=Date.now(),a=!1;if(this.expirationTime>r)a=!1;else if(t)if(this.expirationTime<t)a=!0;else{var s=this.expirationTime-t;s?this.expirationTime=r+Math.max(s,CLOCK_SKEW_RETRY_TIMEOUT):a=!0}else a=!0;a?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Tile.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},module.exports=Tile;
-},{"../data/bucket":51,"../data/bucket/symbol_bucket":57,"../data/extent":58,"../data/feature_index":59,"../data/index_array_type":60,"../data/raster_bounds_array":64,"../data/segment":65,"../gl/index_buffer":71,"../gl/vertex_buffer":72,"../render/texture":93,"../source/pixels_to_tile_units":104,"../style-spec/feature_filter":145,"../symbol/collision_box":208,"../symbol/collision_index":210,"../symbol/projection":216,"../symbol/symbol_placement":220,"../util/util":266,"../util/vectortile_to_geojson":267,"./tile_coord":112,"@mapbox/point-geometry":2,"@mapbox/vector-tile":6,"pbf":38}],111:[function(_dereq_,module,exports){
-"use strict";var LngLatBounds=_dereq_("../geo/lng_lat_bounds"),clamp=_dereq_("../util/util").clamp,TileBounds=function(t,n,o){this.bounds=LngLatBounds.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=o||24};TileBounds.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},TileBounds.prototype.contains=function(t,n){var o=n?Math.min(t.z,n):t.z,a={minX:Math.floor(this.lngX(this.bounds.getWest(),o)),minY:Math.floor(this.latY(this.bounds.getNorth(),o)),maxX:Math.ceil(this.lngX(this.bounds.getEast(),o)),maxY:Math.ceil(this.latY(this.bounds.getSouth(),o))};return t.x>=a.minX&&t.x<a.maxX&&t.y>=a.minY&&t.y<a.maxY},TileBounds.prototype.lngX=function(t,n){return(t+180)*(Math.pow(2,n)/360)},TileBounds.prototype.latY=function(t,n){var o=clamp(Math.sin(Math.PI/180*t),-.9999,.9999),a=Math.pow(2,n)/(2*Math.PI);return Math.pow(2,n-1)+.5*Math.log((1+o)/(1-o))*-a},module.exports=TileBounds;
-},{"../geo/lng_lat_bounds":69,"../util/util":266}],112:[function(_dereq_,module,exports){
-"use strict";function edge(t,i){if(t.row>i.row){var o=t;t=i,i=o}return{x0:t.column,y0:t.row,x1:i.column,y1:i.row,dx:i.column-t.column,dy:i.row-t.row}}function scanSpans(t,i,o,r,e){var h=Math.max(o,Math.floor(i.y0)),s=Math.min(r,Math.ceil(i.y1));if(t.x0===i.x0&&t.y0===i.y0?t.x0+i.dy/t.dy*t.dx<i.x1:t.x1-i.dy/t.dy*t.dx<i.x0){var n=t;t=i,i=n}for(var a=t.dx/t.dy,d=i.dx/i.dy,y=t.dx>0,l=i.dx<0,x=h;x<s;x++){var u=a*Math.max(0,Math.min(t.dy,x+y-t.y0))+t.x0,c=d*Math.max(0,Math.min(i.dy,x+l-i.y0))+i.x0;e(Math.floor(c),Math.ceil(u),x)}}function scanTriangle(t,i,o,r,e,h){var s,n=edge(t,i),a=edge(i,o),d=edge(o,t);n.dy>a.dy&&(s=n,n=a,a=s),n.dy>d.dy&&(s=n,n=d,d=s),a.dy>d.dy&&(s=a,a=d,d=s),n.dy&&scanSpans(d,n,r,e,h),a.dy&&scanSpans(d,a,r,e,h)}function getQuadkey(t,i,o){for(var r,e="",h=t;h>0;h--)r=1<<h-1,e+=(i&r?1:0)+(o&r?2:0);return e}var WhooTS=_dereq_("@mapbox/whoots-js"),Coordinate=_dereq_("../geo/coordinate"),TileCoord=function(t,i,o,r){(void 0===r||isNaN(r))&&(r=0),this.z=+t,this.x=+i,this.y=+o,this.w=+r,(r*=2)<0&&(r=-1*r-1);var e=1<<this.z;this.id=32*(e*e*r+e*this.y+this.x)+this.z,this.posMatrix=null};TileCoord.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},TileCoord.prototype.toCoordinate=function(t){var i=Math.min(this.z,void 0===t?this.z:t),o=Math.pow(2,i),r=this.y,e=this.x+o*this.w;return new Coordinate(e,r,i)},TileCoord.prototype.url=function(t,i,o){var r=WhooTS.getTileBBox(this.x,this.y,this.z),e=getQuadkey(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(Math.min(this.z,i||this.z))).replace("{x}",String(this.x)).replace("{y}",String("tms"===o?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",e).replace("{bbox-epsg-3857}",r)},TileCoord.prototype.parent=function(t){return 0===this.z?null:this.z>t?new TileCoord(this.z-1,this.x,this.y,this.w):new TileCoord(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},TileCoord.prototype.wrapped=function(){return new TileCoord(this.z,this.x,this.y,0)},TileCoord.prototype.isLessThan=function(t){return this.w<t.w||!(this.w>t.w)&&(this.z<t.z||!(this.z>t.z)&&(this.x<t.x||!(this.x>t.x)&&this.y<t.y))},TileCoord.prototype.children=function(t){if(this.z>=t)return[new TileCoord(this.z+1,this.x,this.y,this.w)];var i=this.z+1,o=2*this.x,r=2*this.y;return[new TileCoord(i,o,r,this.w),new TileCoord(i,o+1,r,this.w),new TileCoord(i,o,r+1,this.w),new TileCoord(i,o+1,r+1,this.w)]},TileCoord.prototype.scaledTo=function(t,i){return this.z>i?new TileCoord(t,this.x,this.y,this.w):t<=this.z?new TileCoord(t,this.x>>this.z-t,this.y>>this.z-t,this.w):new TileCoord(t,this.x<<t-this.z,this.y<<t-this.z,this.w)},TileCoord.prototype.isChildOf=function(t,i){var o=Math.min(i,t.z),r=Math.min(i,this.z);return 0===t.z||t.z<this.z&&t.x===this.x>>r-o&&t.y===this.y>>r-o},TileCoord.cover=function(t,i,o,r){function e(t,i,e){var n,a,d,y;if(e>=0&&e<=h)for(n=t;n<i;n++)a=Math.floor(n/h),d=(n%h+h)%h,0!==a&&!0!==r||(y=new TileCoord(o,d,e,a),s[y.id]=y)}void 0===r&&(r=!0);var h=1<<t,s={};return scanTriangle(i[0],i[1],i[2],0,h,e),scanTriangle(i[2],i[3],i[0],0,h,e),Object.keys(s).map(function(t){return s[t]})},TileCoord.fromID=function(t){var i=t%32,o=1<<i,r=(t-i)/32,e=r%o,h=(r-e)/o%o,s=Math.floor(r/(o*o));return s%2!=0&&(s=-1*s-1),s/=2,new TileCoord(i,e,h,s)},module.exports=TileCoord;
-},{"../geo/coordinate":67,"@mapbox/whoots-js":10}],113:[function(_dereq_,module,exports){
-"use strict";var Evented=_dereq_("../util/evented"),util=_dereq_("../util/util"),loadTileJSON=_dereq_("./load_tilejson"),normalizeURL=_dereq_("../util/mapbox").normalizeTileURL,TileBounds=_dereq_("./tile_bounds"),ResourceType=_dereq_("../util/ajax").ResourceType,browser=_dereq_("../util/browser"),VectorTileSource=function(e){function t(t,i,o,r){if(e.call(this),this.id=t,this.dispatcher=o,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,util.extend(this,util.pick(i,["url","scheme","tileSize"])),this._options=util.extend({type:"vector"},i),512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.load=function(){var e=this;this.fire("dataloading",{dataType:"source"}),loadTileJSON(this._options,this.map._transformRequest,function(t,i){t?e.fire("error",t):i&&(util.extend(e,i),i.bounds&&(e.tileBounds=new TileBounds(i.bounds,e.minzoom,e.maxzoom)),e.fire("data",{dataType:"source",sourceDataType:"metadata"}),e.fire("data",{dataType:"source",sourceDataType:"content"}))})},t.prototype.hasTile=function(e){return!this.tileBounds||this.tileBounds.contains(e,this.maxzoom)},t.prototype.onAdd=function(e){this.map=e,this.load()},t.prototype.serialize=function(){return util.extend({},this._options)},t.prototype.loadTile=function(e,t){function i(i,o){return e.aborted?t(null):i?t(i):(this.map._refreshExpiredTiles&&e.setExpiryData(o),e.loadVectorData(o,this.map.painter),t(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}var o=e.coord.z>this.maxzoom?Math.pow(2,e.coord.z-this.maxzoom):1,r=normalizeURL(e.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),s={request:this.map._transformRequest(r,ResourceType.Tile),uid:e.uid,coord:e.coord,zoom:e.coord.z,tileSize:this.tileSize*o,type:this.type,source:this.id,pixelRatio:browser.devicePixelRatio,overscaling:o,showCollisionBoxes:this.map.showCollisionBoxes};void 0===e.workerID||"expired"===e.state?e.workerID=this.dispatcher.send("loadTile",s,i.bind(this)):"loading"===e.state?e.reloadCallback=t:this.dispatcher.send("reloadTile",s,i.bind(this),e.workerID)},t.prototype.abortTile=function(e){this.dispatcher.send("abortTile",{uid:e.uid,type:this.type,source:this.id},void 0,e.workerID)},t.prototype.unloadTile=function(e){e.unloadVectorData(),this.dispatcher.send("removeTile",{uid:e.uid,type:this.type,source:this.id},void 0,e.workerID)},t.prototype.hasTransition=function(){return!1},t}(Evented);module.exports=VectorTileSource;
-},{"../util/ajax":244,"../util/browser":245,"../util/evented":253,"../util/mapbox":260,"../util/util":266,"./load_tilejson":103,"./tile_bounds":111}],114:[function(_dereq_,module,exports){
-"use strict";function loadVectorTile(e,r){var o=ajax.getArrayBuffer(e.request,function(e,o){e?r(e):o&&r(null,{vectorTile:new vt.VectorTile(new Protobuf(o.data)),rawData:o.data,cacheControl:o.cacheControl,expires:o.expires})});return function(){o.abort(),r()}}var ajax=_dereq_("../util/ajax"),vt=_dereq_("@mapbox/vector-tile"),Protobuf=_dereq_("pbf"),WorkerTile=_dereq_("./worker_tile"),util=_dereq_("../util/util"),VectorTileWorkerSource=function(e,r,o){this.actor=e,this.layerIndex=r,this.loadVectorData=o||loadVectorTile,this.loading={},this.loaded={}};VectorTileWorkerSource.prototype.loadTile=function(e,r){var o=this,t=e.source,i=e.uid;this.loading[t]||(this.loading[t]={});var a=this.loading[t][i]=new WorkerTile(e);a.abort=this.loadVectorData(e,function(e,l){if(delete o.loading[t][i],e||!l)return r(e);var c=l.rawData,n={};l.expires&&(n.expires=l.expires),l.cacheControl&&(n.cacheControl=l.cacheControl),a.vectorTile=l.vectorTile,a.parse(l.vectorTile,o.layerIndex,o.actor,function(e,o,t){if(e||!o)return r(e);r(null,util.extend({rawTileData:c},o,n),t)}),o.loaded[t]=o.loaded[t]||{},o.loaded[t][i]=a})},VectorTileWorkerSource.prototype.reloadTile=function(e,r){function o(e,o){if(this.reloadCallback){var t=this.reloadCallback;delete this.reloadCallback,this.parse(this.vectorTile,a.layerIndex,a.actor,t)}r(e,o)}var t=this.loaded[e.source],i=e.uid,a=this;if(t&&t[i]){var l=t[i];l.showCollisionBoxes=e.showCollisionBoxes,"parsing"===l.status?l.reloadCallback=r:"done"===l.status&&l.parse(l.vectorTile,this.layerIndex,this.actor,o.bind(l))}},VectorTileWorkerSource.prototype.abortTile=function(e,r){var o=this.loading[e.source],t=e.uid;o&&o[t]&&o[t].abort&&(o[t].abort(),delete o[t]),r()},VectorTileWorkerSource.prototype.removeTile=function(e,r){var o=this.loaded[e.source],t=e.uid;o&&o[t]&&delete o[t],r()},module.exports=VectorTileWorkerSource;
-},{"../util/ajax":244,"../util/util":266,"./worker_tile":117,"@mapbox/vector-tile":6,"pbf":38}],115:[function(_dereq_,module,exports){
-"use strict";var ajax=_dereq_("../util/ajax"),ImageSource=_dereq_("./image_source"),VideoSource=function(t){function e(e,o,i,r){t.call(this,e,o,i,r),this.roundZoom=!0,this.type="video",this.options=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.load=function(){var t=this,e=this.options;this.urls=e.urls,ajax.getVideo(e.urls,function(e,o){e?t.fire("error",{error:e}):o&&(t.video=o,t.video.loop=!0,t.video.addEventListener("playing",function(){t.map._rerender()}),t.map&&t.video.play(),t._finishLoading())})},e.prototype.getVideo=function(){return this.video},e.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},e.prototype.prepare=function(){0===Object.keys(this.tiles).length||this.video.readyState<2||this._prepareImage(this.map.painter.gl,this.video)},e.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},e.prototype.hasTransition=function(){return this.video&&!this.video.paused},e}(ImageSource);module.exports=VideoSource;
-},{"../util/ajax":244,"./image_source":102}],116:[function(_dereq_,module,exports){
-"use strict";var Actor=_dereq_("../util/actor"),StyleLayerIndex=_dereq_("../style/style_layer_index"),VectorTileWorkerSource=_dereq_("./vector_tile_worker_source"),GeoJSONWorkerSource=_dereq_("./geojson_worker_source"),globalRTLTextPlugin=_dereq_("./rtl_text_plugin"),Worker=function(e){var r=this;this.self=e,this.actor=new Actor(e,this),this.layerIndexes={},this.workerSourceTypes={vector:VectorTileWorkerSource,geojson:GeoJSONWorkerSource},this.workerSources={},this.self.registerWorkerSource=function(e,o){if(r.workerSourceTypes[e])throw new Error('Worker source with name "'+e+'" already registered.');r.workerSourceTypes[e]=o},this.self.registerRTLTextPlugin=function(e){if(globalRTLTextPlugin.applyArabicShaping||globalRTLTextPlugin.processBidirectionalText)throw new Error("RTL text plugin already registered.");globalRTLTextPlugin.applyArabicShaping=e.applyArabicShaping,globalRTLTextPlugin.processBidirectionalText=e.processBidirectionalText}};Worker.prototype.setLayers=function(e,r,o){this.getLayerIndex(e).replace(r),o()},Worker.prototype.updateLayers=function(e,r,o){this.getLayerIndex(e).update(r.layers,r.removedIds),o()},Worker.prototype.loadTile=function(e,r,o){this.getWorkerSource(e,r.type).loadTile(r,o)},Worker.prototype.reloadTile=function(e,r,o){this.getWorkerSource(e,r.type).reloadTile(r,o)},Worker.prototype.abortTile=function(e,r,o){this.getWorkerSource(e,r.type).abortTile(r,o)},Worker.prototype.removeTile=function(e,r,o){this.getWorkerSource(e,r.type).removeTile(r,o)},Worker.prototype.removeSource=function(e,r,o){var t=this.getWorkerSource(e,r.type);void 0!==t.removeSource?t.removeSource(r,o):o()},Worker.prototype.loadWorkerSource=function(e,r,o){try{this.self.importScripts(r.url),o()}catch(e){o(e)}},Worker.prototype.loadRTLTextPlugin=function(e,r,o){try{globalRTLTextPlugin.applyArabicShaping||globalRTLTextPlugin.processBidirectionalText||(this.self.importScripts(r),globalRTLTextPlugin.applyArabicShaping&&globalRTLTextPlugin.processBidirectionalText||o(new Error("RTL Text Plugin failed to import scripts from "+r)))}catch(e){o(e)}},Worker.prototype.getLayerIndex=function(e){var r=this.layerIndexes[e];return r||(r=this.layerIndexes[e]=new StyleLayerIndex),r},Worker.prototype.getWorkerSource=function(e,r){var o=this;if(this.workerSources[e]||(this.workerSources[e]={}),!this.workerSources[e][r]){var t={send:function(r,t,i,l){o.actor.send(r,t,i,l,e)}};this.workerSources[e][r]=new this.workerSourceTypes[r](t,this.getLayerIndex(e))}return this.workerSources[e][r]},module.exports=function(e){return new Worker(e)};
-},{"../style/style_layer_index":203,"../util/actor":243,"./geojson_worker_source":100,"./rtl_text_plugin":107,"./vector_tile_worker_source":114}],117:[function(_dereq_,module,exports){
-"use strict";function recalculateLayers(e,o){for(var r=0,i=e;r<i.length;r+=1){i[r].recalculate({zoom:o,now:Number.MAX_VALUE,defaultFadeDuration:0,zoomHistory:{lastIntegerZoom:0,lastIntegerZoomTime:0,lastZoom:0}})}}function serializeBuckets(e,o){return e.filter(function(e){return!e.isEmpty()}).map(function(e){return e.serialize(o)})}var FeatureIndex=_dereq_("../data/feature_index"),ref=_dereq_("../symbol/symbol_layout"),performSymbolLayout=ref.performSymbolLayout,CollisionBoxArray=_dereq_("../symbol/collision_box"),DictionaryCoder=_dereq_("../util/dictionary_coder"),SymbolBucket=_dereq_("../data/bucket/symbol_bucket"),util=_dereq_("../util/util"),ref$1=_dereq_("../render/image_atlas"),makeImageAtlas=ref$1.makeImageAtlas,ref$2=_dereq_("../render/glyph_atlas"),makeGlyphAtlas=ref$2.makeGlyphAtlas,WorkerTile=function(e){this.coord=e.coord,this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=e.overscaling,this.showCollisionBoxes=e.showCollisionBoxes};WorkerTile.prototype.parse=function(e,o,r,i){function a(){var e=this;if(k)return i(k);if(z&&A){var o=makeGlyphAtlas(z),r=makeImageAtlas(A);for(var a in n){var t=n[a];t instanceof SymbolBucket&&(recalculateLayers(t.layers,e.zoom),performSymbolLayout(t,z,o.positions,A,r.positions,e.showCollisionBoxes))}this.status="done";var s=[o.image.data.buffer,r.image.data.buffer];i(null,{buckets:serializeBuckets(util.values(n),s),featureIndex:l.serialize(s),collisionBoxArray:this.collisionBoxArray.serialize(),glyphAtlasImage:o.image,iconAtlasImage:r.image},s)}}var t=this;this.status="parsing",this.data=e,this.collisionBoxArray=new CollisionBoxArray;var s=new DictionaryCoder(Object.keys(e.layers).sort()),l=new FeatureIndex(this.coord,this.overscaling);l.bucketLayerIDs=[];var n={},u={featureIndex:l,iconDependencies:{},glyphDependencies:{}},c=o.familiesBySource[this.source];for(var m in c){var y=e.layers[m];if(y){1===y.version&&util.warnOnce('Vector tile source "'+t.source+'" layer "'+m+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var f=s.encode(m),d=[],h=0;h<y.length;h++){var p=y.feature(h);d.push({feature:p,index:h,sourceLayerIndex:f})}for(var g=0,v=c[m];g<v.length;g+=1){var b=v[g],x=b[0];if(!(x.minzoom&&t.zoom<Math.floor(x.minzoom))&&(!(x.maxzoom&&t.zoom>=x.maxzoom)&&"none"!==x.visibility)){recalculateLayers(b,t.zoom);(n[x.id]=x.createBucket({index:l.bucketLayerIDs.length,layers:b,zoom:t.zoom,pixelRatio:t.pixelRatio,overscaling:t.overscaling,collisionBoxArray:t.collisionBoxArray})).populate(d,u),l.bucketLayerIDs.push(b.map(function(e){return e.id}))}}}}var k,z,A,B=util.mapObject(u.glyphDependencies,function(e){return Object.keys(e).map(Number)});Object.keys(B).length?r.send("getGlyphs",{uid:this.uid,stacks:B},function(e,o){k||(k=e,z=o,a.call(t))}):z={};var I=Object.keys(u.iconDependencies);I.length?r.send("getImages",{icons:I},function(e,o){k||(k=e,A=o,a.call(t))}):A={},a.call(this)},module.exports=WorkerTile;
-},{"../data/bucket/symbol_bucket":57,"../data/feature_index":59,"../render/glyph_atlas":84,"../render/image_atlas":86,"../symbol/collision_box":208,"../symbol/symbol_layout":219,"../util/dictionary_coder":250,"../util/util":266}],118:[function(_dereq_,module,exports){
-"use strict";function deref(r,e){var f={};for(var t in r)"ref"!==t&&(f[t]=r[t]);return refProperties.forEach(function(r){r in e&&(f[r]=e[r])}),f}function derefLayers(r){r=r.slice();for(var e=Object.create(null),f=0;f<r.length;f++)e[r[f].id]=r[f];for(var t=0;t<r.length;t++)"ref"in r[t]&&(r[t]=deref(r[t],e[r[t].ref]));return r}var refProperties=_dereq_("./util/ref_properties");module.exports=derefLayers;
-},{"./util/ref_properties":155}],119:[function(_dereq_,module,exports){
-"use strict";function diffSources(e,r,o,a){e=e||{},r=r||{};var s;for(s in e)e.hasOwnProperty(s)&&(r.hasOwnProperty(s)||(o.push({command:operations.removeSource,args:[s]}),a[s]=!0));for(s in r)r.hasOwnProperty(s)&&(e.hasOwnProperty(s)?isEqual(e[s],r[s])||("geojson"===e[s].type&&"geojson"===r[s].type?o.push({command:operations.setGeoJSONSourceData,args:[s,r[s].data]}):(o.push({command:operations.removeSource,args:[s]}),o.push({command:operations.addSource,args:[s,r[s]]}),a[s]=!0)):o.push({command:operations.addSource,args:[s,r[s]]}))}function diffLayerPropertyChanges(e,r,o,a,s,t){e=e||{},r=r||{};var n;for(n in e)e.hasOwnProperty(n)&&(isEqual(e[n],r[n])||o.push({command:t,args:[a,n,r[n],s]}));for(n in r)r.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(isEqual(e[n],r[n])||o.push({command:t,args:[a,n,r[n],s]}))}function pluckId(e){return e.id}function indexById(e,r){return e[r.id]=r,e}function diffLayers(e,r,o){e=e||[],r=r||[];var a,s,t,n,i,p,m,u=e.map(pluckId),l=r.map(pluckId),y=e.reduce(indexById,{}),c=r.reduce(indexById,{}),d=u.slice(),h=Object.create(null);for(a=0,s=0;a<u.length;a++)t=u[a],c.hasOwnProperty(t)?s++:(o.push({command:operations.removeLayer,args:[t]}),d.splice(d.indexOf(t,s),1));for(a=0,s=0;a<l.length;a++)t=l[l.length-1-a],d[d.length-1-a]!==t&&(y.hasOwnProperty(t)?(o.push({command:operations.removeLayer,args:[t]}),d.splice(d.lastIndexOf(t,d.length-s),1)):s++,p=d[d.length-a],o.push({command:operations.addLayer,args:[c[t],p]}),d.splice(d.length-a,0,t),h[t]=!0);for(a=0;a<l.length;a++)if(t=l[a],n=y[t],i=c[t],!h[t]&&!isEqual(n,i))if(isEqual(n.source,i.source)&&isEqual(n["source-layer"],i["source-layer"])&&isEqual(n.type,i.type)){diffLayerPropertyChanges(n.layout,i.layout,o,t,null,operations.setLayoutProperty),diffLayerPropertyChanges(n.paint,i.paint,o,t,null,operations.setPaintProperty),isEqual(n.filter,i.filter)||o.push({command:operations.setFilter,args:[t,i.filter]}),isEqual(n.minzoom,i.minzoom)&&isEqual(n.maxzoom,i.maxzoom)||o.push({command:operations.setLayerZoomRange,args:[t,i.minzoom,i.maxzoom]});for(m in n)n.hasOwnProperty(m)&&"layout"!==m&&"paint"!==m&&"filter"!==m&&"metadata"!==m&&"minzoom"!==m&&"maxzoom"!==m&&(0===m.indexOf("paint.")?diffLayerPropertyChanges(n[m],i[m],o,t,m.slice(6),operations.setPaintProperty):isEqual(n[m],i[m])||o.push({command:operations.setLayerProperty,args:[t,m,i[m]]}));for(m in i)i.hasOwnProperty(m)&&!n.hasOwnProperty(m)&&"layout"!==m&&"paint"!==m&&"filter"!==m&&"metadata"!==m&&"minzoom"!==m&&"maxzoom"!==m&&(0===m.indexOf("paint.")?diffLayerPropertyChanges(n[m],i[m],o,t,m.slice(6),operations.setPaintProperty):isEqual(n[m],i[m])||o.push({command:operations.setLayerProperty,args:[t,m,i[m]]}))}else o.push({command:operations.removeLayer,args:[t]}),p=d[d.lastIndexOf(t)+1],o.push({command:operations.addLayer,args:[i,p]})}function diffStyles(e,r){if(!e)return[{command:operations.setStyle,args:[r]}];var o=[];try{if(!isEqual(e.version,r.version))return[{command:operations.setStyle,args:[r]}];isEqual(e.center,r.center)||o.push({command:operations.setCenter,args:[r.center]}),isEqual(e.zoom,r.zoom)||o.push({command:operations.setZoom,args:[r.zoom]}),isEqual(e.bearing,r.bearing)||o.push({command:operations.setBearing,args:[r.bearing]}),isEqual(e.pitch,r.pitch)||o.push({command:operations.setPitch,args:[r.pitch]}),isEqual(e.sprite,r.sprite)||o.push({command:operations.setSprite,args:[r.sprite]}),isEqual(e.glyphs,r.glyphs)||o.push({command:operations.setGlyphs,args:[r.glyphs]}),isEqual(e.transition,r.transition)||o.push({command:operations.setTransition,args:[r.transition]}),isEqual(e.light,r.light)||o.push({command:operations.setLight,args:[r.light]});var a={},s=[];diffSources(e.sources,r.sources,s,a);var t=[];e.layers&&e.layers.forEach(function(e){a[e.source]?o.push({command:operations.removeLayer,args:[e.id]}):t.push(e)}),o=o.concat(s),diffLayers(t,r.layers,o)}catch(e){console.warn("Unable to compute style diff:",e),o=[{command:operations.setStyle,args:[r]}]}return o}var isEqual=_dereq_("lodash.isequal"),operations={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};module.exports=diffStyles,module.exports.operations=operations;
-},{"lodash.isequal":34}],120:[function(_dereq_,module,exports){
-"use strict";function ValidationError(r,i){for(var t=[],o=arguments.length-2;o-- >0;)t[o]=arguments[o+2];this.message=(r?r+": ":"")+format.apply(format,t),null!==i&&void 0!==i&&i.__line__&&(this.line=i.__line__)}var format=_dereq_("util").format;module.exports=ValidationError;
-},{"util":45}],121:[function(_dereq_,module,exports){
-"use strict";function varargs(r){return{type:r}}function stringifySignature(r){return Array.isArray(r)?"("+r.map(toString).join(", ")+")":"("+toString(r.type)+"...)"}var ref=_dereq_("./types"),toString=ref.toString,ParsingContext=_dereq_("./parsing_context"),EvaluationContext=_dereq_("./evaluation_context"),CompoundExpression=function(r,n,e,t){this.name=r,this.type=n,this._evaluate=e,this.args=t};CompoundExpression.prototype.evaluate=function(r){return this._evaluate(r,this.args)},CompoundExpression.prototype.eachChild=function(r){this.args.forEach(r)},CompoundExpression.parse=function(r,n){var e=r[0],t=CompoundExpression.definitions[e];if(!t)return n.error('Unknown expression "'+e+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(t)?t[0]:t.type,i=Array.isArray(t)?[[t[1],t[2]]]:t.overloads,s=i.filter(function(n){var e=n[0];return!Array.isArray(e)||e.length===r.length-1}),a=[],u=1;u<r.length;u++){var p=r[u],l=void 0;if(1===s.length){var g=s[0][0];l=Array.isArray(g)?g[u-1]:g.type}var f=n.parse(p,1+a.length,l);if(!f)return null;a.push(f)}for(var y=null,h=0,d=s;h<d.length;h+=1){var v=d[h],c=v[0],x=v[1];if(y=new ParsingContext(n.definitions,n.path,null,n.scope),Array.isArray(c)&&c.length!==a.length)y.error("Expected "+c.length+" arguments, but found "+a.length+" instead.");else{for(var m=0;m<a.length;m++){var C=Array.isArray(c)?c[m]:c.type,E=a[m];y.concat(m+1).checkSubtype(C,E.type)}if(0===y.errors.length)return new CompoundExpression(e,o,x,a)}}if(1===s.length)n.errors.push.apply(n.errors,y.errors);else{var A=s.length?s:i,S=A.map(function(r){return stringifySignature(r[0])}).join(" | "),w=a.map(function(r){return toString(r.type)}).join(", ");n.error("Expected arguments of type "+S+", but found ("+w+") instead.")}return null},CompoundExpression.register=function(r,n){CompoundExpression.definitions=n;for(var e in n)r[e]=CompoundExpression},module.exports={CompoundExpression:CompoundExpression,varargs:varargs};
-},{"./evaluation_context":135,"./parsing_context":138,"./types":143}],122:[function(_dereq_,module,exports){
-"use strict";var ref=_dereq_("../types"),toString=ref.toString,array=ref.array,ValueType=ref.ValueType,StringType=ref.StringType,NumberType=ref.NumberType,BooleanType=ref.BooleanType,checkSubtype=ref.checkSubtype,ref$1=_dereq_("../values"),typeOf=ref$1.typeOf,RuntimeError=_dereq_("../runtime_error"),types={string:StringType,number:NumberType,boolean:BooleanType},ArrayAssertion=function(e,r){this.type=e,this.input=r};ArrayAssertion.parse=function(e,r){if(e.length<2||e.length>4)return r.error("Expected 1, 2, or 3 arguments, but found "+(e.length-1)+" instead.");var t,n;if(e.length>2){var i=e[1];if("string"!=typeof i||!(i in types))return r.error('The item type argument of "array" must be one of string, number, boolean',1);t=types[i]}else t=ValueType;if(e.length>3){if("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2]))return r.error('The length argument to "array" must be a positive integer literal',2);n=e[2]}var o=array(t,n),a=r.parse(e[e.length-1],e.length-1,ValueType);return a?new ArrayAssertion(o,a):null},ArrayAssertion.prototype.evaluate=function(e){var r=this.input.evaluate(e);if(checkSubtype(this.type,typeOf(r)))throw new RuntimeError("Expected value to be of type "+toString(this.type)+", but found "+toString(typeOf(r))+" instead.");return r},ArrayAssertion.prototype.eachChild=function(e){e(this.input)},module.exports=ArrayAssertion;
-},{"../runtime_error":140,"../types":143,"../values":144}],123:[function(_dereq_,module,exports){
-"use strict";var ref=_dereq_("../types"),ObjectType=ref.ObjectType,ValueType=ref.ValueType,StringType=ref.StringType,NumberType=ref.NumberType,BooleanType=ref.BooleanType,RuntimeError=_dereq_("../runtime_error"),ref$1=_dereq_("../types"),checkSubtype=ref$1.checkSubtype,toString=ref$1.toString,ref$2=_dereq_("../values"),typeOf=ref$2.typeOf,types={string:StringType,number:NumberType,boolean:BooleanType,object:ObjectType},Assertion=function(e,r){this.type=e,this.args=r};Assertion.parse=function(e,r){if(e.length<2)return r.error("Expected at least one argument.");for(var t=e[0],n=types[t],o=[],p=1;p<e.length;p++){var u=r.parse(e[p],p,ValueType);if(!u)return null;o.push(u)}return new Assertion(n,o)},Assertion.prototype.evaluate=function(e){for(var r=this,t=0;t<this.args.length;t++){var n=r.args[t].evaluate(e);if(!checkSubtype(r.type,typeOf(n)))return n;if(t===r.args.length-1)throw new RuntimeError("Expected value to be of type "+toString(r.type)+", but found "+toString(typeOf(n))+" instead.")}return null},Assertion.prototype.eachChild=function(e){this.args.forEach(e)},module.exports=Assertion;
-},{"../runtime_error":140,"../types":143,"../values":144}],124:[function(_dereq_,module,exports){
-"use strict";var ref=_dereq_("../types"),array=ref.array,ValueType=ref.ValueType,NumberType=ref.NumberType,RuntimeError=_dereq_("../runtime_error"),At=function(e,r,t){this.type=e,this.index=r,this.input=t};At.parse=function(e,r){if(3!==e.length)return r.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var t=r.parse(e[1],1,NumberType),n=r.parse(e[2],2,array(r.expectedType||ValueType));if(!t||!n)return null;var u=n.type;return new At(u.itemType,t,n)},At.prototype.evaluate=function(e){var r=this.index.evaluate(e),t=this.input.evaluate(e);if(r<0||r>=t.length)throw new RuntimeError("Array index out of bounds: "+r+" > "+t.length+".");if(r!==Math.floor(r))throw new RuntimeError("Array index must be an integer, but found "+r+" instead.");return t[r]},At.prototype.eachChild=function(e){e(this.index),e(this.input)},module.exports=At;
-},{"../runtime_error":140,"../types":143}],125:[function(_dereq_,module,exports){
-"use strict";var ref=_dereq_("../types"),BooleanType=ref.BooleanType,Case=function(e,r,t){this.type=e,this.branches=r,this.otherwise=t};Case.parse=function(e,r){if(e.length<4)return r.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return r.error("Expected an odd number of arguments.");var t;r.expectedType&&"value"!==r.expectedType.kind&&(t=r.expectedType);for(var a=[],n=1;n<e.length-1;n+=2){var s=r.parse(e[n],n,BooleanType);if(!s)return null;var o=r.parse(e[n+1],n+1,t);if(!o)return null;a.push([s,o]),t=t||o.type}var u=r.parse(e[e.length-1],e.length-1,t);return u?new Case(t,a,u):null},Case.prototype.evaluate=function(e){for(var r=this,t=0,a=r.branches;t<a.length;t+=1){var n=a[t],s=n[0],o=n[1];if(s.evaluate(e))return o.evaluate(e)}return this.otherwise.evaluate(e)},Case.prototype.eachChild=function(e){for(var r=this,t=0,a=r.branches;t<a.length;t+=1){var n=a[t],s=n[0],o=n[1];e(s),e(o)}e(this.otherwise)},module.exports=Case;
-},{"../types":143}],126:[function(_dereq_,module,exports){
-"use strict";var Coalesce=function(e,t){this.type=e,this.args=t};Coalesce.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var r=null;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(var a=[],l=0,n=e.slice(1);l<n.length;l+=1){var o=n[l],s=t.parse(o,1+a.length,r);if(!s)return null;r=r||s.type,a.push(s)}return new Coalesce(r,a)},Coalesce.prototype.evaluate=function(e){for(var t=this,r=null,a=0,l=t.args;a<l.length;a+=1){if(null!==(r=l[a].evaluate(e)))break}return r},Coalesce.prototype.eachChild=function(e){this.args.forEach(e)},module.exports=Coalesce;
-},{}],127:[function(_dereq_,module,exports){
-"use strict";var ref=_dereq_("../types"),ColorType=ref.ColorType,ValueType=ref.ValueType,NumberType=ref.NumberType,ref$1=_dereq_("../values"),Color=ref$1.Color,validateRGBA=ref$1.validateRGBA,RuntimeError=_dereq_("../runtime_error"),types={"to-number":NumberType,"to-color":ColorType},Coercion=function(r,e){this.type=r,this.args=e};Coercion.parse=function(r,e){if(r.length<2)return e.error("Expected at least one argument.");for(var o=r[0],t=types[o],n=[],i=1;i<r.length;i++){var a=e.parse(r[i],i,ValueType);if(!a)return null;n.push(a)}return new Coercion(t,n)},Coercion.prototype.evaluate=function(r){var e=this;if("color"===this.type.kind){for(var o,t,n=0,i=e.args;n<i.length;n+=1){if(o=i[n].evaluate(r),t=null,"string"==typeof o){var a=r.parseColor(o);if(a)return a}else if(Array.isArray(o)&&!(t=o.length<3||o.length>4?"Invalid rbga value "+JSON.stringify(o)+": expected an array containing either three or four numeric values.":validateRGBA(o[0],o[1],o[2],o[3])))return new Color(o[0]/255,o[1]/255,o[2]/255,o[3])}throw new RuntimeError(t||"Could not parse color from value '"+("string"==typeof o?o:JSON.stringify(o))+"'")}for(var u=null,l=0,s=e.args;l<s.length;l+=1){if(null!==(u=s[l].evaluate(r))){var f=Number(u);if(!isNaN(f))return f}}throw new RuntimeError("Could not convert "+JSON.stringify(u)+" to number.")},Coercion.prototype.eachChild=function(r){this.args.forEach(r)},module.exports=Coercion;
-},{"../runtime_error":140,"../types":143,"../values":144}],128:[function(_dereq_,module,exports){
-"use strict";function rgba(e,r){var t=r[0],a=r[1],n=r[2],u=r[3];t=t.evaluate(e),a=a.evaluate(e),n=n.evaluate(e),u=u&&u.evaluate(e);var o=validateRGBA(t,a,n,u);if(o)throw new RuntimeError(o);return new Color(t/255,a/255,n/255,u)}function has(e,r){return e in r}function get(e,r){var t=r[e];return void 0===t?null:t}function length(e,r){return r[0].evaluate(e).length}function eq(e,r){var t=r[0],a=r[1];return t.evaluate(e)===a.evaluate(e)}function ne(e,r){var t=r[0],a=r[1];return t.evaluate(e)!==a.evaluate(e)}function lt(e,r){var t=r[0],a=r[1];return t.evaluate(e)<a.evaluate(e)}function gt(e,r){var t=r[0],a=r[1];return t.evaluate(e)>a.evaluate(e)}function lteq(e,r){var t=r[0],a=r[1];return t.evaluate(e)<=a.evaluate(e)}function gteq(e,r){var t=r[0],a=r[1];return t.evaluate(e)>=a.evaluate(e)}var ref=_dereq_("../types"),NullType=ref.NullType,NumberType=ref.NumberType,StringType=ref.StringType,BooleanType=ref.BooleanType,ColorType=ref.ColorType,ObjectType=ref.ObjectType,ValueType=ref.ValueType,ErrorType=ref.ErrorType,array=ref.array,toString=ref.toString,ref$1=_dereq_("../values"),typeOf=ref$1.typeOf,Color=ref$1.Color,validateRGBA=ref$1.validateRGBA,ref$2=_dereq_("../compound_expression"),CompoundExpression=ref$2.CompoundExpression,varargs=ref$2.varargs,RuntimeError=_dereq_("../runtime_error"),Let=_dereq_("./let"),Var=_dereq_("./var"),Literal=_dereq_("./literal"),Assertion=_dereq_("./assertion"),ArrayAssertion=_dereq_("./array"),Coercion=_dereq_("./coercion"),At=_dereq_("./at"),Match=_dereq_("./match"),Case=_dereq_("./case"),Step=_dereq_("./step"),Interpolate=_dereq_("./interpolate"),Coalesce=_dereq_("./coalesce"),expressions={let:Let,var:Var,literal:Literal,string:Assertion,number:Assertion,boolean:Assertion,object:Assertion,array:ArrayAssertion,"to-number":Coercion,"to-color":Coercion,at:At,case:Case,match:Match,coalesce:Coalesce,step:Step,interpolate:Interpolate};CompoundExpression.register(expressions,{error:[ErrorType,[StringType],function(e,r){var t=r[0];throw new RuntimeError(t.evaluate(e))}],typeof:[StringType,[ValueType],function(e,r){var t=r[0];return toString(typeOf(t.evaluate(e)))}],"to-string":[StringType,[ValueType],function(e,r){var t=r[0];t=t.evaluate(e);var a=typeof t;return null===t||"string"===a||"number"===a||"boolean"===a?String(t):t instanceof Color?"rgba("+255*t.r+","+255*t.g+","+255*t.b+","+t.a+")":JSON.stringify(t)}],"to-boolean":[BooleanType,[ValueType],function(e,r){var t=r[0];return Boolean(t.evaluate(e))}],"to-rgba":[array(NumberType,4),[ColorType],function(e,r){var t=r[0],a=t.evaluate(e);return[a.r,a.g,a.b,a.a]}],rgb:[ColorType,[NumberType,NumberType,NumberType],rgba],rgba:[ColorType,[NumberType,NumberType,NumberType,NumberType],rgba],length:{type:NumberType,overloads:[[[StringType],length],[[array(ValueType)],length]]},has:{type:BooleanType,overloads:[[[StringType],function(e,r){return has(r[0].evaluate(e),e.properties())}],[[StringType,ObjectType],function(e,r){var t=r[0],a=r[1];return has(t.evaluate(e),a.evaluate(e))}]]},get:{type:ValueType,overloads:[[[StringType],function(e,r){return get(r[0].evaluate(e),e.properties())}],[[StringType,ObjectType],function(e,r){var t=r[0],a=r[1];return get(t.evaluate(e),a.evaluate(e))}]]},properties:[ObjectType,[],function(e){return e.properties()}],"geometry-type":[StringType,[],function(e){return e.geometryType()}],id:[ValueType,[],function(e){return e.id()}],zoom:[NumberType,[],function(e){return e.globals.zoom}],"heatmap-density":[NumberType,[],function(e){return e.globals.heatmapDensity||0}],"+":[NumberType,varargs(NumberType),function(e,r){for(var t=0,a=0,n=r;a<n.length;a+=1){t+=n[a].evaluate(e)}return t}],"*":[NumberType,varargs(NumberType),function(e,r){for(var t=1,a=0,n=r;a<n.length;a+=1){t*=n[a].evaluate(e)}return t}],"-":{type:NumberType,overloads:[[[NumberType,NumberType],function(e,r){var t=r[0],a=r[1];return t.evaluate(e)-a.evaluate(e)}],[[NumberType],function(e,r){return-r[0].evaluate(e)}]]},"/":[NumberType,[NumberType,NumberType],function(e,r){var t=r[0],a=r[1];return t.evaluate(e)/a.evaluate(e)}],"%":[NumberType,[NumberType,NumberType],function(e,r){var t=r[0],a=r[1];return t.evaluate(e)%a.evaluate(e)}],ln2:[NumberType,[],function(){return Math.LN2}],pi:[NumberType,[],function(){return Math.PI}],e:[NumberType,[],function(){return Math.E}],"^":[NumberType,[NumberType,NumberType],function(e,r){var t=r[0],a=r[1];return Math.pow(t.evaluate(e),a.evaluate(e))}],sqrt:[NumberType,[NumberType],function(e,r){var t=r[0];return Math.sqrt(t.evaluate(e))}],log10:[NumberType,[NumberType],function(e,r){var t=r[0];return Math.log10(t.evaluate(e))}],ln:[NumberType,[NumberType],function(e,r){var t=r[0];return Math.log(t.evaluate(e))}],log2:[NumberType,[NumberType],function(e,r){var t=r[0];return Math.log2(t.evaluate(e))}],sin:[NumberType,[NumberType],function(e,r){var t=r[0];return Math.sin(t.evaluate(e))}],cos:[NumberType,[NumberType],function(e,r){var t=r[0];return Math.cos(t.evaluate(e))}],tan:[NumberType,[NumberType],function(e,r){var t=r[0];return Math.tan(t.evaluate(e))}],asin:[NumberType,[NumberType],function(e,r){var t=r[0];return Math.asin(t.evaluate(e))}],acos:[NumberType,[NumberType],function(e,r){var t=r[0];return Math.acos(t.evaluate(e))}],atan:[NumberType,[NumberType],function(e,r){var t=r[0];return Math.atan(t.evaluate(e))}],min:[NumberType,varargs(NumberType),function(e,r){return Math.min.apply(Math,r.map(function(r){return r.evaluate(e)}))}],max:[NumberType,varargs(NumberType),function(e,r){return Math.max.apply(Math,r.map(function(r){return r.evaluate(e)}))}],"==":{type:BooleanType,overloads:[[[NumberType,NumberType],eq],[[StringType,StringType],eq],[[BooleanType,BooleanType],eq],[[NullType,NullType],eq]]},"!=":{type:BooleanType,overloads:[[[NumberType,NumberType],ne],[[StringType,StringType],ne],[[BooleanType,BooleanType],ne],[[NullType,NullType],ne]]},">":{type:BooleanType,overloads:[[[NumberType,NumberType],gt],[[StringType,StringType],gt]]},"<":{type:BooleanType,overloads:[[[NumberType,NumberType],lt],[[StringType,StringType],lt]]},">=":{type:BooleanType,overloads:[[[NumberType,NumberType],gteq],[[StringType,StringType],gteq]]},"<=":{type:BooleanType,overloads:[[[NumberType,NumberType],lteq],[[StringType,StringType],lteq]]},all:{type:BooleanType,overloads:[[[BooleanType,BooleanType],function(e,r){var t=r[0],a=r[1];return t.evaluate(e)&&a.evaluate(e)}],[varargs(BooleanType),function(e,r){for(var t=0,a=r;t<a.length;t+=1){if(!a[t].evaluate(e))return!1}return!0}]]},any:{type:BooleanType,overloads:[[[BooleanType,BooleanType],function(e,r){var t=r[0],a=r[1];return t.evaluate(e)||a.evaluate(e)}],[varargs(BooleanType),function(e,r){for(var t=0,a=r;t<a.length;t+=1){if(a[t].evaluate(e))return!0}return!1}]]},"!":[BooleanType,[BooleanType],function(e,r){return!r[0].evaluate(e)}],upcase:[StringType,[StringType],function(e,r){return r[0].evaluate(e).toUpperCase()}],downcase:[StringType,[StringType],function(e,r){return r[0].evaluate(e).toLowerCase()}],concat:[StringType,varargs(StringType),function(e,r){return r.map(function(r){return r.evaluate(e)}).join("")}]}),module.exports=expressions;
-},{"../compound_expression":121,"../runtime_error":140,"../types":143,"../values":144,"./array":122,"./assertion":123,"./at":124,"./case":125,"./coalesce":126,"./coercion":127,"./interpolate":129,"./let":130,"./literal":131,"./match":132,"./step":133,"./var":134}],129:[function(_dereq_,module,exports){
-"use strict";function exponentialInterpolation(e,t,r,n){var i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}var UnitBezier=_dereq_("@mapbox/unitbezier"),interpolate=_dereq_("../../util/interpolate"),ref=_dereq_("../types"),toString=ref.toString,NumberType=ref.NumberType,ref$1=_dereq_("../stops"),findStopLessThanOrEqualTo=ref$1.findStopLessThanOrEqualTo,Interpolate=function(e,t,r,n){var i=this;this.type=e,this.interpolation=t,this.input=r,this.labels=[],this.outputs=[];for(var a=0,o=n;a<o.length;a+=1){var u=o[a],p=u[0],l=u[1];i.labels.push(p),i.outputs.push(l)}};Interpolate.interpolationFactor=function(e,t,r,n){var i=0;if("exponential"===e.name)i=exponentialInterpolation(t,e.base,r,n);else if("linear"===e.name)i=exponentialInterpolation(t,1,r,n);else if("cubic-bezier"===e.name){var a=e.controlPoints,o=new UnitBezier(a[0],a[1],a[2],a[3]);i=o.solve(exponentialInterpolation(t,1,r,n))}return i},Interpolate.parse=function(e,t){var r=e[1],n=e[2],i=e.slice(3);if(!Array.isArray(r)||0===r.length)return t.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){var a=r[1];if("number"!=typeof a)return t.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:a}}else{if("cubic-bezier"!==r[0])return t.error("Unknown interpolation type "+String(r[0]),1,0);var o=r.slice(1);if(4!==o.length||o.some(function(e){return"number"!=typeof e||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:o}}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(!(n=t.parse(n,2,NumberType)))return null;var u=[],p=null;t.expectedType&&"value"!==t.expectedType.kind&&(p=t.expectedType);for(var l=0;l<i.length;l+=2){var s=i[l],f=i[l+1],h=l+3,c=l+4;if("number"!=typeof s)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',h);if(u.length&&u[u.length-1][0]>=s)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',h);var v=t.parse(f,c,p);if(!v)return null;p=p||v.type,u.push([s,v])}return"number"===p.kind||"color"===p.kind||"array"===p.kind&&"number"===p.itemType.kind&&"number"==typeof p.N?new Interpolate(p,r,n,u):t.error("Type "+toString(p)+" is not interpolatable.")},Interpolate.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);var a=findStopLessThanOrEqualTo(t,n),o=t[a],u=t[a+1],p=Interpolate.interpolationFactor(this.interpolation,n,o,u),l=r[a].evaluate(e),s=r[a+1].evaluate(e);return interpolate[this.type.kind.toLowerCase()](l,s,p)},Interpolate.prototype.eachChild=function(e){var t=this;e(this.input);for(var r=0,n=t.outputs;r<n.length;r+=1){e(n[r])}},module.exports=Interpolate;
-},{"../../util/interpolate":154,"../stops":142,"../types":143,"@mapbox/unitbezier":5}],130:[function(_dereq_,module,exports){
-"use strict";var Let=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Let.prototype.evaluate=function(t){t.pushScope(this.bindings);var e=this.result.evaluate(t);return t.popScope(),e},Let.prototype.eachChild=function(t){for(var e=this,r=0,n=e.bindings;r<n.length;r+=1){t(n[r][1])}t(this.result)},Let.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var s=e.parse(t[n+1],n+1);if(!s)return null;r.push([i,s])}var a=e.parse(t[t.length-1],t.length-1,void 0,r);return a?new Let(r,a):null},module.exports=Let;
-},{}],131:[function(_dereq_,module,exports){
-"use strict";var ref=_dereq_("../values"),isValue=ref.isValue,typeOf=ref.typeOf,Literal=function(e,r){this.type=e,this.value=r};Literal.parse=function(e,r){if(2!==e.length)return r.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!isValue(e[1]))return r.error("invalid value");var t=e[1],i=typeOf(t),a=r.expectedType;return"array"!==i.kind||0!==i.N||!a||"array"!==a.kind||"number"==typeof a.N&&0!==a.N||(i=a),new Literal(i,t)},Literal.prototype.evaluate=function(){return this.value},Literal.prototype.eachChild=function(){},module.exports=Literal;
-},{"../values":144}],132:[function(_dereq_,module,exports){
-"use strict";var ref=_dereq_("../values"),typeOf=ref.typeOf,Match=function(e,t,r,n,a,u){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=a,this.otherwise=u};Match.parse=function(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.");var r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var a={},u=[],s=2;s<e.length-1;s+=2){var i=e[s],h=e[s+1];Array.isArray(i)||(i=[i]);var l=t.concat(s);if(0===i.length)return l.error("Expected at least one branch label.");for(var o=0,p=i;o<p.length;o+=1){var c=p[o];if("number"!=typeof c&&"string"!=typeof c)return l.error("Branch labels must be numbers or strings.");if("number"==typeof c&&Math.abs(c)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof c&&Math.floor(c)!==c)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,typeOf(c)))return null}else r=typeOf(c);if(void 0!==a[String(c)])return l.error("Branch labels must be unique.");a[String(c)]=u.length}var f=t.parse(h,s,n);if(!f)return null;n=n||f.type,u.push(f)}var b=t.parse(e[1],1,r);if(!b)return null;var y=t.parse(e[e.length-1],e.length-1,n);return y?new Match(r,n,b,a,u,y):null},Match.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},Match.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},module.exports=Match;
-},{"../values":144}],133:[function(_dereq_,module,exports){
-"use strict";var ref=_dereq_("../types"),NumberType=ref.NumberType,ref$1=_dereq_("../stops"),findStopLessThanOrEqualTo=ref$1.findStopLessThanOrEqualTo,Step=function(e,t,r){var u=this;this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var n=0,s=r;n<s.length;n+=1){var p=s[n],a=p[0],i=p[1];u.labels.push(a),u.outputs.push(i)}};Step.parse=function(e,t){var r=e[1],u=e.slice(2);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(!(r=t.parse(r,1,NumberType)))return null;var n=[],s=null;t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType),u.unshift(-1/0);for(var p=0;p<u.length;p+=2){var a=u[p],i=u[p+1],l=p+1,o=p+2;if("number"!=typeof a)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var h=t.parse(i,o,s);if(!h)return null;s=s||h.type,n.push([a,h])}return new Step(s,r,n)},Step.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var u=this.input.evaluate(e);if(u<=t[0])return r[0].evaluate(e);var n=t.length;return u>=t[n-1]?r[n-1].evaluate(e):r[findStopLessThanOrEqualTo(t,u)].evaluate(e)},Step.prototype.eachChild=function(e){var t=this;e(this.input);for(var r=0,u=t.outputs;r<u.length;r+=1){e(u[r])}},module.exports=Step;
-},{"../stops":142,"../types":143}],134:[function(_dereq_,module,exports){
-"use strict";var Var=function(e,r){this.type=r,this.name=e};Var.parse=function(e,r){if(2!==e.length||"string"!=typeof e[1])return r.error("'var' expression requires exactly one string literal argument.");var t=e[1];return r.scope.has(t)?new Var(t,r.scope.get(t).type):r.error('Unknown variable "'+t+'". Make sure "'+t+'" has been bound in an enclosing "let" expression before using it.',1)},Var.prototype.evaluate=function(e){return e.scope.get(this.name).evaluate(e)},Var.prototype.eachChild=function(){},module.exports=Var;
-},{}],135:[function(_dereq_,module,exports){
-"use strict";var Scope=_dereq_("./scope"),ref=_dereq_("./values"),Color=ref.Color,geometryTypes=["Unknown","Point","LineString","Polygon"],EvaluationContext=function(){this.scope=new Scope,this._parseColorCache={}};EvaluationContext.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},EvaluationContext.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?geometryTypes[this.feature.type]:this.feature.type:null},EvaluationContext.prototype.properties=function(){return this.feature&&this.feature.properties||{}},EvaluationContext.prototype.pushScope=function(t){this.scope=this.scope.concat(t)},EvaluationContext.prototype.popScope=function(){this.scope=this.scope.parent},EvaluationContext.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Color.parse(t)),e},module.exports=EvaluationContext;
-},{"./scope":141,"./values":144}],136:[function(_dereq_,module,exports){
-"use strict";function isExpression(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in definitions}function createExpression(e,r,n){void 0===n&&(n={});var o=new ParsingContext(definitions,[],getExpectedType(r)),t=o.parse(e);if(!t)return error(o.errors);var i,s=new EvaluationContext;if(!1===n.handleErrors)i=function(e,r){return s.globals=e,s.feature=r,t.evaluate(s)};else{var a,u={},p=getDefaultValue(r);"enum"===r.type&&(a=r.values),i=function(e,r){s.globals=e,s.feature=r;try{var n=t.evaluate(s);if(null===n||void 0===n)return p;if(a&&!(n in a))throw new RuntimeError("Expected value to be one of "+Object.keys(a).map(function(e){return JSON.stringify(e)}).join(", ")+", but found "+JSON.stringify(n)+" instead.");return n}catch(e){return u[e.message]||(u[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),p}}}return success({evaluate:i,parsed:t})}function createPropertyExpression(e,r,n){if(void 0===n&&(n={}),e=createExpression(e,r,n),"error"===e.result)return e;var o=e.value,t=o.evaluate,i=o.parsed,s=isConstant.isFeatureConstant(i);if(!s&&!r["property-function"])return error([new ParsingError("","property expressions not supported")]);var a=isConstant.isGlobalPropertyConstant(i,["zoom"]);if(!a&&!1===r["zoom-function"])return error([new ParsingError("","zoom expressions not supported")]);var u=findZoomCurve(i);if(!u&&!a)return error([new ParsingError("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(u instanceof ParsingError)return error([u]);if(u instanceof Interpolate&&"piecewise-constant"===r.function)return error([new ParsingError("",'"interpolate" expressions cannot be used with this property')]);if(!u)return success(s?{kind:"constant",parsed:i,evaluate:t}:{kind:"source",parsed:i,evaluate:t});var p=u instanceof Interpolate?Interpolate.interpolationFactor.bind(void 0,u.interpolation):function(){return 0},l=u.labels;return success(s?{kind:"camera",parsed:i,evaluate:t,interpolationFactor:p,zoomStops:l}:{kind:"composite",parsed:i,evaluate:t,interpolationFactor:p,zoomStops:l})}function normalizePropertyExpression(e,r){if(isFunction(e))return createFunction(e,r);if(isExpression(e)){var n=createPropertyExpression(e,r);if("error"===n.result)throw new Error(n.value.map(function(e){return e.key+": "+e.message}).join(", "));return n.value}var o=e;return"string"==typeof e&&"color"===r.type&&(o=Color.parse(e)),{kind:"constant",evaluate:function(){return o}}}function findZoomCurve(e){var r=null;if(e instanceof Let)r=findZoomCurve(e.result);else if(e instanceof Coalesce)for(var n=0,o=e.args;n<o.length;n+=1){var t=o[n];if(r=findZoomCurve(t))break}else(e instanceof Step||e instanceof Interpolate)&&e.input instanceof CompoundExpression&&"zoom"===e.input.name&&(r=e);return r instanceof ParsingError?r:(e.eachChild(function(e){var n=findZoomCurve(e);n instanceof ParsingError?r=n:!r&&n?r=new ParsingError("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new ParsingError("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r)}function getExpectedType(e){var r={color:ColorType,string:StringType,number:NumberType,enum:StringType,boolean:BooleanType};return"array"===e.type?array(r[e.value]||ValueType,e.length):r[e.type]||null}function getDefaultValue(e){return"color"===e.type&&isFunction(e.default)?new Color(0,0,0,0):"color"===e.type?Color.parse(e.default)||null:void 0===e.default?null:e.default}var ParsingError=_dereq_("./parsing_error"),ParsingContext=_dereq_("./parsing_context"),EvaluationContext=_dereq_("./evaluation_context"),ref=_dereq_("./compound_expression"),CompoundExpression=ref.CompoundExpression,Step=_dereq_("./definitions/step"),Interpolate=_dereq_("./definitions/interpolate"),Coalesce=_dereq_("./definitions/coalesce"),Let=_dereq_("./definitions/let"),definitions=_dereq_("./definitions"),isConstant=_dereq_("./is_constant"),RuntimeError=_dereq_("./runtime_error"),ref$1=_dereq_("../util/result"),success=ref$1.success,error=ref$1.error,ref$2=_dereq_("../function"),isFunction=ref$2.isFunction,createFunction=ref$2.createFunction,ref$3=_dereq_("./values"),Color=ref$3.Color;module.exports={isExpression:isExpression,createExpression:createExpression,createPropertyExpression:createPropertyExpression,normalizePropertyExpression:normalizePropertyExpression};var ref$4=_dereq_("./types"),ColorType=ref$4.ColorType,StringType=ref$4.StringType,NumberType=ref$4.NumberType,BooleanType=ref$4.BooleanType,ValueType=ref$4.ValueType,array=ref$4.array;
-},{"../function":146,"../util/result":156,"./compound_expression":121,"./definitions":128,"./definitions/coalesce":126,"./definitions/interpolate":129,"./definitions/let":130,"./definitions/step":133,"./evaluation_context":135,"./is_constant":137,"./parsing_context":138,"./parsing_error":139,"./runtime_error":140,"./types":143,"./values":144}],137:[function(_dereq_,module,exports){
-"use strict";function isFeatureConstant(n){if(n instanceof CompoundExpression){if("get"===n.name&&1===n.args.length)return!1;if("has"===n.name&&1===n.args.length)return!1;if("properties"===n.name||"geometry-type"===n.name||"id"===n.name)return!1}var e=!0;return n.eachChild(function(n){e&&!isFeatureConstant(n)&&(e=!1)}),e}function isGlobalPropertyConstant(n,e){if(n instanceof CompoundExpression&&e.indexOf(n.name)>=0)return!1;var t=!0;return n.eachChild(function(n){t&&!isGlobalPropertyConstant(n,e)&&(t=!1)}),t}var ref=_dereq_("./compound_expression"),CompoundExpression=ref.CompoundExpression;module.exports={isFeatureConstant:isFeatureConstant,isGlobalPropertyConstant:isGlobalPropertyConstant};
-},{"./compound_expression":121}],138:[function(_dereq_,module,exports){
-"use strict";function isConstant(e){var r=_dereq_("./compound_expression"),t=r.CompoundExpression,n=_dereq_("./is_constant"),i=n.isGlobalPropertyConstant,o=n.isFeatureConstant;if(e instanceof _dereq_("./definitions/var"))return!1;if(e instanceof t&&"error"===e.name)return!1;var a=!0;return e.eachChild(function(e){e instanceof Literal||(a=!1)}),!!a&&(o(e)&&i(e,["zoom","heatmap-density"]))}var Scope=_dereq_("./scope"),ref=_dereq_("./types"),checkSubtype=ref.checkSubtype,ParsingError=_dereq_("./parsing_error"),Literal=_dereq_("./definitions/literal"),ParsingContext=function(e,r,t,n,i){void 0===r&&(r=[]),void 0===n&&(n=new Scope),void 0===i&&(i=[]),this.definitions=e,this.path=r,this.key=r.map(function(e){return"["+e+"]"}).join(""),this.scope=n,this.errors=i,this.expectedType=t};ParsingContext.prototype.parse=function(e,r,t,n){var i=this;if(r&&(i=i.concat(r,t,n)),null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return i.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var o=e[0];if("string"!=typeof o)return i.error("Expression name must be a string, but found "+typeof o+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var a=i.definitions[o];if(a){var s=a.parse(e,i);if(!s)return null;var u=i.expectedType,l=s.type;if(u){if(("string"===u.kind||"number"===u.kind||"boolean"===u.kind)&&"value"===l.kind){s=new(_dereq_("./definitions/assertion"))(u,[s])}else if("color"===u.kind&&("value"===l.kind||"string"===l.kind)){var p=_dereq_("./definitions/coercion");s=new p(u,[s])}if(i.checkSubtype(u,s.type))return null}if(!(s instanceof Literal)&&isConstant(s)){var c=new(_dereq_("./evaluation_context"));try{s=new Literal(s.type,s.evaluate(c))}catch(e){return i.error(e.message),null}}return s}return i.error('Unknown expression "'+o+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===e?i.error("'undefined' value invalid. Use null instead."):"object"==typeof e?i.error('Bare objects invalid. Use ["literal", {...}] instead.'):i.error("Expected an array, but found "+typeof e+" instead.")},ParsingContext.prototype.concat=function(e,r,t){var n="number"==typeof e?this.path.concat(e):this.path,i=t?this.scope.concat(t):this.scope;return new ParsingContext(this.definitions,n,r||null,i,this.errors)},ParsingContext.prototype.error=function(e){for(var r=[],t=arguments.length-1;t-- >0;)r[t]=arguments[t+1];var n=""+this.key+r.map(function(e){return"["+e+"]"}).join("");this.errors.push(new ParsingError(n,e))},ParsingContext.prototype.checkSubtype=function(e,r){var t=checkSubtype(e,r);return t&&this.error(t),t},module.exports=ParsingContext;
-},{"./compound_expression":121,"./definitions/assertion":123,"./definitions/coercion":127,"./definitions/literal":131,"./definitions/var":134,"./evaluation_context":135,"./is_constant":137,"./parsing_error":139,"./scope":141,"./types":143}],139:[function(_dereq_,module,exports){
-"use strict";var ParsingError=function(r){function t(t,o){r.call(this,o),this.message=o,this.key=t}return r&&(t.__proto__=r),t.prototype=Object.create(r&&r.prototype),t.prototype.constructor=t,t}(Error);module.exports=ParsingError;
-},{}],140:[function(_dereq_,module,exports){
-"use strict";var RuntimeError=function(r){this.name="ExpressionEvaluationError",this.message=r};RuntimeError.prototype.toJSON=function(){return this.message},module.exports=RuntimeError;
-},{}],141:[function(_dereq_,module,exports){
-"use strict";var Scope=function(t,n){var i=this;void 0===n&&(n=[]),this.parent=t,this.bindings={};for(var e=0,r=n;e<r.length;e+=1){var o=r[e],s=o[0],p=o[1];i.bindings[s]=p}};Scope.prototype.concat=function(t){return new Scope(this,t)},Scope.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Scope.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)},module.exports=Scope;
-},{}],142:[function(_dereq_,module,exports){
-"use strict";function findStopLessThanOrEqualTo(o,r){for(var t,n,a=o.length,e=0,s=a-1,u=0;e<=s;){if(u=Math.floor((e+s)/2),t=o[u],n=o[u+1],r===t||r>t&&r<n)return u;t<r?e=u+1:t>r&&(s=u-1)}return Math.max(u-1,0)}module.exports={findStopLessThanOrEqualTo:findStopLessThanOrEqualTo};
-},{}],143:[function(_dereq_,module,exports){
-"use strict";function array(e,r){return{kind:"array",itemType:e,N:r}}function toString(e){if("array"===e.kind){var r=toString(e.itemType);return"number"==typeof e.N?"array<"+r+", "+e.N+">":"value"===e.itemType.kind?"array":"array<"+r+">"}return e.kind}function checkSubtype(e,r){if("error"===r.kind)return null;if("array"===e.kind){if("array"===r.kind&&!checkSubtype(e.itemType,r.itemType)&&("number"!=typeof e.N||e.N===r.N))return null}else{if(e.kind===r.kind)return null;if("value"===e.kind)for(var n=0,y=valueMemberTypes;n<y.length;n+=1){var t=y[n];if(!checkSubtype(t,r))return null}}return"Expected "+toString(e)+" but found "+toString(r)+" instead."}var NullType={kind:"null"},NumberType={kind:"number"},StringType={kind:"string"},BooleanType={kind:"boolean"},ColorType={kind:"color"},ObjectType={kind:"object"},ValueType={kind:"value"},ErrorType={kind:"error"},valueMemberTypes=[NullType,NumberType,StringType,BooleanType,ColorType,ObjectType,array(ValueType)];module.exports={NullType:NullType,NumberType:NumberType,StringType:StringType,BooleanType:BooleanType,ColorType:ColorType,ObjectType:ObjectType,ValueType:ValueType,array:array,ErrorType:ErrorType,toString:toString,checkSubtype:checkSubtype};
-},{}],144:[function(_dereq_,module,exports){
-"use strict";function validateRGBA(e,r,t,n){if(!("number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255&&"number"==typeof t&&t>=0&&t<=255)){return"Invalid rgba value ["+("number"==typeof n?[e,r,t,n]:[e,r,t]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[e,r,t,n].join(", ")+"]: 'a' must be between 0 and 1."}function isValue(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Color)return!0;if(Array.isArray(e)){for(var r=0,t=e;r<t.length;r+=1){if(!isValue(t[r]))return!1}return!0}if("object"==typeof e){for(var n in e)if(!isValue(e[n]))return!1;return!0}return!1}function typeOf(e){if(null===e)return NullType;if("string"==typeof e)return StringType;if("boolean"==typeof e)return BooleanType;if("number"==typeof e)return NumberType;if(e instanceof Color)return ColorType;if(Array.isArray(e)){for(var r,t=e.length,n=0,u=e;n<u.length;n+=1){var o=u[n],f=typeOf(o);if(r){if(r===f)continue;r=ValueType;break}r=f}return array(r||ValueType,t)}return ObjectType}var Color=_dereq_("../util/color"),ref=_dereq_("./types"),NullType=ref.NullType,NumberType=ref.NumberType,StringType=ref.StringType,BooleanType=ref.BooleanType,ColorType=ref.ColorType,ObjectType=ref.ObjectType,ValueType=ref.ValueType,array=ref.array;module.exports={Color:Color,validateRGBA:validateRGBA,isValue:isValue,typeOf:typeOf};
-},{"../util/color":150,"./types":143}],145:[function(_dereq_,module,exports){
-"use strict";function isExpressionFilter(e){if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3===e.length&&(Array.isArray(e[1])||Array.isArray(e[2]));case"any":case"all":for(var r=0,i=e.slice(1);r<i.length;r+=1){var n=i[r];if(!isExpressionFilter(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}function createFilter(e){if(!e)return function(){return!0};if(!isExpressionFilter(e))return new Function("g","f","var p = (f && f.properties || {}); return "+compile(e));var r=createExpression(e,filterSpec);if("error"===r.result)throw new Error(r.value.map(function(e){return e.key+": "+e.message}).join(", "));return r.value.evaluate}function compile(e){if(!e)return"true";var r=e[0];return e.length<=1?"any"===r?"false":"true":"("+("=="===r?compileComparisonOp(e[1],e[2],"===",!1):"!="===r?compileComparisonOp(e[1],e[2],"!==",!1):"<"===r||">"===r||"<="===r||">="===r?compileComparisonOp(e[1],e[2],r,!0):"any"===r?compileLogicalOp(e.slice(1),"||"):"all"===r?compileLogicalOp(e.slice(1),"&&"):"none"===r?compileNegation(compileLogicalOp(e.slice(1),"||")):"in"===r?compileInOp(e[1],e.slice(2)):"!in"===r?compileNegation(compileInOp(e[1],e.slice(2))):"has"===r?compileHasOp(e[1]):"!has"===r?compileNegation(compileHasOp(e[1])):"true")+")"}function compilePropertyReference(e){return"$type"===e?"f.type":"$id"===e?"f.id":"p["+JSON.stringify(e)+"]"}function compileComparisonOp(e,r,i,n){var t=compilePropertyReference(e),o="$type"===e?types.indexOf(r):JSON.stringify(r);return(n?"typeof "+t+"=== typeof "+o+"&&":"")+t+i+o}function compileLogicalOp(e,r){return e.map(compile).join(r)}function compileInOp(e,r){"$type"===e&&(r=r.map(function(e){return types.indexOf(e)}));var i=JSON.stringify(r.sort(compare)),n=compilePropertyReference(e);return r.length<=200?i+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+i+",0,"+(r.length-1)+")"}function compileHasOp(e){return"$id"===e?'"id" in f':JSON.stringify(e)+" in p"}function compileNegation(e){return"!("+e+")"}function compare(e,r){return e<r?-1:e>r?1:0}var ref=_dereq_("../expression"),createExpression=ref.createExpression;module.exports=createFilter,module.exports.isExpressionFilter=isExpressionFilter;var types=["Unknown","Point","LineString","Polygon"],filterSpec={type:"boolean",default:!1,function:!0,"property-function":!0,"zoom-function":!0};
-},{"../expression":136}],146:[function(_dereq_,module,exports){
-"use strict";function isFunction(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function identityFunction(t){return t}function createFunction(t,e){var o="color"===e.type,r=t.stops&&"object"==typeof t.stops[0][0],n=r||void 0!==t.property,a=r||!n,i=t.type||("interpolated"===e.function?"exponential":"interval");o&&(t=extend({},t),t.stops&&(t.stops=t.stops.map(function(t){return[t[0],Color.parse(t[1])]})),t.default?t.default=Color.parse(t.default):t.default=Color.parse(e.default));var u,s,p;if("exponential"===i)u=evaluateExponentialFunction;else if("interval"===i)u=evaluateIntervalFunction;else if("categorical"===i){u=evaluateCategoricalFunction,s=Object.create(null);for(var l=0,c=t.stops;l<c.length;l+=1){var f=c[l];s[f[0]]=f[1]}p=typeof t.stops[0][0]}else{if("identity"!==i)throw new Error('Unknown function type "'+i+'"');u=evaluateIdentityFunction}var v;if(t.colorSpace&&"rgb"!==t.colorSpace){if(!colorSpaces[t.colorSpace])throw new Error("Unknown color space: "+t.colorSpace);var d=colorSpaces[t.colorSpace];t=JSON.parse(JSON.stringify(t));for(var y=0;y<t.stops.length;y++)t.stops[y]=[t.stops[y][0],d.forward(t.stops[y][1])];v=d.reverse}else v=identityFunction;if(r){for(var F={},h=[],m=0;m<t.stops.length;m++){var g=t.stops[m],b=g[0].zoom;void 0===F[b]&&(F[b]={zoom:b,type:t.type,property:t.property,default:t.default,stops:[]},h.push(b)),F[b].stops.push([g[0].value,g[1]])}for(var S=[],x=0,T=h;x<T.length;x+=1){var q=T[x];S.push([F[q].zoom,createFunction(F[q],e)])}return{kind:"composite",interpolationFactor:Interpolate.interpolationFactor.bind(void 0,{name:"linear"}),zoomStops:S.map(function(t){return t[0]}),evaluate:function(o,r){var n=o.zoom;return v(evaluateExponentialFunction({stops:S,base:t.base},e,n).evaluate(n,r))}}}return a?{kind:"camera",interpolationFactor:"exponential"===i?Interpolate.interpolationFactor.bind(void 0,{name:"exponential",base:void 0!==t.base?t.base:1}):function(){return 0},zoomStops:t.stops.map(function(t){return t[0]}),evaluate:function(o){var r=o.zoom;return v(u(t,e,r,s,p))}}:{kind:"source",evaluate:function(o,r){var n=r&&r.properties?r.properties[t.property]:void 0;return void 0===n?coalesce(t.default,e.default):v(u(t,e,n,s,p))}}}function coalesce(t,e,o){return void 0!==t?t:void 0!==e?e:void 0!==o?o:void 0}function evaluateCategoricalFunction(t,e,o,r,n){return coalesce(typeof o===n?r[o]:void 0,t.default,e.default)}function evaluateIntervalFunction(t,e,o){if("number"!==getType(o))return coalesce(t.default,e.default);var r=t.stops.length;if(1===r)return t.stops[0][1];if(o<=t.stops[0][0])return t.stops[0][1];if(o>=t.stops[r-1][0])return t.stops[r-1][1];var n=findStopLessThanOrEqualTo(t.stops,o);return t.stops[n][1]}function evaluateExponentialFunction(t,e,o){var r=void 0!==t.base?t.base:1;if("number"!==getType(o))return coalesce(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(o<=t.stops[0][0])return t.stops[0][1];if(o>=t.stops[n-1][0])return t.stops[n-1][1];var a=findStopLessThanOrEqualTo(t.stops,o),i=interpolationFactor(o,r,t.stops[a][0],t.stops[a+1][0]),u=t.stops[a][1],s=t.stops[a+1][1],p=interpolate[e.type]||identityFunction;return"function"==typeof u.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var o=u.evaluate.apply(void 0,t),r=s.evaluate.apply(void 0,t);if(void 0!==o&&void 0!==r)return p(o,r,i)}}:p(u,s,i)}function evaluateIdentityFunction(t,e,o){return"color"===e.type?o=Color.parse(o):getType(o)===e.type||"enum"===e.type&&e.values[o]||(o=void 0),coalesce(o,t.default,e.default)}function findStopLessThanOrEqualTo(t,e){for(var o,r,n=t.length,a=0,i=n-1,u=0;a<=i;){if(u=Math.floor((a+i)/2),o=t[u][0],r=t[u+1][0],e===o||e>o&&e<r)return u;o<e?a=u+1:o>e&&(i=u-1)}return Math.max(u-1,0)}function interpolationFactor(t,e,o,r){var n=r-o,a=t-o;return 0===n?0:1===e?a/n:(Math.pow(e,a)-1)/(Math.pow(e,n)-1)}var colorSpaces=_dereq_("../util/color_spaces"),Color=_dereq_("../util/color"),extend=_dereq_("../util/extend"),getType=_dereq_("../util/get_type"),interpolate=_dereq_("../util/interpolate"),Interpolate=_dereq_("../expression/definitions/interpolate");module.exports={createFunction:createFunction,isFunction:isFunction};
-},{"../expression/definitions/interpolate":129,"../util/color":150,"../util/color_spaces":151,"../util/extend":152,"../util/get_type":153,"../util/interpolate":154}],147:[function(_dereq_,module,exports){
-"use strict";function stringify(r){var t=typeof r;if("number"===t||"boolean"===t||"string"===t||void 0===r||null===r)return JSON.stringify(r);if(Array.isArray(r)){for(var e="[",i=0,n=r;i<n.length;i+=1){e+=stringify(n[i])+","}return e+"]"}for(var o=Object.keys(r).sort(),f="{",u=0;u<o.length;u++)f+=JSON.stringify(o[u])+":"+stringify(r[o[u]])+",";return f+"}"}function getKey(r){for(var t="",e=0,i=refProperties;e<i.length;e+=1){t+="/"+stringify(r[i[e]])}return t}function groupByLayout(r){for(var t={},e=0;e<r.length;e++){var i=getKey(r[e]),n=t[i];n||(n=t[i]=[]),n.push(r[e])}var o=[];for(var f in t)o.push(t[f]);return o}var refProperties=_dereq_("./util/ref_properties");module.exports=groupByLayout;
-},{"./util/ref_properties":155}],148:[function(_dereq_,module,exports){
-"use strict";module.exports=_dereq_("./v8.json");
-},{"./v8.json":149}],149:[function(_dereq_,module,exports){
-module.exports={"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"layers":{"required":true,"type":"array","value":"layer"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_geojson","source_video","source_image","source_canvas"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.0511,180,85.0511]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.0511,180,85.0511]},"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"},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0},"clusterMaxZoom":{"type":"number"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_canvas":{"type":{"required":true,"type":"enum","values":{"canvas":{}}},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}},"animate":{"type":"boolean","default":"true"},"canvas":{"type":"string","required":true}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"background":{}}},"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_background"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible"}},"layout_fill":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible"}},"layout_circle":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible"}},"layout_line":{"line-cap":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"butt":{},"round":{},"square":{}},"default":"butt"},"line-join":{"type":"enum","function":"piecewise-constant","zoom-function":true,"property-function":true,"values":{"bevel":{},"round":{},"miter":{}},"default":"miter"},"line-miter-limit":{"type":"number","default":2,"function":"interpolated","zoom-function":true,"requires":[{"line-join":"miter"}]},"line-round-limit":{"type":"number","default":1.05,"function":"interpolated","zoom-function":true,"requires":[{"line-join":"round"}]},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible"}},"layout_symbol":{"symbol-placement":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"point":{},"line":{}},"default":"point"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"function":"interpolated","zoom-function":true,"units":"pixels","requires":[{"symbol-placement":"line"}]},"symbol-avoid-edges":{"type":"boolean","function":"piecewise-constant","zoom-function":true,"default":false},"icon-allow-overlap":{"type":"boolean","function":"piecewise-constant","zoom-function":true,"default":false,"requires":["icon-image"]},"icon-ignore-placement":{"type":"boolean","function":"piecewise-constant","zoom-function":true,"default":false,"requires":["icon-image"]},"icon-optional":{"type":"boolean","function":"piecewise-constant","zoom-function":true,"default":false,"requires":["icon-image","text-field"]},"icon-rotation-alignment":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"]},"icon-size":{"type":"number","default":1,"minimum":0,"function":"interpolated","zoom-function":true,"property-function":true,"units":"factor of the original icon size","requires":["icon-image"]},"icon-text-fit":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"none":{},"width":{},"height":{},"both":{}},"default":"none","requires":["icon-image","text-field"]},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"units":"pixels","function":"interpolated","zoom-function":true,"requires":["icon-image","text-field",{"icon-text-fit":["both","width","height"]}]},"icon-image":{"type":"string","function":"piecewise-constant","zoom-function":true,"property-function":true,"tokens":true},"icon-rotate":{"type":"number","default":0,"period":360,"function":"interpolated","zoom-function":true,"property-function":true,"units":"degrees","requires":["icon-image"]},"icon-padding":{"type":"number","default":2,"minimum":0,"function":"interpolated","zoom-function":true,"units":"pixels","requires":["icon-image"]},"icon-keep-upright":{"type":"boolean","function":"piecewise-constant","zoom-function":true,"default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{"type":"array","value":"number","units":"pixels multiplied by the value of \"icon-size\"","length":2,"default":[0,0],"function":"interpolated","zoom-function":true,"property-function":true,"requires":["icon-image"]},"icon-anchor":{"type":"enum","function":"piecewise-constant","zoom-function":true,"property-function":true,"values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["icon-image"]},"icon-pitch-alignment":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"]},"text-pitch-alignment":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"]},"text-rotation-alignment":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"]},"text-field":{"type":"string","function":"piecewise-constant","zoom-function":true,"property-function":true,"default":"","tokens":true},"text-font":{"type":"array","value":"string","function":"piecewise-constant","zoom-function":true,"default":["Open Sans Regular","Arial Unicode MS Regular"],"requires":["text-field"]},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","function":"interpolated","zoom-function":true,"property-function":true,"requires":["text-field"]},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","function":"interpolated","zoom-function":true,"property-function":true,"requires":["text-field"]},"text-line-height":{"type":"number","default":1.2,"units":"ems","function":"interpolated","zoom-function":true,"requires":["text-field"]},"text-letter-spacing":{"type":"number","default":0,"units":"ems","function":"interpolated","zoom-function":true,"property-function":true,"requires":["text-field"]},"text-justify":{"type":"enum","function":"piecewise-constant","zoom-function":true,"property-function":true,"values":{"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"]},"text-anchor":{"type":"enum","function":"piecewise-constant","zoom-function":true,"property-function":true,"values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["text-field"]},"text-max-angle":{"type":"number","default":45,"units":"degrees","function":"interpolated","zoom-function":true,"requires":["text-field",{"symbol-placement":"line"}]},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","function":"interpolated","zoom-function":true,"property-function":true,"requires":["text-field"]},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","function":"interpolated","zoom-function":true,"requires":["text-field"]},"text-keep-upright":{"type":"boolean","function":"piecewise-constant","zoom-function":true,"default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{"type":"enum","function":"piecewise-constant","zoom-function":true,"property-function":true,"values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"]},"text-offset":{"type":"array","value":"number","units":"ems","function":"interpolated","zoom-function":true,"property-function":true,"length":2,"default":[0,0],"requires":["text-field"]},"text-allow-overlap":{"type":"boolean","function":"piecewise-constant","zoom-function":true,"default":false,"requires":["text-field"]},"text-ignore-placement":{"type":"boolean","function":"piecewise-constant","zoom-function":true,"default":false,"requires":["text-field"]},"text-optional":{"type":"boolean","function":"piecewise-constant","zoom-function":true,"default":false,"requires":["text-field","icon-image"]},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible"}},"filter":{"type":"array","value":"*"},"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":false}},"function_stop":{"type":"array","minimum":0,"maximum":22,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"expression_name":{"type":"enum","values":{"let":{"group":"Variable binding"},"var":{"group":"Variable binding"},"literal":{"group":"Types"},"array":{"group":"Types"},"at":{"group":"Lookup"},"case":{"group":"Decision"},"match":{"group":"Decision"},"coalesce":{"group":"Decision"},"step":{"group":"Ramps, scales, curves"},"interpolate":{"group":"Ramps, scales, curves"},"ln2":{"group":"Math"},"pi":{"group":"Math"},"e":{"group":"Math"},"typeof":{"group":"Types"},"string":{"group":"Types"},"number":{"group":"Types"},"boolean":{"group":"Types"},"object":{"group":"Types"},"to-string":{"group":"Types"},"to-number":{"group":"Types"},"to-boolean":{"group":"Types"},"to-rgba":{"group":"Color"},"to-color":{"group":"Types"},"rgb":{"group":"Color"},"rgba":{"group":"Color"},"get":{"group":"Lookup"},"has":{"group":"Lookup"},"length":{"group":"Lookup"},"properties":{"group":"Feature data"},"geometry-type":{"group":"Feature data"},"id":{"group":"Feature data"},"zoom":{"group":"Zoom"},"heatmap-density":{"group":"Heatmap"},"+":{"group":"Math"},"*":{"group":"Math"},"-":{"group":"Math"},"/":{"group":"Math"},"%":{"group":"Math"},"^":{"group":"Math"},"sqrt":{"group":"Math"},"log10":{"group":"Math"},"ln":{"group":"Math"},"log2":{"group":"Math"},"sin":{"group":"Math"},"cos":{"group":"Math"},"tan":{"group":"Math"},"asin":{"group":"Math"},"acos":{"group":"Math"},"atan":{"group":"Math"},"min":{"group":"Math"},"max":{"group":"Math"},"==":{"group":"Decision"},"!=":{"group":"Decision"},">":{"group":"Decision"},"<":{"group":"Decision"},">=":{"group":"Decision"},"<=":{"group":"Decision"},"all":{"group":"Decision"},"any":{"group":"Decision"},"!":{"group":"Decision"},"upcase":{"group":"String"},"downcase":{"group":"String"},"concat":{"group":"String"}}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"transition":false,"zoom-function":true,"property-function":false,"function":"piecewise-constant"},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","transition":true,"function":"interpolated","zoom-function":true,"property-function":false},"color":{"type":"color","default":"#ffffff","function":"interpolated","zoom-function":true,"property-function":false,"transition":true},"intensity":{"type":"number","default":0.5,"minimum":0,"maximum":1,"function":"interpolated","zoom-function":true,"property-function":false,"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_background"],"paint_fill":{"fill-antialias":{"type":"boolean","function":"piecewise-constant","zoom-function":true,"default":true},"fill-opacity":{"type":"number","function":"interpolated","zoom-function":true,"property-function":true,"default":1,"minimum":0,"maximum":1,"transition":true},"fill-color":{"type":"color","default":"#000000","function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"requires":[{"!":"fill-pattern"}]},"fill-outline-color":{"type":"color","function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}]},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"function":"interpolated","zoom-function":true,"transition":true,"units":"pixels"},"fill-translate-anchor":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"]},"fill-pattern":{"type":"string","function":"piecewise-constant","zoom-function":true,"transition":true}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","function":"interpolated","zoom-function":true,"property-function":false,"default":1,"minimum":0,"maximum":1,"transition":true},"fill-extrusion-color":{"type":"color","default":"#000000","function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"requires":[{"!":"fill-extrusion-pattern"}]},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"function":"interpolated","zoom-function":true,"transition":true,"units":"pixels"},"fill-extrusion-translate-anchor":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"]},"fill-extrusion-pattern":{"type":"string","function":"piecewise-constant","zoom-function":true,"transition":true},"fill-extrusion-height":{"type":"number","function":"interpolated","zoom-function":true,"property-function":true,"default":0,"minimum":0,"units":"meters","transition":true},"fill-extrusion-base":{"type":"number","function":"interpolated","zoom-function":true,"property-function":true,"default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"]}},"paint_line":{"line-opacity":{"type":"number","function":"interpolated","zoom-function":true,"property-function":true,"default":1,"minimum":0,"maximum":1,"transition":true},"line-color":{"type":"color","default":"#000000","function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"requires":[{"!":"line-pattern"}]},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"function":"interpolated","zoom-function":true,"transition":true,"units":"pixels"},"line-translate-anchor":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"]},"line-width":{"type":"number","default":1,"minimum":0,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"units":"pixels"},"line-gap-width":{"type":"number","default":0,"minimum":0,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"units":"pixels"},"line-offset":{"type":"number","default":0,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"units":"pixels"},"line-blur":{"type":"number","default":0,"minimum":0,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"units":"pixels"},"line-dasharray":{"type":"array","value":"number","function":"piecewise-constant","zoom-function":true,"minimum":0,"transition":true,"units":"line widths","requires":[{"!":"line-pattern"}]},"line-pattern":{"type":"string","function":"piecewise-constant","zoom-function":true,"transition":true}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"units":"pixels"},"circle-color":{"type":"color","default":"#000000","function":"interpolated","zoom-function":true,"property-function":true,"transition":true},"circle-blur":{"type":"number","default":0,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"function":"interpolated","zoom-function":true,"transition":true,"units":"pixels"},"circle-translate-anchor":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"]},"circle-pitch-scale":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"map":{},"viewport":{}},"default":"map"},"circle-pitch-alignment":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"map":{},"viewport":{}},"default":"viewport"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"units":"pixels"},"circle-stroke-color":{"type":"color","default":"#000000","function":"interpolated","zoom-function":true,"property-function":true,"transition":true},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"function":"interpolated","zoom-function":true,"property-function":false,"transition":true,"units":"pixels"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"function":"interpolated","zoom-function":true,"property-function":true,"transition":false},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"function":"interpolated","zoom-function":true,"property-function":false,"transition":true},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"function":"interpolated","zoom-function":false,"property-function":false,"transition":true},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"function":"interpolated","zoom-function":true,"property-function":false,"transition":true}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"requires":["icon-image"]},"icon-color":{"type":"color","default":"#000000","function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"requires":["icon-image"]},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"requires":["icon-image"]},"icon-halo-width":{"type":"number","default":0,"minimum":0,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"units":"pixels","requires":["icon-image"]},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"units":"pixels","requires":["icon-image"]},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"function":"interpolated","zoom-function":true,"transition":true,"units":"pixels","requires":["icon-image"]},"icon-translate-anchor":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"]},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"requires":["text-field"]},"text-color":{"type":"color","default":"#000000","function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"requires":["text-field"]},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"requires":["text-field"]},"text-halo-width":{"type":"number","default":0,"minimum":0,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"units":"pixels","requires":["text-field"]},"text-halo-blur":{"type":"number","default":0,"minimum":0,"function":"interpolated","zoom-function":true,"property-function":true,"transition":true,"units":"pixels","requires":["text-field"]},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"function":"interpolated","zoom-function":true,"transition":true,"units":"pixels","requires":["text-field"]},"text-translate-anchor":{"type":"enum","function":"piecewise-constant","zoom-function":true,"values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"]}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"function":"interpolated","zoom-function":true,"transition":true},"raster-hue-rotate":{"type":"number","default":0,"period":360,"function":"interpolated","zoom-function":true,"transition":true,"units":"degrees"},"raster-brightness-min":{"type":"number","function":"interpolated","zoom-function":true,"default":0,"minimum":0,"maximum":1,"transition":true},"raster-brightness-max":{"type":"number","function":"interpolated","zoom-function":true,"default":1,"minimum":0,"maximum":1,"transition":true},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"function":"interpolated","zoom-function":true,"transition":true},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"function":"interpolated","zoom-function":true,"transition":true},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"function":"interpolated","zoom-function":true,"transition":true,"units":"milliseconds"}},"paint_background":{"background-color":{"type":"color","default":"#000000","function":"interpolated","zoom-function":true,"transition":true,"requires":[{"!":"background-pattern"}]},"background-pattern":{"type":"string","function":"piecewise-constant","zoom-function":true,"transition":true},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"function":"interpolated","zoom-function":true,"transition":true}},"transition":{"duration":{"type":"number","default":300,"minimum":0,"units":"milliseconds"},"delay":{"type":"number","default":0,"minimum":0,"units":"milliseconds"}}}
-},{}],150:[function(_dereq_,module,exports){
-"use strict";var ref=_dereq_("csscolorparser"),parseCSSColor=ref.parseCSSColor,Color=function(o,r,e,l){void 0===l&&(l=1),this.r=o,this.g=r,this.b=e,this.a=l};Color.parse=function(o){if(o){if(o instanceof Color)return o;if("string"==typeof o){var r=parseCSSColor(o);if(r)return new Color(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3])}}},Color.black=new Color(0,0,0,1),Color.white=new Color(1,1,1,1),Color.transparent=new Color(0,0,0,0),module.exports=Color;
-},{"csscolorparser":11}],151:[function(_dereq_,module,exports){
-"use strict";function xyz2lab(a){return a>t3?Math.pow(a,1/3):a/t2+t0}function lab2xyz(a){return a>t1?a*a*a:t2*(a-t0)}function xyz2rgb(a){return 255*(a<=.0031308?12.92*a:1.055*Math.pow(a,1/2.4)-.055)}function rgb2xyz(a){return a/=255,a<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function rgbToLab(a){var r=rgb2xyz(a.r),t=rgb2xyz(a.g),b=rgb2xyz(a.b),n=xyz2lab((.4124564*r+.3575761*t+.1804375*b)/Xn),l=xyz2lab((.2126729*r+.7151522*t+.072175*b)/Yn);return{l:116*l-16,a:500*(n-l),b:200*(l-xyz2lab((.0193339*r+.119192*t+.9503041*b)/Zn)),alpha:a.a}}function labToRgb(a){var r=(a.l+16)/116,t=isNaN(a.a)?r:r+a.a/500,b=isNaN(a.b)?r:r-a.b/200;return r=Yn*lab2xyz(r),t=Xn*lab2xyz(t),b=Zn*lab2xyz(b),new Color(xyz2rgb(3.2404542*t-1.5371385*r-.4985314*b),xyz2rgb(-.969266*t+1.8760108*r+.041556*b),xyz2rgb(.0556434*t-.2040259*r+1.0572252*b),a.alpha)}function rgbToHcl(a){var r=rgbToLab(a),t=r.l,b=r.a,n=r.b,l=Math.atan2(n,b)*rad2deg;return{h:l<0?l+360:l,c:Math.sqrt(b*b+n*n),l:t,alpha:a.a}}function hclToRgb(a){var r=a.h*deg2rad,t=a.c;return labToRgb({l:a.l,a:Math.cos(r)*t,b:Math.sin(r)*t,alpha:a.alpha})}var Color=_dereq_("./color"),Xn=.95047,Yn=1,Zn=1.08883,t0=4/29,t1=6/29,t2=3*t1*t1,t3=t1*t1*t1,deg2rad=Math.PI/180,rad2deg=180/Math.PI;module.exports={lab:{forward:rgbToLab,reverse:labToRgb},hcl:{forward:rgbToHcl,reverse:hclToRgb}};
-},{"./color":150}],152:[function(_dereq_,module,exports){
-"use strict";module.exports=function(r){for(var t=[],e=arguments.length-1;e-- >0;)t[e]=arguments[e+1];for(var n=0,o=t;n<o.length;n+=1){var a=o[n];for(var f in a)r[f]=a[f]}return r};
-},{}],153:[function(_dereq_,module,exports){
-"use strict";module.exports=function(n){return n instanceof Number?"number":n instanceof String?"string":n instanceof Boolean?"boolean":Array.isArray(n)?"array":null===n?"null":typeof n};
-},{}],154:[function(_dereq_,module,exports){
-"use strict";function number(r,n,u){return r*(1-u)+n*u}function color(r,n,u){return new Color(number(r.r,n.r,u),number(r.g,n.g,u),number(r.b,n.b,u),number(r.a,n.a,u))}function array(r,n,u){return r.map(function(r,e){return number(r,n[e],u)})}var Color=_dereq_("./color");module.exports={number:number,color:color,array:array};
-},{"./color":150}],155:[function(_dereq_,module,exports){
-"use strict";module.exports=["type","source","source-layer","minzoom","maxzoom","filter","layout"];
-},{}],156:[function(_dereq_,module,exports){
-"use strict";function success(r){return{result:"success",value:r}}function error(r){return{result:"error",value:r}}module.exports={success:success,error:error};
-},{}],157:[function(_dereq_,module,exports){
-"use strict";function unbundle(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function deepUnbundle(e){return Array.isArray(e)?e.map(deepUnbundle):unbundle(e)}module.exports=unbundle,module.exports.deep=deepUnbundle;
-},{}],158:[function(_dereq_,module,exports){
-"use strict";var ValidationError=_dereq_("../error/validation_error"),getType=_dereq_("../util/get_type"),extend=_dereq_("../util/extend"),unbundle=_dereq_("../util/unbundle_jsonlint"),ref=_dereq_("../expression"),isExpression=ref.isExpression,ref$1=_dereq_("../function"),isFunction=ref$1.isFunction;module.exports=function(e){var r=_dereq_("./validate_function"),i=_dereq_("./validate_expression"),t=_dereq_("./validate_object"),n={"*":function(){return[]},array:_dereq_("./validate_array"),boolean:_dereq_("./validate_boolean"),number:_dereq_("./validate_number"),color:_dereq_("./validate_color"),constants:_dereq_("./validate_constants"),enum:_dereq_("./validate_enum"),filter:_dereq_("./validate_filter"),function:_dereq_("./validate_function"),layer:_dereq_("./validate_layer"),object:_dereq_("./validate_object"),source:_dereq_("./validate_source"),light:_dereq_("./validate_light"),string:_dereq_("./validate_string")},a=e.value,u=e.valueSpec,o=e.key,l=e.styleSpec,s=e.style;if("string"===getType(a)&&"@"===a[0]){if(l.$version>7)return[new ValidationError(o,a,"constants have been deprecated as of v8")];if(!(a in s.constants))return[new ValidationError(o,a,'constant "%s" not found',a)];e=extend({},e,{value:s.constants[a]})}return u.function&&isFunction(unbundle(a))?r(e):u.function&&isExpression(unbundle.deep(a))?i(e):u.type&&n[u.type]?n[u.type](e):t(extend({},e,{valueSpec:u.type?l[u.type]:u}))};
-},{"../error/validation_error":120,"../expression":136,"../function":146,"../util/extend":152,"../util/get_type":153,"../util/unbundle_jsonlint":157,"./validate_array":159,"./validate_boolean":160,"./validate_color":161,"./validate_constants":162,"./validate_enum":163,"./validate_expression":164,"./validate_filter":165,"./validate_function":166,"./validate_layer":168,"./validate_light":170,"./validate_number":171,"./validate_object":172,"./validate_source":175,"./validate_string":176}],159:[function(_dereq_,module,exports){
-"use strict";var getType=_dereq_("../util/get_type"),validate=_dereq_("./validate"),ValidationError=_dereq_("../error/validation_error");module.exports=function(e){var r=e.value,t=e.valueSpec,a=e.style,n=e.styleSpec,l=e.key,i=e.arrayElementValidator||validate;if("array"!==getType(r))return[new ValidationError(l,r,"array expected, %s found",getType(r))];if(t.length&&r.length!==t.length)return[new ValidationError(l,r,"array length %d expected, length %d found",t.length,r.length)];if(t["min-length"]&&r.length<t["min-length"])return[new ValidationError(l,r,"array length at least %d expected, length %d found",t["min-length"],r.length)];var o={type:t.value};n.$version<7&&(o.function=t.function),"object"===getType(t.value)&&(o=t.value);for(var u=[],d=0;d<r.length;d++)u=u.concat(i({array:r,arrayIndex:d,value:r[d],valueSpec:o,style:a,styleSpec:n,key:l+"["+d+"]"}));return u};
-},{"../error/validation_error":120,"../util/get_type":153,"./validate":158}],160:[function(_dereq_,module,exports){
-"use strict";var getType=_dereq_("../util/get_type"),ValidationError=_dereq_("../error/validation_error");module.exports=function(e){var r=e.value,o=e.key,t=getType(r);return"boolean"!==t?[new ValidationError(o,r,"boolean expected, %s found",t)]:[]};
-},{"../error/validation_error":120,"../util/get_type":153}],161:[function(_dereq_,module,exports){
-"use strict";var ValidationError=_dereq_("../error/validation_error"),getType=_dereq_("../util/get_type"),parseCSSColor=_dereq_("csscolorparser").parseCSSColor;module.exports=function(r){var e=r.key,o=r.value,t=getType(o);return"string"!==t?[new ValidationError(e,o,"color expected, %s found",t)]:null===parseCSSColor(o)?[new ValidationError(e,o,'color expected, "%s" found',o)]:[]};
-},{"../error/validation_error":120,"../util/get_type":153,"csscolorparser":11}],162:[function(_dereq_,module,exports){
-"use strict";var ValidationError=_dereq_("../error/validation_error");module.exports=function(r){var e=r.key,a=r.value;return a?[new ValidationError(e,a,"constants have been deprecated as of v8")]:[]};
-},{"../error/validation_error":120}],163:[function(_dereq_,module,exports){
-"use strict";var ValidationError=_dereq_("../error/validation_error"),unbundle=_dereq_("../util/unbundle_jsonlint");module.exports=function(e){var r=e.key,n=e.value,u=e.valueSpec,i=[];return Array.isArray(u.values)?-1===u.values.indexOf(unbundle(n))&&i.push(new ValidationError(r,n,"expected one of [%s], %s found",u.values.join(", "),JSON.stringify(n))):-1===Object.keys(u.values).indexOf(unbundle(n))&&i.push(new ValidationError(r,n,"expected one of [%s], %s found",Object.keys(u.values).join(", "),JSON.stringify(n))),i};
-},{"../error/validation_error":120,"../util/unbundle_jsonlint":157}],164:[function(_dereq_,module,exports){
-"use strict";var ValidationError=_dereq_("../error/validation_error"),ref=_dereq_("../expression"),createExpression=ref.createExpression,createPropertyExpression=ref.createPropertyExpression,unbundle=_dereq_("../util/unbundle_jsonlint");module.exports=function(e){var r=("property"===e.expressionContext?createPropertyExpression:createExpression)(unbundle.deep(e.value),e.valueSpec);return"error"!==r.result?[]:r.value.map(function(r){return new ValidationError(""+e.key+r.key,e.value,r.message)})};
-},{"../error/validation_error":120,"../expression":136,"../util/unbundle_jsonlint":157}],165:[function(_dereq_,module,exports){
-"use strict";function validateNonExpressionFilter(e){var r=e.value,t=e.key;if("array"!==getType(r))return[new ValidationError(t,r,"array expected, %s found",getType(r))];var a,n=e.styleSpec,s=[];if(r.length<1)return[new ValidationError(t,r,"filter array must have at least 1 element")];switch(s=s.concat(validateEnum({key:t+"[0]",value:r[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),unbundle(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===unbundle(r[1])&&s.push(new ValidationError(t,r,'"$type" cannot be use with operator "%s"',r[0]));case"==":case"!=":3!==r.length&&s.push(new ValidationError(t,r,'filter array for operator "%s" must have 3 elements',r[0]));case"in":case"!in":r.length>=2&&"string"!==(a=getType(r[1]))&&s.push(new ValidationError(t+"[1]",r[1],"string expected, %s found",a));for(var i=2;i<r.length;i++)a=getType(r[i]),"$type"===unbundle(r[1])?s=s.concat(validateEnum({key:t+"["+i+"]",value:r[i],valueSpec:n.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==a&&"number"!==a&&"boolean"!==a&&s.push(new ValidationError(t+"["+i+"]",r[i],"string, number, or boolean expected, %s found",a));break;case"any":case"all":case"none":for(var l=1;l<r.length;l++)s=s.concat(validateNonExpressionFilter({key:t+"["+l+"]",value:r[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":a=getType(r[1]),2!==r.length?s.push(new ValidationError(t,r,'filter array for "%s" operator must have 2 elements',r[0])):"string"!==a&&s.push(new ValidationError(t+"[1]",r[1],"string expected, %s found",a))}return s}var ValidationError=_dereq_("../error/validation_error"),validateExpression=_dereq_("./validate_expression"),validateEnum=_dereq_("./validate_enum"),getType=_dereq_("../util/get_type"),unbundle=_dereq_("../util/unbundle_jsonlint"),extend=_dereq_("../util/extend"),ref=_dereq_("../feature_filter"),isExpressionFilter=ref.isExpressionFilter;module.exports=function(e){return isExpressionFilter(unbundle.deep(e.value))?validateExpression(extend({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):validateNonExpressionFilter(e)};
-},{"../error/validation_error":120,"../feature_filter":145,"../util/extend":152,"../util/get_type":153,"../util/unbundle_jsonlint":157,"./validate_enum":163,"./validate_expression":164}],166:[function(_dereq_,module,exports){
-"use strict";var ValidationError=_dereq_("../error/validation_error"),getType=_dereq_("../util/get_type"),validate=_dereq_("./validate"),validateObject=_dereq_("./validate_object"),validateArray=_dereq_("./validate_array"),validateNumber=_dereq_("./validate_number"),unbundle=_dereq_("../util/unbundle_jsonlint");module.exports=function(e){function t(e){if("identity"===p)return[new ValidationError(e.key,e.value,'identity function may not have a "stops" property')];var t=[],a=e.value;return t=t.concat(validateArray({key:e.key,value:a,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:r})),"array"===getType(a)&&0===a.length&&t.push(new ValidationError(e.key,a,"array must have at least one stop")),t}function r(e){var t=[],r=e.value,o=e.key;if("array"!==getType(r))return[new ValidationError(o,r,"array expected, %s found",getType(r))];if(2!==r.length)return[new ValidationError(o,r,"array length %d expected, length %d found",2,r.length)];if(d){if("object"!==getType(r[0]))return[new ValidationError(o,r,"object expected, %s found",getType(r[0]))];if(void 0===r[0].zoom)return[new ValidationError(o,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new ValidationError(o,r,"object stop key must have value")];if(l&&l>unbundle(r[0].zoom))return[new ValidationError(o,r[0].zoom,"stop zoom values must appear in ascending order")];unbundle(r[0].zoom)!==l&&(l=unbundle(r[0].zoom),i=void 0,s={}),t=t.concat(validateObject({key:o+"[0]",value:r[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:validateNumber,value:a}}))}else t=t.concat(a({key:o+"[0]",value:r[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},r));return t.concat(validate({key:o+"[1]",value:r[1],valueSpec:u,style:e.style,styleSpec:e.styleSpec}))}function a(e,t){var r=getType(e.value),a=unbundle(e.value),o=null!==e.value?e.value:t;if(n){if(r!==n)return[new ValidationError(e.key,o,"%s stop domain type must match previous stop domain type %s",r,n)]}else n=r;if("number"!==r&&"string"!==r&&"boolean"!==r)return[new ValidationError(e.key,o,"stop domain value must be a number, string, or boolean")];if("number"!==r&&"categorical"!==p){var l="number expected, %s found";return u["property-function"]&&void 0===p&&(l+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ValidationError(e.key,o,l,r)]}return"categorical"!==p||"number"!==r||isFinite(a)&&Math.floor(a)===a?"categorical"!==p&&"number"===r&&void 0!==i&&a<i?[new ValidationError(e.key,o,"stop domain values must appear in ascending order")]:(i=a,"categorical"===p&&a in s?[new ValidationError(e.key,o,"stop domain values must be unique")]:(s[a]=!0,[])):[new ValidationError(e.key,o,"integer expected, found %s",a)]}function o(e){return validate({key:e.key,value:e.value,valueSpec:u,style:e.style,styleSpec:e.styleSpec})}var n,i,l,u=e.valueSpec,p=unbundle(e.value.type),s={},y="categorical"!==p&&void 0===e.value.property,c=!y,d="array"===getType(e.value.stops)&&"array"===getType(e.value.stops[0])&&"object"===getType(e.value.stops[0][0]),v=validateObject({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:t,default:o}});return"identity"===p&&y&&v.push(new ValidationError(e.key,e.value,'missing required property "property"')),"identity"===p||e.value.stops||v.push(new ValidationError(e.key,e.value,'missing required property "stops"')),"exponential"===p&&"piecewise-constant"===e.valueSpec.function&&v.push(new ValidationError(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(c&&!e.valueSpec["property-function"]?v.push(new ValidationError(e.key,e.value,"property functions not supported")):y&&!e.valueSpec["zoom-function"]&&"heatmap-color"!==e.objectKey&&v.push(new ValidationError(e.key,e.value,"zoom functions not supported"))),"categorical"!==p&&!d||void 0!==e.value.property||v.push(new ValidationError(e.key,e.value,'"property" property is required')),v};
-},{"../error/validation_error":120,"../util/get_type":153,"../util/unbundle_jsonlint":157,"./validate":158,"./validate_array":159,"./validate_number":171,"./validate_object":172}],167:[function(_dereq_,module,exports){
-"use strict";var ValidationError=_dereq_("../error/validation_error"),validateString=_dereq_("./validate_string");module.exports=function(r){var e=r.value,t=r.key,a=validateString(r);return a.length?a:(-1===e.indexOf("{fontstack}")&&a.push(new ValidationError(t,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&a.push(new ValidationError(t,e,'"glyphs" url must include a "{range}" token')),a)};
-},{"../error/validation_error":120,"./validate_string":176}],168:[function(_dereq_,module,exports){
-"use strict";var ValidationError=_dereq_("../error/validation_error"),unbundle=_dereq_("../util/unbundle_jsonlint"),validateObject=_dereq_("./validate_object"),validateFilter=_dereq_("./validate_filter"),validatePaintProperty=_dereq_("./validate_paint_property"),validateLayoutProperty=_dereq_("./validate_layout_property"),extend=_dereq_("../util/extend");module.exports=function(e){var r=[],t=e.value,a=e.key,i=e.style,l=e.styleSpec;t.type||t.ref||r.push(new ValidationError(a,t,'either "type" or "ref" is required'));var u=unbundle(t.type),n=unbundle(t.ref);if(t.id)for(var o=unbundle(t.id),s=0;s<e.arrayIndex;s++){var d=i.layers[s];unbundle(d.id)===o&&r.push(new ValidationError(a,t.id,'duplicate layer id "%s", previously used at line %d',t.id,d.id.__line__))}if("ref"in t){["type","source","source-layer","filter","layout"].forEach(function(e){e in t&&r.push(new ValidationError(a,t[e],'"%s" is prohibited for ref layers',e))});var y;i.layers.forEach(function(e){unbundle(e.id)===n&&(y=e)}),y?y.ref?r.push(new ValidationError(a,t.ref,"ref cannot reference another ref layer")):u=unbundle(y.type):r.push(new ValidationError(a,t.ref,'ref layer "%s" not found',n))}else if("background"!==u)if(t.source){var c=i.sources&&i.sources[t.source],p=c&&unbundle(c.type);c?"vector"===p&&"raster"===u?r.push(new ValidationError(a,t.source,'layer "%s" requires a raster source',t.id)):"raster"===p&&"raster"!==u?r.push(new ValidationError(a,t.source,'layer "%s" requires a vector source',t.id)):"vector"!==p||t["source-layer"]||r.push(new ValidationError(a,t,'layer "%s" must specify a "source-layer"',t.id)):r.push(new ValidationError(a,t.source,'source "%s" not found',t.source))}else r.push(new ValidationError(a,t,'missing required property "source"'));return r=r.concat(validateObject({key:a,value:t,valueSpec:l.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},filter:validateFilter,layout:function(e){return validateObject({layer:t,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return validateLayoutProperty(extend({layerType:u},e))}}})},paint:function(e){return validateObject({layer:t,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return validatePaintProperty(extend({layerType:u},e))}}})}}}))};
-},{"../error/validation_error":120,"../util/extend":152,"../util/unbundle_jsonlint":157,"./validate_filter":165,"./validate_layout_property":169,"./validate_object":172,"./validate_paint_property":173}],169:[function(_dereq_,module,exports){
-"use strict";var validateProperty=_dereq_("./validate_property");module.exports=function(r){return validateProperty(r,"layout")};
-},{"./validate_property":174}],170:[function(_dereq_,module,exports){
-"use strict";var ValidationError=_dereq_("../error/validation_error"),getType=_dereq_("../util/get_type"),validate=_dereq_("./validate");module.exports=function(e){var t=e.value,r=e.styleSpec,a=r.light,i=e.style,n=[],o=getType(t);if(void 0===t)return n;if("object"!==o)return n=n.concat([new ValidationError("light",t,"object expected, %s found",o)]);for(var l in t){var c=l.match(/^(.*)-transition$/);n=c&&a[c[1]]&&a[c[1]].transition?n.concat(validate({key:l,value:t[l],valueSpec:r.transition,style:i,styleSpec:r})):a[l]?n.concat(validate({key:l,value:t[l],valueSpec:a[l],style:i,styleSpec:r})):n.concat([new ValidationError(l,t[l],'unknown property "%s"',l)])}return n};
-},{"../error/validation_error":120,"../util/get_type":153,"./validate":158}],171:[function(_dereq_,module,exports){
-"use strict";var getType=_dereq_("../util/get_type"),ValidationError=_dereq_("../error/validation_error");module.exports=function(e){var r=e.key,i=e.value,m=e.valueSpec,a=getType(i);return"number"!==a?[new ValidationError(r,i,"number expected, %s found",a)]:"minimum"in m&&i<m.minimum?[new ValidationError(r,i,"%s is less than the minimum value %s",i,m.minimum)]:"maximum"in m&&i>m.maximum?[new ValidationError(r,i,"%s is greater than the maximum value %s",i,m.maximum)]:[]};
-},{"../error/validation_error":120,"../util/get_type":153}],172:[function(_dereq_,module,exports){
-"use strict";var ValidationError=_dereq_("../error/validation_error"),getType=_dereq_("../util/get_type"),validateSpec=_dereq_("./validate");module.exports=function(e){var r=e.key,t=e.value,i=e.valueSpec||{},a=e.objectElementValidators||{},o=e.style,l=e.styleSpec,n=[],u=getType(t);if("object"!==u)return[new ValidationError(r,t,"object expected, %s found",u)];for(var d in t){var p=d.split(".")[0],s=i[p]||i["*"],c=void 0;if(a[p])c=a[p];else if(i[p])c=validateSpec;else if(a["*"])c=a["*"];else{if(!i["*"]){n.push(new ValidationError(r,t[d],'unknown property "%s"',d));continue}c=validateSpec}n=n.concat(c({key:(r?r+".":r)+d,value:t[d],valueSpec:s,style:o,styleSpec:l,object:t,objectKey:d},t))}for(var v in i)i[v].required&&void 0===i[v].default&&void 0===t[v]&&n.push(new ValidationError(r,t,'missing required property "%s"',v));return n};
-},{"../error/validation_error":120,"../util/get_type":153,"./validate":158}],173:[function(_dereq_,module,exports){
-"use strict";var validateProperty=_dereq_("./validate_property");module.exports=function(r){return validateProperty(r,"paint")};
-},{"./validate_property":174}],174:[function(_dereq_,module,exports){
-"use strict";var validate=_dereq_("./validate"),ValidationError=_dereq_("../error/validation_error"),getType=_dereq_("../util/get_type");module.exports=function(e,t){var r=e.key,i=e.style,n=e.styleSpec,a=e.value,o=e.objectKey,p=n[t+"_"+e.layerType];if(!p)return[];var y=o.match(/^(.*)-transition$/);if("paint"===t&&y&&p[y[1]]&&p[y[1]].transition)return validate({key:r,value:a,valueSpec:n.transition,style:i,styleSpec:n});var l=e.valueSpec||p[o];if(!l)return[new ValidationError(r,a,'unknown property "%s"',o)];var s;if("string"===getType(a)&&l["property-function"]&&!l.tokens&&(s=/^{([^}]+)}$/.exec(a)))return[new ValidationError(r,a,'"%s" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": %s` }`.',o,JSON.stringify(s[1]))];var u=[];return"symbol"===e.layerType&&"text-field"===o&&i&&!i.glyphs&&u.push(new ValidationError(r,a,'use of "text-field" requires a style "glyphs" property')),u.concat(validate({key:e.key,value:a,valueSpec:l,style:i,styleSpec:n,expressionContext:"property"}))};
-},{"../error/validation_error":120,"../util/get_type":153,"./validate":158}],175:[function(_dereq_,module,exports){
-"use strict";var ValidationError=_dereq_("../error/validation_error"),unbundle=_dereq_("../util/unbundle_jsonlint"),validateObject=_dereq_("./validate_object"),validateEnum=_dereq_("./validate_enum");module.exports=function(e){var a=e.value,t=e.key,r=e.styleSpec,l=e.style;if(!a.type)return[new ValidationError(t,a,'"type" is required')];var u=unbundle(a.type),i=[];switch(u){case"vector":case"raster":if(i=i.concat(validateObject({key:t,value:a,valueSpec:r["source_"+u],style:e.style,styleSpec:r})),"url"in a)for(var s in a)["type","url","tileSize"].indexOf(s)<0&&i.push(new ValidationError(t+"."+s,a[s],'a source with a "url" property may not include a "%s" property',s));return i;case"geojson":return validateObject({key:t,value:a,valueSpec:r.source_geojson,style:l,styleSpec:r});case"video":return validateObject({key:t,value:a,valueSpec:r.source_video,style:l,styleSpec:r});case"image":return validateObject({key:t,value:a,valueSpec:r.source_image,style:l,styleSpec:r});case"canvas":return validateObject({key:t,value:a,valueSpec:r.source_canvas,style:l,styleSpec:r});default:return validateEnum({key:t+".type",value:a.type,valueSpec:{values:["vector","raster","geojson","video","image","canvas"]},style:l,styleSpec:r})}};
-},{"../error/validation_error":120,"../util/unbundle_jsonlint":157,"./validate_enum":163,"./validate_object":172}],176:[function(_dereq_,module,exports){
-"use strict";var getType=_dereq_("../util/get_type"),ValidationError=_dereq_("../error/validation_error");module.exports=function(r){var e=r.value,t=r.key,i=getType(e);return"string"!==i?[new ValidationError(t,e,"string expected, %s found",i)]:[]};
-},{"../error/validation_error":120,"../util/get_type":153}],177:[function(_dereq_,module,exports){
-"use strict";function validateStyleMin(e,a){a=a||latestStyleSpec;var t=[];return t=t.concat(validate({key:"",value:e,valueSpec:a.$root,styleSpec:a,style:e,objectElementValidators:{glyphs:validateGlyphsURL,"*":function(){return[]}}})),e.constants&&(t=t.concat(validateConstants({key:"constants",value:e.constants,style:e,styleSpec:a}))),sortErrors(t)}function sortErrors(e){return[].concat(e).sort(function(e,a){return e.line-a.line})}function wrapCleanErrors(e){return function(){return sortErrors(e.apply(this,arguments))}}var validateConstants=_dereq_("./validate/validate_constants"),validate=_dereq_("./validate/validate"),latestStyleSpec=_dereq_("./reference/latest"),validateGlyphsURL=_dereq_("./validate/validate_glyphs_url");validateStyleMin.source=wrapCleanErrors(_dereq_("./validate/validate_source")),validateStyleMin.light=wrapCleanErrors(_dereq_("./validate/validate_light")),validateStyleMin.layer=wrapCleanErrors(_dereq_("./validate/validate_layer")),validateStyleMin.filter=wrapCleanErrors(_dereq_("./validate/validate_filter")),validateStyleMin.paintProperty=wrapCleanErrors(_dereq_("./validate/validate_paint_property")),validateStyleMin.layoutProperty=wrapCleanErrors(_dereq_("./validate/validate_layout_property")),module.exports=validateStyleMin;
-},{"./reference/latest":148,"./validate/validate":158,"./validate/validate_constants":162,"./validate/validate_filter":165,"./validate/validate_glyphs_url":167,"./validate/validate_layer":168,"./validate/validate_layout_property":169,"./validate/validate_light":170,"./validate/validate_paint_property":173,"./validate/validate_source":175}],178:[function(_dereq_,module,exports){
-"use strict";var styleSpec=_dereq_("../style-spec/reference/latest"),util=_dereq_("../util/util"),Evented=_dereq_("../util/evented"),validateStyle=_dereq_("./validate_style"),ref=_dereq_("../util/util"),sphericalToCartesian=ref.sphericalToCartesian,Color=_dereq_("../style-spec/util/color"),interpolate=_dereq_("../style-spec/util/interpolate"),ref$1=_dereq_("./properties"),Properties=ref$1.Properties,Transitionable=ref$1.Transitionable,Transitioning=ref$1.Transitioning,PossiblyEvaluated=ref$1.PossiblyEvaluated,DataConstantProperty=ref$1.DataConstantProperty,LightPositionProperty=function(){this.specification=styleSpec.light.position};LightPositionProperty.prototype.possiblyEvaluate=function(t,e){return sphericalToCartesian(t.expression.evaluate(e))},LightPositionProperty.prototype.interpolate=function(t,e,i){return{x:interpolate.number(t.x,e.x,i),y:interpolate.number(t.y,e.y,i),z:interpolate.number(t.z,e.z,i)}};var properties=new Properties({anchor:new DataConstantProperty(styleSpec.light.anchor),position:new LightPositionProperty,color:new DataConstantProperty(styleSpec.light.color),intensity:new DataConstantProperty(styleSpec.light.intensity)}),TRANSITION_SUFFIX="-transition",Light=function(t){function e(e){t.call(this),this._transitionable=new Transitionable(properties),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getLight=function(){return this._transitionable.serialize()},e.prototype.setLight=function(t){var e=this;if(!this._validate(validateStyle.light,t))for(var i in t){var r=t[i];util.endsWith(i,TRANSITION_SUFFIX)?e._transitionable.setTransition(i.slice(0,-TRANSITION_SUFFIX.length),r):e._transitionable.setValue(i,r)}},e.prototype.updateTransitions=function(t,e){!1===t.transition?this._transitioning=this._transitionable.untransitioned():this._transitioning=this._transitionable.transitioned({now:Date.now(),transition:e},this._transitioning)},e.prototype.hasTransition=function(){return this._transitioning.hasTransition()},e.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},e.prototype._validate=function(t,e){return validateStyle.emitErrors(this,t.call(validateStyle,util.extend({value:e,style:{glyphs:!0,sprite:!0},styleSpec:styleSpec})))},e}(Evented);module.exports=Light;
-},{"../style-spec/reference/latest":148,"../style-spec/util/color":150,"../style-spec/util/interpolate":154,"../util/evented":253,"../util/util":266,"./properties":183,"./validate_style":204}],179:[function(_dereq_,module,exports){
-"use strict";var ref=_dereq_("../util/mapbox"),normalizeGlyphsURL=ref.normalizeGlyphsURL,ajax=_dereq_("../util/ajax"),parseGlyphPBF=_dereq_("./parse_glyph_pbf");module.exports=function(e,r,a,l,p){var i=256*r,s=i+255,t=l(normalizeGlyphsURL(a).replace("{fontstack}",e).replace("{range}",i+"-"+s),ajax.ResourceType.Glyphs);ajax.getArrayBuffer(t,function(e,r){if(e)p(e);else if(r){for(var a={},l=0,i=parseGlyphPBF(r.data);l<i.length;l+=1){var s=i[l];a[s.id]=s}p(null,a)}})};
-},{"../util/ajax":244,"../util/mapbox":260,"./parse_glyph_pbf":181}],180:[function(_dereq_,module,exports){
-"use strict";var ajax=_dereq_("../util/ajax"),browser=_dereq_("../util/browser"),ref=_dereq_("../util/mapbox"),normalizeSpriteURL=ref.normalizeSpriteURL,ref$1=_dereq_("../util/image"),RGBAImage=ref$1.RGBAImage;module.exports=function(e,r,i){function a(){if(u)i(u);else if(t&&o){var e=browser.getImageData(o),r={};for(var a in t){var n=t[a],g=n.width,l=n.height,x=n.x,m=n.y,p=n.sdf,f=n.pixelRatio,s=RGBAImage.create({width:g,height:l});RGBAImage.copy(e,s,{x:x,y:m},{x:0,y:0},{width:g,height:l}),r[a]={data:s,pixelRatio:f,sdf:p}}i(null,r)}}var t,o,u,n=browser.devicePixelRatio>1?"@2x":"";ajax.getJSON(r(normalizeSpriteURL(e,n,".json"),ajax.ResourceType.SpriteJSON),function(e,r){u||(u=e,t=r,a())}),ajax.getImage(r(normalizeSpriteURL(e,n,".png"),ajax.ResourceType.SpriteImage),function(e,r){u||(u=e,o=r,a())})};
-},{"../util/ajax":244,"../util/browser":245,"../util/image":256,"../util/mapbox":260}],181:[function(_dereq_,module,exports){
-"use strict";function readFontstacks(e,a,r){1===e&&r.readMessage(readFontstack,a)}function readFontstack(e,a,r){if(3===e){var t=r.readMessage(readGlyph,{}),d=t.id,i=t.bitmap,n=t.width,o=t.height,h=t.left,s=t.top,p=t.advance;a.push({id:d,bitmap:AlphaImage.create({width:n+2*border,height:o+2*border},i),metrics:{width:n,height:o,left:h,top:s,advance:p}})}}function readGlyph(e,a,r){1===e?a.id=r.readVarint():2===e?a.bitmap=r.readBytes():3===e?a.width=r.readVarint():4===e?a.height=r.readVarint():5===e?a.left=r.readSVarint():6===e?a.top=r.readSVarint():7===e&&(a.advance=r.readVarint())}var ref=_dereq_("../util/image"),AlphaImage=ref.AlphaImage,Protobuf=_dereq_("pbf"),border=3;module.exports=function(e){return new Protobuf(e).readFields(readFontstacks,[])},module.exports.GLYPH_PBF_BORDER=border;
-},{"../util/image":256,"pbf":38}],182:[function(_dereq_,module,exports){
-"use strict";function compareTileCoords(e,n){var r=TileCoord.fromID(e),i=TileCoord.fromID(n);return r.isLessThan(i)?-1:i.isLessThan(r)?1:0}var browser=_dereq_("../util/browser"),CollisionIndex=_dereq_("../symbol/collision_index"),TileCoord=_dereq_("../source/tile_coord"),LayerPlacement=function(e){this._currentTileIndex=0,this._tileIDs=e};LayerPlacement.prototype.continuePlacement=function(e,n,r,i,o){for(var t=this;this._currentTileIndex<this._tileIDs.length;){if(e.getTileByID(t._tileIDs[t._currentTileIndex]).placeLayer(r,n,i,e.id),t._currentTileIndex++,o())return!0}};var Placement=function(e,n,r,i,o,t){this.collisionIndex=new CollisionIndex(e.clone()),this._currentPlacementIndex=n.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=i,this._sourceCacheTileIDs={},this._done=!1,this._delayUntil=r||!t?browser.now():t._delayUntil+300,this._collisionFadeTimes=t?t._collisionFadeTimes:{latestStart:0,duration:o}};Placement.prototype.isDone=function(){return this._done},Placement.prototype.continuePlacement=function(e,n,r){var i=this,o=browser.now();if(o<this._delayUntil)return!0;for(var t=function(){var e=browser.now()-o;return!i._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=e[i._currentPlacementIndex],l=n[s];if("symbol"===l.type){var c=r[l.source];i._inProgressLayer||(i._sourceCacheTileIDs[l.source]||(i._sourceCacheTileIDs[l.source]=c.getRenderableIds().sort(compareTileCoords)),i._inProgressLayer=new LayerPlacement(i._sourceCacheTileIDs[l.source]));if(i._inProgressLayer.continuePlacement(c,i.collisionIndex,i._showCollisionBoxes,l,t))return;delete i._inProgressLayer}i._currentPlacementIndex--}for(var a in r)r[a].commitPlacement(i.collisionIndex,i._collisionFadeTimes);this._done=!0},Placement.prototype.stillFading=function(){return Date.now()<this._collisionFadeTimes.latestStart+this._collisionFadeTimes.duration},module.exports=Placement;
-},{"../source/tile_coord":112,"../symbol/collision_index":210,"../util/browser":245}],183:[function(_dereq_,module,exports){
-"use strict";var ref=_dereq_("../util/util"),extend=ref.extend,easeCubicInOut=ref.easeCubicInOut,interpolate=_dereq_("../style-spec/util/interpolate"),ref$1=_dereq_("../style-spec/expression"),normalizePropertyExpression=ref$1.normalizePropertyExpression,Color=_dereq_("../style-spec/util/color"),PropertyValue=function(t,e){this.property=t,this.value=e,this.expression=normalizePropertyExpression(void 0===e?t.specification.default:e,t.specification)};PropertyValue.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},PropertyValue.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var TransitionablePropertyValue=function(t){this.property=t,this.value=new PropertyValue(t,void 0)};TransitionablePropertyValue.prototype.transitioned=function(t,e){return new TransitioningPropertyValue(this.property,this.value,e,extend({},this.transition,t.transition),t.now)},TransitionablePropertyValue.prototype.untransitioned=function(){return new TransitioningPropertyValue(this.property,this.value,null,{},0)};var Transitionable=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Transitionable.prototype.getValue=function(t){return this._values[t].value.value},Transitionable.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new TransitionablePropertyValue(this._values[t].property)),this._values[t].value=new PropertyValue(this._values[t].property,null===e?void 0:e)},Transitionable.prototype.getTransition=function(t){return this._values[t].transition},Transitionable.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new TransitionablePropertyValue(this._values[t].property)),this._values[t].transition=e||void 0},Transitionable.prototype.serialize=function(){for(var t=this,e={},r=0,o=Object.keys(t._values);r<o.length;r+=1){var a=o[r],i=t.getValue(a);void 0!==i&&(e[a]=i);var n=t.getTransition(a);void 0!==n&&(e[a+"-transition"]=n)}return e},Transitionable.prototype.transitioned=function(t,e){for(var r=this,o=new Transitioning(this._properties),a=0,i=Object.keys(r._values);a<i.length;a+=1){var n=i[a];o._values[n]=r._values[n].transitioned(t,e._values[n])}return o},Transitionable.prototype.untransitioned=function(){for(var t=this,e=new Transitioning(this._properties),r=0,o=Object.keys(t._values);r<o.length;r+=1){var a=o[r];e._values[a]=t._values[a].untransitioned()}return e};var TransitioningPropertyValue=function(t,e,r,o,a){this.property=t,this.value=e,this.begin=a+o.delay||0,this.end=this.begin+o.duration||0,(o.delay||o.duration)&&(this.prior=r)};TransitioningPropertyValue.prototype.possiblyEvaluate=function(t){var e=t.now||0,r=this.value.possiblyEvaluate(t),o=this.prior;if(o){if(e>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(e<this.begin)return o.possiblyEvaluate(t);var a=(e-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t),r,easeCubicInOut(a))}return r};var Transitioning=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Transitioning.prototype.possiblyEvaluate=function(t){for(var e=this,r=new PossiblyEvaluated(this._properties),o=0,a=Object.keys(e._values);o<a.length;o+=1){var i=a[o];r._values[i]=e._values[i].possiblyEvaluate(t)}return r},Transitioning.prototype.hasTransition=function(){for(var t=this,e=0,r=Object.keys(t._values);e<r.length;e+=1){var o=r[e];if(t._values[o].prior)return!0}return!1};var Layout=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};Layout.prototype.getValue=function(t){return this._values[t].value},Layout.prototype.setValue=function(t,e){this._values[t]=new PropertyValue(this._values[t].property,null===e?void 0:e)},Layout.prototype.serialize=function(){for(var t=this,e={},r=0,o=Object.keys(t._values);r<o.length;r+=1){var a=o[r],i=t.getValue(a);void 0!==i&&(e[a]=i)}return e},Layout.prototype.possiblyEvaluate=function(t){for(var e=this,r=new PossiblyEvaluated(this._properties),o=0,a=Object.keys(e._values);o<a.length;o+=1){var i=a[o];r._values[i]=e._values[i].possiblyEvaluate(t)}return r};var PossiblyEvaluatedPropertyValue=function(t,e,r){this.property=t,this.value=e,this.globals=r};PossiblyEvaluatedPropertyValue.prototype.isConstant=function(){return"constant"===this.value.kind},PossiblyEvaluatedPropertyValue.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},PossiblyEvaluatedPropertyValue.prototype.evaluate=function(t){return this.property.evaluate(this.value,this.globals,t)};var PossiblyEvaluated=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};PossiblyEvaluated.prototype.get=function(t){return this._values[t]};var DataConstantProperty=function(t){this.specification=t};DataConstantProperty.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},DataConstantProperty.prototype.interpolate=function(t,e,r){var o=interpolate[this.specification.type];return o?o(t,e,r):t};var DataDrivenProperty=function(t,e){void 0===e&&(e=!1),this.specification=t,this.useIntegerZoom=e};DataDrivenProperty.prototype.possiblyEvaluate=function(t,e){return this.useIntegerZoom&&(e=extend({},e,{zoom:Math.floor(e.zoom)})),"constant"===t.expression.kind||"camera"===t.expression.kind?new PossiblyEvaluatedPropertyValue(this,{kind:"constant",value:t.expression.evaluate(e)},e):new PossiblyEvaluatedPropertyValue(this,t.expression,e)},DataDrivenProperty.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0!==t.value.value&&void 0!==t.value.value){var o=interpolate[this.specification.type];return o?new PossiblyEvaluatedPropertyValue(this,{kind:"constant",value:o(t.value.value,e.value.value,r)},t.globals):t}},DataDrivenProperty.prototype.evaluate=function(t,e,r){return this.useIntegerZoom&&(e=extend({},e,{zoom:Math.floor(e.zoom)})),"constant"===t.kind?t.value:t.evaluate(e,r)};var CrossFadedProperty=function(t){this.specification=t};CrossFadedProperty.prototype.possiblyEvaluate=function(t,e){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e)}},CrossFadedProperty.prototype._calculate=function(t,e,r,o){var a=o.zoom,i=a-Math.floor(a),n=o.defaultFadeDuration,s=0!==n?Math.min((o.now-o.zoomHistory.lastIntegerZoomTime)/n,1):1;return a>o.zoomHistory.lastIntegerZoom?{from:t,to:e,fromScale:2,toScale:1,t:i+(1-i)*s}:{from:r,to:e,fromScale:.5,toScale:1,t:1-(1-s)*i}},CrossFadedProperty.prototype.interpolate=function(t){return t};var HeatmapColorProperty=function(t){this.specification=t};HeatmapColorProperty.prototype.possiblyEvaluate=function(){},HeatmapColorProperty.prototype.interpolate=function(){};var Properties=function(t){var e=this;this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={};for(var r in t){var o=t[r],a=e.defaultPropertyValues[r]=new PropertyValue(o,void 0),i=e.defaultTransitionablePropertyValues[r]=new TransitionablePropertyValue(o);e.defaultTransitioningPropertyValues[r]=i.untransitioned(),e.defaultPossiblyEvaluatedValues[r]=a.possiblyEvaluate({})}};module.exports={PropertyValue:PropertyValue,Transitionable:Transitionable,Transitioning:Transitioning,Layout:Layout,PossiblyEvaluatedPropertyValue:PossiblyEvaluatedPropertyValue,PossiblyEvaluated:PossiblyEvaluated,DataConstantProperty:DataConstantProperty,DataDrivenProperty:DataDrivenProperty,CrossFadedProperty:CrossFadedProperty,HeatmapColorProperty:HeatmapColorProperty,Properties:Properties};
-},{"../style-spec/expression":136,"../style-spec/util/color":150,"../style-spec/util/interpolate":154,"../util/util":266}],184:[function(_dereq_,module,exports){
-"use strict";function getMaximumPaintValue(t,a,e){var n=a.paint.get(t).value;return"constant"===n.kind?n.value:e.programConfigurations.get(a.id).paintPropertyStatistics[t].max}function translateDistance(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function translate(t,a,e,n,r){if(!a[0]&&!a[1])return t;var i=Point.convert(a);"viewport"===e&&i._rotate(-n);for(var u=[],o=0;o<t.length;o++){for(var s=t[o],l=[],m=0;m<s.length;m++)l.push(s[m].sub(i._mult(r)));u.push(l)}return u}var Point=_dereq_("@mapbox/point-geometry");module.exports={getMaximumPaintValue:getMaximumPaintValue,translateDistance:translateDistance,translate:translate};
-},{"@mapbox/point-geometry":2}],185:[function(_dereq_,module,exports){
-"use strict";var Evented=_dereq_("../util/evented"),StyleLayer=_dereq_("./style_layer"),loadSprite=_dereq_("./load_sprite"),ImageManager=_dereq_("../render/image_manager"),GlyphManager=_dereq_("../render/glyph_manager"),Light=_dereq_("./light"),LineAtlas=_dereq_("../render/line_atlas"),util=_dereq_("../util/util"),ajax=_dereq_("../util/ajax"),mapbox=_dereq_("../util/mapbox"),browser=_dereq_("../util/browser"),Dispatcher=_dereq_("../util/dispatcher"),validateStyle=_dereq_("./validate_style"),getSourceType=_dereq_("../source/source").getType,setSourceType=_dereq_("../source/source").setType,QueryFeatures=_dereq_("../source/query_features"),SourceCache=_dereq_("../source/source_cache"),GeoJSONSource=_dereq_("../source/geojson_source"),styleSpec=_dereq_("../style-spec/reference/latest"),getWorkerPool=_dereq_("../util/global_worker_pool"),deref=_dereq_("../style-spec/deref"),diff=_dereq_("../style-spec/diff"),rtlTextPlugin=_dereq_("../source/rtl_text_plugin"),Placement=_dereq_("./placement"),supportedDiffOperations=util.pick(diff.operations,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),ignoredDiffOperations=util.pick(diff.operations,["setCenter","setZoom","setBearing","setPitch"]),Style=function(e){function t(t,r){var a=this;void 0===r&&(r={}),e.call(this),this.map=t,this.dispatcher=new Dispatcher(getWorkerPool(),this),this.imageManager=new ImageManager,this.glyphManager=new GlyphManager(t._transformRequest,r.localIdeographFontFamily),this.lineAtlas=new LineAtlas(256,512),this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory={},this._loaded=!1,this._resetUpdates();var i=this;this._rtlTextPluginCallback=rtlTextPlugin.registerForPluginAvailability(function(e){i.dispatcher.broadcast("loadRTLTextPlugin",e.pluginBlobURL,e.errorCallback);for(var t in i.sourceCaches)i.sourceCaches[t].reload()}),this.on("data",function(e){if("source"===e.dataType&&"metadata"===e.sourceDataType){var t=a.sourceCaches[e.sourceId];if(t){var r=t.getSource();if(r&&r.vectorLayerIds)for(var i in a._layers){var s=a._layers[i];s.source===r.id&&a._validateLayer(s)}}}})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.loadURL=function(e,t){var r=this;void 0===t&&(t={}),this.fire("dataloading",{dataType:"style"});var a="boolean"==typeof t.validate?t.validate:!mapbox.isMapboxURL(e);e=mapbox.normalizeStyleURL(e,t.accessToken);var i=this.map._transformRequest(e,ajax.ResourceType.Style);ajax.getJSON(i,function(e,t){e?r.fire("error",{error:e}):t&&r._load(t,a)})},t.prototype.loadJSON=function(e,t){var r=this;void 0===t&&(t={}),this.fire("dataloading",{dataType:"style"}),browser.frame(function(){r._load(e,!1!==t.validate)})},t.prototype._load=function(e,t){var r=this;if(!t||!validateStyle.emitErrors(this,validateStyle(e))){this._loaded=!0,this.stylesheet=e,this.updatePaintProperties();for(var a in e.sources)r.addSource(a,e.sources[a],{validate:!1});e.sprite?loadSprite(e.sprite,this.map._transformRequest,function(e,t){if(e)r.fire("error",e);else if(t)for(var a in t)r.imageManager.addImage(a,t[a]);r.imageManager.setLoaded(!0),r.fire("data",{dataType:"style"})}):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var i=deref(this.stylesheet.layers);this._order=i.map(function(e){return e.id}),this._layers={};for(var s=0,o=i;s<o.length;s+=1){var n=o[s];n=StyleLayer.create(n),n.setEventedParent(r,{layer:{id:n.id}}),r._layers[n.id]=n}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Light(this.stylesheet.light),this.fire("data",{dataType:"style"}),this.fire("style.load")}},t.prototype._validateLayer=function(e){var t=this.sourceCaches[e.source];if(t){var r=e.sourceLayer;if(r){var a=t.getSource();("geojson"===a.type||a.vectorLayerIds&&-1===a.vectorLayerIds.indexOf(r))&&this.fire("error",{error:new Error('Source layer "'+r+'" does not exist on source "'+a.id+'" as specified by style layer "'+e.id+'"')})}}},t.prototype.loaded=function(){var e=this;if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in e.sourceCaches)if(!e.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},t.prototype._serializeLayers=function(e){var t=this;return e.map(function(e){return t._layers[e].serialize()})},t.prototype._applyPaintPropertyUpdates=function(e){var t=this;if(this._loaded){e=e||{transition:!0};var r=util.extend({duration:300,delay:0},this.stylesheet.transition),a=this._updatedAllPaintProps?this._layers:this._updatedPaintProps;for(var i in a)t._layers[i].updatePaintTransitions(e,r);this.light.updateTransitions(e,r)}},t.prototype._recalculate=function(e){var t=this;if(this._loaded){for(var r in t.sourceCaches)t.sourceCaches[r].used=!1;for(var a={zoom:e,now:Date.now(),defaultFadeDuration:300,zoomHistory:this._updateZoomHistory(e)},i=0,s=t._order;i<s.length;i+=1){var o=s[i],n=t._layers[o];n.recalculate(a),!n.isHidden(e)&&n.source&&(t.sourceCaches[n.source].used=!0)}this.light.recalculate(a),this.z=e}},t.prototype.hasTransitions=function(){var e=this;if(this.light&&this.light.hasTransition())return!0;for(var t in e.sourceCaches)if(e.sourceCaches[t].hasTransition())return!0;for(var r in e._layers)if(e._layers[r].hasTransition())return!0;return!1},t.prototype._updateZoomHistory=function(e){var t=this.zoomHistory;return void 0===t.lastIntegerZoom&&(t.lastIntegerZoom=Math.floor(e),t.lastIntegerZoomTime=0,t.lastZoom=e),Math.floor(t.lastZoom)<Math.floor(e)?(t.lastIntegerZoom=Math.floor(e),t.lastIntegerZoomTime=Date.now()):Math.floor(t.lastZoom)>Math.floor(e)&&(t.lastIntegerZoom=Math.floor(e+1),t.lastIntegerZoomTime=Date.now()),t.lastZoom=e,t},t.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},t.prototype.update=function(e){var t=this;if(this._changed){var r=Object.keys(this._updatedLayers),a=Object.keys(this._removedLayers);(r.length||a.length)&&this._updateWorkerLayers(r,a);for(var i in t._updatedSources){var s=t._updatedSources[i];"reload"===s?t._reloadSource(i):"clear"===s&&t._clearSource(i)}this._applyPaintPropertyUpdates(e),this._resetUpdates(),this.fire("data",{dataType:"style"})}},t.prototype._updateWorkerLayers=function(e,t){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(e),removedIds:t})},t.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._updatedAllPaintProps=!1},t.prototype.setState=function(e){var t=this;if(this._checkLoaded(),validateStyle.emitErrors(this,validateStyle(e)))return!1;e=util.clone(e),e.layers=deref(e.layers);var r=diff(this.serialize(),e).filter(function(e){return!(e.command in ignoredDiffOperations)});if(0===r.length)return!1;var a=r.filter(function(e){return!(e.command in supportedDiffOperations)});if(a.length>0)throw new Error("Unimplemented: "+a.map(function(e){return e.command}).join(", ")+".");return r.forEach(function(e){"setTransition"!==e.command&&t[e.command].apply(t,e.args)}),this.stylesheet=e,!0},t.prototype.addImage=function(e,t){if(this.imageManager.getImage(e))return this.fire("error",{error:new Error("An image with this name already exists.")});this.imageManager.addImage(e,t),this.fire("data",{dataType:"style"})},t.prototype.removeImage=function(e){if(!this.imageManager.getImage(e))return this.fire("error",{error:new Error("No image with this name exists.")});this.imageManager.removeImage(e),this.fire("data",{dataType:"style"})},t.prototype.addSource=function(e,t,r){var a=this;if(this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!t.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(t).join(", ")+".");if(!(["vector","raster","geojson","video","image","canvas"].indexOf(t.type)>=0&&this._validate(validateStyle.source,"sources."+e,t,null,r))){var i=this.sourceCaches[e]=new SourceCache(e,t,this.dispatcher);i.style=this,i.setEventedParent(this,function(){return{isSourceLoaded:a.loaded(),source:i.serialize(),sourceId:e}}),i.onAdd(this.map),this._changed=!0}},t.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");var t=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],t.fire("data",{sourceDataType:"metadata",dataType:"source",sourceId:e}),t.setEventedParent(null),t.clearTiles(),t.onRemove&&t.onRemove(this.map),this._changed=!0},t.prototype.setGeoJSONSourceData=function(e,t){this._checkLoaded(),this.sourceCaches[e].getSource().setData(t),this._changed=!0},t.prototype.getSource=function(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()},t.prototype.addLayer=function(e,t,r){this._checkLoaded();var a=e.id;if("object"==typeof e.source&&(this.addSource(a,e.source),e=util.clone(e),e=util.extend(e,{source:a})),!this._validate(validateStyle.layer,"layers."+a,e,{arrayIndex:-1},r)){var i=StyleLayer.create(e);this._validateLayer(i),i.setEventedParent(this,{layer:{id:a}});var s=t?this._order.indexOf(t):this._order.length;if(t&&-1===s)return void this.fire("error",{message:new Error('Layer with id "'+t+'" does not exist on this map.')});if(this._order.splice(s,0,a),this._layerOrderChanged=!0,this._layers[a]=i,this._removedLayers[a]&&i.source){var o=this._removedLayers[a];delete this._removedLayers[a],o.type!==i.type?this._updatedSources[i.source]="clear":(this._updatedSources[i.source]="reload",this.sourceCaches[i.source].pause())}this._updateLayer(i),this.updatePaintProperties(a)}},t.prototype.moveLayer=function(e,t){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire("error",{error:new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")});var r=this._order.indexOf(e);this._order.splice(r,1);var a=t?this._order.indexOf(t):this._order.length;this._order.splice(a,0,e),this._layerOrderChanged=!0},t.prototype.removeLayer=function(e){this._checkLoaded();var t=this._layers[e];if(!t)return void this.fire("error",{error:new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")});t.setEventedParent(null);var r=this._order.indexOf(e);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=t,delete this._layers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e]},t.prototype.getLayer=function(e){return this._layers[e]},t.prototype.setLayerZoomRange=function(e,t,r){this._checkLoaded();var a=this.getLayer(e);if(!a)return void this.fire("error",{error:new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")});a.minzoom===t&&a.maxzoom===r||(null!=t&&(a.minzoom=t),null!=r&&(a.maxzoom=r),this._updateLayer(a))},t.prototype.setFilter=function(e,t){this._checkLoaded();var r=this.getLayer(e);if(!r)return void this.fire("error",{error:new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")});if(!util.deepEqual(r.filter,t))return null===t||void 0===t?(r.filter=void 0,void this._updateLayer(r)):void(this._validate(validateStyle.filter,"layers."+r.id+".filter",t)||(r.filter=util.clone(t),this._updateLayer(r)))},t.prototype.getFilter=function(e){return util.clone(this.getLayer(e).filter)},t.prototype.setLayoutProperty=function(e,t,r){this._checkLoaded();var a=this.getLayer(e);if(!a)return void this.fire("error",{error:new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")});util.deepEqual(a.getLayoutProperty(t),r)||(a.setLayoutProperty(t,r),this._updateLayer(a))},t.prototype.getLayoutProperty=function(e,t){return this.getLayer(e).getLayoutProperty(t)},t.prototype.setPaintProperty=function(e,t,r){this._checkLoaded();var a=this.getLayer(e);if(!a)return void this.fire("error",{error:new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")});if(!util.deepEqual(a.getPaintProperty(t),r)){var i=a._transitionablePaint._values[t].value.isDataDriven();a.setPaintProperty(t,r);(a._transitionablePaint._values[t].value.isDataDriven()||i)&&this._updateLayer(a),this.updatePaintProperties(e,t)}},t.prototype.getPaintProperty=function(e,t){return this.getLayer(e).getPaintProperty(t)},t.prototype.getTransition=function(){return util.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},t.prototype.updatePaintProperties=function(e,t){if(this._changed=!0,e){var r=this._updatedPaintProps;r[e]||(r[e]={}),r[e][t||"all"]=!0}else this._updatedAllPaintProps=!0},t.prototype.serialize=function(){var e=this;return util.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:util.mapObject(this.sourceCaches,function(e){return e.serialize()}),layers:this._order.map(function(t){return e._layers[t].serialize()})},function(e){return void 0!==e})},t.prototype._updateLayer=function(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._changed=!0},t.prototype._flattenRenderedFeatures=function(e){for(var t=this,r=[],a=this._order.length-1;a>=0;a--)for(var i=t._order[a],s=0,o=e;s<o.length;s+=1){var n=o[s],l=n[i];if(l)for(var h=0,u=l;h<u.length;h+=1){var d=u[h];r.push(d)}}return r},t.prototype.queryRenderedFeatures=function(e,t,r,a){var i=this;t&&t.filter&&this._validate(validateStyle.filter,"queryRenderedFeatures.filter",t.filter);var s={};if(t&&t.layers){if(!Array.isArray(t.layers))return this.fire("error",{error:"parameters.layers must be an Array."}),[];for(var o=0,n=t.layers;o<n.length;o+=1){var l=n[o],h=i._layers[l];if(!h)return i.fire("error",{error:"The layer '"+l+"' does not exist in the map's style and cannot be queried for features."}),[];s[h.source]=!0}}var u=[];for(var d in i.sourceCaches)if(!t.layers||s[d]){var c=QueryFeatures.rendered(i.sourceCaches[d],i._layers,e,t,r,a);u.push(c)}return this._flattenRenderedFeatures(u)},t.prototype.querySourceFeatures=function(e,t){t&&t.filter&&this._validate(validateStyle.filter,"querySourceFeatures.filter",t.filter);var r=this.sourceCaches[e];return r?QueryFeatures.source(r,t):[]},t.prototype.addSourceType=function(e,t,r){return getSourceType(e)?r(new Error('A source type called "'+e+'" already exists.')):(setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},r):r(null,null))},t.prototype.getLight=function(){return this.light.getLight()},t.prototype.setLight=function(e,t){this._checkLoaded();var r=this.light.getLight(),a=!1;for(var i in e)if(!util.deepEqual(e[i],r[i])){a=!0;break}if(a){t=t||{transition:!0};var s=util.extend({duration:300,delay:0},this.stylesheet.transition);this.light.setLight(e),this.light.updateTransitions(t,s)}},t.prototype._validate=function(e,t,r,a,i){return(!i||!1!==i.validate)&&validateStyle.emitErrors(this,e.call(validateStyle,util.extend({key:t,style:this.serialize(),value:r,styleSpec:styleSpec},a)))},t.prototype._remove=function(){var e=this;rtlTextPlugin.evented.off("pluginAvailable",this._rtlTextPluginCallback);for(var t in e.sourceCaches)e.sourceCaches[t].clearTiles();this.dispatcher.remove()},t.prototype._clearSource=function(e){this.sourceCaches[e].clearTiles()},t.prototype._reloadSource=function(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()},t.prototype._updateSources=function(e){var t=this;for(var r in t.sourceCaches)t.sourceCaches[r].update(e)},t.prototype.getNeedsFullPlacement=function(){var e=this;if(this._layerOrderChanged)return!0;for(var t in e.sourceCaches)if(e.sourceCaches[t].getNeedsFullPlacement())return!0;return!1},t.prototype._generateCollisionBoxes=function(){var e=this;for(var t in e.sourceCaches)e._reloadSource(t)},t.prototype._updatePlacement=function(e,t,r){var a=this.getNeedsFullPlacement();return(a||!this.placement||this.placement.isDone())&&(this.placement=new Placement(e,this._order,a,t,r,this.placement),this._layerOrderChanged=!1),this.placement.continuePlacement(this._order,this._layers,this.sourceCaches),this.placement.isDone()&&(this.collisionIndex=this.placement.collisionIndex),!this.placement.isDone()||this.placement.stillFading()},t.prototype.getImages=function(e,t,r){this.imageManager.getImages(t.icons,r)},t.prototype.getGlyphs=function(e,t,r){this.glyphManager.getGlyphs(t.stacks,r)},t}(Evented);module.exports=Style;
-},{"../render/glyph_manager":85,"../render/image_manager":87,"../render/line_atlas":88,"../source/geojson_source":99,"../source/query_features":105,"../source/rtl_text_plugin":107,"../source/source":108,"../source/source_cache":109,"../style-spec/deref":118,"../style-spec/diff":119,"../style-spec/reference/latest":148,"../util/ajax":244,"../util/browser":245,"../util/dispatcher":251,"../util/evented":253,"../util/global_worker_pool":255,"../util/mapbox":260,"../util/util":266,"./light":178,"./load_sprite":180,"./placement":182,"./style_layer":186,"./validate_style":204}],186:[function(_dereq_,module,exports){
-"use strict";var util=_dereq_("../util/util"),styleSpec=_dereq_("../style-spec/reference/latest"),validateStyle=_dereq_("./validate_style"),Evented=_dereq_("../util/evented"),ref=_dereq_("./properties"),Layout=ref.Layout,Transitionable=ref.Transitionable,Transitioning=ref.Transitioning,Properties=ref.Properties,TRANSITION_SUFFIX="-transition",StyleLayer=function(t){function i(i,e){var a=this;t.call(this),this.id=i.id,this.metadata=i.metadata,this.type=i.type,this.minzoom=i.minzoom,this.maxzoom=i.maxzoom,this.visibility="visible","background"!==i.type&&(this.source=i.source,this.sourceLayer=i["source-layer"],this.filter=i.filter),this._featureFilter=function(){return!0},e.layout&&(this._unevaluatedLayout=new Layout(e.layout)),this._transitionablePaint=new Transitionable(e.paint);for(var r in i.paint)a.setPaintProperty(r,i.paint[r],{validate:!1});for(var n in i.layout)a.setLayoutProperty(n,i.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned()}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},i.prototype.setLayoutProperty=function(t,i,e){if(null!==i&&void 0!==i){var a="layers."+this.id+".layout."+t;if(this._validate(validateStyle.layoutProperty,a,t,i,e))return}if("visibility"===t)return void(this.visibility="none"===i?i:"visible");this._unevaluatedLayout.setValue(t,i)},i.prototype.getPaintProperty=function(t){return util.endsWith(t,TRANSITION_SUFFIX)?this._transitionablePaint.getTransition(t.slice(0,-TRANSITION_SUFFIX.length)):this._transitionablePaint.getValue(t)},i.prototype.setPaintProperty=function(t,i,e){if(null!==i&&void 0!==i){var a="layers."+this.id+".paint."+t;if(this._validate(validateStyle.paintProperty,a,t,i,e))return}util.endsWith(t,TRANSITION_SUFFIX)?this._transitionablePaint.setTransition(t.slice(0,-TRANSITION_SUFFIX.length),i||void 0):this._transitionablePaint.setValue(t,i)},i.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||(!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility)},i.prototype.updatePaintTransitions=function(t,i){!1===t.transition?this._transitioningPaint=this._transitionablePaint.untransitioned():this._transitioningPaint=this._transitionablePaint.transitioned({now:Date.now(),transition:i},this._transitioningPaint)},i.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},i.prototype.recalculate=function(t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t)},i.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return"none"===this.visibility&&(t.layout=t.layout||{},t.layout.visibility="none"),util.filterObject(t,function(t,i){return!(void 0===t||"layout"===i&&!Object.keys(t).length||"paint"===i&&!Object.keys(t).length)})},i.prototype._validate=function(t,i,e,a,r){return(!r||!1!==r.validate)&&validateStyle.emitErrors(this,t.call(validateStyle,{key:i,layerType:this.type,objectKey:e,value:a,styleSpec:styleSpec,style:{glyphs:!0,sprite:!0}}))},i.prototype.has3DPass=function(){return!1},i.prototype.resize=function(t){},i}(Evented);module.exports=StyleLayer;var subclasses={circle:_dereq_("./style_layer/circle_style_layer"),heatmap:_dereq_("./style_layer/heatmap_style_layer"),fill:_dereq_("./style_layer/fill_style_layer"),"fill-extrusion":_dereq_("./style_layer/fill_extrusion_style_layer"),line:_dereq_("./style_layer/line_style_layer"),symbol:_dereq_("./style_layer/symbol_style_layer"),background:_dereq_("./style_layer/background_style_layer"),raster:_dereq_("./style_layer/raster_style_layer")};StyleLayer.create=function(t){return new subclasses[t.type](t)};
-},{"../style-spec/reference/latest":148,"../util/evented":253,"../util/util":266,"./properties":183,"./style_layer/background_style_layer":187,"./style_layer/circle_style_layer":189,"./style_layer/fill_extrusion_style_layer":191,"./style_layer/fill_style_layer":193,"./style_layer/heatmap_style_layer":195,"./style_layer/line_style_layer":197,"./style_layer/raster_style_layer":199,"./style_layer/symbol_style_layer":201,"./validate_style":204}],187:[function(_dereq_,module,exports){
-"use strict";var StyleLayer=_dereq_("../style_layer"),properties=_dereq_("./background_style_layer_properties"),ref=_dereq_("../properties"),Transitionable=ref.Transitionable,Transitioning=ref.Transitioning,PossiblyEvaluated=ref.PossiblyEvaluated,BackgroundStyleLayer=function(e){function r(r){e.call(this,r,properties)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r}(StyleLayer);module.exports=BackgroundStyleLayer;
-},{"../properties":183,"../style_layer":186,"./background_style_layer_properties":188}],188:[function(_dereq_,module,exports){
-"use strict";var styleSpec=_dereq_("../../style-spec/reference/latest"),ref=_dereq_("../properties"),Properties=ref.Properties,DataConstantProperty=ref.DataConstantProperty,DataDrivenProperty=ref.DataDrivenProperty,CrossFadedProperty=ref.CrossFadedProperty,HeatmapColorProperty=ref.HeatmapColorProperty,paint=new Properties({"background-color":new DataConstantProperty(styleSpec.paint_background["background-color"]),"background-pattern":new CrossFadedProperty(styleSpec.paint_background["background-pattern"]),"background-opacity":new DataConstantProperty(styleSpec.paint_background["background-opacity"])});module.exports={paint:paint};
-},{"../../style-spec/reference/latest":148,"../properties":183}],189:[function(_dereq_,module,exports){
-"use strict";var StyleLayer=_dereq_("../style_layer"),CircleBucket=_dereq_("../../data/bucket/circle_bucket"),ref=_dereq_("../../util/intersection_tests"),multiPolygonIntersectsBufferedMultiPoint=ref.multiPolygonIntersectsBufferedMultiPoint,ref$1=_dereq_("../query_utils"),getMaximumPaintValue=ref$1.getMaximumPaintValue,translateDistance=ref$1.translateDistance,translate=ref$1.translate,properties=_dereq_("./circle_style_layer_properties"),ref$2=_dereq_("../properties"),Transitionable=ref$2.Transitionable,Transitioning=ref$2.Transitioning,PossiblyEvaluated=ref$2.PossiblyEvaluated,CircleStyleLayer=function(e){function t(t){e.call(this,t,properties)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new CircleBucket(e)},t.prototype.queryRadius=function(e){var t=e;return getMaximumPaintValue("circle-radius",this,t)+getMaximumPaintValue("circle-stroke-width",this,t)+translateDistance(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,i,a,n){var l=translate(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a,n),s=this.paint.get("circle-radius").evaluate(t)*n,u=this.paint.get("circle-stroke-width").evaluate(t)*n;return multiPolygonIntersectsBufferedMultiPoint(l,r,s+u)},t}(StyleLayer);module.exports=CircleStyleLayer;
-},{"../../data/bucket/circle_bucket":52,"../../util/intersection_tests":257,"../properties":183,"../query_utils":184,"../style_layer":186,"./circle_style_layer_properties":190}],190:[function(_dereq_,module,exports){
-"use strict";var styleSpec=_dereq_("../../style-spec/reference/latest"),ref=_dereq_("../properties"),Properties=ref.Properties,DataConstantProperty=ref.DataConstantProperty,DataDrivenProperty=ref.DataDrivenProperty,CrossFadedProperty=ref.CrossFadedProperty,HeatmapColorProperty=ref.HeatmapColorProperty,paint=new Properties({"circle-radius":new DataDrivenProperty(styleSpec.paint_circle["circle-radius"]),"circle-color":new DataDrivenProperty(styleSpec.paint_circle["circle-color"]),"circle-blur":new DataDrivenProperty(styleSpec.paint_circle["circle-blur"]),"circle-opacity":new DataDrivenProperty(styleSpec.paint_circle["circle-opacity"]),"circle-translate":new DataConstantProperty(styleSpec.paint_circle["circle-translate"]),"circle-translate-anchor":new DataConstantProperty(styleSpec.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new DataConstantProperty(styleSpec.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new DataConstantProperty(styleSpec.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new DataDrivenProperty(styleSpec.paint_circle["circle-stroke-width"]),"circle-stroke-color":new DataDrivenProperty(styleSpec.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new DataDrivenProperty(styleSpec.paint_circle["circle-stroke-opacity"])});module.exports={paint:paint};
-},{"../../style-spec/reference/latest":148,"../properties":183}],191:[function(_dereq_,module,exports){
-"use strict";var StyleLayer=_dereq_("../style_layer"),FillExtrusionBucket=_dereq_("../../data/bucket/fill_extrusion_bucket"),ref=_dereq_("../../util/intersection_tests"),multiPolygonIntersectsMultiPolygon=ref.multiPolygonIntersectsMultiPolygon,ref$1=_dereq_("../query_utils"),translateDistance=ref$1.translateDistance,translate=ref$1.translate,properties=_dereq_("./fill_extrusion_style_layer_properties"),ref$2=_dereq_("../properties"),Transitionable=ref$2.Transitionable,Transitioning=ref$2.Transitioning,PossiblyEvaluated=ref$2.PossiblyEvaluated,FillExtrusionStyleLayer=function(t){function e(e){t.call(this,e,properties)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new FillExtrusionBucket(t)},e.prototype.queryRadius=function(){return translateDistance(this.paint.get("fill-extrusion-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,o){var s=translate(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),n,o);return multiPolygonIntersectsMultiPolygon(s,r)},e.prototype.has3DPass=function(){return 0!==this.paint.get("fill-extrusion-opacity")&&"none"!==this.visibility},e.prototype.resize=function(t){if(this.viewportFrame){var e=this.viewportFrame,r=e.texture,i=e.fbo;t.deleteTexture(r),t.deleteFramebuffer(i),this.viewportFrame=null}},e}(StyleLayer);module.exports=FillExtrusionStyleLayer;
-},{"../../data/bucket/fill_extrusion_bucket":54,"../../util/intersection_tests":257,"../properties":183,"../query_utils":184,"../style_layer":186,"./fill_extrusion_style_layer_properties":192}],192:[function(_dereq_,module,exports){
-"use strict";var styleSpec=_dereq_("../../style-spec/reference/latest"),ref=_dereq_("../properties"),Properties=ref.Properties,DataConstantProperty=ref.DataConstantProperty,DataDrivenProperty=ref.DataDrivenProperty,CrossFadedProperty=ref.CrossFadedProperty,HeatmapColorProperty=ref.HeatmapColorProperty,paint=new Properties({"fill-extrusion-opacity":new DataConstantProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new DataDrivenProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new DataConstantProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new DataConstantProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new CrossFadedProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new DataDrivenProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new DataDrivenProperty(styleSpec["paint_fill-extrusion"]["fill-extrusion-base"])});module.exports={paint:paint};
-},{"../../style-spec/reference/latest":148,"../properties":183}],193:[function(_dereq_,module,exports){
-"use strict";var StyleLayer=_dereq_("../style_layer"),FillBucket=_dereq_("../../data/bucket/fill_bucket"),ref=_dereq_("../../util/intersection_tests"),multiPolygonIntersectsMultiPolygon=ref.multiPolygonIntersectsMultiPolygon,ref$1=_dereq_("../query_utils"),translateDistance=ref$1.translateDistance,translate=ref$1.translate,properties=_dereq_("./fill_style_layer_properties"),ref$2=_dereq_("../properties"),Transitionable=ref$2.Transitionable,Transitioning=ref$2.Transitioning,PossiblyEvaluated=ref$2.PossiblyEvaluated,FillStyleLayer=function(t){function e(e){t.call(this,e,properties)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(t){this.paint=this._transitioningPaint.possiblyEvaluate(t),void 0===this._transitionablePaint.getValue("fill-outline-color")&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new FillBucket(t)},e.prototype.queryRadius=function(){return translateDistance(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,l,n){var a=translate(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),l,n);return multiPolygonIntersectsMultiPolygon(a,r)},e}(StyleLayer);module.exports=FillStyleLayer;
-},{"../../data/bucket/fill_bucket":53,"../../util/intersection_tests":257,"../properties":183,"../query_utils":184,"../style_layer":186,"./fill_style_layer_properties":194}],194:[function(_dereq_,module,exports){
-"use strict";var styleSpec=_dereq_("../../style-spec/reference/latest"),ref=_dereq_("../properties"),Properties=ref.Properties,DataConstantProperty=ref.DataConstantProperty,DataDrivenProperty=ref.DataDrivenProperty,CrossFadedProperty=ref.CrossFadedProperty,HeatmapColorProperty=ref.HeatmapColorProperty,paint=new Properties({"fill-antialias":new DataConstantProperty(styleSpec.paint_fill["fill-antialias"]),"fill-opacity":new DataDrivenProperty(styleSpec.paint_fill["fill-opacity"]),"fill-color":new DataDrivenProperty(styleSpec.paint_fill["fill-color"]),"fill-outline-color":new DataDrivenProperty(styleSpec.paint_fill["fill-outline-color"]),"fill-translate":new DataConstantProperty(styleSpec.paint_fill["fill-translate"]),"fill-translate-anchor":new DataConstantProperty(styleSpec.paint_fill["fill-translate-anchor"]),"fill-pattern":new CrossFadedProperty(styleSpec.paint_fill["fill-pattern"])});module.exports={paint:paint};
-},{"../../style-spec/reference/latest":148,"../properties":183}],195:[function(_dereq_,module,exports){
-"use strict";var StyleLayer=_dereq_("../style_layer"),HeatmapBucket=_dereq_("../../data/bucket/heatmap_bucket"),RGBAImage=_dereq_("../../util/image").RGBAImage,properties=_dereq_("./heatmap_style_layer_properties"),ref=_dereq_("../properties"),Transitionable=ref.Transitionable,Transitioning=ref.Transitioning,PossiblyEvaluated=ref.PossiblyEvaluated,HeatmapStyleLayer=function(e){function t(t){e.call(this,t,properties),this._updateColorRamp()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new HeatmapBucket(e)},t.prototype.setPaintProperty=function(t,r,a){e.prototype.setPaintProperty.call(this,t,r,a),"heatmap-color"===t&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){for(var e=this._transitionablePaint._values["heatmap-color"].value.expression,t=new Uint8Array(1024),r=t.length,a=4;a<r;a+=4){var o=e.evaluate({heatmapDensity:a/r});t[a+0]=Math.floor(255*o.r/o.a),t[a+1]=Math.floor(255*o.g/o.a),t[a+2]=Math.floor(255*o.b/o.a),t[a+3]=Math.floor(255*o.a)}this.colorRamp=RGBAImage.create({width:256,height:1},t),this.colorRampTexture=null},t.prototype.resize=function(e){this.heatmapTexture&&(e.deleteTexture(this.heatmapTexture),this.heatmapTexture=null),this.heatmapFbo&&(e.deleteFramebuffer(this.heatmapFbo),this.heatmapFbo=null)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t}(StyleLayer);module.exports=HeatmapStyleLayer;
-},{"../../data/bucket/heatmap_bucket":55,"../../util/image":256,"../properties":183,"../style_layer":186,"./heatmap_style_layer_properties":196}],196:[function(_dereq_,module,exports){
-"use strict";var styleSpec=_dereq_("../../style-spec/reference/latest"),ref=_dereq_("../properties"),Properties=ref.Properties,DataConstantProperty=ref.DataConstantProperty,DataDrivenProperty=ref.DataDrivenProperty,CrossFadedProperty=ref.CrossFadedProperty,HeatmapColorProperty=ref.HeatmapColorProperty,paint=new Properties({"heatmap-radius":new DataConstantProperty(styleSpec.paint_heatmap["heatmap-radius"]),"heatmap-weight":new DataDrivenProperty(styleSpec.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new DataConstantProperty(styleSpec.paint_heatmap["heatmap-intensity"]),"heatmap-color":new HeatmapColorProperty(styleSpec.paint_heatmap["heatmap-color"]),"heatmap-opacity":new DataConstantProperty(styleSpec.paint_heatmap["heatmap-opacity"])});module.exports={paint:paint};
-},{"../../style-spec/reference/latest":148,"../properties":183}],197:[function(_dereq_,module,exports){
-"use strict";function getLineWidth(e,t){return t>0?t+2*e:e}function offsetLine(e,t){for(var i=[],r=new Point(0,0),n=0;n<e.length;n++){for(var a=e[n],l=[],o=0;o<a.length;o++){var u=a[o-1],s=a[o],p=a[o+1],y=0===o?r:s.sub(u)._unit()._perp(),f=o===a.length-1?r:p.sub(s)._unit()._perp(),c=y._add(f)._unit(),h=c.x*f.x+c.y*f.y;c._mult(1/h),l.push(c._mult(t)._add(s))}i.push(l)}return i}var Point=_dereq_("@mapbox/point-geometry"),StyleLayer=_dereq_("../style_layer"),LineBucket=_dereq_("../../data/bucket/line_bucket"),ref=_dereq_("../../util/intersection_tests"),multiPolygonIntersectsBufferedMultiLine=ref.multiPolygonIntersectsBufferedMultiLine,ref$1=_dereq_("../query_utils"),getMaximumPaintValue=ref$1.getMaximumPaintValue,translateDistance=ref$1.translateDistance,translate=ref$1.translate,properties=_dereq_("./line_style_layer_properties"),ref$2=_dereq_("../properties"),Transitionable=ref$2.Transitionable,Transitioning=ref$2.Transitioning,Layout=ref$2.Layout,PossiblyEvaluated=ref$2.PossiblyEvaluated,DataDrivenProperty=ref$2.DataDrivenProperty,lineFloorwidthProperty=new DataDrivenProperty(properties.paint.properties["line-width"].specification,!0),LineStyleLayer=function(e){function t(t){e.call(this,t,properties)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t){e.prototype.recalculate.call(this,t),this.paint._values["line-floorwidth"]=lineFloorwidthProperty.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},t.prototype.createBucket=function(e){return new LineBucket(e)},t.prototype.queryRadius=function(e){var t=e,i=getLineWidth(getMaximumPaintValue("line-width",this,t),getMaximumPaintValue("line-gap-width",this,t)),r=getMaximumPaintValue("line-offset",this,t);return i/2+Math.abs(r)+translateDistance(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(e,t,i,r,n,a){var l=translate(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),n,a),o=a/2*getLineWidth(this.paint.get("line-width").evaluate(t),this.paint.get("line-gap-width").evaluate(t)),u=this.paint.get("line-offset").evaluate(t);return u&&(i=offsetLine(i,u*a)),multiPolygonIntersectsBufferedMultiLine(l,i,o)},t}(StyleLayer);module.exports=LineStyleLayer;
-},{"../../data/bucket/line_bucket":56,"../../util/intersection_tests":257,"../properties":183,"../query_utils":184,"../style_layer":186,"./line_style_layer_properties":198,"@mapbox/point-geometry":2}],198:[function(_dereq_,module,exports){
-"use strict";var styleSpec=_dereq_("../../style-spec/reference/latest"),ref=_dereq_("../properties"),Properties=ref.Properties,DataConstantProperty=ref.DataConstantProperty,DataDrivenProperty=ref.DataDrivenProperty,CrossFadedProperty=ref.CrossFadedProperty,HeatmapColorProperty=ref.HeatmapColorProperty,layout=new Properties({"line-cap":new DataConstantProperty(styleSpec.layout_line["line-cap"]),"line-join":new DataDrivenProperty(styleSpec.layout_line["line-join"]),"line-miter-limit":new DataConstantProperty(styleSpec.layout_line["line-miter-limit"]),"line-round-limit":new DataConstantProperty(styleSpec.layout_line["line-round-limit"])}),paint=new Properties({"line-opacity":new DataDrivenProperty(styleSpec.paint_line["line-opacity"]),"line-color":new DataDrivenProperty(styleSpec.paint_line["line-color"]),"line-translate":new DataConstantProperty(styleSpec.paint_line["line-translate"]),"line-translate-anchor":new DataConstantProperty(styleSpec.paint_line["line-translate-anchor"]),"line-width":new DataDrivenProperty(styleSpec.paint_line["line-width"]),"line-gap-width":new DataDrivenProperty(styleSpec.paint_line["line-gap-width"]),"line-offset":new DataDrivenProperty(styleSpec.paint_line["line-offset"]),"line-blur":new DataDrivenProperty(styleSpec.paint_line["line-blur"]),"line-dasharray":new CrossFadedProperty(styleSpec.paint_line["line-dasharray"]),"line-pattern":new CrossFadedProperty(styleSpec.paint_line["line-pattern"])});module.exports={paint:paint,layout:layout};
-},{"../../style-spec/reference/latest":148,"../properties":183}],199:[function(_dereq_,module,exports){
-"use strict";var StyleLayer=_dereq_("../style_layer"),properties=_dereq_("./raster_style_layer_properties"),ref=_dereq_("../properties"),Transitionable=ref.Transitionable,Transitioning=ref.Transitioning,PossiblyEvaluated=ref.PossiblyEvaluated,RasterStyleLayer=function(e){function r(r){e.call(this,r,properties)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r}(StyleLayer);module.exports=RasterStyleLayer;
-},{"../properties":183,"../style_layer":186,"./raster_style_layer_properties":200}],200:[function(_dereq_,module,exports){
-"use strict";var styleSpec=_dereq_("../../style-spec/reference/latest"),ref=_dereq_("../properties"),Properties=ref.Properties,DataConstantProperty=ref.DataConstantProperty,DataDrivenProperty=ref.DataDrivenProperty,CrossFadedProperty=ref.CrossFadedProperty,HeatmapColorProperty=ref.HeatmapColorProperty,paint=new Properties({"raster-opacity":new DataConstantProperty(styleSpec.paint_raster["raster-opacity"]),"raster-hue-rotate":new DataConstantProperty(styleSpec.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new DataConstantProperty(styleSpec.paint_raster["raster-brightness-min"]),"raster-brightness-max":new DataConstantProperty(styleSpec.paint_raster["raster-brightness-max"]),"raster-saturation":new DataConstantProperty(styleSpec.paint_raster["raster-saturation"]),"raster-contrast":new DataConstantProperty(styleSpec.paint_raster["raster-contrast"]),"raster-fade-duration":new DataConstantProperty(styleSpec.paint_raster["raster-fade-duration"])});module.exports={paint:paint};
-},{"../../style-spec/reference/latest":148,"../properties":183}],201:[function(_dereq_,module,exports){
-"use strict";var StyleLayer=_dereq_("../style_layer"),SymbolBucket=_dereq_("../../data/bucket/symbol_bucket"),resolveTokens=_dereq_("../../util/token"),ref=_dereq_("../../style-spec/expression"),isExpression=ref.isExpression,properties=_dereq_("./symbol_style_layer_properties"),ref$1=_dereq_("../properties"),Transitionable=ref$1.Transitionable,Transitioning=ref$1.Transitioning,Layout=ref$1.Layout,PossiblyEvaluated=ref$1.PossiblyEvaluated,SymbolStyleLayer=function(t){function e(e){t.call(this,e,properties)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),"auto"===this.layout.get("icon-rotation-alignment")&&("line"===this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("line"===this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"))},e.prototype.getValueAndResolveTokens=function(t,e){var o=this.layout.get(t).evaluate(e),i=this._unevaluatedLayout._values[t];return i.isDataDriven()||isExpression(i.value)?o:resolveTokens(e.properties,o)},e.prototype.createBucket=function(t){return new SymbolBucket(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e}(StyleLayer);module.exports=SymbolStyleLayer;
-},{"../../data/bucket/symbol_bucket":57,"../../style-spec/expression":136,"../../util/token":265,"../properties":183,"../style_layer":186,"./symbol_style_layer_properties":202}],202:[function(_dereq_,module,exports){
-"use strict";var styleSpec=_dereq_("../../style-spec/reference/latest"),ref=_dereq_("../properties"),Properties=ref.Properties,DataConstantProperty=ref.DataConstantProperty,DataDrivenProperty=ref.DataDrivenProperty,CrossFadedProperty=ref.CrossFadedProperty,HeatmapColorProperty=ref.HeatmapColorProperty,layout=new Properties({"symbol-placement":new DataConstantProperty(styleSpec.layout_symbol["symbol-placement"]),"symbol-spacing":new DataConstantProperty(styleSpec.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new DataConstantProperty(styleSpec.layout_symbol["symbol-avoid-edges"]),"icon-allow-overlap":new DataConstantProperty(styleSpec.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new DataConstantProperty(styleSpec.layout_symbol["icon-ignore-placement"]),"icon-optional":new DataConstantProperty(styleSpec.layout_symbol["icon-optional"]),"icon-rotation-alignment":new DataConstantProperty(styleSpec.layout_symbol["icon-rotation-alignment"]),"icon-size":new DataDrivenProperty(styleSpec.layout_symbol["icon-size"]),"icon-text-fit":new DataConstantProperty(styleSpec.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new DataConstantProperty(styleSpec.layout_symbol["icon-text-fit-padding"]),"icon-image":new DataDrivenProperty(styleSpec.layout_symbol["icon-image"]),"icon-rotate":new DataDrivenProperty(styleSpec.layout_symbol["icon-rotate"]),"icon-padding":new DataConstantProperty(styleSpec.layout_symbol["icon-padding"]),"icon-keep-upright":new DataConstantProperty(styleSpec.layout_symbol["icon-keep-upright"]),"icon-offset":new DataDrivenProperty(styleSpec.layout_symbol["icon-offset"]),"icon-anchor":new DataDrivenProperty(styleSpec.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new DataConstantProperty(styleSpec.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new DataConstantProperty(styleSpec.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new DataConstantProperty(styleSpec.layout_symbol["text-rotation-alignment"]),"text-field":new DataDrivenProperty(styleSpec.layout_symbol["text-field"]),"text-font":new DataConstantProperty(styleSpec.layout_symbol["text-font"]),"text-size":new DataDrivenProperty(styleSpec.layout_symbol["text-size"]),"text-max-width":new DataDrivenProperty(styleSpec.layout_symbol["text-max-width"]),"text-line-height":new DataConstantProperty(styleSpec.layout_symbol["text-line-height"]),"text-letter-spacing":new DataDrivenProperty(styleSpec.layout_symbol["text-letter-spacing"]),"text-justify":new DataDrivenProperty(styleSpec.layout_symbol["text-justify"]),"text-anchor":new DataDrivenProperty(styleSpec.layout_symbol["text-anchor"]),"text-max-angle":new DataConstantProperty(styleSpec.layout_symbol["text-max-angle"]),"text-rotate":new DataDrivenProperty(styleSpec.layout_symbol["text-rotate"]),"text-padding":new DataConstantProperty(styleSpec.layout_symbol["text-padding"]),"text-keep-upright":new DataConstantProperty(styleSpec.layout_symbol["text-keep-upright"]),"text-transform":new DataDrivenProperty(styleSpec.layout_symbol["text-transform"]),"text-offset":new DataDrivenProperty(styleSpec.layout_symbol["text-offset"]),"text-allow-overlap":new DataConstantProperty(styleSpec.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new DataConstantProperty(styleSpec.layout_symbol["text-ignore-placement"]),"text-optional":new DataConstantProperty(styleSpec.layout_symbol["text-optional"])}),paint=new Properties({"icon-opacity":new DataDrivenProperty(styleSpec.paint_symbol["icon-opacity"]),"icon-color":new DataDrivenProperty(styleSpec.paint_symbol["icon-color"]),"icon-halo-color":new DataDrivenProperty(styleSpec.paint_symbol["icon-halo-color"]),"icon-halo-width":new DataDrivenProperty(styleSpec.paint_symbol["icon-halo-width"]),"icon-halo-blur":new DataDrivenProperty(styleSpec.paint_symbol["icon-halo-blur"]),"icon-translate":new DataConstantProperty(styleSpec.paint_symbol["icon-translate"]),"icon-translate-anchor":new DataConstantProperty(styleSpec.paint_symbol["icon-translate-anchor"]),"text-opacity":new DataDrivenProperty(styleSpec.paint_symbol["text-opacity"]),"text-color":new DataDrivenProperty(styleSpec.paint_symbol["text-color"]),"text-halo-color":new DataDrivenProperty(styleSpec.paint_symbol["text-halo-color"]),"text-halo-width":new DataDrivenProperty(styleSpec.paint_symbol["text-halo-width"]),"text-halo-blur":new DataDrivenProperty(styleSpec.paint_symbol["text-halo-blur"]),"text-translate":new DataConstantProperty(styleSpec.paint_symbol["text-translate"]),"text-translate-anchor":new DataConstantProperty(styleSpec.paint_symbol["text-translate-anchor"])});module.exports={paint:paint,layout:layout};
-},{"../../style-spec/reference/latest":148,"../properties":183}],203:[function(_dereq_,module,exports){
-"use strict";var StyleLayer=_dereq_("./style_layer"),util=_dereq_("../util/util"),featureFilter=_dereq_("../style-spec/feature_filter"),groupByLayout=_dereq_("../style-spec/group_by_layout"),StyleLayerIndex=function(e){e&&this.replace(e)};StyleLayerIndex.prototype.replace=function(e){this._layerConfigs={},this._layers={},this.update(e,[])},StyleLayerIndex.prototype.update=function(e,r){for(var t=this,a=0,i=e;a<i.length;a+=1){var l=i[a];t._layerConfigs[l.id]=l;var y=t._layers[l.id]=StyleLayer.create(l);y._featureFilter=featureFilter(y.filter)}for(var u=0,s=r;u<s.length;u+=1){var o=s[u];delete t._layerConfigs[o],delete t._layers[o]}this.familiesBySource={};for(var n=groupByLayout(util.values(this._layerConfigs)),f=0,p=n;f<p.length;f+=1){var c=p[f],_=c.map(function(e){return t._layers[e.id]}),d=_[0];if("none"!==d.visibility){var v=d.source||"",g=t.familiesBySource[v];g||(g=t.familiesBySource[v]={});var h=d.sourceLayer||"_geojsonTileLayer",L=g[h];L||(L=g[h]=[]),L.push(_)}}},module.exports=StyleLayerIndex;
-},{"../style-spec/feature_filter":145,"../style-spec/group_by_layout":147,"../util/util":266,"./style_layer":186}],204:[function(_dereq_,module,exports){
-"use strict";module.exports=_dereq_("../style-spec/validate_style.min"),module.exports.emitErrors=function(r,e){if(e&&e.length){for(var t=0,o=e;t<o.length;t+=1){var s=o[t],i=s.message;r.fire("error",{error:new Error(i)})}return!0}return!1};
-},{"../style-spec/validate_style.min":177}],205:[function(_dereq_,module,exports){
-"use strict";var Point=_dereq_("@mapbox/point-geometry"),Anchor=function(t){function o(o,e,n,r){t.call(this,o,e),this.angle=n,void 0!==r&&(this.segment=r)}return t&&(o.__proto__=t),o.prototype=Object.create(t&&t.prototype),o.prototype.constructor=o,o.prototype.clone=function(){return new o(this.x,this.y,this.angle,this.segment)},o}(Point);module.exports=Anchor;
-},{"@mapbox/point-geometry":2}],206:[function(_dereq_,module,exports){
-"use strict";function checkMaxAngle(e,t,a,r,n){if(void 0===t.segment)return!0;for(var i=t,s=t.segment+1,f=0;f>-a/2;){if(--s<0)return!1;f-=e[s].dist(i),i=e[s]}f+=e[s].dist(e[s+1]),s++;for(var l=[],o=0;f<a/2;){var u=e[s-1],c=e[s],g=e[s+1];if(!g)return!1;var h=u.angleTo(c)-c.angleTo(g);for(h=Math.abs((h+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:f,angleDelta:h}),o+=h;f-l[0].distance>r;)o-=l.shift().angleDelta;if(o>n)return!1;s++,f+=c.dist(g)}return!0}module.exports=checkMaxAngle;
-},{}],207:[function(_dereq_,module,exports){
-"use strict";function clipLine(n,x,y,o,e){for(var r=[],t=0;t<n.length;t++)for(var i=n[t],u=void 0,d=0;d<i.length-1;d++){var P=i[d],w=i[d+1];P.x<x&&w.x<x||(P.x<x?P=new Point(x,P.y+(w.y-P.y)*((x-P.x)/(w.x-P.x)))._round():w.x<x&&(w=new Point(x,P.y+(w.y-P.y)*((x-P.x)/(w.x-P.x)))._round()),P.y<y&&w.y<y||(P.y<y?P=new Point(P.x+(w.x-P.x)*((y-P.y)/(w.y-P.y)),y)._round():w.y<y&&(w=new Point(P.x+(w.x-P.x)*((y-P.y)/(w.y-P.y)),y)._round()),P.x>=o&&w.x>=o||(P.x>=o?P=new Point(o,P.y+(w.y-P.y)*((o-P.x)/(w.x-P.x)))._round():w.x>=o&&(w=new Point(o,P.y+(w.y-P.y)*((o-P.x)/(w.x-P.x)))._round()),P.y>=e&&w.y>=e||(P.y>=e?P=new Point(P.x+(w.x-P.x)*((e-P.y)/(w.y-P.y)),e)._round():w.y>=e&&(w=new Point(P.x+(w.x-P.x)*((e-P.y)/(w.y-P.y)),e)._round()),u&&P.equals(u[u.length-1])||(u=[P],r.push(u)),u.push(w)))))}return r}var Point=_dereq_("@mapbox/point-geometry");module.exports=clipLine;
-},{"@mapbox/point-geometry":2}],208:[function(_dereq_,module,exports){
-"use strict";var createStructArrayType=_dereq_("../util/struct_array"),Point=_dereq_("@mapbox/point-geometry"),CollisionBoxArray=createStructArrayType({members:[{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"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]});Object.defineProperty(CollisionBoxArray.prototype.StructType.prototype,"anchorPoint",{get:function(){return new Point(this.anchorPointX,this.anchorPointY)}}),module.exports=CollisionBoxArray;
-},{"../util/struct_array":263,"@mapbox/point-geometry":2}],209:[function(_dereq_,module,exports){
-"use strict";var CollisionFeature=function(t,e,i,o,a,r,l,n,s,d,h){var u=l.top*n-s,f=l.bottom*n+s,c=l.left*n-s,x=l.right*n+s;if(this.boxStartIndex=t.length,d){var m=f-u,v=x-c;m>0&&(m=Math.max(10*n,m),this._addLineCollisionCircles(t,e,i,i.segment,v,m,o,a,r,h))}else t.emplaceBack(i.x,i.y,c,u,x,f,o,a,r,0,0);this.boxEndIndex=t.length};CollisionFeature.prototype._addLineCollisionCircles=function(t,e,i,o,a,r,l,n,s,d){var h=r/2,u=Math.floor(a/h),f=1+.4*Math.log(d)/Math.LN2,c=Math.floor(u*f/2),x=-r/2,m=i,v=o+1,C=x,b=-a/2,g=b-a/4;do{if(--v<0){if(C>b)return;v=0;break}C-=e[v].dist(m),m=e[v]}while(C>g);for(var p=e[v].dist(e[v+1]),M=-c;M<u+c;M++){var _=M*h,k=b+_;if(_<0&&(k+=_),_>a&&(k+=_-a),!(k<C)){for(;C+p<k;){if(C+=p,++v+1>=e.length)return;p=e[v].dist(e[v+1])}var y=k-C,F=e[v],L=e[v+1],B=L.sub(F)._unit()._mult(y)._add(F)._round(),I=Math.abs(k-x)<h?0:.8*(k-x);t.emplaceBack(B.x,B.y,-r/2,-r/2,r/2,r/2,l,n,s,r/2,I)}}},module.exports=CollisionFeature;
-},{}],210:[function(_dereq_,module,exports){
-"use strict";function markCollisionCircleUsed(i,t,e){i[t+4]=e?1:0}var Point=_dereq_("@mapbox/point-geometry"),intersectionTests=_dereq_("../util/intersection_tests"),Grid=_dereq_("./grid_index"),glmatrix=_dereq_("@mapbox/gl-matrix"),mat4=glmatrix.mat4,projection=_dereq_("../symbol/projection"),viewportPadding=100,CollisionIndex=function(i,t,e){void 0===t&&(t=new Grid(i.width+2*viewportPadding,i.height+2*viewportPadding,25)),void 0===e&&(e=new Grid(i.width+2*viewportPadding,i.height+2*viewportPadding,25)),this.transform=i,this.grid=t,this.ignoredGrid=e,this.pitchfactor=Math.cos(i._pitch)*i.cameraToCenterDistance};CollisionIndex.prototype.placeCollisionBox=function(i,t,e,r){var o=this.projectAndGetPerspectiveRatio(r,i.anchorPointX,i.anchorPointY),n=e*o.perspectiveRatio,a=i.x1/n+o.point.x,s=i.y1/n+o.point.y,c=i.x2/n+o.point.x,l=i.y2/n+o.point.y;return!t&&this.grid.hitTest(a,s,c,l)?[]:[a,s,c,l]},CollisionIndex.prototype.approximateTileDistance=function(i,t,e,r,o){var n=o?1:r/this.pitchfactor,a=i.lastSegmentViewportDistance*e;return i.prevTileDistance+a+(n-1)*a*Math.abs(Math.sin(t))},CollisionIndex.prototype.placeCollisionCircles=function(i,t,e,r,o,n,a,s,c,l,p,h,d){var x=this,g=[],f=this.projectAnchor(l,n.anchorX,n.anchorY),v={},u=c/24,m=n.lineOffsetX*c,y=n.lineOffsetY*c,C=new Point(n.anchorX,n.anchorY),P=projection.project(C,p).point,I=projection.placeFirstAndLastGlyph(u,s,m,y,!1,P,C,n,a,p,v,!0),w=!1,D=f.perspectiveRatio*r,j=D/e,T=0,G=0;I&&(T=this.approximateTileDistance(I.first.tileDistance,I.first.angle,j,f.cameraDistance,d),G=this.approximateTileDistance(I.last.tileDistance,I.last.angle,j,f.cameraDistance,d));for(var M=0;M<i.length;M+=5){var b=i[M],R=i[M+1],q=i[M+2],k=i[M+3];if(!I||k<-T||k>G)markCollisionCircleUsed(i,M,!1);else{var A=x.projectPoint(l,b,R),X=q/D;if(g.length>0){var Y=A.x-g[g.length-4],L=A.y-g[g.length-3];if(X*X*2>Y*Y+L*L){if(M+8<i.length){var U=i[M+8];if(U>-T&&U<G){markCollisionCircleUsed(i,M,!1);continue}}}}var _=M/5;if(g.push(A.x,A.y,X,_),markCollisionCircleUsed(i,M,!0),!t&&x.grid.hitTestCircle(A.x,A.y,X)){if(!h)return[];w=!0}}}return w?[]:g},CollisionIndex.prototype.queryRenderedSymbols=function(i,t,e,r,o,n){var a=this,s={},c=[];if(0===i.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return c;for(var l=this.transform.calculatePosMatrix(t,e),p=[],h=1/0,d=1/0,x=-1/0,g=-1/0,f=0;f<i.length;f++)for(var v=i[f],u=0;u<v.length;u++){var m=a.projectPoint(l,v[u].x,v[u].y);h=Math.min(h,m.x),d=Math.min(d,m.y),x=Math.max(x,m.x),g=Math.max(g,m.y),p.push(m)}for(var y=t.id,C=[],P=this.grid.query(h,d,x,g),I=0;I<P.length;I++)P[I].sourceID===n&&P[I].tileID===y&&C.push(P[I].boxIndex);for(var w=this.ignoredGrid.query(h,d,x,g),D=0;D<w.length;D++)w[D].sourceID===n&&w[D].tileID===y&&C.push(w[D].boxIndex);for(var j=0;j<C.length;j++){var T=o.get(C[j]),G=T.sourceLayerIndex,M=T.featureIndex,b=T.bucketIndex;if(void 0===s[G]&&(s[G]={}),void 0===s[G][M]&&(s[G][M]={}),!s[G][M][b]){var R=a.projectAndGetPerspectiveRatio(l,T.anchorPointX,T.anchorPointY),q=r*R.perspectiveRatio,k=T.x1/q+R.point.x,A=T.y1/q+R.point.y,X=T.x2/q+R.point.x,Y=T.y2/q+R.point.y,L=[new Point(k,A),new Point(X,A),new Point(X,Y),new Point(k,Y)];intersectionTests.polygonIntersectsPolygon(p,L)&&(s[G][M][b]=!0,c.push(C[j]))}}return c},CollisionIndex.prototype.insertCollisionBox=function(i,t,e,r,o){var n=t?this.ignoredGrid:this.grid,a={tileID:e,sourceID:r,boxIndex:o};n.insert(a,i[0],i[1],i[2],i[3])},CollisionIndex.prototype.insertCollisionCircles=function(i,t,e,r,o){for(var n=t?this.ignoredGrid:this.grid,a=0;a<i.length;a+=4){var s={tileID:e,sourceID:r,boxIndex:o+i[a+3]};n.insertCircle(s,i[a],i[a+1],i[a+2])}},CollisionIndex.prototype.projectAnchor=function(i,t,e){var r=[t,e,0,1];return projection.xyTransformMat4(r,r,i),{perspectiveRatio:.5+r[3]/this.transform.cameraToCenterDistance*.5,cameraDistance:r[3]}},CollisionIndex.prototype.projectPoint=function(i,t,e){var r=[t,e,0,1];return projection.xyTransformMat4(r,r,i),new Point((r[0]/r[3]+1)/2*this.transform.width+viewportPadding,(-r[1]/r[3]+1)/2*this.transform.height+viewportPadding)},CollisionIndex.prototype.projectAndGetPerspectiveRatio=function(i,t,e){var r=[t,e,0,1];return projection.xyTransformMat4(r,r,i),{point:new Point((r[0]/r[3]+1)/2*this.transform.width+viewportPadding,(-r[1]/r[3]+1)/2*this.transform.height+viewportPadding),perspectiveRatio:.5+r[3]/this.transform.cameraToCenterDistance*.5}},module.exports=CollisionIndex;
-},{"../symbol/projection":216,"../util/intersection_tests":257,"./grid_index":213,"@mapbox/gl-matrix":1,"@mapbox/point-geometry":2}],211:[function(_dereq_,module,exports){
-"use strict";var EXTENT=_dereq_("../data/extent"),OpacityState=_dereq_("./opacity_state"),roundingFactor=512/EXTENT/2,TileLayerIndex=function(e,t,i){var o=this;this.coord=e,this.sourceMaxZoom=t,this.symbolInstances={};for(var a=0,n=i;a<n.length;a+=1){var s=n[a],r=s.key;o.symbolInstances[r]||(o.symbolInstances[r]=[]),o.symbolInstances[r].push({instance:s,coordinates:o.getScaledCoordinates(s,e)}),s.isDuplicate=!1,s.textOpacityState=new OpacityState,s.iconOpacityState=new OpacityState}};TileLayerIndex.prototype.getScaledCoordinates=function(e,t){var i=Math.min(this.sourceMaxZoom,t.z)-Math.min(this.sourceMaxZoom,this.coord.z),o=roundingFactor/(1<<i),a=e.anchor;return{x:Math.floor((t.x*EXTENT+a.x)*o),y:Math.floor((t.y*EXTENT+a.y)*o)}},TileLayerIndex.prototype.getMatchingSymbol=function(e,t){var i=this;if(this.symbolInstances[e.key])for(var o=this.getScaledCoordinates(e,t),a=0,n=i.symbolInstances[e.key];a<n.length;a+=1){var s=n[a];if(Math.abs(s.coordinates.x-o.x)<=1&&Math.abs(s.coordinates.y-o.y)<=1)return s.instance}},TileLayerIndex.prototype.forEachSymbolInstance=function(e){var t=this;for(var i in t.symbolInstances)for(var o=t.symbolInstances[i],a=0,n=o;a<n.length;a+=1){var s=n[a];e(s.instance)}};var CrossTileSymbolLayerIndex=function(){this.indexes={}};CrossTileSymbolLayerIndex.prototype.addTile=function(e,t,i){var o=this,a=25,n=0;for(var s in o.indexes)a=Math.min(s,a),n=Math.max(s,n);for(var r=new TileLayerIndex(e,t,i),c=n;c>e.z;c--){var l=o.indexes[c];for(var d in l){var y=l[d];y.coord.isChildOf(e,t)&&o.blockLabels(y,r,!1)}}var h=this.indexes[e.z]&&this.indexes[e.z][e.id];h&&(this.blockLabels(r,h,!0),this.removeTile(e,t));for(var x=e.z-1;x>=a;x--){var p=e.scaledTo(x,t),b=o.indexes[x]&&o.indexes[x][p.id];b&&o.blockLabels(r,b,!0)}void 0===this.indexes[e.z]&&(this.indexes[e.z]={}),this.indexes[e.z][e.id]=r},CrossTileSymbolLayerIndex.prototype.removeTile=function(e,t){var i=this,o=this.indexes[e.z][e.id];delete this.indexes[e.z][e.id],0===Object.keys(this.indexes[e.z]).length&&delete this.indexes[e.z];for(var a=Math.min.apply(Math,[25].concat(Object.keys(this.indexes))),n=e,s=e.z-1;s>=a&&(n=n.parent(t));s--){var r=i.indexes[s]&&i.indexes[s][n.id];r&&i.unblockLabels(o,r)}},CrossTileSymbolLayerIndex.prototype.blockLabels=function(e,t,i){e.forEachSymbolInstance(function(o){if(!o.isDuplicate){var a=t.getMatchingSymbol(o,e.coord);void 0!==a&&(a.isDuplicate||(a.isDuplicate=!0,i&&(o.textOpacityState=a.textOpacityState.clone(),o.iconOpacityState=a.iconOpacityState.clone())))}})},CrossTileSymbolLayerIndex.prototype.unblockLabels=function(e,t){e.forEachSymbolInstance(function(i){if(!i.isDuplicate){var o=t.getMatchingSymbol(i,e.coord);void 0!==o&&(o.isDuplicate=!1,o.textOpacityState=i.textOpacityState.clone(),o.iconOpacityState=i.iconOpacityState.clone(),i.isDuplicate=!0)}})};var CrossTileSymbolIndex=function(){this.layerIndexes={}};CrossTileSymbolIndex.prototype.addTileLayer=function(e,t,i,o){var a=this.layerIndexes[e];void 0===a&&(a=this.layerIndexes[e]=new CrossTileSymbolLayerIndex),a.addTile(t,i,o)},CrossTileSymbolIndex.prototype.removeTileLayer=function(e,t,i){var o=this.layerIndexes[e];void 0!==o&&o.removeTile(t,i)},module.exports=CrossTileSymbolIndex;
-},{"../data/extent":58,"./opacity_state":215}],212:[function(_dereq_,module,exports){
-"use strict";function getAnchors(e,r,t,n,a,l,o,i,c){var h=n?.6*l*o:0,s=Math.max(n?n.right-n.left:0,a?a.right-a.left:0),u=0===e[0].x||e[0].x===c||0===e[0].y||e[0].y===c;r-s*o<r/4&&(r=s*o+r/4);var g=2*l;return resample(e,u?r/2*i%r:(s/2+g)*o*i%r,r,h,t,s*o,u,!1,c)}function resample(e,r,t,n,a,l,o,i,c){for(var h=l/2,s=0,u=0;u<e.length-1;u++)s+=e[u].dist(e[u+1]);for(var g=0,p=r-t,x=[],f=0;f<e.length-1;f++){for(var m=e[f],v=e[f+1],y=m.dist(v),A=v.angleTo(m);p+t<g+y;){p+=t;var d=(p-g)/y,k=interpolate(m.x,v.x,d),q=interpolate(m.y,v.y,d);if(k>=0&&k<c&&q>=0&&q<c&&p-h>=0&&p+h<=s){var M=new Anchor(k,q,A,f);M._round(),n&&!checkMaxAngle(e,M,l,n,a)||x.push(M)}}g+=y}return i||x.length||o||(x=resample(e,g/2,t,n,a,l,o,!0,c)),x}var interpolate=_dereq_("../style-spec/util/interpolate").number,Anchor=_dereq_("../symbol/anchor"),checkMaxAngle=_dereq_("./check_max_angle");module.exports=getAnchors;
-},{"../style-spec/util/interpolate":154,"../symbol/anchor":205,"./check_max_angle":206}],213:[function(_dereq_,module,exports){
-"use strict";var GridIndex=function(e,t,i){var r=this.boxCells=[],s=this.circleCells=[];this.xCellCount=Math.ceil(e/i),this.yCellCount=Math.ceil(t/i);for(var l=0;l<this.xCellCount*this.yCellCount;l++)r.push([]),s.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};GridIndex.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},GridIndex.prototype.insert=function(e,t,i,r,s){this._forEachCell(t,i,r,s,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(s)},GridIndex.prototype.insertCircle=function(e,t,i,r){this._forEachCell(t-r,i-r,t+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(i),this.circles.push(r)},GridIndex.prototype._insertBoxCell=function(e,t,i,r,s,l){this.boxCells[s].push(l)},GridIndex.prototype._insertCircleCell=function(e,t,i,r,s,l){this.circleCells[s].push(l)},GridIndex.prototype._query=function(e,t,i,r,s){if(i<0||e>this.width||r<0||t>this.height)return!s&&[];var l=[];if(e<=0&&t<=0&&this.width<=i&&this.height<=r)l=Array.prototype.slice.call(this.boxKeys).concat(this.circleKeys);else{var o={hitTest:s,seenUids:{box:{},circle:{}}};this._forEachCell(e,t,i,r,this._queryCell,l,o)}return s?l.length>0:l},GridIndex.prototype._queryCircle=function(e,t,i,r){var s=e-i,l=e+i,o=t-i,h=t+i;if(l<0||s>this.width||h<0||o>this.height)return!r&&[];var n=[],c={hitTest:r,circle:{x:e,y:t,radius:i},seenUids:{box:{},circle:{}}};return this._forEachCell(s,o,l,h,this._queryCellCircle,n,c),r?n.length>0:n},GridIndex.prototype.query=function(e,t,i,r){return this._query(e,t,i,r,!1)},GridIndex.prototype.hitTest=function(e,t,i,r){return this._query(e,t,i,r,!0)},GridIndex.prototype.hitTestCircle=function(e,t,i){return this._queryCircle(e,t,i,!0)},GridIndex.prototype._queryCell=function(e,t,i,r,s,l,o){var h=this,n=o.seenUids,c=this.boxCells[s];if(null!==c)for(var u=this.bboxes,d=0,C=c;d<C.length;d+=1){var a=C[d];if(!n.box[a]){n.box[a]=!0;var x=4*a;if(e<=u[x+2]&&t<=u[x+3]&&i>=u[x+0]&&r>=u[x+1]){if(o.hitTest)return l.push(!0),!0;l.push(h.boxKeys[a])}}}var p=this.circleCells[s];if(null!==p)for(var f=this.circles,y=0,v=p;y<v.length;y+=1){var b=v[y];if(!n.circle[b]){n.circle[b]=!0;var _=3*b;if(h._circleAndRectCollide(f[_],f[_+1],f[_+2],e,t,i,r)){if(o.hitTest)return l.push(!0),!0;l.push(h.circleKeys[b])}}}},GridIndex.prototype._queryCellCircle=function(e,t,i,r,s,l,o){var h=this,n=o.circle,c=o.seenUids,u=this.boxCells[s];if(null!==u)for(var d=this.bboxes,C=0,a=u;C<a.length;C+=1){var x=a[C];if(!c.box[x]){c.box[x]=!0;var p=4*x;if(h._circleAndRectCollide(n.x,n.y,n.radius,d[p+0],d[p+1],d[p+2],d[p+3]))return l.push(!0),!0}}var f=this.circleCells[s];if(null!==f)for(var y=this.circles,v=0,b=f;v<b.length;v+=1){var _=b[v];if(!c.circle[_]){c.circle[_]=!0;var G=3*_;if(h._circlesCollide(y[G],y[G+1],y[G+2],n.x,n.y,n.radius))return l.push(!0),!0}}},GridIndex.prototype._forEachCell=function(e,t,i,r,s,l,o){for(var h=this,n=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(i),d=this._convertToYCellCoord(r),C=n;C<=u;C++)for(var a=c;a<=d;a++){var x=h.xCellCount*a+C;if(s.call(h,e,t,i,r,x,l,o))return}},GridIndex.prototype._convertToXCellCoord=function(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))},GridIndex.prototype._convertToYCellCoord=function(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))},GridIndex.prototype._circlesCollide=function(e,t,i,r,s,l){var o=r-e,h=s-t,n=i+l;return n*n>o*o+h*h},GridIndex.prototype._circleAndRectCollide=function(e,t,i,r,s,l,o){var h=(l-r)/2,n=Math.abs(e-(r+h));if(n>h+i)return!1;var c=(o-s)/2,u=Math.abs(t-(s+c));if(u>c+i)return!1;if(n<=h||u<=c)return!0;var d=n-h,C=u-c;return d*d+C*C<=i*i},module.exports=GridIndex;
-},{}],214:[function(_dereq_,module,exports){
-"use strict";module.exports=function(e){function t(t){g.push(e[t]),l++}function r(e,t,r){var n=u[e];return delete u[e],u[t]=n,g[n].geometry[0].pop(),g[n].geometry[0]=g[n].geometry[0].concat(r[0]),n}function n(e,t,r){var n=i[t];return delete i[t],i[e]=n,g[n].geometry[0].shift(),g[n].geometry[0]=r[0].concat(g[n].geometry[0]),n}function o(e,t,r){var n=r?t[0][t[0].length-1]:t[0][0];return e+":"+n.x+":"+n.y}for(var i={},u={},g=[],l=0,m=0;m<e.length;m++){var y=e[m],c=y.geometry,f=y.text;if(f){var a=o(f,c),s=o(f,c,!0);if(a in u&&s in i&&u[a]!==i[s]){var v=n(a,s,c),d=r(a,s,g[v].geometry);delete i[a],delete u[s],u[o(f,g[d].geometry,!0)]=d,g[v].geometry=null}else a in u?r(a,s,c):s in i?n(a,s,c):(t(m),i[a]=l-1,u[s]=l-1)}else t(m)}return g.filter(function(e){return e.geometry})};
-},{}],215:[function(_dereq_,module,exports){
-"use strict";var OpacityState=function(){this.opacity=0,this.targetOpacity=0,this.time=0};OpacityState.prototype.clone=function(){var t=new OpacityState;return t.opacity=this.opacity,t.targetOpacity=this.targetOpacity,t.time=this.time,t},module.exports=OpacityState;
-},{}],216:[function(_dereq_,module,exports){
-"use strict";function getLabelPlaneMatrix(e,t,r,a,n){var i=mat4.identity(new Float32Array(16));return t?(mat4.identity(i),mat4.scale(i,i,[1/n,1/n,1]),r||mat4.rotateZ(i,i,a.angle)):(mat4.scale(i,i,[a.width/2,-a.height/2,1]),mat4.translate(i,i,[1,-1,0]),mat4.multiply(i,i,e)),i}function getGlCoordMatrix(e,t,r,a,n){var i=mat4.identity(new Float32Array(16));return t?(mat4.multiply(i,i,e),mat4.scale(i,i,[n,n,1]),r||mat4.rotateZ(i,i,-a.angle)):(mat4.scale(i,i,[1,-1,1]),mat4.translate(i,i,[-1,-1,0]),mat4.scale(i,i,[2/a.width,2/a.height,1])),i}function project(e,t){var r=[e.x,e.y,0,1];xyTransformMat4(r,r,t);var a=r[3];return{point:new Point(r[0]/a,r[1]/a),signedDistanceFromCamera:a}}function isVisible(e,t){var r=e[0]/e[3],a=e[1]/e[3];return r>=-t[0]&&r<=t[0]&&a>=-t[1]&&a<=t[1]}function updateLineLabels(e,t,r,a,n,i,o,l){var s=a?e.textSizeData:e.iconSizeData,p=symbolSize.evaluateSizeForZoom(s,r.transform.zoom,symbolLayoutProperties.properties[a?"text-size":"icon-size"]),u=[256/r.width*2+1,256/r.height*2+1],y=a?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;y.clear();for(var c=e.lineVertexArray,d=a?e.placedGlyphArray:e.placedIconArray,m=r.transform.width/r.transform.height,g=!1,h=0;h<d.length;h++){var f=d.get(h);if(f.hidden||f.writingMode===WritingMode.vertical&&!g)hideGlyphs(f.numGlyphs,y);else{g=!1;var x=[f.anchorX,f.anchorY,0,1];if(vec4.transformMat4(x,x,t),isVisible(x,u)){var v=x[3],L=.5+v/r.transform.cameraToCenterDistance*.5,b=symbolSize.evaluateSizeForFeature(s,p,f),A=o?b*L:b/L,G=new Point(f.anchorX,f.anchorY),M=project(G,n).point,S={},w=placeGlyphsAlongLine(f,A,!1,l,t,n,i,e.glyphOffsetArray,c,y,M,G,S,m);g=w.useVertical,(w.notEnoughRoom||g||w.needsFlipping&&placeGlyphsAlongLine(f,A,!0,l,t,n,i,e.glyphOffsetArray,c,y,M,G,S,m).notEnoughRoom)&&hideGlyphs(f.numGlyphs,y)}else hideGlyphs(f.numGlyphs,y)}}a?e.text.dynamicLayoutVertexBuffer.updateData(y.serialize()):e.icon.dynamicLayoutVertexBuffer.updateData(y.serialize())}function placeFirstAndLastGlyph(e,t,r,a,n,i,o,l,s,p,u,y){var c=l.glyphStartIndex+l.numGlyphs,d=l.lineStartIndex,m=l.lineStartIndex+l.lineLength,g=t.getoffsetX(l.glyphStartIndex),h=t.getoffsetX(c-1),f=placeGlyphAlongLine(e*g,r,a,n,i,o,l.segment,d,m,s,p,u,y);if(!f)return null;var x=placeGlyphAlongLine(e*h,r,a,n,i,o,l.segment,d,m,s,p,u,y);return x?{first:f,last:x}:null}function requiresOrientationChange(e,t,r,a){if(e===WritingMode.horizontal){if(Math.abs(r.y-t.y)>Math.abs(r.x-t.x)*a)return{useVertical:!0}}return(e===WritingMode.vertical?t.y<r.y:t.x>r.x)?{needsFlipping:!0}:null}function placeGlyphsAlongLine(e,t,r,a,n,i,o,l,s,p,u,y,c,d){var m,g=t/24,h=e.lineOffsetX*t,f=e.lineOffsetY*t;if(e.numGlyphs>1){var x=e.glyphStartIndex+e.numGlyphs,v=e.lineStartIndex,L=e.lineStartIndex+e.lineLength,b=placeFirstAndLastGlyph(g,l,h,f,r,u,y,e,s,i,c,!1);if(!b)return{notEnoughRoom:!0};var A=project(b.first.point,o).point,G=project(b.last.point,o).point;if(a&&!r){var M=requiresOrientationChange(e.writingMode,A,G,d);if(M)return M}m=[b.first];for(var S=e.glyphStartIndex+1;S<x-1;S++)m.push(placeGlyphAlongLine(g*l.getoffsetX(S),h,f,r,u,y,e.segment,v,L,s,i,c,!1));m.push(b.last)}else{if(a&&!r){var w=project(y,n).point,F=e.lineStartIndex+e.segment+1,z=new Point(s.getx(F),s.gety(F)),D=project(z,n),I=D.signedDistanceFromCamera>0?D.point:projectTruncatedLineSegment(y,z,w,1,n),j=requiresOrientationChange(e.writingMode,w,I,d);if(j)return j}var P=placeGlyphAlongLine(g*l.getoffsetX(e.glyphStartIndex),h,f,r,u,y,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,s,i,c,!1);if(!P)return{notEnoughRoom:!0};m=[P]}for(var _=0,C=m;_<C.length;_+=1){var V=C[_];addDynamicAttributes(p,V.point,V.angle)}return{}}function projectTruncatedLineSegment(e,t,r,a,n){var i=project(e.add(e.sub(t)._unit()),n).point,o=r.sub(i);return r.add(o._mult(a/o.mag()))}function placeGlyphAlongLine(e,t,r,a,n,i,o,l,s,p,u,y,c){var d=a?e-t:e+t,m=d>0?1:-1,g=0;a&&(m*=-1,g=Math.PI),m<0&&(g+=Math.PI);for(var h=m>0?l+o:l+o+1,f=h,x=n,v=n,L=0,b=0,A=Math.abs(d);L+b<=A;){if((h+=m)<l||h>=s)return null;if(v=x,void 0===(x=y[h])){var G=new Point(p.getx(h),p.gety(h)),M=project(G,u);if(M.signedDistanceFromCamera>0)x=y[h]=M.point;else{var S=h-m;x=projectTruncatedLineSegment(0===L?i:new Point(p.getx(S),p.gety(S)),G,v,A-L+1,u)}}L+=b,b=v.dist(x)}var w=(A-L)/b,F=x.sub(v),z=F.mult(w)._add(v);return z._add(F._unit()._perp()._mult(r*m)),{point:z,angle:g+Math.atan2(x.y-v.y,x.x-v.x),tileDistance:c?{prevTileDistance:h-m===f?0:p.gettileUnitDistanceFromAnchor(h-m),lastSegmentViewportDistance:A-L}:null}}function hideGlyphs(e,t){for(var r=0;r<e;r++){var a=t.length;t.resize(a+4),t.float32.set(hiddenGlyphAttributes,3*a)}}function xyTransformMat4(e,t,r){var a=t[0],n=t[1];return e[0]=r[0]*a+r[4]*n+r[12],e[1]=r[1]*a+r[5]*n+r[13],e[3]=r[3]*a+r[7]*n+r[15],e}var Point=_dereq_("@mapbox/point-geometry"),ref=_dereq_("@mapbox/gl-matrix"),mat4=ref.mat4,vec4=ref.vec4,symbolSize=_dereq_("./symbol_size"),ref$1=_dereq_("../data/bucket/symbol_bucket"),addDynamicAttributes=ref$1.addDynamicAttributes,symbolLayoutProperties=_dereq_("../style/style_layer/symbol_style_layer_properties").layout,WritingMode=_dereq_("../symbol/shaping").WritingMode;module.exports={updateLineLabels:updateLineLabels,getLabelPlaneMatrix:getLabelPlaneMatrix,getGlCoordMatrix:getGlCoordMatrix,project:project,placeFirstAndLastGlyph:placeFirstAndLastGlyph,xyTransformMat4:xyTransformMat4};var hiddenGlyphAttributes=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);
-},{"../data/bucket/symbol_bucket":57,"../style/style_layer/symbol_style_layer_properties":202,"../symbol/shaping":218,"./symbol_size":221,"@mapbox/gl-matrix":1,"@mapbox/point-geometry":2}],217:[function(_dereq_,module,exports){
-"use strict";function getIconQuads(t,e,i,o,n,a,r){var u,l,g,d,f=e.image,c=i.layout,h=e.top-1/f.pixelRatio,x=e.left-1/f.pixelRatio,p=e.bottom+1/f.pixelRatio,s=e.right+1/f.pixelRatio;if("none"!==c.get("icon-text-fit")&&n){var P=s-x,_=p-h,w=c.get("text-size").evaluate(r)/24,m=n.left*w,v=n.right*w,y=n.top*w,M=n.bottom*w,R=v-m,b=M-y,G=c.get("icon-text-fit-padding")[0],B=c.get("icon-text-fit-padding")[1],I=c.get("icon-text-fit-padding")[2],Q=c.get("icon-text-fit-padding")[3],O="width"===c.get("icon-text-fit")?.5*(b-_):0,A="height"===c.get("icon-text-fit")?.5*(R-P):0,D="width"===c.get("icon-text-fit")||"both"===c.get("icon-text-fit")?R:P,E="height"===c.get("icon-text-fit")||"both"===c.get("icon-text-fit")?b:_;u=new Point(m+A-Q,y+O-G),l=new Point(m+A+B+D,y+O-G),g=new Point(m+A+B+D,y+O+I+E),d=new Point(m+A-Q,y+O+I+E)}else u=new Point(x,h),l=new Point(s,h),g=new Point(s,p),d=new Point(x,p);var F=i.layout.get("icon-rotate").evaluate(r)*Math.PI/180;if(F){var H=Math.sin(F),L=Math.cos(F),Y=[L,-H,H,L];u._matMult(Y),l._matMult(Y),d._matMult(Y),g._matMult(Y)}return[{tl:u,tr:l,bl:d,br:g,tex:{x:f.textureRect.x-1,y:f.textureRect.y-1,w:f.textureRect.w+2,h:f.textureRect.h+2},writingMode:void 0,glyphOffset:[0,0]}]}function getGlyphQuads(t,e,i,o,n,a,r){for(var u=i.layout.get("text-rotate").evaluate(a)*Math.PI/180,l=i.layout.get("text-offset").evaluate(a).map(function(t){return 24*t}),g=e.positionedGlyphs,d=[],f=0;f<g.length;f++){var c=g[f],h=r[c.glyph];if(h){var x=h.rect;if(x){var p=GLYPH_PBF_BORDER+1,s=h.metrics.advance/2,P=o?[c.x+s,c.y]:[0,0],_=o?[0,0]:[c.x+s+l[0],c.y+l[1]],w=h.metrics.left-p-s+_[0],m=-h.metrics.top-p+_[1],v=w+x.w,y=m+x.h,M=new Point(w,m),R=new Point(v,m),b=new Point(w,y),G=new Point(v,y);if(o&&c.vertical){var B=new Point(-s,s),I=-Math.PI/2,Q=new Point(5,0);M._rotateAround(I,B)._add(Q),R._rotateAround(I,B)._add(Q),b._rotateAround(I,B)._add(Q),G._rotateAround(I,B)._add(Q)}if(u){var O=Math.sin(u),A=Math.cos(u),D=[A,-O,O,A];M._matMult(D),R._matMult(D),b._matMult(D),G._matMult(D)}d.push({tl:M,tr:R,bl:b,br:G,tex:x,writingMode:e.writingMode,glyphOffset:P})}}}return d}var Point=_dereq_("@mapbox/point-geometry"),ref=_dereq_("../style/parse_glyph_pbf"),GLYPH_PBF_BORDER=ref.GLYPH_PBF_BORDER;module.exports={getIconQuads:getIconQuads,getGlyphQuads:getGlyphQuads};
-},{"../style/parse_glyph_pbf":181,"@mapbox/point-geometry":2}],218:[function(_dereq_,module,exports){
-"use strict";function breakLines(e,t){for(var a=[],r=0,i=0,n=t;i<n.length;i+=1){var l=n[i];a.push(e.substring(r,l)),r=l}return r<e.length&&a.push(e.substring(r,e.length)),a}function shapeText(e,t,a,r,i,n,l,o,c,s){var h=e.trim();s===WritingMode.vertical&&(h=verticalizePunctuation(h));var g,u=[],p={positionedGlyphs:u,text:h,top:o[1],bottom:o[1],left:o[0],right:o[0],writingMode:s},b=rtlTextPlugin.processBidirectionalText;return g=b?b(h,determineLineBreaks(h,l,a,t)):breakLines(h,determineLineBreaks(h,l,a,t)),shapeLines(p,t,g,r,i,n,s,l,c),!!u.length&&p}function determineAverageLineWidth(e,t,a,r){for(var i=0,n=0;n<e.length;n++){var l=r[e.charCodeAt(n)];l&&(i+=l.metrics.advance+t)}return i/Math.max(1,Math.ceil(i/a))}function calculateBadness(e,t,a,r){var i=Math.pow(e-t,2);return r?e<t?i/2:2*i:i+Math.abs(a)*a}function calculatePenalty(e,t){var a=0;return 10===e&&(a-=1e4),40!==e&&65288!==e||(a+=50),41!==t&&65289!==t||(a+=50),a}function evaluateBreak(e,t,a,r,i,n){for(var l=null,o=calculateBadness(t,a,i,n),c=0,s=r;c<s.length;c+=1){var h=s[c],g=t-h.x,u=calculateBadness(g,a,i,n)+h.badness;u<=o&&(l=h,o=u)}return{index:e,x:t,priorBreak:l,badness:o}}function leastBadBreaks(e){return e?leastBadBreaks(e.priorBreak).concat(e.index):[]}function determineLineBreaks(e,t,a,r){if(!a)return[];if(!e)return[];for(var i=[],n=determineAverageLineWidth(e,t,a,r),l=0,o=0;o<e.length;o++){var c=e.charCodeAt(o),s=r[c];s&&!whitespace[c]&&(l+=s.metrics.advance+t),o<e.length-1&&(breakable[c]||scriptDetection.charAllowsIdeographicBreaking(c))&&i.push(evaluateBreak(o+1,l,n,i,calculatePenalty(c,e.charCodeAt(o+1)),!1))}return leastBadBreaks(evaluateBreak(e.length,l,n,i,0,!0))}function getAnchorAlignment(e){var t=.5,a=.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":a=1;break;case"top":case"top-right":case"top-left":a=0}return{horizontalAlign:t,verticalAlign:a}}function shapeLines(e,t,a,r,i,n,l,o,c){for(var s=0,h=-17,g=0,u=e.positionedGlyphs,p="right"===n?1:"left"===n?0:.5,b=0,v=a;b<v.length;b+=1){var d=v[b];if(d=d.trim(),d.length){for(var f=u.length,k=0;k<d.length;k++){var m=d.charCodeAt(k),x=t[m];x&&(scriptDetection.charHasUprightVerticalOrientation(m)&&l!==WritingMode.horizontal?(u.push({glyph:m,x:s,y:0,vertical:!0}),s+=c+o):(u.push({glyph:m,x:s,y:h,vertical:!1}),s+=x.metrics.advance+o))}if(u.length!==f){var A=s-o;g=Math.max(A,g),justifyLine(u,t,f,u.length-1,p)}s=0,h+=r}else h+=r}var B=getAnchorAlignment(i),y=B.horizontalAlign,w=B.verticalAlign;align(u,p,y,w,g,r,a.length);var z=a.length*r;e.top+=-w*z,e.bottom=e.top+z,e.left+=-y*g,e.right=e.left+g}function justifyLine(e,t,a,r,i){if(i){var n=t[e[r].glyph];if(n)for(var l=n.metrics.advance,o=(e[r].x+l)*i,c=a;c<=r;c++)e[c].x-=o}}function align(e,t,a,r,i,n,l){for(var o=(t-a)*i,c=(-r*l+.5)*n,s=0;s<e.length;s++)e[s].x+=o,e[s].y+=c}function shapeIcon(e,t,a){var r=getAnchorAlignment(a),i=r.horizontalAlign,n=r.verticalAlign,l=t[0],o=t[1],c=l-e.displaySize[0]*i,s=c+e.displaySize[0],h=o-e.displaySize[1]*n;return{image:e,top:h,bottom:h+e.displaySize[1],left:c,right:s}}var scriptDetection=_dereq_("../util/script_detection"),verticalizePunctuation=_dereq_("../util/verticalize_punctuation"),rtlTextPlugin=_dereq_("../source/rtl_text_plugin"),WritingMode={horizontal:1,vertical:2,horizontalOnly:3};module.exports={shapeText:shapeText,shapeIcon:shapeIcon,WritingMode:WritingMode};var whitespace={};whitespace[9]=!0,whitespace[10]=!0,whitespace[11]=!0,whitespace[12]=!0,whitespace[13]=!0,whitespace[32]=!0;var breakable={};breakable[10]=!0,breakable[32]=!0,breakable[38]=!0,breakable[40]=!0,breakable[41]=!0,breakable[43]=!0,breakable[45]=!0,breakable[47]=!0,breakable[173]=!0,breakable[183]=!0,breakable[8203]=!0,breakable[8208]=!0,breakable[8211]=!0,breakable[8231]=!0;
-},{"../source/rtl_text_plugin":107,"../util/script_detection":261,"../util/verticalize_punctuation":268}],219:[function(_dereq_,module,exports){
-"use strict";function performSymbolLayout(e,t,i,o,a,n){e.createArrays(),e.symbolInstances=[];var r=512*e.overscaling;e.tilePixelRatio=EXTENT/r,e.compareText={},e.iconsNeedLinear=!1;for(var l=e.layers[0].layout,c=24*l.get("text-line-height"),s=l.get("text-font").join(","),u="map"===l.get("text-rotation-alignment")&&"line"===l.get("symbol-placement"),g=l.get("text-keep-upright"),x=t[s]||{},y=i[s]||{},d=0,p=e.features;d<p.length;d+=1){var f=p[d],h={},m=f.text;if(m){var v=scriptDetection.allowsVerticalWritingMode(m),S=l.get("text-offset").evaluate(f).map(function(e){return 24*e}),b=24*l.get("text-letter-spacing").evaluate(f),T=scriptDetection.allowsLetterSpacing(m)?b:0,I=l.get("text-anchor").evaluate(f),z=l.get("text-justify").evaluate(f),A="line"!==l.get("symbol-placement")?24*l.get("text-max-width").evaluate(f):0;h.horizontal=shapeText(m,x,A,c,I,z,T,S,24,WritingMode.horizontal),v&&u&&g&&(h.vertical=shapeText(m,x,A,c,I,z,T,S,24,WritingMode.vertical))}var E=void 0;if(f.icon){var q=o[f.icon];q&&(E=shapeIcon(a[f.icon],l.get("icon-offset").evaluate(f),l.get("icon-anchor").evaluate(f)),void 0===e.sdfIcons?e.sdfIcons=q.sdf:e.sdfIcons!==q.sdf&&util.warnOnce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),q.pixelRatio!==e.pixelRatio?e.iconsNeedLinear=!0:0!==l.get("icon-rotate").constantOr(1)&&(e.iconsNeedLinear=!0))}(h.horizontal||E)&&addFeature(e,f,h,E,y)}n&&e.generateCollisionDebugBuffers()}function addFeature(e,t,i,o,a){var n=e.layoutTextSize.evaluate(t),r=e.layoutIconSize.evaluate(t),l=e.textMaxSize.evaluate(t);void 0===l&&(l=n);var c=e.layers[0].layout,s=c.get("text-offset").evaluate(t),u=c.get("icon-offset").evaluate(t),g=n/24,x=e.tilePixelRatio*g,y=e.tilePixelRatio*l/24,d=e.tilePixelRatio*r,p=e.tilePixelRatio*c.get("symbol-spacing"),f=c.get("text-padding")*e.tilePixelRatio,h=c.get("icon-padding")*e.tilePixelRatio,m=c.get("text-max-angle")/180*Math.PI,v="map"===c.get("text-rotation-alignment")&&"line"===c.get("symbol-placement"),S="map"===c.get("icon-rotation-alignment")&&"line"===c.get("symbol-placement"),b=c.get("symbol-placement"),T=p/2,I=function(n,r){r.x<0||r.x>=EXTENT||r.y<0||r.y>=EXTENT||e.symbolInstances.push(addSymbol(e,r,n,i,o,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,x,f,v,s,d,h,S,u,{zoom:e.zoom},t,a))};if("line"===b)for(var z=0,A=clipLine(t.geometry,0,0,EXTENT,EXTENT);z<A.length;z+=1)for(var E=A[z],q=getAnchors(E,p,m,i.vertical||i.horizontal,o,24,y,e.overscaling,EXTENT),L=0,O=q;L<O.length;L+=1){var P=O[L],w=i.horizontal;w&&anchorIsTooClose(e,w.text,T,P)||I(E,P)}else if("Polygon"===t.type)for(var B=0,M=classifyRings(t.geometry,0);B<M.length;B+=1){var R=M[B],_=findPoleOfInaccessibility(R,16);I(R[0],new Anchor(_.x,_.y,0))}else if("LineString"===t.type)for(var N=0,D=t.geometry;N<D.length;N+=1){var V=D[N];I(V,new Anchor(V[0].x,V[0].y,0))}else if("Point"===t.type)for(var G=0,W=t.geometry;G<W.length;G+=1)for(var X=W[G],C=0,F=X;C<F.length;C+=1){var k=F[C];I([k],new Anchor(k.x,k.y,0))}}function addTextVertices(e,t,i,o,a,n,r,l,c,s,u,g){var x=getGlyphQuads(t,i,o,a,n,r,g),y=e.textSizeData,d=null;return"source"===y.functionType?d=[10*o.layout.get("text-size").evaluate(r)]:"composite"===y.functionType&&(d=[10*e.compositeTextSizes[0].evaluate(r),10*e.compositeTextSizes[1].evaluate(r)]),e.addSymbols(e.text,x,d,l,a,r,s,t,c.lineStartIndex,c.lineLength,e.placedGlyphArray),u.push(e.placedGlyphArray.length-1),4*x.length}function addSymbol(e,t,i,o,a,n,r,l,c,s,u,g,x,y,d,p,f,h,m,v,S){var b,T,I=e.addToLineVertexArray(t,i),z=0,A=0,E=0,q=o.horizontal?o.horizontal.text:"",L=[];o.horizontal&&(b=new CollisionFeature(r,i,t,l,c,s,o.horizontal,u,g,x,e.overscaling),A+=addTextVertices(e,t,o.horizontal,n,x,m,v,y,I,o.vertical?WritingMode.horizontal:WritingMode.horizontalOnly,L,S),o.vertical&&(E+=addTextVertices(e,t,o.vertical,n,x,m,v,y,I,WritingMode.vertical,L,S)));var O=b?b.boxStartIndex:e.collisionBoxArray.length,P=b?b.boxEndIndex:e.collisionBoxArray.length;if(a){var w=getIconQuads(t,a,n,f,o.horizontal,m,v);T=new CollisionFeature(r,i,t,l,c,s,a,d,p,!1,e.overscaling),z=4*w.length;var B=e.iconSizeData,M=null;"source"===B.functionType?M=[10*n.layout.get("icon-size").evaluate(v)]:"composite"===B.functionType&&(M=[10*e.compositeIconSizes[0].evaluate(v),10*e.compositeIconSizes[1].evaluate(v)]),e.addSymbols(e.icon,w,M,h,f,v,!1,t,I.lineStartIndex,I.lineLength,e.placedIconArray)}var R=T?T.boxStartIndex:e.collisionBoxArray.length,_=T?T.boxEndIndex:e.collisionBoxArray.length;return e.glyphOffsetArray.length>=SymbolBucket.MAX_GLYPHS&&util.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),{key:q,textBoxStartIndex:O,textBoxEndIndex:P,iconBoxStartIndex:R,iconBoxEndIndex:_,textOffset:y,iconOffset:h,anchor:t,line:i,featureIndex:l,feature:v,numGlyphVertices:A,numVerticalGlyphVertices:E,numIconVertices:z,textOpacityState:new OpacityState,iconOpacityState:new OpacityState,isDuplicate:!1,placedTextSymbolIndices:L}}function anchorIsTooClose(e,t,i,o){var a=e.compareText;if(t in a){for(var n=a[t],r=n.length-1;r>=0;r--)if(o.dist(n[r])<i)return!0}else a[t]=[];return a[t].push(o),!1}var Anchor=_dereq_("./anchor"),getAnchors=_dereq_("./get_anchors"),clipLine=_dereq_("./clip_line"),OpacityState=_dereq_("./opacity_state"),ref=_dereq_("./shaping"),shapeText=ref.shapeText,shapeIcon=ref.shapeIcon,WritingMode=ref.WritingMode,ref$1=_dereq_("./quads"),getGlyphQuads=ref$1.getGlyphQuads,getIconQuads=ref$1.getIconQuads,CollisionFeature=_dereq_("./collision_feature"),util=_dereq_("../util/util"),scriptDetection=_dereq_("../util/script_detection"),findPoleOfInaccessibility=_dereq_("../util/find_pole_of_inaccessibility"),classifyRings=_dereq_("../util/classify_rings"),EXTENT=_dereq_("../data/extent"),SymbolBucket=_dereq_("../data/bucket/symbol_bucket"),Point=_dereq_("@mapbox/point-geometry");module.exports={performSymbolLayout:performSymbolLayout};
-},{"../data/bucket/symbol_bucket":57,"../data/extent":58,"../util/classify_rings":248,"../util/find_pole_of_inaccessibility":254,"../util/script_detection":261,"../util/util":266,"./anchor":205,"./clip_line":207,"./collision_feature":209,"./get_anchors":212,"./opacity_state":215,"./quads":217,"./shaping":218,"@mapbox/point-geometry":2}],220:[function(_dereq_,module,exports){
-"use strict";function updateOpacity(e,t,i,o,a){if(e.isDuplicate)t.opacity=0,t.targetOpacity=0;else{t.targetOpacity!==i&&(a.latestStart=o);var l=a.duration?(o-t.time)/a.duration:1;t.opacity=Math.max(0,Math.min(1,t.opacity+(1===t.targetOpacity?l:-l))),t.targetOpacity=i,t.time=o}}function packOpacity(e){if(0===e.opacity&&0===e.targetOpacity)return 0;if(1===e.opacity&&1===e.targetOpacity)return 4294967295;var t=1===e.targetOpacity?1:0,i=Math.floor(127*e.opacity);return i*shift25+t*shift24+i*shift17+t*shift16+i*shift9+t*shift8+i*shift1+t}function updateOpacities(e,t){var i=e.text&&e.text.opacityVertexArray,o=e.icon&&e.icon.opacityVertexArray;i&&i.clear(),o&&o.clear(),e.fadeStartTime=Date.now();for(var a=0,l=e.symbolInstances;a<l.length;a+=1){var r=l[a],c=!(r.textBoxStartIndex===r.textBoxEndIndex),n=!(r.iconBoxStartIndex===r.iconBoxEndIndex);if(c||n){if(c){var s=r.placedText?1:0,p=r.textOpacityState,x=0===p.opacity&&0===p.targetOpacity;updateOpacity(r,p,s,e.fadeStartTime,t);var y=0===p.opacity&&0===p.targetOpacity;if(x!==y)for(var f=0,d=r.placedTextSymbolIndices;f<d.length;f+=1){var m=d[f],B=e.placedGlyphArray.get(m);B.hidden=y}for(var u=(r.numGlyphVertices+r.numVerticalGlyphVertices)/4,h=packOpacity(p),g=0;g<u;g++)i.emplaceBack(h)}if(n){var v=r.placedIcon?1:0,S=r.iconOpacityState;updateOpacity(r,S,v,e.fadeStartTime,t);for(var C=r.numIconVertices/4,A=packOpacity(S),I=0;I<C;I++)o.emplaceBack(A)}}}i&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(i.serialize()),o&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(o.serialize())}function updateCollisionBox(e,t){e.emplaceBack(t?1:0,0),e.emplaceBack(t?1:0,0),e.emplaceBack(t?1:0,0),e.emplaceBack(t?1:0,0)}function updateCollisionCircles(e,t,i,o){for(var a=0;a<t.length;a+=5){var l=o||0===t[a+4];e.emplaceBack(i?1:0,l?1:0),e.emplaceBack(i?1:0,l?1:0),e.emplaceBack(i?1:0,l?1:0),e.emplaceBack(i?1:0,l?1:0)}}function performSymbolPlacement(e,t,i,o,a,l,r,c,n,s){var p,x,y=e.layers[0],f=y.layout,d=Math.pow(2,o-e.zoom);i&&(e.collisionBox&&e.collisionBox.collisionVertexArray&&e.collisionBox.collisionVertexArray.length&&(p=e.collisionBox.collisionVertexArray,p.clear()),e.collisionCircle&&e.collisionCircle.collisionVertexArray&&e.collisionCircle.collisionVertexArray.length&&(x=e.collisionCircle.collisionVertexArray,x.clear()));for(var m=symbolSize.evaluateSizeForZoom(e.textSizeData,t.transform.zoom,symbolLayoutProperties.properties["text-size"]),B="map"===f.get("text-pitch-alignment"),u=0,h=e.symbolInstances;u<h.length;u+=1){var g=h[u],v=!(g.textBoxStartIndex===g.textBoxEndIndex),S=!(g.iconBoxStartIndex===g.iconBoxEndIndex),C=f.get("text-optional")||!v,A=f.get("icon-optional")||!S;g.collisionArrays||(g.collisionArrays=e.deserializeCollisionBoxes(s,g.textBoxStartIndex,g.textBoxEndIndex,g.iconBoxStartIndex,g.iconBoxEndIndex));var I=[],O=[],V=[],z=!1;if(!g.isDuplicate){g.collisionArrays.textBox&&(I=t.placeCollisionBox(g.collisionArrays.textBox,f.get("text-allow-overlap"),a,l)),g.collisionArrays.iconBox&&(O=t.placeCollisionBox(g.collisionArrays.iconBox,f.get("icon-allow-overlap"),a,l));var b=g.collisionArrays.textCircles;if(b){var k=e.placedGlyphArray.get(g.placedTextSymbolIndices[0]),w=symbolSize.evaluateSizeForFeature(e.textSizeData,m,k);V=t.placeCollisionCircles(b,f.get("text-allow-overlap"),d,a,g.key,k,e.lineVertexArray,e.glyphOffsetArray,w,l,r,i,B),z=f.get("text-allow-overlap")||V.length>0}}var M=I.length>0||z,D=O.length>0;C||A?A?C||(D=D&&M):M=D&&M:D=M=D&&M,g.placedText=M,g.placedIcon=D,g.collisionArrays.textBox&&(p&&updateCollisionBox(p,M),M&&t.insertCollisionBox(I,f.get("text-ignore-placement"),c,n,g.textBoxStartIndex)),g.collisionArrays.iconBox&&(p&&updateCollisionBox(p,D),D&&t.insertCollisionBox(O,f.get("icon-ignore-placement"),c,n,g.iconBoxStartIndex)),g.collisionArrays.textCircles&&(x&&updateCollisionCircles(x,g.collisionArrays.textCircles,M,g.isDuplicate),M&&t.insertCollisionCircles(V,f.get("text-ignore-placement"),c,n,g.textBoxStartIndex))}p&&e.collisionBox.collisionVertexBuffer&&e.collisionBox.collisionVertexBuffer.updateData(p.serialize()),x&&e.collisionCircle.collisionVertexBuffer&&e.collisionCircle.collisionVertexBuffer.updateData(x.serialize())}var symbolSize=_dereq_("./symbol_size"),symbolLayoutProperties=_dereq_("../style/style_layer/symbol_style_layer_properties").layout,mat4=_dereq_("@mapbox/gl-matrix").mat4;module.exports={updateOpacities:updateOpacities,performSymbolPlacement:performSymbolPlacement};var shift25=Math.pow(2,25),shift24=Math.pow(2,24),shift17=Math.pow(2,17),shift16=Math.pow(2,16),shift9=Math.pow(2,9),shift8=Math.pow(2,8),shift1=Math.pow(2,1);
-},{"../style/style_layer/symbol_style_layer_properties":202,"./symbol_size":221,"@mapbox/gl-matrix":1}],221:[function(_dereq_,module,exports){
-"use strict";function getSizeData(e,o){var i=o.expression;if("constant"===i.kind)return{functionType:"constant",layoutSize:i.evaluate({zoom:e+1})};if("source"===i.kind)return{functionType:"source"};for(var t=i.zoomStops,r=0;r<t.length&&t[r]<=e;)r++;r=Math.max(0,r-1);for(var a=r;a<t.length&&t[a]<e+1;)a++;a=Math.min(t.length-1,a);var n={min:t[r],max:t[a]};return"composite"===i.kind?{functionType:"composite",zoomRange:n,propertyValue:o.value}:{functionType:"camera",layoutSize:i.evaluate({zoom:e+1}),zoomRange:n,sizeRange:{min:i.evaluate({zoom:n.min}),max:i.evaluate({zoom:n.max})},propertyValue:o.value}}function evaluateSizeForFeature(e,o,i){var t=o;return"source"===e.functionType?i.lowerSize/10:"composite"===e.functionType?interpolate.number(i.lowerSize/10,i.upperSize/10,t.uSizeT):t.uSize}function evaluateSizeForZoom(e,o,i){if("constant"===e.functionType)return{uSizeT:0,uSize:e.layoutSize};if("source"===e.functionType)return{uSizeT:0,uSize:0};if("camera"===e.functionType){var t=e.propertyValue,r=e.zoomRange,a=e.sizeRange,n=normalizePropertyExpression(t,i.specification),u=util.clamp(n.interpolationFactor(o,r.min,r.max),0,1);return{uSizeT:0,uSize:a.min+u*(a.max-a.min)}}var p=e.propertyValue,l=e.zoomRange,m=normalizePropertyExpression(p,i.specification);return{uSizeT:util.clamp(m.interpolationFactor(o,l.min,l.max),0,1),uSize:0}}var ref=_dereq_("../style-spec/expression"),normalizePropertyExpression=ref.normalizePropertyExpression,interpolate=_dereq_("../style-spec/util/interpolate"),util=_dereq_("../util/util");module.exports={getSizeData:getSizeData,evaluateSizeForFeature:evaluateSizeForFeature,evaluateSizeForZoom:evaluateSizeForZoom};
-},{"../style-spec/expression":136,"../style-spec/util/interpolate":154,"../util/util":266}],222:[function(_dereq_,module,exports){
-"use strict";var rtlTextPlugin=_dereq_("../source/rtl_text_plugin");module.exports=function(e,t,r){var a=t.layout.get("text-transform").evaluate(r);return"uppercase"===a?e=e.toLocaleUpperCase():"lowercase"===a&&(e=e.toLocaleLowerCase()),rtlTextPlugin.applyArabicShaping&&(e=rtlTextPlugin.applyArabicShaping(e)),e};
-},{"../source/rtl_text_plugin":107}],223:[function(_dereq_,module,exports){
-"use strict";var DOM=_dereq_("../util/dom"),Point=_dereq_("@mapbox/point-geometry"),handlers={scrollZoom:_dereq_("./handler/scroll_zoom"),boxZoom:_dereq_("./handler/box_zoom"),dragRotate:_dereq_("./handler/drag_rotate"),dragPan:_dereq_("./handler/drag_pan"),keyboard:_dereq_("./handler/keyboard"),doubleClickZoom:_dereq_("./handler/dblclick_zoom"),touchZoomRotate:_dereq_("./handler/touch_zoom_rotate")};module.exports=function(e,t){function n(e){h("mouseout",e)}function o(t){e.doubleClickZoom.isActive()||e.stop(),L=DOM.mousePos(g,t),h("mousedown",t),E=!0}function r(t){var n=e.dragRotate&&e.dragRotate.isActive();p&&!n&&h("contextmenu",p),p=null,E=!1,h("mouseup",t)}function u(t){if(!(e.dragPan&&e.dragPan.isActive()||e.dragRotate&&e.dragRotate.isActive())){for(var n=t.toElement||t.target;n&&n!==g;)n=n.parentNode;n===g&&h("mousemove",t)}}function a(t){e.stop(),f("touchstart",t),!t.touches||t.touches.length>1||(b?(clearTimeout(b),b=null,h("dblclick",t)):b=setTimeout(l,300))}function i(e){f("touchmove",e)}function c(e){f("touchend",e)}function d(e){f("touchcancel",e)}function l(){b=null}function s(e){DOM.mousePos(g,e).equals(L)&&h("click",e)}function m(e){h("dblclick",e),e.preventDefault()}function v(t){var n=e.dragRotate&&e.dragRotate.isActive();E||n?E&&(p=t):h("contextmenu",t),t.preventDefault()}function h(t,n){var o=DOM.mousePos(g,n);return e.fire(t,{lngLat:e.unproject(o),point:o,originalEvent:n})}function f(t,n){var o=DOM.touchPos(g,n),r=o.reduce(function(e,t,n,o){return e.add(t.div(o.length))},new Point(0,0));return e.fire(t,{lngLat:e.unproject(r),point:r,lngLats:o.map(function(t){return e.unproject(t)},this),points:o,originalEvent:n})}var g=e.getCanvasContainer(),p=null,E=!1,L=null,b=null;for(var k in handlers)e[k]=new handlers[k](e,t),t.interactive&&t[k]&&e[k].enable(t[k]);g.addEventListener("mouseout",n,!1),g.addEventListener("mousedown",o,!1),g.addEventListener("mouseup",r,!1),g.addEventListener("mousemove",u,!1),g.addEventListener("touchstart",a,!1),g.addEventListener("touchend",c,!1),g.addEventListener("touchmove",i,!1),g.addEventListener("touchcancel",d,!1),g.addEventListener("click",s,!1),g.addEventListener("dblclick",m,!1),g.addEventListener("contextmenu",v,!1)};
-},{"../util/dom":252,"./handler/box_zoom":232,"./handler/dblclick_zoom":233,"./handler/drag_pan":234,"./handler/drag_rotate":235,"./handler/keyboard":236,"./handler/scroll_zoom":237,"./handler/touch_zoom_rotate":238,"@mapbox/point-geometry":2}],224:[function(_dereq_,module,exports){
-"use strict";var util=_dereq_("../util/util"),interpolate=_dereq_("../style-spec/util/interpolate").number,browser=_dereq_("../util/browser"),LngLat=_dereq_("../geo/lng_lat"),LngLatBounds=_dereq_("../geo/lng_lat_bounds"),Point=_dereq_("@mapbox/point-geometry"),Evented=_dereq_("../util/evented"),Camera=function(t){function i(i,e){t.call(this),this.moving=!1,this.transform=i,this._bearingSnap=e.bearingSnap}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.getCenter=function(){return this.transform.center},i.prototype.setCenter=function(t,i){return this.jumpTo({center:t},i)},i.prototype.panBy=function(t,i,e){return t=Point.convert(t).mult(-1),this.panTo(this.transform.center,util.extend({offset:t},i),e)},i.prototype.panTo=function(t,i,e){return this.easeTo(util.extend({center:t},i),e)},i.prototype.getZoom=function(){return this.transform.zoom},i.prototype.setZoom=function(t,i){return this.jumpTo({zoom:t},i),this},i.prototype.zoomTo=function(t,i,e){return this.easeTo(util.extend({zoom:t},i),e)},i.prototype.zoomIn=function(t,i){return this.zoomTo(this.getZoom()+1,t,i),this},i.prototype.zoomOut=function(t,i){return this.zoomTo(this.getZoom()-1,t,i),this},i.prototype.getBearing=function(){return this.transform.bearing},i.prototype.setBearing=function(t,i){return this.jumpTo({bearing:t},i),this},i.prototype.rotateTo=function(t,i,e){return this.easeTo(util.extend({bearing:t},i),e)},i.prototype.resetNorth=function(t,i){return this.rotateTo(0,util.extend({duration:1e3},t),i),this},i.prototype.snapToNorth=function(t,i){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,i):this},i.prototype.getPitch=function(){return this.transform.pitch},i.prototype.setPitch=function(t,i){return this.jumpTo({pitch:t},i),this},i.prototype.fitBounds=function(t,i,e){if(i=util.extend({padding:{top:0,bottom:0,right:0,left:0},offset:[0,0],maxZoom:this.transform.maxZoom},i),"number"==typeof i.padding){var o=i.padding;i.padding={top:o,bottom:o,right:o,left:o}}if(!util.deepEqual(Object.keys(i.padding).sort(function(t,i){return t<i?-1:t>i?1:0}),["bottom","left","right","top"]))return util.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'"),this;t=LngLatBounds.convert(t);var n=[(i.padding.left-i.padding.right)/2,(i.padding.top-i.padding.bottom)/2],r=Math.min(i.padding.right,i.padding.left),a=Math.min(i.padding.top,i.padding.bottom);i.offset=[i.offset[0]+n[0],i.offset[1]+n[1]];var s=Point.convert(i.offset),h=this.transform,p=h.project(t.getNorthWest()),u=h.project(t.getSouthEast()),c=u.sub(p),m=(h.width-2*r-2*Math.abs(s.x))/c.x,f=(h.height-2*a-2*Math.abs(s.y))/c.y;return f<0||m<0?(util.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset."),this):(i.center=h.unproject(p.add(u).div(2)),i.zoom=Math.min(h.scaleZoom(h.scale*Math.min(m,f)),i.maxZoom),i.bearing=0,i.linear?this.easeTo(i,e):this.flyTo(i,e))},i.prototype.jumpTo=function(t,i){this.stop();var e=this.transform,o=!1,n=!1,r=!1;return"zoom"in t&&e.zoom!==+t.zoom&&(o=!0,e.zoom=+t.zoom),void 0!==t.center&&(e.center=LngLat.convert(t.center)),"bearing"in t&&e.bearing!==+t.bearing&&(n=!0,e.bearing=+t.bearing),"pitch"in t&&e.pitch!==+t.pitch&&(r=!0,e.pitch=+t.pitch),this.fire("movestart",i).fire("move",i),o&&this.fire("zoomstart",i).fire("zoom",i).fire("zoomend",i),n&&this.fire("rotate",i),r&&this.fire("pitchstart",i).fire("pitch",i).fire("pitchend",i),this.fire("moveend",i)},i.prototype.easeTo=function(t,i){var e=this;this.stop(),t=util.extend({offset:[0,0],duration:500,easing:util.ease},t),!1===t.animate&&(t.duration=0),t.smoothEasing&&0!==t.duration&&(t.easing=this._smoothOutEasing(t.duration));var o=this.transform,n=this.getZoom(),r=this.getBearing(),a=this.getPitch(),s="zoom"in t?+t.zoom:n,h="bearing"in t?this._normalizeBearing(t.bearing,r):r,p="pitch"in t?+t.pitch:a,u=o.centerPoint.add(Point.convert(t.offset)),c=o.pointLocation(u),m=LngLat.convert(t.center||c);this._normalizeCenter(m);var f,g,d=o.project(c),l=o.project(m).sub(d),v=o.zoomScale(s-n);return t.around&&(f=LngLat.convert(t.around),g=o.locationPoint(f)),this.zooming=s!==n,this.rotating=r!==h,this.pitching=p!==a,this._prepareEase(i,t.noMoveStart),clearTimeout(this._onEaseEnd),this._ease(function(t){if(this.zooming&&(o.zoom=interpolate(n,s,t)),this.rotating&&(o.bearing=interpolate(r,h,t)),this.pitching&&(o.pitch=interpolate(a,p,t)),f)o.setLocationAtPoint(f,g);else{var e=o.zoomScale(o.zoom-n),c=s>n?Math.min(2,v):Math.max(.5,v),m=Math.pow(c,1-t),b=o.unproject(d.add(l.mult(t*m)).mult(e));o.setLocationAtPoint(o.renderWorldCopies?b.wrap():b,u)}this._fireMoveEvents(i)},function(){t.delayEndEvents?e._onEaseEnd=setTimeout(function(){return e._easeToEnd(i)},t.delayEndEvents):e._easeToEnd(i)},t),this},i.prototype._prepareEase=function(t,i){this.moving=!0,i||this.fire("movestart",t),this.zooming&&this.fire("zoomstart",t),this.pitching&&this.fire("pitchstart",t)},i.prototype._fireMoveEvents=function(t){this.fire("move",t),this.zooming&&this.fire("zoom",t),this.rotating&&this.fire("rotate",t),this.pitching&&this.fire("pitch",t)},i.prototype._easeToEnd=function(t){var i=this.zooming,e=this.pitching;this.moving=!1,this.zooming=!1,this.rotating=!1,this.pitching=!1,i&&this.fire("zoomend",t),e&&this.fire("pitchend",t),this.fire("moveend",t)},i.prototype.flyTo=function(t,i){function e(t){var i=(M*M-z*z+(t?-1:1)*L*L*E*E)/(2*(t?M:z)*L*E);return Math.log(Math.sqrt(i*i+1)-i)}function o(t){return(Math.exp(t)-Math.exp(-t))/2}function n(t){return(Math.exp(t)+Math.exp(-t))/2}function r(t){return o(t)/n(t)}var a=this;this.stop(),t=util.extend({offset:[0,0],speed:1.2,curve:1.42,easing:util.ease},t);var s=this.transform,h=this.getZoom(),p=this.getBearing(),u=this.getPitch(),c="zoom"in t?util.clamp(+t.zoom,s.minZoom,s.maxZoom):h,m="bearing"in t?this._normalizeBearing(t.bearing,p):p,f="pitch"in t?+t.pitch:u,g=s.zoomScale(c-h),d=s.centerPoint.add(Point.convert(t.offset)),l=s.pointLocation(d),v=LngLat.convert(t.center||l);this._normalizeCenter(v);var b=s.project(l),y=s.project(v).sub(b),_=t.curve,z=Math.max(s.width,s.height),M=z/g,E=y.mag();if("minZoom"in t){var T=util.clamp(Math.min(t.minZoom,h,c),s.minZoom,s.maxZoom),x=z/s.zoomScale(T-h);_=Math.sqrt(x/E*2)}var L=_*_,j=e(0),Z=function(t){return n(j)/n(j+_*t)},w=function(t){return z*((n(j)*r(j+_*t)-o(j))/L)/E},P=(e(1)-j)/_;if(Math.abs(E)<1e-6||!isFinite(P)){if(Math.abs(z-M)<1e-6)return this.easeTo(t,i);var q=M<z?-1:1;P=Math.abs(Math.log(M/z))/_,w=function(){return 0},Z=function(t){return Math.exp(q*_*t)}}if("duration"in t)t.duration=+t.duration;else{var B="screenSpeed"in t?+t.screenSpeed/_:+t.speed;t.duration=1e3*P/B}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this.zooming=!0,this.rotating=p!==m,this.pitching=f!==u,this._prepareEase(i,!1),this._ease(function(t){var e=t*P,o=1/Z(e);s.zoom=h+s.scaleZoom(o),this.rotating&&(s.bearing=interpolate(p,m,t)),this.pitching&&(s.pitch=interpolate(u,f,t));var n=s.unproject(b.add(y.mult(w(e))).mult(o));s.setLocationAtPoint(s.renderWorldCopies?n.wrap():n,d),this._fireMoveEvents(i)},function(){return a._easeToEnd(i)},t),this},i.prototype.isEasing=function(){return!!this._abortFn},i.prototype.isMoving=function(){return this.moving},i.prototype.stop=function(){return this._abortFn&&(this._abortFn(),this._finishEase()),this},i.prototype._ease=function(t,i,e){this._finishFn=i,this._abortFn=browser.timed(function(i){t.call(this,e.easing(i)),1===i&&this._finishEase()},!1===e.animate?0:e.duration,this)},i.prototype._finishEase=function(){delete this._abortFn;var t=this._finishFn;delete this._finishFn,t.call(this)},i.prototype._normalizeBearing=function(t,i){t=util.wrap(t,-180,180);var e=Math.abs(t-i);return Math.abs(t-360-i)<e&&(t-=360),Math.abs(t+360-i)<e&&(t+=360),t},i.prototype._normalizeCenter=function(t){var i=this.transform;if(i.renderWorldCopies&&!i.lngRange){var e=t.lng-i.center.lng;t.lng+=e>180?-360:e<-180?360:0}},i.prototype._smoothOutEasing=function(t){var i=util.ease;if(this._prevEase){var e=this._prevEase,o=(Date.now()-e.start)/e.duration,n=e.easing(o+.01)-e.easing(o),r=.27/Math.sqrt(n*n+1e-4)*.01,a=Math.sqrt(.0729-r*r);i=util.bezier(r,a,.25,1)}return this._prevEase={start:(new Date).getTime(),duration:t,easing:i},i},i}(Evented);module.exports=Camera;
-},{"../geo/lng_lat":68,"../geo/lng_lat_bounds":69,"../style-spec/util/interpolate":154,"../util/browser":245,"../util/evented":253,"../util/util":266,"@mapbox/point-geometry":2}],225:[function(_dereq_,module,exports){
-"use strict";var DOM=_dereq_("../../util/dom"),util=_dereq_("../../util/util"),config=_dereq_("../../util/config"),AttributionControl=function(t){this.options=t,util.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};AttributionControl.prototype.getDefaultPosition=function(){return"bottom-right"},AttributionControl.prototype.onAdd=function(t){var i=this.options&&this.options.compact;return this._map=t,this._container=DOM.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),i&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===i&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},AttributionControl.prototype.onRemove=function(){DOM.remove(this._container),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0},AttributionControl.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:config.ACCESS_TOKEN}];if(t){var o=i.reduce(function(t,o,e){return o.value&&(t+=o.key+"="+o.value+(e<i.length-1?"&":"")),t},"?");t.href="https://www.mapbox.com/feedback/"+o+(this._map._hash?this._map._hash.getHashString(!0):"")}},AttributionControl.prototype._updateData=function(t){t&&"metadata"===t.sourceDataType&&(this._updateAttributions(),this._updateEditLink())},AttributionControl.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this._map.style.stylesheet){var i=this._map.style.stylesheet;this.styleOwner=i.owner,this.styleId=i.id}var o=this._map.style.sourceCaches;for(var e in o){var n=o[e].getSource();n.attribution&&t.indexOf(n.attribution)<0&&t.push(n.attribution)}t.sort(function(t,i){return t.length-i.length}),t=t.filter(function(i,o){for(var e=o+1;e<t.length;e++)if(t[e].indexOf(i)>=0)return!1;return!0}),this._container.innerHTML=t.join(" | "),this._editLink=null}},AttributionControl.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")},module.exports=AttributionControl;
-},{"../../util/config":249,"../../util/dom":252,"../../util/util":266}],226:[function(_dereq_,module,exports){
-"use strict";var DOM=_dereq_("../../util/dom"),util=_dereq_("../../util/util"),window=_dereq_("../../util/window"),FullscreenControl=function(){this._fullscreen=!1,util.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in window.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl"};FullscreenControl.prototype.onAdd=function(e){return this._map=e,this._mapContainer=this._map.getContainer(),this._container=DOM.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._container.style.display="none",util.warnOnce("This device does not support fullscreen mode.")),this._container},FullscreenControl.prototype.onRemove=function(){DOM.remove(this._container),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},FullscreenControl.prototype._checkFullscreenSupport=function(){return!!(window.document.fullscreenEnabled||window.document.mozFullScreenEnabled||window.document.msFullscreenEnabled||window.document.webkitFullscreenEnabled)},FullscreenControl.prototype._setupUI=function(){var e=this._fullscreenButton=DOM.create("button",this._className+"-icon "+this._className+"-fullscreen",this._container);e.setAttribute("aria-label","Toggle fullscreen"),e.type="button",this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)},FullscreenControl.prototype._isFullscreen=function(){return this._fullscreen},FullscreenControl.prototype._changeIcon=function(){(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._mapContainer!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"))},FullscreenControl.prototype._onClickFullscreen=function(){this._isFullscreen()?window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen&&window.document.webkitCancelFullScreen():this._mapContainer.requestFullscreen?this._mapContainer.requestFullscreen():this._mapContainer.mozRequestFullScreen?this._mapContainer.mozRequestFullScreen():this._mapContainer.msRequestFullscreen?this._mapContainer.msRequestFullscreen():this._mapContainer.webkitRequestFullscreen&&this._mapContainer.webkitRequestFullscreen()},module.exports=FullscreenControl;
-},{"../../util/dom":252,"../../util/util":266,"../../util/window":247}],227:[function(_dereq_,module,exports){
-"use strict";function checkGeolocationSupport(t){void 0!==supportsGeolocation?t(supportsGeolocation):void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then(function(o){supportsGeolocation="denied"!==o.state,t(supportsGeolocation)}):(supportsGeolocation=!!window.navigator.geolocation,t(supportsGeolocation))}var Evented=_dereq_("../../util/evented"),DOM=_dereq_("../../util/dom"),window=_dereq_("../../util/window"),util=_dereq_("../../util/util"),LngLat=_dereq_("../../geo/lng_lat"),Marker=_dereq_("../marker"),defaultOptions={positionOptions:{enableHighAccuracy:!1,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0},className="mapboxgl-ctrl",supportsGeolocation,GeolocateControl=function(t){function o(o){t.call(this),this.options=util.extend({},defaultOptions,o),util.bindAll(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker","_onClickGeolocate"],this)}return t&&(o.__proto__=t),o.prototype=Object.create(t&&t.prototype),o.prototype.constructor=o,o.prototype.onAdd=function(t){return this._map=t,this._container=DOM.create("div",className+" "+className+"-group"),checkGeolocationSupport(this._setupUI),this._container},o.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker.remove(),DOM.remove(this._container),this._map=void 0},o.prototype._onSuccess=function(t){if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire("geolocate",t),this._finish()},o.prototype._updateCamera=function(t){var o=new LngLat(t.coords.longitude,t.coords.latitude),e=t.coords.accuracy;this._map.fitBounds(o.toBounds(e),this.options.fitBoundsOptions,{geolocateSource:!0})},o.prototype._updateMarker=function(t){t?this._userLocationDotMarker.setLngLat([t.coords.longitude,t.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()},o.prototype._onError=function(t){if(this.options.trackUserLocation)if(1===t.code)this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),void 0!==this._geolocationWatchID&&this._clearWatch();else switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire("error",t),this._finish()},o.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},o.prototype._setupUI=function(t){var o=this;!1!==t&&(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=DOM.create("button",className+"-icon "+className+"-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=DOM.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Marker(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),this.options.trackUserLocation&&this._map.on("movestart",function(t){t.geolocateSource||"ACTIVE_LOCK"!==o._watchState||(o._watchState="BACKGROUND",o._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),o._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),o.fire("trackuserlocationend"))}))},o.prototype._onClickGeolocate=function(){if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire("trackuserlocationstart");break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire("trackuserlocationend");break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire("trackuserlocationstart")}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4)},o.prototype._clearWatch=function(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},o}(Evented);module.exports=GeolocateControl;
-},{"../../geo/lng_lat":68,"../../util/dom":252,"../../util/evented":253,"../../util/util":266,"../../util/window":247,"../marker":241}],228:[function(_dereq_,module,exports){
-"use strict";var DOM=_dereq_("../../util/dom"),util=_dereq_("../../util/util"),LogoControl=function(){util.bindAll(["_updateLogo"],this)};LogoControl.prototype.onAdd=function(o){this._map=o,this._container=DOM.create("div","mapboxgl-ctrl");var t=DOM.create("a","mapboxgl-ctrl-logo");return t.target="_blank",t.href="https://www.mapbox.com/",t.setAttribute("aria-label","Mapbox logo"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._container},LogoControl.prototype.onRemove=function(){DOM.remove(this._container),this._map.off("sourcedata",this._updateLogo)},LogoControl.prototype.getDefaultPosition=function(){return"bottom-left"},LogoControl.prototype._updateLogo=function(o){o&&"metadata"!==o.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},LogoControl.prototype._logoRequired=function(){if(this._map.style){var o=this._map.style.sourceCaches;for(var t in o){if(o[t].getSource().mapbox_logo)return!0}return!1}},module.exports=LogoControl;
-},{"../../util/dom":252,"../../util/util":266}],229:[function(_dereq_,module,exports){
-"use strict";var DOM=_dereq_("../../util/dom"),util=_dereq_("../../util/util"),DragRotateHandler=_dereq_("../handler/drag_rotate"),NavigationControl=function(){var t=this;util.bindAll(["_rotateCompassArrow"],this),this._container=DOM.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._zoomInButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-in","Zoom In",function(){return t._map.zoomIn()}),this._zoomOutButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-out","Zoom Out",function(){return t._map.zoomOut()}),this._compass=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-compass","Reset North",function(){return t._map.resetNorth()}),this._compassArrow=DOM.create("span","mapboxgl-ctrl-compass-arrow",this._compass)};NavigationControl.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t},NavigationControl.prototype.onAdd=function(t){return this._map=t,this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new DragRotateHandler(t,{button:"left",element:this._compass}),this._handler.enable(),this._container},NavigationControl.prototype.onRemove=function(){DOM.remove(this._container),this._map.off("rotate",this._rotateCompassArrow),delete this._map,this._handler.disable(),delete this._handler},NavigationControl.prototype._createButton=function(t,o,r){var e=DOM.create("button",t,this._container);return e.type="button",e.setAttribute("aria-label",o),e.addEventListener("click",r),e},module.exports=NavigationControl;
-},{"../../util/dom":252,"../../util/util":266,"../handler/drag_rotate":235}],230:[function(_dereq_,module,exports){
-"use strict";function updateScale(t,e,o){var n=o&&o.maxWidth||100,i=t._container.clientHeight/2,a=getDistance(t.unproject([0,i]),t.unproject([n,i]));if(o&&"imperial"===o.unit){var l=3.2808*a;if(l>5280){setScale(e,n,l/5280,"mi")}else setScale(e,n,l,"ft")}else if(o&&"nautical"===o.unit){var r=a/1852;setScale(e,n,r,"nm")}else setScale(e,n,a,"m")}function setScale(t,e,o,n){var i=getRoundNum(o),a=i/o;"m"===n&&i>=1e3&&(i/=1e3,n="km"),t.style.width=e*a+"px",t.innerHTML=i+n}function getDistance(t,e){var o=Math.PI/180,n=t.lat*o,i=e.lat*o,a=Math.sin(n)*Math.sin(i)+Math.cos(n)*Math.cos(i)*Math.cos((e.lng-t.lng)*o);return 6371e3*Math.acos(Math.min(a,1))}function getRoundNum(t){var e=Math.pow(10,(""+Math.floor(t)).length-1),o=t/e;return o=o>=10?10:o>=5?5:o>=3?3:o>=2?2:1,e*o}var DOM=_dereq_("../../util/dom"),util=_dereq_("../../util/util"),ScaleControl=function(t){this.options=t,util.bindAll(["_onMove"],this)};ScaleControl.prototype.getDefaultPosition=function(){return"bottom-left"},ScaleControl.prototype._onMove=function(){updateScale(this._map,this._container,this.options)},ScaleControl.prototype.onAdd=function(t){return this._map=t,this._container=DOM.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},ScaleControl.prototype.onRemove=function(){DOM.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},module.exports=ScaleControl;
-},{"../../util/dom":252,"../../util/util":266}],231:[function(_dereq_,module,exports){
-"use strict";
-},{}],232:[function(_dereq_,module,exports){
-"use strict";var DOM=_dereq_("../../util/dom"),LngLatBounds=_dereq_("../../geo/lng_lat_bounds"),util=_dereq_("../../util/util"),window=_dereq_("../../util/window"),BoxZoomHandler=function(o){this._map=o,this._el=o.getCanvasContainer(),this._container=o.getContainer(),util.bindAll(["_onMouseDown","_onMouseMove","_onMouseUp","_onKeyDown"],this)};BoxZoomHandler.prototype.isEnabled=function(){return!!this._enabled},BoxZoomHandler.prototype.isActive=function(){return!!this._active},BoxZoomHandler.prototype.enable=function(){this.isEnabled()||(this._map.dragPan&&this._map.dragPan.disable(),this._el.addEventListener("mousedown",this._onMouseDown,!1),this._map.dragPan&&this._map.dragPan.enable(),this._enabled=!0)},BoxZoomHandler.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},BoxZoomHandler.prototype._onMouseDown=function(o){o.shiftKey&&0===o.button&&(window.document.addEventListener("mousemove",this._onMouseMove,!1),window.document.addEventListener("keydown",this._onKeyDown,!1),window.document.addEventListener("mouseup",this._onMouseUp,!1),DOM.disableDrag(),this._startPos=DOM.mousePos(this._el,o),this._active=!0)},BoxZoomHandler.prototype._onMouseMove=function(o){var e=this._startPos,t=DOM.mousePos(this._el,o);this._box||(this._box=DOM.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",o));var n=Math.min(e.x,t.x),i=Math.max(e.x,t.x),s=Math.min(e.y,t.y),a=Math.max(e.y,t.y);DOM.setTransform(this._box,"translate("+n+"px,"+s+"px)"),this._box.style.width=i-n+"px",this._box.style.height=a-s+"px"},BoxZoomHandler.prototype._onMouseUp=function(o){if(0===o.button){var e=this._startPos,t=DOM.mousePos(this._el,o),n=(new LngLatBounds).extend(this._map.unproject(e)).extend(this._map.unproject(t));this._finish(),e.x===t.x&&e.y===t.y?this._fireEvent("boxzoomcancel",o):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:o,boxZoomBounds:n})}},BoxZoomHandler.prototype._onKeyDown=function(o){27===o.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",o))},BoxZoomHandler.prototype._finish=function(){this._active=!1,window.document.removeEventListener("mousemove",this._onMouseMove,!1),window.document.removeEventListener("keydown",this._onKeyDown,!1),window.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(DOM.remove(this._box),this._box=null),DOM.enableDrag()},BoxZoomHandler.prototype._fireEvent=function(o,e){return this._map.fire(o,{originalEvent:e})},module.exports=BoxZoomHandler;
-},{"../../geo/lng_lat_bounds":69,"../../util/dom":252,"../../util/util":266,"../../util/window":247}],233:[function(_dereq_,module,exports){
-"use strict";var util=_dereq_("../../util/util"),DoubleClickZoomHandler=function(o){this._map=o,util.bindAll(["_onDblClick","_onZoomEnd"],this)};DoubleClickZoomHandler.prototype.isEnabled=function(){return!!this._enabled},DoubleClickZoomHandler.prototype.isActive=function(){return!!this._active},DoubleClickZoomHandler.prototype.enable=function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},DoubleClickZoomHandler.prototype.disable=function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},DoubleClickZoomHandler.prototype._onDblClick=function(o){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(o.originalEvent.shiftKey?-1:1),{around:o.lngLat},o)},DoubleClickZoomHandler.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)},module.exports=DoubleClickZoomHandler;
-},{"../../util/util":266}],234:[function(_dereq_,module,exports){
-"use strict";var DOM=_dereq_("../../util/dom"),util=_dereq_("../../util/util"),window=_dereq_("../../util/window"),inertiaLinearity=.3,inertiaEasing=util.bezier(0,0,inertiaLinearity,1),inertiaMaxSpeed=1400,inertiaDeceleration=2500,DragPanHandler=function(t){this._map=t,this._el=t.getCanvasContainer(),util.bindAll(["_onDown","_onMove","_onUp","_onTouchEnd","_onMouseUp"],this)};DragPanHandler.prototype.isEnabled=function(){return!!this._enabled},DragPanHandler.prototype.isActive=function(){return!!this._active},DragPanHandler.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},DragPanHandler.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},DragPanHandler.prototype._onDown=function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(window.document.addEventListener("touchmove",this._onMove),window.document.addEventListener("touchend",this._onTouchEnd)):(window.document.addEventListener("mousemove",this._onMove),window.document.addEventListener("mouseup",this._onMouseUp)),window.addEventListener("blur",this._onMouseUp),this._active=!1,this._startPos=this._pos=DOM.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},DragPanHandler.prototype._onMove=function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._map.moving=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=DOM.mousePos(this._el,t),n=this._map;n.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),n.transform.setLocationAtPoint(n.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},DragPanHandler.prototype._onUp=function(t){var e=this;if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var n=function(){e._map.moving=!1,e._fireEvent("moveend",t)},i=this._inertia;if(i.length<2)return void n();var o=i[i.length-1],r=i[0],a=o[1].sub(r[1]),s=(o[0]-r[0])/1e3;if(0===s||o[1].equals(r[1]))return void n();var u=a.mult(inertiaLinearity/s),d=u.mag();d>inertiaMaxSpeed&&(d=inertiaMaxSpeed,u._unit()._mult(d));var h=d/(inertiaDeceleration*inertiaLinearity),v=u.mult(-h/2);this._map.panBy(v,{duration:1e3*h,easing:inertiaEasing,noMoveStart:!0},{originalEvent:t})}},DragPanHandler.prototype._onMouseUp=function(t){this._ignoreEvent(t)||(this._onUp(t),window.document.removeEventListener("mousemove",this._onMove),window.document.removeEventListener("mouseup",this._onMouseUp),window.removeEventListener("blur",this._onMouseUp))},DragPanHandler.prototype._onTouchEnd=function(t){this._ignoreEvent(t)||(this._onUp(t),window.document.removeEventListener("touchmove",this._onMove),window.document.removeEventListener("touchend",this._onTouchEnd))},DragPanHandler.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},DragPanHandler.prototype._ignoreEvent=function(t){var e=this._map;return!(!e.boxZoom||!e.boxZoom.isActive())||(!(!e.dragRotate||!e.dragRotate.isActive())||(t.touches?t.touches.length>1:!!t.ctrlKey||"mousemove"!==t.type&&t.button&&0!==t.button))},DragPanHandler.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()},module.exports=DragPanHandler;
-},{"../../util/dom":252,"../../util/util":266,"../../util/window":247}],235:[function(_dereq_,module,exports){
-"use strict";var DOM=_dereq_("../../util/dom"),util=_dereq_("../../util/util"),window=_dereq_("../../util/window"),inertiaLinearity=.25,inertiaEasing=util.bezier(0,0,inertiaLinearity,1),inertiaMaxSpeed=180,inertiaDeceleration=720,DragRotateHandler=function(t,e){this._map=t,this._el=e.element||t.getCanvasContainer(),this._button=e.button||"right",this._bearingSnap=e.bearingSnap||0,this._pitchWithRotate=!1!==e.pitchWithRotate,util.bindAll(["_onDown","_onMove","_onUp"],this)};DragRotateHandler.prototype.isEnabled=function(){return!!this._enabled},DragRotateHandler.prototype.isActive=function(){return!!this._active},DragRotateHandler.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},DragRotateHandler.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},DragRotateHandler.prototype._onDown=function(t){if(!(this._map.boxZoom&&this._map.boxZoom.isActive()||this._map.dragPan&&this._map.dragPan.isActive()||this.isActive())){if("right"===this._button){var e=t.ctrlKey?0:2,i=t.button;if(void 0!==window.InstallTrigger&&2===t.button&&t.ctrlKey&&window.navigator.platform.toUpperCase().indexOf("MAC")>=0&&(i=0),i!==e)return}else if(t.ctrlKey||0!==t.button)return;DOM.disableDrag(),window.document.addEventListener("mousemove",this._onMove,{capture:!0}),window.document.addEventListener("mouseup",this._onUp),window.addEventListener("blur",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=DOM.mousePos(this._el,t),this._center=this._map.transform.centerPoint,t.preventDefault()}},DragRotateHandler.prototype._onMove=function(t){this.isActive()||(this._active=!0,this._map.moving=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t));var e=this._map;e.stop();var i=this._pos,n=DOM.mousePos(this._el,t),r=.8*(i.x-n.x),a=-.5*(i.y-n.y),o=e.getBearing()-r,s=e.getPitch()-a,h=this._inertia,_=h[h.length-1];this._drainInertiaBuffer(),h.push([Date.now(),e._normalizeBearing(o,_[1])]),e.transform.bearing=o,this._pitchWithRotate&&(this._fireEvent("pitch",t),e.transform.pitch=s),this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n},DragRotateHandler.prototype._onUp=function(t){var e=this;if(window.document.removeEventListener("mousemove",this._onMove,{capture:!0}),window.document.removeEventListener("mouseup",this._onUp),window.removeEventListener("blur",this._onUp),DOM.enableDrag(),this.isActive()){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var i=this._map,n=i.getBearing(),r=this._inertia,a=function(){Math.abs(n)<e._bearingSnap?i.resetNorth({noMoveStart:!0},{originalEvent:t}):(e._map.moving=!1,e._fireEvent("moveend",t)),e._pitchWithRotate&&e._fireEvent("pitchend",t)};if(r.length<2)return void a();var o=r[0],s=r[r.length-1],h=r[r.length-2],_=i._normalizeBearing(n,h[1]),p=s[1]-o[1],v=p<0?-1:1,d=(s[0]-o[0])/1e3;if(0===p||0===d)return void a();var l=Math.abs(p*(inertiaLinearity/d));l>inertiaMaxSpeed&&(l=inertiaMaxSpeed);var u=l/(inertiaDeceleration*inertiaLinearity);_+=v*l*(u/2),Math.abs(i._normalizeBearing(_,0))<this._bearingSnap&&(_=i._normalizeBearing(0,_)),i.rotateTo(_,{duration:1e3*u,easing:inertiaEasing,noMoveStart:!0},{originalEvent:t})}},DragRotateHandler.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})},DragRotateHandler.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()},module.exports=DragRotateHandler;
-},{"../../util/dom":252,"../../util/util":266,"../../util/window":247}],236:[function(_dereq_,module,exports){
-"use strict";function easeOut(e){return e*(2-e)}var util=_dereq_("../../util/util"),panStep=100,bearingStep=15,pitchStep=10,KeyboardHandler=function(e){this._map=e,this._el=e.getCanvasContainer(),util.bindAll(["_onKeyDown"],this)};KeyboardHandler.prototype.isEnabled=function(){return!!this._enabled},KeyboardHandler.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},KeyboardHandler.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},KeyboardHandler.prototype._onKeyDown=function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var t=0,a=0,n=0,r=0,i=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?a=-1:(e.preventDefault(),r=-1);break;case 39:e.shiftKey?a=1:(e.preventDefault(),r=1);break;case 38:e.shiftKey?n=1:(e.preventDefault(),i=-1);break;case 40:e.shiftKey?n=-1:(i=1,e.preventDefault());break;default:return}var s=this._map,o=s.getZoom(),l={duration:300,delayEndEvents:500,easing:easeOut,zoom:t?Math.round(o)+t*(e.shiftKey?2:1):o,bearing:s.getBearing()+a*bearingStep,pitch:s.getPitch()+n*pitchStep,offset:[-r*panStep,-i*panStep],center:s.getCenter()};s.easeTo(l,{originalEvent:e})}},module.exports=KeyboardHandler;
-},{"../../util/util":266}],237:[function(_dereq_,module,exports){
-"use strict";var DOM=_dereq_("../../util/dom"),util=_dereq_("../../util/util"),browser=_dereq_("../../util/browser"),window=_dereq_("../../util/window"),ua=window.navigator.userAgent.toLowerCase(),firefox=-1!==ua.indexOf("firefox"),safari=-1!==ua.indexOf("safari")&&-1===ua.indexOf("chrom"),ScrollZoomHandler=function(e){this._map=e,this._el=e.getCanvasContainer(),util.bindAll(["_onWheel","_onTimeout"],this)};ScrollZoomHandler.prototype.isEnabled=function(){return!!this._enabled},ScrollZoomHandler.prototype.enable=function(e){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0,this._aroundCenter=e&&"center"===e.around)},ScrollZoomHandler.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},ScrollZoomHandler.prototype._onWheel=function(e){var t=0;"wheel"===e.type?(t=e.deltaY,firefox&&e.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(t/=browser.devicePixelRatio),e.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(t*=40)):"mousewheel"===e.type&&(t=-e.wheelDeltaY,safari&&(t/=3));var o=browser.now(),i=o-(this._time||0);this._pos=DOM.mousePos(this._el,e),this._time=o,0!==t&&t%4.000244140625==0?this._type="wheel":0!==t&&Math.abs(t)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(i*t)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&this._zoom(-t,e),e.preventDefault()},ScrollZoomHandler.prototype._onTimeout=function(){this._type="wheel",this._zoom(-this._lastValue)},ScrollZoomHandler.prototype._zoom=function(e,t){if(0!==e){var o=this._map,i=2/(1+Math.exp(-Math.abs(e/100)));e<0&&0!==i&&(i=1/i);var l=o.ease?o.ease.to:o.transform.scale,s=o.transform.scaleZoom(l*i);o.zoomTo(s,{duration:"wheel"===this._type?200:0,around:this._aroundCenter?o.getCenter():o.unproject(this._pos),delayEndEvents:200,smoothEasing:!0},{originalEvent:t})}},module.exports=ScrollZoomHandler;
-},{"../../util/browser":245,"../../util/dom":252,"../../util/util":266,"../../util/window":247}],238:[function(_dereq_,module,exports){
-"use strict";var DOM=_dereq_("../../util/dom"),util=_dereq_("../../util/util"),window=_dereq_("../../util/window"),inertiaLinearity=.15,inertiaEasing=util.bezier(0,0,inertiaLinearity,1),inertiaDeceleration=12,inertiaMaxSpeed=2.5,significantScaleThreshold=.15,significantRotateThreshold=10,TouchZoomRotateHandler=function(t){this._map=t,this._el=t.getCanvasContainer(),util.bindAll(["_onStart","_onMove","_onEnd"],this)};TouchZoomRotateHandler.prototype.isEnabled=function(){return!!this._enabled},TouchZoomRotateHandler.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},TouchZoomRotateHandler.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},TouchZoomRotateHandler.prototype.disableRotation=function(){this._rotationDisabled=!0},TouchZoomRotateHandler.prototype.enableRotation=function(){this._rotationDisabled=!1},TouchZoomRotateHandler.prototype._onStart=function(t){if(2===t.touches.length){var e=DOM.mousePos(this._el,t.touches[0]),o=DOM.mousePos(this._el,t.touches[1]);this._startVec=e.sub(o),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],window.document.addEventListener("touchmove",this._onMove,!1),window.document.addEventListener("touchend",this._onEnd,!1)}},TouchZoomRotateHandler.prototype._onMove=function(t){if(2===t.touches.length){var e=DOM.mousePos(this._el,t.touches[0]),o=DOM.mousePos(this._el,t.touches[1]),i=e.add(o).div(2),n=e.sub(o),a=n.mag()/this._startVec.mag(),r=this._rotationDisabled?0:180*n.angleWith(this._startVec)/Math.PI,s=this._map;if(this._gestureIntent){var h={duration:0,around:s.unproject(i)};"rotate"===this._gestureIntent&&(h.bearing=this._startBearing+r),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(h.zoom=s.transform.scaleZoom(this._startScale*a)),s.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),a,i]),s.easeTo(h,{originalEvent:t})}else{var u=Math.abs(1-a)>significantScaleThreshold;Math.abs(r)>significantRotateThreshold?this._gestureIntent="rotate":u&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=n,this._startScale=s.transform.scale,this._startBearing=s.transform.bearing)}t.preventDefault()}},TouchZoomRotateHandler.prototype._onEnd=function(t){window.document.removeEventListener("touchmove",this._onMove),window.document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,o=this._map;if(e.length<2)return void o.snapToNorth({},{originalEvent:t});var i=e[e.length-1],n=e[0],a=o.transform.scaleZoom(this._startScale*i[1]),r=o.transform.scaleZoom(this._startScale*n[1]),s=a-r,h=(i[0]-n[0])/1e3,u=i[2];if(0===h||a===r)return void o.snapToNorth({},{originalEvent:t});var l=s*inertiaLinearity/h;Math.abs(l)>inertiaMaxSpeed&&(l=l>0?inertiaMaxSpeed:-inertiaMaxSpeed);var d=1e3*Math.abs(l/(inertiaDeceleration*inertiaLinearity)),c=a+l*d/2e3;c<0&&(c=0),o.easeTo({zoom:c,duration:d,easing:inertiaEasing,around:this._aroundCenter?o.getCenter():o.unproject(u)},{originalEvent:t})},TouchZoomRotateHandler.prototype._drainInertiaBuffer=function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()},module.exports=TouchZoomRotateHandler;
-},{"../../util/dom":252,"../../util/util":266,"../../util/window":247}],239:[function(_dereq_,module,exports){
-"use strict";var util=_dereq_("../util/util"),window=_dereq_("../util/window"),throttle=_dereq_("../util/throttle"),Hash=function(){util.bindAll(["_onHashChange","_updateHash"],this),this._updateHash=throttle(this._updateHashUnthrottled.bind(this),300)};Hash.prototype.addTo=function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Hash.prototype.remove=function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},Hash.prototype.getHashString=function(t){var h=this._map.getCenter(),e=Math.round(100*this._map.getZoom())/100,a=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),o=Math.round(h.lng*Math.pow(10,a))/Math.pow(10,a),n=Math.round(h.lat*Math.pow(10,a))/Math.pow(10,a),i=this._map.getBearing(),s=this._map.getPitch(),r="";return r+=t?"#/"+o+"/"+n+"/"+e:"#"+e+"/"+n+"/"+o,(i||s)&&(r+="/"+Math.round(10*i)/10),s&&(r+="/"+Math.round(s)),r},Hash.prototype._onHashChange=function(){var t=window.location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},Hash.prototype._updateHashUnthrottled=function(){var t=this.getHashString();window.history.replaceState("","",t)},module.exports=Hash;
-},{"../util/throttle":264,"../util/util":266,"../util/window":247}],240:[function(_dereq_,module,exports){
-"use strict";function removeNode(t){t.parentNode&&t.parentNode.removeChild(t)}var util=_dereq_("../util/util"),browser=_dereq_("../util/browser"),window=_dereq_("../util/window"),ref=_dereq_("../util/window"),HTMLImageElement=ref.HTMLImageElement,HTMLElement=ref.HTMLElement,DOM=_dereq_("../util/dom"),ajax=_dereq_("../util/ajax"),Style=_dereq_("../style/style"),Painter=_dereq_("../render/painter"),Transform=_dereq_("../geo/transform"),Hash=_dereq_("./hash"),bindHandlers=_dereq_("./bind_handlers"),Camera=_dereq_("./camera"),LngLat=_dereq_("../geo/lng_lat"),LngLatBounds=_dereq_("../geo/lng_lat_bounds"),Point=_dereq_("@mapbox/point-geometry"),AttributionControl=_dereq_("./control/attribution_control"),LogoControl=_dereq_("./control/logo_control"),isSupported=_dereq_("mapbox-gl-supported");_dereq_("./events");var defaultMinZoom=0,defaultMaxZoom=22,defaultOptions={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:defaultMinZoom,maxZoom:defaultMaxZoom,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,transformRequest:null,collisionFadeDuration:300},Map=function(t){function e(e){var o=this;if(e=util.extend({},defaultOptions,e),null!=e.minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than minZoom");var r=new Transform(e.minZoom,e.maxZoom,e.renderWorldCopies);t.call(this,r,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._collisionFadeDuration=e.collisionFadeDuration;var i=e.transformRequest;if(this._transformRequest=i?function(t,e){return i(t,e)||{url:t}}:function(t){return{url:t}},"string"==typeof e.container){var n=window.document.getElementById(e.container);if(!n)throw new Error("Container '"+e.container+"' not found.");this._container=n}else{if(!(e.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}e.maxBounds&&this.setMaxBounds(e.maxBounds),util.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored","_update","_render","_onData","_onDataLoading"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("move",function(){o._rerender()}),void 0!==window&&(window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1)),bindHandlers(this,e),this._hash=e.hash&&(new Hash).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),this.resize(),e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new AttributionControl),this.addControl(new LogoControl,e.logoPosition),this.on("style.load",function(){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update({transition:!1})}),this.on("data",this._onData),this.on("dataloading",this._onDataLoading)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var o={showTileBoundaries:{},showCollisionBoxes:{},showOverdrawInspector:{},repaint:{},vertices:{}};return e.prototype.addControl=function(t,e){void 0===e&&t.getDefaultPosition&&(e=t.getDefaultPosition()),void 0===e&&(e="top-right");var o=t.onAdd(this),r=this._controlPositions[e];return-1!==e.indexOf("bottom")?r.insertBefore(o,r.firstChild):r.appendChild(o),this},e.prototype.removeControl=function(t){return t.onRemove(this),this},e.prototype.resize=function(){var t=this._containerDimensions(),e=t[0],o=t[1];return this._resizeCanvas(e,o),this.transform.resize(e,o),this.painter.resize(e,o),this.fire("movestart").fire("move").fire("resize").fire("moveend")},e.prototype.getBounds=function(){var t=new LngLatBounds(this.transform.pointLocation(new Point(0,this.transform.height)),this.transform.pointLocation(new Point(this.transform.width,0)));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new Point(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new Point(0,this.transform.size.y)))),t},e.prototype.getMaxBounds=function(){return this.transform.latRange&&2===this.transform.latRange.length&&this.transform.lngRange&&2===this.transform.lngRange.length?new LngLatBounds([this.transform.lngRange[0],this.transform.latRange[0]],[this.transform.lngRange[1],this.transform.latRange[1]]):null},e.prototype.setMaxBounds=function(t){if(t){var e=LngLatBounds.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=null,this.transform.latRange=null,this._update());return this},e.prototype.setMinZoom=function(t){if((t=null===t||void 0===t?defaultMinZoom:t)>=defaultMinZoom&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between "+defaultMinZoom+" and the current maxZoom, inclusive")},e.prototype.getMinZoom=function(){return this.transform.minZoom},e.prototype.setMaxZoom=function(t){if((t=null===t||void 0===t?defaultMaxZoom:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},e.prototype.getMaxZoom=function(){return this.transform.maxZoom},e.prototype.project=function(t){return this.transform.locationPoint(LngLat.convert(t))},e.prototype.unproject=function(t){return this.transform.pointLocation(Point.convert(t))},e.prototype.on=function(e,o,r){var i=this;if(void 0===r)return t.prototype.on.call(this,e,o);var n=function(){if("mouseenter"===e||"mouseover"===e){var t=!1;return{layer:o,listener:r,delegates:{mousemove:function(n){var s=i.getLayer(o)?i.queryRenderedFeatures(n.point,{layers:[o]}):[];s.length?t||(t=!0,r.call(i,util.extend({features:s},n,{type:e}))):t=!1},mouseout:function(){t=!1}}}}if("mouseleave"===e||"mouseout"===e){var n=!1;return{layer:o,listener:r,delegates:{mousemove:function(t){(i.getLayer(o)?i.queryRenderedFeatures(t.point,{layers:[o]}):[]).length?n=!0:n&&(n=!1,r.call(i,util.extend({},t,{type:e})))},mouseout:function(t){n&&(n=!1,r.call(i,util.extend({},t,{type:e})))}}}}var s=function(t){var e=i.getLayer(o)?i.queryRenderedFeatures(t.point,{layers:[o]}):[];e.length&&r.call(i,util.extend({features:e},t))};return{layer:o,listener:r,delegates:(a={},a[e]=s,a)};var a}();this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(n);for(var s in n.delegates)i.on(s,n.delegates[s]);return this},e.prototype.off=function(e,o,r){var i=this;if(void 0===r)return t.prototype.off.call(this,e,o);if(this._delegatedListeners&&this._delegatedListeners[e])for(var n=this._delegatedListeners[e],s=0;s<n.length;s++){var a=n[s];if(a.layer===o&&a.listener===r){for(var h in a.delegates)i.off(h,a.delegates[h]);return n.splice(s,1),i}}return this},e.prototype.queryRenderedFeatures=function(t,e){return 2===arguments.length?(t=arguments[0],e=arguments[1]):1===arguments.length&&function(t){return t instanceof Point||Array.isArray(t)}(arguments[0])?(t=arguments[0],e={}):1===arguments.length?(t=void 0,e=arguments[0]):(t=void 0,e={}),this.style?this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle):[]},e.prototype._makeQueryGeometry=function(t){var e=this;void 0===t&&(t=[Point.convert([0,0]),Point.convert([this.transform.width,this.transform.height])]);var o;if(t instanceof Point||"number"==typeof t[0]){o=[Point.convert(t)]}else{var r=[Point.convert(t[0]),Point.convert(t[1])];o=[r[0],new Point(r[1].x,r[0].y),r[1],new Point(r[0].x,r[1].y),r[0]]}return o=o.map(function(t){return e.transform.pointCoordinate(t)})},e.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},e.prototype.setStyle=function(t,e){if((!e||!1!==e.diff&&!e.localIdeographFontFamily)&&this.style&&t&&"object"==typeof t)try{return this.style.setState(t)&&this._update(!0),this}catch(t){util.warnOnce("Unable to perform style diff: "+(t.message||t.error||t)+". Rebuilding the style from scratch.")}return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new Style(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},e.prototype.getStyle=function(){if(this.style)return this.style.serialize()},e.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():util.warnOnce("There is no style added to the map.")},e.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0),this},e.prototype.isSourceLoaded=function(t){var e=this.style&&this.style.sourceCaches[t];return void 0===e?void this.fire("error",{error:new Error("There is no source with ID '"+t+"'")}):e.loaded()},e.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var o=t[e],r=o._tiles;for(var i in r){var n=r[i];if("loaded"!==n.state&&"errored"!==n.state)return!1}}return!0},e.prototype.addSourceType=function(t,e,o){return this.style.addSourceType(t,e,o)},e.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0),this},e.prototype.getSource=function(t){return this.style.getSource(t)},e.prototype.addImage=function(t,e,o){void 0===o&&(o={});var r=o.pixelRatio;void 0===r&&(r=1);var i=o.sdf;if(void 0===i&&(i=!1),e instanceof HTMLImageElement)e=browser.getImageData(e);else if(void 0===e.width||void 0===e.height)return this.fire("error",{error:new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")});this.style.addImage(t,{data:e,pixelRatio:r,sdf:i})},e.prototype.removeImage=function(t){this.style.removeImage(t)},e.prototype.loadImage=function(t,e){ajax.getImage(this._transformRequest(t,ajax.ResourceType.Image),e)},e.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0),this},e.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0),this},e.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0),this},e.prototype.getLayer=function(t){return this.style.getLayer(t)},e.prototype.setFilter=function(t,e){return this.style.setFilter(t,e),this._update(!0),this},e.prototype.setLayerZoomRange=function(t,e,o){return this.style.setLayerZoomRange(t,e,o),this._update(!0),this},e.prototype.getFilter=function(t){return this.style.getFilter(t)},e.prototype.setPaintProperty=function(t,e,o){return this.style.setPaintProperty(t,e,o),this._update(!0),this},e.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},e.prototype.setLayoutProperty=function(t,e,o){return this.style.setLayoutProperty(t,e,o),this._update(!0),this},e.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},e.prototype.setLight=function(t){return this.style.setLight(t),this._update(!0),this},e.prototype.getLight=function(){return this.style.getLight()},e.prototype.getContainer=function(){return this._container},e.prototype.getCanvasContainer=function(){return this._canvasContainer},e.prototype.getCanvas=function(){return this._canvas},e.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),[t,e]},e.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSContainer=DOM.create("div","mapboxgl-missing-css",t)).innerHTML="Missing Mapbox GL JS CSS";var e=this._canvasContainer=DOM.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=DOM.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var o=this._containerDimensions();this._resizeCanvas(o[0],o[1]);var r=this._controlContainer=DOM.create("div","mapboxgl-control-container",t),i=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){i[t]=DOM.create("div","mapboxgl-ctrl-"+t,r)})},e.prototype._resizeCanvas=function(t,e){var o=window.devicePixelRatio||1;this._canvas.width=o*t,this._canvas.height=o*e,this._canvas.style.width=t+"px",this._canvas.style.height=e+"px"},e.prototype._setupPainter=function(){var t=util.extend({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer},isSupported.webGLContextAttributes),e=this._canvas.getContext("webgl",t)||this._canvas.getContext("experimental-webgl",t);if(!e)return void this.fire("error",{error:new Error("Failed to initialize WebGL")});this.painter=new Painter(e,this.transform)},e.prototype._contextLost=function(t){t.preventDefault(),this._frameId&&(browser.cancelFrame(this._frameId),this._frameId=null),this.fire("webglcontextlost",{originalEvent:t})},e.prototype._contextRestored=function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},e.prototype.loaded=function(){return!(this._styleDirty||this._sourcesDirty||this._placementDirty)&&!(!this.style||!this.style.loaded())},e.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},e.prototype._render=function(){return this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(),this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._collisionFadeDuration),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.rotating,zooming:this.zooming,collisionFadeDuration:this._collisionFadeDuration}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty||this._placementDirty)&&this._rerender(),this},e.prototype.remove=function(){this._hash&&this._hash.remove(),browser.cancelFrame(this._frameId),this._frameId=null,this.setStyle(null),void 0!==window&&(window.removeEventListener("resize",this._onWindowResize,!1),window.removeEventListener("online",this._onWindowOnline,!1));var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),removeNode(this._canvasContainer),removeNode(this._controlContainer),removeNode(this._missingCSSContainer),this._container.classList.remove("mapboxgl-map"),this.fire("remove")},e.prototype._rerender=function(){this.style&&!this._frameId&&(this._frameId=browser.frame(this._render))},e.prototype._onWindowOnline=function(){this._update()},e.prototype._onWindowResize=function(){this._trackResize&&this.stop().resize()._update()},o.showTileBoundaries.get=function(){return!!this._showTileBoundaries},o.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},o.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},o.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},o.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},o.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},o.repaint.get=function(){return!!this._repaint},o.repaint.set=function(t){this._repaint=t,this._update()},o.vertices.get=function(){return!!this._vertices},o.vertices.set=function(t){this._vertices=t,this._update()},e.prototype._onData=function(t){this._update("style"===t.dataType),this.fire(t.dataType+"data",t)},e.prototype._onDataLoading=function(t){this.fire(t.dataType+"dataloading",t)},Object.defineProperties(e.prototype,o),e}(Camera);module.exports=Map;
-},{"../geo/lng_lat":68,"../geo/lng_lat_bounds":69,"../geo/transform":70,"../render/painter":89,"../style/style":185,"../util/ajax":244,"../util/browser":245,"../util/dom":252,"../util/util":266,"../util/window":247,"./bind_handlers":223,"./camera":224,"./control/attribution_control":225,"./control/logo_control":228,"./events":231,"./hash":239,"@mapbox/point-geometry":2,"mapbox-gl-supported":37}],241:[function(_dereq_,module,exports){
-"use strict";var DOM=_dereq_("../util/dom"),LngLat=_dereq_("../geo/lng_lat"),Point=_dereq_("@mapbox/point-geometry"),smartWrap=_dereq_("../util/smart_wrap"),ref=_dereq_("../util/util"),bindAll=ref.bindAll,Marker=function(t,e){if(this._offset=Point.convert(e&&e.offset||[0,0]),bindAll(["_update","_onMapClick"],this),!t){t=DOM.create("div");var r=DOM.createNS("http://www.w3.org/2000/svg","svg");r.setAttributeNS(null,"height","41px"),r.setAttributeNS(null,"width","27px"),r.setAttributeNS(null,"viewBox","0 0 27 41");var i=DOM.createNS("http://www.w3.org/2000/svg","g");i.setAttributeNS(null,"stroke","none"),i.setAttributeNS(null,"stroke-width","1"),i.setAttributeNS(null,"fill","none"),i.setAttributeNS(null,"fill-rule","evenodd");var p=DOM.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"fill-rule","nonzero");var s=DOM.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"transform","translate(3.0, 29.0)"),s.setAttributeNS(null,"fill","#000000");for(var l=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}],n=0,o=l;n<o.length;n+=1){var a=o[n],u=DOM.createNS("http://www.w3.org/2000/svg","ellipse");u.setAttributeNS(null,"opacity","0.04"),u.setAttributeNS(null,"cx","10.5"),u.setAttributeNS(null,"cy","5.80029008"),u.setAttributeNS(null,"rx",a.rx),u.setAttributeNS(null,"ry",a.ry),s.appendChild(u)}var h=DOM.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"fill","#3FB1CE");var g=DOM.createNS("http://www.w3.org/2000/svg","path");g.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"),h.appendChild(g);var _=DOM.createNS("http://www.w3.org/2000/svg","g");_.setAttributeNS(null,"opacity","0.25"),_.setAttributeNS(null,"fill","#000000");var d=DOM.createNS("http://www.w3.org/2000/svg","path");d.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"),_.appendChild(d);var w=DOM.createNS("http://www.w3.org/2000/svg","g");w.setAttributeNS(null,"transform","translate(6.0, 7.0)"),w.setAttributeNS(null,"fill","#FFFFFF");var c=DOM.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"transform","translate(8.0, 8.0)");var v=DOM.createNS("http://www.w3.org/2000/svg","circle");v.setAttributeNS(null,"fill","#000000"),v.setAttributeNS(null,"opacity","0.25"),v.setAttributeNS(null,"cx","5.5"),v.setAttributeNS(null,"cy","5.5"),v.setAttributeNS(null,"r","5.4999962");var f=DOM.createNS("http://www.w3.org/2000/svg","circle");f.setAttributeNS(null,"fill","#FFFFFF"),f.setAttributeNS(null,"cx","5.5"),f.setAttributeNS(null,"cy","5.5"),f.setAttributeNS(null,"r","5.4999962"),c.appendChild(v),c.appendChild(f),p.appendChild(s),p.appendChild(h),p.appendChild(_),p.appendChild(w),p.appendChild(c),r.appendChild(p),t.appendChild(r)}t.classList.add("mapboxgl-marker"),this._element=t,this._popup=null};Marker.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this._update(),this._map.on("click",this._onMapClick),this},Marker.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),delete this._map),DOM.remove(this._element),this._popup&&this._popup.remove(),this},Marker.prototype.getLngLat=function(){return this._lngLat},Marker.prototype.setLngLat=function(t){return this._lngLat=LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},Marker.prototype.getElement=function(){return this._element},Marker.prototype.setPopup=function(t){return this._popup&&(this._popup.remove(),this._popup=null),t&&("offset"in t.options||(t.options.offset=this._offset),this._popup=t,this._popup.setLngLat(this._lngLat)),this},Marker.prototype._onMapClick=function(t){var e=t.originalEvent.target,r=this._element;this._popup&&(e===r||r.contains(e))&&this.togglePopup()},Marker.prototype.getPopup=function(){return this._popup},Marker.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},Marker.prototype._update=function(t){this._map&&(this._map.transform.renderWorldCopies&&(this._lngLat=smartWrap(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset),t&&"moveend"!==t.type||(this._pos=this._pos.round()),DOM.setTransform(this._element,"translate(-50%, -50%) translate("+this._pos.x+"px, "+this._pos.y+"px)"))},module.exports=Marker;
-},{"../geo/lng_lat":68,"../util/dom":252,"../util/smart_wrap":262,"../util/util":266,"@mapbox/point-geometry":2}],242:[function(_dereq_,module,exports){
-"use strict";function normalizeOffset(t){if(t){if("number"==typeof t){var o=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{top:new Point(0,t),"top-left":new Point(o,o),"top-right":new Point(-o,o),bottom:new Point(0,-t),"bottom-left":new Point(o,-o),"bottom-right":new Point(-o,-o),left:new Point(t,0),right:new Point(-t,0)}}if(t instanceof Point||Array.isArray(t)){var e=Point.convert(t);return{top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{top:Point.convert(t.top||[0,0]),"top-left":Point.convert(t["top-left"]||[0,0]),"top-right":Point.convert(t["top-right"]||[0,0]),bottom:Point.convert(t.bottom||[0,0]),"bottom-left":Point.convert(t["bottom-left"]||[0,0]),"bottom-right":Point.convert(t["bottom-right"]||[0,0]),left:Point.convert(t.left||[0,0]),right:Point.convert(t.right||[0,0])}}return normalizeOffset(new Point(0,0))}var util=_dereq_("../util/util"),Evented=_dereq_("../util/evented"),DOM=_dereq_("../util/dom"),LngLat=_dereq_("../geo/lng_lat"),Point=_dereq_("@mapbox/point-geometry"),window=_dereq_("../util/window"),smartWrap=_dereq_("../util/smart_wrap"),defaultOptions={closeButton:!0,closeOnClick:!0},Popup=function(t){function o(o){t.call(this),this.options=util.extend(Object.create(defaultOptions),o),util.bindAll(["_update","_onClickClose"],this)}return t&&(o.__proto__=t),o.prototype=Object.create(t&&t.prototype),o.prototype.constructor=o,o.prototype.addTo=function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},o.prototype.isOpen=function(){return!!this._map},o.prototype.remove=function(){return this._content&&DOM.remove(this._content),this._container&&(DOM.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(t){return this._lngLat=LngLat.convert(t),this._pos=null,this._update(),this},o.prototype.setText=function(t){return this.setDOMContent(window.document.createTextNode(t))},o.prototype.setHTML=function(t){var o,e=window.document.createDocumentFragment(),n=window.document.createElement("body");for(n.innerHTML=t;;){if(!(o=n.firstChild))break;e.appendChild(o)}return this.setDOMContent(e)},o.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},o.prototype._createContent=function(){this._content&&DOM.remove(this._content),this._content=DOM.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=DOM.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClickClose))},o.prototype._update=function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=DOM.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=DOM.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content)),this._map.transform.renderWorldCopies&&(this._lngLat=smartWrap(this._lngLat,this._pos,this._map.transform));var t=this._pos=this._map.project(this._lngLat),o=this.options.anchor,e=normalizeOffset(this.options.offset);if(!o){var n=this._container.offsetWidth,i=this._container.offsetHeight;o=t.y+e.bottom.y<i?["top"]:t.y>this._map.transform.height-i?["bottom"]:[],t.x<n/2?o.push("left"):t.x>this._map.transform.width-n/2&&o.push("right"),o=0===o.length?"bottom":o.join("-")}var r=t.add(e[o]).round(),s={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%)"},p=this._container.classList;for(var a in s)p.remove("mapboxgl-popup-anchor-"+a);p.add("mapboxgl-popup-anchor-"+o),DOM.setTransform(this._container,s[o]+" translate("+r.x+"px,"+r.y+"px)")}},o.prototype._onClickClose=function(){this.remove()},o}(Evented);module.exports=Popup;
-},{"../geo/lng_lat":68,"../util/dom":252,"../util/evented":253,"../util/smart_wrap":262,"../util/util":266,"../util/window":247,"@mapbox/point-geometry":2}],243:[function(_dereq_,module,exports){
-"use strict";var util=_dereq_("./util"),Actor=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,util.bindAll(["receive"],this),this.target.addEventListener("message",this.receive,!1)};Actor.prototype.send=function(t,e,r,a,i){var s=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[s]=r),this.target.postMessage({targetMapId:i,sourceMapId:this.mapId,type:t,id:String(s),data:e},a)},Actor.prototype.receive=function(t){var e,r=this,a=t.data,i=a.id;if(!a.targetMapId||this.mapId===a.targetMapId){var s=function(t,e,a){r.target.postMessage({sourceMapId:r.mapId,type:"<response>",id:String(i),error:t?String(t):null,data:e},a)};if("<response>"===a.type)e=this.callbacks[a.id],delete this.callbacks[a.id],e&&a.error?e(new Error(a.error)):e&&e(null,a.data);else if(void 0!==a.id&&this.parent[a.type])this.parent[a.type](a.sourceMapId,a.data,s);else if(void 0!==a.id&&this.parent.getWorkerSource){var o=a.type.split("."),p=this.parent.getWorkerSource(a.sourceMapId,o[0]);p[o[1]](a.data,s)}else this.parent[a.type](a.data)}},Actor.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1)},module.exports=Actor;
-},{"./util":266}],244:[function(_dereq_,module,exports){
-"use strict";function makeRequest(e){var t=new window.XMLHttpRequest;t.open("GET",e.url,!0);for(var r in e.headers)t.setRequestHeader(r,e.headers[r]);return t.withCredentials="include"===e.credentials,t}function sameOrigin(e){var t=window.document.createElement("a");return t.href=e,t.protocol===window.document.location.protocol&&t.host===window.document.location.host}var window=_dereq_("./window"),ResourceType={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};exports.ResourceType=ResourceType,"function"==typeof Object.freeze&&Object.freeze(ResourceType);var AJAXError=function(e){function t(t,r){e.call(this,t),this.status=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error);exports.getJSON=function(e,t){var r=makeRequest(e);return r.setRequestHeader("Accept","application/json"),r.onerror=function(){t(new Error(r.statusText))},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var e;try{e=JSON.parse(r.response)}catch(e){return t(e)}t(null,e)}else t(new AJAXError(r.statusText,r.status))},r.send(),r},exports.getArrayBuffer=function(e,t){var r=makeRequest(e);return r.responseType="arraybuffer",r.onerror=function(){t(new Error(r.statusText))},r.onload=function(){var e=r.response;if(0===e.byteLength&&200===r.status)return t(new Error("http status 200 returned without content."));r.status>=200&&r.status<300&&r.response?t(null,{data:e,cacheControl:r.getResponseHeader("Cache-Control"),expires:r.getResponseHeader("Expires")}):t(new AJAXError(r.statusText,r.status))},r.send(),r};var transparentPngUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";exports.getImage=function(e,t){return exports.getArrayBuffer(e,function(e,r){if(e)t(e);else if(r){var n=new window.Image,o=window.URL||window.webkitURL;n.onload=function(){t(null,n),o.revokeObjectURL(n.src)};var s=new window.Blob([new Uint8Array(r.data)],{type:"image/png"});n.cacheControl=r.cacheControl,n.expires=r.expires,n.src=r.data.byteLength?o.createObjectURL(s):transparentPngUrl}})},exports.getVideo=function(e,t){var r=window.document.createElement("video");r.onloadstart=function(){t(null,r)};for(var n=0;n<e.length;n++){var o=window.document.createElement("source");sameOrigin(e[n])||(r.crossOrigin="Anonymous"),o.src=e[n],r.appendChild(o)}return r};
-},{"./window":247}],245:[function(_dereq_,module,exports){
-"use strict";var window=_dereq_("./window"),now=window.performance&&window.performance.now?window.performance.now.bind(window.performance):Date.now.bind(Date),frame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,cancel=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.webkitCancelAnimationFrame||window.msCancelAnimationFrame;module.exports={now:now,frame:function(e){return frame(e)},cancelFrame:function(e){return cancel(e)},timed:function(e,n,t){function a(){if(!i){var r=now();r>=o+n?e.call(t,1):(e.call(t,(r-o)/n),frame(a))}}if(!n)return e.call(t,1),null;var i=!1,o=now();return frame(a),function(){i=!0}},getImageData:function(e){var n=window.document.createElement("canvas"),t=n.getContext("2d");if(!t)throw new Error("failed to create canvas 2d context");return n.width=e.width,n.height=e.height,t.drawImage(e,0,0,e.width,e.height),t.getImageData(0,0,e.width,e.height)},hardwareConcurrency:window.navigator.hardwareConcurrency||4,get devicePixelRatio(){return window.devicePixelRatio},supportsWebp:!1};var webpImgTest=window.document.createElement("img");webpImgTest.onload=function(){module.exports.supportsWebp=!0},webpImgTest.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=";
-},{"./window":247}],246:[function(_dereq_,module,exports){
-"use strict";var WebWorkify=_dereq_("webworkify"),window=_dereq_("../window"),workerURL=window.URL.createObjectURL(new WebWorkify(_dereq_("../../source/worker"),{bare:!0}));module.exports=function(){return new window.Worker(workerURL)};
-},{"../../source/worker":116,"../window":247,"webworkify":48}],247:[function(_dereq_,module,exports){
-"use strict";module.exports=self;
-},{}],248:[function(_dereq_,module,exports){
-"use strict";function compareAreas(e,r){return r.area-e.area}var quickselect=_dereq_("quickselect"),calculateSignedArea=_dereq_("./util").calculateSignedArea;module.exports=function(e,r){var a=e.length;if(a<=1)return[e];for(var t,u,c=[],i=0;i<a;i++){var l=calculateSignedArea(e[i]);0!==l&&(e[i].area=Math.abs(l),void 0===u&&(u=l<0),u===l<0?(t&&c.push(t),t=[e[i]]):t.push(e[i]))}if(t&&c.push(t),r>1)for(var n=0;n<c.length;n++)c[n].length<=r||(quickselect(c[n],r,1,c[n].length-1,compareAreas),c[n]=c[n].slice(0,r));return c};
-},{"./util":266,"quickselect":40}],249:[function(_dereq_,module,exports){
-"use strict";var config={API_URL:"https://api.mapbox.com",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null};module.exports=config;
-},{}],250:[function(_dereq_,module,exports){
-"use strict";var DictionaryCoder=function(r){var t=this;this._stringToNumber={},this._numberToString=[];for(var o=0;o<r.length;o++){var i=r[o];t._stringToNumber[i]=o,t._numberToString[o]=i}};DictionaryCoder.prototype.encode=function(r){return this._stringToNumber[r]},DictionaryCoder.prototype.decode=function(r){return this._numberToString[r]},module.exports=DictionaryCoder;
-},{}],251:[function(_dereq_,module,exports){
-"use strict";var util=_dereq_("./util"),Actor=_dereq_("./actor"),Dispatcher=function(t,r){var o=this;this.workerPool=t,this.actors=[],this.currentActor=0,this.id=util.uniqueId();for(var i=this.workerPool.acquire(this.id),e=0;e<i.length;e++){var s=i[e],c=new Actor(s,r,o.id);c.name="Worker "+e,o.actors.push(c)}};Dispatcher.prototype.broadcast=function(t,r,o){o=o||function(){},util.asyncAll(this.actors,function(o,i){o.send(t,r,i)},o)},Dispatcher.prototype.send=function(t,r,o,i,e){return("number"!=typeof i||isNaN(i))&&(i=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[i].send(t,r,o,e),i},Dispatcher.prototype.remove=function(){this.actors.forEach(function(t){t.remove()}),this.actors=[],this.workerPool.release(this.id)},module.exports=Dispatcher;
-},{"./actor":243,"./util":266}],252:[function(_dereq_,module,exports){
-"use strict";function testProp(e){for(var t=0;t<e.length;t++)if(e[t]in docStyle)return e[t];return e[0]}var Point=_dereq_("@mapbox/point-geometry"),window=_dereq_("./window");exports.create=function(e,t,n){var o=window.document.createElement(e);return t&&(o.className=t),n&&n.appendChild(o),o},exports.createNS=function(e,t){return window.document.createElementNS(e,t)};var docStyle=window.document.documentElement.style,selectProp=testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),userSelect;exports.disableDrag=function(){selectProp&&(userSelect=docStyle[selectProp],docStyle[selectProp]="none")},exports.enableDrag=function(){selectProp&&(docStyle[selectProp]=userSelect)};var transformProp=testProp(["transform","WebkitTransform"]);exports.setTransform=function(e,t){e.style[transformProp]=t};var suppressClick=function(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",suppressClick,!0)};exports.suppressClick=function(){window.addEventListener("click",suppressClick,!0),window.setTimeout(function(){window.removeEventListener("click",suppressClick,!0)},0)},exports.mousePos=function(e,t){var n=e.getBoundingClientRect();return t=t.touches?t.touches[0]:t,new Point(t.clientX-n.left-e.clientLeft,t.clientY-n.top-e.clientTop)},exports.touchPos=function(e,t){for(var n=e.getBoundingClientRect(),o=[],r="touchend"===t.type?t.changedTouches:t.touches,c=0;c<r.length;c++)o.push(new Point(r[c].clientX-n.left-e.clientLeft,r[c].clientY-n.top-e.clientTop));return o},exports.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};
-},{"./window":247,"@mapbox/point-geometry":2}],253:[function(_dereq_,module,exports){
-"use strict";function _addEventListener(e,t,n){n[e]=n[e]||[],n[e].push(t)}function _removeEventListener(e,t,n){if(n&&n[e]){var i=n[e].indexOf(t);-1!==i&&n[e].splice(i,1)}}var util=_dereq_("./util"),Evented=function(){};Evented.prototype.on=function(e,t){return this._listeners=this._listeners||{},_addEventListener(e,t,this._listeners),this},Evented.prototype.off=function(e,t){return _removeEventListener(e,t,this._listeners),_removeEventListener(e,t,this._oneTimeListeners),this},Evented.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},_addEventListener(e,t,this._oneTimeListeners),this},Evented.prototype.fire=function(e,t){var n=this;if(this.listens(e)){t=util.extend({},t,{type:e,target:this});for(var i=this._listeners&&this._listeners[e]?this._listeners[e].slice():[],s=0;s<i.length;s++)i[s].call(n,t);for(var r=this._oneTimeListeners&&this._oneTimeListeners[e]?this._oneTimeListeners[e].slice():[],o=0;o<r.length;o++)r[o].call(n,t),_removeEventListener(e,r[o],n._oneTimeListeners);this._eventedParent&&this._eventedParent.fire(e,util.extend({},t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData))}else util.endsWith(e,"error")&&console.error(t&&t.error||t||"Empty error event");return this},Evented.prototype.listens=function(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},Evented.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this},module.exports=Evented;
-},{"./util":266}],254:[function(_dereq_,module,exports){
-"use strict";function compareMax(e,t){return t.max-e.max}function Cell(e,t,n,o){this.p=new Point(e,t),this.h=n,this.d=pointToPolygonDist(this.p,o),this.max=this.d+this.h*Math.SQRT2}function pointToPolygonDist(e,t){for(var n=!1,o=1/0,r=0;r<t.length;r++)for(var i=t[r],l=0,u=i.length,a=u-1;l<u;a=l++){var s=i[l],p=i[a];s.y>e.y!=p.y>e.y&&e.x<(p.x-s.x)*(e.y-s.y)/(p.y-s.y)+s.x&&(n=!n),o=Math.min(o,distToSegmentSquared(e,s,p))}return(n?1:-1)*Math.sqrt(o)}function getCentroidCell(e){for(var t=0,n=0,o=0,r=e[0],i=0,l=r.length,u=l-1;i<l;u=i++){var a=r[i],s=r[u],p=a.x*s.y-s.x*a.y;n+=(a.x+s.x)*p,o+=(a.y+s.y)*p,t+=3*p}return new Cell(n/t,o/t,0,e)}var Queue=_dereq_("tinyqueue"),Point=_dereq_("@mapbox/point-geometry"),distToSegmentSquared=_dereq_("./intersection_tests").distToSegmentSquared;module.exports=function(e,t,n){void 0===t&&(t=1),void 0===n&&(n=!1);for(var o=1/0,r=1/0,i=-1/0,l=-1/0,u=e[0],a=0;a<u.length;a++){var s=u[a];(!a||s.x<o)&&(o=s.x),(!a||s.y<r)&&(r=s.y),(!a||s.x>i)&&(i=s.x),(!a||s.y>l)&&(l=s.y)}var p=i-o,h=l-r,d=Math.min(p,h),x=d/2,y=new Queue(null,compareMax);if(0===d)return new Point(o,r);for(var g=o;g<i;g+=d)for(var f=r;f<l;f+=d)y.push(new Cell(g+x,f+x,x,e));for(var m=getCentroidCell(e),v=y.length;y.length;){var c=y.pop();(c.d>m.d||!m.d)&&(m=c,n&&console.log("found best %d after %d probes",Math.round(1e4*c.d)/1e4,v)),c.max-m.d<=t||(x=c.h/2,y.push(new Cell(c.p.x-x,c.p.y-x,x,e)),y.push(new Cell(c.p.x+x,c.p.y-x,x,e)),y.push(new Cell(c.p.x-x,c.p.y+x,x,e)),y.push(new Cell(c.p.x+x,c.p.y+x,x,e)),v+=4)}return n&&(console.log("num probes: "+v),console.log("best distance: "+m.d)),m.p};
-},{"./intersection_tests":257,"@mapbox/point-geometry":2,"tinyqueue":42}],255:[function(_dereq_,module,exports){
-"use strict";var WorkerPool=_dereq_("./worker_pool"),globalWorkerPool;module.exports=function(){return globalWorkerPool||(globalWorkerPool=new WorkerPool),globalWorkerPool};
-},{"./worker_pool":269}],256:[function(_dereq_,module,exports){
-"use strict";function createImage(e,t,i){var h=e.width,a=e.height;if(i){if(i.length!==h*a*t)throw new RangeError("mismatched image size")}else i=new Uint8Array(h*a*t);return{width:h,height:a,data:i}}function resizeImage(e,t,i){var h=t.width,a=t.height;if(h===e.width&&a===e.height)return e;var r=createImage({width:h,height:a},i);copyImage(e,r,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,h),height:Math.min(e.height,a)},i),e.width=h,e.height=a,e.data=r.data}function copyImage(e,t,i,h,a,r){if(0===a.width||0===a.height)return t;if(a.width>e.width||a.height>e.height||i.x>e.width-a.width||i.y>e.height-a.height)throw new RangeError("out of range source coordinates for image copy");if(a.width>t.width||a.height>t.height||h.x>t.width-a.width||h.y>t.height-a.height)throw new RangeError("out of range destination coordinates for image copy");for(var g=e.data,n=t.data,o=0;o<a.height;o++)for(var m=((i.y+o)*e.width+i.x)*r,c=((h.y+o)*t.width+h.x)*r,d=0;d<a.width*r;d++)n[c+d]=g[m+d];return t}var AlphaImage=function(){};AlphaImage.create=function(e,t){return createImage(e,1,t)},AlphaImage.resize=function(e,t){resizeImage(e,t,1)},AlphaImage.copy=function(e,t,i,h,a){copyImage(e,t,i,h,a,1)};var RGBAImage=function(){};RGBAImage.create=function(e,t){return createImage(e,4,t)},RGBAImage.resize=function(e,t){resizeImage(e,t,4)},RGBAImage.copy=function(e,t,i,h,a){copyImage(e,t,i,h,a,4)},module.exports={AlphaImage:AlphaImage,RGBAImage:RGBAImage};
-},{}],257:[function(_dereq_,module,exports){
-"use strict";function polygonIntersectsPolygon(n,t){for(var e=0;e<n.length;e++)if(polygonContainsPoint(t,n[e]))return!0;for(var r=0;r<t.length;r++)if(polygonContainsPoint(n,t[r]))return!0;return!!lineIntersectsLine(n,t)}function multiPolygonIntersectsBufferedMultiPoint(n,t,e){for(var r=0;r<n.length;r++)for(var o=n[r],i=0;i<t.length;i++)for(var l=t[i],u=0;u<l.length;u++){var s=l[u];if(polygonContainsPoint(o,s))return!0;if(pointIntersectsBufferedLine(s,o,e))return!0}return!1}function multiPolygonIntersectsMultiPolygon(n,t){if(1===n.length&&1===n[0].length)return multiPolygonContainsPoint(t,n[0][0]);for(var e=0;e<t.length;e++)for(var r=t[e],o=0;o<r.length;o++)if(multiPolygonContainsPoint(n,r[o]))return!0;for(var i=0;i<n.length;i++){for(var l=n[i],u=0;u<l.length;u++)if(multiPolygonContainsPoint(t,l[u]))return!0;for(var s=0;s<t.length;s++)if(lineIntersectsLine(l,t[s]))return!0}return!1}function multiPolygonIntersectsBufferedMultiLine(n,t,e){for(var r=0;r<t.length;r++)for(var o=t[r],i=0;i<n.length;i++){var l=n[i];if(l.length>=3)for(var u=0;u<o.length;u++)if(polygonContainsPoint(l,o[u]))return!0;if(lineIntersectsBufferedLine(l,o,e))return!0}return!1}function lineIntersectsBufferedLine(n,t,e){if(n.length>1){if(lineIntersectsLine(n,t))return!0;for(var r=0;r<t.length;r++)if(pointIntersectsBufferedLine(t[r],n,e))return!0}for(var o=0;o<n.length;o++)if(pointIntersectsBufferedLine(n[o],t,e))return!0;return!1}function lineIntersectsLine(n,t){if(0===n.length||0===t.length)return!1;for(var e=0;e<n.length-1;e++)for(var r=n[e],o=n[e+1],i=0;i<t.length-1;i++){var l=t[i],u=t[i+1];if(lineSegmentIntersectsLineSegment(r,o,l,u))return!0}return!1}function lineSegmentIntersectsLineSegment(n,t,e,r){return isCounterClockwise(n,e,r)!==isCounterClockwise(t,e,r)&&isCounterClockwise(n,t,e)!==isCounterClockwise(n,t,r)}function pointIntersectsBufferedLine(n,t,e){var r=e*e;if(1===t.length)return n.distSqr(t[0])<r;for(var o=1;o<t.length;o++){if(distToSegmentSquared(n,t[o-1],t[o])<r)return!0}return!1}function distToSegmentSquared(n,t,e){var r=t.distSqr(e);if(0===r)return n.distSqr(t);var o=((n.x-t.x)*(e.x-t.x)+(n.y-t.y)*(e.y-t.y))/r;return o<0?n.distSqr(t):o>1?n.distSqr(e):n.distSqr(e.sub(t)._mult(o)._add(t))}function multiPolygonContainsPoint(n,t){for(var e,r,o,i=!1,l=0;l<n.length;l++){e=n[l];for(var u=0,s=e.length-1;u<e.length;s=u++)r=e[u],o=e[s],r.y>t.y!=o.y>t.y&&t.x<(o.x-r.x)*(t.y-r.y)/(o.y-r.y)+r.x&&(i=!i)}return i}function polygonContainsPoint(n,t){for(var e=!1,r=0,o=n.length-1;r<n.length;o=r++){var i=n[r],l=n[o];i.y>t.y!=l.y>t.y&&t.x<(l.x-i.x)*(t.y-i.y)/(l.y-i.y)+i.x&&(e=!e)}return e}var ref=_dereq_("./util"),isCounterClockwise=ref.isCounterClockwise;module.exports={multiPolygonIntersectsBufferedMultiPoint:multiPolygonIntersectsBufferedMultiPoint,multiPolygonIntersectsMultiPolygon:multiPolygonIntersectsMultiPolygon,multiPolygonIntersectsBufferedMultiLine:multiPolygonIntersectsBufferedMultiLine,polygonIntersectsPolygon:polygonIntersectsPolygon,distToSegmentSquared:distToSegmentSquared};
-},{"./util":266}],258:[function(_dereq_,module,exports){
-"use strict";var unicodeBlockLookup={"Latin-1 Supplement":function(n){return n>=128&&n<=255},Arabic:function(n){return n>=1536&&n<=1791},"Arabic Supplement":function(n){return n>=1872&&n<=1919},"Arabic Extended-A":function(n){return n>=2208&&n<=2303},"Hangul Jamo":function(n){return n>=4352&&n<=4607},"Unified Canadian Aboriginal Syllabics":function(n){return n>=5120&&n<=5759},"Unified Canadian Aboriginal Syllabics Extended":function(n){return n>=6320&&n<=6399},"General Punctuation":function(n){return n>=8192&&n<=8303},"Letterlike Symbols":function(n){return n>=8448&&n<=8527},"Number Forms":function(n){return n>=8528&&n<=8591},"Miscellaneous Technical":function(n){return n>=8960&&n<=9215},"Control Pictures":function(n){return n>=9216&&n<=9279},"Optical Character Recognition":function(n){return n>=9280&&n<=9311},"Enclosed Alphanumerics":function(n){return n>=9312&&n<=9471},"Geometric Shapes":function(n){return n>=9632&&n<=9727},"Miscellaneous Symbols":function(n){return n>=9728&&n<=9983},"Miscellaneous Symbols and Arrows":function(n){return n>=11008&&n<=11263},"CJK Radicals Supplement":function(n){return n>=11904&&n<=12031},"Kangxi Radicals":function(n){return n>=12032&&n<=12255},"Ideographic Description Characters":function(n){return n>=12272&&n<=12287},"CJK Symbols and Punctuation":function(n){return n>=12288&&n<=12351},Hiragana:function(n){return n>=12352&&n<=12447},Katakana:function(n){return n>=12448&&n<=12543},Bopomofo:function(n){return n>=12544&&n<=12591},"Hangul Compatibility Jamo":function(n){return n>=12592&&n<=12687},Kanbun:function(n){return n>=12688&&n<=12703},"Bopomofo Extended":function(n){return n>=12704&&n<=12735},"CJK Strokes":function(n){return n>=12736&&n<=12783},"Katakana Phonetic Extensions":function(n){return n>=12784&&n<=12799},"Enclosed CJK Letters and Months":function(n){return n>=12800&&n<=13055},"CJK Compatibility":function(n){return n>=13056&&n<=13311},"CJK Unified Ideographs Extension A":function(n){return n>=13312&&n<=19903},"Yijing Hexagram Symbols":function(n){return n>=19904&&n<=19967},"CJK Unified Ideographs":function(n){return n>=19968&&n<=40959},"Yi Syllables":function(n){return n>=40960&&n<=42127},"Yi Radicals":function(n){return n>=42128&&n<=42191},"Hangul Jamo Extended-A":function(n){return n>=43360&&n<=43391},"Hangul Syllables":function(n){return n>=44032&&n<=55215},"Hangul Jamo Extended-B":function(n){return n>=55216&&n<=55295},"Private Use Area":function(n){return n>=57344&&n<=63743},"CJK Compatibility Ideographs":function(n){return n>=63744&&n<=64255},"Arabic Presentation Forms-A":function(n){return n>=64336&&n<=65023},"Vertical Forms":function(n){return n>=65040&&n<=65055},"CJK Compatibility Forms":function(n){return n>=65072&&n<=65103},"Small Form Variants":function(n){return n>=65104&&n<=65135},"Arabic Presentation Forms-B":function(n){return n>=65136&&n<=65279},"Halfwidth and Fullwidth Forms":function(n){return n>=65280&&n<=65519}};module.exports=unicodeBlockLookup;
-},{}],259:[function(_dereq_,module,exports){
-"use strict";var LRUCache=function(t,e){this.max=t,this.onRemove=e,this.reset()};LRUCache.prototype.reset=function(){var t=this;for(var e in t.data)t.onRemove(t.data[e]);return this.data={},this.order=[],this},LRUCache.prototype.add=function(t,e){if(this.has(t))this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t);else if(this.data[t]=e,this.order.push(t),this.order.length>this.max){var r=this.getAndRemove(this.order[0]);r&&this.onRemove(r)}return this},LRUCache.prototype.has=function(t){return t in this.data},LRUCache.prototype.keys=function(){return this.order},LRUCache.prototype.getAndRemove=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},LRUCache.prototype.get=function(t){return this.has(t)?this.data[t]:null},LRUCache.prototype.remove=function(t){if(!this.has(t))return this;var e=this.data[t];return delete this.data[t],this.onRemove(e),this.order.splice(this.order.indexOf(t),1),this},LRUCache.prototype.setMaxSize=function(t){var e=this;for(this.max=t;this.order.length>this.max;){var r=e.getAndRemove(e.order[0]);r&&e.onRemove(r)}return this},module.exports=LRUCache;
-},{}],260:[function(_dereq_,module,exports){
-"use strict";function makeAPIURL(r,e){var t=parseUrl(config.API_URL);if(r.protocol=t.protocol,r.authority=t.authority,"/"!==t.path&&(r.path=""+t.path+r.path),!config.REQUIRE_ACCESS_TOKEN)return formatUrl(r);if(!(e=e||config.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+help);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+help);return r.params.push("access_token="+e),formatUrl(r)}function isMapboxURL(r){return 0===r.indexOf("mapbox:")}function replaceTempAccessToken(r){for(var e=0;e<r.length;e++)0===r[e].indexOf("access_token=tk.")&&(r[e]="access_token="+(config.ACCESS_TOKEN||""))}function parseUrl(r){var e=r.match(urlRe);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function formatUrl(r){var e=r.params.length?"?"+r.params.join("&"):"";return r.protocol+"://"+r.authority+r.path+e}var config=_dereq_("./config"),browser=_dereq_("./browser"),help="See https://www.mapbox.com/api-documentation/#access-tokens";exports.isMapboxURL=isMapboxURL,exports.normalizeStyleURL=function(r,e){if(!isMapboxURL(r))return r;var t=parseUrl(r);return t.path="/styles/v1"+t.path,makeAPIURL(t,e)},exports.normalizeGlyphsURL=function(r,e){if(!isMapboxURL(r))return r;var t=parseUrl(r);return t.path="/fonts/v1"+t.path,makeAPIURL(t,e)},exports.normalizeSourceURL=function(r,e){if(!isMapboxURL(r))return r;var t=parseUrl(r);return t.path="/v4/"+t.authority+".json",t.params.push("secure"),makeAPIURL(t,e)},exports.normalizeSpriteURL=function(r,e,t,a){var o=parseUrl(r);return isMapboxURL(r)?(o.path="/styles/v1"+o.path+"/sprite"+e+t,makeAPIURL(o,a)):(o.path+=""+e+t,formatUrl(o))};var imageExtensionRe=/(\.(png|jpg)\d*)(?=$)/;exports.normalizeTileURL=function(r,e,t){if(!e||!isMapboxURL(e))return r;var a=parseUrl(r),o=browser.devicePixelRatio>=2||512===t?"@2x":"",p=browser.supportsWebp?".webp":"$1";return a.path=a.path.replace(imageExtensionRe,""+o+p),replaceTempAccessToken(a.params),formatUrl(a)};var urlRe=/^(\w+):\/\/([^\/?]*)(\/[^?]+)?\??(.+)?/;
-},{"./browser":245,"./config":249}],261:[function(_dereq_,module,exports){
-"use strict";var isChar=_dereq_("./is_char_in_unicode_block");module.exports.allowsIdeographicBreaking=function(a){for(var i=0,r=a;i<r.length;i+=1){var s=r[i];if(!exports.charAllowsIdeographicBreaking(s.charCodeAt(0)))return!1}return!0},module.exports.allowsVerticalWritingMode=function(a){for(var i=0,r=a;i<r.length;i+=1){var s=r[i];if(exports.charHasUprightVerticalOrientation(s.charCodeAt(0)))return!0}return!1},module.exports.allowsLetterSpacing=function(a){for(var i=0,r=a;i<r.length;i+=1){var s=r[i];if(!exports.charAllowsLetterSpacing(s.charCodeAt(0)))return!1}return!0},module.exports.charAllowsLetterSpacing=function(a){return!isChar.Arabic(a)&&(!isChar["Arabic Supplement"](a)&&(!isChar["Arabic Extended-A"](a)&&(!isChar["Arabic Presentation Forms-A"](a)&&!isChar["Arabic Presentation Forms-B"](a))))},module.exports.charAllowsIdeographicBreaking=function(a){return!(a<11904)&&(!!isChar["Bopomofo Extended"](a)||(!!isChar.Bopomofo(a)||(!!isChar["CJK Compatibility Forms"](a)||(!!isChar["CJK Compatibility Ideographs"](a)||(!!isChar["CJK Compatibility"](a)||(!!isChar["CJK Radicals Supplement"](a)||(!!isChar["CJK Strokes"](a)||(!!isChar["CJK Symbols and Punctuation"](a)||(!!isChar["CJK Unified Ideographs Extension A"](a)||(!!isChar["CJK Unified Ideographs"](a)||(!!isChar["Enclosed CJK Letters and Months"](a)||(!!isChar["Halfwidth and Fullwidth Forms"](a)||(!!isChar.Hiragana(a)||(!!isChar["Ideographic Description Characters"](a)||(!!isChar["Kangxi Radicals"](a)||(!!isChar["Katakana Phonetic Extensions"](a)||(!!isChar.Katakana(a)||(!!isChar["Vertical Forms"](a)||(!!isChar["Yi Radicals"](a)||!!isChar["Yi Syllables"](a))))))))))))))))))))},exports.charHasUprightVerticalOrientation=function(a){return 746===a||747===a||!(a<4352)&&(!!isChar["Bopomofo Extended"](a)||(!!isChar.Bopomofo(a)||(!(!isChar["CJK Compatibility Forms"](a)||a>=65097&&a<=65103)||(!!isChar["CJK Compatibility Ideographs"](a)||(!!isChar["CJK Compatibility"](a)||(!!isChar["CJK Radicals Supplement"](a)||(!!isChar["CJK Strokes"](a)||(!(!isChar["CJK Symbols and Punctuation"](a)||a>=12296&&a<=12305||a>=12308&&a<=12319||12336===a)||(!!isChar["CJK Unified Ideographs Extension A"](a)||(!!isChar["CJK Unified Ideographs"](a)||(!!isChar["Enclosed CJK Letters and Months"](a)||(!!isChar["Hangul Compatibility Jamo"](a)||(!!isChar["Hangul Jamo Extended-A"](a)||(!!isChar["Hangul Jamo Extended-B"](a)||(!!isChar["Hangul Jamo"](a)||(!!isChar["Hangul Syllables"](a)||(!!isChar.Hiragana(a)||(!!isChar["Ideographic Description Characters"](a)||(!!isChar.Kanbun(a)||(!!isChar["Kangxi Radicals"](a)||(!!isChar["Katakana Phonetic Extensions"](a)||(!(!isChar.Katakana(a)||12540===a)||(!(!isChar["Halfwidth and Fullwidth Forms"](a)||65288===a||65289===a||65293===a||a>=65306&&a<=65310||65339===a||65341===a||65343===a||a>=65371&&a<=65503||65507===a||a>=65512&&a<=65519)||(!(!isChar["Small Form Variants"](a)||a>=65112&&a<=65118||a>=65123&&a<=65126)||(!!isChar["Unified Canadian Aboriginal Syllabics"](a)||(!!isChar["Unified Canadian Aboriginal Syllabics Extended"](a)||(!!isChar["Vertical Forms"](a)||(!!isChar["Yijing Hexagram Symbols"](a)||(!!isChar["Yi Syllables"](a)||!!isChar["Yi Radicals"](a))))))))))))))))))))))))))))))},exports.charHasNeutralVerticalOrientation=function(a){return!(!isChar["Latin-1 Supplement"](a)||167!==a&&169!==a&&174!==a&&177!==a&&188!==a&&189!==a&&190!==a&&215!==a&&247!==a)||(!(!isChar["General Punctuation"](a)||8214!==a&&8224!==a&&8225!==a&&8240!==a&&8241!==a&&8251!==a&&8252!==a&&8258!==a&&8263!==a&&8264!==a&&8265!==a&&8273!==a)||(!!isChar["Letterlike Symbols"](a)||(!!isChar["Number Forms"](a)||(!(!isChar["Miscellaneous Technical"](a)||!(a>=8960&&a<=8967||a>=8972&&a<=8991||a>=8996&&a<=9e3||9003===a||a>=9085&&a<=9114||a>=9150&&a<=9165||9167===a||a>=9169&&a<=9179||a>=9186&&a<=9215))||(!(!isChar["Control Pictures"](a)||9251===a)||(!!isChar["Optical Character Recognition"](a)||(!!isChar["Enclosed Alphanumerics"](a)||(!!isChar["Geometric Shapes"](a)||(!(!isChar["Miscellaneous Symbols"](a)||a>=9754&&a<=9759)||(!(!isChar["Miscellaneous Symbols and Arrows"](a)||!(a>=11026&&a<=11055||a>=11088&&a<=11097||a>=11192&&a<=11243))||(!!isChar["CJK Symbols and Punctuation"](a)||(!!isChar.Katakana(a)||(!!isChar["Private Use Area"](a)||(!!isChar["CJK Compatibility Forms"](a)||(!!isChar["Small Form Variants"](a)||(!!isChar["Halfwidth and Fullwidth Forms"](a)||(8734===a||8756===a||8757===a||a>=9984&&a<=10087||a>=10102&&a<=10131||65532===a||65533===a)))))))))))))))))},exports.charHasRotatedVerticalOrientation=function(a){return!(exports.charHasUprightVerticalOrientation(a)||exports.charHasNeutralVerticalOrientation(a))};
-},{"./is_char_in_unicode_block":258}],262:[function(_dereq_,module,exports){
-"use strict";var LngLat=_dereq_("../geo/lng_lat");module.exports=function(n,t,l){if(n=new LngLat(n.lng,n.lat),t){var a=new LngLat(n.lng-360,n.lat),i=new LngLat(n.lng+360,n.lat),o=l.locationPoint(n).distSqr(t);l.locationPoint(a).distSqr(t)<o?n=a:l.locationPoint(i).distSqr(t)<o&&(n=i)}for(;Math.abs(n.lng-l.center.lng)>180;){var e=l.locationPoint(n);if(e.x>=0&&e.y>=0&&e.x<=l.width&&e.y<=l.height)break;n.lng>l.center.lng?n.lng-=360:n.lng+=360}return n};
-},{"../geo/lng_lat":68}],263:[function(_dereq_,module,exports){
-"use strict";function createStructArrayType(t){var e=JSON.stringify(t);if(structArrayTypeCache[e])return structArrayTypeCache[e];var r=void 0===t.alignment?1:t.alignment,n=0,i=0,a=["Uint8"],o=t.members.map(function(t){a.indexOf(t.type)<0&&a.push(t.type);var e=sizeOf(t.type),o=n=align(n,Math.max(r,e)),s=t.components||1;return i=Math.max(i,e),n+=e*s,{name:t.name,type:t.type,components:s,offset:o}}),s=align(n,Math.max(i,r)),p=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Struct);p.prototype.alignment=r,p.prototype.size=s;for(var y=0,c=o;y<c.length;y+=1)for(var h=c[y],u=0;u<h.components;u++){var f=h.name;if(h.components>1&&(f+=u),f in p.prototype)throw new Error(f+" is a reserved name and cannot be used as a member name.");Object.defineProperty(p.prototype,f,createAccessors(h,u))}var m=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(StructArray);m.prototype.members=o,m.prototype.StructType=p,m.prototype.bytesPerElement=s,m.prototype.emplaceBack=createEmplaceBack(o,s),m.prototype._usedTypes=a,structArrayTypeCache[e]=m;for(var l=0,A=o;l<A.length;l+=1)for(var g=A[l],v=0;v<g.components;v++){var _="get"+g.name;if(g.components>1&&(_+=v),_ in m.prototype)throw new Error(_+" is a reserved name and cannot be used as a member name.");m.prototype[_]=createIndexedMemberComponentGetter(g,v,s)}return m}function align(t,e){return Math.ceil(t/e)*e}function sizeOf(t){return viewTypes[t].BYTES_PER_ELEMENT}function getArrayViewName(t){return t.toLowerCase()}function createEmplaceBack(t,e){for(var r=[],n=[],i="var i = this.length;\nthis.resize(this.length + 1);\n",a=0,o=t;a<o.length;a+=1){var s=o[a],p=sizeOf(s.type);r.indexOf(p)<0&&(r.push(p),i+="var o"+p.toFixed(0)+" = i * "+(e/p).toFixed(0)+";\n");for(var y=0;y<s.components;y++){var c="v"+n.length,h="o"+p.toFixed(0)+" + "+(s.offset/p+y).toFixed(0);i+="this."+getArrayViewName(s.type)+"["+h+"] = "+c+";\n",n.push(c)}}return i+="return i;",new Function(n.toString(),i)}function createMemberComponentString(t,e){var r="this._pos"+sizeOf(t.type).toFixed(0),n=(t.offset/sizeOf(t.type)+e).toFixed(0),i=r+" + "+n;return"this._structArray."+getArrayViewName(t.type)+"["+i+"]"}function createIndexedMemberComponentGetter(t,e,r){var n=(t.offset/sizeOf(t.type)+e).toFixed(0),i=r/sizeOf(t.type);return new Function("index","return this."+getArrayViewName(t.type)+"[index * "+i+" + "+n+"];")}function createAccessors(t,e){var r=createMemberComponentString(t,e);return{get:new Function("return "+r+";"),set:new Function("x",r+" = x;")}}module.exports=createStructArrayType;var viewTypes={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Struct=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},DEFAULT_CAPACITY=128,RESIZE_MULTIPLIER=5,StructArray=function(t){this.isTransferred=!1,void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))};StructArray.serialize=function(){return{members:this.prototype.members,alignment:this.prototype.StructType.prototype.alignment}},StructArray.prototype.serialize=function(t){return this._trim(),t&&(this.isTransferred=!0,t.push(this.arrayBuffer)),{length:this.length,arrayBuffer:this.arrayBuffer}},StructArray.prototype.get=function(t){return new this.StructType(this,t)},StructArray.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},StructArray.prototype.clear=function(){this.length=0},StructArray.prototype.resize=function(t){if(this.length=t,t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*RESIZE_MULTIPLIER),DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},StructArray.prototype._refreshViews=function(){for(var t=this,e=0,r=t._usedTypes;e<r.length;e+=1){var n=r[e];t[getArrayViewName(n)]=new viewTypes[n](t.arrayBuffer)}},StructArray.prototype.toArray=function(t,e){for(var r=this,n=[],i=t;i<e;i++){var a=r.get(i);n.push(a)}return n};var structArrayTypeCache={};
-},{}],264:[function(_dereq_,module,exports){
-"use strict";module.exports=function(t,n){var u=!1,e=0,r=function(){e=0,u&&(t(),e=setTimeout(r,n),u=!1)};return function(){return u=!0,e||r(),e}};
-},{}],265:[function(_dereq_,module,exports){
-"use strict";function resolveTokens(e,n){return n.replace(/{([^{}]+)}/g,function(n,r){return r in e?String(e[r]):""})}module.exports=resolveTokens;
-},{}],266:[function(_dereq_,module,exports){
-"use strict";var UnitBezier=_dereq_("@mapbox/unitbezier"),Coordinate=_dereq_("../geo/coordinate"),Point=_dereq_("@mapbox/point-geometry");exports.easeCubicInOut=function(r){if(r<=0)return 0;if(r>=1)return 1;var e=r*r,t=e*r;return 4*(r<.5?t:3*(r-e)+t-.75)},exports.bezier=function(r,e,t,n){var o=new UnitBezier(r,e,t,n);return function(r){return o.solve(r)}},exports.ease=exports.bezier(.25,.1,.25,1),exports.clamp=function(r,e,t){return Math.min(t,Math.max(e,r))},exports.wrap=function(r,e,t){var n=t-e,o=((r-e)%n+n)%n+e;return o===e?t:o},exports.asyncAll=function(r,e,t){if(!r.length)return t(null,[]);var n=r.length,o=new Array(r.length),a=null;r.forEach(function(r,i){e(r,function(r,e){r&&(a=r),o[i]=e,0==--n&&t(a,o)})})},exports.values=function(r){var e=[];for(var t in r)e.push(r[t]);return e},exports.keysDifference=function(r,e){var t=[];for(var n in r)n in e||t.push(n);return t},exports.extend=function(r){for(var e=[],t=arguments.length-1;t-- >0;)e[t]=arguments[t+1];for(var n=0,o=e;n<o.length;n+=1){var a=o[n];for(var i in a)r[i]=a[i]}return r},exports.pick=function(r,e){for(var t={},n=0;n<e.length;n++){var o=e[n];o in r&&(t[o]=r[o])}return t};var id=1;exports.uniqueId=function(){return id++},exports.bindAll=function(r,e){r.forEach(function(r){e[r]&&(e[r]=e[r].bind(e))})},exports.getCoordinatesCenter=function(r){for(var e=1/0,t=1/0,n=-1/0,o=-1/0,a=0;a<r.length;a++)e=Math.min(e,r[a].column),t=Math.min(t,r[a].row),n=Math.max(n,r[a].column),o=Math.max(o,r[a].row);var i=n-e,u=o-t,s=Math.max(i,u),c=Math.max(0,Math.floor(-Math.log(s)/Math.LN2));return new Coordinate((e+n)/2,(t+o)/2,0).zoomTo(c)},exports.endsWith=function(r,e){return-1!==r.indexOf(e,r.length-e.length)},exports.mapObject=function(r,e,t){var n=this,o={};for(var a in r)o[a]=e.call(t||n,r[a],a,r);return o},exports.filterObject=function(r,e,t){var n=this,o={};for(var a in r)e.call(t||n,r[a],a,r)&&(o[a]=r[a]);return o},exports.deepEqual=function(r,e){if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(var t=0;t<r.length;t++)if(!exports.deepEqual(r[t],e[t]))return!1;return!0}if("object"==typeof r&&null!==r&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(r).length!==Object.keys(e).length)return!1;for(var n in r)if(!exports.deepEqual(r[n],e[n]))return!1;return!0}return r===e},exports.clone=function(r){return Array.isArray(r)?r.map(exports.clone):"object"==typeof r&&r?exports.mapObject(r,exports.clone):r},exports.arraysIntersect=function(r,e){for(var t=0;t<r.length;t++)if(e.indexOf(r[t])>=0)return!0;return!1};var warnOnceHistory={};exports.warnOnce=function(r){warnOnceHistory[r]||("undefined"!=typeof console&&console.warn(r),warnOnceHistory[r]=!0)},exports.isCounterClockwise=function(r,e,t){return(t.y-r.y)*(e.x-r.x)>(e.y-r.y)*(t.x-r.x)},exports.calculateSignedArea=function(r){for(var e=0,t=0,n=r.length,o=n-1,a=void 0,i=void 0;t<n;o=t++)a=r[t],i=r[o],e+=(i.x-a.x)*(a.y+i.y);return e},exports.isClosedPolygon=function(r){if(r.length<4)return!1;var e=r[0],t=r[r.length-1];return!(Math.abs(e.x-t.x)>0||Math.abs(e.y-t.y)>0)&&Math.abs(exports.calculateSignedArea(r))>.01},exports.sphericalToCartesian=function(r){var e=r[0],t=r[1],n=r[2];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)}},exports.parseCacheControl=function(r){var e=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,t={};if(r.replace(e,function(r,e,n,o){var a=n||o;return t[e]=!a||a.toLowerCase(),""}),t["max-age"]){var n=parseInt(t["max-age"],10);isNaN(n)?delete t["max-age"]:t["max-age"]=n}return t};
-},{"../geo/coordinate":67,"@mapbox/point-geometry":2,"@mapbox/unitbezier":5}],267:[function(_dereq_,module,exports){
-"use strict";var Feature=function(e,t,r,o){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=o,this.properties=e.properties,null!=e.id&&(this.id=e.id)},prototypeAccessors={geometry:{}};prototypeAccessors.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},prototypeAccessors.geometry.set=function(e){this._geometry=e},Feature.prototype.toJSON=function(){var e=this,t={geometry:this.geometry};for(var r in e)"_geometry"!==r&&"_vectorTileFeature"!==r&&(t[r]=e[r]);return t},Object.defineProperties(Feature.prototype,prototypeAccessors),module.exports=Feature;
-},{}],268:[function(_dereq_,module,exports){
-"use strict";var scriptDetection=_dereq_("./script_detection");module.exports=function(t){for(var o="",e=0;e<t.length;e++){var r=t.charCodeAt(e+1)||null,l=t.charCodeAt(e-1)||null;(!r||!scriptDetection.charHasRotatedVerticalOrientation(r)||module.exports.lookup[t[e+1]])&&(!l||!scriptDetection.charHasRotatedVerticalOrientation(l)||module.exports.lookup[t[e-1]])&&module.exports.lookup[t[e]]?o+=module.exports.lookup[t[e]]:o+=t[e]}return o},module.exports.lookup={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};
-},{"./script_detection":261}],269:[function(_dereq_,module,exports){
-"use strict";var WebWorker=_dereq_("./web_worker"),WorkerPool=function(){this.active={}};WorkerPool.prototype.acquire=function(r){var e=this;if(!this.workers){var o=_dereq_("../").workerCount;for(this.workers=[];this.workers.length<o;)e.workers.push(new WebWorker)}return this.active[r]=!0,this.workers.slice()},WorkerPool.prototype.release=function(r){delete this.active[r],0===Object.keys(this.active).length&&(this.workers.forEach(function(r){r.terminate()}),this.workers=null)},module.exports=WorkerPool;
-},{"../":73,"./web_worker":246}]},{},[73])(73)
-});
-
-
-//# sourceMappingURL=mapbox-gl.js.map
\ No newline at end of file
diff --git a/deployment/manager/shared/map/mapbox-gl-js/1.2.1/mapbox-gl.css b/deployment/manager/shared/map/mapbox-gl-js/1.2.1/mapbox-gl.css
new file mode 100644
index 000000000..da8c71b42
--- /dev/null
+++ b/deployment/manager/shared/map/mapbox-gl-js/1.2.1/mapbox-gl.css
@@ -0,0 +1,513 @@
+.mapboxgl-map {
+ font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;
+ overflow: hidden;
+ position: relative;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+
+.mapboxgl-map:-webkit-full-screen {
+ width: 100%;
+ height: 100%;
+}
+
+.mapboxgl-canary {
+ background-color: salmon;
+}
+
+.mapboxgl-canvas-container.mapboxgl-interactive,
+.mapboxgl-ctrl-group > button.mapboxgl-ctrl-compass {
+ cursor: -webkit-grab;
+ cursor: -moz-grab;
+ cursor: grab;
+ -moz-user-select: none;
+ -webkit-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.mapboxgl-canvas-container.mapboxgl-interactive:active,
+.mapboxgl-ctrl-group > button.mapboxgl-ctrl-compass:active {
+ cursor: -webkit-grabbing;
+ cursor: -moz-grabbing;
+ cursor: grabbing;
+}
+
+.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,
+.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas {
+ touch-action: pan-x pan-y;
+}
+
+.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,
+.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas {
+ touch-action: pinch-zoom;
+}
+
+.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,
+.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas {
+ touch-action: none;
+}
+
+.mapboxgl-ctrl-top-left,
+.mapboxgl-ctrl-top-right,
+.mapboxgl-ctrl-bottom-left,
+.mapboxgl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }
+.mapboxgl-ctrl-top-left { top: 0; left: 0; }
+.mapboxgl-ctrl-top-right { top: 0; right: 0; }
+.mapboxgl-ctrl-bottom-left { bottom: 0; left: 0; }
+.mapboxgl-ctrl-bottom-right { right: 0; bottom: 0; }
+
+.mapboxgl-ctrl { clear: both; pointer-events: auto; }
+.mapboxgl-ctrl-top-left .mapboxgl-ctrl { margin: 10px 0 0 10px; float: left; }
+.mapboxgl-ctrl-top-right .mapboxgl-ctrl { margin: 10px 10px 0 0; float: right; }
+.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl { margin: 0 0 10px 10px; float: left; }
+.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl { margin: 0 10px 10px 0; float: right; }
+
+.mapboxgl-ctrl-group {
+ border-radius: 4px;
+ overflow: hidden;
+ background: #fff;
+}
+
+.mapboxgl-ctrl-group:not(:empty) {
+ -moz-box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
+ -webkit-box-shadow: 0 0 2px rgba(0, 0, 0, 0.1);
+ box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
+}
+
+.mapboxgl-ctrl-group > button {
+ width: 30px;
+ height: 30px;
+ display: block;
+ padding: 0;
+ outline: none;
+ border: 0;
+ box-sizing: border-box;
+ background-color: transparent;
+ cursor: pointer;
+}
+
+.mapboxgl-ctrl-group > button + button {
+ border-top: 1px solid #ddd;
+}
+
+/* https://bugzilla.mozilla.org/show_bug.cgi?id=140562 */
+.mapboxgl-ctrl > button::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+
+.mapboxgl-ctrl > button:hover {
+ background-color: rgba(0, 0, 0, 0.05);
+}
+
+.mapboxgl-ctrl-icon,
+.mapboxgl-ctrl-icon > .mapboxgl-ctrl-compass-arrow {
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.mapboxgl-ctrl-icon {
+ padding: 5px;
+}
+
+.mapboxgl-ctrl-icon.mapboxgl-ctrl-zoom-out {
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath style='fill:%23333333;' d='m 7,9 c -0.554,0 -1,0.446 -1,1 0,0.554 0.446,1 1,1 l 6,0 c 0.554,0 1,-0.446 1,-1 0,-0.554 -0.446,-1 -1,-1 z'/%3E %3C/svg%3E");
+}
+
+.mapboxgl-ctrl-icon.mapboxgl-ctrl-zoom-in {
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath style='fill:%23333333;' d='M 10 6 C 9.446 6 9 6.4459904 9 7 L 9 9 L 7 9 C 6.446 9 6 9.446 6 10 C 6 10.554 6.446 11 7 11 L 9 11 L 9 13 C 9 13.55401 9.446 14 10 14 C 10.554 14 11 13.55401 11 13 L 11 11 L 13 11 C 13.554 11 14 10.554 14 10 C 14 9.446 13.554 9 13 9 L 11 9 L 11 7 C 11 6.4459904 10.554 6 10 6 z'/%3E %3C/svg%3E");
+}
+
+.mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate {
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E %3Cpath d='M10 4C9 4 9 5 9 5L9 5.1A5 5 0 0 0 5.1 9L5 9C5 9 4 9 4 10 4 11 5 11 5 11L5.1 11A5 5 0 0 0 9 14.9L9 15C9 15 9 16 10 16 11 16 11 15 11 15L11 14.9A5 5 0 0 0 14.9 11L15 11C15 11 16 11 16 10 16 9 15 9 15 9L14.9 9A5 5 0 0 0 11 5.1L11 5C11 5 11 4 10 4zM10 6.5A3.5 3.5 0 0 1 13.5 10 3.5 3.5 0 0 1 10 13.5 3.5 3.5 0 0 1 6.5 10 3.5 3.5 0 0 1 10 6.5zM10 8.3A1.8 1.8 0 0 0 8.3 10 1.8 1.8 0 0 0 10 11.8 1.8 1.8 0 0 0 11.8 10 1.8 1.8 0 0 0 10 8.3z'/%3E %3C/svg%3E");
+}
+
+.mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate:disabled {
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E %3Cpath d='M10 4C9 4 9 5 9 5L9 5.1A5 5 0 0 0 5.1 9L5 9C5 9 4 9 4 10 4 11 5 11 5 11L5.1 11A5 5 0 0 0 9 14.9L9 15C9 15 9 16 10 16 11 16 11 15 11 15L11 14.9A5 5 0 0 0 14.9 11L15 11C15 11 16 11 16 10 16 9 15 9 15 9L14.9 9A5 5 0 0 0 11 5.1L11 5C11 5 11 4 10 4zM10 6.5A3.5 3.5 0 0 1 13.5 10 3.5 3.5 0 0 1 10 13.5 3.5 3.5 0 0 1 6.5 10 3.5 3.5 0 0 1 10 6.5zM10 8.3A1.8 1.8 0 0 0 8.3 10 1.8 1.8 0 0 0 10 11.8 1.8 1.8 0 0 0 11.8 10 1.8 1.8 0 0 0 10 8.3z'/%3E %3C/svg%3E");
+}
+
+.mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active {
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5L9 5.1A5 5 0 0 0 5.1 9L5 9C5 9 4 9 4 10 4 11 5 11 5 11L5.1 11A5 5 0 0 0 9 14.9L9 15C9 15 9 16 10 16 11 16 11 15 11 15L11 14.9A5 5 0 0 0 14.9 11L15 11C15 11 16 11 16 10 16 9 15 9 15 9L14.9 9A5 5 0 0 0 11 5.1L11 5C11 5 11 4 10 4zM10 6.5A3.5 3.5 0 0 1 13.5 10 3.5 3.5 0 0 1 10 13.5 3.5 3.5 0 0 1 6.5 10 3.5 3.5 0 0 1 10 6.5zM10 8.3A1.8 1.8 0 0 0 8.3 10 1.8 1.8 0 0 0 10 11.8 1.8 1.8 0 0 0 11.8 10 1.8 1.8 0 0 0 10 8.3z'/%3E %3C/svg%3E");
+}
+
+.mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error {
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5L9 5.1A5 5 0 0 0 5.1 9L5 9C5 9 4 9 4 10 4 11 5 11 5 11L5.1 11A5 5 0 0 0 9 14.9L9 15C9 15 9 16 10 16 11 16 11 15 11 15L11 14.9A5 5 0 0 0 14.9 11L15 11C15 11 16 11 16 10 16 9 15 9 15 9L14.9 9A5 5 0 0 0 11 5.1L11 5C11 5 11 4 10 4zM10 6.5A3.5 3.5 0 0 1 13.5 10 3.5 3.5 0 0 1 10 13.5 3.5 3.5 0 0 1 6.5 10 3.5 3.5 0 0 1 10 6.5zM10 8.3A1.8 1.8 0 0 0 8.3 10 1.8 1.8 0 0 0 10 11.8 1.8 1.8 0 0 0 11.8 10 1.8 1.8 0 0 0 10 8.3z'/%3E %3C/svg%3E");
+}
+
+.mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background {
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E %3Cpath d='M 10,4 C 9,4 9,5 9,5 L 9,5.1 C 7.0357113,5.5006048 5.5006048,7.0357113 5.1,9 L 5,9 c 0,0 -1,0 -1,1 0,1 1,1 1,1 l 0.1,0 c 0.4006048,1.964289 1.9357113,3.499395 3.9,3.9 L 9,15 c 0,0 0,1 1,1 1,0 1,-1 1,-1 l 0,-0.1 c 1.964289,-0.400605 3.499395,-1.935711 3.9,-3.9 l 0.1,0 c 0,0 1,0 1,-1 C 16,9 15,9 15,9 L 14.9,9 C 14.499395,7.0357113 12.964289,5.5006048 11,5.1 L 11,5 c 0,0 0,-1 -1,-1 z m 0,2.5 c 1.932997,0 3.5,1.5670034 3.5,3.5 0,1.932997 -1.567003,3.5 -3.5,3.5 C 8.0670034,13.5 6.5,11.932997 6.5,10 6.5,8.0670034 8.0670034,6.5 10,6.5 Z'/%3E %3C/svg%3E");
+}
+
+.mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error {
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E %3Cpath d='M 10,4 C 9,4 9,5 9,5 L 9,5.1 C 7.0357113,5.5006048 5.5006048,7.0357113 5.1,9 L 5,9 c 0,0 -1,0 -1,1 0,1 1,1 1,1 l 0.1,0 c 0.4006048,1.964289 1.9357113,3.499395 3.9,3.9 L 9,15 c 0,0 0,1 1,1 1,0 1,-1 1,-1 l 0,-0.1 c 1.964289,-0.400605 3.499395,-1.935711 3.9,-3.9 l 0.1,0 c 0,0 1,0 1,-1 C 16,9 15,9 15,9 L 14.9,9 C 14.499395,7.0357113 12.964289,5.5006048 11,5.1 L 11,5 c 0,0 0,-1 -1,-1 z m 0,2.5 c 1.932997,0 3.5,1.5670034 3.5,3.5 0,1.932997 -1.567003,3.5 -3.5,3.5 C 8.0670034,13.5 6.5,11.932997 6.5,10 6.5,8.0670034 8.0670034,6.5 10,6.5 Z'/%3E %3C/svg%3E");
+}
+
+.mapboxgl-ctrl-icon.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting {
+ -webkit-animation: mapboxgl-spin 2s infinite linear;
+ -moz-animation: mapboxgl-spin 2s infinite linear;
+ -o-animation: mapboxgl-spin 2s infinite linear;
+ -ms-animation: mapboxgl-spin 2s infinite linear;
+ animation: mapboxgl-spin 2s infinite linear;
+}
+
+@-webkit-keyframes mapboxgl-spin {
+ 0% { -webkit-transform: rotate(0deg); }
+ 100% { -webkit-transform: rotate(360deg); }
+}
+
+@-moz-keyframes mapboxgl-spin {
+ 0% { -moz-transform: rotate(0deg); }
+ 100% { -moz-transform: rotate(360deg); }
+}
+
+@-o-keyframes mapboxgl-spin {
+ 0% { -o-transform: rotate(0deg); }
+ 100% { -o-transform: rotate(360deg); }
+}
+
+@-ms-keyframes mapboxgl-spin {
+ 0% { -ms-transform: rotate(0deg); }
+ 100% { -ms-transform: rotate(360deg); }
+}
+
+@keyframes mapboxgl-spin {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(360deg); }
+}
+
+.mapboxgl-ctrl-icon.mapboxgl-ctrl-fullscreen {
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath d='M 5 4 C 4.5 4 4 4.5 4 5 L 4 6 L 4 9 L 4.5 9 L 5.7773438 7.296875 C 6.7771319 8.0602131 7.835765 8.9565728 8.890625 10 C 7.8257121 11.0633 6.7761791 11.951675 5.78125 12.707031 L 4.5 11 L 4 11 L 4 15 C 4 15.5 4.5 16 5 16 L 9 16 L 9 15.5 L 7.2734375 14.205078 C 8.0428931 13.187886 8.9395441 12.133481 9.9609375 11.068359 C 11.042371 12.14699 11.942093 13.2112 12.707031 14.21875 L 11 15.5 L 11 16 L 14 16 L 15 16 C 15.5 16 16 15.5 16 15 L 16 14 L 16 11 L 15.5 11 L 14.205078 12.726562 C 13.177985 11.949617 12.112718 11.043577 11.037109 10.009766 C 12.151856 8.981061 13.224345 8.0798624 14.228516 7.3046875 L 15.5 9 L 16 9 L 16 5 C 16 4.5 15.5 4 15 4 L 11 4 L 11 4.5 L 12.703125 5.7773438 C 11.932647 6.7864834 11.026693 7.8554712 9.9707031 8.9199219 C 8.9584739 7.8204943 8.0698767 6.7627188 7.3046875 5.7714844 L 9 4.5 L 9 4 L 6 4 L 5 4 z '/%3E %3C/svg%3E");
+}
+
+.mapboxgl-ctrl-icon.mapboxgl-ctrl-shrink {
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath style='fill:%23000000;' d='M 4.2421875 3.4921875 A 0.750075 0.750075 0 0 0 3.71875 4.78125 L 5.9648438 7.0273438 L 4 8.5 L 4 9 L 8 9 C 8.500001 8.9999988 9 8.4999992 9 8 L 9 4 L 8.5 4 L 7.0175781 5.9550781 L 4.78125 3.71875 A 0.750075 0.750075 0 0 0 4.2421875 3.4921875 z M 15.734375 3.4921875 A 0.750075 0.750075 0 0 0 15.21875 3.71875 L 12.984375 5.953125 L 11.5 4 L 11 4 L 11 8 C 11 8.4999992 11.499999 8.9999988 12 9 L 16 9 L 16 8.5 L 14.035156 7.0273438 L 16.28125 4.78125 A 0.750075 0.750075 0 0 0 15.734375 3.4921875 z M 4 11 L 4 11.5 L 5.9648438 12.972656 L 3.71875 15.21875 A 0.75130096 0.75130096 0 1 0 4.78125 16.28125 L 7.0273438 14.035156 L 8.5 16 L 9 16 L 9 12 C 9 11.500001 8.500001 11.000001 8 11 L 4 11 z M 12 11 C 11.499999 11.000001 11 11.500001 11 12 L 11 16 L 11.5 16 L 12.972656 14.035156 L 15.21875 16.28125 A 0.75130096 0.75130096 0 1 0 16.28125 15.21875 L 14.035156 12.972656 L 16 11.5 L 16 11 L 12 11 z '/%3E %3C/svg%3E");
+}
+
+.mapboxgl-ctrl-icon.mapboxgl-ctrl-compass > .mapboxgl-ctrl-compass-arrow {
+ width: 20px;
+ height: 20px;
+ margin: 5px;
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E %3Cpolygon fill='%23333333' points='6,9 10,1 14,9'/%3E %3Cpolygon fill='%23CCCCCC' points='6,11 10,19 14,11 '/%3E %3C/svg%3E");
+ background-repeat: no-repeat;
+ display: inline-block;
+}
+
+a.mapboxgl-ctrl-logo {
+ width: 85px;
+ height: 21px;
+ margin: 0 0 -3px -3px;
+ display: block;
+ background-repeat: no-repeat;
+ cursor: pointer;
+ background-image: url("data:image/svg+xml;charset=utf-8,%3C?xml version='1.0' encoding='utf-8'?%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 84.49 21' style='enable-background:new 0 0 84.49 21;' xml:space='preserve'%3E%3Cg%3E %3Cpath class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' d='M83.25,14.26c0,0.12-0.09,0.21-0.21,0.21h-1.61c-0.13,0-0.24-0.06-0.3-0.17l-1.44-2.39l-1.44,2.39 c-0.06,0.11-0.18,0.17-0.3,0.17h-1.61c-0.04,0-0.08-0.01-0.12-0.03c-0.09-0.06-0.13-0.19-0.06-0.28l0,0l2.43-3.68L76.2,6.84 c-0.02-0.03-0.03-0.07-0.03-0.12c0-0.12,0.09-0.21,0.21-0.21h1.61c0.13,0,0.24,0.06,0.3,0.17l1.41,2.36l1.4-2.35 c0.06-0.11,0.18-0.17,0.3-0.17H83c0.04,0,0.08,0.01,0.12,0.03c0.09,0.06,0.13,0.19,0.06,0.28l0,0l-2.37,3.63l2.43,3.67 C83.24,14.18,83.25,14.22,83.25,14.26z'/%3E %3Cpath class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' d='M66.24,9.59c-0.39-1.88-1.96-3.28-3.84-3.28c-1.03,0-2.03,0.42-2.73,1.18V3.51c0-0.13-0.1-0.23-0.23-0.23h-1.4 c-0.13,0-0.23,0.11-0.23,0.23v10.72c0,0.13,0.1,0.23,0.23,0.23h1.4c0.13,0,0.23-0.11,0.23-0.23V13.5c0.71,0.75,1.7,1.18,2.73,1.18 c1.88,0,3.45-1.41,3.84-3.29C66.37,10.79,66.37,10.18,66.24,9.59L66.24,9.59z M62.08,13c-1.32,0-2.39-1.11-2.41-2.48v-0.06 c0.02-1.38,1.09-2.48,2.41-2.48s2.42,1.12,2.42,2.51S63.41,13,62.08,13z'/%3E %3Cpath class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' d='M71.67,6.32c-1.98-0.01-3.72,1.35-4.16,3.29c-0.13,0.59-0.13,1.19,0,1.77c0.44,1.94,2.17,3.32,4.17,3.3 c2.35,0,4.26-1.87,4.26-4.19S74.04,6.32,71.67,6.32z M71.65,13.01c-1.33,0-2.42-1.12-2.42-2.51s1.08-2.52,2.42-2.52 c1.33,0,2.42,1.12,2.42,2.51S72.99,13,71.65,13.01L71.65,13.01z'/%3E %3Cpath class='st1' style='opacity:0.35; enable-background:new;' d='M62.08,7.98c-1.32,0-2.39,1.11-2.41,2.48v0.06C59.68,11.9,60.75,13,62.08,13s2.42-1.12,2.42-2.51 S63.41,7.98,62.08,7.98z M62.08,11.76c-0.63,0-1.14-0.56-1.17-1.25v-0.04c0.01-0.69,0.54-1.25,1.17-1.25 c0.63,0,1.17,0.57,1.17,1.27C63.24,11.2,62.73,11.76,62.08,11.76z'/%3E %3Cpath class='st1' style='opacity:0.35; enable-background:new;' d='M71.65,7.98c-1.33,0-2.42,1.12-2.42,2.51S70.32,13,71.65,13s2.42-1.12,2.42-2.51S72.99,7.98,71.65,7.98z M71.65,11.76c-0.64,0-1.17-0.57-1.17-1.27c0-0.7,0.53-1.26,1.17-1.26s1.17,0.57,1.17,1.27C72.82,11.21,72.29,11.76,71.65,11.76z'/%3E %3Cpath class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' d='M45.74,6.53h-1.4c-0.13,0-0.23,0.11-0.23,0.23v0.73c-0.71-0.75-1.7-1.18-2.73-1.18 c-2.17,0-3.94,1.87-3.94,4.19s1.77,4.19,3.94,4.19c1.04,0,2.03-0.43,2.73-1.19v0.73c0,0.13,0.1,0.23,0.23,0.23h1.4 c0.13,0,0.23-0.11,0.23-0.23V6.74c0-0.12-0.09-0.22-0.22-0.22C45.75,6.53,45.75,6.53,45.74,6.53z M44.12,10.53 C44.11,11.9,43.03,13,41.71,13s-2.42-1.12-2.42-2.51s1.08-2.52,2.4-2.52c1.33,0,2.39,1.11,2.41,2.48L44.12,10.53z'/%3E %3Cpath class='st1' style='opacity:0.35; enable-background:new;' d='M41.71,7.98c-1.33,0-2.42,1.12-2.42,2.51S40.37,13,41.71,13s2.39-1.11,2.41-2.48v-0.06 C44.1,9.09,43.03,7.98,41.71,7.98z M40.55,10.49c0-0.7,0.52-1.27,1.17-1.27c0.64,0,1.14,0.56,1.17,1.25v0.04 c-0.01,0.68-0.53,1.24-1.17,1.24C41.08,11.75,40.55,11.19,40.55,10.49z'/%3E %3Cpath class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' d='M52.41,6.32c-1.03,0-2.03,0.42-2.73,1.18V6.75c0-0.13-0.1-0.23-0.23-0.23h-1.4c-0.13,0-0.23,0.11-0.23,0.23 v10.72c0,0.13,0.1,0.23,0.23,0.23h1.4c0.13,0,0.23-0.1,0.23-0.23V13.5c0.71,0.75,1.7,1.18,2.74,1.18c2.17,0,3.94-1.87,3.94-4.19 S54.58,6.32,52.41,6.32z M52.08,13.01c-1.32,0-2.39-1.11-2.42-2.48v-0.07c0.02-1.38,1.09-2.49,2.4-2.49c1.32,0,2.41,1.12,2.41,2.51 S53.4,13,52.08,13.01L52.08,13.01z'/%3E %3Cpath class='st1' style='opacity:0.35; enable-background:new;' d='M52.08,7.98c-1.32,0-2.39,1.11-2.42,2.48v0.06c0.03,1.38,1.1,2.48,2.42,2.48s2.41-1.12,2.41-2.51 S53.4,7.98,52.08,7.98z M52.08,11.76c-0.63,0-1.14-0.56-1.17-1.25v-0.04c0.01-0.69,0.54-1.25,1.17-1.25c0.63,0,1.17,0.58,1.17,1.27 S52.72,11.76,52.08,11.76z'/%3E %3Cpath class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' d='M36.08,14.24c0,0.13-0.1,0.23-0.23,0.23h-1.41c-0.13,0-0.23-0.11-0.23-0.23V9.68c0-0.98-0.74-1.71-1.62-1.71 c-0.8,0-1.46,0.7-1.59,1.62l0.01,4.66c0,0.13-0.11,0.23-0.23,0.23h-1.41c-0.13,0-0.23-0.11-0.23-0.23V9.68 c0-0.98-0.74-1.71-1.62-1.71c-0.85,0-1.54,0.79-1.6,1.8v4.48c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.11-0.23-0.23V6.74 c0.01-0.13,0.1-0.22,0.23-0.22h1.4c0.13,0,0.22,0.11,0.23,0.22V7.4c0.5-0.68,1.3-1.09,2.16-1.1h0.03c1.09,0,2.09,0.6,2.6,1.55 c0.45-0.95,1.4-1.55,2.44-1.56c1.62,0,2.93,1.25,2.9,2.78L36.08,14.24z'/%3E %3Cpath class='st1' style='opacity:0.35; enable-background:new;' d='M84.34,13.59l-0.07-0.13l-1.96-2.99l1.94-2.95c0.44-0.67,0.26-1.56-0.41-2.02c-0.02,0-0.03,0-0.04-0.01 c-0.23-0.15-0.5-0.22-0.78-0.22h-1.61c-0.56,0-1.08,0.29-1.37,0.78L79.72,6.6l-0.34-0.56C79.09,5.56,78.57,5.27,78,5.27h-1.6 c-0.6,0-1.13,0.37-1.35,0.92c-2.19-1.66-5.28-1.47-7.26,0.45c-0.35,0.34-0.65,0.72-0.89,1.14c-0.9-1.62-2.58-2.72-4.5-2.72 c-0.5,0-1.01,0.07-1.48,0.23V3.51c0-0.82-0.66-1.48-1.47-1.48h-1.4c-0.81,0-1.47,0.66-1.47,1.47v3.75 c-0.95-1.36-2.5-2.18-4.17-2.19c-0.74,0-1.46,0.16-2.12,0.47c-0.24-0.17-0.54-0.26-0.84-0.26h-1.4c-0.45,0-0.87,0.21-1.15,0.56 c-0.02-0.03-0.04-0.05-0.07-0.08c-0.28-0.3-0.68-0.47-1.09-0.47h-1.39c-0.3,0-0.6,0.09-0.84,0.26c-0.67-0.3-1.39-0.46-2.12-0.46 c-1.83,0-3.43,1-4.37,2.5c-0.2-0.46-0.48-0.89-0.83-1.25c-0.8-0.81-1.89-1.25-3.02-1.25h-0.01c-0.89,0.01-1.75,0.33-2.46,0.88 c-0.74-0.57-1.64-0.88-2.57-0.88H28.1c-0.29,0-0.58,0.03-0.86,0.11c-0.28,0.06-0.56,0.16-0.82,0.28c-0.21-0.12-0.45-0.18-0.7-0.18 h-1.4c-0.82,0-1.47,0.66-1.47,1.47v7.5c0,0.82,0.66,1.47,1.47,1.47h1.4c0.82,0,1.48-0.66,1.48-1.48l0,0V9.79 c0.03-0.36,0.23-0.59,0.36-0.59c0.18,0,0.38,0.18,0.38,0.47v4.57c0,0.82,0.66,1.47,1.47,1.47h1.41c0.82,0,1.47-0.66,1.47-1.47 l-0.01-4.57c0.06-0.32,0.25-0.47,0.35-0.47c0.18,0,0.38,0.18,0.38,0.47v4.57c0,0.82,0.66,1.47,1.47,1.47h1.41 c0.82,0,1.47-0.66,1.47-1.47v-0.38c0.96,1.29,2.46,2.06,4.06,2.06c0.74,0,1.46-0.16,2.12-0.47c0.24,0.17,0.54,0.26,0.84,0.26h1.39 c0.3,0,0.6-0.09,0.84-0.26v2.01c0,0.82,0.66,1.47,1.47,1.47h1.4c0.82,0,1.47-0.66,1.47-1.47v-1.77c0.48,0.15,0.99,0.23,1.49,0.22 c1.7,0,3.22-0.87,4.17-2.2v0.52c0,0.82,0.66,1.47,1.47,1.47h1.4c0.3,0,0.6-0.09,0.84-0.26c0.66,0.31,1.39,0.47,2.12,0.47 c1.92,0,3.6-1.1,4.49-2.73c1.54,2.65,4.95,3.53,7.58,1.98c0.18-0.11,0.36-0.22,0.53-0.36c0.22,0.55,0.76,0.91,1.35,0.9H78 c0.56,0,1.08-0.29,1.37-0.78l0.37-0.61l0.37,0.61c0.29,0.48,0.81,0.78,1.38,0.78h1.6c0.81,0,1.46-0.66,1.45-1.46 C84.49,14.02,84.44,13.8,84.34,13.59L84.34,13.59z M35.86,14.47h-1.41c-0.13,0-0.23-0.11-0.23-0.23V9.68 c0-0.98-0.74-1.71-1.62-1.71c-0.8,0-1.46,0.7-1.59,1.62l0.01,4.66c0,0.13-0.1,0.23-0.23,0.23h-1.41c-0.13,0-0.23-0.11-0.23-0.23 V9.68c0-0.98-0.74-1.71-1.62-1.71c-0.85,0-1.54,0.79-1.6,1.8v4.48c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.11-0.23-0.23 V6.74c0.01-0.13,0.11-0.22,0.23-0.22h1.4c0.13,0,0.22,0.11,0.23,0.22V7.4c0.5-0.68,1.3-1.09,2.16-1.1h0.03 c1.09,0,2.09,0.6,2.6,1.55c0.45-0.95,1.4-1.55,2.44-1.56c1.62,0,2.93,1.25,2.9,2.78l0.01,5.16C36.09,14.36,35.98,14.46,35.86,14.47 L35.86,14.47z M45.97,14.24c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.11-0.23-0.23V13.5c-0.7,0.76-1.69,1.18-2.72,1.18 c-2.17,0-3.94-1.87-3.94-4.19s1.77-4.19,3.94-4.19c1.03,0,2.02,0.43,2.73,1.18V6.74c0-0.13,0.1-0.23,0.23-0.23h1.4 c0.12-0.01,0.22,0.08,0.23,0.21c0,0.01,0,0.01,0,0.02v7.51h-0.01V14.24z M52.41,14.67c-1.03,0-2.02-0.43-2.73-1.18v3.97 c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.1-0.23-0.23V6.75c0-0.13,0.1-0.22,0.23-0.22h1.4c0.13,0,0.23,0.11,0.23,0.23v0.73 c0.71-0.76,1.7-1.18,2.73-1.18c2.17,0,3.94,1.86,3.94,4.18S54.58,14.67,52.41,14.67z M66.24,11.39c-0.39,1.87-1.96,3.29-3.84,3.29 c-1.03,0-2.02-0.43-2.73-1.18v0.73c0,0.13-0.1,0.23-0.23,0.23h-1.4c-0.13,0-0.23-0.11-0.23-0.23V3.51c0-0.13,0.1-0.23,0.23-0.23 h1.4c0.13,0,0.23,0.11,0.23,0.23v3.97c0.71-0.75,1.7-1.18,2.73-1.17c1.88,0,3.45,1.4,3.84,3.28C66.37,10.19,66.37,10.8,66.24,11.39 L66.24,11.39L66.24,11.39z M71.67,14.68c-2,0.01-3.73-1.35-4.17-3.3c-0.13-0.59-0.13-1.19,0-1.77c0.44-1.94,2.17-3.31,4.17-3.3 c2.36,0,4.26,1.87,4.26,4.19S74.03,14.68,71.67,14.68L71.67,14.68z M83.04,14.47h-1.61c-0.13,0-0.24-0.06-0.3-0.17l-1.44-2.39 l-1.44,2.39c-0.06,0.11-0.18,0.17-0.3,0.17h-1.61c-0.04,0-0.08-0.01-0.12-0.03c-0.09-0.06-0.13-0.19-0.06-0.28l0,0l2.43-3.68 L76.2,6.84c-0.02-0.03-0.03-0.07-0.03-0.12c0-0.12,0.09-0.21,0.21-0.21h1.61c0.13,0,0.24,0.06,0.3,0.17l1.41,2.36l1.41-2.36 c0.06-0.11,0.18-0.17,0.3-0.17h1.61c0.04,0,0.08,0.01,0.12,0.03c0.09,0.06,0.13,0.19,0.06,0.28l0,0l-2.38,3.64l2.43,3.67 c0.02,0.03,0.03,0.07,0.03,0.12C83.25,14.38,83.16,14.47,83.04,14.47L83.04,14.47L83.04,14.47z'/%3E %3Cpath class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' d='M10.5,1.24c-5.11,0-9.25,4.15-9.25,9.25s4.15,9.25,9.25,9.25s9.25-4.15,9.25-9.25 C19.75,5.38,15.61,1.24,10.5,1.24z M14.89,12.77c-1.93,1.93-4.78,2.31-6.7,2.31c-0.7,0-1.41-0.05-2.1-0.16c0,0-1.02-5.64,2.14-8.81 c0.83-0.83,1.95-1.28,3.13-1.28c1.27,0,2.49,0.51,3.39,1.42C16.59,8.09,16.64,11,14.89,12.77z'/%3E %3Cpath class='st1' style='opacity:0.35; enable-background:new;' d='M10.5-0.01C4.7-0.01,0,4.7,0,10.49s4.7,10.5,10.5,10.5S21,16.29,21,10.49C20.99,4.7,16.3-0.01,10.5-0.01z M10.5,19.74c-5.11,0-9.25-4.15-9.25-9.25s4.14-9.26,9.25-9.26s9.25,4.15,9.25,9.25C19.75,15.61,15.61,19.74,10.5,19.74z'/%3E %3Cpath class='st1' style='opacity:0.35; enable-background:new;' d='M14.74,6.25C12.9,4.41,9.98,4.35,8.23,6.1c-3.16,3.17-2.14,8.81-2.14,8.81s5.64,1.02,8.81-2.14 C16.64,11,16.59,8.09,14.74,6.25z M12.47,10.34l-0.91,1.87l-0.9-1.87L8.8,9.43l1.86-0.9l0.9-1.87l0.91,1.87l1.86,0.9L12.47,10.34z'/%3E %3Cpolygon class='st0' style='opacity:0.9; fill: %23FFFFFF; enable-background: new;' points='14.33,9.43 12.47,10.34 11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 '/%3E%3C/g%3E%3C/svg%3E");
+}
+
+a.mapboxgl-ctrl-logo.mapboxgl-compact {
+ width: 21px;
+ height: 21px;
+ background-image: url("data:image/svg+xml;charset=utf-8,%3C?xml version='1.0' encoding='utf-8'?%3E %3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 21 21' style='enable-background:new 0 0 21 21;' xml:space='preserve'%3E%3Cg transform='translate(0,0.01)'%3E%3Cpath d='m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z' style='opacity:0.9;fill:%23ffffff;enable-background:new' class='st0'/%3E%3Cpath d='M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z' style='opacity:0.35;enable-background:new' class='st1'/%3E%3Cpath d='M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z' style='opacity:0.35;enable-background:new' class='st1'/%3E%3Cpolygon points='11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 ' style='opacity:0.9;fill:%23ffffff;enable-background:new' class='st0'/%3E%3C/g%3E%3C/svg%3E");
+}
+
+.mapboxgl-ctrl.mapboxgl-ctrl-attrib {
+ padding: 0 5px;
+ background-color: rgba(255, 255, 255, 0.5);
+ margin: 0;
+}
+
+@media screen {
+ .mapboxgl-ctrl-attrib.mapboxgl-compact {
+ margin: 0 10px 10px;
+ position: relative;
+ background-color: #fff;
+ border-radius: 3px 12px 12px 3px;
+ }
+
+ .mapboxgl-ctrl-attrib.mapboxgl-compact:hover {
+ padding: 2px 24px 2px 4px;
+ visibility: visible;
+ }
+
+ .mapboxgl-ctrl-attrib.mapboxgl-compact > a {
+ display: none;
+ }
+
+ .mapboxgl-ctrl-attrib.mapboxgl-compact:hover > a {
+ display: inline;
+ }
+
+ .mapboxgl-ctrl-attrib.mapboxgl-compact::after {
+ content: '';
+ cursor: pointer;
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath fill='%23333333' fill-rule='evenodd' d='M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0'/%3E %3C/svg%3E");
+ background-color: rgba(255, 255, 255, 0.5);
+ width: 24px;
+ height: 24px;
+ box-sizing: border-box;
+ border-radius: 12px;
+ }
+}
+
+.mapboxgl-ctrl-attrib a {
+ color: rgba(0, 0, 0, 0.75);
+ text-decoration: none;
+}
+
+.mapboxgl-ctrl-attrib a:hover {
+ color: inherit;
+ text-decoration: underline;
+}
+
+/* stylelint-disable-next-line selector-class-pattern */
+.mapboxgl-ctrl-attrib .mapbox-improve-map {
+ font-weight: bold;
+ margin-left: 2px;
+}
+
+.mapboxgl-attrib-empty {
+ display: none;
+}
+
+.mapboxgl-ctrl-scale {
+ background-color: rgba(255, 255, 255, 0.75);
+ font-size: 10px;
+ border-width: medium 2px 2px;
+ border-style: none solid solid;
+ border-color: #333;
+ padding: 0 5px;
+ color: #333;
+ box-sizing: border-box;
+}
+
+.mapboxgl-popup {
+ position: absolute;
+ top: 0;
+ left: 0;
+ display: -webkit-flex;
+ display: flex;
+ will-change: transform;
+ pointer-events: none;
+}
+
+.mapboxgl-popup-anchor-top,
+.mapboxgl-popup-anchor-top-left,
+.mapboxgl-popup-anchor-top-right {
+ -webkit-flex-direction: column;
+ flex-direction: column;
+}
+
+.mapboxgl-popup-anchor-bottom,
+.mapboxgl-popup-anchor-bottom-left,
+.mapboxgl-popup-anchor-bottom-right {
+ -webkit-flex-direction: column-reverse;
+ flex-direction: column-reverse;
+}
+
+.mapboxgl-popup-anchor-left {
+ -webkit-flex-direction: row;
+ flex-direction: row;
+}
+
+.mapboxgl-popup-anchor-right {
+ -webkit-flex-direction: row-reverse;
+ flex-direction: row-reverse;
+}
+
+.mapboxgl-popup-tip {
+ width: 0;
+ height: 0;
+ border: 10px solid transparent;
+ z-index: 1;
+}
+
+.mapboxgl-popup-anchor-top .mapboxgl-popup-tip {
+ -webkit-align-self: center;
+ align-self: center;
+ border-top: none;
+ border-bottom-color: #fff;
+}
+
+.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip {
+ -webkit-align-self: flex-start;
+ align-self: flex-start;
+ border-top: none;
+ border-left: none;
+ border-bottom-color: #fff;
+}
+
+.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip {
+ -webkit-align-self: flex-end;
+ align-self: flex-end;
+ border-top: none;
+ border-right: none;
+ border-bottom-color: #fff;
+}
+
+.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip {
+ -webkit-align-self: center;
+ align-self: center;
+ border-bottom: none;
+ border-top-color: #fff;
+}
+
+.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip {
+ -webkit-align-self: flex-start;
+ align-self: flex-start;
+ border-bottom: none;
+ border-left: none;
+ border-top-color: #fff;
+}
+
+.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip {
+ -webkit-align-self: flex-end;
+ align-self: flex-end;
+ border-bottom: none;
+ border-right: none;
+ border-top-color: #fff;
+}
+
+.mapboxgl-popup-anchor-left .mapboxgl-popup-tip {
+ -webkit-align-self: center;
+ align-self: center;
+ border-left: none;
+ border-right-color: #fff;
+}
+
+.mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
+ -webkit-align-self: center;
+ align-self: center;
+ border-right: none;
+ border-left-color: #fff;
+}
+
+.mapboxgl-popup-close-button {
+ position: absolute;
+ right: 0;
+ top: 0;
+ border: 0;
+ border-radius: 0 3px 0 0;
+ cursor: pointer;
+ background-color: transparent;
+}
+
+.mapboxgl-popup-close-button:hover {
+ background-color: rgba(0, 0, 0, 0.05);
+}
+
+.mapboxgl-popup-content {
+ position: relative;
+ background: #fff;
+ border-radius: 3px;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
+ padding: 10px 10px 15px;
+ pointer-events: auto;
+}
+
+.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content {
+ border-top-left-radius: 0;
+}
+
+.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content {
+ border-top-right-radius: 0;
+}
+
+.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content {
+ border-bottom-left-radius: 0;
+}
+
+.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content {
+ border-bottom-right-radius: 0;
+}
+
+.mapboxgl-marker {
+ position: absolute;
+ top: 0;
+ left: 0;
+ will-change: transform;
+}
+
+.mapboxgl-user-location-dot {
+ background-color: #1da1f2;
+ width: 15px;
+ height: 15px;
+ border-radius: 50%;
+ box-shadow: 0 0 2px rgba(0, 0, 0, 0.25);
+}
+
+.mapboxgl-user-location-dot::before {
+ background-color: #1da1f2;
+ content: '';
+ width: 15px;
+ height: 15px;
+ border-radius: 50%;
+ position: absolute;
+ -webkit-animation: mapboxgl-user-location-dot-pulse 2s infinite;
+ -moz-animation: mapboxgl-user-location-dot-pulse 2s infinite;
+ -ms-animation: mapboxgl-user-location-dot-pulse 2s infinite;
+ animation: mapboxgl-user-location-dot-pulse 2s infinite;
+}
+
+.mapboxgl-user-location-dot::after {
+ border-radius: 50%;
+ border: 2px solid #fff;
+ content: '';
+ height: 19px;
+ left: -2px;
+ position: absolute;
+ top: -2px;
+ width: 19px;
+ box-sizing: border-box;
+}
+
+@-webkit-keyframes mapboxgl-user-location-dot-pulse {
+ 0% { -webkit-transform: scale(1); opacity: 1; }
+ 70% { -webkit-transform: scale(3); opacity: 0; }
+ 100% { -webkit-transform: scale(1); opacity: 0; }
+}
+
+@-ms-keyframes mapboxgl-user-location-dot-pulse {
+ 0% { -ms-transform: scale(1); opacity: 1; }
+ 70% { -ms-transform: scale(3); opacity: 0; }
+ 100% { -ms-transform: scale(1); opacity: 0; }
+}
+
+@keyframes mapboxgl-user-location-dot-pulse {
+ 0% { transform: scale(1); opacity: 1; }
+ 70% { transform: scale(3); opacity: 0; }
+ 100% { transform: scale(1); opacity: 0; }
+}
+
+.mapboxgl-user-location-dot-stale {
+ background-color: #aaa;
+}
+
+.mapboxgl-user-location-dot-stale::after {
+ display: none;
+}
+
+.mapboxgl-crosshair,
+.mapboxgl-crosshair .mapboxgl-interactive,
+.mapboxgl-crosshair .mapboxgl-interactive:active {
+ cursor: crosshair;
+}
+
+.mapboxgl-boxzoom {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 0;
+ height: 0;
+ background: #fff;
+ border: 2px dotted #202020;
+ opacity: 0.5;
+}
+
+@media print {
+ /* stylelint-disable-next-line selector-class-pattern */
+ .mapbox-improve-map {
+ display: none;
+ }
+}
diff --git a/deployment/manager/shared/map/mapbox-gl-js/1.2.1/mapbox-gl.js b/deployment/manager/shared/map/mapbox-gl-js/1.2.1/mapbox-gl.js
new file mode 100644
index 000000000..d900a14e3
--- /dev/null
+++ b/deployment/manager/shared/map/mapbox-gl-js/1.2.1/mapbox-gl.js
@@ -0,0 +1,40 @@
+/* Mapbox GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/mapbox/mapbox-gl-js/blob/v0.50.0/LICENSE.txt */
+(function (global, factory) {
+typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+typeof define === 'function' && define.amd ? define(factory) :
+(global.mapboxgl = factory());
+}(this, (function () { 'use strict';
+
+/* eslint-disable */
+
+var shared, worker, mapboxgl;
+// define gets called three times: one for each chunk. we rely on the order
+// they're imported to know which is which
+function define(_, chunk) {
+if (!shared) {
+ shared = chunk;
+} else if (!worker) {
+ worker = chunk;
+} else {
+ var workerBundleString = 'var sharedChunk = {}; (' + shared + ')(sharedChunk); (' + worker + ')(sharedChunk);'
+
+ var sharedChunk = {};
+ shared(sharedChunk);
+ mapboxgl = chunk(sharedChunk);
+ mapboxgl.workerUrl = window.URL.createObjectURL(new Blob([workerBundleString], { type: 'text/javascript' }));
+}
+}
+
+
+define(["exports"],function(t){"use strict";function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=n;function n(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=r,this.p2y=n;}n.prototype.sampleCurveX=function(t){return ((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return ((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return (3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){var r,n,i,a,o;for(void 0===e&&(e=1e-6),i=t,o=0;o<8;o++){if(a=this.sampleCurveX(i)-t,Math.abs(a)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s;}if(n=1,(i=t)<(r=0))return r;if(i>n)return n;for(;r<n;){if(a=this.sampleCurveX(i),Math.abs(a-t)<e)return i;t>a?r=i:n=i,i=.5*(n-r)+r;}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=function(t,e,r){this.column=t,this.row=e,this.zoom=r;};i.prototype.clone=function(){return new i(this.column,this.row,this.zoom)},i.prototype.zoomTo=function(t){return this.clone()._zoomTo(t)},i.prototype.sub=function(t){return this.clone()._sub(t)},i.prototype._zoomTo=function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},i.prototype._sub=function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this};var a=o;function o(t,e){this.x=t,this.y=e;}function s(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return !1;for(var r=0;r<t.length;r++)if(!s(t[r],e[r]))return !1;return !0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return !1;if(Object.keys(t).length!==Object.keys(e).length)return !1;for(var n in t)if(!s(t[n],e[n]))return !1;return !0}return t===e}function u(t,e,n,i){var a=new r(t,e,n,i);return function(t){return a.solve(t)}}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var p=u(.25,.1,.25,1);function l(t,e,r){return Math.min(r,Math.max(e,t))}function c(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o];}return t}var h=1;function f(){return h++}function y(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e));});}function d(t,e){return -1!==t.indexOf(e,t.length-e.length)}function m(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function v(t,e,r){var n={};for(var i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function g(t){return Array.isArray(t)?t.map(g):"object"==typeof t&&t?m(t,g):t}var x={};function b(t){x[t]||("undefined"!=typeof console&&console.warn(t),x[t]=!0);}function _(t,e,r){return (r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function w(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r<n;i=r++)a=t[r],e+=((o=t[i]).x-a.x)*(a.y+o.y);return e}var A=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),k=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,z=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,S={now:A,frame:function(t){var e=k(t);return {cancel:function(){return z(e)}}},getImageData:function(t){var e=self.document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)},resolveURL:function(t){var e=self.document.createElement("a");return e.href=t,e.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},supportsWebp:!1};if(self.document){var B=self.document.createElement("img");B.onload=function(){S.supportsWebp=!0;},B.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=";}var V={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(V);var I=function(t){function e(e,r,n){t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e;}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error);function P(t){var e=new self.XMLHttpRequest;for(var r in e.open(t.method||"GET",t.url,!0),t.headers)e.setRequestHeader(r,t.headers[r]);return e.withCredentials="include"===t.credentials,e}var M=function(t,e){var r=P(t);return r.responseType="arraybuffer",r.onerror=function(){e(new Error(r.statusText));},r.onload=function(){var n=r.response;if(0===n.byteLength&&200===r.status)return e(new Error("http status 200 returned without content."));(r.status>=200&&r.status<300||0===r.status)&&r.response?e(null,{data:n,cacheControl:r.getResponseHeader("Cache-Control"),expires:r.getResponseHeader("Expires")}):e(new I(r.statusText,r.status,t.url));},r.send(),{cancel:function(){return r.abort()}}};function C(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e));}function T(t,e,r){if(r&&r[t]){var n=r[t].indexOf(e);-1!==n&&r[t].splice(n,1);}}var E=function(t,e){void 0===e&&(e={}),c(this,e),this.type=t;},F=function(t){function e(e,r){void 0===r&&(r={}),t.call(this,"error",c({error:e},r));}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(E),O=function(){};O.prototype.on=function(t,e){return this._listeners=this._listeners||{},C(t,e,this._listeners),this},O.prototype.off=function(t,e){return T(t,e,this._listeners),T(t,e,this._oneTimeListeners),this},O.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},C(t,e,this._oneTimeListeners),this},O.prototype.fire=function(t){"string"==typeof t&&(t=new E(t,arguments[1]||{}));var e=t.type;if(this.listens(e)){t.target=this;for(var r=0,n=this._listeners&&this._listeners[e]?this._listeners[e].slice():[];r<n.length;r+=1){n[r].call(this,t);}for(var i=0,a=this._oneTimeListeners&&this._oneTimeListeners[e]?this._oneTimeListeners[e].slice():[];i<a.length;i+=1){var o=a[i];T(e,o,this._oneTimeListeners),o.call(this,t);}var s=this._eventedParent;s&&(c(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),s.fire(t));}else t instanceof F&&console.error(t.error);return this},O.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},O.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var L={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{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"},"*":{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:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-z-order":{type:"enum",values:{"viewport-y":{},source:{}},default:"viewport-y",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,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:"string",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:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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:{},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:{left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,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"],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-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"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Heatmap"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},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}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"string",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"string",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,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"string",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"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},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}},"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:"string",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"}},"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"}}},D=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__);};function j(t){var e=t.key,r=t.value;return r?[new D(e,r,"constants have been deprecated as of v8")]:[]}function U(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n<i.length;n+=1){var a=i[n];for(var o in a)t[o]=a[o];}return t}function q(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function R(t){return Array.isArray(t)?t.map(R):q(t)}var N=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e;}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Z=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r],a=i[0],o=i[1];this.bindings[a]=o;}};Z.prototype.concat=function(t){return new Z(this,t)},Z.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Z.prototype.has=function(t){return !!this.bindings[t]||!!this.parent&&this.parent.has(t)};var X={kind:"null"},G={kind:"number"},H={kind:"string"},J={kind:"boolean"},K={kind:"color"},Y={kind:"object"},$={kind:"value"},W={kind:"collator"},Q={kind:"formatted"};function tt(t,e){return {kind:"array",itemType:t,N:e}}function et(t){if("array"===t.kind){var e=et(t.itemType);return "number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var rt=[X,G,H,J,K,Q,Y,tt($)];function nt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!nt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=rt;r<n.length;r+=1){if(!nt(n[r],e))return null}}return "Expected "+et(t)+" but found "+et(e)+" instead."}var it=e(function(t,e){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return (t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return "%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return "%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=i.indexOf("("),p=i.indexOf(")");if(-1!==u&&p+1===i.length){var l=i.substr(0,u),c=i.substr(u+1,p-(u+1)).split(","),h=1;switch(l){case"rgba":if(4!==c.length)return null;h=o(c.pop());case"rgb":return 3!==c.length?null:[a(c[0]),a(c[1]),a(c[2]),h];case"hsla":if(4!==c.length)return null;h=o(c.pop());case"hsl":if(3!==c.length)return null;var f=(parseFloat(c[0])%360+360)%360/360,y=o(c[1]),d=o(c[2]),m=d<=.5?d*(y+1):d+y-d*y,v=2*d-m;return [n(255*s(v,m,f+1/3)),n(255*s(v,m,f)),n(255*s(v,m,f-1/3)),h];default:return null}}return null};}catch(t){}}).parseCSSColor,at=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n;};at.parse=function(t){if(t){if(t instanceof at)return t;if("string"==typeof t){var e=it(t);if(e)return new at(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},at.prototype.toString=function(){var t=this.toArray(),e=t[0],r=t[1],n=t[2],i=t[3];return "rgba("+Math.round(e)+","+Math.round(r)+","+Math.round(n)+","+i+")"},at.prototype.toArray=function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]},at.black=new at(0,0,0,1),at.white=new at(1,1,1,1),at.transparent=new at(0,0,0,0),at.red=new at(1,0,0,1);var ot=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"});};ot.prototype.compare=function(t,e){return this.collator.compare(t,e)},ot.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var st=function(t,e,r){this.text=t,this.scale=e,this.fontStack=r;},ut=function(t){this.sections=t;};function pt(t,e,r,n){return "number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function lt(t){if(null===t)return X;if("string"==typeof t)return H;if("boolean"==typeof t)return J;if("number"==typeof t)return G;if(t instanceof at)return K;if(t instanceof ot)return W;if(t instanceof ut)return Q;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var a=lt(i[n]);if(e){if(e===a)continue;e=$;break}e=a;}return tt(e||$,r)}return Y}function ct(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof at||t instanceof ut?t.toString():JSON.stringify(t)}ut.fromString=function(t){return new ut([new st(t,null,null)])},ut.prototype.toString=function(){return this.sections.map(function(t){return t.text}).join("")},ut.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),t.push(i);}return t};var ht=function(t,e){this.type=t,this.value=e;};ht.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!function t(e){if(null===e)return !0;if("string"==typeof e)return !0;if("boolean"==typeof e)return !0;if("number"==typeof e)return !0;if(e instanceof at)return !0;if(e instanceof ot)return !0;if(e instanceof ut)return !0;if(Array.isArray(e)){for(var r=0,n=e;r<n.length;r+=1)if(!t(n[r]))return !1;return !0}if("object"==typeof e){for(var i in e)if(!t(e[i]))return !1;return !0}return !1}(t[1]))return e.error("invalid value");var r=t[1],n=lt(r),i=e.expectedType;return "array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new ht(n,r)},ht.prototype.evaluate=function(){return this.value},ht.prototype.eachChild=function(){},ht.prototype.possibleOutputs=function(){return [this.value]},ht.prototype.serialize=function(){return "array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof at?["rgba"].concat(this.value.toArray()):this.value instanceof ut?this.value.serialize():this.value};var ft=function(t){this.name="ExpressionEvaluationError",this.message=t;};ft.prototype.toJSON=function(){return this.message};var yt={string:H,number:G,boolean:J,object:Y},dt=function(t,e){this.type=t,this.args=e;};dt.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var a,o;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in yt)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=yt[s],n++;}else a=$;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],n++;}r=tt(a,o);}else r=yt[i];for(var u=[];n<t.length;n++){var p=e.parse(t[n],n,$);if(!p)return null;u.push(p);}return new dt(r,u)},dt.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!nt(this.type,lt(r)))return r;if(e===this.args.length-1)throw new ft("Expected value to be of type "+et(this.type)+", but found "+et(lt(r))+" instead.")}return null},dt.prototype.eachChild=function(t){this.args.forEach(t);},dt.prototype.possibleOutputs=function(){return (t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}));var t;},dt.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n);}}return e.concat(this.args.map(function(t){return t.serialize()}))};var mt=function(t){this.type=Q,this.sections=t;};mt.parse=function(t,e){if(t.length<3)return e.error("Expected at least two arguments.");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");for(var r=[],n=1;n<t.length-1;n+=2){var i=e.parse(t[n],1,$);if(!i)return null;var a=i.type.kind;if("string"!==a&&"value"!==a&&"null"!==a)return e.error("Formatted text type must be 'string', 'value', or 'null'.");var o=t[n+1];if("object"!=typeof o||Array.isArray(o))return e.error("Format options argument must be an object.");var s=null;if(o["font-scale"]&&!(s=e.parse(o["font-scale"],1,G)))return null;var u=null;if(o["text-font"]&&!(u=e.parse(o["text-font"],1,tt(H))))return null;r.push({text:i,scale:s,font:u});}return new mt(r)},mt.prototype.evaluate=function(t){return new ut(this.sections.map(function(e){return new st(ct(e.text.evaluate(t)),e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null)}))},mt.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.text),n.scale&&t(n.scale),n.font&&t(n.font);}},mt.prototype.possibleOutputs=function(){return [void 0]},mt.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.text.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),t.push(i);}return t};var vt={"to-boolean":J,"to-color":K,"to-number":G,"to-string":H},gt=function(t,e){this.type=t,this.args=e;};gt.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var n=vt[r],i=[],a=1;a<t.length;a++){var o=e.parse(t[a],a,$);if(!o)return null;i.push(o);}return new gt(n,i)},gt.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof at)return e;if("string"==typeof e){var a=t.parseColor(e);if(a)return a}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":pt(e[0],e[1],e[2],e[3])))return new at(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ft(r||"Could not parse color from value '"+("string"==typeof e?e:JSON.stringify(e))+"'")}if("number"===this.type.kind){for(var o=null,s=0,u=this.args;s<u.length;s+=1){if(null===(o=u[s].evaluate(t)))return 0;var p=Number(o);if(!isNaN(p))return p}throw new ft("Could not convert "+JSON.stringify(o)+" to number.")}return "formatted"===this.type.kind?ut.fromString(ct(this.args[0].evaluate(t))):ct(this.args[0].evaluate(t))},gt.prototype.eachChild=function(t){this.args.forEach(t);},gt.prototype.possibleOutputs=function(){return (t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}));var t;},gt.prototype.serialize=function(){if("formatted"===this.type.kind)return new mt([{text:this.args[0],scale:null,font:null}]).serialize();var t=["to-"+this.type.kind];return this.eachChild(function(e){t.push(e.serialize());}),t};var xt=["Unknown","Point","LineString","Polygon"],bt=function(){this.globals=null,this.feature=null,this.featureState=null,this._parseColorCache={};};bt.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},bt.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?xt[this.feature.type]:this.feature.type:null},bt.prototype.properties=function(){return this.feature&&this.feature.properties||{}},bt.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=at.parse(t)),e};var _t=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n;};_t.prototype.evaluate=function(t){return this._evaluate(t,this.args)},_t.prototype.eachChild=function(t){this.args.forEach(t);},_t.prototype.possibleOutputs=function(){return [void 0]},_t.prototype.serialize=function(){return [this.name].concat(this.args.map(function(t){return t.serialize()}))},_t.parse=function(t,e){var r=t[0],n=_t.definitions[r];if(!n)return e.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var i=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=a.filter(function(e){var r=e[0];return !Array.isArray(r)||r.length===t.length-1}),s=null,u=0,p=o;u<p.length;u+=1){var l=p[u],c=l[0],h=l[1];s=new Bt(e.registry,e.path,null,e.scope);for(var f=[],y=!1,d=1;d<t.length;d++){var m=t[d],v=Array.isArray(c)?c[d-1]:c.type,g=s.parse(m,1+f.length,v);if(!g){y=!0;break}f.push(g);}if(!y)if(Array.isArray(c)&&c.length!==f.length)s.error("Expected "+c.length+" arguments, but found "+f.length+" instead.");else{for(var x=0;x<f.length;x++){var b=Array.isArray(c)?c[x]:c.type,_=f[x];s.concat(x+1).checkSubtype(b,_.type);}if(0===s.errors.length)return new _t(r,i,h,f)}}if(1===o.length)e.errors.push.apply(e.errors,s.errors);else{for(var w=(o.length?o:a).map(function(t){var e,r=t[0];return e=r,Array.isArray(e)?"("+e.map(et).join(", ")+")":"("+et(e.type)+"...)"}).join(" | "),A=[],k=1;k<t.length;k++){var z=e.parse(t[k],1+A.length);if(!z)return null;A.push(et(z.type));}e.error("Expected arguments of type "+w+", but found ("+A.join(", ")+") instead.");}return null},_t.register=function(t,e){for(var r in _t.definitions=e,e)t[r]=_t;};var wt=function(t,e,r){this.type=W,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e;};function At(t){if(t instanceof _t){if("get"===t.name&&1===t.args.length)return !1;if("feature-state"===t.name)return !1;if("has"===t.name&&1===t.args.length)return !1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return !1;if(/^filter-/.test(t.name))return !1}var e=!0;return t.eachChild(function(t){e&&!At(t)&&(e=!1);}),e}function kt(t){if(t instanceof _t&&"feature-state"===t.name)return !1;var e=!0;return t.eachChild(function(t){e&&!kt(t)&&(e=!1);}),e}function zt(t,e){if(t instanceof _t&&e.indexOf(t.name)>=0)return !1;var r=!0;return t.eachChild(function(t){r&&!zt(t,e)&&(r=!1);}),r}wt.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,J);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,J);if(!i)return null;var a=null;return r.locale&&!(a=e.parse(r.locale,1,H))?null:new wt(n,i,a)},wt.prototype.evaluate=function(t){return new ot(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},wt.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale);},wt.prototype.possibleOutputs=function(){return [void 0]},wt.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var St=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e;};St.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var r=t[1];return e.scope.has(r)?new St(r,e.scope.get(r)):e.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},St.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},St.prototype.eachChild=function(){},St.prototype.possibleOutputs=function(){return [void 0]},St.prototype.serialize=function(){return ["var",this.name]};var Bt=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new Z),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map(function(t){return "["+t+"]"}).join(""),this.scope=n,this.errors=i,this.expectedType=r;};function Vt(t,e){for(var r,n,i=0,a=t.length-1,o=0;i<=a;){if(r=t[o=Math.floor((i+a)/2)],n=t[o+1],e===r||e>r&&e<n)return o;if(r<e)i=o+1;else{if(!(r>e))throw new ft("Input is not a number.");a=o-1;}}return Math.max(o-1,0)}Bt.prototype.parse=function(t,e,r,n,i){return void 0===i&&(i={}),e?this.concat(e,r,n)._parse(t,i):this._parse(t,i)},Bt.prototype._parse=function(t,e){function r(t,e,r){return "assert"===r?new dt(e,[t]):"coerce"===r?new gt(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(t,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,e.typeAnnotation||"coerce");else a=r(a,o,e.typeAnnotation||"assert");}if(!(a instanceof ht)&&function t(e){if(e instanceof St)return t(e.boundExpression);if(e instanceof _t&&"error"===e.name)return !1;if(e instanceof wt)return !1;var r=e instanceof gt||e instanceof dt;var n=!0;e.eachChild(function(e){n=r?n&&t(e):n&&e instanceof ht;});if(!n)return !1;return At(e)&&zt(e,["zoom","heatmap-density","line-progress","is-supported-script"])}(a)){var u=new bt;try{a=new ht(a.type,a.evaluate(u));}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},Bt.prototype.concat=function(t,e,r){var n="number"==typeof t?this.path.concat(t):this.path,i=r?this.scope.concat(r):this.scope;return new Bt(this.registry,n,e||null,i,this.errors)},Bt.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var n=""+this.key+e.map(function(t){return "["+t+"]"}).join("");this.errors.push(new N(n,t));},Bt.prototype.checkSubtype=function(t,e){var r=nt(t,e);return r&&this.error(r),r};var It=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var a=i[n],o=a[0],s=a[1];this.labels.push(o),this.outputs.push(s);}};function Pt(t,e,r){return t*(1-r)+e*r}It.parse=function(t,e){var r=t[1],n=t.slice(2);if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(r=e.parse(r,1,G)))return null;var i=[],a=null;e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType),n.unshift(-1/0);for(var o=0;o<n.length;o+=2){var s=n[o],u=n[o+1],p=o+1,l=o+2;if("number"!=typeof s)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(i.length&&i[i.length-1][0]>=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',p);var c=e.parse(u,l,a);if(!c)return null;a=a||c.type,i.push([s,c]);}return new It(a,r,i)},It.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[Vt(e,n)].evaluate(t)},It.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1){t(r[e]);}},It.prototype.possibleOutputs=function(){return (t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()}));var t;},It.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Mt=Object.freeze({number:Pt,color:function(t,e,r){return new at(Pt(t.r,e.r,r),Pt(t.g,e.g,r),Pt(t.b,e.b,r),Pt(t.a,e.a,r))},array:function(t,e,r){return t.map(function(t,n){return Pt(t,e[n],r)})}}),Ct=.95047,Tt=1,Et=1.08883,Ft=4/29,Ot=6/29,Lt=3*Ot*Ot,Dt=Ot*Ot*Ot,jt=Math.PI/180,Ut=180/Math.PI;function qt(t){return t>Dt?Math.pow(t,1/3):t/Lt+Ft}function Rt(t){return t>Ot?t*t*t:Lt*(t-Ft)}function Nt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Zt(t){return (t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Xt(t){var e=Zt(t.r),r=Zt(t.g),n=Zt(t.b),i=qt((.4124564*e+.3575761*r+.1804375*n)/Ct),a=qt((.2126729*e+.7151522*r+.072175*n)/Tt);return {l:116*a-16,a:500*(i-a),b:200*(a-qt((.0193339*e+.119192*r+.9503041*n)/Et)),alpha:t.a}}function Gt(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=Tt*Rt(e),r=Ct*Rt(r),n=Et*Rt(n),new at(Nt(3.2404542*r-1.5371385*e-.4985314*n),Nt(-.969266*r+1.8760108*e+.041556*n),Nt(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}var Ht={forward:Xt,reverse:Gt,interpolate:function(t,e,r){return {l:Pt(t.l,e.l,r),a:Pt(t.a,e.a,r),b:Pt(t.b,e.b,r),alpha:Pt(t.alpha,e.alpha,r)}}},Jt={forward:function(t){var e=Xt(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*Ut;return {h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*jt,r=t.c;return Gt({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return {h:function(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}(t.h,e.h,r),c:Pt(t.c,e.c,r),l:Pt(t.l,e.l,r),alpha:Pt(t.alpha,e.alpha,r)}}},Kt=Object.freeze({lab:Ht,hcl:Jt}),Yt=function(t,e,r,n,i){this.type=t,this.operator=e,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a<o.length;a+=1){var s=o[a],u=s[0],p=s[1];this.labels.push(u),this.outputs.push(p);}};function $t(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}Yt.interpolationFactor=function(t,e,n,i){var a=0;if("exponential"===t.name)a=$t(e,t.base,n,i);else if("linear"===t.name)a=$t(e,1,n,i);else if("cubic-bezier"===t.name){var o=t.controlPoints;a=new r(o[0],o[1],o[2],o[3]).solve($t(e,1,n,i));}return a},Yt.parse=function(t,e){var r=t[0],n=t[1],i=t[2],a=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var o=n[1];if("number"!=typeof o)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:o};}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some(function(t){return "number"!=typeof t||t<0||t>1}))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s};}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(i=e.parse(i,2,G)))return null;var u=[],p=null;"interpolate-hcl"===r||"interpolate-lab"===r?p=K:e.expectedType&&"value"!==e.expectedType.kind&&(p=e.expectedType);for(var l=0;l<a.length;l+=2){var c=a[l],h=a[l+1],f=l+3,y=l+4;if("number"!=typeof c)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(u.length&&u[u.length-1][0]>=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=e.parse(h,y,p);if(!d)return null;p=p||d.type,u.push([c,d]);}return "number"===p.kind||"color"===p.kind||"array"===p.kind&&"number"===p.itemType.kind&&"number"==typeof p.N?new Yt(p,r,n,i,u):e.error("Type "+et(p)+" is not interpolatable.")},Yt.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;if(n>=e[i-1])return r[i-1].evaluate(t);var a=Vt(e,n),o=e[a],s=e[a+1],u=Yt.interpolationFactor(this.interpolation,n,o,s),p=r[a].evaluate(t),l=r[a+1].evaluate(t);return "interpolate"===this.operator?Mt[this.type.kind.toLowerCase()](p,l,u):"interpolate-hcl"===this.operator?Jt.reverse(Jt.interpolate(Jt.forward(p),Jt.forward(l),u)):Ht.reverse(Ht.interpolate(Ht.forward(p),Ht.forward(l),u))},Yt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1){t(r[e]);}},Yt.prototype.possibleOutputs=function(){return (t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()}));var t;},Yt.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var Wt=function(t,e){this.type=t,this.args=e;};Wt.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],a=0,o=t.slice(1);a<o.length;a+=1){var s=o[a],u=e.parse(s,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!u)return null;r=r||u.type,i.push(u);}var p=n&&i.some(function(t){return nt(n,t.type)});return new Wt(p?$:r,i)},Wt.prototype.evaluate=function(t){for(var e=null,r=0,n=this.args;r<n.length;r+=1){if(null!==(e=n[r].evaluate(t)))break}return e},Wt.prototype.eachChild=function(t){this.args.forEach(t);},Wt.prototype.possibleOutputs=function(){return (t=[]).concat.apply(t,this.args.map(function(t){return t.possibleOutputs()}));var t;},Wt.prototype.serialize=function(){var t=["coalesce"];return this.eachChild(function(e){t.push(e.serialize());}),t};var Qt=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e;};Qt.prototype.evaluate=function(t){return this.result.evaluate(t)},Qt.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1){t(r[e][1]);}t(this.result);},Qt.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var a=e.parse(t[n+1],n+1);if(!a)return null;r.push([i,a]);}var o=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return o?new Qt(r,o):null},Qt.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},Qt.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e],i=n[0],a=n[1];t.push(i,a.serialize());}return t.push(this.result.serialize()),t};var te=function(t,e,r){this.type=t,this.index=e,this.input=r;};te.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,G),n=e.parse(t[2],2,tt(e.expectedType||$));if(!r||!n)return null;var i=n.type;return new te(i.itemType,r,n)},te.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new ft("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new ft("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ft("Array index must be an integer, but found "+e+" instead.");return r[e]},te.prototype.eachChild=function(t){t(this.index),t(this.input);},te.prototype.possibleOutputs=function(){return [void 0]},te.prototype.serialize=function(){return ["at",this.index.serialize(),this.input.serialize()]};var ee=function(t,e,r,n,i,a){this.inputType=t,this.type=e,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a;};ee.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var i={},a=[],o=2;o<t.length-1;o+=2){var s=t[o],u=t[o+1];Array.isArray(s)||(s=[s]);var p=e.concat(o);if(0===s.length)return p.error("Expected at least one branch label.");for(var l=0,c=s;l<c.length;l+=1){var h=c[l];if("number"!=typeof h&&"string"!=typeof h)return p.error("Branch labels must be numbers or strings.");if("number"==typeof h&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return p.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return p.error("Numeric branch labels must be integer values.");if(r){if(p.checkSubtype(r,lt(h)))return null}else r=lt(h);if(void 0!==i[String(h)])return p.error("Branch labels must be unique.");i[String(h)]=a.length;}var f=e.parse(u,o,n);if(!f)return null;n=n||f.type,a.push(f);}var y=e.parse(t[1],1,$);if(!y)return null;var d=e.parse(t[t.length-1],t.length-1,n);return d?"value"!==y.type.kind&&e.concat(1).checkSubtype(r,y.type)?null:new ee(r,n,y,i,a,d):null},ee.prototype.evaluate=function(t){var e=this.input.evaluate(t);return (lt(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},ee.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise);},ee.prototype.possibleOutputs=function(){return (t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()})).concat(this.otherwise.possibleOutputs());var t;},ee.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i<a.length;i+=1){var o=a[i],s=n[t.cases[o]];void 0===s?(n[t.cases[o]]=r.length,r.push([t.cases[o],[o]])):r[s][1].push(o);}for(var u=function(e){return "number"===t.inputType.kind?Number(e):e},p=0,l=r;p<l.length;p+=1){var c=l[p],h=c[0],f=c[1];1===f.length?e.push(u(f[0])):e.push(f.map(u)),e.push(t.outputs[h].serialize());}return e.push(this.otherwise.serialize()),e};var re=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r;};function ne(t,e){return "=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function ie(t,e,r,n){return 0===n.compare(e,r)}function ae(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=J,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind;}return i.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],a=e.parse(t[1],1,$);if(!a)return null;if(!ne(r,a.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+et(a.type)+"'.");var o=e.parse(t[2],2,$);if(!o)return null;if(!ne(r,o.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+et(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot compare types '"+et(a.type)+"' and '"+et(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new dt(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new dt(a.type,[o])));var s=null;if(4===t.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,W)))return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=lt(a),u=lt(o);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new ft('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var p=lt(a),l=lt(o);if("string"!==p.kind||"string"!==l.kind)return e(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):e(i,a,o)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator);},i.prototype.possibleOutputs=function(){return [!0,!1]},i.prototype.serialize=function(){var e=[t];return this.eachChild(function(t){e.push(t.serialize());}),e},i}()}re.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i<t.length-1;i+=2){var a=e.parse(t[i],i,J);if(!a)return null;var o=e.parse(t[i+1],i+1,r);if(!o)return null;n.push([a,o]),r=r||o.type;}var s=e.parse(t[t.length-1],t.length-1,r);return s?new re(r,n,s):null},re.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],a=n[1];if(i.evaluate(t))return a.evaluate(t)}return this.otherwise.evaluate(t)},re.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],a=n[1];t(i),t(a);}t(this.otherwise);},re.prototype.possibleOutputs=function(){return (t=[]).concat.apply(t,this.branches.map(function(t){t[0];return t[1].possibleOutputs()})).concat(this.otherwise.possibleOutputs());var t;},re.prototype.serialize=function(){var t=["case"];return this.eachChild(function(e){t.push(e.serialize());}),t};var oe=ae("==",function(t,e,r){return e===r},ie),se=ae("!=",function(t,e,r){return e!==r},function(t,e,r,n){return !ie(0,e,r,n)}),ue=ae("<",function(t,e,r){return e<r},function(t,e,r,n){return n.compare(e,r)<0}),pe=ae(">",function(t,e,r){return e>r},function(t,e,r,n){return n.compare(e,r)>0}),le=ae("<=",function(t,e,r){return e<=r},function(t,e,r,n){return n.compare(e,r)<=0}),ce=ae(">=",function(t,e,r){return e>=r},function(t,e,r,n){return n.compare(e,r)>=0}),he=function(t){this.type=G,this.input=t;};he.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?e.error("Expected argument of type string or array, but found "+et(r.type)+" instead."):new he(r):null},he.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ft("Expected value to be of type string or array, but found "+et(lt(e))+" instead.")},he.prototype.eachChild=function(t){t(this.input);},he.prototype.possibleOutputs=function(){return [void 0]},he.prototype.serialize=function(){var t=["length"];return this.eachChild(function(e){t.push(e.serialize());}),t};var fe={"==":oe,"!=":se,">":pe,"<":ue,">=":ce,"<=":le,array:dt,at:te,boolean:dt,case:re,coalesce:Wt,collator:wt,format:mt,interpolate:Yt,"interpolate-hcl":Yt,"interpolate-lab":Yt,length:he,let:Qt,literal:ht,match:ee,number:dt,object:dt,step:It,string:dt,"to-boolean":gt,"to-color":gt,"to-number":gt,"to-string":gt,var:St};function ye(t,e){var r=e[0],n=e[1],i=e[2],a=e[3];r=r.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);var o=a?a.evaluate(t):1,s=pt(r,n,i,o);if(s)throw new ft(s);return new at(r/255*o,n/255*o,i/255*o,o)}function de(t,e){return t in e}function me(t,e){var r=e[t];return void 0===r?null:r}function ve(t){return {type:t}}function ge(t){return {result:"success",value:t}}function xe(t){return {result:"error",value:t}}function be(t){return "data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function _e(t){return !!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function we(t){return !!t.expression&&t.expression.interpolated}function Ae(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function ke(t){return "object"==typeof t&&null!==t&&!Array.isArray(t)}function ze(t){return t}function Se(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Be(t,e,r,n,i){return Se(typeof r===i?n[r]:void 0,t.default,e.default)}function Ve(t,e,r){if("number"!==Ae(r))return Se(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Me(t.stops,r);return t.stops[i][1]}function Ie(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Ae(r))return Se(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=Me(t.stops,r),o=function(t,e,r,n){var i=n-r,a=t-r;return 0===i?0:1===e?a/i:(Math.pow(e,a)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[a][0],t.stops[a+1][0]),s=t.stops[a][1],u=t.stops[a+1][1],p=Mt[e.type]||ze;if(t.colorSpace&&"rgb"!==t.colorSpace){var l=Kt[t.colorSpace];p=function(t,e){return l.reverse(l.interpolate(l.forward(t),l.forward(e),o))};}return "function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=s.evaluate.apply(void 0,t),n=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return p(r,n,o)}}:p(s,u,o)}function Pe(t,e,r){return "color"===e.type?r=at.parse(r):"formatted"===e.type?r=ut.fromString(r.toString()):Ae(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Se(r,t.default,e.default)}function Me(t,e){for(var r,n,i=0,a=t.length-1,o=0;i<=a;){if(r=t[o=Math.floor((i+a)/2)][0],n=t[o+1][0],e===r||e>r&&e<n)return o;r<e?i=o+1:r>e&&(a=o-1);}return Math.max(o-1,0)}_t.register(fe,{error:[{kind:"error"},[H],function(t,e){var r=e[0];throw new ft(r.evaluate(t))}],typeof:[H,[$],function(t,e){return et(lt(e[0].evaluate(t)))}],"to-rgba":[tt(G,4),[K],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[K,[G,G,G],ye],rgba:[K,[G,G,G,G],ye],has:{type:J,overloads:[[[H],function(t,e){return de(e[0].evaluate(t),t.properties())}],[[H,Y],function(t,e){var r=e[0],n=e[1];return de(r.evaluate(t),n.evaluate(t))}]]},get:{type:$,overloads:[[[H],function(t,e){return me(e[0].evaluate(t),t.properties())}],[[H,Y],function(t,e){var r=e[0],n=e[1];return me(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[$,[H],function(t,e){return me(e[0].evaluate(t),t.featureState||{})}],properties:[Y,[],function(t){return t.properties()}],"geometry-type":[H,[],function(t){return t.geometryType()}],id:[$,[],function(t){return t.id()}],zoom:[G,[],function(t){return t.globals.zoom}],"heatmap-density":[G,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[G,[],function(t){return t.globals.lineProgress||0}],"+":[G,ve(G),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1){r+=i[n].evaluate(t);}return r}],"*":[G,ve(G),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1){r*=i[n].evaluate(t);}return r}],"-":{type:G,overloads:[[[G,G],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)-n.evaluate(t)}],[[G],function(t,e){return -e[0].evaluate(t)}]]},"/":[G,[G,G],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)/n.evaluate(t)}],"%":[G,[G,G],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)%n.evaluate(t)}],ln2:[G,[],function(){return Math.LN2}],pi:[G,[],function(){return Math.PI}],e:[G,[],function(){return Math.E}],"^":[G,[G,G],function(t,e){var r=e[0],n=e[1];return Math.pow(r.evaluate(t),n.evaluate(t))}],sqrt:[G,[G],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[G,[G],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[G,[G],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[G,[G],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[G,[G],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[G,[G],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[G,[G],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[G,[G],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[G,[G],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[G,[G],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[G,ve(G),function(t,e){return Math.min.apply(Math,e.map(function(e){return e.evaluate(t)}))}],max:[G,ve(G),function(t,e){return Math.max.apply(Math,e.map(function(e){return e.evaluate(t)}))}],abs:[G,[G],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[G,[G],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[G,[G],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[G,[G],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[J,[H,$],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[J,[$],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[J,[H],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[J,[H,$],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<a}],"filter-id-<":[J,[$],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[J,[H,$],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[J,[$],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[J,[H,$],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[J,[$],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[J,[H,$],function(t,e){var r=e[0],n=e[1],i=t.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[J,[$],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[J,[$],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[J,[],function(t){return null!==t.id()}],"filter-type-in":[J,[tt(H)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[J,[tt($)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[J,[H,tt($)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[J,[H,tt($)],function(t,e){var r=e[0],n=e[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return !0;e[i]>t?n=i-1:r=i+1;}return !1}(t.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:J,overloads:[[[J,J],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[ve(J),function(t,e){for(var r=0,n=e;r<n.length;r+=1){if(!n[r].evaluate(t))return !1}return !0}]]},any:{type:J,overloads:[[[J,J],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)||n.evaluate(t)}],[ve(J),function(t,e){for(var r=0,n=e;r<n.length;r+=1){if(n[r].evaluate(t))return !0}return !1}]]},"!":[J,[J],function(t,e){return !e[0].evaluate(t)}],"is-supported-script":[J,[H],function(t,e){var r=e[0],n=t.globals&&t.globals.isSupportedScript;return !n||n(r.evaluate(t))}],upcase:[H,[H],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[H,[H],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[H,ve($),function(t,e){return e.map(function(e){return ct(e.evaluate(t))}).join("")}],"resolved-locale":[H,[W],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Ce=function(t,e){var r;this.expression=t,this._warningHistory={},this._evaluator=new bt,this._defaultValue="color"===(r=e).type&&ke(r.default)?new at(0,0,0,0):"color"===r.type?at.parse(r.default)||null:void 0===r.default?null:r.default,this._enumValues="enum"===e.type?e.values:null;};function Te(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in fe}function Ee(t,e){var r=new Bt(fe,[],function(t){var e={color:K,string:H,number:G,enum:H,boolean:J,formatted:Q};if("array"===t.type)return tt(e[t.value]||$,t.length);return e[t.type]}(e)),n=r.parse(t,void 0,void 0,void 0,"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?ge(new Ce(n,e)):xe(r.errors)}Ce.prototype.evaluateWithoutErrorHandling=function(t,e,r){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this.expression.evaluate(this._evaluator)},Ce.prototype.evaluate=function(t,e,r){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null;try{var n=this.expression.evaluate(this._evaluator);if(null===n||void 0===n)return this._defaultValue;if(this._enumValues&&!(n in this._enumValues))throw new ft("Expected value to be one of "+Object.keys(this._enumValues).map(function(t){return JSON.stringify(t)}).join(", ")+", but found "+JSON.stringify(n)+" instead.");return n}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Fe=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!kt(e.expression);};Fe.prototype.evaluateWithoutErrorHandling=function(t,e,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r)},Fe.prototype.evaluate=function(t,e,r){return this._styleExpression.evaluate(t,e,r)};var Oe=function(t,e,r){this.kind=t,this.zoomStops=r.labels,this._styleExpression=e,this.isStateDependent="camera"!==t&&!kt(e.expression),r instanceof Yt&&(this._interpolationType=r.interpolation);};function Le(t,e){if("error"===(t=Ee(t,e)).result)return t;var r=t.value.expression,n=At(r);if(!n&&!be(e))return xe([new N("","data expressions not supported")]);var i=zt(r,["zoom"]);if(!i&&!_e(e))return xe([new N("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof Qt)r=t(e.result);else if(e instanceof Wt)for(var n=0,i=e.args;n<i.length;n+=1){var a=i[n];if(r=t(a))break}else(e instanceof It||e instanceof Yt)&&e.input instanceof _t&&"zoom"===e.input.name&&(r=e);if(r instanceof N)return r;e.eachChild(function(e){var n=t(e);n instanceof N?r=n:!r&&n?r=new N("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new N("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'));});return r}(r);return a||i?a instanceof N?xe([a]):a instanceof Yt&&!we(e)?xe([new N("",'"interpolate" expressions cannot be used with this property')]):ge(a?new Oe(n?"camera":"composite",t.value,a):new Fe(n?"constant":"source",t.value)):xe([new N("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Oe.prototype.evaluateWithoutErrorHandling=function(t,e,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r)},Oe.prototype.evaluate=function(t,e,r){return this._styleExpression.evaluate(t,e,r)},Oe.prototype.interpolationFactor=function(t,e,r){return this._interpolationType?Yt.interpolationFactor(this._interpolationType,t,e,r):0};var De=function(t,e){this._parameters=t,this._specification=e,U(this,function t(e,r){var n,i,a,o="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||void 0!==e.property,p=s||!u,l=e.type||(we(r)?"exponential":"interval");if(o&&((e=U({},e)).stops&&(e.stops=e.stops.map(function(t){return [t[0],at.parse(t[1])]})),e.default?e.default=at.parse(e.default):e.default=at.parse(r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Kt[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===l)n=Ie;else if("interval"===l)n=Ve;else if("categorical"===l){n=Be,i=Object.create(null);for(var c=0,h=e.stops;c<h.length;c+=1){var f=h[c];i[f[0]]=f[1];}a=typeof e.stops[0][0];}else{if("identity"!==l)throw new Error('Unknown function type "'+l+'"');n=Pe;}if(s){for(var y={},d=[],m=0;m<e.stops.length;m++){var v=e.stops[m],g=v[0].zoom;void 0===y[g]&&(y[g]={zoom:g,type:e.type,property:e.property,default:e.default,stops:[]},d.push(g)),y[g].stops.push([v[0].value,v[1]]);}for(var x=[],b=0,_=d;b<_.length;b+=1){var w=_[b];x.push([y[w].zoom,t(y[w],r)]);}return {kind:"composite",interpolationFactor:Yt.interpolationFactor.bind(void 0,{name:"linear"}),zoomStops:x.map(function(t){return t[0]}),evaluate:function(t,n){var i=t.zoom;return Ie({stops:x,base:e.base},r,i).evaluate(i,n)}}}return p?{kind:"camera",interpolationFactor:"exponential"===l?Yt.interpolationFactor.bind(void 0,{name:"exponential",base:void 0!==e.base?e.base:1}):function(){return 0},zoomStops:e.stops.map(function(t){return t[0]}),evaluate:function(t){var o=t.zoom;return n(e,r,o,i,a)}}:{kind:"source",evaluate:function(t,o){var s=o&&o.properties?o.properties[e.property]:void 0;return void 0===s?Se(e.default,r.default):n(e,r,s,i,a)}}}(this._parameters,this._specification));};function je(t,e){if(ke(t))return new De(t,e);if(Te(t)){var r=Le(t,e);if("error"===r.result)throw new Error(r.value.map(function(t){return t.key+": "+t.message}).join(", "));return r.value}var n=t;return "string"==typeof t&&"color"===e.type&&(n=at.parse(t)),{kind:"constant",evaluate:function(){return n}}}function Ue(t){var e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},a=t.style,o=t.styleSpec,s=[],u=Ae(r);if("object"!==u)return [new D(e,r,"object expected, "+u+" found")];for(var p in r){var l=p.split(".")[0],c=n[l]||n["*"],h=void 0;if(i[l])h=i[l];else if(n[l])h=lr;else if(i["*"])h=i["*"];else{if(!n["*"]){s.push(new D(e,r[p],'unknown property "'+p+'"'));continue}h=lr;}s=s.concat(h({key:(e?e+".":e)+p,value:r[p],valueSpec:c,style:a,styleSpec:o,object:r,objectKey:p},r));}for(var f in n)i[f]||n[f].required&&void 0===n[f].default&&void 0===r[f]&&s.push(new D(e,r,'missing required property "'+f+'"'));return s}function qe(t){var e=t.value,r=t.valueSpec,n=t.style,i=t.styleSpec,a=t.key,o=t.arrayElementValidator||lr;if("array"!==Ae(e))return [new D(a,e,"array expected, "+Ae(e)+" found")];if(r.length&&e.length!==r.length)return [new D(a,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return [new D(a,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value};i.$version<7&&(s.function=r.function),"object"===Ae(r.value)&&(s=r.value);for(var u=[],p=0;p<e.length;p++)u=u.concat(o({array:e,arrayIndex:p,value:e[p],valueSpec:s,style:n,styleSpec:i,key:a+"["+p+"]"}));return u}function Re(t){var e=t.key,r=t.value,n=t.valueSpec,i=Ae(r);return "number"!==i?[new D(e,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new D(e,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new D(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function Ne(t){var e,r,n,i=t.valueSpec,a=q(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,u=!s,p="array"===Ae(t.value.stops)&&"array"===Ae(t.value.stops[0])&&"object"===Ae(t.value.stops[0][0]),l=Ue({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===a)return [new D(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat(qe({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===Ae(r)&&0===r.length&&e.push(new D(t.key,r,"array must have at least one stop"));return e},default:function(t){return lr({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return "identity"===a&&s&&l.push(new D(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||l.push(new D(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!we(t.valueSpec)&&l.push(new D(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!be(t.valueSpec)?l.push(new D(t.key,t.value,"property functions not supported")):s&&!_e(t.valueSpec)&&l.push(new D(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!p||void 0!==t.value.property||l.push(new D(t.key,t.value,'"property" property is required')),l;function c(t){var e=[],a=t.value,s=t.key;if("array"!==Ae(a))return [new D(s,a,"array expected, "+Ae(a)+" found")];if(2!==a.length)return [new D(s,a,"array length 2 expected, length "+a.length+" found")];if(p){if("object"!==Ae(a[0]))return [new D(s,a,"object expected, "+Ae(a[0])+" found")];if(void 0===a[0].zoom)return [new D(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return [new D(s,a,"object stop key must have value")];if(n&&n>q(a[0].zoom))return [new D(s,a[0].zoom,"stop zoom values must appear in ascending order")];q(a[0].zoom)!==n&&(n=q(a[0].zoom),r=void 0,o={}),e=e.concat(Ue({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Re,value:h}}));}else e=e.concat(h({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return e.concat(lr({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=Ae(t.value),u=q(t.value),p=null!==t.value?t.value:n;if(e){if(s!==e)return [new D(t.key,p,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return [new D(t.key,p,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var l="number expected, "+s+" found";return be(i)&&void 0===a&&(l+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new D(t.key,p,l)]}return "categorical"!==a||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==a&&"number"===s&&void 0!==r&&u<r?[new D(t.key,p,"stop domain values must appear in ascending order")]:(r=u,"categorical"===a&&u in o?[new D(t.key,p,"stop domain values must be unique")]:(o[u]=!0,[])):[new D(t.key,p,"integer expected, found "+u)]}}function Ze(t){var e=("property"===t.expressionContext?Le:Ee)(R(t.value),t.valueSpec);return "error"===e.result?e.value.map(function(e){return new D(""+t.key+e.key,t.value,e.message)}):"property"===t.expressionContext&&"text-font"===t.propertyKey&&-1!==e.value._styleExpression.expression.possibleOutputs().indexOf(void 0)?[new D(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')]:"property"!==t.expressionContext||"layout"!==t.propertyType||kt(e.value._styleExpression.expression)?[]:[new D(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')]}function Xe(t){var e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(q(r))&&i.push(new D(e,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(q(r))&&i.push(new D(e,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function Ge(t){if(!0===t||!1===t)return !0;if(!Array.isArray(t)||0===t.length)return !1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":case"!in":case"!has":case"none":return !1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var n=r[e];if(!Ge(n)&&"boolean"!=typeof n)return !1}return !0;default:return !0}}De.deserialize=function(t){return new De(t._parameters,t._specification)},De.serialize=function(t){return {_parameters:t._parameters,_specification:t._specification}};var He={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Je(t){if(null===t||void 0===t)return function(){return !0};Ge(t)||(t=Ye(t));var e=Ee(t,He);if("error"===e.result)throw new Error(e.value.map(function(t){return t.key+": "+t.message}).join(", "));return function(t,r){return e.value.evaluate(t,r)}}function Ke(t,e){return t<e?-1:t>e?1:0}function Ye(t){if(!t)return !0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?$e(t[1],t[2],"=="):"!="===r?tr($e(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?$e(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Ye))):"all"===r?["all"].concat(t.slice(1).map(Ye)):"none"===r?["all"].concat(t.slice(1).map(Ye).map(tr)):"in"===r?We(t[1],t.slice(2)):"!in"===r?tr(We(t[1],t.slice(2))):"has"===r?Qe(t[1]):"!has"!==r||tr(Qe(t[1]))}function $e(t,e,r){switch(t){case"$type":return ["filter-type-"+r,e];case"$id":return ["filter-id-"+r,e];default:return ["filter-"+r,t,e]}}function We(t,e){if(0===e.length)return !1;switch(t){case"$type":return ["filter-type-in",["literal",e]];case"$id":return ["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(function(t){return typeof t!=typeof e[0]})?["filter-in-large",t,["literal",e.sort(Ke)]]:["filter-in-small",t,["literal",e]]}}function Qe(t){switch(t){case"$type":return !0;case"$id":return ["filter-has-id"];default:return ["filter-has",t]}}function tr(t){return ["!",t]}function er(t){return Ge(R(t.value))?Ze(U({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value;var n=e.key;if("array"!==Ae(r))return [new D(n,r,"array expected, "+Ae(r)+" found")];var i=e.styleSpec;var a;var o=[];if(r.length<1)return [new D(n,r,"filter array must have at least 1 element")];o=o.concat(Xe({key:n+"[0]",value:r[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec}));switch(q(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===q(r[1])&&o.push(new D(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new D(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(a=Ae(r[1]))&&o.push(new D(n+"[1]",r[1],"string expected, "+a+" found"));for(var s=2;s<r.length;s++)a=Ae(r[s]),"$type"===q(r[1])?o=o.concat(Xe({key:n+"["+s+"]",value:r[s],valueSpec:i.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==a&&"number"!==a&&"boolean"!==a&&o.push(new D(n+"["+s+"]",r[s],"string, number, or boolean expected, "+a+" found"));break;case"any":case"all":case"none":for(var u=1;u<r.length;u++)o=o.concat(t({key:n+"["+u+"]",value:r[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":a=Ae(r[1]),2!==r.length?o.push(new D(n,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==a&&o.push(new D(n+"[1]",r[1],"string expected, "+a+" found"));}return o}(t)}function rr(t,e){var r=t.key,n=t.style,i=t.styleSpec,a=t.value,o=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return [];var u=o.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return lr({key:r,value:a,valueSpec:i.transition,style:n,styleSpec:i});var p,l=t.valueSpec||s[o];if(!l)return [new D(r,a,'unknown property "'+o+'"')];if("string"===Ae(a)&&be(l)&&!l.tokens&&(p=/^{([^}]+)}$/.exec(a)))return [new D(r,a,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(p[1])+" }`.")];var c=[];return "symbol"===t.layerType&&("text-field"===o&&n&&!n.glyphs&&c.push(new D(r,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&ke(R(a))&&"identity"===q(a.type)&&c.push(new D(r,a,'"text-font" does not support identity functions'))),c.concat(lr({key:t.key,value:a,valueSpec:l,style:n,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:o}))}function nr(t){return rr(t,"paint")}function ir(t){return rr(t,"layout")}function ar(t){var e=[],r=t.value,n=t.key,i=t.style,a=t.styleSpec;r.type||r.ref||e.push(new D(n,r,'either "type" or "ref" is required'));var o,s=q(r.type),u=q(r.ref);if(r.id)for(var p=q(r.id),l=0;l<t.arrayIndex;l++){var c=i.layers[l];q(c.id)===p&&e.push(new D(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+c.id.__line__));}if("ref"in r)["type","source","source-layer","filter","layout"].forEach(function(t){t in r&&e.push(new D(n,r[t],'"'+t+'" is prohibited for ref layers'));}),i.layers.forEach(function(t){q(t.id)===u&&(o=t);}),o?o.ref?e.push(new D(n,r.ref,"ref cannot reference another ref layer")):s=q(o.type):e.push(new D(n,r.ref,'ref layer "'+u+'" not found'));else if("background"!==s)if(r.source){var h=i.sources&&i.sources[r.source],f=h&&q(h.type);h?"vector"===f&&"raster"===s?e.push(new D(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===f&&"raster"!==s?e.push(new D(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==f||r["source-layer"]?"raster-dem"===f&&"hillshade"!==s?e.push(new D(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===f&&h.lineMetrics||e.push(new D(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new D(n,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new D(n,r.source,'source "'+r.source+'" not found'));}else e.push(new D(n,r,'missing required property "source"'));return e=e.concat(Ue({key:n,value:r,valueSpec:a.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return []},type:function(){return lr({key:n+".type",value:r.type,valueSpec:a.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:er,layout:function(t){return Ue({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return ir(U({layerType:s},t))}}})},paint:function(t){return Ue({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return nr(U({layerType:s},t))}}})}}}))}function or(t){var e=t.value,r=t.key,n=t.styleSpec,i=t.style;if(!e.type)return [new D(r,e,'"type" is required')];var a=q(e.type),o=[];switch(a){case"vector":case"raster":case"raster-dem":if(o=o.concat(Ue({key:r,value:e,valueSpec:n["source_"+a.replace("-","_")],style:t.style,styleSpec:n})),"url"in e)for(var s in e)["type","url","tileSize"].indexOf(s)<0&&o.push(new D(r+"."+s,e[s],'a source with a "url" property may not include a "'+s+'" property'));return o;case"geojson":return Ue({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n});case"video":return Ue({key:r,value:e,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return Ue({key:r,value:e,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return o.push(new D(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")),o;default:return Xe({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function sr(t){var e=t.value,r=t.styleSpec,n=r.light,i=t.style,a=[],o=Ae(e);if(void 0===e)return a;if("object"!==o)return a=a.concat([new D("light",e,"object expected, "+o+" found")]);for(var s in e){var u=s.match(/^(.*)-transition$/);a=u&&n[u[1]]&&n[u[1]].transition?a.concat(lr({key:s,value:e[s],valueSpec:r.transition,style:i,styleSpec:r})):n[s]?a.concat(lr({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):a.concat([new D(s,e[s],'unknown property "'+s+'"')]);}return a}function ur(t){var e=t.value,r=t.key,n=Ae(e);return "string"!==n?[new D(r,e,"string expected, "+n+" found")]:[]}var pr={"*":function(){return []},array:qe,boolean:function(t){var e=t.value,r=t.key,n=Ae(e);return "boolean"!==n?[new D(r,e,"boolean expected, "+n+" found")]:[]},number:Re,color:function(t){var e=t.key,r=t.value,n=Ae(r);return "string"!==n?[new D(e,r,"color expected, "+n+" found")]:null===it(r)?[new D(e,r,'color expected, "'+r+'" found')]:[]},constants:j,enum:Xe,filter:er,function:Ne,layer:ar,object:Ue,source:or,light:sr,string:ur,formatted:function(t){return 0===ur(t).length?[]:Ze(t)}};function lr(t){var e=t.value,r=t.valueSpec,n=t.styleSpec;return r.expression&&ke(q(e))?Ne(t):r.expression&&Te(R(e))?Ze(t):r.type&&pr[r.type]?pr[r.type](t):Ue(U({},t,{valueSpec:r.type?n[r.type]:r}))}function cr(t){var e=t.value,r=t.key,n=ur(t);return n.length?n:(-1===e.indexOf("{fontstack}")&&n.push(new D(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new D(r,e,'"glyphs" url must include a "{range}" token')),n)}function hr(t,e){e=e||L;var r=[];return r=r.concat(lr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:cr,"*":function(){return []}}})),t.constants&&(r=r.concat(j({key:"constants",value:t.constants,style:t,styleSpec:e}))),fr(r)}function fr(t){return [].concat(t).sort(function(t,e){return t.line-e.line})}function yr(t){return function(){return fr(t.apply(this,arguments))}}hr.source=yr(or),hr.light=yr(sr),hr.layer=yr(ar),hr.filter=yr(er),hr.paintProperty=yr(nr),hr.layoutProperty=yr(ir);var dr=hr,mr=hr.light,vr=hr.paintProperty,gr=hr.layoutProperty;function xr(t,e){var r=!1;if(e&&e.length)for(var n=0,i=e;n<i.length;n+=1){var a=i[n];t.fire(new F(new Error(a.message))),r=!0;}return r}var br=wr,_r=3;function wr(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],e=i[1],r=i[2],this.d=e+2*r;for(var a=0;a<this.d*this.d;a++){var o=i[_r+a],s=i[_r+a+1];n.push(o===s?null:i.subarray(o,s));}var u=i[_r+n.length],p=i[_r+n.length+1];this.keys=i.subarray(u,p),this.bboxes=i.subarray(p),this.insert=this._insertReadonly;}else{this.d=e+2*r;for(var l=0;l<this.d*this.d;l++)n.push([]);this.keys=[],this.bboxes=[];}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0;var c=r/e*t;this.min=-c,this.max=t+c;}wr.prototype.insert=function(t,e,r,n,i){this._forEachCell(e,r,n,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i);},wr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},wr.prototype._insertCell=function(t,e,r,n,i,a){this.cells[i].push(a);},wr.prototype.query=function(t,e,r,n){var i=this.min,a=this.max;if(t<=i&&e<=i&&a<=r&&a<=n)return Array.prototype.slice.call(this.keys);var o=[];return this._forEachCell(t,e,r,n,this._queryCell,o,{}),o},wr.prototype._queryCell=function(t,e,r,n,i,a,o){var s=this.cells[i];if(null!==s)for(var u=this.keys,p=this.bboxes,l=0;l<s.length;l++){var c=s[l];if(void 0===o[c]){var h=4*c;t<=p[h+2]&&e<=p[h+3]&&r>=p[h+0]&&n>=p[h+1]?(o[c]=!0,a.push(u[c])):o[c]=!1;}}},wr.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),u=this._convertToCellCoord(e),p=this._convertToCellCoord(r),l=this._convertToCellCoord(n),c=s;c<=p;c++)for(var h=u;h<=l;h++){var f=this.d*h+c;if(i.call(this,t,e,r,n,f,a,o))return}},wr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},wr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=_r+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(e+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var a=e,o=0;o<t.length;o++){var s=t[o];i[_r+o]=a,i.set(s,a),a+=s.length;}return i[_r+t.length]=a,i.set(this.keys,a),a+=this.keys.length,i[_r+t.length+1]=a,i.set(this.bboxes,a),a+=this.bboxes.length,i.buffer};var Ar=self.ImageData,kr={};function zr(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),kr[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]};}for(var Sr in zr("Object",Object),br.serialize=function(t,e){var r=t.toArrayBuffer();return e&&e.push(r),{buffer:r}},br.deserialize=function(t){return new br(t.buffer)},zr("Grid",br),zr("Color",at),zr("Error",Error),zr("StylePropertyFunction",De),zr("StyleExpression",Ce,{omit:["_evaluator"]}),zr("ZoomDependentExpression",Oe),zr("ZoomConstantExpression",Fe),zr("CompoundExpression",_t,{omit:["_evaluate"]}),fe)fe[Sr]._classRegistryKey||zr("Expression_"+Sr,fe[Sr]);function Br(t,e){if(null===t||void 0===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(t instanceof ArrayBuffer)return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Ar)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],i=0,a=t;i<a.length;i+=1){var o=a[i];n.push(Br(o,e));}return n}if("object"==typeof t){var s=t.constructor,u=s._classRegistryKey;if(!u)throw new Error("can't serialize object of unregistered class");var p=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var l in t)if(t.hasOwnProperty(l)&&!(kr[u].omit.indexOf(l)>=0)){var c=t[l];p[l]=kr[u].shallow.indexOf(l)>=0?c:Br(c,e);}t instanceof Error&&(p.message=t.message);}if(p.$name)throw new Error("$name property is reserved for worker serialization logic.");return "Object"!==u&&(p.$name=u),p}throw new Error("can't serialize object of type "+typeof t)}function Vr(t){if(null===t||void 0===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof Ar)return t;if(Array.isArray(t))return t.map(Vr);if("object"==typeof t){var e=t.$name||"Object",r=kr[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var n=Object.create(r.prototype),i=0,a=Object.keys(t);i<a.length;i+=1){var o=a[i];if("$name"!==o){var s=t[o];n[o]=kr[e].shallow.indexOf(o)>=0?s:Vr(s);}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Ir=function(){this.first=!0;};Ir.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var Pr={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Mr(t){for(var e=0,r=t;e<r.length;e+=1){if(Tr(r[e].charCodeAt(0)))return !0}return !1}function Cr(t){return !Pr.Arabic(t)&&(!Pr["Arabic Supplement"](t)&&(!Pr["Arabic Extended-A"](t)&&(!Pr["Arabic Presentation Forms-A"](t)&&!Pr["Arabic Presentation Forms-B"](t))))}function Tr(t){return 746===t||747===t||!(t<4352)&&(!!Pr["Bopomofo Extended"](t)||(!!Pr.Bopomofo(t)||(!(!Pr["CJK Compatibility Forms"](t)||t>=65097&&t<=65103)||(!!Pr["CJK Compatibility Ideographs"](t)||(!!Pr["CJK Compatibility"](t)||(!!Pr["CJK Radicals Supplement"](t)||(!!Pr["CJK Strokes"](t)||(!(!Pr["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!Pr["CJK Unified Ideographs Extension A"](t)||(!!Pr["CJK Unified Ideographs"](t)||(!!Pr["Enclosed CJK Letters and Months"](t)||(!!Pr["Hangul Compatibility Jamo"](t)||(!!Pr["Hangul Jamo Extended-A"](t)||(!!Pr["Hangul Jamo Extended-B"](t)||(!!Pr["Hangul Jamo"](t)||(!!Pr["Hangul Syllables"](t)||(!!Pr.Hiragana(t)||(!!Pr["Ideographic Description Characters"](t)||(!!Pr.Kanbun(t)||(!!Pr["Kangxi Radicals"](t)||(!!Pr["Katakana Phonetic Extensions"](t)||(!(!Pr.Katakana(t)||12540===t)||(!(!Pr["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||(!(!Pr["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!Pr["Unified Canadian Aboriginal Syllabics"](t)||(!!Pr["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!Pr["Vertical Forms"](t)||(!!Pr["Yijing Hexagram Symbols"](t)||(!!Pr["Yi Syllables"](t)||!!Pr["Yi Radicals"](t))))))))))))))))))))))))))))))}function Er(t){return !(Tr(t)||function(t){return !!(Pr["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Pr["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Pr["Letterlike Symbols"](t)||Pr["Number Forms"](t)||Pr["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Pr["Control Pictures"](t)&&9251!==t||Pr["Optical Character Recognition"](t)||Pr["Enclosed Alphanumerics"](t)||Pr["Geometric Shapes"](t)||Pr["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Pr["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Pr["CJK Symbols and Punctuation"](t)||Pr.Katakana(t)||Pr["Private Use Area"](t)||Pr["CJK Compatibility Forms"](t)||Pr["Small Form Variants"](t)||Pr["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Fr(t,e){return !(!e&&(t>=1424&&t<=2303||Pr["Arabic Presentation Forms-A"](t)||Pr["Arabic Presentation Forms-B"](t)))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||Pr.Khmer(t))}var Or,Lr=!1,Dr=null,jr=!1,Ur=new O,qr={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return jr||null!=qr.applyArabicShaping}},Rr=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ir,this.transition={});};Rr.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;r<n.length;r+=1)if(!Fr(n[r].charCodeAt(0),e))return !1;return !0}(t,qr.isLoaded())},Rr.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Rr.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Nr=function(t,e){this.property=t,this.value=e,this.expression=je(void 0===e?t.specification.default:e,t.specification);};Nr.prototype.isDataDriven=function(){return "source"===this.expression.kind||"composite"===this.expression.kind},Nr.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var Zr=function(t){this.property=t,this.value=new Nr(t,void 0);};Zr.prototype.transitioned=function(t,e){return new Gr(this.property,this.value,e,c({},t.transition,this.transition),t.now)},Zr.prototype.untransitioned=function(){return new Gr(this.property,this.value,null,{},0)};var Xr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues);};Xr.prototype.getValue=function(t){return g(this._values[t].value.value)},Xr.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Zr(this._values[t].property)),this._values[t].value=new Nr(this._values[t].property,null===e?void 0:g(e));},Xr.prototype.getTransition=function(t){return g(this._values[t].transition)},Xr.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Zr(this._values[t].property)),this._values[t].transition=g(e)||void 0;},Xr.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);var a=this.getTransition(n);void 0!==a&&(t[n+"-transition"]=a);}return t},Xr.prototype.transitioned=function(t,e){for(var r=new Hr(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var a=i[n];r._values[a]=this._values[a].transitioned(t,e._values[a]);}return r},Xr.prototype.untransitioned=function(){for(var t=new Hr(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e];t._values[n]=this._values[n].untransitioned();}return t};var Gr=function(t,e,r,n,i){this.property=t,this.value=e,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=r);};Gr.prototype.possiblyEvaluate=function(t){var e=t.now||0,r=this.value.possiblyEvaluate(t),n=this.prior;if(n){if(e>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(e<this.begin)return n.possiblyEvaluate(t);var i=(e-this.begin)/(this.end-this.begin);return this.property.interpolate(n.possiblyEvaluate(t),r,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(i))}return r};var Hr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues);};Hr.prototype.possiblyEvaluate=function(t){for(var e=new Yr(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var i=n[r];e._values[i]=this._values[i].possiblyEvaluate(t);}return e},Hr.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1){var r=e[t];if(this._values[r].prior)return !0}return !1};var Jr=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues);};Jr.prototype.getValue=function(t){return g(this._values[t].value)},Jr.prototype.setValue=function(t,e){this._values[t]=new Nr(this._values[t].property,null===e?void 0:g(e));},Jr.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var n=r[e],i=this.getValue(n);void 0!==i&&(t[n]=i);}return t},Jr.prototype.possiblyEvaluate=function(t){for(var e=new Yr(this._properties),r=0,n=Object.keys(this._values);r<n.length;r+=1){var i=n[r];e._values[i]=this._values[i].possiblyEvaluate(t);}return e};var Kr=function(t,e,r){this.property=t,this.value=e,this.parameters=r;};Kr.prototype.isConstant=function(){return "constant"===this.value.kind},Kr.prototype.constantOr=function(t){return "constant"===this.value.kind?this.value.value:t},Kr.prototype.evaluate=function(t,e){return this.property.evaluate(this.value,this.parameters,t,e)};var Yr=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues);};Yr.prototype.get=function(t){return this._values[t]};var $r=function(t){this.specification=t;};$r.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},$r.prototype.interpolate=function(t,e,r){var n=Mt[this.specification.type];return n?n(t,e,r):t};var Wr=function(t){this.specification=t;};Wr.prototype.possiblyEvaluate=function(t,e){return "constant"===t.expression.kind||"camera"===t.expression.kind?new Kr(this,{kind:"constant",value:t.expression.evaluate(e)},e):new Kr(this,t.expression,e)},Wr.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Kr(this,{kind:"constant",value:void 0},t.parameters);var n=Mt[this.specification.type];return n?new Kr(this,{kind:"constant",value:n(t.value.value,e.value.value,r)},t.parameters):t},Wr.prototype.evaluate=function(t,e,r,n){return "constant"===t.kind?t.value:t.evaluate(e,r,n)};var Qr=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(t,e){if(void 0===t.value)return new Kr(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var r=t.expression.evaluate(e),n=this._calculate(r,r,r,e);return new Kr(this,{kind:"constant",value:n},e)}if("camera"===t.expression.kind){var i=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Kr(this,{kind:"constant",value:i},e)}return new Kr(this,t.expression,e)},e.prototype.evaluate=function(t,e,r,n){if("source"===t.kind){var i=t.evaluate(e,r,n);return this._calculate(i,i,i,e)}return "composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,n),t.evaluate({zoom:Math.floor(e.zoom)},r,n),t.evaluate({zoom:Math.floor(e.zoom)+1},r,n),e):t.value},e.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Wr),tn=function(t){this.specification=t;};tn.prototype.possiblyEvaluate=function(t,e){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new Rr(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Rr(Math.floor(e.zoom),e)),t.expression.evaluate(new Rr(Math.floor(e.zoom+1),e)),e)}},tn.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},tn.prototype.interpolate=function(t){return t};var en=function(t){this.specification=t;};en.prototype.possiblyEvaluate=function(t,e){return !!t.expression.evaluate(e)},en.prototype.interpolate=function(){return !1};var rn=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},t){var r=t[e],n=this.defaultPropertyValues[e]=new Nr(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Zr(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({});}};zr("DataDrivenProperty",Wr),zr("DataConstantProperty",$r),zr("CrossFadedDataDrivenProperty",Qr),zr("CrossFadedProperty",tn),zr("ColorRampProperty",en);var nn=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this.visibility="visible",this._featureFilter=function(){return !0},"custom"!==e.type&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),r.layout&&(this._unevaluatedLayout=new Jr(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Xr(r.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned();}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return "visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,r){if(null!==e&&void 0!==e){var n="layers."+this.id+".layout."+t;if(this._validate(gr,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility="none"===e?e:"visible";},e.prototype.getPaintProperty=function(t){return d(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(null!==e&&void 0!==e){var n="layers."+this.id+".paint."+t;if(this._validate(vr,n,t,e,r))return !1}if(d(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],a="cross-faded-data-driven"===i.property.specification["property-type"]&&!i.value.value&&e,o=this._transitionablePaint._values[t].value.isDataDriven();this._transitionablePaint.setValue(t,e);var s=this._transitionablePaint._values[t].value.isDataDriven();return this._handleSpecialPaintPropertyUpdate(t),s||o||a},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype.isHidden=function(t){return !!(this.minzoom&&t<this.minzoom)||(!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility)},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint);},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t);},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return "none"===this.visibility&&(t.layout=t.layout||{},t.layout.visibility="none"),v(t,function(t,e){return !(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)})},e.prototype._validate=function(t,e,r,n,i){return (!i||!1!==i.validate)&&xr(this,t.call(dr,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:L,style:{glyphs:!0,sprite:!0}}))},e.prototype.hasOffscreenPass=function(){return !1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Kr&&be(e.property.specification)&&(("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent))return !0}return !1},e}(O),an={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},on=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8;},sn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0);};function un(t,e){void 0===e&&(e=1);var r=0,n=0;return {members:t.map(function(t){var i,a=(i=t.type,an[i].BYTES_PER_ELEMENT),o=r=pn(r,Math.max(e,a)),s=t.components||1;return n=Math.max(n,a),r+=a*s,{name:t.name,type:t.type,components:s,offset:o}}),size:pn(r,Math.max(n,e)),alignment:e}}function pn(t,e){return Math.ceil(t/e)*e}sn.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},sn.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},sn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews());},sn.prototype.clear=function(){this.length=0;},sn.prototype.resize=function(t){this.reserve(t),this.length=t;},sn.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e);}},sn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var ln=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=2*r;return this.int16[n+0]=t,this.int16[n+1]=e,r},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(sn);ln.prototype.bytesPerElement=4,zr("StructArrayLayout2i4",ln);var cn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;this.resize(i+1);var a=4*i;return this.int16[a+0]=t,this.int16[a+1]=e,this.int16[a+2]=r,this.int16[a+3]=n,i},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,t},e}(sn);cn.prototype.bytesPerElement=8,zr("StructArrayLayout4i8",cn);var hn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;this.resize(o+1);var s=6*o;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=i,this.int16[s+5]=a,o},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(sn);hn.prototype.bytesPerElement=12,zr("StructArrayLayout2i4i12",hn);var fn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s){var u=this.length;this.resize(u+1);var p=6*u,l=12*u;return this.int16[p+0]=t,this.int16[p+1]=e,this.int16[p+2]=r,this.int16[p+3]=n,this.uint8[l+8]=i,this.uint8[l+9]=a,this.uint8[l+10]=o,this.uint8[l+11]=s,u},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u){var p=6*t,l=12*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint8[l+8]=a,this.uint8[l+9]=o,this.uint8[l+10]=s,this.uint8[l+11]=u,t},e}(sn);fn.prototype.bytesPerElement=12,zr("StructArrayLayout4i4ub12",fn);var yn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s){var u=this.length;this.resize(u+1);var p=8*u;return this.uint16[p+0]=t,this.uint16[p+1]=e,this.uint16[p+2]=r,this.uint16[p+3]=n,this.uint16[p+4]=i,this.uint16[p+5]=a,this.uint16[p+6]=o,this.uint16[p+7]=s,u},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u){var p=8*t;return this.uint16[p+0]=e,this.uint16[p+1]=r,this.uint16[p+2]=n,this.uint16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=u,t},e}(sn);yn.prototype.bytesPerElement=16,zr("StructArrayLayout8ui16",yn);var dn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s){var u=this.length;this.resize(u+1);var p=8*u;return this.int16[p+0]=t,this.int16[p+1]=e,this.int16[p+2]=r,this.int16[p+3]=n,this.uint16[p+4]=i,this.uint16[p+5]=a,this.uint16[p+6]=o,this.uint16[p+7]=s,u},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u){var p=8*t;return this.int16[p+0]=e,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=a,this.uint16[p+5]=o,this.uint16[p+6]=s,this.uint16[p+7]=u,t},e}(sn);dn.prototype.bytesPerElement=16,zr("StructArrayLayout4i4ui16",dn);var mn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;this.resize(n+1);var i=3*n;return this.float32[i+0]=t,this.float32[i+1]=e,this.float32[i+2]=r,n},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=r,this.float32[i+2]=n,t},e}(sn);mn.prototype.bytesPerElement=12,zr("StructArrayLayout3f12",mn);var vn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t){var e=this.length;this.resize(e+1);var r=1*e;return this.uint32[r+0]=t,e},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(sn);vn.prototype.bytesPerElement=4,zr("StructArrayLayout1ul4",vn);var gn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,p,l){var c=this.length;this.resize(c+1);var h=12*c,f=6*c;return this.int16[h+0]=t,this.int16[h+1]=e,this.int16[h+2]=r,this.int16[h+3]=n,this.int16[h+4]=i,this.int16[h+5]=a,this.uint32[f+3]=o,this.uint16[h+8]=s,this.uint16[h+9]=u,this.int16[h+10]=p,this.int16[h+11]=l,c},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,p,l,c){var h=12*t,f=6*t;return this.int16[h+0]=e,this.int16[h+1]=r,this.int16[h+2]=n,this.int16[h+3]=i,this.int16[h+4]=a,this.int16[h+5]=o,this.uint32[f+3]=s,this.uint16[h+8]=u,this.uint16[h+9]=p,this.int16[h+10]=l,this.int16[h+11]=c,t},e}(sn);gn.prototype.bytesPerElement=24,zr("StructArrayLayout6i1ul2ui2i24",gn);var xn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a){var o=this.length;this.resize(o+1);var s=6*o;return this.int16[s+0]=t,this.int16[s+1]=e,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=i,this.int16[s+5]=a,o},e.prototype.emplace=function(t,e,r,n,i,a,o){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,t},e}(sn);xn.prototype.bytesPerElement=12,zr("StructArrayLayout2i2i2i12",xn);var bn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=4*r;return this.uint8[n+0]=t,this.uint8[n+1]=e,r},e.prototype.emplace=function(t,e,r){var n=4*t;return this.uint8[n+0]=e,this.uint8[n+1]=r,t},e}(sn);bn.prototype.bytesPerElement=4,zr("StructArrayLayout2ub4",bn);var _n=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){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);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,p,l,c,h,f){var y=this.length;this.resize(y+1);var d=20*y,m=10*y,v=40*y;return this.int16[d+0]=t,this.int16[d+1]=e,this.uint16[d+2]=r,this.uint16[d+3]=n,this.uint32[m+2]=i,this.uint32[m+3]=a,this.uint32[m+4]=o,this.uint16[d+10]=s,this.uint16[d+11]=u,this.uint16[d+12]=p,this.float32[m+7]=l,this.float32[m+8]=c,this.uint8[v+36]=h,this.uint8[v+37]=f,y},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,p,l,c,h,f,y){var d=20*t,m=10*t,v=40*t;return this.int16[d+0]=e,this.int16[d+1]=r,this.uint16[d+2]=n,this.uint16[d+3]=i,this.uint32[m+2]=a,this.uint32[m+3]=o,this.uint32[m+4]=s,this.uint16[d+10]=u,this.uint16[d+11]=p,this.uint16[d+12]=l,this.float32[m+7]=c,this.float32[m+8]=h,this.uint8[v+36]=f,this.uint8[v+37]=y,t},e}(sn);_n.prototype.bytesPerElement=40,zr("StructArrayLayout2i2ui3ul3ui2f2ub40",_n);var wn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s,u,p,l,c,h,f){var y=this.length;this.resize(y+1);var d=16*y,m=8*y;return this.int16[d+0]=t,this.int16[d+1]=e,this.int16[d+2]=r,this.int16[d+3]=n,this.uint16[d+4]=i,this.uint16[d+5]=a,this.uint16[d+6]=o,this.uint16[d+7]=s,this.uint16[d+8]=u,this.uint16[d+9]=p,this.uint16[d+10]=l,this.uint16[d+11]=c,this.uint16[d+12]=h,this.uint32[m+7]=f,y},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,p,l,c,h,f,y){var d=16*t,m=8*t;return this.int16[d+0]=e,this.int16[d+1]=r,this.int16[d+2]=n,this.int16[d+3]=i,this.uint16[d+4]=a,this.uint16[d+5]=o,this.uint16[d+6]=s,this.uint16[d+7]=u,this.uint16[d+8]=p,this.uint16[d+9]=l,this.uint16[d+10]=c,this.uint16[d+11]=h,this.uint16[d+12]=f,this.uint32[m+7]=y,t},e}(sn);wn.prototype.bytesPerElement=32,zr("StructArrayLayout4i9ui1ul32",wn);var An=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t){var e=this.length;this.resize(e+1);var r=1*e;return this.float32[r+0]=t,e},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(sn);An.prototype.bytesPerElement=4,zr("StructArrayLayout1f4",An);var kn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;this.resize(n+1);var i=3*n;return this.int16[i+0]=t,this.int16[i+1]=e,this.int16[i+2]=r,n},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=r,this.int16[i+2]=n,t},e}(sn);kn.prototype.bytesPerElement=6,zr("StructArrayLayout3i6",kn);var zn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;this.resize(n+1);var i=2*n,a=4*n;return this.uint32[i+0]=t,this.uint16[a+2]=e,this.uint16[a+3]=r,n},e.prototype.emplace=function(t,e,r,n){var i=2*t,a=4*t;return this.uint32[i+0]=e,this.uint16[a+2]=r,this.uint16[a+3]=n,t},e}(sn);zn.prototype.bytesPerElement=8,zr("StructArrayLayout1ul2ui8",zn);var Sn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r){var n=this.length;this.resize(n+1);var i=3*n;return this.uint16[i+0]=t,this.uint16[i+1]=e,this.uint16[i+2]=r,n},e.prototype.emplace=function(t,e,r,n){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,this.uint16[i+2]=n,t},e}(sn);Sn.prototype.bytesPerElement=6,zr("StructArrayLayout3ui6",Sn);var Bn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=2*r;return this.uint16[n+0]=t,this.uint16[n+1]=e,r},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(sn);Bn.prototype.bytesPerElement=4,zr("StructArrayLayout2ui4",Bn);var Vn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t){var e=this.length;this.resize(e+1);var r=1*e;return this.uint16[r+0]=t,e},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(sn);Vn.prototype.bytesPerElement=2,zr("StructArrayLayout1ui2",Vn);var In=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e){var r=this.length;this.resize(r+1);var n=2*r;return this.float32[n+0]=t,this.float32[n+1]=e,r},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(sn);In.prototype.bytesPerElement=8,zr("StructArrayLayout2f8",In);var Pn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n){var i=this.length;this.resize(i+1);var a=4*i;return this.float32[a+0]=t,this.float32[a+1]=e,this.float32[a+2]=r,this.float32[a+3]=n,i},e.prototype.emplace=function(t,e,r,n,i){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,t},e}(sn);Pn.prototype.bytesPerElement=16,zr("StructArrayLayout4f16",Pn);var Mn=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t;},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t;},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.x1.set=function(t){this._structArray.int16[this._pos2+2]=t;},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.y1.set=function(t){this._structArray.int16[this._pos2+3]=t;},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.x2.set=function(t){this._structArray.int16[this._pos2+4]=t;},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.y2.set=function(t){this._structArray.int16[this._pos2+5]=t;},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t;},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t;},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t;},r.radius.get=function(){return this._structArray.int16[this._pos2+10]},r.radius.set=function(t){this._structArray.int16[this._pos2+10]=t;},r.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},r.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t;},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(on);Mn.prototype.size=24;var Cn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Mn(this,t)},e}(gn);zr("CollisionBoxArray",Cn);var Tn=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},hidden:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t;},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t;},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t;},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t;},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t;},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t;},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t;},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t;},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t;},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t;},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t;},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t;},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t;},r.hidden.get=function(){return this._structArray.uint8[this._pos1+37]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+37]=t;},Object.defineProperties(e.prototype,r),e}(on);Tn.prototype.size=40;var En=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Tn(this,t)},e}(_n);zr("PlacedSymbolArray",En);var Fn=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},horizontalPlacedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},crossTileID:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t;},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t;},r.horizontalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.horizontalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+2]=t;},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.verticalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+3]=t;},r.key.get=function(){return this._structArray.uint16[this._pos2+4]},r.key.set=function(t){this._structArray.uint16[this._pos2+4]=t;},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+5]},r.textBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+5]=t;},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+6]},r.textBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+6]=t;},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+7]},r.iconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+7]=t;},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.iconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t;},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.featureIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t;},r.numGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+10]},r.numGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+10]=t;},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+11]},r.numVerticalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+11]=t;},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+12]},r.numIconVertices.set=function(t){this._structArray.uint16[this._pos2+12]=t;},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+7]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+7]=t;},Object.defineProperties(e.prototype,r),e}(on);Fn.prototype.size=32;var On=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Fn(this,t)},e}(wn);zr("SymbolInstanceArray",On);var Ln=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={offsetX:{configurable:!0}};return r.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},r.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t;},Object.defineProperties(e.prototype,r),e}(on);Ln.prototype.size=4;var Dn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e.prototype.get=function(t){return new Ln(this,t)},e}(An);zr("GlyphOffsetArray",Dn);var jn=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return r.x.get=function(){return this._structArray.int16[this._pos2+0]},r.x.set=function(t){this._structArray.int16[this._pos2+0]=t;},r.y.get=function(){return this._structArray.int16[this._pos2+1]},r.y.set=function(t){this._structArray.int16[this._pos2+1]=t;},r.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},r.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t;},Object.defineProperties(e.prototype,r),e}(on);jn.prototype.size=6;var Un=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e.prototype.get=function(t){return new jn(this,t)},e}(kn);zr("SymbolLineVertexArray",Un);var qn=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t;},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t;},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},r.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t;},Object.defineProperties(e.prototype,r),e}(on);qn.prototype.size=8;var Rn=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new qn(this,t)},e}(zn);zr("FeatureIndexArray",Rn);var Nn=un([{name:"a_pos",components:2,type:"Int16"}],4),Zn=Nn.members,Xn=(Nn.size,Nn.alignment,function(t){void 0===t&&(t=[]),this.segments=t;});Xn.prototype.prepareSegment=function(t,e,r){var n=this.segments[this.segments.length-1];return t>Xn.MAX_VERTEX_ARRAY_LENGTH&&b("Max vertices per segment is "+Xn.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>Xn.MAX_VERTEX_ARRAY_LENGTH)&&(n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},this.segments.push(n)),n},Xn.prototype.get=function(){return this.segments},Xn.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r=e[t];for(var n in r.vaos)r.vaos[n].destroy();}},Xn.simpleSegment=function(t,e,r,n){return new Xn([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:n,vaos:{}}])},Xn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,zr("SegmentVector",Xn);var Gn=function(t,e){return 256*(t=l(Math.floor(t),0,255))+(e=l(Math.floor(e),0,255))},Hn=function(){this.ids=[],this.positions=[],this.indexed=!1;};function Jn(t,e,r){var n=t[e];t[e]=t[r],t[r]=n;}Hn.prototype.add=function(t,e,r,n){this.ids.push(t),this.positions.push(e,r,n);},Hn.prototype.getPositions=function(t){for(var e=0,r=this.ids.length-1;e<r;){var n=e+r>>1;this.ids[n]>=t?r=n:e=n+1;}for(var i=[];this.ids[e]===t;){var a=this.positions[3*e],o=this.positions[3*e+1],s=this.positions[3*e+2];i.push({index:a,start:o,end:s}),e++;}return i},Hn.serialize=function(t,e){var r=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,r,n,i){if(n>=i)return;var a=e[n+i>>1];var o=n-1;var s=i+1;for(;;){do{o++;}while(e[o]<a);do{s--;}while(e[s]>a);if(o>=s)break;Jn(e,o,s),Jn(r,3*o,3*s),Jn(r,3*o+1,3*s+1),Jn(r,3*o+2,3*s+2);}t(e,r,n,s);t(e,r,s+1,i);}(r,n,0,r.length-1),e.push(r.buffer,n.buffer),{ids:r,positions:n}},Hn.deserialize=function(t){var e=new Hn;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},zr("FeaturePositionMap",Hn);var Kn=function(t,e){this.gl=t.gl,this.location=e;},Yn=function(t){function e(e,r){t.call(this,e,r),this.current=0;}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t));},e}(Kn),$n=function(t){function e(e,r){t.call(this,e,r),this.current=0;}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t));},e}(Kn),Wn=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0];}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]));},e}(Kn),Qn=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0];}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]));},e}(Kn),ti=function(t){function e(e,r){t.call(this,e,r),this.current=[0,0,0,0];}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]));},e}(Kn),ei=function(t){function e(e,r){t.call(this,e,r),this.current=at.transparent;}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a));},e}(Kn),ri=new Float32Array(16),ni=function(t){function e(e,r){t.call(this,e,r),this.current=ri;}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(Kn);function ii(t){return [Gn(255*t.r,255*t.g),Gn(255*t.b,255*t.a)]}var ai=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map(function(t){return "u_"+t}),this.type=r,this.maxValue=-1/0;};ai.prototype.defines=function(){return this.names.map(function(t){return "#define HAS_UNIFORM_u_"+t})},ai.prototype.setConstantPatternPositions=function(){},ai.prototype.populatePaintArray=function(){},ai.prototype.updatePaintArray=function(){},ai.prototype.upload=function(){},ai.prototype.destroy=function(){},ai.prototype.setUniforms=function(t,e,r,n){e.set(n.constantOr(this.value));},ai.prototype.getBinding=function(t,e){return "color"===this.type?new ei(t,e):new $n(t,e)},ai.serialize=function(t){var e=t.value,r=t.names,n=t.type;return {value:Br(e),names:r,type:n}},ai.deserialize=function(t){var e=t.value,r=t.names,n=t.type;return new ai(Vr(e),r,n)};var oi=function(t,e,r){this.value=t,this.names=e,this.uniformNames=this.names.map(function(t){return "u_"+t}),this.type=r,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null};};oi.prototype.defines=function(){return this.names.map(function(t){return "#define HAS_UNIFORM_u_"+t})},oi.prototype.populatePaintArray=function(){},oi.prototype.updatePaintArray=function(){},oi.prototype.upload=function(){},oi.prototype.destroy=function(){},oi.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr;},oi.prototype.setUniforms=function(t,e,r,n,i){var a=this.patternPositions;"u_pattern_to"===i&&a.patternTo&&e.set(a.patternTo),"u_pattern_from"===i&&a.patternFrom&&e.set(a.patternFrom);},oi.prototype.getBinding=function(t,e){return new ti(t,e)};var si=function(t,e,r,n){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map(function(t){return "a_"+t}),this.maxValue=-1/0,this.paintVertexAttributes=e.map(function(t){return {name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}}),this.paintVertexArray=new n;};si.prototype.defines=function(){return []},si.prototype.setConstantPatternPositions=function(){},si.prototype.populatePaintArray=function(t,e){var r=this.paintVertexArray,n=r.length;r.reserve(t);var i=this.expression.evaluate(new Rr(0),e,{});if("color"===this.type)for(var a=ii(i),o=n;o<t;o++)r.emplaceBack(a[0],a[1]);else{for(var s=n;s<t;s++)r.emplaceBack(i);this.maxValue=Math.max(this.maxValue,i);}},si.prototype.updatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,a=this.expression.evaluate({zoom:0},r,n);if("color"===this.type)for(var o=ii(a),s=t;s<e;s++)i.emplace(s,o[0],o[1]);else{for(var u=t;u<e;u++)i.emplace(u,a);this.maxValue=Math.max(this.maxValue,a);}},si.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent));},si.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy();},si.prototype.setUniforms=function(t,e){e.set(0);},si.prototype.getBinding=function(t,e){return new $n(t,e)};var ui=function(t,e,r,n,i,a){this.expression=t,this.names=e,this.uniformNames=this.names.map(function(t){return "a_"+t+"_t"}),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=-1/0;var o=a;this.paintVertexAttributes=e.map(function(t){return {name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}}),this.paintVertexArray=new o;};ui.prototype.defines=function(){return []},ui.prototype.setConstantPatternPositions=function(){},ui.prototype.populatePaintArray=function(t,e){var r=this.paintVertexArray,n=r.length;r.reserve(t);var i=this.expression.evaluate(new Rr(this.zoom),e,{}),a=this.expression.evaluate(new Rr(this.zoom+1),e,{});if("color"===this.type)for(var o=ii(i),s=ii(a),u=n;u<t;u++)r.emplaceBack(o[0],o[1],s[0],s[1]);else{for(var p=n;p<t;p++)r.emplaceBack(i,a);this.maxValue=Math.max(this.maxValue,i,a);}},ui.prototype.updatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,a=this.expression.evaluate({zoom:this.zoom},r,n),o=this.expression.evaluate({zoom:this.zoom+1},r,n);if("color"===this.type)for(var s=ii(a),u=ii(o),p=t;p<e;p++)i.emplace(p,s[0],s[1],u[0],u[1]);else{for(var l=t;l<e;l++)i.emplace(l,a,o);this.maxValue=Math.max(this.maxValue,a,o);}},ui.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent));},ui.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy();},ui.prototype.interpolationFactor=function(t){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(t),this.zoom,this.zoom+1):this.expression.interpolationFactor(t,this.zoom,this.zoom+1)},ui.prototype.setUniforms=function(t,e,r){e.set(this.interpolationFactor(r.zoom));},ui.prototype.getBinding=function(t,e){return new $n(t,e)};var pi=function(t,e,r,n,i,a,o){this.expression=t,this.names=e,this.type=r,this.uniformNames=this.names.map(function(t){return "a_"+t+"_t"}),this.useIntegerZoom=n,this.zoom=i,this.maxValue=-1/0,this.layerId=o,this.paintVertexAttributes=e.map(function(t){return {name:"a_"+t,type:"Uint16",components:4,offset:0}}),this.zoomInPaintVertexArray=new a,this.zoomOutPaintVertexArray=new a;};pi.prototype.defines=function(){return []},pi.prototype.setConstantPatternPositions=function(){},pi.prototype.populatePaintArray=function(t,e,r){var n=this.zoomInPaintVertexArray,i=this.zoomOutPaintVertexArray,a=this.layerId,o=n.length;if(n.reserve(t),i.reserve(t),r&&e.patterns&&e.patterns[a]){var s=e.patterns[a],u=s.min,p=s.mid,l=s.max,c=r[u],h=r[p],f=r[l];if(!c||!h||!f)return;for(var y=o;y<t;y++)n.emplaceBack(h.tl[0],h.tl[1],h.br[0],h.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1]),i.emplaceBack(h.tl[0],h.tl[1],h.br[0],h.br[1],f.tl[0],f.tl[1],f.br[0],f.br[1]);}},pi.prototype.updatePaintArray=function(t,e,r,n,i){var a=this.zoomInPaintVertexArray,o=this.zoomOutPaintVertexArray,s=this.layerId;if(i&&r.patterns&&r.patterns[s]){var u=r.patterns[s],p=u.min,l=u.mid,c=u.max,h=i[p],f=i[l],y=i[c];if(!h||!f||!y)return;for(var d=t;d<e;d++)a.emplace(d,f.tl[0],f.tl[1],f.br[0],f.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1]),o.emplace(d,f.tl[0],f.tl[1],f.br[0],f.br[1],y.tl[0],y.tl[1],y.br[0],y.br[1]);}},pi.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent));},pi.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy();},pi.prototype.setUniforms=function(t,e){e.set(0);},pi.prototype.getBinding=function(t,e){return new $n(t,e)};var li=function(){this.binders={},this.cacheKey="",this._buffers=[],this._featureMap=new Hn,this._bufferOffset=0;};li.createDynamic=function(t,e,r){var n=new li,i=[];for(var a in t.paint._values)if(r(a)){var o=t.paint.get(a);if(o instanceof Kr&&be(o.property.specification)){var s=hi(a,t.type),u=o.property.specification.type,p=o.property.useIntegerZoom;if("cross-faded"===o.property.specification["property-type"]||"cross-faded-data-driven"===o.property.specification["property-type"])if("constant"===o.value.kind)n.binders[a]=new oi(o.value.value,s,u),i.push("/u_"+a);else{var l=fi(a,u,"source");n.binders[a]=new pi(o.value,s,u,p,e,l,t.id),i.push("/a_"+a);}else if("constant"===o.value.kind)n.binders[a]=new ai(o.value.value,s,u),i.push("/u_"+a);else if("source"===o.value.kind){var c=fi(a,u,"source");n.binders[a]=new si(o.value,s,u,c),i.push("/a_"+a);}else{var h=fi(a,u,"composite");n.binders[a]=new ui(o.value,s,u,p,e,h),i.push("/z_"+a);}}}return n.cacheKey=i.sort().join(""),n},li.prototype.populatePaintArrays=function(t,e,r,n){for(var i in this.binders){this.binders[i].populatePaintArray(t,e,n);}void 0!==e.id&&this._featureMap.add(+e.id,r,this._bufferOffset,t),this._bufferOffset=t;},li.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){this.binders[r].setConstantPatternPositions(t,e);}},li.prototype.updatePaintArrays=function(t,e,r,n){var i=!1;for(var a in t)for(var o=0,s=this._featureMap.getPositions(+a);o<s.length;o+=1){var u=s[o],p=e.feature(u.index);for(var l in this.binders){var c=this.binders[l];if(!(c instanceof ai||c instanceof oi)&&!0===c.expression.isStateDependent){var h=r.paint.get(l);c.expression=h.value,c.updatePaintArray(u.start,u.end,p,t[a],n),i=!0;}}}return i},li.prototype.defines=function(){var t=[];for(var e in this.binders)t.push.apply(t,this.binders[e].defines());return t},li.prototype.getPaintVertexBuffers=function(){return this._buffers},li.prototype.getUniforms=function(t,e){var r={};for(var n in this.binders)for(var i=this.binders[n],a=0,o=i.uniformNames;a<o.length;a+=1){var s=o[a];r[s]=i.getBinding(t,e[s]);}return r},li.prototype.setUniforms=function(t,e,r,n){for(var i in this.binders)for(var a=this.binders[i],o=0,s=a.uniformNames;o<s.length;o+=1){var u=s[o];a.setUniforms(t,e[u],n,r.get(i),u);}},li.prototype.updatePatternPaintBuffers=function(t){var e=[];for(var r in this.binders){var n=this.binders[r];if(n instanceof pi){var i=2===t.fromScale?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&e.push(i);}else(n instanceof si||n instanceof ui)&&n.paintVertexBuffer&&e.push(n.paintVertexBuffer);}this._buffers=e;},li.prototype.upload=function(t){for(var e in this.binders)this.binders[e].upload(t);var r=[];for(var n in this.binders){var i=this.binders[n];(i instanceof si||i instanceof ui)&&i.paintVertexBuffer&&r.push(i.paintVertexBuffer);}this._buffers=r;},li.prototype.destroy=function(){for(var t in this.binders)this.binders[t].destroy();};var ci=function(t,e,r,n){void 0===n&&(n=function(){return !0}),this.programConfigurations={};for(var i=0,a=e;i<a.length;i+=1){var o=a[i];this.programConfigurations[o.id]=li.createDynamic(o,r,n),this.programConfigurations[o.id].layoutAttributes=t;}this.needsUpload=!1;};function hi(t,e){return {"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from"],"fill-pattern":["pattern_to","pattern_from"],"fill-extrusion-pattern":["pattern_to","pattern_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function fi(t,e,r){var n={color:{source:In,composite:Pn},number:{source:An,composite:In}},i=function(t){return {"line-pattern":{source:yn,composite:yn},"fill-pattern":{source:yn,composite:yn},"fill-extrusion-pattern":{source:yn,composite:yn}}[t]}(t);return i&&i[r]||n[e][r]}ci.prototype.populatePaintArrays=function(t,e,r,n){for(var i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(t,e,r,n);this.needsUpload=!0;},ci.prototype.updatePaintArrays=function(t,e,r,n){for(var i=0,a=r;i<a.length;i+=1){var o=a[i];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,e,o,n)||this.needsUpload;}},ci.prototype.get=function(t){return this.programConfigurations[t]},ci.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1;}},ci.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy();},zr("ConstantBinder",ai),zr("CrossFadedConstantBinder",oi),zr("SourceExpressionBinder",si),zr("CrossFadedCompositeBinder",pi),zr("CompositeExpressionBinder",ui),zr("ProgramConfiguration",li,{omit:["_buffers"]}),zr("ProgramConfigurationSet",ci);var yi=8192;var di,mi=(di=16,{min:-1*Math.pow(2,di-1),max:Math.pow(2,di-1)-1});function vi(t){for(var e=yi/t.extent,r=t.loadGeometry(),n=0;n<r.length;n++)for(var i=r[n],a=0;a<i.length;a++){var o=i[a];o.x=Math.round(o.x*e),o.y=Math.round(o.y*e),(o.x<mi.min||o.x>mi.max||o.y<mi.min||o.y>mi.max)&&b("Geometry exceeds allowed extent, reduce your vector tile buffer size");}return r}function gi(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2);}var xi=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ln,this.indexArray=new Sn,this.segments=new Xn,this.programConfigurations=new ci(Zn,t.layers,t.zoom);};function bi(t,e,r){for(var n=0;n<t.length;n++){var i=t[n];if(Ii(i,e))return !0;if(Si(e,i,r))return !0}return !1}function _i(t,e){if(1===t.length&&1===t[0].length)return Vi(e,t[0][0]);for(var r=0;r<e.length;r++)for(var n=e[r],i=0;i<n.length;i++)if(Vi(t,n[i]))return !0;for(var a=0;a<t.length;a++){for(var o=t[a],s=0;s<o.length;s++)if(Vi(e,o[s]))return !0;for(var u=0;u<e.length;u++)if(ki(o,e[u]))return !0}return !1}function wi(t,e,r){for(var n=0;n<e.length;n++)for(var i=e[n],a=0;a<t.length;a++){var o=t[a];if(o.length>=3)for(var s=0;s<i.length;s++)if(Ii(o,i[s]))return !0;if(Ai(o,i,r))return !0}return !1}function Ai(t,e,r){if(t.length>1){if(ki(t,e))return !0;for(var n=0;n<e.length;n++)if(Si(e[n],t,r))return !0}for(var i=0;i<t.length;i++)if(Si(t[i],e,r))return !0;return !1}function ki(t,e){if(0===t.length||0===e.length)return !1;for(var r=0;r<t.length-1;r++)for(var n=t[r],i=t[r+1],a=0;a<e.length-1;a++){if(zi(n,i,e[a],e[a+1]))return !0}return !1}function zi(t,e,r,n){return _(t,r,n)!==_(e,r,n)&&_(t,e,r)!==_(t,e,n)}function Si(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])<n;for(var i=1;i<e.length;i++){if(Bi(t,e[i-1],e[i])<n)return !0}return !1}function Bi(t,e,r){var n=e.distSqr(r);if(0===n)return t.distSqr(e);var i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function Vi(t,e){for(var r,n,i,a=!1,o=0;o<t.length;o++)for(var s=0,u=(r=t[o]).length-1;s<r.length;u=s++)n=r[s],i=r[u],n.y>e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function Ii(t,e){for(var r=!1,n=0,i=t.length-1;n<t.length;i=n++){var a=t[n],o=t[i];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r);}return r}function Pi(t,e,r){var n=e.paint.get(t).value;return "constant"===n.kind?n.value:r.programConfigurations.get(e.id).binders[t].maxValue}function Mi(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ci(t,e,r,n,i){if(!e[0]&&!e[1])return t;var o=a.convert(e);"viewport"===r&&o._rotate(-n);for(var s=[],u=0;u<t.length;u++){for(var p=t[u],l=[],c=0;c<p.length;c++)l.push(p[c].sub(o._mult(i)));s.push(l);}return s}xi.prototype.populate=function(t,e){for(var r=0,n=t;r<n.length;r+=1){var i=n[r],a=i.feature,o=i.index,s=i.sourceLayerIndex;if(this.layers[0]._featureFilter(new Rr(this.zoom),a)){var u=vi(a);this.addFeature(a,u,o),e.featureIndex.insert(a,u,o,s,this.index);}}},xi.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},xi.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},xi.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},xi.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Zn),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;},xi.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());},xi.prototype.addFeature=function(t,e,r){for(var n=0,i=e;n<i.length;n+=1)for(var a=0,o=i[n];a<o.length;a+=1){var s=o[a],u=s.x,p=s.y;if(!(u<0||u>=yi||p<0||p>=yi)){var l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),c=l.vertexLength;gi(this.layoutVertexArray,u,p,-1,-1),gi(this.layoutVertexArray,u,p,1,-1),gi(this.layoutVertexArray,u,p,1,1),gi(this.layoutVertexArray,u,p,-1,1),this.indexArray.emplaceBack(c,c+1,c+2),this.indexArray.emplaceBack(c,c+3,c+2),l.vertexLength+=4,l.primitiveLength+=2;}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{});},zr("CircleBucket",xi,{omit:["layers"]});var Ti={paint:new rn({"circle-radius":new Wr(L.paint_circle["circle-radius"]),"circle-color":new Wr(L.paint_circle["circle-color"]),"circle-blur":new Wr(L.paint_circle["circle-blur"]),"circle-opacity":new Wr(L.paint_circle["circle-opacity"]),"circle-translate":new $r(L.paint_circle["circle-translate"]),"circle-translate-anchor":new $r(L.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new $r(L.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new $r(L.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Wr(L.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Wr(L.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Wr(L.paint_circle["circle-stroke-opacity"])})},Ei=1e-6,Fi="undefined"!=typeof Float32Array?Float32Array:Array;Math.PI;function Oi(){var t=new Fi(9);return Fi!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Li(){var t=new Fi(3);return Fi!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Di(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function ji(t,e,r){var n=new Fi(3);return n[0]=t,n[1]=e,n[2]=r,n}function Ui(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}function qi(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ri(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],u=r[2];return t[0]=i*u-a*s,t[1]=a*o-n*u,t[2]=n*s-i*o,t}var Ni,Zi=Di,Xi=(Ni=Li(),function(t,e,r,n,i,a){var o=void 0,s=void 0;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,o=r;o<s;o+=e)Ni[0]=t[o],Ni[1]=t[o+1],Ni[2]=t[o+2],i(Ni,Ni,a),t[o]=Ni[0],t[o+1]=Ni[1],t[o+2]=Ni[2];return t});function Gi(){var t=new Fi(4);return Fi!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Hi(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t}function Ji(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}var Ki=function(){var t=Gi();return function(e,r,n,i,a,o){var s=void 0,u=void 0;for(r||(r=4),n||(n=0),u=i?Math.min(i*r+n,e.length):e.length,s=n;s<u;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],a(t,t,o),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}();function Yi(){var t=new Fi(4);return Fi!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function $i(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],u=r[0],p=r[1],l=r[2],c=r[3],h=void 0,f=void 0,y=void 0,d=void 0,m=void 0;return (f=i*u+a*p+o*l+s*c)<0&&(f=-f,u=-u,p=-p,l=-l,c=-c),1-f>Ei?(h=Math.acos(f),y=Math.sin(h),d=Math.sin((1-n)*h)/y,m=Math.sin(n*h)/y):(d=1-n,m=n),t[0]=d*i+m*u,t[1]=d*a+m*p,t[2]=d*o+m*l,t[3]=d*s+m*c,t}var Wi,Qi,ta,ea,ra,na,ia=Hi;Wi=Li(),Qi=ji(1,0,0),ta=ji(0,1,0),ea=Yi(),ra=Yi(),na=Oi();!function(){var t,e=(t=new Fi(2),Fi!=Float32Array&&(t[0]=0,t[1]=0),t);}();var aa=function(t){function e(e){t.call(this,e,Ti);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new xi(t)},e.prototype.queryRadius=function(t){var e=t;return Pi("circle-radius",this,e)+Pi("circle-stroke-width",this,e)+Mi(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var u=Ci(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),p=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),l="map"===this.paint.get("circle-pitch-alignment"),c=l?u:function(t,e,r){return t.map(function(t){return t.map(function(t){return oa(t,e,r)})})}(u,s,a),h=l?p*o:p,f=0,y=n;f<y.length;f+=1)for(var d=0,m=y[f];d<m.length;d+=1){var v=m[d],g=l?v:oa(v,s,a),x=h,b=Ji([],[v.x,v.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?x*=b[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(x*=a.cameraToCenterDistance/b[3]),bi(c,g,x))return !0}return !1},e}(nn);function oa(t,e,r){var n=Ji([],[t.x,t.y,0,1],e);return new a((n[0]/n[3]+1)*r.width*.5,(n[1]/n[3]+1)*r.height*.5)}var sa=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(xi);function ua(t,e,r,n){var i=e.width,a=e.height;if(n){if(n.length!==i*a*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*a*r);return t.width=i,t.height=a,t.data=n,t}function pa(t,e,r){var n=e.width,i=e.height;if(n!==t.width||i!==t.height){var a=ua({},{width:n,height:i},r);la(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,i)},r),t.width=n,t.height=i,t.data=a.data;}}function la(t,e,r,n,i,a){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=t.data,s=e.data,u=0;u<i.height;u++)for(var p=((r.y+u)*t.width+r.x)*a,l=((n.y+u)*e.width+n.x)*a,c=0;c<i.width*a;c++)s[l+c]=o[p+c];return e}zr("HeatmapBucket",sa,{omit:["layers"]});var ca=function(t,e){ua(this,t,1,e);};ca.prototype.resize=function(t){pa(this,t,1);},ca.prototype.clone=function(){return new ca({width:this.width,height:this.height},new Uint8Array(this.data))},ca.copy=function(t,e,r,n,i){la(t,e,r,n,i,1);};var ha=function(t,e){ua(this,t,4,e);};ha.prototype.resize=function(t){pa(this,t,4);},ha.prototype.clone=function(){return new ha({width:this.width,height:this.height},new Uint8Array(this.data))},ha.copy=function(t,e,r,n,i){la(t,e,r,n,i,4);},zr("AlphaImage",ca),zr("RGBAImage",ha);var fa={paint:new rn({"heatmap-radius":new Wr(L.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Wr(L.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new $r(L.paint_heatmap["heatmap-intensity"]),"heatmap-color":new en(L.paint_heatmap["heatmap-color"]),"heatmap-opacity":new $r(L.paint_heatmap["heatmap-opacity"])})};function ya(t,e){for(var r=new Uint8Array(1024),n={},i=0,a=0;i<256;i++,a+=4){n[e]=i/255;var o=t.evaluate(n);r[a+0]=Math.floor(255*o.r/o.a),r[a+1]=Math.floor(255*o.g/o.a),r[a+2]=Math.floor(255*o.b/o.a),r[a+3]=Math.floor(255*o.a);}return new ha({width:256,height:1},r)}var da=function(t){function e(e){t.call(this,e,fa),this._updateColorRamp();}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new sa(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp();},e.prototype._updateColorRamp=function(){var t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=ya(t,"heatmapDensity"),this.colorRampTexture=null;},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null);},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return !1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(nn),ma={paint:new rn({"hillshade-illumination-direction":new $r(L.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new $r(L.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new $r(L.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new $r(L.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new $r(L.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new $r(L.paint_hillshade["hillshade-accent-color"])})},va=function(t){function e(e){t.call(this,e,ma);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(nn),ga=un([{name:"a_pos",components:2,type:"Int16"}],4),xa=ga.members,ba=(ga.size,ga.alignment,wa),_a=wa;function wa(t,e,r){r=r||2;var n,i,a,o,s,u,p,l=e&&e.length,c=l?e[0]*r:t.length,h=Aa(t,0,c,r,!0),f=[];if(!h)return f;if(l&&(h=function(t,e,r,n){var i,a,o,s,u,p=[];for(i=0,a=e.length;i<a;i++)o=e[i]*n,s=i<a-1?e[i+1]*n:t.length,(u=Aa(t,o,s,n,!1))===u.next&&(u.steiner=!0),p.push(Ta(u));for(p.sort(Pa),i=0;i<p.length;i++)Ma(p[i],r),r=ka(r,r.next);return r}(t,e,h,r)),t.length>80*r){n=a=t[0],i=o=t[1];for(var y=r;y<c;y+=r)s=t[y],u=t[y+1],s<n&&(n=s),u<i&&(i=u),s>a&&(a=s),u>o&&(o=u);p=0!==(p=Math.max(a-n,o-i))?1/p:0;}return za(h,f,r,n,i,p),f}function Aa(t,e,r,n,i){var a,o;if(i===Za(t,e,r,n)>0)for(a=e;a<r;a+=n)o=qa(a,t[a],t[a+1],o);else for(a=r-n;a>=e;a-=n)o=qa(a,t[a],t[a+1],o);return o&&La(o,o.next)&&(Ra(o),o=o.next),o}function ka(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!La(n,n.next)&&0!==Oa(n.prev,n,n.next))n=n.next;else{if(Ra(n),(n=e=n.prev)===n.next)break;r=!0;}}while(r||n!==e);return e}function za(t,e,r,n,i,a,o){if(t){!o&&a&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=Ca(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,u,p=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e<p&&(s++,n=n.nextZ);e++);for(u=p;s>0||u>0&&n;)0!==s&&(0===u||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n;}a.nextZ=null,p*=2;}while(o>1)}(i);}(t,n,i,a);for(var s,u,p=t;t.prev!==t.next;)if(s=t.prev,u=t.next,a?Ba(t,n,i,a):Sa(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),Ra(t),t=u.next,p=u.next;else if((t=u)===p){o?1===o?za(t=Va(t,e,r),e,r,n,i,a,2):2===o&&Ia(t,e,r,n,i,a):za(ka(t),e,r,n,i,a,1);break}}}function Sa(t){var e=t.prev,r=t,n=t.next;if(Oa(e,r,n)>=0)return !1;for(var i=t.next.next;i!==t.prev;){if(Ea(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&Oa(i.prev,i,i.next)>=0)return !1;i=i.next;}return !0}function Ba(t,e,r,n){var i=t.prev,a=t,o=t.next;if(Oa(i,a,o)>=0)return !1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,u=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,p=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,c=Ca(s,u,e,r,n),h=Ca(p,l,e,r,n),f=t.prevZ,y=t.nextZ;f&&f.z>=c&&y&&y.z<=h;){if(f!==t.prev&&f!==t.next&&Ea(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Oa(f.prev,f,f.next)>=0)return !1;if(f=f.prevZ,y!==t.prev&&y!==t.next&&Ea(i.x,i.y,a.x,a.y,o.x,o.y,y.x,y.y)&&Oa(y.prev,y,y.next)>=0)return !1;y=y.nextZ;}for(;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&Ea(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Oa(f.prev,f,f.next)>=0)return !1;f=f.prevZ;}for(;y&&y.z<=h;){if(y!==t.prev&&y!==t.next&&Ea(i.x,i.y,a.x,a.y,o.x,o.y,y.x,y.y)&&Oa(y.prev,y,y.next)>=0)return !1;y=y.nextZ;}return !0}function Va(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!La(i,a)&&Da(i,n,n.next,a)&&ja(i,a)&&ja(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),Ra(n),Ra(n.next),n=t=a),n=n.next;}while(n!==t);return n}function Ia(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Fa(o,s)){var u=Ua(o,s);return o=ka(o,o.next),u=ka(u,u.next),za(o,e,r,n,i,a),void za(u,e,r,n,i,a)}s=s.next;}o=o.next;}while(o!==t)}function Pa(t,e){return t.x-e.x}function Ma(t,e){if(e=function(t,e){var r,n=e,i=t.x,a=t.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next;}}n=n.next;}while(n!==e);if(!r)return null;if(i===o)return r.prev;var u,p=r,l=r.x,c=r.y,h=1/0;n=r.next;for(;n!==p;)i>=n.x&&n.x>=l&&i!==n.x&&Ea(a<c?i:o,a,l,c,a<c?o:i,a,n.x,n.y)&&((u=Math.abs(a-n.y)/(i-n.x))<h||u===h&&n.x>r.x)&&ja(n,t)&&(r=n,h=u),n=n.next;return r}(t,e)){var r=Ua(e,t);ka(r,r.next);}}function Ca(t,e,r,n,i){return (t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ta(t){var e=t,r=t;do{e.x<r.x&&(r=e),e=e.next;}while(e!==t);return r}function Ea(t,e,r,n,i,a,o,s){return (i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function Fa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Da(r,r.next,t,e))return !0;r=r.next;}while(r!==t);return !1}(t,e)&&ja(t,e)&&ja(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;}while(r!==t);return n}(t,e)}function Oa(t,e,r){return (e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function La(t,e){return t.x===e.x&&t.y===e.y}function Da(t,e,r,n){return !!(La(t,e)&&La(r,n)||La(t,n)&&La(r,e))||Oa(t,e,r)>0!=Oa(t,e,n)>0&&Oa(r,n,t)>0!=Oa(r,n,e)>0}function ja(t,e){return Oa(t.prev,t,t.next)<0?Oa(t,e,t.next)>=0&&Oa(t,t.prev,e)>=0:Oa(t,e,t.prev)<0||Oa(t,t.next,e)<0}function Ua(t,e){var r=new Na(t.i,t.x,t.y),n=new Na(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function qa(t,e,r,n){var i=new Na(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ra(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ);}function Na(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1;}function Za(t,e,r,n){for(var i=0,a=e,o=r-n;a<r;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}wa.deviation=function(t,e,r,n){var i=e&&e.length,a=i?e[0]*r:t.length,o=Math.abs(Za(t,0,a,r));if(i)for(var s=0,u=e.length;s<u;s++){var p=e[s]*r,l=s<u-1?e[s+1]*r:t.length;o-=Math.abs(Za(t,p,l,r));}var c=0;for(s=0;s<n.length;s+=3){var h=n[s]*r,f=n[s+1]*r,y=n[s+2]*r;c+=Math.abs((t[h]-t[y])*(t[f+1]-t[h+1])-(t[h]-t[f])*(t[y+1]-t[h+1]));}return 0===o&&0===c?0:Math.abs((c-o)/o)},wa.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<e;o++)r.vertices.push(t[i][a][o]);i>0&&(n+=t[i-1].length,r.holes.push(n));}return r},ba.default=_a;var Xa=e(function(t,e){t.exports=function(){function t(t,e,r){var n=t[e];t[e]=t[r],t[r]=n;}function e(t,e){return t<e?-1:t>e?1:0}return function(r,n,i,a,o){!function e(r,n,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,u=n-i+1,p=Math.log(s),l=.5*Math.exp(2*p/3),c=.5*Math.sqrt(p*l*(s-l)/s)*(u-s/2<0?-1:1),h=Math.max(i,Math.floor(n-u*l/s+c)),f=Math.min(a,Math.floor(n+(s-u)*l/s+c));e(r,n,h,f,o);}var y=r[n],d=i,m=a;for(t(r,i,n),o(r[a],y)>0&&t(r,i,a);d<m;){for(t(r,d,m),d++,m--;o(r[d],y)<0;)d++;for(;o(r[m],y)>0;)m--;}0===o(r[i],y)?t(r,i,m):t(r,++m,a),m<=n&&(i=m+1),n<=m&&(a=m-1);}}(r,n,i||0,a||r.length-1,o||e);}}();});function Ga(t,e){var r=t.length;if(r<=1)return [t];for(var n,i,a=[],o=0;o<r;o++){var s=w(t[o]);0!==s&&(t[o].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&a.push(n),n=[t[o]]):n.push(t[o]));}if(n&&a.push(n),e>1)for(var u=0;u<a.length;u++)a[u].length<=e||(Xa(a[u],e,1,a[u].length-1,Ha),a[u]=a[u].slice(0,e));return a}function Ha(t,e){return e.area-t.area}function Ja(t,e,r){for(var n=r.patternDependencies,i=!1,a=0,o=e;a<o.length;a+=1){var s=o[a].paint.get(t+"-pattern");s.isConstant()||(i=!0);var u=s.constantOr(null);u&&(i=!0,n[u.to]=!0,n[u.from]=!0);}return i}function Ka(t,e,r,n,i){for(var a=i.patternDependencies,o=0,s=e;o<s.length;o+=1){var u=s[o],p=u.paint.get(t+"-pattern").value;if("constant"!==p.kind){var l=p.evaluate({zoom:n-1},r,{}),c=p.evaluate({zoom:n},r,{}),h=p.evaluate({zoom:n+1},r,{});a[l]=!0,a[c]=!0,a[h]=!0,r.patterns[u.id]={min:l,mid:c,max:h};}}return r}var Ya=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ln,this.indexArray=new Sn,this.indexArray2=new Bn,this.programConfigurations=new ci(xa,t.layers,t.zoom),this.segments=new Xn,this.segments2=new Xn;};Ya.prototype.populate=function(t,e){this.features=[],this.hasPattern=Ja("fill",this.layers,e);for(var r=0,n=t;r<n.length;r+=1){var i=n[r],a=i.feature,o=i.index,s=i.sourceLayerIndex;if(this.layers[0]._featureFilter(new Rr(this.zoom),a)){var u=vi(a),p={sourceLayerIndex:s,index:o,geometry:u,properties:a.properties,type:a.type,patterns:{}};void 0!==a.id&&(p.id=a.id),this.hasPattern?this.features.push(Ka("fill",this.layers,p,this.zoom,e)):this.addFeature(p,u,o,{}),e.featureIndex.insert(a,u,o,s,this.index);}}},Ya.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},Ya.prototype.addFeatures=function(t,e){for(var r=0,n=this.features;r<n.length;r+=1){var i=n[r],a=i.geometry;this.addFeature(i,a,i.index,e);}},Ya.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ya.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},Ya.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,xa),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0;},Ya.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy());},Ya.prototype.addFeature=function(t,e,r,n){for(var i=0,a=Ga(e,500);i<a.length;i+=1){for(var o=a[i],s=0,u=0,p=o;u<p.length;u+=1){s+=p[u].length;}for(var l=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),c=l.vertexLength,h=[],f=[],y=0,d=o;y<d.length;y+=1){var m=d[y];if(0!==m.length){m!==o[0]&&f.push(h.length/2);var v=this.segments2.prepareSegment(m.length,this.layoutVertexArray,this.indexArray2),g=v.vertexLength;this.layoutVertexArray.emplaceBack(m[0].x,m[0].y),this.indexArray2.emplaceBack(g+m.length-1,g),h.push(m[0].x),h.push(m[0].y);for(var x=1;x<m.length;x++)this.layoutVertexArray.emplaceBack(m[x].x,m[x].y),this.indexArray2.emplaceBack(g+x-1,g+x),h.push(m[x].x),h.push(m[x].y);v.vertexLength+=m.length,v.primitiveLength+=m.length;}}for(var b=ba(h,f),_=0;_<b.length;_+=3)this.indexArray.emplaceBack(c+b[_],c+b[_+1],c+b[_+2]);l.vertexLength+=s,l.primitiveLength+=b.length/3;}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n);},zr("FillBucket",Ya,{omit:["layers","features"]});var $a={paint:new rn({"fill-antialias":new $r(L.paint_fill["fill-antialias"]),"fill-opacity":new Wr(L.paint_fill["fill-opacity"]),"fill-color":new Wr(L.paint_fill["fill-color"]),"fill-outline-color":new Wr(L.paint_fill["fill-outline-color"]),"fill-translate":new $r(L.paint_fill["fill-translate"]),"fill-translate-anchor":new $r(L.paint_fill["fill-translate-anchor"]),"fill-pattern":new Qr(L.paint_fill["fill-pattern"])})},Wa=function(t){function e(e){t.call(this,e,$a);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e);var r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"]);},e.prototype.createBucket=function(t){return new Ya(t)},e.prototype.queryRadius=function(){return Mi(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o){return _i(Ci(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)},e}(nn),Qa=un([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),to=Qa.members,eo=(Qa.size,Qa.alignment,Math.pow(2,13));function ro(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*eo)+o,i*eo*2,a*eo*2,Math.round(s));}var no=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new hn,this.indexArray=new Sn,this.programConfigurations=new ci(to,t.layers,t.zoom),this.segments=new Xn;};function io(t,e){return t.x===e.x&&(t.x<0||t.x>yi)||t.y===e.y&&(t.y<0||t.y>yi)}function ao(t){return t.every(function(t){return t.x<0})||t.every(function(t){return t.x>yi})||t.every(function(t){return t.y<0})||t.every(function(t){return t.y>yi})}no.prototype.populate=function(t,e){this.features=[],this.hasPattern=Ja("fill-extrusion",this.layers,e);for(var r=0,n=t;r<n.length;r+=1){var i=n[r],a=i.feature,o=i.index,s=i.sourceLayerIndex;if(this.layers[0]._featureFilter(new Rr(this.zoom),a)){var u=vi(a),p={sourceLayerIndex:s,index:o,geometry:u,properties:a.properties,type:a.type,patterns:{}};void 0!==a.id&&(p.id=a.id),this.hasPattern?this.features.push(Ka("fill-extrusion",this.layers,p,this.zoom,e)):this.addFeature(p,u,o,{}),e.featureIndex.insert(a,u,o,s,this.index);}}},no.prototype.addFeatures=function(t,e){for(var r=0,n=this.features;r<n.length;r+=1){var i=n[r],a=i.geometry;this.addFeature(i,a,i.index,e);}},no.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},no.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},no.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},no.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,to),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;},no.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());},no.prototype.addFeature=function(t,e,r,n){for(var i=0,a=Ga(e,500);i<a.length;i+=1){for(var o=a[i],s=0,u=0,p=o;u<p.length;u+=1){s+=p[u].length;}for(var l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),c=0,h=o;c<h.length;c+=1){var f=h[c];if(0!==f.length&&!ao(f))for(var y=0,d=0;d<f.length;d++){var m=f[d];if(d>=1){var v=f[d-1];if(!io(m,v)){l.vertexLength+4>Xn.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var g=m.sub(v)._perp()._unit(),x=v.dist(m);y+x>32768&&(y=0),ro(this.layoutVertexArray,m.x,m.y,g.x,g.y,0,0,y),ro(this.layoutVertexArray,m.x,m.y,g.x,g.y,0,1,y),y+=x,ro(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,0,y),ro(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,1,y);var b=l.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),l.vertexLength+=4,l.primitiveLength+=2;}}}}l.vertexLength+s>Xn.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray));for(var _=[],w=[],A=l.vertexLength,k=0,z=o;k<z.length;k+=1){var S=z[k];if(0!==S.length){S!==o[0]&&w.push(_.length/2);for(var B=0;B<S.length;B++){var V=S[B];ro(this.layoutVertexArray,V.x,V.y,0,0,1,1,0),_.push(V.x),_.push(V.y);}}}for(var I=ba(_,w),P=0;P<I.length;P+=3)this.indexArray.emplaceBack(A+I[P],A+I[P+2],A+I[P+1]);l.primitiveLength+=I.length/3,l.vertexLength+=s;}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n);},zr("FillExtrusionBucket",no,{omit:["layers","features"]});var oo={paint:new rn({"fill-extrusion-opacity":new $r(L["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Wr(L["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new $r(L["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new $r(L["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Qr(L["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Wr(L["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Wr(L["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new $r(L["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},so=function(t){function e(e){t.call(this,e,oo);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new no(t)},e.prototype.queryRadius=function(){return Mi(this.paint.get("fill-extrusion-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o){return _i(Ci(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,o),n)},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("fill-extrusion-opacity")&&"none"!==this.visibility},e.prototype.resize=function(){this.viewportFrame&&(this.viewportFrame.destroy(),this.viewportFrame=null);},e}(nn),uo=un([{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),po=uo.members,lo=(uo.size,uo.alignment,co);function co(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(ho,this,e);}function ho(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){var r=t.readVarint()+t.pos;for(;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i;}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos);}function fo(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i<a;o=i++)e=t[i],n+=((r=t[o]).x-e.x)*(e.y+r.y);return n}co.types=["Unknown","Point","LineString","Polygon"],co.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,n=1,i=0,o=0,s=0,u=[];t.pos<r;){if(i<=0){var p=t.readVarint();n=7&p,i=p>>3;}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone());}}return e&&u.push(e),u},co.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,u=1/0,p=-1/0;t.pos<e;){if(n<=0){var l=t.readVarint();r=7&l,n=l>>3;}if(n--,1===r||2===r)i+=t.readSVarint(),a+=t.readSVarint(),i<o&&(o=i),i>s&&(s=i),a<u&&(u=a),a>p&&(p=a);else if(7!==r)throw new Error("unknown command "+r)}return [o,u,s,p]},co.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,u=this.loadGeometry(),p=co.types[this.type];function l(t){for(var e=0;e<t.length;e++){var r=t[e],n=180-360*(r.y+s)/a;t[e]=[360*(r.x+o)/a-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90];}}switch(this.type){case 1:var c=[];for(n=0;n<u.length;n++)c[n]=u[n][0];l(u=c);break;case 2:for(n=0;n<u.length;n++)l(u[n]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return [t];for(var r,n,i=[],a=0;a<e;a++){var o=fo(t[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[t[a]]):r.push(t[a]));}r&&i.push(r);return i}(u),n=0;n<u.length;n++)for(i=0;i<u[n].length;i++)l(u[n][i]);}1===u.length?u=u[0]:p="Multi"+p;var h={type:"Feature",geometry:{type:p,coordinates:u},properties:this.properties};return "id"in this&&(h.id=this.id),h};var yo=mo;function mo(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(vo,this,e),this.length=this._features.length;}function vo(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){var e=null,r=t.readVarint()+t.pos;for(;t.pos<r;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null;}return e}(r));}function go(t,e,r){if(3===t){var n=new yo(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n);}}mo.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new lo(this._pbf,e,this.extent,this._keys,this._values)};var xo={VectorTile:function(t,e){this.layers=t.readFields(go,{},e);},VectorTileFeature:lo,VectorTileLayer:yo},bo=xo.VectorTileFeature.types,_o=63,wo=Math.cos(Math.PI/180*37.5),Ao=.5,ko=Math.pow(2,14)/Ao;function zo(t,e,r,n,i,a,o){t.emplaceBack(e.x,e.y,n?1:0,i?1:-1,Math.round(_o*r.x)+128,Math.round(_o*r.y)+128,1+(0===a?0:a<0?-1:1)|(o*Ao&63)<<2,o*Ao>>6);}var So=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.features=[],this.hasPattern=!1,this.layoutVertexArray=new fn,this.indexArray=new Sn,this.programConfigurations=new ci(po,t.layers,t.zoom),this.segments=new Xn;};function Bo(t,e){return (t/e.tileTotal*(e.end-e.start)+e.start)*(ko-1)}So.prototype.populate=function(t,e){this.features=[],this.hasPattern=Ja("line",this.layers,e);for(var r=0,n=t;r<n.length;r+=1){var i=n[r],a=i.feature,o=i.index,s=i.sourceLayerIndex;if(this.layers[0]._featureFilter(new Rr(this.zoom),a)){var u=vi(a),p={sourceLayerIndex:s,index:o,geometry:u,properties:a.properties,type:a.type,patterns:{}};void 0!==a.id&&(p.id=a.id),this.hasPattern?this.features.push(Ka("line",this.layers,p,this.zoom,e)):this.addFeature(p,u,o,{}),e.featureIndex.insert(a,u,o,s,this.index);}}},So.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r);},So.prototype.addFeatures=function(t,e){for(var r=0,n=this.features;r<n.length;r+=1){var i=n[r],a=i.geometry;this.addFeature(i,a,i.index,e);}},So.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},So.prototype.uploadPending=function(){return !this.uploaded||this.programConfigurations.needsUpload},So.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,po),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0;},So.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy());},So.prototype.addFeature=function(t,e,r,n){for(var i=this.layers[0].layout,a=i.get("line-join").evaluate(t,{}),o=i.get("line-cap"),s=i.get("line-miter-limit"),u=i.get("line-round-limit"),p=0,l=e;p<l.length;p+=1){var c=l[p];this.addLine(c,t,a,o,s,u,r,n);}},So.prototype.addLine=function(t,e,r,n,i,a,o,s){var u=null;e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")&&(u={start:e.properties.mapbox_clip_start,end:e.properties.mapbox_clip_end,tileTotal:void 0});for(var p="Polygon"===bo[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;c<l-1&&t[c].equals(t[c+1]);)c++;if(!(l<(p?3:2))){u&&(u.tileTotal=function(t,e,r){for(var n,i,a=0,o=e;o<r-1;o++)n=t[o],i=t[o+1],a+=n.dist(i);return a}(t,c,l)),"bevel"===r&&(i=1.05);var h=yi/(512*this.overscaling)*15,f=t[c],y=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray);this.distance=0;var d,m,v,g=n,x=p?"butt":n,b=!0,_=void 0,w=void 0,A=void 0,k=void 0;this.e1=this.e2=this.e3=-1,p&&(d=t[l-2],k=f.sub(d)._unit()._perp());for(var z=c;z<l;z++)if(!(w=p&&z===l-1?t[c+1]:t[z+1])||!t[z].equals(w)){k&&(A=k),d&&(_=d),d=t[z],k=w?w.sub(d)._unit()._perp():A;var S=(A=A||k).add(k);0===S.x&&0===S.y||S._unit();var B=S.x*k.x+S.y*k.y,V=0!==B?1/B:1/0,I=B<wo&&_&&w;if(I&&z>c){var P=d.dist(_);if(P>2*h){var M=d.sub(d.sub(_)._mult(h/P)._round());this.distance+=M.dist(_),this.addCurrentVertex(M,this.distance,A.mult(1),0,0,!1,y,u),_=M;}}var C=_&&w,T=C?r:w?g:x;if(C&&"round"===T&&(V<a?T="miter":V<=2&&(T="fakeround")),"miter"===T&&V>i&&(T="bevel"),"bevel"===T&&(V>2&&(T="flipbevel"),V<i&&(T="miter")),_&&(this.distance+=d.dist(_)),"miter"===T)S._mult(V),this.addCurrentVertex(d,this.distance,S,0,0,!1,y,u);else if("flipbevel"===T){if(V>100)S=k.clone().mult(-1);else{var E=A.x*k.y-A.y*k.x>0?-1:1,F=V*A.add(k).mag()/A.sub(k).mag();S._perp()._mult(F*E);}this.addCurrentVertex(d,this.distance,S,0,0,!1,y,u),this.addCurrentVertex(d,this.distance,S.mult(-1),0,0,!1,y,u);}else if("bevel"===T||"fakeround"===T){var O=A.x*k.y-A.y*k.x>0,L=-Math.sqrt(V*V-1);if(O?(v=0,m=L):(m=0,v=L),b||this.addCurrentVertex(d,this.distance,A,m,v,!1,y,u),"fakeround"===T){for(var D=Math.floor(8*(.5-(B-.5))),j=void 0,U=0;U<D;U++)j=k.mult((U+1)/(D+1))._add(A)._unit(),this.addPieSliceVertex(d,this.distance,j,O,y,u);this.addPieSliceVertex(d,this.distance,S,O,y,u);for(var q=D-1;q>=0;q--)j=A.mult((q+1)/(D+1))._add(k)._unit(),this.addPieSliceVertex(d,this.distance,j,O,y,u);}w&&this.addCurrentVertex(d,this.distance,k,-m,-v,!1,y,u);}else"butt"===T?(b||this.addCurrentVertex(d,this.distance,A,0,0,!1,y,u),w&&this.addCurrentVertex(d,this.distance,k,0,0,!1,y,u)):"square"===T?(b||(this.addCurrentVertex(d,this.distance,A,1,1,!1,y,u),this.e1=this.e2=-1),w&&this.addCurrentVertex(d,this.distance,k,-1,-1,!1,y,u)):"round"===T&&(b||(this.addCurrentVertex(d,this.distance,A,0,0,!1,y,u),this.addCurrentVertex(d,this.distance,A,1,1,!0,y,u),this.e1=this.e2=-1),w&&(this.addCurrentVertex(d,this.distance,k,-1,-1,!0,y,u),this.addCurrentVertex(d,this.distance,k,0,0,!1,y,u)));if(I&&z<l-1){var R=d.dist(w);if(R>2*h){var N=d.add(w.sub(d)._mult(h/R)._round());this.distance+=N.dist(d),this.addCurrentVertex(N,this.distance,k.mult(1),0,0,!1,y,u),d=N;}}b=!1;}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,s);}},So.prototype.addCurrentVertex=function(t,e,r,n,i,a,o,s){var u,p=this.layoutVertexArray,l=this.indexArray;s&&(e=Bo(e,s)),u=r.clone(),n&&u._sub(r.perp()._mult(n)),zo(p,t,u,a,!1,n,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(l.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),this.e1=this.e2,this.e2=this.e3,u=r.mult(-1),i&&u._sub(r.perp()._mult(i)),zo(p,t,u,a,!0,-i,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(l.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>ko/2&&!s&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a,o));},So.prototype.addPieSliceVertex=function(t,e,r,n,i,a){r=r.mult(n?-1:1);var o=this.layoutVertexArray,s=this.indexArray;a&&(e=Bo(e,a)),zo(o,t,r,!1,n,0,e),this.e3=i.vertexLength++,this.e1>=0&&this.e2>=0&&(s.emplaceBack(this.e1,this.e2,this.e3),i.primitiveLength++),n?this.e2=this.e3:this.e1=this.e3;},zr("LineBucket",So,{omit:["layers","features"]});var Vo=new rn({"line-cap":new $r(L.layout_line["line-cap"]),"line-join":new Wr(L.layout_line["line-join"]),"line-miter-limit":new $r(L.layout_line["line-miter-limit"]),"line-round-limit":new $r(L.layout_line["line-round-limit"])}),Io={paint:new rn({"line-opacity":new Wr(L.paint_line["line-opacity"]),"line-color":new Wr(L.paint_line["line-color"]),"line-translate":new $r(L.paint_line["line-translate"]),"line-translate-anchor":new $r(L.paint_line["line-translate-anchor"]),"line-width":new Wr(L.paint_line["line-width"]),"line-gap-width":new Wr(L.paint_line["line-gap-width"]),"line-offset":new Wr(L.paint_line["line-offset"]),"line-blur":new Wr(L.paint_line["line-blur"]),"line-dasharray":new tn(L.paint_line["line-dasharray"]),"line-pattern":new Qr(L.paint_line["line-pattern"]),"line-gradient":new en(L.paint_line["line-gradient"])}),layout:Vo},Po=new(function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Rr(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),t.prototype.possiblyEvaluate.call(this,e,r)},e.prototype.evaluate=function(e,r,n,i){return r=c({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(Wr))(Io.paint.properties["line-width"].specification);Po.useIntegerZoom=!0;var Mo=function(t){function e(e){t.call(this,e,Io);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient();},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=ya(t,"lineProgress"),this.gradientTexture=null;},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=Po.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e);},e.prototype.createBucket=function(t){return new So(t)},e.prototype.queryRadius=function(t){var e=t,r=Co(Pi("line-width",this,e),Pi("line-gap-width",this,e)),n=Pi("line-offset",this,e);return r/2+Math.abs(n)+Mi(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,o,s){var u=Ci(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),p=s/2*Co(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),l=this.paint.get("line-offset").evaluate(e,r);return l&&(n=function(t,e){for(var r=[],n=new a(0,0),i=0;i<t.length;i++){for(var o=t[i],s=[],u=0;u<o.length;u++){var p=o[u-1],l=o[u],c=o[u+1],h=0===u?n:l.sub(p)._unit()._perp(),f=u===o.length-1?n:c.sub(l)._unit()._perp(),y=h._add(f)._unit(),d=y.x*f.x+y.y*f.y;y._mult(1/d),s.push(y._mult(e)._add(l));}r.push(s);}return r}(n,l*s)),wi(u,n,p)},e}(nn);function Co(t,e){return e>0?e+2*t:t}var To=un([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),Eo=un([{name:"a_projected_pos",components:3,type:"Float32"}],4),Fo=(un([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),un([{name:"a_placed",components:2,type:"Uint8"}],4)),Oo=(un([{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"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),un([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Lo=un([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);un([{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:"hidden"}]),un([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"horizontalPlacedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint32",name:"crossTileID"}]),un([{type:"Float32",name:"offsetX"}]),un([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function Do(t,e,r){return t.sections.forEach(function(t){t.text=function(t,e,r){var n=e.layout.get("text-transform").evaluate(r,{});return "uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),qr.applyArabicShaping&&(t=qr.applyArabicShaping(t)),t}(t.text,e,r);}),t}var jo={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Uo=function(t){function e(e,r,n,i){t.call(this,e,r),this.angle=n,void 0!==i&&(this.segment=i);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(a);zr("Anchor",Uo);var qo=256;function Ro(t,e){var r=e.expression;if("constant"===r.kind)return {functionType:"constant",layoutSize:r.evaluate(new Rr(t+1))};if("source"===r.kind)return {functionType:"source"};for(var n=r.zoomStops,i=0;i<n.length&&n[i]<=t;)i++;for(var a=i=Math.max(0,i-1);a<n.length&&n[a]<t+1;)a++;a=Math.min(n.length-1,a);var o={min:n[i],max:n[a]};return "composite"===r.kind?{functionType:"composite",zoomRange:o,propertyValue:e.value}:{functionType:"camera",layoutSize:r.evaluate(new Rr(t+1)),zoomRange:o,sizeRange:{min:r.evaluate(new Rr(o.min)),max:r.evaluate(new Rr(o.max))},propertyValue:e.value}}var No=xo.VectorTileFeature.types,Zo=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Xo(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,Math.round(32*n),Math.round(32*i),a,o,s?s[0]:0,s?s[1]:0);}function Go(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r);}var Ho=function(t){this.layoutVertexArray=new dn,this.indexArray=new Sn,this.programConfigurations=t,this.segments=new Xn,this.dynamicLayoutVertexArray=new mn,this.opacityVertexArray=new vn,this.placedSymbolArray=new En;};Ho.prototype.upload=function(t,e,r,n){r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,To.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Eo.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Zo,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(t);},Ho.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy());},zr("SymbolBuffers",Ho);var Jo=function(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new Xn,this.collisionVertexArray=new bn;};Jo.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Fo.members,!0);},Jo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy());},zr("CollisionBuffers",Jo);var Ko=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1;var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Ro(this.zoom,e["text-size"]),this.iconSizeData=Ro(this.zoom,e["icon-size"]);var r=this.layers[0].layout,n="viewport-y"===r.get("symbol-z-order");this.sortFeaturesByY=n&&(r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement")),this.sourceID=t.sourceID;};Ko.prototype.createArrays=function(){this.text=new Ho(new ci(To.members,this.layers,this.zoom,function(t){return /^text/.test(t)})),this.icon=new Ho(new ci(To.members,this.layers,this.zoom,function(t){return /^icon/.test(t)})),this.collisionBox=new Jo(xn,Oo.members,Bn),this.collisionCircle=new Jo(xn,Lo.members,Sn),this.glyphOffsetArray=new Dn,this.lineVertexArray=new Un,this.symbolInstances=new On;},Ko.prototype.calculateGlyphDependencies=function(t,e,r,n){for(var i=0;i<t.length;i++)if(e[t.charCodeAt(i)]=!0,r&&n){var a=jo[t.charAt(i)];a&&(e[a.charCodeAt(0)]=!0);}},Ko.prototype.populate=function(t,e){var r=this.layers[0],n=r.layout,i=n.get("text-font"),a=n.get("text-field"),o=n.get("icon-image"),s=("constant"!==a.value.kind||a.value.value.toString().length>0)&&("constant"!==i.value.kind||i.value.value.length>0),u="constant"!==o.value.kind||o.value.value&&o.value.value.length>0;if(this.features=[],s||u){for(var p=e.iconDependencies,l=e.glyphDependencies,c=new Rr(this.zoom),h=0,f=t;h<f.length;h+=1){var y=f[h],d=y.feature,m=y.index,v=y.sourceLayerIndex;if(r._featureFilter(c,d)){var g=void 0;if(s){var x=r.getValueAndResolveTokens("text-field",d);g=Do(x instanceof ut?x:ut.fromString(x),r,d);}var b=void 0;if(u&&(b=r.getValueAndResolveTokens("icon-image",d)),g||b){var _={text:g,icon:b,index:m,sourceLayerIndex:v,geometry:vi(d),properties:d.properties,type:No[d.type]};if(void 0!==d.id&&(_.id=d.id),this.features.push(_),b&&(p[b]=!0),g)for(var w=i.evaluate(d,{}).join(","),A="map"===n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement"),k=0,z=g.sections;k<z.length;k+=1){var S=z[k],B=Mr(g.toString()),V=S.fontStack||w,I=l[V]=l[V]||{};this.calculateGlyphDependencies(S.text,I,A,B);}}}}"line"===n.get("symbol-placement")&&(this.features=function(t){var e={},r={},n=[],i=0;function a(e){n.push(t[e]),i++;}function o(t,e,i){var a=r[t];return delete r[t],r[e]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(t,r,i){var a=e[r];return delete e[r],e[t]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function u(t,e,r){var n=r?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var p=0;p<t.length;p++){var l=t[p],c=l.geometry,h=l.text?l.text.toString():null;if(h){var f=u(h,c),y=u(h,c,!0);if(f in r&&y in e&&r[f]!==e[y]){var d=s(f,y,c),m=o(f,y,n[d].geometry);delete e[f],delete r[y],r[u(h,n[m].geometry,!0)]=m,n[d].geometry=null;}else f in r?o(f,y,c):y in e?s(f,y,c):(a(p),e[f]=i-1,r[y]=i-1);}else a(p);}return n.filter(function(t){return t.geometry})}(this.features));}},Ko.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r));},Ko.prototype.isEmpty=function(){return 0===this.symbolInstances.length},Ko.prototype.uploadPending=function(){return !this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Ko.prototype.upload=function(t){this.uploaded||(this.collisionBox.upload(t),this.collisionCircle.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0;},Ko.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy();},Ko.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),a={},o=t.segment+1;o<e.length;o++)a[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:n},o<e.length-1&&(n+=e[o+1].dist(e[o]));for(var s=t.segment||0;s>=0;s--)a[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var p=a[u];this.lineVertexArray.emplaceBack(p.x,p.y,p.tileUnitDistanceFromAnchor);}}return {lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},Ko.prototype.addSymbols=function(t,e,r,n,i,a,o,s,u,p){for(var l=t.indexArray,c=t.layoutVertexArray,h=t.dynamicLayoutVertexArray,f=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray),y=this.glyphOffsetArray.length,d=f.vertexLength,m=0,v=e;m<v.length;m+=1){var g=v[m],x=g.tl,b=g.tr,_=g.bl,w=g.br,A=g.tex,k=f.vertexLength,z=g.glyphOffset[1];Xo(c,s.x,s.y,x.x,z+x.y,A.x,A.y,r),Xo(c,s.x,s.y,b.x,z+b.y,A.x+A.w,A.y,r),Xo(c,s.x,s.y,_.x,z+_.y,A.x,A.y+A.h,r),Xo(c,s.x,s.y,w.x,z+w.y,A.x+A.w,A.y+A.h,r),Go(h,s,0),l.emplaceBack(k,k+1,k+2),l.emplaceBack(k+1,k+2,k+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(g.glyphOffset[0]);}t.placedSymbolArray.emplaceBack(s.x,s.y,y,this.glyphOffsetArray.length-y,d,u,p,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],o,!1),t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,a,a.index,{});},Ko.prototype._addCollisionDebugVertex=function(t,e,r,n,i,a){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))},Ko.prototype.addCollisionDebugVertices=function(t,e,r,n,i,o,s,u){var p=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),l=p.vertexLength,c=i.layoutVertexArray,h=i.collisionVertexArray,f=s.anchorX,y=s.anchorY;if(this._addCollisionDebugVertex(c,h,o,f,y,new a(t,e)),this._addCollisionDebugVertex(c,h,o,f,y,new a(r,e)),this._addCollisionDebugVertex(c,h,o,f,y,new a(r,n)),this._addCollisionDebugVertex(c,h,o,f,y,new a(t,n)),p.vertexLength+=4,u){var d=i.indexArray;d.emplaceBack(l,l+1,l+2),d.emplaceBack(l,l+2,l+3),p.primitiveLength+=2;}else{var m=i.indexArray;m.emplaceBack(l,l+1),m.emplaceBack(l+1,l+2),m.emplaceBack(l+2,l+3),m.emplaceBack(l+3,l),p.primitiveLength+=4;}},Ko.prototype.addDebugCollisionBoxes=function(t,e,r){for(var n=t;n<e;n++){var i=this.collisionBoxArray.get(n),a=i.x1,o=i.y1,s=i.x2,u=i.y2,p=i.radius>0;this.addCollisionDebugVertices(a,o,s,u,p?this.collisionCircle:this.collisionBox,i.anchorPoint,r,p);}},Ko.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e);}},Ko.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,n,i){for(var a={},o=e;o<r;o++){var s=t.get(o);if(0===s.radius){a.textBox={x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,anchorPointX:s.anchorPointX,anchorPointY:s.anchorPointY},a.textFeatureIndex=s.featureIndex;break}a.textCircles||(a.textCircles=[],a.textFeatureIndex=s.featureIndex);a.textCircles.push(s.anchorPointX,s.anchorPointY,s.radius,s.signedDistanceFromAnchor,1);}for(var u=n;u<i;u++){var p=t.get(u);if(0===p.radius){a.iconBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},a.iconFeatureIndex=p.featureIndex;break}}return a},Ko.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex));}},Ko.prototype.hasTextData=function(){return this.text.segments.get().length>0},Ko.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Ko.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},Ko.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},Ko.prototype.addIndicesForPlacedTextSymbol=function(t){for(var e=this.text.placedSymbolArray.get(t),r=e.vertexStartIndex+4*e.numGlyphs,n=e.vertexStartIndex;n<r;n+=4)this.text.indexArray.emplaceBack(n,n+1,n+2),this.text.indexArray.emplaceBack(n+1,n+2,n+3);},Ko.prototype.sortFeatures=function(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&(this.sortedAngle=t,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var e=[],r=0;r<this.symbolInstances.length;r++)e.push(r);for(var n=Math.sin(t),i=Math.cos(t),a=[],o=[],s=0;s<this.symbolInstances.length;s++){var u=this.symbolInstances.get(s);a.push(0|Math.round(n*u.anchorX+i*u.anchorY)),o.push(u.featureIndex);}e.sort(function(t,e){return a[t]-a[e]||o[e]-o[t]}),this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var p=0,l=e;p<l.length;p+=1){var c=l[p],h=this.symbolInstances.get(c);this.featureSortOrder.push(h.featureIndex),h.horizontalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedTextSymbol(h.horizontalPlacedTextSymbolIndex),h.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedTextSymbol(h.verticalPlacedTextSymbolIndex);var f=this.icon.placedSymbolArray.get(c);if(f.numGlyphs){var y=f.vertexStartIndex;this.icon.indexArray.emplaceBack(y,y+1,y+2),this.icon.indexArray.emplaceBack(y+1,y+2,y+3);}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray);}},zr("SymbolBucket",Ko,{omit:["layers","collisionBoxArray","features","compareText"]}),Ko.MAX_GLYPHS=65535,Ko.addDynamicAttributes=Go;var Yo=new rn({"symbol-placement":new $r(L.layout_symbol["symbol-placement"]),"symbol-spacing":new $r(L.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new $r(L.layout_symbol["symbol-avoid-edges"]),"symbol-z-order":new $r(L.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new $r(L.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new $r(L.layout_symbol["icon-ignore-placement"]),"icon-optional":new $r(L.layout_symbol["icon-optional"]),"icon-rotation-alignment":new $r(L.layout_symbol["icon-rotation-alignment"]),"icon-size":new Wr(L.layout_symbol["icon-size"]),"icon-text-fit":new $r(L.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new $r(L.layout_symbol["icon-text-fit-padding"]),"icon-image":new Wr(L.layout_symbol["icon-image"]),"icon-rotate":new Wr(L.layout_symbol["icon-rotate"]),"icon-padding":new $r(L.layout_symbol["icon-padding"]),"icon-keep-upright":new $r(L.layout_symbol["icon-keep-upright"]),"icon-offset":new Wr(L.layout_symbol["icon-offset"]),"icon-anchor":new Wr(L.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new $r(L.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new $r(L.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new $r(L.layout_symbol["text-rotation-alignment"]),"text-field":new Wr(L.layout_symbol["text-field"]),"text-font":new Wr(L.layout_symbol["text-font"]),"text-size":new Wr(L.layout_symbol["text-size"]),"text-max-width":new Wr(L.layout_symbol["text-max-width"]),"text-line-height":new $r(L.layout_symbol["text-line-height"]),"text-letter-spacing":new Wr(L.layout_symbol["text-letter-spacing"]),"text-justify":new Wr(L.layout_symbol["text-justify"]),"text-anchor":new Wr(L.layout_symbol["text-anchor"]),"text-max-angle":new $r(L.layout_symbol["text-max-angle"]),"text-rotate":new Wr(L.layout_symbol["text-rotate"]),"text-padding":new $r(L.layout_symbol["text-padding"]),"text-keep-upright":new $r(L.layout_symbol["text-keep-upright"]),"text-transform":new Wr(L.layout_symbol["text-transform"]),"text-offset":new Wr(L.layout_symbol["text-offset"]),"text-allow-overlap":new $r(L.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new $r(L.layout_symbol["text-ignore-placement"]),"text-optional":new $r(L.layout_symbol["text-optional"])}),$o={paint:new rn({"icon-opacity":new Wr(L.paint_symbol["icon-opacity"]),"icon-color":new Wr(L.paint_symbol["icon-color"]),"icon-halo-color":new Wr(L.paint_symbol["icon-halo-color"]),"icon-halo-width":new Wr(L.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Wr(L.paint_symbol["icon-halo-blur"]),"icon-translate":new $r(L.paint_symbol["icon-translate"]),"icon-translate-anchor":new $r(L.paint_symbol["icon-translate-anchor"]),"text-opacity":new Wr(L.paint_symbol["text-opacity"]),"text-color":new Wr(L.paint_symbol["text-color"]),"text-halo-color":new Wr(L.paint_symbol["text-halo-color"]),"text-halo-width":new Wr(L.paint_symbol["text-halo-width"]),"text-halo-blur":new Wr(L.paint_symbol["text-halo-blur"]),"text-translate":new $r(L.paint_symbol["text-translate"]),"text-translate-anchor":new $r(L.paint_symbol["text-translate-anchor"])}),layout:Yo},Wo=function(t){function e(e){t.call(this,e,$o);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));},e.prototype.getValueAndResolveTokens=function(t,e){var r,n=this.layout.get(t).evaluate(e,{}),i=this._unevaluatedLayout._values[t];return i.isDataDriven()||Te(i.value)?n:(r=e.properties,n.replace(/{([^{}]+)}/g,function(t,e){return e in r?String(r[e]):""}))},e.prototype.createBucket=function(t){return new Ko(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return !1},e}(nn),Qo={paint:new rn({"background-color":new $r(L.paint_background["background-color"]),"background-pattern":new tn(L.paint_background["background-pattern"]),"background-opacity":new $r(L.paint_background["background-opacity"])})},ts=function(t){function e(e){t.call(this,e,Qo);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(nn),es={paint:new rn({"raster-opacity":new $r(L.paint_raster["raster-opacity"]),"raster-hue-rotate":new $r(L.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new $r(L.paint_raster["raster-brightness-min"]),"raster-brightness-max":new $r(L.paint_raster["raster-brightness-max"]),"raster-saturation":new $r(L.paint_raster["raster-saturation"]),"raster-contrast":new $r(L.paint_raster["raster-contrast"]),"raster-resampling":new $r(L.paint_raster["raster-resampling"]),"raster-fade-duration":new $r(L.paint_raster["raster-fade-duration"])})},rs=function(t){function e(e){t.call(this,e,es);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(nn);var ns=function(t){function e(e){t.call(this,e,{}),this.implementation=e;}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender||"3d"===this.implementation.renderingMode},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.resize=function(){this.viewportFrame&&(this.viewportFrame.destroy(),this.viewportFrame=null);},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl);},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t);},e}(nn),is={circle:aa,heatmap:da,hillshade:va,fill:Wa,"fill-extrusion":so,line:Mo,symbol:Wo,background:ts,raster:rs};function as(t){for(var e=0,r=0,n=0,i=t;n<i.length;n+=1){var a=i[n];e+=a.w*a.h,r=Math.max(r,a.w);}t.sort(function(t,e){return e.h-t.h});for(var o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,u=0,p=0,l=t;p<l.length;p+=1)for(var c=l[p],h=o.length-1;h>=0;h--){var f=o[h];if(!(c.w>f.w||c.h>f.h)){if(c.x=f.x,c.y=f.y,u=Math.max(u,c.y+c.h),s=Math.max(s,c.x+c.w),c.w===f.w&&c.h===f.h){var y=o.pop();h<o.length&&(o[h]=y);}else c.h===f.h?(f.x+=c.w,f.w-=c.w):c.w===f.w?(f.y+=c.h,f.h-=c.h):(o.push({x:f.x+c.w,y:f.y,w:f.w-c.w,h:c.h}),f.y+=c.h,f.h-=c.h);break}}return {w:s,h:u,fill:e/(s*u)||0}}var os=function(t,e){var r=e.pixelRatio;this.paddedRect=t,this.pixelRatio=r;},ss={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};ss.tl.get=function(){return [this.paddedRect.x+1,this.paddedRect.y+1]},ss.br.get=function(){return [this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},ss.tlbr.get=function(){return this.tl.concat(this.br)},ss.displaySize.get=function(){return [(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(os.prototype,ss);var us=function(t,e){var r={},n={},i=[];for(var a in t){var o=t[a],s={x:0,y:0,w:o.data.width+2,h:o.data.height+2};i.push(s),r[a]=new os(s,o);}for(var u in e){var p=e[u],l={x:0,y:0,w:p.data.width+2,h:p.data.height+2};i.push(l),n[u]=new os(l,p);}var c=as(i),h=c.w,f=c.h,y=new ha({width:h||1,height:f||1});for(var d in t){var m=t[d],v=r[d].paddedRect;ha.copy(m.data,y,{x:0,y:0},{x:v.x+1,y:v.y+1},m.data);}for(var g in e){var x=e[g],b=n[g].paddedRect,_=b.x+1,w=b.y+1,A=x.data.width,k=x.data.height;ha.copy(x.data,y,{x:0,y:0},{x:_,y:w},x.data),ha.copy(x.data,y,{x:0,y:k-1},{x:_,y:w-1},{width:A,height:1}),ha.copy(x.data,y,{x:0,y:0},{x:_,y:w+k},{width:A,height:1}),ha.copy(x.data,y,{x:A-1,y:0},{x:_-1,y:w},{width:1,height:k}),ha.copy(x.data,y,{x:0,y:0},{x:_+A,y:w},{width:1,height:k});}this.image=y,this.iconPositions=r,this.patternPositions=n;};zr("ImagePosition",os),zr("ImageAtlas",us);var ps=self.HTMLImageElement,ls=self.HTMLCanvasElement,cs=self.HTMLVideoElement,hs=self.ImageData,fs=function(t,e,r,n){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,n);};fs.prototype.update=function(t,e){var r=t.width,n=t.height,i=!this.size||this.size[0]!==r||this.size[1]!==n,a=this.context,o=a.gl;this.useMipmap=Boolean(e&&e.useMipmap),o.bindTexture(o.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===o.RGBA&&(!e||!1!==e.premultiply)),i?(this.size=[r,n],t instanceof ps||t instanceof ls||t instanceof cs||t instanceof hs?o.texImage2D(o.TEXTURE_2D,0,this.format,this.format,o.UNSIGNED_BYTE,t):o.texImage2D(o.TEXTURE_2D,0,this.format,r,n,0,this.format,o.UNSIGNED_BYTE,t.data)):t instanceof ps||t instanceof ls||t instanceof cs||t instanceof hs?o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,t):o.texSubImage2D(o.TEXTURE_2D,0,0,0,r,n,o.RGBA,o.UNSIGNED_BYTE,t.data),this.useMipmap&&this.isSizePowerOfTwo()&&o.generateMipmap(o.TEXTURE_2D);},fs.prototype.bind=function(t,e,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e);},fs.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},fs.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null;};var ys=function(t,e,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,p=u>>1,l=-7,c=r?i-1:0,h=r?-1:1,f=t[e+c];for(c+=h,a=f&(1<<-l)-1,f>>=-l,l+=s;l>0;a=256*a+t[e+c],c+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+t[e+c],c+=h,l-=8);if(0===a)a=1-p;else{if(a===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=p;}return (f?-1:1)*o*Math.pow(2,a-n)},ds=function(t,e,r,n,i,a){var o,s,u,p=8*a-i-1,l=(1<<p)-1,c=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:a-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),(e+=o+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(o++,u/=2),o+c>=l?(s=0,o=l):o+c>=1?(s=(e*u-1)*Math.pow(2,i),o+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),o=0));i>=8;t[r+f]=255&s,f+=y,s/=256,i-=8);for(o=o<<i|s,p+=i;p>0;t[r+f]=255&o,f+=y,o/=256,p-=8);t[r+f-y]|=128*d;},ms=vs;function vs(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length;}vs.Varint=0,vs.Fixed64=1,vs.Bytes=2,vs.Fixed32=5;function gs(t){return t.type===vs.Bytes?t.readVarint()+t.pos:t.pos+1}function xs(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function bs(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i];}function _s(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r]);}function ws(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r]);}function As(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r]);}function ks(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r]);}function zs(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r]);}function Ss(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r]);}function Bs(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r]);}function Vs(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r]);}function Is(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r]);}function Ps(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Ms(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24;}function Cs(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}vs.prototype={destroy:function(){this.buf=null;},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,t(i,e,this),this.pos===a&&this.skip(n);}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Ps(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Cs(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Ps(this.buf,this.pos)+4294967296*Ps(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Ps(this.buf,this.pos)+4294967296*Cs(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=ys(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ys(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return xs(t,n,e);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return xs(t,n,e);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return xs(t,n,e);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return xs(t,n,e);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return xs(t,n,e);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return xs(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=function(t,e,r){var n="",i=e;for(;i<r;){var a,o,s,u=t[i],p=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l>r)break;1===l?u<128&&(p=u):2===l?128==(192&(a=t[i+1]))&&(p=(31&u)<<6|63&a)<=127&&(p=null):3===l?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((p=(15&u)<<12|(63&a)<<6|63&o)<=2047||p>=55296&&p<=57343)&&(p=null)):4===l&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((p=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||p>=1114112)&&(p=null)),null===p?(p=65533,l=1):p>65535&&(p-=65536,n+=String.fromCharCode(p>>>10&1023|55296),p=56320|1023&p),n+=String.fromCharCode(p),i+=l;}return n}(this.buf,this.pos,t);return this.pos=t,e},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){var r=gs(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){var e=gs(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){var e=gs(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){var e=gs(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){var e=gs(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){var e=gs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){var e=gs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){var e=gs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){var e=gs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===vs.Varint)for(;this.buf[this.pos++]>127;);else if(e===vs.Bytes)this.pos=this.readVarint()+this.pos;else if(e===vs.Fixed32)this.pos+=4;else{if(e!==vs.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8;}},writeTag:function(t,e){this.writeVarint(t<<3|e);},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e;}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Ms(this.buf,t,this.pos),this.pos+=4;},writeSFixed32:function(t){this.realloc(4),Ms(this.buf,t,this.pos),this.pos+=4;},writeFixed64:function(t){this.realloc(8),Ms(this.buf,-1&t,this.pos),Ms(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8;},writeSFixed64:function(t){this.realloc(8),Ms(this.buf,-1&t,this.pos),Ms(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8;},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t;}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t;}(n,e);}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))));},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t);},writeBoolean:function(t){this.writeVarint(Boolean(t));},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,a=0;a<e.length;a++){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null;}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128);}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&bs(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r;},writeFloat:function(t){this.realloc(4),ds(this.buf,t,this.pos,!0,23,4),this.pos+=4;},writeDouble:function(t){this.realloc(8),ds(this.buf,t,this.pos,!0,52,8),this.pos+=8;},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r];},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&bs(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n;},writeMessage:function(t,e,r){this.writeTag(t,vs.Bytes),this.writeRawMessage(e,r);},writePackedVarint:function(t,e){this.writeMessage(t,_s,e);},writePackedSVarint:function(t,e){this.writeMessage(t,ws,e);},writePackedBoolean:function(t,e){this.writeMessage(t,zs,e);},writePackedFloat:function(t,e){this.writeMessage(t,As,e);},writePackedDouble:function(t,e){this.writeMessage(t,ks,e);},writePackedFixed32:function(t,e){this.writeMessage(t,Ss,e);},writePackedSFixed32:function(t,e){this.writeMessage(t,Bs,e);},writePackedFixed64:function(t,e){this.writeMessage(t,Vs,e);},writePackedSFixed64:function(t,e){this.writeMessage(t,Is,e);},writeBytesField:function(t,e){this.writeTag(t,vs.Bytes),this.writeBytes(e);},writeFixed32Field:function(t,e){this.writeTag(t,vs.Fixed32),this.writeFixed32(e);},writeSFixed32Field:function(t,e){this.writeTag(t,vs.Fixed32),this.writeSFixed32(e);},writeFixed64Field:function(t,e){this.writeTag(t,vs.Fixed64),this.writeFixed64(e);},writeSFixed64Field:function(t,e){this.writeTag(t,vs.Fixed64),this.writeSFixed64(e);},writeVarintField:function(t,e){this.writeTag(t,vs.Varint),this.writeVarint(e);},writeSVarintField:function(t,e){this.writeTag(t,vs.Varint),this.writeSVarint(e);},writeStringField:function(t,e){this.writeTag(t,vs.Bytes),this.writeString(e);},writeFloatField:function(t,e){this.writeTag(t,vs.Fixed32),this.writeFloat(e);},writeDoubleField:function(t,e){this.writeTag(t,vs.Fixed64),this.writeDouble(e);},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e));}};var Ts=3;function Es(t,e,r){1===t&&r.readMessage(Fs,e);}function Fs(t,e,r){if(3===t){var n=r.readMessage(Os,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,u=n.left,p=n.top,l=n.advance;e.push({id:i,bitmap:new ca({width:o+2*Ts,height:s+2*Ts},a),metrics:{width:o,height:s,left:u,top:p,advance:l}});}}function Os(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint());}var Ls=Ts,Ds=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,y(["receive"],this),this.target.addEventListener("message",this.receive,!1);};function js(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return [t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}Ds.prototype.send=function(t,e,r,n){var i=r?this.mapId+":"+this.callbackID++:null;r&&(this.callbacks[i]=r);var a=[];this.target.postMessage({targetMapId:n,sourceMapId:this.mapId,type:t,id:String(i),data:Br(e,a)},a);},Ds.prototype.receive=function(t){var e,r=this,n=t.data,i=n.id;if(!n.targetMapId||this.mapId===n.targetMapId){var a=function(t,e){var n=[];r.target.postMessage({sourceMapId:r.mapId,type:"<response>",id:String(i),error:t?Br(t):null,data:Br(e,n)},n);};if("<response>"===n.type)e=this.callbacks[n.id],delete this.callbacks[n.id],e&&n.error?e(Vr(n.error)):e&&e(null,Vr(n.data));else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.sourceMapId,Vr(n.data),a);else if(void 0!==n.id&&this.parent.getWorkerSource){var o=n.type.split("."),s=Vr(n.data);this.parent.getWorkerSource(n.sourceMapId,o[0],s.source)[o[1]](s,a);}else this.parent[n.type](Vr(n.data));}},Ds.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1);};var Us=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Ns(0,t,e,r);};Us.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Us.prototype.url=function(t,e){var r,n,i,a,o,s=(r=this.x,n=this.y,i=this.z,a=js(256*r,256*(n=Math.pow(2,i)-n-1),i),o=js(256*(r+1),256*(n+1),i),a[0]+","+a[1]+","+o[0]+","+o[1]),u=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<<a-1)?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",u).replace("{bbox-epsg-3857}",s)};var qs=function(t,e){this.wrap=t,this.canonical=e,this.key=Ns(t,e.z,e.x,e.y);},Rs=function(t,e,r,n,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Us(r,+n,+i),this.key=Ns(e,t,n,i);};function Ns(t,e,r,n){(t*=2)<0&&(t=-1*t-1);var i=1<<e;return 32*(i*i*t+i*n+r)+e}Rs.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Rs.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Rs(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Rs(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Rs.prototype.isChildOf=function(t){var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Rs.prototype.children=function(t){if(this.overscaledZ>=t)return [new Rs(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return [new Rs(e,this.wrap,e,r,n),new Rs(e,this.wrap,e,r+1,n),new Rs(e,this.wrap,e,r,n+1),new Rs(e,this.wrap,e,r+1,n+1)]},Rs.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Rs.prototype.wrapped=function(){return new Rs(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Rs.prototype.unwrapTo=function(t){return new Rs(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Rs.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Rs.prototype.toUnwrapped=function(){return new qs(this.wrap,this.canonical)},Rs.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Rs.prototype.toCoordinate=function(){return new i(this.canonical.x+Math.pow(2,this.wrap),this.canonical.y,this.canonical.z)},zr("CanonicalTileID",Us),zr("OverscaledTileID",Rs,{omit:["posMatrix"]});var Zs=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return b('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');var n=this.dim=e.height;this.border=Math.max(Math.ceil(e.height/2),1),this.stride=this.dim+2*this.border,this.data=new Int32Array(this.stride*this.stride);for(var i=e.data,a="terrarium"===r?this._unpackTerrarium:this._unpackMapbox,o=0;o<n;o++)for(var s=0;s<n;s++){var u=4*(o*n+s);this.set(s,o,a(i[u],i[u+1],i[u+2]));}for(var p=0;p<n;p++)this.set(-1,p,this.get(0,p)),this.set(n,p,this.get(n-1,p)),this.set(p,-1,this.get(p,0)),this.set(p,n,this.get(p,n-1));this.set(-1,-1,this.get(0,0)),this.set(n,-1,this.get(n-1,0)),this.set(-1,n,this.get(0,n-1)),this.set(n,n,this.get(n-1,n-1));};Zs.prototype.set=function(t,e,r){this.data[this._idx(t,e)]=r+65536;},Zs.prototype.get=function(t,e){return this.data[this._idx(t,e)]-65536},Zs.prototype._idx=function(t,e){if(t<-this.border||t>=this.dim+this.border||e<-this.border||e>=this.dim+this.border)throw new RangeError("out of range source coordinates for DEM data");return (e+this.border)*this.stride+(t+this.border)},Zs.prototype._unpackMapbox=function(t,e,r){return (256*t*256+256*e+r)/10-1e4},Zs.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Zs.prototype.getPixels=function(){return new ha({width:this.dim+2*this.border,height:this.dim+2*this.border},new Uint8Array(this.data.buffer))},Zs.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,i=e*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(e){case-1:n=i-1;break;case 1:i=n+1;}switch(r){case-1:a=o-1;break;case 1:o=a+1;}for(var s=l(n,-this.border,this.dim+this.border),u=l(i,-this.border,this.dim+this.border),p=l(a,-this.border,this.dim+this.border),c=l(o,-this.border,this.dim+this.border),h=-e*this.dim,f=-r*this.dim,y=p;y<c;y++)for(var d=s;d<u;d++)this.set(d,y,t.get(d+h,y+f));},zr("DEMData",Zs);var Xs=un([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);var Gs=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r;}};Gs.prototype.encode=function(t){return this._stringToNumber[t]},Gs.prototype.decode=function(t){return this._numberToString[t]};var Hs=function(t,e,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id);},Js={geometry:{configurable:!0}};Js.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Js.geometry.set=function(t){this._geometry=t;},Hs.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Hs.prototype,Js);var Ks=function(){this.state={},this.stateChanges={};};Ks.prototype.updateState=function(t,e,r){var n=String(e);this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},c(this.stateChanges[t][n],r);},Ks.prototype.getState=function(t,e){var r=String(e),n=this.state[t]||{},i=this.stateChanges[t]||{};return c({},n[r],i[r])},Ks.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e);},Ks.prototype.coalesceChanges=function(t,e){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var i={};for(var a in this.stateChanges[n])this.state[n][a]||(this.state[n][a]={}),c(this.state[n][a],this.stateChanges[n][a]),i[a]=this.state[n][a];r[n]=i;}if(this.stateChanges={},0!==Object.keys(r).length)for(var o in t){t[o].setFeatureState(r,e);}};var Ys=function(t,e,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=e||new br(yi,16,0),this.featureIndexArray=r||new Rn;};function $s(t,e){return e-t}Ys.prototype.insert=function(t,e,r,n,i){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var o=0;o<e.length;o++){for(var s=e[o],u=[1/0,1/0,-1/0,-1/0],p=0;p<s.length;p++){var l=s[p];u[0]=Math.min(u[0],l.x),u[1]=Math.min(u[1],l.y),u[2]=Math.max(u[2],l.x),u[3]=Math.max(u[3],l.y);}u[0]<yi&&u[1]<yi&&u[2]>=0&&u[3]>=0&&this.grid.insert(a,u[0],u[1],u[2],u[3]);}},Ys.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new xo.VectorTile(new ms(this.rawTileData)).layers,this.sourceLayerCoder=new Gs(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Ys.prototype.query=function(t,e,r){var n=this;this.loadVTLayers();for(var i=t.params||{},a=yi/t.tileSize/t.scale,o=Je(i.filter),s=t.queryGeometry,u=t.queryPadding*a,p=1/0,l=1/0,c=-1/0,h=-1/0,f=0;f<s.length;f++)for(var y=s[f],d=0;d<y.length;d++){var m=y[d];p=Math.min(p,m.x),l=Math.min(l,m.y),c=Math.max(c,m.x),h=Math.max(h,m.y);}var v=this.grid.query(p-u,l-u,c+u,h+u);v.sort($s);for(var g,x={},b=function(u){var p=v[u];if(p!==g){g=p;var l=n.featureIndexArray.get(p),c=null;n.loadMatchingFeature(x,l.bucketIndex,l.sourceLayerIndex,l.featureIndex,o,i.layers,e,function(e,i){c||(c=vi(e));var o={};return e.id&&(o=r.getState(i.sourceLayer||"_geojsonTileLayer",e.id)),i.queryIntersectsFeature(s,e,o,c,n.z,t.transform,a,t.posMatrix)});}},_=0;_<v.length;_++)b(_);return x},Ys.prototype.loadMatchingFeature=function(t,e,r,n,i,a,o,s){var u=this.bucketLayerIDs[e];if(!a||function(t,e){for(var r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return !0;return !1}(a,u)){var p=this.sourceLayerCoder.decode(r),l=this.vtLayers[p].feature(n);if(i(new Rr(this.tileID.overscaledZ),l))for(var c=0;c<u.length;c++){var h=u[c];if(!(a&&a.indexOf(h)<0)){var f=o[h];if(f&&(!s||s(l,f))){var y=new Hs(l,this.z,this.x,this.y);y.layer=f.serialize();var d=t[h];void 0===d&&(d=t[h]=[]),d.push({featureIndex:n,feature:y});}}}}},Ys.prototype.lookupSymbolFeatures=function(t,e,r,n,i,a){var o={};this.loadVTLayers();for(var s=Je(n),u=0,p=t;u<p.length;u+=1){var l=p[u];this.loadMatchingFeature(o,e,r,l,s,i,a);}return o},Ys.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var n=0,i=r[e];n<i.length;n+=1){if(t===i[n])return !0}return !1},zr("FeatureIndex",Ys,{omit:["rawTileData","sourceLayerCoder"]});var Ws=function(t,e){this.tileID=t,this.uid=f(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.expiredRequestCount=0,this.state="loading";};Ws.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<S.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e);},Ws.prototype.wasRequested=function(){return "errored"===this.state||"loaded"===this.state||"reloading"===this.state},Ws.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var n=0,i=t;n<i.length;n+=1){var a=i[n],o=a.layerIds.map(function(t){return e.getLayer(t)}).filter(Boolean);if(0!==o.length){a.layers=o,a.stateDependentLayers=o.filter(function(t){return t.isStateDependent()});for(var s=0,u=o;s<u.length;s+=1)r[u[s].id]=a;}}return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[n];if(i instanceof Ko){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0;}}for(var a in this.queryPadding=0,this.buckets){var o=this.buckets[a];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(a).queryRadius(o));}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage);}else this.collisionBoxArray=new Cn;},Ws.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded";},Ws.prototype.unloadDEMData=function(){this.dem=null,this.neighboringTiles=null,this.state="unloaded";},Ws.prototype.getBucket=function(t){return this.buckets[t.id]},Ws.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t);}var n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new fs(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new fs(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null);},Ws.prototype.queryRenderedFeatures=function(t,e,r,n,i,a,o,s){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,scale:n,tileSize:this.tileSize,posMatrix:s,transform:a,params:i,queryPadding:this.queryPadding*o},t,e):{}},Ws.prototype.querySourceFeatures=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData){var r=this.latestFeatureIndex.loadVTLayers(),n=e?e.sourceLayer:"",i=r._geojsonTileLayer||r[n];if(i)for(var a=Je(e&&e.filter),o=this.tileID.canonical,s=o.z,u=o.x,p=o.y,l={z:s,x:u,y:p},c=0;c<i.length;c++){var h=i.feature(c);if(a(new Rr(this.tileID.overscaledZ),h)){var f=new Hs(h,s,u,p);f.tile=l,t.push(f);}}}},Ws.prototype.clearMask=function(){this.segments&&(this.segments.destroy(),delete this.segments),this.maskedBoundsBuffer&&(this.maskedBoundsBuffer.destroy(),delete this.maskedBoundsBuffer),this.maskedIndexBuffer&&(this.maskedIndexBuffer.destroy(),delete this.maskedIndexBuffer);},Ws.prototype.setMask=function(t,e){if(!s(this.mask,t)&&(this.mask=t,this.clearMask(),!s(t,{0:!0}))){var r=new cn,n=new Sn;this.segments=new Xn,this.segments.prepareSegment(0,r,n);for(var i=Object.keys(t),o=0;o<i.length;o++){var u=t[i[o]],p=yi>>u.z,l=new a(u.x*p,u.y*p),c=new a(l.x+p,l.y+p),h=this.segments.prepareSegment(4,r,n);r.emplaceBack(l.x,l.y,l.x,l.y),r.emplaceBack(c.x,l.y,c.x,l.y),r.emplaceBack(l.x,c.y,l.x,c.y),r.emplaceBack(c.x,c.y,c.x,c.y);var f=h.vertexLength;n.emplaceBack(f,f+1,f+2),n.emplaceBack(f+1,f+2,f+3),h.vertexLength+=4,h.primitiveLength+=2;}this.maskedBoundsBuffer=e.createVertexBuffer(r,Xs.members),this.maskedIndexBuffer=e.createIndexBuffer(n);}},Ws.prototype.hasData=function(){return "loaded"===this.state||"reloading"===this.state||"expired"===this.state},Ws.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Ws.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=function(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(t,r,n,i){var a=n||i;return e[r]=!a||a.toLowerCase(),""}),e["max-age"]){var r=parseInt(e["max-age"],10);isNaN(r)?delete e["max-age"]:e["max-age"]=r;}return e}(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"]);}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),i=!1;if(this.expirationTime>n)i=!1;else if(e)if(this.expirationTime<e)i=!0;else{var a=this.expirationTime-e;a?this.expirationTime=n+Math.max(a,3e4):i=!0;}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0;}},Ws.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},Ws.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets){var i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=t[a];o&&s&&0!==Object.keys(s).length&&(i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{}),e&&e.style&&(this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(n).queryRadius(i))));}}},Ws.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Ws.prototype.symbolFadeFinished=function(){return !this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<S.now()},Ws.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0;},Ws.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=S.now()+t;};var Qs={horizontal:1,vertical:2,horizontalOnly:3},tu=function(){this.text="",this.sectionIndex=[],this.sections=[];};tu.fromFeature=function(t,e){for(var r=new tu,n=0;n<t.sections.length;n++){var i=t.sections[n];r.sections.push({scale:i.scale||1,fontStack:i.fontStack||e}),r.text+=i.text;for(var a=0;a<i.text.length;a++)r.sectionIndex.push(n);}return r},tu.prototype.length=function(){return this.text.length},tu.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},tu.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},tu.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;n&&Er(n)&&!jo[t[r+1]]||i&&Er(i)&&!jo[t[r-1]]||!jo[t[r]]?e+=t[r]:e+=jo[t[r]];}return e}(this.text);},tu.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&eu[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=t&&eu[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r);},tu.prototype.substring=function(t,e){var r=new tu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},tu.prototype.toString=function(){return this.text},tu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce(function(e,r){return Math.max(e,t.sections[r].scale)},0)};var eu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ru={};function nu(t,e,r,n){var i=Math.pow(t-e,2);return n?t<e?i/2:2*i:i+Math.abs(r)*r}function iu(t,e){var r=0;return 10===t&&(r-=1e4),40!==t&&65288!==t||(r+=50),41!==e&&65289!==e||(r+=50),r}function au(t,e,r,n,i,a){for(var o=null,s=nu(e,r,i,a),u=0,p=n;u<p.length;u+=1){var l=p[u],c=nu(e-l.x,r,i,a)+l.badness;c<=s&&(o=l,s=c);}return {index:t,x:e,priorBreak:o,badness:s}}function ou(t,e,r,n){if(!r)return [];if(!t)return [];for(var i,a=[],o=function(t,e,r,n){for(var i=0,a=0;a<t.length();a++){var o=t.getSection(a),s=n[o.fontStack],u=s&&s[t.getCharCode(a)];u&&(i+=u.metrics.advance*o.scale+e);}return i/Math.max(1,Math.ceil(i/r))}(t,e,r,n),s=0,u=0;u<t.length();u++){var p=t.getSection(u),l=t.getCharCode(u),c=n[p.fontStack],h=c&&c[l];h&&!eu[l]&&(s+=h.metrics.advance*p.scale+e),u<t.length()-1&&(ru[l]||!((i=l)<11904)&&(Pr["Bopomofo Extended"](i)||Pr.Bopomofo(i)||Pr["CJK Compatibility Forms"](i)||Pr["CJK Compatibility Ideographs"](i)||Pr["CJK Compatibility"](i)||Pr["CJK Radicals Supplement"](i)||Pr["CJK Strokes"](i)||Pr["CJK Symbols and Punctuation"](i)||Pr["CJK Unified Ideographs Extension A"](i)||Pr["CJK Unified Ideographs"](i)||Pr["Enclosed CJK Letters and Months"](i)||Pr["Halfwidth and Fullwidth Forms"](i)||Pr.Hiragana(i)||Pr["Ideographic Description Characters"](i)||Pr["Kangxi Radicals"](i)||Pr["Katakana Phonetic Extensions"](i)||Pr.Katakana(i)||Pr["Vertical Forms"](i)||Pr["Yi Radicals"](i)||Pr["Yi Syllables"](i)))&&a.push(au(u+1,s,o,a,iu(l,t.getCharCode(u+1)),!1));}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(au(t.length(),s,o,a,0,!0))}function su(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0;}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0;}return {horizontalAlign:e,verticalAlign:r}}function uu(t,e,r,n,i){if(i){var a=t[n],o=e[a.fontStack],s=o&&o[a.glyph];if(s)for(var u=s.metrics.advance*a.scale,p=(t[n].x+u)*i,l=r;l<=n;l++)t[l].x-=p;}}ru[10]=!0,ru[32]=!0,ru[38]=!0,ru[40]=!0,ru[41]=!0,ru[43]=!0,ru[45]=!0,ru[47]=!0,ru[173]=!0,ru[183]=!0,ru[8203]=!0,ru[8208]=!0,ru[8211]=!0,ru[8231]=!0,t.createCommonjsModule=e,t.Point=a,t.window=self,t.browser=S,t.uuid=function(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()},t.validateUuid=function(t){return !!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)},t.storageAvailable=function(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return !1}},t.warnOnce=b,t.postData=function(t,e,r){var n=P(c(t,{method:"POST"}));return n.onerror=function(){r(new Error(n.statusText));},n.onload=function(){n.status>=200&&n.status<300?r(null,n.response):r(new I(n.statusText,n.status,t.url));},n.send(e),{cancel:function(){return n.abort()}}},t.getJSON=function(t,e){var r=P(t);return r.setRequestHeader("Accept","application/json"),r.onerror=function(){e(new Error(r.statusText));},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&r.response){var n;try{n=JSON.parse(r.response);}catch(t){return e(t)}e(null,n);}else 401===r.status&&t.url.match(/mapbox.com/)?e(new I(r.statusText+": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens",r.status,t.url)):e(new I(r.statusText,r.status,t.url));},r.send(),{cancel:function(){return r.abort()}}},t.getImage=function(t,e){return M(t,function(t,r){if(t)e(t);else if(r){var n=new self.Image,i=self.URL||self.webkitURL;n.onload=function(){e(null,n),i.revokeObjectURL(n.src);},n.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var a=new self.Blob([new Uint8Array(r.data)],{type:"image/png"});n.cacheControl=r.cacheControl,n.expires=r.expires,n.src=r.data.byteLength?i.createObjectURL(a):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";}})},t.ResourceType=V,t.RGBAImage=ha,t.potpack=as,t.ImagePosition=os,t.Texture=fs,t.getArrayBuffer=M,t.parseGlyphPBF=function(t){return new ms(t).readFields(Es,[])},t.isChar=Pr,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach(function(t,o){e(t,function(t,e){t&&(a=t),i[o]=e,0==--n&&r(a,i);});});},t.AlphaImage=ca,t.styleSpec=L,t.endsWith=d,t.extend=c,t.sphericalToCartesian=function(t){var e=t[0],r=t[1],n=t[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n)}},t.Evented=O,t.validateStyle=dr,t.validateLight=mr,t.emitValidationErrors=xr,t.Color=at,t.number=Pt,t.Properties=rn,t.Transitionable=Xr,t.Transitioning=Hr,t.PossiblyEvaluated=Yr,t.DataConstantProperty=$r,t.uniqueId=f,t.Actor=Ds,t.pick=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n];i in t&&(r[i]=t[i]);}return r},t.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},t.clamp=l,t.Event=E,t.ErrorEvent=F,t.OverscaledTileID=Rs,t.EXTENT=yi,t.getCoordinatesCenter=function(t){for(var e=1/0,r=1/0,n=-1/0,a=-1/0,o=0;o<t.length;o++)e=Math.min(e,t[o].column),r=Math.min(r,t[o].row),n=Math.max(n,t[o].column),a=Math.max(a,t[o].row);var s=n-e,u=a-r,p=Math.max(s,u),l=Math.max(0,Math.floor(-Math.log(p)/Math.LN2));return new i((e+n)/2,(r+a)/2,0).zoomTo(l)},t.CanonicalTileID=Us,t.StructArrayLayout4i8=cn,t.rasterBoundsAttributes=Xs,t.SegmentVector=Xn,t.getVideo=function(t,e){var r,n,i=self.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i);};for(var a=0;a<t.length;a++){var o=self.document.createElement("source");r=t[a],n=void 0,(n=self.document.createElement("a")).href=r,(n.protocol!==self.document.location.protocol||n.host!==self.document.location.host)&&(i.crossOrigin="Anonymous"),o.src=t[a],i.appendChild(o);}return {cancel:function(){}}},t.ValidationError=D,t.bindAll=y,t.isEqual=s,t.Tile=Ws,t.Coordinate=i,t.keysDifference=function(t,e){var r=[];for(var n in t)n in e||r.push(n);return r},t.SourceFeatureState=Ks,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.create=function(){var t=new Fi(16);return Fi!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.invert=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],p=e[7],l=e[8],c=e[9],h=e[10],f=e[11],y=e[12],d=e[13],m=e[14],v=e[15],g=r*s-n*o,x=r*u-i*o,b=r*p-a*o,_=n*u-i*s,w=n*p-a*s,A=i*p-a*u,k=l*d-c*y,z=l*m-h*y,S=l*v-f*y,B=c*m-h*d,V=c*v-f*d,I=h*v-f*m,P=g*I-x*V+b*B+_*S-w*z+A*k;return P?(P=1/P,t[0]=(s*I-u*V+p*B)*P,t[1]=(i*V-n*I-a*B)*P,t[2]=(d*A-m*w+v*_)*P,t[3]=(h*w-c*A-f*_)*P,t[4]=(u*S-o*I-p*z)*P,t[5]=(r*I-i*S+a*z)*P,t[6]=(m*b-y*A-v*x)*P,t[7]=(l*A-h*b+f*x)*P,t[8]=(o*V-s*S+p*k)*P,t[9]=(n*S-r*V-a*k)*P,t[10]=(y*w-d*b+v*g)*P,t[11]=(c*b-l*w-f*g)*P,t[12]=(s*z-o*B-u*k)*P,t[13]=(r*B-n*z+i*k)*P,t[14]=(d*x-y*_-m*g)*P,t[15]=(l*_-c*x+h*g)*P,t):null},t.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],p=e[6],l=e[7],c=e[8],h=e[9],f=e[10],y=e[11],d=e[12],m=e[13],v=e[14],g=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*n+b*s+_*c+w*d,t[1]=x*i+b*u+_*h+w*m,t[2]=x*a+b*p+_*f+w*v,t[3]=x*o+b*l+_*y+w*g,x=r[4],b=r[5],_=r[6],w=r[7],t[4]=x*n+b*s+_*c+w*d,t[5]=x*i+b*u+_*h+w*m,t[6]=x*a+b*p+_*f+w*v,t[7]=x*o+b*l+_*y+w*g,x=r[8],b=r[9],_=r[10],w=r[11],t[8]=x*n+b*s+_*c+w*d,t[9]=x*i+b*u+_*h+w*m,t[10]=x*a+b*p+_*f+w*v,t[11]=x*o+b*l+_*y+w*g,x=r[12],b=r[13],_=r[14],w=r[15],t[12]=x*n+b*s+_*c+w*d,t[13]=x*i+b*u+_*h+w*m,t[14]=x*a+b*p+_*f+w*v,t[15]=x*o+b*l+_*y+w*g,t},t.translate=function(t,e,r){var n=r[0],i=r[1],a=r[2],o=void 0,s=void 0,u=void 0,p=void 0,l=void 0,c=void 0,h=void 0,f=void 0,y=void 0,d=void 0,m=void 0,v=void 0;return e===t?(t[12]=e[0]*n+e[4]*i+e[8]*a+e[12],t[13]=e[1]*n+e[5]*i+e[9]*a+e[13],t[14]=e[2]*n+e[6]*i+e[10]*a+e[14],t[15]=e[3]*n+e[7]*i+e[11]*a+e[15]):(o=e[0],s=e[1],u=e[2],p=e[3],l=e[4],c=e[5],h=e[6],f=e[7],y=e[8],d=e[9],m=e[10],v=e[11],t[0]=o,t[1]=s,t[2]=u,t[3]=p,t[4]=l,t[5]=c,t[6]=h,t[7]=f,t[8]=y,t[9]=d,t[10]=m,t[11]=v,t[12]=o*n+l*i+y*a+e[12],t[13]=s*n+c*i+d*a+e[13],t[14]=u*n+h*i+m*a+e[14],t[15]=p*n+f*i+v*a+e[15]),t},t.scale=function(t,e,r){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.rotateX=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[4],o=e[5],s=e[6],u=e[7],p=e[8],l=e[9],c=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+p*n,t[5]=o*i+l*n,t[6]=s*i+c*n,t[7]=u*i+h*n,t[8]=p*i-a*n,t[9]=l*i-o*n,t[10]=c*i-s*n,t[11]=h*i-u*n,t},t.rotateZ=function(t,e,r){var n=Math.sin(r),i=Math.cos(r),a=e[0],o=e[1],s=e[2],u=e[3],p=e[4],l=e[5],c=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+p*n,t[1]=o*i+l*n,t[2]=s*i+c*n,t[3]=u*i+h*n,t[4]=p*i-a*n,t[5]=l*i-o*n,t[6]=c*i-s*n,t[7]=h*i-u*n,t},t.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=void 0;return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t},t.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),u=1/(n-i),p=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*p,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(o+a)*p,t[15]=1,t},t.create$1=Gi,t.normalize=Hi,t.transformMat4=Ji,t.forEach=Ki,t.getSizeData=Ro,t.evaluateSizeForFeature=function(t,e,r){var n=e;return "source"===t.functionType?r.lowerSize/qo:"composite"===t.functionType?Pt(r.lowerSize/qo,r.upperSize/qo,n.uSizeT):n.uSize},t.evaluateSizeForZoom=function(t,e,r){if("constant"===t.functionType)return {uSizeT:0,uSize:t.layoutSize};if("source"===t.functionType)return {uSizeT:0,uSize:0};if("camera"===t.functionType){var n=t.propertyValue,i=t.zoomRange,a=t.sizeRange,o=l(je(n,r.specification).interpolationFactor(e,i.min,i.max),0,1);return {uSizeT:0,uSize:a.min+o*(a.max-a.min)}}var s=t.propertyValue,u=t.zoomRange;return {uSizeT:l(je(s,r.specification).interpolationFactor(e,u.min,u.max),0,1),uSize:0}},t.SIZE_PACK_FACTOR=qo,t.addDynamicAttributes=Go,t.properties=$o,t.WritingMode=Qs,t.multiPolygonIntersectsBufferedPoint=bi,t.multiPolygonIntersectsMultiPolygon=_i,t.multiPolygonIntersectsBufferedMultiLine=wi,t.polygonIntersectsPolygon=function(t,e){for(var r=0;r<t.length;r++)if(Ii(e,t[r]))return !0;for(var n=0;n<e.length;n++)if(Ii(t,e[n]))return !0;return !!ki(t,e)},t.distToSegmentSquared=Bi,t.SymbolInstanceArray=On,t.StyleLayer=nn,t.createStyleLayer=function(t){return "custom"===t.type?new ns(t):new is[t.type](t)},t.clone=g,t.filterObject=v,t.mapObject=m,t.registerForPluginAvailability=function(t){return Dr?t({pluginURL:Dr,completionCallback:Or}):Ur.once("pluginAvailable",t),t},t.evented=Ur,t.ZoomHistory=Ir,t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e},t.createLayout=un,t.ProgramConfiguration=li,t.Uniform1i=Yn,t.Uniform1f=$n,t.Uniform2f=Wn,t.Uniform4f=ti,t.Uniform3f=Qn,t.UniformMatrix4f=ni,t.create$2=Oi,t.fromRotation=function(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.create$3=Li,t.length=Di,t.fromValues=ji,t.normalize$1=Ui,t.dot=qi,t.cross=Ri,t.transformMat3=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t},t.len=Zi,t.forEach$1=Xi,t.UniformColor=ei,t.StructArrayLayout2i4=ln,t.StructArrayLayout2ui4=Bn,t.StructArrayLayout3ui6=Sn,t.StructArrayLayout1ui2=Vn,t.UnwrappedTileID=qs,t.create$4=function(){var t=new Fi(4);return Fi!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.rotate=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=n*-s+a*u,t[3]=i*-s+o*u,t},t.ease=p,t.bezier=u,t.EvaluationParameters=Rr,t.setRTLTextPlugin=function(t,e){if(Lr)throw new Error("setRTLTextPlugin cannot be called multiple times.");Lr=!0,Dr=S.resolveURL(t),Or=function(t){t?(Lr=!1,Dr=null,e&&e(t)):jr=!0;},Ur.fire(new E("pluginAvailable",{pluginURL:Dr,completionCallback:Or}));},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.featureFilter=Je,t.Anchor=Uo,t.GLYPH_PBF_BORDER=Ls,t.shapeText=function(t,e,r,n,i,a,o,s,u,p,l){var c=tu.fromFeature(t,r);l===Qs.vertical&&c.verticalizePunctuation();var h,f=[],y={positionedGlyphs:f,text:c,top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:l},d=qr.processBidirectionalText,m=qr.processStyledBidirectionalText;if(d&&1===c.sections.length){h=[];for(var v=0,g=d(c.toString(),ou(c,s,n,e));v<g.length;v+=1){var x=g[v],b=new tu;b.text=x,b.sections=c.sections;for(var _=0;_<x.length;_++)b.sectionIndex.push(0);h.push(b);}}else if(m){h=[];for(var w=0,A=m(c.text,c.sectionIndex,ou(c,s,n,e));w<A.length;w+=1){var k=A[w],z=new tu;z.text=k[0],z.sectionIndex=k[1],z.sections=c.sections,h.push(z);}}else h=function(t,e){for(var r=[],n=t.text,i=0,a=0,o=e;a<o.length;a+=1){var s=o[a];r.push(t.substring(i,s)),i=s;}return i<n.length&&r.push(t.substring(i,n.length)),r}(c,ou(c,s,n,e));return function(t,e,r,n,i,a,o,s,u){for(var p=0,l=-17,c=0,h=t.positionedGlyphs,f="right"===a?1:"left"===a?0:.5,y=0,d=r;y<d.length;y+=1){var m=d[y];m.trim();var v=m.getMaxScale();if(m.length()){for(var g=h.length,x=0;x<m.length();x++){var b=m.getSection(x),_=m.getCharCode(x),w=24*(v-b.scale),A=e[b.fontStack],k=A&&A[_];k&&(Tr(_)&&o!==Qs.horizontal?(h.push({glyph:_,x:p,y:w,vertical:!0,scale:b.scale,fontStack:b.fontStack}),p+=u*b.scale+s):(h.push({glyph:_,x:p,y:l+w,vertical:!1,scale:b.scale,fontStack:b.fontStack}),p+=k.metrics.advance*b.scale+s));}if(h.length!==g){var z=p-s;c=Math.max(z,c),uu(h,e,g,h.length-1,f);}p=0,l+=n*v;}else l+=n;}var S=su(i),B=S.horizontalAlign,V=S.verticalAlign;!function(t,e,r,n,i,a,o){for(var s=(e-r)*i,u=(-n*o+.5)*a,p=0;p<t.length;p++)t[p].x+=s,t[p].y+=u;}(h,f,B,V,c,n,r.length);var I=l- -17;t.top+=-V*I,t.bottom=t.top+I,t.left+=-B*c,t.right=t.left+c;}(y,e,h,i,a,o,l,s,p),!!f.length&&(y.text=y.text.toString(),y)},t.shapeIcon=function(t,e,r){var n=su(r),i=n.horizontalAlign,a=n.verticalAlign,o=e[0],s=e[1],u=o-t.displaySize[0]*i,p=u+t.displaySize[0],l=s-t.displaySize[1]*a;return {image:t,top:l,bottom:l+t.displaySize[1],left:u,right:p}},t.allowsVerticalWritingMode=Mr,t.allowsLetterSpacing=function(t){for(var e=0,r=t;e<r.length;e+=1)if(!Cr(r[e].charCodeAt(0)))return !1;return !0},t.classifyRings=Ga,t.SymbolBucket=Ko,t.register=zr,t.FeatureIndex=Ys,t.CollisionBoxArray=Cn,t.DictionaryCoder=Gs,t.LineBucket=So,t.FillBucket=Ya,t.FillExtrusionBucket=no,t.ImageAtlas=us,t.mvt=xo,t.Protobuf=ms,t.DEMData=Zs,t.vectorTile=xo,t.Point$1=a,t.pbf=ms,t.plugin=qr;});
+
+define(["./shared.js"],function(e){"use strict";function t(e){var r=typeof e;if("number"===r||"boolean"===r||"string"===r||void 0===e||null===e)return JSON.stringify(e);if(Array.isArray(e)){for(var n="[",o=0,i=e;o<i.length;o+=1){n+=t(i[o])+",";}return n+"]"}for(var a=Object.keys(e).sort(),s="{",l=0;l<a.length;l++)s+=JSON.stringify(a[l])+":"+t(e[a[l]])+",";return s+"}"}function r(r){for(var n="",o=0,i=e.refProperties;o<i.length;o+=1){n+="/"+t(r[i[o]]);}return n}var n=function(e){e&&this.replace(e);};function o(e,t,r,n,o){if(void 0===t.segment)return !0;for(var i=t,a=t.segment+1,s=0;s>-r/2;){if(--a<0)return !1;s-=e[a].dist(i),i=e[a];}s+=e[a].dist(e[a+1]),a++;for(var l=[],u=0;s<r/2;){var h=e[a-1],c=e[a],f=e[a+1];if(!f)return !1;var p=h.angleTo(c)-c.angleTo(f);for(p=Math.abs((p+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:p}),u+=p;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>o)return !1;a++,s+=c.dist(f);}return !0}function i(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function a(e,t,r){return e?.6*t*r:0}function s(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function l(t,r,n,l,u,h){for(var c=a(n,u,h),f=s(n,l)*h,p=0,d=i(t)/2,g=0;g<t.length-1;g++){var m=t[g],v=t[g+1],y=m.dist(v);if(p+y>d){var x=(d-p)/y,w=e.number(m.x,v.x,x),M=e.number(m.y,v.y,x),S=new e.Anchor(w,M,v.angleTo(m),g);return S._round(),!c||o(t,S,f,c,r)?S:void 0}p+=y;}}function u(t,r,n,l,u,h,c,f,p){var d=a(l,h,c),g=s(l,u),m=g*c,v=0===t[0].x||t[0].x===p||0===t[0].y||t[0].y===p;return r-m<r/4&&(r=m+r/4),function t(r,n,a,s,l,u,h,c,f){var p=u/2;var d=i(r);var g=0,m=n-a;var v=[];for(var y=0;y<r.length-1;y++){for(var x=r[y],w=r[y+1],M=x.dist(w),S=w.angleTo(x);m+a<g+M;){var _=((m+=a)-g)/M,P=e.number(x.x,w.x,_),b=e.number(x.y,w.y,_);if(P>=0&&P<f&&b>=0&&b<f&&m-p>=0&&m+p<=d){var T=new e.Anchor(P,b,S,y);T._round(),s&&!o(r,T,u,s,l)||v.push(T);}}g+=M;}c||v.length||h||(v=t(r,g/2,a,s,l,u,h,!0,f));return v}(t,v?r/2*f%r:(g/2+2*h)*c*f%r,r,d,n,m,v,!1,p)}n.prototype.replace=function(e){this._layerConfigs={},this._layers={},this.update(e,[]);},n.prototype.update=function(t,n){for(var o=this,i=0,a=t;i<a.length;i+=1){var s=a[i];o._layerConfigs[s.id]=s;var l=o._layers[s.id]=e.createStyleLayer(s);l._featureFilter=e.featureFilter(l.filter);}for(var u=0,h=n;u<h.length;u+=1){var c=h[u];delete o._layerConfigs[c],delete o._layers[c];}this.familiesBySource={};for(var f=0,p=function(e){for(var t={},n=0;n<e.length;n++){var o=r(e[n]),i=t[o];i||(i=t[o]=[]),i.push(e[n]);}var a=[];for(var s in t)a.push(t[s]);return a}(e.values(this._layerConfigs));f<p.length;f+=1){var d=p[f].map(function(e){return o._layers[e.id]}),g=d[0];if("none"!==g.visibility){var m=g.source||"",v=o.familiesBySource[m];v||(v=o.familiesBySource[m]={});var y=g.sourceLayer||"_geojsonTileLayer",x=v[y];x||(x=v[y]=[]),x.push(d);}}};var h=function(t,r,n,o,i,a,s,l,u,h,c,f){var p=s.top*l-u,d=s.bottom*l+u,g=s.left*l-u,m=s.right*l+u;if(this.boxStartIndex=t.length,h){var v=d-p,y=m-g;v>0&&(v=Math.max(10*l,v),this._addLineCollisionCircles(t,r,n,n.segment,y,v,o,i,a,c));}else{if(f){var x=new e.Point(g,p),w=new e.Point(m,p),M=new e.Point(g,d),S=new e.Point(m,d),_=f*Math.PI/180;x._rotate(_),w._rotate(_),M._rotate(_),S._rotate(_),g=Math.min(x.x,w.x,M.x,S.x),m=Math.max(x.x,w.x,M.x,S.x),p=Math.min(x.y,w.y,M.y,S.y),d=Math.max(x.y,w.y,M.y,S.y);}t.emplaceBack(n.x,n.y,g,p,m,d,o,i,a,0,0);}this.boxEndIndex=t.length;};h.prototype._addLineCollisionCircles=function(e,t,r,n,o,i,a,s,l,u){var h=i/2,c=Math.floor(o/h)||1,f=1+.4*Math.log(u)/Math.LN2,p=Math.floor(c*f/2),d=-i/2,g=r,m=n+1,v=d,y=-o/2,x=y-o/4;do{if(--m<0){if(v>y)return;m=0;break}v-=t[m].dist(g),g=t[m];}while(v>x);for(var w=t[m].dist(t[m+1]),M=-p;M<c+p;M++){var S=M*h,_=y+S;if(S<0&&(_+=S),S>o&&(_+=S-o),!(_<v)){for(;v+w<_;){if(v+=w,++m+1>=t.length)return;w=t[m].dist(t[m+1]);}var P=_-v,b=t[m],T=t[m+1].sub(b)._unit()._mult(P)._add(b)._round(),I=Math.abs(_-d)<h?0:.8*(_-d);e.emplaceBack(T.x,T.y,-i/2,-i/2,i/2,i/2,a,s,l,i/2,I);}}};var c=p,f=p;function p(e,t){if(!(this instanceof p))return new p(e,t);if(this.data=e||[],this.length=this.data.length,this.compare=t||d,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r);}function d(e,t){return e<t?-1:e>t?1:0}function g(t,r,n){void 0===r&&(r=1),void 0===n&&(n=!1);for(var o=1/0,i=1/0,a=-1/0,s=-1/0,l=t[0],u=0;u<l.length;u++){var h=l[u];(!u||h.x<o)&&(o=h.x),(!u||h.y<i)&&(i=h.y),(!u||h.x>a)&&(a=h.x),(!u||h.y>s)&&(s=h.y);}var f=a-o,p=s-i,d=Math.min(f,p),g=d/2,y=new c(null,m);if(0===d)return new e.Point(o,i);for(var x=o;x<a;x+=d)for(var w=i;w<s;w+=d)y.push(new v(x+g,w+g,g,t));for(var M=function(e){for(var t=0,r=0,n=0,o=e[0],i=0,a=o.length,s=a-1;i<a;s=i++){var l=o[i],u=o[s],h=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*h,n+=(l.y+u.y)*h,t+=3*h;}return new v(r/t,n/t,0,e)}(t),S=y.length;y.length;){var _=y.pop();(_.d>M.d||!M.d)&&(M=_,n&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,S)),_.max-M.d<=r||(g=_.h/2,y.push(new v(_.p.x-g,_.p.y-g,g,t)),y.push(new v(_.p.x+g,_.p.y-g,g,t)),y.push(new v(_.p.x-g,_.p.y+g,g,t)),y.push(new v(_.p.x+g,_.p.y+g,g,t)),S+=4);}return n&&(console.log("num probes: "+S),console.log("best distance: "+M.d)),M.p}function m(e,t){return t.max-e.max}function v(t,r,n,o){this.p=new e.Point(t,r),this.h=n,this.d=function(t,r){for(var n=!1,o=1/0,i=0;i<r.length;i++)for(var a=r[i],s=0,l=a.length,u=l-1;s<l;u=s++){var h=a[s],c=a[u];h.y>t.y!=c.y>t.y&&t.x<(c.x-h.x)*(t.y-h.y)/(c.y-h.y)+h.x&&(n=!n),o=Math.min(o,e.distToSegmentSquared(t,h,c));}return (n?1:-1)*Math.sqrt(o)}(this.p,o),this.max=this.d+this.h*Math.SQRT2;}p.prototype={push:function(e){this.data.push(e),this.length++,this._up(this.length-1);},pop:function(){if(0!==this.length){var e=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),e}},peek:function(){return this.data[0]},_up:function(e){for(var t=this.data,r=this.compare,n=t[e];e>0;){var o=e-1>>1,i=t[o];if(r(n,i)>=0)break;t[e]=i,e=o;}t[e]=n;},_down:function(e){for(var t=this.data,r=this.compare,n=this.length>>1,o=t[e];e<n;){var i=1+(e<<1),a=i+1,s=t[i];if(a<this.length&&r(t[a],s)<0&&(i=a,s=t[a]),r(s,o)>=0)break;t[e]=s,e=i;}t[e]=o;}},c.default=f;var y=e.createCommonjsModule(function(e){e.exports=function(e,t){var r,n,o,i,a,s,l,u;for(r=3&e.length,n=e.length-r,o=t,a=3432918353,s=461845907,u=0;u<n;)l=255&e.charCodeAt(u)|(255&e.charCodeAt(++u))<<8|(255&e.charCodeAt(++u))<<16|(255&e.charCodeAt(++u))<<24,++u,o=27492+(65535&(i=5*(65535&(o=(o^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|o>>>19))+((5*(o>>>16)&65535)<<16)&4294967295))+((58964+(i>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:o^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(u)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295;}return o^=e.length,o=2246822507*(65535&(o^=o>>>16))+((2246822507*(o>>>16)&65535)<<16)&4294967295,o=3266489909*(65535&(o^=o>>>13))+((3266489909*(o>>>16)&65535)<<16)&4294967295,(o^=o>>>16)>>>0};}),x=y,w=y,M=e.createCommonjsModule(function(e){e.exports=function(e,t){for(var r,n=e.length,o=t^n,i=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(i)|(255&e.charCodeAt(++i))<<8|(255&e.charCodeAt(++i))<<16|(255&e.charCodeAt(++i))<<24))+((1540483477*(r>>>16)&65535)<<16),o=1540483477*(65535&o)+((1540483477*(o>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++i;switch(n){case 3:o^=(255&e.charCodeAt(i+2))<<16;case 2:o^=(255&e.charCodeAt(i+1))<<8;case 1:o=1540483477*(65535&(o^=255&e.charCodeAt(i)))+((1540483477*(o>>>16)&65535)<<16);}return o=1540483477*(65535&(o^=o>>>13))+((1540483477*(o>>>16)&65535)<<16),(o^=o>>>15)>>>0};});function S(t,r,n,o,i,a){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=e.EXTENT/s,t.compareText={},t.iconsNeedLinear=!1;var l=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,h={};if("composite"===t.textSizeData.functionType){var c=t.textSizeData.zoomRange,f=c.min,p=c.max;h.compositeTextSizes=[u["text-size"].possiblyEvaluate(new e.EvaluationParameters(f)),u["text-size"].possiblyEvaluate(new e.EvaluationParameters(p))];}if("composite"===t.iconSizeData.functionType){var d=t.iconSizeData.zoomRange,g=d.min,m=d.max;h.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new e.EvaluationParameters(g)),u["icon-size"].possiblyEvaluate(new e.EvaluationParameters(m))];}h.layoutTextSize=u["text-size"].possiblyEvaluate(new e.EvaluationParameters(t.zoom+1)),h.layoutIconSize=u["icon-size"].possiblyEvaluate(new e.EvaluationParameters(t.zoom+1)),h.textMaxSize=u["text-size"].possiblyEvaluate(new e.EvaluationParameters(18));for(var v=24*l.get("text-line-height"),y="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),w=0,M=t.features;w<M.length;w+=1){var S=M[w],P=l.get("text-font").evaluate(S,{}).join(","),b=n,T={},I=S.text;if(I){var k=I.toString(),z=l.get("text-offset").evaluate(S,{}).map(function(e){return 24*e}),C=24*l.get("text-letter-spacing").evaluate(S,{}),E=e.allowsLetterSpacing(k)?C:0,L=l.get("text-anchor").evaluate(S,{}),A=l.get("text-justify").evaluate(S,{}),D="point"===l.get("symbol-placement")?24*l.get("text-max-width").evaluate(S,{}):0;T.horizontal=e.shapeText(I,r,P,D,v,L,A,E,z,24,e.WritingMode.horizontal),e.allowsVerticalWritingMode(k)&&y&&x&&(T.vertical=e.shapeText(I,r,P,D,v,L,A,E,z,24,e.WritingMode.vertical));}var O=void 0;if(S.icon){var N=o[S.icon];N&&(O=e.shapeIcon(i[S.icon],l.get("icon-offset").evaluate(S,{}),l.get("icon-anchor").evaluate(S,{})),void 0===t.sdfIcons?t.sdfIcons=N.sdf:t.sdfIcons!==N.sdf&&e.warnOnce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),N.pixelRatio!==t.pixelRatio?t.iconsNeedLinear=!0:0!==l.get("icon-rotate").constantOr(1)&&(t.iconsNeedLinear=!0));}(T.horizontal||O)&&_(t,S,T,O,b,h);}a&&t.generateCollisionDebugBuffers();}function _(t,r,n,o,i,a){var s=a.layoutTextSize.evaluate(r,{}),c=a.layoutIconSize.evaluate(r,{}),f=a.textMaxSize.evaluate(r,{});void 0===f&&(f=s);var p=t.layers[0].layout,d=p.get("text-offset").evaluate(r,{}),m=p.get("icon-offset").evaluate(r,{}),v=s/24,y=t.tilePixelRatio*v,w=t.tilePixelRatio*f/24,M=t.tilePixelRatio*c,S=t.tilePixelRatio*p.get("symbol-spacing"),_=p.get("text-padding")*t.tilePixelRatio,I=p.get("icon-padding")*t.tilePixelRatio,k=p.get("text-max-angle")/180*Math.PI,z="map"===p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),C="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),E=p.get("symbol-placement"),L=S/2,A=function(s,l){l.x<0||l.x>=e.EXTENT||l.y<0||l.y>=e.EXTENT||function(t,r,n,o,i,a,s,l,u,c,f,p,d,g,m,v,y,w,M,S,_){var T,I,k=t.addToLineVertexArray(r,n),z=0,C=0,E=0,L=x(o.horizontal?o.horizontal.text:""),A=[];if(o.horizontal){var D=a.layout.get("text-rotate").evaluate(M,{});T=new h(s,n,r,l,u,c,o.horizontal,f,p,d,t.overscaling,D),C+=b(t,r,o.horizontal,a,d,M,g,k,o.vertical?e.WritingMode.horizontal:e.WritingMode.horizontalOnly,A,S,_),o.vertical&&(E+=b(t,r,o.vertical,a,d,M,g,k,e.WritingMode.vertical,A,S,_));}var O=T?T.boxStartIndex:t.collisionBoxArray.length,N=T?T.boxEndIndex:t.collisionBoxArray.length;if(i){var R=function(t,r,n,o,i,a){var s,l,u,h,c=r.image,f=n.layout,p=r.top-1/c.pixelRatio,d=r.left-1/c.pixelRatio,g=r.bottom+1/c.pixelRatio,m=r.right+1/c.pixelRatio;if("none"!==f.get("icon-text-fit")&&i){var v=m-d,y=g-p,x=f.get("text-size").evaluate(a,{})/24,w=i.left*x,M=i.right*x,S=i.top*x,_=M-w,P=i.bottom*x-S,b=f.get("icon-text-fit-padding")[0],T=f.get("icon-text-fit-padding")[1],I=f.get("icon-text-fit-padding")[2],k=f.get("icon-text-fit-padding")[3],z="width"===f.get("icon-text-fit")?.5*(P-y):0,C="height"===f.get("icon-text-fit")?.5*(_-v):0,E="width"===f.get("icon-text-fit")||"both"===f.get("icon-text-fit")?_:v,L="height"===f.get("icon-text-fit")||"both"===f.get("icon-text-fit")?P:y;s=new e.Point(w+C-k,S+z-b),l=new e.Point(w+C+T+E,S+z-b),u=new e.Point(w+C+T+E,S+z+I+L),h=new e.Point(w+C-k,S+z+I+L);}else s=new e.Point(d,p),l=new e.Point(m,p),u=new e.Point(m,g),h=new e.Point(d,g);var A=n.layout.get("icon-rotate").evaluate(a,{})*Math.PI/180;if(A){var D=Math.sin(A),O=Math.cos(A),N=[O,-D,D,O];s._matMult(N),l._matMult(N),h._matMult(N),u._matMult(N);}return [{tl:s,tr:l,bl:h,br:u,tex:c.paddedRect,writingMode:void 0,glyphOffset:[0,0]}]}(0,i,a,0,o.horizontal,M),F=a.layout.get("icon-rotate").evaluate(M,{});I=new h(s,n,r,l,u,c,i,m,v,!1,t.overscaling,F),z=4*R.length;var B=t.iconSizeData,Z=null;"source"===B.functionType?(Z=[e.SIZE_PACK_FACTOR*a.layout.get("icon-size").evaluate(M,{})])[0]>P&&e.warnOnce(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'):"composite"===B.functionType&&((Z=[e.SIZE_PACK_FACTOR*_.compositeIconSizes[0].evaluate(M,{}),e.SIZE_PACK_FACTOR*_.compositeIconSizes[1].evaluate(M,{})])[0]>P||Z[1]>P)&&e.warnOnce(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'),t.addSymbols(t.icon,R,Z,w,y,M,!1,r,k.lineStartIndex,k.lineLength);}var j=I?I.boxStartIndex:t.collisionBoxArray.length,G=I?I.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=e.SymbolBucket.MAX_GLYPHS&&e.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");t.symbolInstances.emplaceBack(r.x,r.y,A.length>0?A[0]:-1,A.length>1?A[1]:-1,L,O,N,j,G,l,C,E,z,0);}(t,l,s,n,o,t.layers[0],t.collisionBoxArray,r.index,r.sourceLayerIndex,t.index,y,_,z,d,M,I,C,m,r,i,a);};if("line"===E)for(var D=0,O=function(t,r,n,o,i){for(var a=[],s=0;s<t.length;s++)for(var l=t[s],u=void 0,h=0;h<l.length-1;h++){var c=l[h],f=l[h+1];c.x<r&&f.x<r||(c.x<r?c=new e.Point(r,c.y+(f.y-c.y)*((r-c.x)/(f.x-c.x)))._round():f.x<r&&(f=new e.Point(r,c.y+(f.y-c.y)*((r-c.x)/(f.x-c.x)))._round()),c.y<n&&f.y<n||(c.y<n?c=new e.Point(c.x+(f.x-c.x)*((n-c.y)/(f.y-c.y)),n)._round():f.y<n&&(f=new e.Point(c.x+(f.x-c.x)*((n-c.y)/(f.y-c.y)),n)._round()),c.x>=o&&f.x>=o||(c.x>=o?c=new e.Point(o,c.y+(f.y-c.y)*((o-c.x)/(f.x-c.x)))._round():f.x>=o&&(f=new e.Point(o,c.y+(f.y-c.y)*((o-c.x)/(f.x-c.x)))._round()),c.y>=i&&f.y>=i||(c.y>=i?c=new e.Point(c.x+(f.x-c.x)*((i-c.y)/(f.y-c.y)),i)._round():f.y>=i&&(f=new e.Point(c.x+(f.x-c.x)*((i-c.y)/(f.y-c.y)),i)._round()),u&&c.equals(u[u.length-1])||(u=[c],a.push(u)),u.push(f)))));}return a}(r.geometry,0,0,e.EXTENT,e.EXTENT);D<O.length;D+=1)for(var N=O[D],R=0,F=u(N,S,k,n.vertical||n.horizontal,o,24,w,t.overscaling,e.EXTENT);R<F.length;R+=1){var B=F[R],Z=n.horizontal;Z&&T(t,Z.text,L,B)||A(N,B);}else if("line-center"===E)for(var j=0,G=r.geometry;j<G.length;j+=1){var J=G[j];if(J.length>1){var X=l(J,k,n.vertical||n.horizontal,o,24,w);X&&A(J,X);}}else if("Polygon"===r.type)for(var V=0,W=e.classifyRings(r.geometry,0);V<W.length;V+=1){var Y=W[V],q=g(Y,16);A(Y[0],new e.Anchor(q.x,q.y,0));}else if("LineString"===r.type)for(var K=0,U=r.geometry;K<U.length;K+=1){var H=U[K];A(H,new e.Anchor(H[0].x,H[0].y,0));}else if("Point"===r.type)for(var Q=0,$=r.geometry;Q<$.length;Q+=1)for(var ee=0,te=$[Q];ee<te.length;ee+=1){var re=te[ee];A([re],new e.Anchor(re.x,re.y,0));}}x.murmur3=w,x.murmur2=M;var P=65535;function b(t,r,n,o,i,a,s,l,u,h,c,f){var p=function(t,r,n,o,i,a){for(var s=n.layout.get("text-rotate").evaluate(i,{})*Math.PI/180,l=n.layout.get("text-offset").evaluate(i,{}).map(function(e){return 24*e}),u=r.positionedGlyphs,h=[],c=0;c<u.length;c++){var f=u[c],p=a[f.fontStack],d=p&&p[f.glyph];if(d){var g=d.rect;if(g){var m=e.GLYPH_PBF_BORDER+1,v=d.metrics.advance*f.scale/2,y=o?[f.x+v,f.y]:[0,0],x=o?[0,0]:[f.x+v+l[0],f.y+l[1]],w=(d.metrics.left-m)*f.scale-v+x[0],M=(-d.metrics.top-m)*f.scale+x[1],S=w+g.w*f.scale,_=M+g.h*f.scale,P=new e.Point(w,M),b=new e.Point(S,M),T=new e.Point(w,_),I=new e.Point(S,_);if(o&&f.vertical){var k=new e.Point(-v,v),z=-Math.PI/2,C=new e.Point(5,0);P._rotateAround(z,k)._add(C),b._rotateAround(z,k)._add(C),T._rotateAround(z,k)._add(C),I._rotateAround(z,k)._add(C);}if(s){var E=Math.sin(s),L=Math.cos(s),A=[L,-E,E,L];P._matMult(A),b._matMult(A),T._matMult(A),I._matMult(A);}h.push({tl:P,tr:b,bl:T,br:I,tex:g,writingMode:r.writingMode,glyphOffset:y});}}}return h}(0,n,o,i,a,c),d=t.textSizeData,g=null;return "source"===d.functionType?(g=[e.SIZE_PACK_FACTOR*o.layout.get("text-size").evaluate(a,{})])[0]>P&&e.warnOnce(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'):"composite"===d.functionType&&((g=[e.SIZE_PACK_FACTOR*f.compositeTextSizes[0].evaluate(a,{}),e.SIZE_PACK_FACTOR*f.compositeTextSizes[1].evaluate(a,{})])[0]>P||g[1]>P)&&e.warnOnce(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'),t.addSymbols(t.text,p,g,s,i,a,u,r,l.lineStartIndex,l.lineLength),h.push(t.text.placedSymbolArray.length-1),4*p.length}function T(e,t,r,n){var o=e.compareText;if(t in o){for(var i=o[t],a=i.length-1;a>=0;a--)if(n.dist(i[a])<r)return !0}else o[t]=[];return o[t].push(n),!1}var I=function(t){var r={},n=[];for(var o in t){var i=t[o],a=r[o]={};for(var s in i){var l=i[+s];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var u={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};n.push(u),a[s]={rect:u,metrics:l.metrics};}}}var h=e.potpack(n),c=h.w,f=h.h,p=new e.AlphaImage({width:c||1,height:f||1});for(var d in t){var g=t[d];for(var m in g){var v=g[+m];if(v&&0!==v.bitmap.width&&0!==v.bitmap.height){var y=r[d][m].rect;e.AlphaImage.copy(v.bitmap,p,{x:0,y:0},{x:y.x+1,y:y.y+1},v.bitmap);}}}this.image=p,this.positions=r;};e.register("GlyphAtlas",I);var k=function(t){this.tileID=new e.OverscaledTileID(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;};function z(t,r){for(var n=new e.EvaluationParameters(r),o=0,i=t;o<i.length;o+=1){i[o].recalculate(n);}}k.prototype.parse=function(t,r,n,o){var i=this;this.status="parsing",this.data=t,this.collisionBoxArray=new e.CollisionBoxArray;var a=new e.DictionaryCoder(Object.keys(t.layers).sort()),s=new e.FeatureIndex(this.tileID);s.bucketLayerIDs=[];var l,u,h,c,f={},p={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{}},d=r.familiesBySource[this.source];for(var g in d){var m=t.layers[g];if(m){1===m.version&&e.warnOnce('Vector tile source "'+i.source+'" layer "'+g+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var v=a.encode(g),y=[],x=0;x<m.length;x++){var w=m.feature(x);y.push({feature:w,index:x,sourceLayerIndex:v});}for(var M=0,_=d[g];M<_.length;M+=1){var P=_[M],b=P[0];if(!(b.minzoom&&i.zoom<Math.floor(b.minzoom)))if(!(b.maxzoom&&i.zoom>=b.maxzoom))if("none"!==b.visibility)z(P,i.zoom),(f[b.id]=b.createBucket({index:s.bucketLayerIDs.length,layers:P,zoom:i.zoom,pixelRatio:i.pixelRatio,overscaling:i.overscaling,collisionBoxArray:i.collisionBoxArray,sourceLayerIndex:v,sourceID:i.source})).populate(y,p),s.bucketLayerIDs.push(P.map(function(e){return e.id}));}}}var T=e.mapObject(p.glyphDependencies,function(e){return Object.keys(e).map(Number)});Object.keys(T).length?n.send("getGlyphs",{uid:this.uid,stacks:T},function(e,t){l||(l=e,u=t,E.call(i));}):u={};var k=Object.keys(p.iconDependencies);k.length?n.send("getImages",{icons:k},function(e,t){l||(l=e,h=t,E.call(i));}):h={};var C=Object.keys(p.patternDependencies);function E(){if(l)return o(l);if(u&&h&&c){var t=new I(u),r=new e.ImageAtlas(h,c);for(var n in f){var i=f[n];i instanceof e.SymbolBucket?(z(i.layers,this.zoom),S(i,u,t.positions,h,r.iconPositions,this.showCollisionBoxes)):i.hasPattern&&(i instanceof e.LineBucket||i instanceof e.FillBucket||i instanceof e.FillExtrusionBucket)&&(z(i.layers,this.zoom),i.addFeatures(p,r.patternPositions));}this.status="done",o(null,{buckets:e.values(f).filter(function(e){return !e.isEmpty()}),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r});}}C.length?n.send("getImages",{icons:C},function(e,t){l||(l=e,c=t,E.call(i));}):c={},E.call(this);};var C="undefined"!=typeof performance,E={getEntriesByName:function(e){return !!(C&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(e)},mark:function(e){return !!(C&&performance&&performance.mark)&&performance.mark(e)},measure:function(e,t,r){return !!(C&&performance&&performance.measure)&&performance.measure(e,t,r)},clearMarks:function(e){return !!(C&&performance&&performance.clearMarks)&&performance.clearMarks(e)},clearMeasures:function(e){return !!(C&&performance&&performance.clearMeasures)&&performance.clearMeasures(e)}},L=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},E.mark(this._marks.start);};function A(t,r){var n=e.getArrayBuffer(t.request,function(t,n){t?r(t):n&&r(null,{vectorTile:new e.mvt.VectorTile(new e.Protobuf(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires});});return function(){n.cancel(),r();}}L.prototype.finish=function(){E.mark(this._marks.end);var e=E.getEntriesByName(this._marks.measure);return 0===e.length&&(E.measure(this._marks.measure,this._marks.start,this._marks.end),e=E.getEntriesByName(this._marks.measure),E.clearMarks(this._marks.start),E.clearMarks(this._marks.end),E.clearMeasures(this._marks.measure)),e},E.Performance=L;var D=function(e,t,r){this.actor=e,this.layerIndex=t,this.loadVectorData=r||A,this.loading={},this.loaded={};};D.prototype.loadTile=function(t,r){var n=this,o=t.uid;this.loading||(this.loading={});var i=!!(t&&t.request&&t.request.collectResourceTiming)&&new E.Performance(t.request),a=this.loading[o]=new k(t);a.abort=this.loadVectorData(t,function(t,s){if(delete n.loading[o],t||!s)return a.status="done",n.loaded[o]=a,r(t);var l=s.rawData,u={};s.expires&&(u.expires=s.expires),s.cacheControl&&(u.cacheControl=s.cacheControl);var h={};if(i){var c=i.finish();c&&(h.resourceTiming=JSON.parse(JSON.stringify(c)));}a.vectorTile=s.vectorTile,a.parse(s.vectorTile,n.layerIndex,n.actor,function(t,n){if(t||!n)return r(t);r(null,e.extend({rawTileData:l.slice(0)},n,u,h));}),n.loaded=n.loaded||{},n.loaded[o]=a;});},D.prototype.reloadTile=function(e,t){var r=this.loaded,n=e.uid,o=this;if(r&&r[n]){var i=r[n];i.showCollisionBoxes=e.showCollisionBoxes;var a=function(e,r){var n=i.reloadCallback;n&&(delete i.reloadCallback,i.parse(i.vectorTile,o.layerIndex,o.actor,n)),t(e,r);};"parsing"===i.status?i.reloadCallback=a:"done"===i.status&&(i.vectorTile?i.parse(i.vectorTile,this.layerIndex,this.actor,a):a());}},D.prototype.abortTile=function(e,t){var r=this.loading,n=e.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),t();},D.prototype.removeTile=function(e,t){var r=this.loaded,n=e.uid;r&&r[n]&&delete r[n],t();};var O=function(){this.loaded={};};O.prototype.loadTile=function(t,r){var n=t.uid,o=t.encoding,i=t.rawImageData,a=new e.DEMData(n,i,o);this.loaded=this.loaded||{},this.loaded[n]=a,r(null,a);},O.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r];};var N={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function R(e){var t=0;if(e&&e.length>0){t+=Math.abs(F(e[0]));for(var r=1;r<e.length;r++)t-=Math.abs(F(e[r]));}return t}function F(e){var t,r,n,o,i,a,s=0,l=e.length;if(l>2){for(a=0;a<l;a++)a===l-2?(n=l-2,o=l-1,i=0):a===l-1?(n=l-1,o=0,i=1):(n=a,o=a+1,i=a+2),t=e[n],r=e[o],s+=(B(e[i][0])-B(t[0]))*Math.sin(B(r[1]));s=s*N.RADIUS*N.RADIUS/2;}return s}function B(e){return e*Math.PI/180}var Z={geometry:function e(t){var r,n=0;switch(t.type){case"Polygon":return R(t.coordinates);case"MultiPolygon":for(r=0;r<t.coordinates.length;r++)n+=R(t.coordinates[r]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(r=0;r<t.geometries.length;r++)n+=e(t.geometries[r]);return n}},ring:F},j=function e(t,r){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.map(G(e,r)),t;case"Feature":return t.geometry=e(t.geometry,r),t;case"Polygon":case"MultiPolygon":return function(e,t){"Polygon"===e.type?e.coordinates=J(e.coordinates,t):"MultiPolygon"===e.type&&(e.coordinates=e.coordinates.map(G(J,t)));return e}(t,r);default:return t}};function G(e,t){return function(r){return e(r,t)}}function J(e,t){t=!!t,e[0]=X(e[0],t);for(var r=1;r<e.length;r++)e[r]=X(e[r],!t);return e}function X(e,t){return function(e){return Z.ring(e)>=0}(e)===t?e:e.reverse()}var V=e.mvt.VectorTileFeature.prototype.toGeoJSON,W=function(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10));};W.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,n=this._feature.geometry;r<n.length;r+=1){var o=n[r];t.push([new e.Point(o[0],o[1])]);}return t}for(var i=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var l=[],u=0,h=s[a];u<h.length;u+=1){var c=h[u];l.push(new e.Point(c[0],c[1]));}i.push(l);}return i},W.prototype.toGeoJSON=function(e,t,r){return V.call(this,e,t,r)};var Y=function(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=t.length,this._features=t;};Y.prototype.feature=function(e){return new W(this._features[e])};var q=e.vectorTile.VectorTileFeature,K=U;function U(e,t){this.options=t||{},this.features=e,this.length=e.length;}function H(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096;}U.prototype.feature=function(e){return new H(this.features[e],this.options.extent)},H.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var r=0;r<t.length;r++){for(var n=t[r],o=[],i=0;i<n.length;i++)o.push(new e.Point$1(n[i][0],n[i][1]));this.geometry.push(o);}return this.geometry},H.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,n=1/0,o=-1/0,i=0;i<e.length;i++)for(var a=e[i],s=0;s<a.length;s++){var l=a[s];t=Math.min(t,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),o=Math.max(o,l.y);}return [t,n,r,o]},H.prototype.toGeoJSON=q.prototype.toGeoJSON;var Q=re,$=re,ee=function(e,t){t=t||{};var r={};for(var n in e)r[n]=new K(e[n].features,t),r[n].name=n,r[n].version=t.version,r[n].extent=t.extent;return re({layers:r})},te=K;function re(t){var r=new e.pbf;return function(e,t){for(var r in e.layers)t.writeMessage(3,ne,e.layers[r]);}(t,r),r.finish()}function ne(e,t){var r;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)n.feature=e.feature(r),t.writeMessage(2,oe,n);var o=n.keys;for(r=0;r<o.length;r++)t.writeStringField(3,o[r]);var i=n.values;for(r=0;r<i.length;r++)t.writeMessage(4,ue,i[r]);}function oe(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,ie,e),t.writeVarintField(3,r.type),t.writeMessage(4,le,r);}function ie(e,t){var r=e.feature,n=e.keys,o=e.values,i=e.keycache,a=e.valuecache;for(var s in r.properties){var l=i[s];void 0===l&&(n.push(s),l=n.length-1,i[s]=l),t.writeVarint(l);var u=r.properties[s],h=typeof u;"string"!==h&&"boolean"!==h&&"number"!==h&&(u=JSON.stringify(u));var c=h+":"+u,f=a[c];void 0===f&&(o.push(u),f=o.length-1,a[c]=f),t.writeVarint(f);}}function ae(e,t){return (t<<3)+(7&e)}function se(e){return e<<1^e>>31}function le(e,t){for(var r=e.loadGeometry(),n=e.type,o=0,i=0,a=r.length,s=0;s<a;s++){var l=r[s],u=1;1===n&&(u=l.length),t.writeVarint(ae(1,u));for(var h=3===n?l.length-1:l.length,c=0;c<h;c++){1===c&&1!==n&&t.writeVarint(ae(2,h-1));var f=l[c].x-o,p=l[c].y-i;t.writeVarint(se(f)),t.writeVarint(se(p)),o+=f,i+=p;}3===n&&t.writeVarint(ae(7,1));}}function ue(e,t){var r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e));}function he(e,t,r,n,o,i){if(!(o-n<=r)){var a=Math.floor((n+o)/2);!function e(t,r,n,o,i,a){for(;i>o;){if(i-o>600){var s=i-o+1,l=n-o+1,u=Math.log(s),h=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*h*(s-h)/s)*(l-s/2<0?-1:1),f=Math.max(o,Math.floor(n-l*h/s+c)),p=Math.min(i,Math.floor(n+(s-l)*h/s+c));e(t,r,n,f,p,a);}var d=r[2*n+a],g=o,m=i;for(ce(t,r,o,n),r[2*i+a]>d&&ce(t,r,o,i);g<m;){for(ce(t,r,g,m),g++,m--;r[2*g+a]<d;)g++;for(;r[2*m+a]>d;)m--;}r[2*o+a]===d?ce(t,r,o,m):ce(t,r,++m,i),m<=n&&(o=m+1),n<=m&&(i=m-1);}}(e,t,a,n,o,i%2),he(e,t,r,n,a-1,i+1),he(e,t,r,a+1,o,i+1);}}function ce(e,t,r,n){fe(e,r,n),fe(t,2*r,2*n),fe(t,2*r+1,2*n+1);}function fe(e,t,r){var n=e[t];e[t]=e[r],e[r]=n;}function pe(e,t,r,n){var o=e-r,i=t-n;return o*o+i*i}function de(e,t,r,n,o){return new ge(e,t,r,n,o)}function ge(e,t,r,n,o){t=t||me,r=r||ve,o=o||Array,this.nodeSize=n||64,this.points=e,this.ids=new o(e.length),this.coords=new o(2*e.length);for(var i=0;i<e.length;i++)this.ids[i]=i,this.coords[2*i]=t(e[i]),this.coords[2*i+1]=r(e[i]);he(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0);}function me(e){return e[0]}function ve(e){return e[1]}function ye(e){this.options=Pe(Object.create(this.options),e),this.trees=new Array(this.options.maxZoom+1);}function xe(e,t,r,n,o){return {x:e,y:t,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:o}}function we(e){return {type:"Feature",id:e.id,properties:Me(e),geometry:{type:"Point",coordinates:[(n=e.x,360*(n-.5)),(t=e.y,r=(180-360*t)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var t,r,n;}function Me(e){var t=e.numPoints,r=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return Pe(Pe({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function Se(e){return e/360+.5}function _e(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function Pe(e,t){for(var r in t)e[r]=t[r];return e}function be(e){return e.x}function Te(e){return e.y}function Ie(e,t,r,n,o,i){var a=o-r,s=i-n;if(0!==a||0!==s){var l=((e-r)*a+(t-n)*s)/(a*a+s*s);l>1?(r=o,n=i):l>0&&(r+=a*l,n+=s*l);}return (a=e-r)*a+(s=t-n)*s}function ke(e,t,r,n){var o={id:void 0===e?null:e,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,r=e.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)ze(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<t.length;n++)ze(e,t[n]);else if("MultiPolygon"===r)for(n=0;n<t.length;n++)for(var o=0;o<t[n].length;o++)ze(e,t[n][o]);}(o),o}function ze(e,t){for(var r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1]);}function Ce(e,t,r,n){if(t.geometry){var o=t.geometry.coordinates,i=t.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===i)Ee(o,s);else if("MultiPoint"===i)for(var u=0;u<o.length;u++)Ee(o[u],s);else if("LineString"===i)Le(o,s,a,!1);else if("MultiLineString"===i){if(r.lineMetrics){for(u=0;u<o.length;u++)s=[],Le(o[u],s,a,!1),e.push(ke(l,"LineString",s,t.properties));return}Ae(o,s,a,!1);}else if("Polygon"===i)Ae(o,s,a,!0);else{if("MultiPolygon"!==i){if("GeometryCollection"===i){for(u=0;u<t.geometry.geometries.length;u++)Ce(e,{id:l,geometry:t.geometry.geometries[u],properties:t.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(u=0;u<o.length;u++){var h=[];Ae(o[u],h,a,!0),s.push(h);}}e.push(ke(l,i,s,t.properties));}}function Ee(e,t){t.push(De(e[0])),t.push(Oe(e[1])),t.push(0);}function Le(e,t,r,n){for(var o,i,a=0,s=0;s<e.length;s++){var l=De(e[s][0]),u=Oe(e[s][1]);t.push(l),t.push(u),t.push(0),s>0&&(a+=n?(o*u-l*i)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(u-i,2))),o=l,i=u;}var h=t.length-3;t[2]=1,function e(t,r,n,o){for(var i,a=o,s=n-r>>1,l=n-r,u=t[r],h=t[r+1],c=t[n],f=t[n+1],p=r+3;p<n;p+=3){var d=Ie(t[p],t[p+1],u,h,c,f);if(d>a)i=p,a=d;else if(d===a){var g=Math.abs(p-s);g<l&&(i=p,l=g);}}a>o&&(i-r>3&&e(t,r,i,o),t[i+2]=a,n-i>3&&e(t,i,n,o));}(t,0,h,r),t[h+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size;}function Ae(e,t,r,n){for(var o=0;o<e.length;o++){var i=[];Le(e[o],i,r,n),t.push(i);}}function De(e){return e/360+.5}function Oe(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function Ne(e,t,r,n,o,i,a,s){if(n/=t,i>=(r/=t)&&a<n)return e;if(a<r||i>=n)return null;for(var l=[],u=0;u<e.length;u++){var h=e[u],c=h.geometry,f=h.type,p=0===o?h.minX:h.minY,d=0===o?h.maxX:h.maxY;if(p>=r&&d<n)l.push(h);else if(!(d<r||p>=n)){var g=[];if("Point"===f||"MultiPoint"===f)Re(c,g,r,n,o);else if("LineString"===f)Fe(c,g,r,n,o,!1,s.lineMetrics);else if("MultiLineString"===f)Ze(c,g,r,n,o,!1);else if("Polygon"===f)Ze(c,g,r,n,o,!0);else if("MultiPolygon"===f)for(var m=0;m<c.length;m++){var v=[];Ze(c[m],v,r,n,o,!0),v.length&&g.push(v);}if(g.length){if(s.lineMetrics&&"LineString"===f){for(m=0;m<g.length;m++)l.push(ke(h.id,f,g[m],h.tags));continue}"LineString"!==f&&"MultiLineString"!==f||(1===g.length?(f="LineString",g=g[0]):f="MultiLineString"),"Point"!==f&&"MultiPoint"!==f||(f=3===g.length?"Point":"MultiPoint"),l.push(ke(h.id,f,g,h.tags));}}}return l.length?l:null}function Re(e,t,r,n,o){for(var i=0;i<e.length;i+=3){var a=e[i+o];a>=r&&a<=n&&(t.push(e[i]),t.push(e[i+1]),t.push(e[i+2]));}}function Fe(e,t,r,n,o,i,a){for(var s,l,u=Be(e),h=0===o?Ge:Je,c=e.start,f=0;f<e.length-3;f+=3){var p=e[f],d=e[f+1],g=e[f+2],m=e[f+3],v=e[f+4],y=0===o?p:d,x=0===o?m:v,w=!1;a&&(s=Math.sqrt(Math.pow(p-m,2)+Math.pow(d-v,2))),y<r?x>=r&&(l=h(u,p,d,m,v,r),a&&(u.start=c+s*l)):y>=n?x<n&&(l=h(u,p,d,m,v,n),a&&(u.start=c+s*l)):je(u,p,d,g),x<r&&y>=r&&(l=h(u,p,d,m,v,r),w=!0),x>n&&y<=n&&(l=h(u,p,d,m,v,n),w=!0),!i&&w&&(a&&(u.end=c+s*l),t.push(u),u=Be(e)),a&&(c+=s);}var M=e.length-3;p=e[M],d=e[M+1],g=e[M+2],(y=0===o?p:d)>=r&&y<=n&&je(u,p,d,g),M=u.length-3,i&&M>=3&&(u[M]!==u[0]||u[M+1]!==u[1])&&je(u,u[0],u[1],u[2]),u.length&&t.push(u);}function Be(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function Ze(e,t,r,n,o,i){for(var a=0;a<e.length;a++)Fe(e[a],t,r,n,o,i,!1);}function je(e,t,r,n){e.push(t),e.push(r),e.push(n);}function Ge(e,t,r,n,o,i){var a=(i-t)/(n-t);return e.push(i),e.push(r+(o-r)*a),e.push(1),a}function Je(e,t,r,n,o,i){var a=(i-r)/(o-r);return e.push(t+(n-t)*a),e.push(i),e.push(1),a}function Xe(e,t){for(var r=[],n=0;n<e.length;n++){var o,i=e[n],a=i.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)o=Ve(i.geometry,t);else if("MultiLineString"===a||"Polygon"===a){o=[];for(var s=0;s<i.geometry.length;s++)o.push(Ve(i.geometry[s],t));}else if("MultiPolygon"===a)for(o=[],s=0;s<i.geometry.length;s++){for(var l=[],u=0;u<i.geometry[s].length;u++)l.push(Ve(i.geometry[s][u],t));o.push(l);}r.push(ke(i.id,a,o,i.tags));}return r}function Ve(e,t){var r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(var n=0;n<e.length;n+=3)r.push(e[n]+t,e[n+1],e[n+2]);return r}function We(e,t){if(e.transformed)return e;var r,n,o,i=1<<e.z,a=e.x,s=e.y;for(r=0;r<e.features.length;r++){var l=e.features[r],u=l.geometry,h=l.type;if(l.geometry=[],1===h)for(n=0;n<u.length;n+=2)l.geometry.push(Ye(u[n],u[n+1],t,i,a,s));else for(n=0;n<u.length;n++){var c=[];for(o=0;o<u[n].length;o+=2)c.push(Ye(u[n][o],u[n][o+1],t,i,a,s));l.geometry.push(c);}}return e.transformed=!0,e}function Ye(e,t,r,n,o,i){return [Math.round(r*(e*n-o)),Math.round(r*(t*n-i))]}function qe(e,t,r,n,o){for(var i=t===o.maxZoom?0:o.tolerance/((1<<t)*o.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<e.length;s++){a.numFeatures++,Ke(a,e[s],i,o);var l=e[s].minX,u=e[s].minY,h=e[s].maxX,c=e[s].maxY;l<a.minX&&(a.minX=l),u<a.minY&&(a.minY=u),h>a.maxX&&(a.maxX=h),c>a.maxY&&(a.maxY=c);}return a}function Ke(e,t,r,n){var o=t.geometry,i=t.type,a=[];if("Point"===i||"MultiPoint"===i)for(var s=0;s<o.length;s+=3)a.push(o[s]),a.push(o[s+1]),e.numPoints++,e.numSimplified++;else if("LineString"===i)Ue(a,o,e,r,!1,!1);else if("MultiLineString"===i||"Polygon"===i)for(s=0;s<o.length;s++)Ue(a,o[s],e,r,"Polygon"===i,0===s);else if("MultiPolygon"===i)for(var l=0;l<o.length;l++){var u=o[l];for(s=0;s<u.length;s++)Ue(a,u[s],e,r,!0,0===s);}if(a.length){var h=t.tags||null;if("LineString"===i&&n.lineMetrics){for(var c in h={},t.tags)h[c]=t.tags[c];h.mapbox_clip_start=o.start/o.size,h.mapbox_clip_end=o.end/o.size;}var f={geometry:a,type:"Polygon"===i||"MultiPolygon"===i?3:"LineString"===i||"MultiLineString"===i?2:1,tags:h};null!==t.id&&(f.id=t.id),e.features.push(f);}}function Ue(e,t,r,n,o,i){var a=n*n;if(n>0&&t.size<(o?a:n))r.numPoints+=t.length/3;else{for(var s=[],l=0;l<t.length;l+=3)(0===n||t[l+2]>a)&&(r.numSimplified++,s.push(t[l]),s.push(t[l+1])),r.numPoints++;o&&function(e,t){for(var r=0,n=0,o=e.length,i=o-2;n<o;i=n,n+=2)r+=(e[n]-e[i])*(e[n+1]+e[i+1]);if(r>0===t)for(n=0,o=e.length;n<o/2;n+=2){var a=e[n],s=e[n+1];e[n]=e[o-2-n],e[n+1]=e[o-1-n],e[o-2-n]=a,e[o-1-n]=s;}}(s,i),e.push(s);}}function He(e,t){var r=(t=this.options=function(e,t){for(var r in t)e[r]=t[r];return e}(Object.create(this.options),t)).debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(e,t){var r=[];if("FeatureCollection"===e.type)for(var n=0;n<e.features.length;n++)Ce(r,e.features[n],t,n);else"Feature"===e.type?Ce(r,e,t):Ce(r,{geometry:e},t);return r}(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=function(e,t){var r=t.buffer/t.extent,n=e,o=Ne(e,1,-1-r,r,0,-1,2,t),i=Ne(e,1,1-r,2+r,0,-1,2,t);return (o||i)&&(n=Ne(e,1,-r,1+r,0,-1,2,t)||[],o&&(n=Xe(o,1).concat(n)),i&&(n=n.concat(Xe(i,-1)))),n}(n,t)).length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)));}function Qe(e,t,r){return 32*((1<<e)*r+t)+e}function $e(e,t){var r=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);var n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return t(null,null);var o=new Y(n.features),i=Q(o);0===i.byteOffset&&i.byteLength===i.buffer.byteLength||(i=new Uint8Array(i)),t(null,{vectorTile:o,rawData:i.buffer});}Q.fromVectorTileJs=$,Q.fromGeojsonVt=ee,Q.GeoJSONWrapper=te,ge.prototype={range:function(e,t,r,n){return function(e,t,r,n,o,i,a){for(var s,l,u=[0,e.length-1,0],h=[];u.length;){var c=u.pop(),f=u.pop(),p=u.pop();if(f-p<=a)for(var d=p;d<=f;d++)s=t[2*d],l=t[2*d+1],s>=r&&s<=o&&l>=n&&l<=i&&h.push(e[d]);else{var g=Math.floor((p+f)/2);s=t[2*g],l=t[2*g+1],s>=r&&s<=o&&l>=n&&l<=i&&h.push(e[g]);var m=(c+1)%2;(0===c?r<=s:n<=l)&&(u.push(p),u.push(g-1),u.push(m)),(0===c?o>=s:i>=l)&&(u.push(g+1),u.push(f),u.push(m));}}return h}(this.ids,this.coords,e,t,r,n,this.nodeSize)},within:function(e,t,r){return function(e,t,r,n,o,i){for(var a=[0,e.length-1,0],s=[],l=o*o;a.length;){var u=a.pop(),h=a.pop(),c=a.pop();if(h-c<=i)for(var f=c;f<=h;f++)pe(t[2*f],t[2*f+1],r,n)<=l&&s.push(e[f]);else{var p=Math.floor((c+h)/2),d=t[2*p],g=t[2*p+1];pe(d,g,r,n)<=l&&s.push(e[p]);var m=(u+1)%2;(0===u?r-o<=d:n-o<=g)&&(a.push(c),a.push(p-1),a.push(m)),(0===u?r+o>=d:n+o>=g)&&(a.push(p+1),a.push(h),a.push(m));}}return s}(this.ids,this.coords,e,t,r,this.nodeSize)}},ye.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return {}},map:function(e){return e}},load:function(e){var t=this.options.log;t&&console.time("total time");var r="prepare "+e.length+" points";t&&console.time(r),this.points=e;for(var n,o,i,a=[],s=0;s<e.length;s++)e[s].geometry&&a.push((n=e[s],o=s,void 0,{x:Se((i=n.geometry.coordinates)[0]),y:_e(i[1]),zoom:1/0,index:o,parentId:-1}));this.trees[this.options.maxZoom+1]=de(a,be,Te,this.options.nodeSize,Float32Array),t&&console.timeEnd(r);for(var l=this.options.maxZoom;l>=this.options.minZoom;l--){var u=+Date.now();a=this._cluster(a,l),this.trees[l]=de(a,be,Te,this.options.nodeSize,Float32Array),t&&console.log("z%d: %d clusters in %dms",l,a.length,+Date.now()-u);}return t&&console.timeEnd("total time"),this},getClusters:function(e,t){var r=((e[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[1])),o=180===e[2]?180:((e[2]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,o=180;else if(r>o){var a=this.getClusters([r,n,180,i],t),s=this.getClusters([-180,n,o,i],t);return a.concat(s)}for(var l=this.trees[this._limitZoom(t)],u=l.range(Se(r),_e(i),Se(o),_e(n)),h=[],c=0;c<u.length;c++){var f=l.points[u[c]];h.push(f.numPoints?we(f):this.points[f.index]);}return h},getChildren:function(e){var t=e>>5,r=e%32,n="No cluster with the specified id.",o=this.trees[r];if(!o)throw new Error(n);var i=o.points[t];if(!i)throw new Error(n);for(var a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=o.within(i.x,i.y,a),l=[],u=0;u<s.length;u++){var h=o.points[s[u]];h.parentId===e&&l.push(h.numPoints?we(h):this.points[h.index]);}if(0===l.length)throw new Error(n);return l},getLeaves:function(e,t,r){t=t||10,r=r||0;var n=[];return this._appendLeaves(n,e,t,r,0),n},getTile:function(e,t,r){var n=this.trees[this._limitZoom(e)],o=Math.pow(2,e),i=this.options.extent,a=this.options.radius/i,s=(r-a)/o,l=(r+1+a)/o,u={features:[]};return this._addTileFeatures(n.range((t-a)/o,s,(t+1+a)/o,l),n.points,t,r,o,u),0===t&&this._addTileFeatures(n.range(1-a/o,s,1,l),n.points,o,r,o,u),t===o-1&&this._addTileFeatures(n.range(0,s,a/o,l),n.points,-1,r,o,u),u.features.length?u:null},getClusterExpansionZoom:function(e){for(var t=e%32-1;t<this.options.maxZoom;){var r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id;}return t},_appendLeaves:function(e,t,r,n,o){for(var i=this.getChildren(t),a=0;a<i.length;a++){var s=i[a].properties;if(s&&s.cluster?o+s.point_count<=n?o+=s.point_count:o=this._appendLeaves(e,s.cluster_id,r,n,o):o<n?o++:e.push(i[a]),e.length===r)break}return o},_addTileFeatures:function(e,t,r,n,o,i){for(var a=0;a<e.length;a++){var s=t[e[a]],l={type:1,geometry:[[Math.round(this.options.extent*(s.x*o-r)),Math.round(this.options.extent*(s.y*o-n))]],tags:s.numPoints?Me(s):this.points[s.index].properties},u=s.numPoints?s.id:this.points[s.index].id;void 0!==u&&(l.id=u),i.features.push(l);}},_limitZoom:function(e){return Math.max(this.options.minZoom,Math.min(e,this.options.maxZoom+1))},_cluster:function(e,t){for(var r=[],n=this.options.radius/(this.options.extent*Math.pow(2,t)),o=0;o<e.length;o++){var i=e[o];if(!(i.zoom<=t)){i.zoom=t;var a=this.trees[t+1],s=a.within(i.x,i.y,n),l=i.numPoints||1,u=i.x*l,h=i.y*l,c=null;this.options.reduce&&(c=this.options.initial(),this._accumulate(c,i));for(var f=(o<<5)+(t+1),p=0;p<s.length;p++){var d=a.points[s[p]];if(!(d.zoom<=t)){d.zoom=t;var g=d.numPoints||1;u+=d.x*g,h+=d.y*g,l+=g,d.parentId=f,this.options.reduce&&this._accumulate(c,d);}}1===l?r.push(i):(i.parentId=f,r.push(xe(u/l,h/l,f,l,c)));}}return r},_accumulate:function(e,t){var r=t.numPoints?t.properties:this.options.map(this.points[t.index].properties);this.options.reduce(e,r);}},He.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},He.prototype.splitTile=function(e,t,r,n,o,i,a){for(var s=[e,t,r,n],l=this.options,u=l.debug;s.length;){n=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();var h=1<<t,c=Qe(t,r,n),f=this.tiles[c];if(!f&&(u>1&&console.time("creation"),f=this.tiles[c]=qe(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var p="z"+t;this.stats[p]=(this.stats[p]||0)+1,this.total++;}if(f.source=e,o){if(t===l.maxZoom||t===o)continue;var d=1<<o-t;if(r!==Math.floor(i/d)||n!==Math.floor(a/d))continue}else if(t===l.indexMaxZoom||f.numPoints<=l.indexMaxPoints)continue;if(f.source=null,0!==e.length){u>1&&console.time("clipping");var g,m,v,y,x,w,M=.5*l.buffer/l.extent,S=.5-M,_=.5+M,P=1+M;g=m=v=y=null,x=Ne(e,h,r-M,r+_,0,f.minX,f.maxX,l),w=Ne(e,h,r+S,r+P,0,f.minX,f.maxX,l),e=null,x&&(g=Ne(x,h,n-M,n+_,1,f.minY,f.maxY,l),m=Ne(x,h,n+S,n+P,1,f.minY,f.maxY,l),x=null),w&&(v=Ne(w,h,n-M,n+_,1,f.minY,f.maxY,l),y=Ne(w,h,n+S,n+P,1,f.minY,f.maxY,l),w=null),u>1&&console.timeEnd("clipping"),s.push(g||[],t+1,2*r,2*n),s.push(m||[],t+1,2*r,2*n+1),s.push(v||[],t+1,2*r+1,2*n),s.push(y||[],t+1,2*r+1,2*n+1);}}},He.prototype.getTile=function(e,t,r){var n=this.options,o=n.extent,i=n.debug;if(e<0||e>24)return null;var a=1<<e,s=Qe(e,t=(t%a+a)%a,r);if(this.tiles[s])return We(this.tiles[s],o);i>1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,u=e,h=t,c=r;!l&&u>0;)u--,h=Math.floor(h/2),c=Math.floor(c/2),l=this.tiles[Qe(u,h,c)];return l&&l.source?(i>1&&console.log("found parent tile z%d-%d-%d",u,h,c),i>1&&console.time("drilling down"),this.splitTile(l.source,u,h,c,e,t,r),i>1&&console.timeEnd("drilling down"),this.tiles[s]?We(this.tiles[s],o):null):null};var et=function(t){function r(e,r,n){t.call(this,e,r,$e),n&&(this.loadGeoJSON=n);}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData());},r.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var t=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var n=!!(r&&r.request&&r.request.collectResourceTiming)&&new E.Performance(r.request);this.loadGeoJSON(r,function(o,i){if(o||!i)return t(o);if("object"!=typeof i)return t(new Error("Input data is not a valid GeoJSON object."));j(i,!0);try{e._geoJSONIndex=r.cluster?(a=r.superclusterOptions,new ye(a)).load(i.features):function(e,t){return new He(e,t)}(i,r.geojsonVtOptions);}catch(o){return t(o)}e.loaded={};var a,s={};if(n){var l=n.finish();l&&(s.resourceTiming={},s.resourceTiming[r.source]=JSON.parse(JSON.stringify(l)));}t(null,s);});}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData());},r.prototype.reloadTile=function(e,r){var n=this.loaded,o=e.uid;return n&&n[o]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},r.prototype.loadGeoJSON=function(t,r){if(t.request)e.getJSON(t.request,r);else{if("string"!=typeof t.data)return r(new Error("Input data is not a valid GeoJSON object."));try{return r(null,JSON.parse(t.data))}catch(e){return r(new Error("Input data is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t();},r.prototype.getClusterExpansionZoom=function(e,t){t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId));},r.prototype.getClusterChildren=function(e,t){t(null,this._geoJSONIndex.getChildren(e.clusterId));},r.prototype.getClusterLeaves=function(e,t){t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset));},r}(D),tt=function(t){var r=this;this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.workerSourceTypes={vector:D,geojson:et},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(e,t){if(r.workerSourceTypes[e])throw new Error('Worker source with name "'+e+'" already registered.');r.workerSourceTypes[e]=t;},this.self.registerRTLTextPlugin=function(t){if(e.plugin.isLoaded())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText;};};return tt.prototype.setLayers=function(e,t,r){this.getLayerIndex(e).replace(t),r();},tt.prototype.updateLayers=function(e,t,r){this.getLayerIndex(e).update(t.layers,t.removedIds),r();},tt.prototype.loadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).loadTile(t,r);},tt.prototype.loadDEMTile=function(e,t,r){this.getDEMWorkerSource(e,t.source).loadTile(t,r);},tt.prototype.reloadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).reloadTile(t,r);},tt.prototype.abortTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).abortTile(t,r);},tt.prototype.removeTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).removeTile(t,r);},tt.prototype.removeDEMTile=function(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t);},tt.prototype.removeSource=function(e,t,r){if(this.workerSources[e]&&this.workerSources[e][t.type]&&this.workerSources[e][t.type][t.source]){var n=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==n.removeSource?n.removeSource(t,r):r();}},tt.prototype.loadWorkerSource=function(e,t,r){try{this.self.importScripts(t.url),r();}catch(e){r(e.toString());}},tt.prototype.loadRTLTextPlugin=function(t,r,n){try{e.plugin.isLoaded()||(this.self.importScripts(r),n(e.plugin.isLoaded()?null:new Error("RTL Text Plugin failed to import scripts from "+r)));}catch(e){n(e.toString());}},tt.prototype.getLayerIndex=function(e){var t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new n),t},tt.prototype.getWorkerSource=function(e,t,r){var n=this;if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){var o={send:function(t,r,o){n.actor.send(t,r,o,e);}};this.workerSources[e][t][r]=new this.workerSourceTypes[t](o,this.getLayerIndex(e));}return this.workerSources[e][t][r]},tt.prototype.getDEMWorkerSource=function(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new O),this.demWorkerSources[e][t]},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&new tt(self),tt});
+
+define(["./shared.js"],function(t){"use strict";var e=t.createCommonjsModule(function(t){function e(t){return !!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return !1;var t,e,i=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(i);try{e=new Worker(n),t=!0;}catch(e){t=!1;}e&&e.terminate();return URL.revokeObjectURL(n),t}()&&"Uint8ClampedArray"in window&&ArrayBuffer.isView&&function(t){void 0===i[t]&&(i[t]=function(t){var i=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,i.probablySupportsContext?i.probablySupportsContext("webgl",n)||i.probablySupportsContext("experimental-webgl",n):i.supportsContext?i.supportsContext("webgl",n)||i.supportsContext("experimental-webgl",n):i.getContext("webgl",n)||i.getContext("experimental-webgl",n)}(t));return i[t]}(t&&t.failIfMajorPerformanceCaveat))}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e);var i={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};}),i={create:function(e,i,n){var o=t.window.document.createElement(e);return i&&(o.className=i),n&&n.appendChild(o),o},createNS:function(e,i){return t.window.document.createElementNS(e,i)}},n=t.window.document?t.window.document.documentElement.style:null;function o(t){if(!n)return null;for(var e=0;e<t.length;e++)if(t[e]in n)return t[e];return t[0]}var r,a=o(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);i.disableDrag=function(){n&&a&&(r=n[a],n[a]="none");},i.enableDrag=function(){n&&a&&(n[a]=r);};var s=o(["transform","WebkitTransform"]);i.setTransform=function(t,e){t.style[s]=e;};var l=!1;try{var c=Object.defineProperty({},"passive",{get:function(){l=!0;}});t.window.addEventListener("test",c,c),t.window.removeEventListener("test",c,c);}catch(t){l=!1;}i.addEventListener=function(t,e,i,n){void 0===n&&(n={}),"passive"in n&&l?t.addEventListener(e,i,n):t.addEventListener(e,i,n.capture);},i.removeEventListener=function(t,e,i,n){void 0===n&&(n={}),"passive"in n&&l?t.removeEventListener(e,i,n):t.removeEventListener(e,i,n.capture);};var h=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",h,!0);};i.suppressClick=function(){t.window.addEventListener("click",h,!0),t.window.setTimeout(function(){t.window.removeEventListener("click",h,!0);},0);},i.mousePos=function(e,i){var n=e.getBoundingClientRect();return i=i.touches?i.touches[0]:i,new t.Point(i.clientX-n.left-e.clientLeft,i.clientY-n.top-e.clientTop)},i.touchPos=function(e,i){for(var n=e.getBoundingClientRect(),o=[],r="touchend"===i.type?i.changedTouches:i.touches,a=0;a<r.length;a++)o.push(new t.Point(r[a].clientX-n.left-e.clientLeft,r[a].clientY-n.top-e.clientTop));return o},i.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},i.remove=function(t){t.parentNode&&t.parentNode.removeChild(t);};var u={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return 0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":"https://events.mapbox.com/events/v2"},REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null},p="See https://www.mapbox.com/api-documentation/#access-tokens";function d(t,e){var i=b(u.API_URL);if(t.protocol=i.protocol,t.authority=i.authority,"/"!==i.path&&(t.path=""+i.path+t.path),!u.REQUIRE_ACCESS_TOKEN)return w(t);if(!(e=e||u.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+p);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+p);return t.params.push("access_token="+e),w(t)}function f(t){return 0===t.indexOf("mapbox:")}var _=function(t,e){if(!f(t))return t;var i=b(t);return i.path="/fonts/v1"+i.path,d(i,e)},m=function(t,e){if(!f(t))return t;var i=b(t);return i.path="/v4/"+i.authority+".json",i.params.push("secure"),d(i,e)},g=function(t,e,i,n){var o=b(t);return f(t)?(o.path="/styles/v1"+o.path+"/sprite"+e+i,d(o,n)):(o.path+=""+e+i,w(o))},v=/(\.(png|jpg)\d*)(?=$)/,y=function(e,i,n){if(!i||!f(i))return e;var o=b(e),r=t.browser.devicePixelRatio>=2||512===n?"@2x":"",a=t.browser.supportsWebp?".webp":"$1";return o.path=o.path.replace(v,""+r+a),function(t){for(var e=0;e<t.length;e++)0===t[e].indexOf("access_token=tk.")&&(t[e]="access_token="+(u.ACCESS_TOKEN||""));}(o.params),w(o)};var x=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function b(t){var e=t.match(x);if(!e)throw new Error("Unable to parse URL object");return {protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function w(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}var E=function(){this.eventData={anonId:null,lastSuccess:null,accessToken:u.ACCESS_TOKEN},this.queue=[],this.pending=!1,this.pendingRequest=null;};E.prototype.postTurnstileEvent=function(t){u.ACCESS_TOKEN&&Array.isArray(t)&&t.some(function(t){return /(mapbox\.c)(n|om)/i.test(t)})&&this.queueRequest(Date.now());},E.prototype.queueRequest=function(t){this.queue.push(t),this.processRequests();},E.prototype.processRequests=function(){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var i="mapbox.turnstileEventData:"+(u.ACCESS_TOKEN||""),n=t.storageAvailable("localStorage"),o=!!this.eventData.accessToken&&this.eventData.accessToken!==u.ACCESS_TOKEN;if(o&&(this.eventData.anonId=this.eventData.lastSuccess=null),(!this.eventData.anonId||!this.eventData.lastSuccess)&&n)try{var r=t.window.localStorage.getItem(i);r&&(this.eventData=JSON.parse(r));}catch(e){t.warnOnce("Unable to read from LocalStorage");}t.validateUuid(this.eventData.anonId)||(this.eventData.anonId=t.uuid(),o=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var s=new Date(this.eventData.lastSuccess),l=new Date(a),c=(a-this.eventData.lastSuccess)/864e5;o=o||c>=1||c<-1||s.getDate()!==l.getDate();}if(!o)return this.processRequests();var h=b(u.EVENTS_URL);h.params.push("access_token="+(u.ACCESS_TOKEN||""));var p={url:w(h),headers:{"Content-Type":"text/plain"}},d=JSON.stringify([{event:"appUserTurnstile",created:new Date(a).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"0.50.0","enabled.telemetry":!1,userId:this.eventData.anonId}]);this.pendingRequest=t.postData(p,d,function(o){if(e.pendingRequest=null,!o){if(e.eventData.lastSuccess=a,e.eventData.accessToken=u.ACCESS_TOKEN,n)try{t.window.localStorage.setItem(i,JSON.stringify(e.eventData));}catch(e){t.warnOnce("Unable to write to LocalStorage");}e.processRequests();}});}};var T=new E,S=T.postTurnstileEvent.bind(T);var C=function(){this.images={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0;};C.prototype.isLoaded=function(){return this.loaded},C.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,i=this.requestors;e<i.length;e+=1){var n=i[e],o=n.ids,r=n.callback;this._notify(o,r);}this.requestors=[];}},C.prototype.getImage=function(t){return this.images[t]},C.prototype.addImage=function(t,e){this.images[t]=e;},C.prototype.removeImage=function(t){delete this.images[t],delete this.patterns[t];},C.prototype.listImages=function(){return Object.keys(this.images)},C.prototype.getImages=function(t,e){var i=!0;if(!this.isLoaded())for(var n=0,o=t;n<o.length;n+=1){var r=o[n];this.images[r]||(i=!1);}this.isLoaded()||i?this._notify(t,e):this.requestors.push({ids:t,callback:e});},C.prototype._notify=function(t,e){for(var i={},n=0,o=t;n<o.length;n+=1){var r=o[n],a=this.images[r];a&&(i[r]={data:a.data.clone(),pixelRatio:a.pixelRatio,sdf:a.sdf});}e(null,i);},C.prototype.getPixelSize=function(){var t=this.atlasImage;return {width:t.width,height:t.height}},C.prototype.getPattern=function(e){var i=this.patterns[e];if(i)return i.position;var n=this.getImage(e);if(!n)return null;var o={w:n.data.width+2,h:n.data.height+2,x:0,y:0},r=new t.ImagePosition(o,n);return this.patterns[e]={bin:o,position:r},this._updatePatternAtlas(),r},C.prototype.bind=function(e){var i=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,i.RGBA),this.atlasTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE);},C.prototype._updatePatternAtlas=function(){var e=[];for(var i in this.patterns)e.push(this.patterns[i].bin);var n=t.potpack(e),o=n.w,r=n.h,a=this.atlasImage;for(var s in a.resize({width:o||1,height:r||1}),this.patterns){var l=this.patterns[s].bin,c=l.x+1,h=l.y+1,u=this.images[s].data,p=u.width,d=u.height;t.RGBAImage.copy(u,a,{x:0,y:0},{x:c,y:h},{width:p,height:d}),t.RGBAImage.copy(u,a,{x:0,y:d-1},{x:c,y:h-1},{width:p,height:1}),t.RGBAImage.copy(u,a,{x:0,y:0},{x:c,y:h+d},{width:p,height:1}),t.RGBAImage.copy(u,a,{x:p-1,y:0},{x:c-1,y:h},{width:1,height:d}),t.RGBAImage.copy(u,a,{x:0,y:0},{x:c+p,y:h},{width:1,height:d});}this.dirty=!0;};var I=P,z=1e20;function P(t,e,i,n,o,r){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=o||"sans-serif",this.fontWeight=r||"normal",this.radius=i||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1));}function D(t,e,i,n,o,r,a){for(var s=0;s<e;s++){for(var l=0;l<i;l++)n[l]=t[l*e+s];for(R(n,o,r,a,i),l=0;l<i;l++)t[l*e+s]=o[l];}for(l=0;l<i;l++){for(s=0;s<e;s++)n[s]=t[l*e+s];for(R(n,o,r,a,e),s=0;s<e;s++)t[l*e+s]=Math.sqrt(o[s]);}}function R(t,e,i,n,o){i[0]=0,n[0]=-z,n[1]=+z;for(var r=1,a=0;r<o;r++){for(var s=(t[r]+r*r-(t[i[a]]+i[a]*i[a]))/(2*r-2*i[a]);s<=n[a];)a--,s=(t[r]+r*r-(t[i[a]]+i[a]*i[a]))/(2*r-2*i[a]);i[++a]=r,n[a]=s,n[a+1]=+z;}for(r=0,a=0;r<o;r++){for(;n[a+1]<r;)a++;e[r]=(r-i[a])*(r-i[a])+t[i[a]];}}P.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),i=new Uint8ClampedArray(this.size*this.size),n=0;n<this.size*this.size;n++){var o=e.data[4*n+3]/255;this.gridOuter[n]=1===o?0:0===o?z:Math.pow(Math.max(0,.5-o),2),this.gridInner[n]=1===o?z:0===o?0:Math.pow(Math.max(0,o-.5),2);}for(D(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),D(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++){var r=this.gridOuter[n]-this.gridInner[n];i[n]=Math.max(0,Math.min(255,Math.round(255-255*(r/this.radius+this.cutoff))));}return i};var L=function(t,e){this.requestTransform=t,this.localIdeographFontFamily=e,this.entries={};};L.prototype.setURL=function(t){this.url=t;},L.prototype.getGlyphs=function(e,i){var n=this,o=[];for(var r in e)for(var a=0,s=e[r];a<s.length;a+=1){var l=s[a];o.push({stack:r,id:l});}t.asyncAll(o,function(t,e){var i=t.stack,o=t.id,r=n.entries[i];r||(r=n.entries[i]={glyphs:{},requests:{}});var a=r.glyphs[o];if(void 0===a)if(a=n._tinySDF(r,i,o))e(null,{stack:i,id:o,glyph:a});else{var s=Math.floor(o/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else{var l=r.requests[s];l||(l=r.requests[s]=[],L.loadGlyphRange(i,s,n.url,n.requestTransform,function(t,e){if(e)for(var i in e)r.glyphs[+i]=e[+i];for(var n=0,o=l;n<o.length;n+=1){(0,o[n])(t,e);}delete r.requests[s];})),l.push(function(t,n){t?e(t):n&&e(null,{stack:i,id:o,glyph:n[o]||null});});}}else e(null,{stack:i,id:o,glyph:a});},function(t,e){if(t)i(t);else if(e){for(var n={},o=0,r=e;o<r.length;o+=1){var a=r[o],s=a.stack,l=a.id,c=a.glyph;(n[s]||(n[s]={}))[l]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.metrics};}i(null,n);}});},L.prototype._tinySDF=function(e,i,n){var o=this.localIdeographFontFamily;if(o&&(t.isChar["CJK Unified Ideographs"](n)||t.isChar["Hangul Syllables"](n))){var r=e.tinySDF;if(!r){var a="400";/bold/i.test(i)?a="900":/medium/i.test(i)?a="500":/light/i.test(i)&&(a="200"),r=e.tinySDF=new L.TinySDF(24,3,8,.25,o,a);}return {id:n,bitmap:new t.AlphaImage({width:30,height:30},r.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},L.loadGlyphRange=function(e,i,n,o,r){var a=256*i,s=a+255,l=o(_(n).replace("{fontstack}",e).replace("{range}",a+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(l,function(e,i){if(e)r(e);else if(i){for(var n={},o=0,a=t.parseGlyphPBF(i.data);o<a.length;o+=1){var s=a[o];n[s.id]=s;}r(null,n);}});},L.TinySDF=I;var A=function(){this.specification=t.styleSpec.light.position;};A.prototype.possiblyEvaluate=function(e,i){return t.sphericalToCartesian(e.expression.evaluate(i))},A.prototype.interpolate=function(e,i,n){return {x:t.number(e.x,i.x,n),y:t.number(e.y,i.y,n),z:t.number(e.z,i.z,n)}};var M=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new A,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),k=function(e){function i(i){e.call(this),this._transitionable=new t.Transitionable(M),this.setLight(i),this._transitioning=this._transitionable.untransitioned();}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.getLight=function(){return this._transitionable.serialize()},i.prototype.setLight=function(e){if(!this._validate(t.validateLight,e))for(var i in e){var n=e[i];t.endsWith(i,"-transition")?this._transitionable.setTransition(i.slice(0,-"-transition".length),n):this._transitionable.setValue(i,n);}},i.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning);},i.prototype.hasTransition=function(){return this._transitioning.hasTransition()},i.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t);},i.prototype._validate=function(e,i){return t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:i,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},i}(t.Evented),B=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={};};B.prototype.getDash=function(t,e){var i=t.join(",")+String(e);return this.positions[i]||(this.positions[i]=this.addDash(t,e)),this.positions[i]},B.prototype.addDash=function(e,i){var n=i?7:0,o=2*n+1;if(this.nextRow+o>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var r=0,a=0;a<e.length;a++)r+=e[a];for(var s=this.width/r,l=s/2,c=e.length%2==1,h=-n;h<=n;h++)for(var u=this.nextRow+n+h,p=this.width*u,d=c?-e[e.length-1]:0,f=e[0],_=1,m=0;m<this.width;m++){for(;f<m/s;)d=f,f+=e[_],c&&_===e.length-1&&(f+=e[0]),_++;var g=Math.abs(m-d*s),v=Math.abs(m-f*s),y=Math.min(g,v),x=_%2==1,b=void 0;if(i){var w=n?h/n*(l+1):0;if(x){var E=l-Math.abs(w);b=Math.sqrt(y*y+E*E);}else b=l-Math.sqrt(y*y+w*w);}else b=(x?1:-1)*y;this.data[3+4*(p+m)]=Math.max(0,Math.min(255,b+128));}var T={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:r};return this.nextRow+=o,this.dirty=!0,T},B.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.RGBA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,this.width,this.height,0,e.RGBA,e.UNSIGNED_BYTE,this.data));};var O=function e(i,n){this.workerPool=i,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var o=this.workerPool.acquire(this.id),r=0;r<o.length;r++){var a=o[r],s=new e.Actor(a,n,this.id);s.name="Worker "+r,this.actors.push(s);}};function F(e,i,n){var o=function(e,i){if(e)return n(e);if(i){var o=t.pick(i,["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds"]);i.vector_layers&&(o.vectorLayers=i.vector_layers,o.vectorLayerIds=o.vectorLayers.map(function(t){return t.id})),n(null,o);}};return e.url?t.getJSON(i(m(e.url),t.ResourceType.Source),o):t.browser.frame(function(){return o(null,e)})}O.prototype.broadcast=function(e,i,n){n=n||function(){},t.asyncAll(this.actors,function(t,n){t.send(e,i,n);},n);},O.prototype.send=function(t,e,i,n){return ("number"!=typeof n||isNaN(n))&&(n=this.currentActor=(this.currentActor+1)%this.actors.length),this.actors[n].send(t,e,i),n},O.prototype.remove=function(){this.actors.forEach(function(t){t.remove();}),this.actors=[],this.workerPool.release(this.id);},O.Actor=t.Actor;var U=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};U.prototype.wrap=function(){return new U(t.wrap(this.lng,-180,180),this.lat)},U.prototype.toArray=function(){return [this.lng,this.lat]},U.prototype.toString=function(){return "LngLat("+this.lng+", "+this.lat+")"},U.prototype.toBounds=function(t){var e=360*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return new N(new U(this.lng-i,this.lat-e),new U(this.lng+i,this.lat+e))},U.convert=function(t){if(t instanceof U)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new U(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new U(Number(t.lng),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var N=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]));};N.prototype.setNorthEast=function(t){return this._ne=t instanceof U?new U(t.lng,t.lat):U.convert(t),this},N.prototype.setSouthWest=function(t){return this._sw=t instanceof U?new U(t.lng,t.lat):U.convert(t),this},N.prototype.extend=function(t){var e,i,n=this._sw,o=this._ne;if(t instanceof U)e=t,i=t;else{if(!(t instanceof N))return Array.isArray(t)?t.every(Array.isArray)?this.extend(N.convert(t)):this.extend(U.convert(t)):this;if(e=t._sw,i=t._ne,!e||!i)return this}return n||o?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),o.lng=Math.max(i.lng,o.lng),o.lat=Math.max(i.lat,o.lat)):(this._sw=new U(e.lng,e.lat),this._ne=new U(i.lng,i.lat)),this},N.prototype.getCenter=function(){return new U((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},N.prototype.getSouthWest=function(){return this._sw},N.prototype.getNorthEast=function(){return this._ne},N.prototype.getNorthWest=function(){return new U(this.getWest(),this.getNorth())},N.prototype.getSouthEast=function(){return new U(this.getEast(),this.getSouth())},N.prototype.getWest=function(){return this._sw.lng},N.prototype.getSouth=function(){return this._sw.lat},N.prototype.getEast=function(){return this._ne.lng},N.prototype.getNorth=function(){return this._ne.lat},N.prototype.toArray=function(){return [this._sw.toArray(),this._ne.toArray()]},N.prototype.toString=function(){return "LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},N.prototype.isEmpty=function(){return !(this._sw&&this._ne)},N.convert=function(t){return !t||t instanceof N?t:new N(t)};var Z=function(t,e,i){this.bounds=N.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=i||24;};Z.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},Z.prototype.contains=function(t){var e=Math.floor(this.lngX(this.bounds.getWest(),t.z)),i=Math.floor(this.latY(this.bounds.getNorth(),t.z)),n=Math.ceil(this.lngX(this.bounds.getEast(),t.z)),o=Math.ceil(this.latY(this.bounds.getSouth(),t.z));return t.x>=e&&t.x<n&&t.y>=i&&t.y<o},Z.prototype.lngX=function(t,e){return (t+180)*(Math.pow(2,e)/360)},Z.prototype.latY=function(e,i){var n=t.clamp(Math.sin(Math.PI/180*e),-.9999,.9999),o=Math.pow(2,i)/(2*Math.PI);return Math.pow(2,i-1)+.5*Math.log((1+n)/(1-n))*-o};var q=function(e){function i(i,n,o,r){if(e.call(this),this.id=i,this.dispatcher=o,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,t.extend(this,t.pick(n,["url","scheme","tileSize"])),this._options=t.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(r);}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=F(this._options,this.map._transformRequest,function(i,n){e._tileJSONRequest=null,i?e.fire(new t.ErrorEvent(i)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new Z(n.bounds,e.minzoom,e.maxzoom)),S(n.tiles),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})));});},i.prototype.hasTile=function(t){return !this.tileBounds||this.tileBounds.contains(t.canonical)},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);},i.prototype.serialize=function(){return t.extend({},this._options)},i.prototype.loadTile=function(e,i){var n=y(e.tileID.canonical.url(this.tiles,this.scheme),this.url),o={request:this.map._transformRequest(n,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};function r(t,n){return e.aborted?i(null):t&&404!==t.status?i(t):(n&&n.resourceTiming&&(e.resourceTiming=n.resourceTiming),this.map._refreshExpiredTiles&&n&&e.setExpiryData(n),e.loadVectorData(n,this.map.painter),i(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}o.request.collectResourceTiming=this._collectResourceTiming,void 0===e.workerID||"expired"===e.state?e.workerID=this.dispatcher.send("loadTile",o,r.bind(this)):"loading"===e.state?e.reloadCallback=i:this.dispatcher.send("reloadTile",o,r.bind(this),e.workerID);},i.prototype.abortTile=function(t){this.dispatcher.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID);},i.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0,t.workerID);},i.prototype.hasTransition=function(){return !1},i}(t.Evented),V=function(e){function i(i,n,o,r){e.call(this),this.id=i,this.dispatcher=o,this.setEventedParent(r),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({},n),t.extend(this,t.pick(n,["url","scheme","tileSize"]));}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=F(this._options,this.map._transformRequest,function(i,n){e._tileJSONRequest=null,i?e.fire(new t.ErrorEvent(i)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new Z(n.bounds,e.minzoom,e.maxzoom)),S(n.tiles),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})));});},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);},i.prototype.serialize=function(){return t.extend({},this._options)},i.prototype.hasTile=function(t){return !this.tileBounds||this.tileBounds.contains(t.canonical)},i.prototype.loadTile=function(e,i){var n=this,o=y(e.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);e.request=t.getImage(this.map._transformRequest(o,t.ResourceType.Tile),function(o,r){if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(o)e.state="errored",i(o);else if(r){n.map._refreshExpiredTiles&&e.setExpiryData(r),delete r.cacheControl,delete r.expires;var a=n.map.painter.context,s=a.gl;e.texture=n.map.painter.getTileTexture(r.width),e.texture?e.texture.update(r,{useMipmap:!0}):(e.texture=new t.Texture(a,r,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),e.state="loaded",i(null);}});},i.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e();},i.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e();},i.prototype.hasTransition=function(){return !1},i}(t.Evented),j=function(e){function i(i,n,o,r){e.call(this,i,n,o,r),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({},n),this.encoding=n.encoding||"mapbox";}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.serialize=function(){return {type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},i.prototype.loadTile=function(e,i){var n=y(e.tileID.canonical.url(this.tiles,this.scheme),this.url,this.tileSize);e.request=t.getImage(this.map._transformRequest(n,t.ResourceType.Tile),function(n,o){if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(n)e.state="errored",i(n);else if(o){this.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var r=t.browser.getImageData(o),a={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:r,encoding:this.encoding};e.workerID&&"expired"!==e.state||(e.workerID=this.dispatcher.send("loadDEMTile",a,function(t,n){t&&(e.state="errored",i(t));n&&(e.dem=n,e.needsHillshadePrepare=!0,e.state="loaded",i(null));}.bind(this)));}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID);},i.prototype._getNeighboringTiles=function(e){var i=e.canonical,n=Math.pow(2,i.z),o=(i.x-1+n)%n,r=0===i.x?e.wrap-1:e.wrap,a=(i.x+1+n)%n,s=i.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,r,i.z,o,i.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y).key]={backfilled:!1},i.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,r,i.z,o,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y-1).key]={backfilled:!1}),i.y+1<n&&(l[new t.OverscaledTileID(e.overscaledZ,r,i.z,o,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,a,i.y+1).key]={backfilled:!1}),l},i.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",this.dispatcher.send("removeDEMTile",{uid:t.uid,source:this.id},void 0,t.workerID);},i}(V),G=function(e){function i(i,n,o,r){e.call(this),this.id=i,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this.dispatcher=o,this.setEventedParent(r),this._data=n.data,this._options=t.extend({},n),this._collectResourceTiming=n.collectResourceTiming,this._resourceTiming=[],void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution);var a=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*a,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*a,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?Math.min(n.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,extent:t.EXTENT,radius:(n.clusterRadius||50)*a,log:!1}},n.workerOptions);}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(i){if(i)e.fire(new t.ErrorEvent(i));else{var n={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n));}});},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.setData=function(e){var i=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(e){if(e)i.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};i._collectResourceTiming&&i._resourceTiming&&i._resourceTiming.length>0&&(n.resourceTiming=i._resourceTiming,i._resourceTiming=[]),i.fire(new t.Event("data",n));}}),this},i.prototype.getClusterExpansionZoom=function(t,e){return this.dispatcher.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e,this.workerID),this},i.prototype.getClusterChildren=function(t,e){return this.dispatcher.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e,this.workerID),this},i.prototype.getClusterLeaves=function(t,e,i,n){return this.dispatcher.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},n,this.workerID),this},i.prototype._updateWorkerData=function(e){var i=this,n=t.extend({},this.workerOptions),o=this._data;"string"==typeof o?(n.request=this.map._transformRequest(t.browser.resolveURL(o),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(o),this.workerID=this.dispatcher.send(this.type+".loadData",n,function(t,o){i._removed||o&&o.abandoned||(i._loaded=!0,o&&o.resourceTiming&&o.resourceTiming[i.id]&&(i._resourceTiming=o.resourceTiming[i.id].slice(0)),i.dispatcher.send(i.type+".coalesce",{source:n.source},null,i.workerID),e(t));},this.workerID);},i.prototype.loadTile=function(e,i){var n=this,o=void 0===e.workerID?"loadTile":"reloadTile",r={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};e.workerID=this.dispatcher.send(o,r,function(t,r){return e.unloadVectorData(),e.aborted?i(null):t?i(t):(e.loadVectorData(r,n.map.painter,"reloadTile"===o),i(null))},this.workerID);},i.prototype.abortTile=function(t){t.aborted=!0;},i.prototype.unloadTile=function(t){t.unloadVectorData(),this.dispatcher.send("removeTile",{uid:t.uid,type:this.type,source:this.id},null,t.workerID);},i.prototype.onRemove=function(){this._removed=!0,this.dispatcher.send("removeSource",{type:this.type,source:this.id},null,this.workerID);},i.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},i.prototype.hasTransition=function(){return !1},i}(t.Evented),W=function(e){function i(t,i,n,o){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=i.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this.setEventedParent(o),this.options=i;}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.load=function(e,i){var n=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._transformRequest(this.url,t.ResourceType.Image),function(o,r){o?n.fire(new t.ErrorEvent(o)):r&&(n.image=t.browser.getImageData(r),e&&(n.coordinates=e),i&&i(),n._finishLoading());});},i.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,function(){e.texture=null;}),this):this},i.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})));},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.setCoordinates=function(e){this.coordinates=e;var i=this.map,n=e.map(function(t){return i.transform.locationCoordinate(U.convert(t)).zoomTo(0)}),o=this.centerCoord=t.getCoordinatesCenter(n);o.column=Math.floor(o.column),o.row=Math.floor(o.row),this.tileID=new t.CanonicalTileID(o.zoom,o.column,o.row),this.minzoom=this.maxzoom=o.zoom;var r=n.map(function(e){var i=e.zoomTo(o.zoom);return new t.Point(Math.round((i.column-o.column)*t.EXTENT),Math.round((i.row-o.row)*t.EXTENT))});return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(r[0].x,r[0].y,0,0),this._boundsArray.emplaceBack(r[1].x,r[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(r[3].x,r[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(r[2].x,r[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},i.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,i=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var o=this.tiles[n];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture);}}},i.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null));},i.prototype.serialize=function(){return {type:"image",url:this.options.url,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return !1},i}(t.Evented),X=function(e){function i(t,i,n,o){e.call(this,t,i,n,o),this.roundZoom=!0,this.type="video",this.options=i;}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.load=function(){var e=this,i=this.options;this.urls=[];for(var n=0,o=i.urls;n<o.length;n+=1){var r=o[n];e.urls.push(e.map._transformRequest(r,t.ResourceType.Source).url);}t.getVideo(this.urls,function(i,n){i?e.fire(new t.ErrorEvent(i)):n&&(e.video=n,e.video.loop=!0,e.video.addEventListener("playing",function(){e.map.triggerRepaint();}),e.map&&e.video.play(),e._finishLoading());});},i.prototype.getVideo=function(){return this.video},i.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)));},i.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,i=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var o=this.tiles[n];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture);}}},i.prototype.serialize=function(){return {type:"video",urls:this.urls,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this.video&&!this.video.paused},i}(W),H=function(e){function i(i,n,o,r){e.call(this,i,n,o,r),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some(function(t){return !Array.isArray(t)||2!==t.length||t.some(function(t){return "number"!=typeof t})})||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,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.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate;}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.load=function(){this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint();},this.pause=function(){this._playing=!1;},this._finishLoading());},i.prototype.getCanvas=function(){return this.canvas},i.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play();},i.prototype.onRemove=function(){this.pause();},i.prototype.prepare=function(){var 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()&&0!==Object.keys(this.tiles).length){var i=this.map.painter.context,n=i.gl;for(var o in this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(i,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var r=this.tiles[o];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture);}}},i.prototype.serialize=function(){return {type:"canvas",coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this._playing},i.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var i=e[t];if(isNaN(i)||i<=0)return !0}return !1},i}(W),K={vector:q,raster:V,"raster-dem":j,geojson:G,video:X,image:W,canvas:H},Y=function(e,i,n,o){var r=new K[i.type](e,i,n,o);if(r.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+r.id);return t.bindAll(["load","abort","unload","serialize","prepare"],r),r};function J(t,e,i,n,o){var r=o.maxPitchScaleFactor(),a=t.tilesIn(i,r);a.sort(Q);for(var s=[],l=0,c=a;l<c.length;l+=1){var h=c[l];s.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(e,t._state,h.queryGeometry,h.scale,n,o,r,t.transform.calculatePosMatrix(h.tileID.toUnwrapped()))});}var u=function(t){for(var e={},i={},n=0,o=t;n<o.length;n+=1){var r=o[n],a=r.queryResults,s=r.wrappedTileID,l=i[s]=i[s]||{};for(var c in a)for(var h=a[c],u=l[c]=l[c]||{},p=e[c]=e[c]||[],d=0,f=h;d<f.length;d+=1){var _=f[d];u[_.featureIndex]||(u[_.featureIndex]=!0,p.push(_.feature));}}return e}(s);for(var p in u)u[p].forEach(function(e){var i=t.getFeatureState(e.layer["source-layer"],e.id);e.source=e.layer.source,e.layer["source-layer"]&&(e.sourceLayer=e.layer["source-layer"]),e.state=i;});return u}function Q(t,e){var i=t.tileID,n=e.tileID;return i.overscaledZ-n.overscaledZ||i.canonical.y-n.canonical.y||i.wrap-n.wrap||i.canonical.x-n.canonical.x}var $=function(t,e){this.max=t,this.onRemove=e,this.reset();};$.prototype.reset=function(){for(var t in this.data)for(var e=0,i=this.data[t];e<i.length;e+=1){var n=i[e];n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value);}return this.data={},this.order=[],this},$.prototype.add=function(t,e,i){var n=this,o=t.wrapped().key;void 0===this.data[o]&&(this.data[o]=[]);var r={value:e,timeout:void 0};if(void 0!==i&&(r.timeout=setTimeout(function(){n.remove(t,r);},i)),this.data[o].push(r),this.order.push(o),this.order.length>this.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a);}return this},$.prototype.has=function(t){return t.wrapped().key in this.data},$.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},$.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},$.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},$.prototype.remove=function(t,e){if(!this.has(t))return this;var i=t.wrapped().key,n=void 0===e?0:this.data[i].indexOf(e),o=this.data[i][n];return this.data[i].splice(n,1),o.timeout&&clearTimeout(o.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(o.value),this.order.splice(this.order.indexOf(i),1),this},$.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e);}return this};var tt=function(t,e,i){this.context=t;var n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer;};tt.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer);},tt.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer);},tt.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer);};var et={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},it=function(t,e,i,n){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;var o=t.gl;this.buffer=o.createBuffer(),t.bindVertexBuffer.set(this.buffer),o.bufferData(o.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer;};it.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer);},it.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer);},it.prototype.enableAttributes=function(t,e){for(var i=0;i<this.attributes.length;i++){var n=this.attributes[i],o=e.attributes[n.name];void 0!==o&&t.enableVertexAttribArray(o);}},it.prototype.setVertexAttribPointers=function(t,e,i){for(var n=0;n<this.attributes.length;n++){var o=this.attributes[n],r=e.attributes[o.name];void 0!==r&&t.vertexAttribPointer(r,o.components,t[et[o.type]],!1,this.itemSize,o.offset+this.itemSize*(i||0));}},it.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer);};var nt=function(e){this.context=e,this.default=t.Color.transparent,this.current=this.default,this.dirty=!1;};nt.prototype.get=function(){return this.current},nt.prototype.setDefault=function(){this.set(this.default);},nt.prototype.set=function(t){var e=this.current;t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a&&!0!==this.dirty||(this.context.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1);};var ot=function(t){this.context=t,this.default=1,this.current=this.default,this.dirty=!1;};ot.prototype.get=function(){return this.current},ot.prototype.setDefault=function(){this.set(this.default);},ot.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.clearDepth(t),this.current=t,this.dirty=!1);};var rt=function(t){this.context=t,this.default=0,this.current=this.default,this.dirty=!1;};rt.prototype.get=function(){return this.current},rt.prototype.setDefault=function(){this.set(this.default);},rt.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.clearStencil(t),this.current=t,this.dirty=!1);};var at=function(t){this.context=t,this.default=[!0,!0,!0,!0],this.current=this.default,this.dirty=!1;};at.prototype.get=function(){return this.current},at.prototype.setDefault=function(){this.set(this.default);},at.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&!0!==this.dirty||(this.context.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1);};var st=function(t){this.context=t,this.default=!0,this.current=this.default,this.dirty=!1;};st.prototype.get=function(){return this.current},st.prototype.setDefault=function(){this.set(this.default);},st.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.depthMask(t),this.current=t,this.dirty=!1);};var lt=function(t){this.context=t,this.default=255,this.current=this.default,this.dirty=!1;};lt.prototype.get=function(){return this.current},lt.prototype.setDefault=function(){this.set(this.default);},lt.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.stencilMask(t),this.current=t,this.dirty=!1);};var ct=function(t){this.context=t,this.default={func:t.gl.ALWAYS,ref:0,mask:255},this.current=this.default,this.dirty=!1;};ct.prototype.get=function(){return this.current},ct.prototype.setDefault=function(){this.set(this.default);},ct.prototype.set=function(t){var e=this.current;t.func===e.func&&t.ref===e.ref&&t.mask===e.mask&&!0!==this.dirty||(this.context.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1);};var ht=function(t){this.context=t;var e=this.context.gl;this.default=[e.KEEP,e.KEEP,e.KEEP],this.current=this.default,this.dirty=!1;};ht.prototype.get=function(){return this.current},ht.prototype.setDefault=function(){this.set(this.default);},ht.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&!0!==this.dirty||(this.context.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1);};var ut=function(t){this.context=t,this.default=!1,this.current=this.default,this.dirty=!1;};ut.prototype.get=function(){return this.current},ut.prototype.setDefault=function(){this.set(this.default);},ut.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1;}};var pt=function(t){this.context=t,this.default=[0,1],this.current=this.default,this.dirty=!1;};pt.prototype.get=function(){return this.current},pt.prototype.setDefault=function(){this.set(this.default);},pt.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&!0!==this.dirty||(this.context.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1);};var dt=function(t){this.context=t,this.default=!1,this.current=this.default,this.dirty=!1;};dt.prototype.get=function(){return this.current},dt.prototype.setDefault=function(){this.set(this.default);},dt.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1;}};var ft=function(t){this.context=t,this.default=t.gl.LESS,this.current=this.default,this.dirty=!1;};ft.prototype.get=function(){return this.current},ft.prototype.setDefault=function(){this.set(this.default);},ft.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.depthFunc(t),this.current=t,this.dirty=!1);};var _t=function(t){this.context=t,this.default=!1,this.current=this.default,this.dirty=!1;};_t.prototype.get=function(){return this.current},_t.prototype.setDefault=function(){this.set(this.default);},_t.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1;}};var mt=function(t){this.context=t;var e=this.context.gl;this.default=[e.ONE,e.ZERO],this.current=this.default,this.dirty=!1;};mt.prototype.get=function(){return this.current},mt.prototype.setDefault=function(){this.set(this.default);},mt.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&!0!==this.dirty||(this.context.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1);};var gt=function(e){this.context=e,this.default=t.Color.transparent,this.current=this.default,this.dirty=!1;};gt.prototype.get=function(){return this.current},gt.prototype.setDefault=function(){this.set(this.default);},gt.prototype.set=function(t){var e=this.current;t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a&&!0!==this.dirty||(this.context.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1);};var vt=function(t){this.context=t,this.default=this.context.gl.FUNC_ADD,this.current=this.default,this.dirty=!1;};vt.prototype.get=function(){return this.current},vt.prototype.setDefault=function(){this.set(this.default);},vt.prototype.set=function(t){t===this.current&&!0!==this.dirty||(this.context.gl.blendEquation(t),this.current=t,this.dirty=!1);};var yt=function(t){this.context=t,this.default=!1,this.current=this.default,this.dirty=!1;};yt.prototype.get=function(){return this.current},yt.prototype.setDefault=function(){this.set(this.default);},yt.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1;}};var xt=function(t){this.context=t;var e=this.context.gl;this.default=e.BACK,this.current=this.default,this.dirty=!1;};xt.prototype.get=function(){return this.current},xt.prototype.setDefault=function(){this.set(this.default);},xt.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.cullFace(t),this.current=t,this.dirty=!1);};var bt=function(t){this.context=t;var e=this.context.gl;this.default=e.CCW,this.current=this.default,this.dirty=!1;};bt.prototype.get=function(){return this.current},bt.prototype.setDefault=function(){this.set(this.default);},bt.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.frontFace(t),this.current=t,this.dirty=!1);};var wt=function(t){this.context=t,this.default=null,this.current=this.default,this.dirty=!1;};wt.prototype.get=function(){return this.current},wt.prototype.setDefault=function(){this.set(this.default);},wt.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.useProgram(t),this.current=t,this.dirty=!1);};var Et=function(t){this.context=t,this.default=t.gl.TEXTURE0,this.current=this.default,this.dirty=!1;};Et.prototype.get=function(){return this.current},Et.prototype.setDefault=function(){this.set(this.default);},Et.prototype.set=function(t){this.current===t&&!0!==this.dirty||(this.context.gl.activeTexture(t),this.current=t,this.dirty=!1);};var Tt=function(t){this.context=t;var e=this.context.gl;this.default=[0,0,e.drawingBufferWidth,e.drawingBufferHeight],this.current=this.default,this.dirty=!1;};Tt.prototype.get=function(){return this.current},Tt.prototype.setDefault=function(){this.set(this.default);},Tt.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&!0!==this.dirty||(this.context.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1);};var St=function(t){this.context=t,this.default=null,this.current=this.default,this.dirty=!1;};St.prototype.get=function(){return this.current},St.prototype.setDefault=function(){this.set(this.default);},St.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1;}};var Ct=function(t){this.context=t,this.default=null,this.current=this.default,this.dirty=!1;};Ct.prototype.get=function(){return this.current},Ct.prototype.setDefault=function(){this.set(this.default);},Ct.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1;}};var It=function(t){this.context=t,this.default=null,this.current=this.default,this.dirty=!1;};It.prototype.get=function(){return this.current},It.prototype.setDefault=function(){this.set(this.default);},It.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1;}};var zt=function(t){this.context=t,this.default=null,this.current=this.default,this.dirty=!1;};zt.prototype.get=function(){return this.current},zt.prototype.setDefault=function(){this.set(this.default);},zt.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1;}};var Pt=function(t){this.context=t,this.default=null,this.current=this.default,this.dirty=!1;};Pt.prototype.get=function(){return this.current},Pt.prototype.setDefault=function(){this.set(this.default);},Pt.prototype.set=function(t){var e=this.context.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1;};var Dt=function(t){this.context=t,this.default=null,this.current=this.default,this.dirty=!1;};Dt.prototype.get=function(){return this.current},Dt.prototype.setDefault=function(){this.set(this.default);},Dt.prototype.set=function(t){(this.current!==t&&this.context.extVertexArrayObject||!0===this.dirty)&&(this.context.extVertexArrayObject.bindVertexArrayOES(t),this.current=t,this.dirty=!1);};var Rt=function(t){this.context=t,this.default=4,this.current=this.default,this.dirty=!1;};Rt.prototype.get=function(){return this.current},Rt.prototype.setDefault=function(){this.set(this.default);},Rt.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1;}};var Lt=function(t){this.context=t,this.default=!1,this.current=this.default,this.dirty=!1;};Lt.prototype.get=function(){return this.current},Lt.prototype.setDefault=function(){this.set(this.default);},Lt.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1;}};var At=function(t){this.context=t,this.default=!1,this.current=this.default,this.dirty=!1;};At.prototype.get=function(){return this.current},At.prototype.setDefault=function(){this.set(this.default);},At.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1;}};var Mt=function(t,e){this.context=t,this.default=null,this.current=this.default,this.dirty=!1,this.parent=e;};Mt.prototype.get=function(){return this.current};var kt=function(t){function e(e,i){t.call(this,e,i),this.dirty=!1;}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setDefault=function(){this.set(this.default);},e.prototype.set=function(t){if(this.dirty||this.current!==t){var e=this.context.gl;this.context.bindFramebuffer.set(this.parent),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1;}},e.prototype.setDirty=function(){this.dirty=!0;},e}(Mt),Bt=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setDefault=function(){this.set(this.default);},e.prototype.set=function(t){if(this.current!==t||!0===this.dirty){var e=this.context.gl;this.context.bindFramebuffer.set(this.parent),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1;}},e}(Mt),Ot=function(t,e,i){this.context=t,this.width=e,this.height=i;var n=t.gl,o=this.framebuffer=n.createFramebuffer();this.colorAttachment=new kt(t,o),this.depthAttachment=new Bt(t,o);};Ot.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();e&&t.deleteTexture(e);var i=this.depthAttachment.get();i&&t.deleteRenderbuffer(i),t.deleteFramebuffer(this.framebuffer);};var Ft=function(t,e,i){this.func=t,this.mask=e,this.range=i;};Ft.ReadOnly=!1,Ft.ReadWrite=!0,Ft.disabled=new Ft(519,Ft.ReadOnly,[0,1]);var Ut=function(t,e,i,n,o,r){this.test=t,this.ref=e,this.mask=i,this.fail=n,this.depthFail=o,this.pass=r;};Ut.disabled=new Ut({func:519,mask:0},0,0,7680,7680,7680);var Nt=function(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i;};Nt.Replace=[1,0],Nt.disabled=new Nt(Nt.Replace,t.Color.transparent,[!1,!1,!1,!1]),Nt.unblended=new Nt(Nt.Replace,t.Color.transparent,[!0,!0,!0,!0]),Nt.alphaBlended=new Nt([1,771],t.Color.transparent,[!0,!0,!0,!0]);var Zt=function(t,e,i){this.enable=t,this.mode=e,this.frontFace=i;};Zt.disabled=new Zt(!1,1029,2305),Zt.backCCW=new Zt(!0,1029,2305);var qt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new nt(this),this.clearDepth=new ot(this),this.clearStencil=new rt(this),this.colorMask=new at(this),this.depthMask=new st(this),this.stencilMask=new lt(this),this.stencilFunc=new ct(this),this.stencilOp=new ht(this),this.stencilTest=new ut(this),this.depthRange=new pt(this),this.depthTest=new dt(this),this.depthFunc=new ft(this),this.blend=new _t(this),this.blendFunc=new mt(this),this.blendColor=new gt(this),this.blendEquation=new vt(this),this.cullFace=new yt(this),this.cullFaceSide=new xt(this),this.frontFace=new bt(this),this.program=new wt(this),this.activeTexture=new Et(this),this.viewport=new Tt(this),this.bindFramebuffer=new St(this),this.bindRenderbuffer=new Ct(this),this.bindTexture=new It(this),this.bindVertexBuffer=new zt(this),this.bindElementBuffer=new Pt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new Dt(this),this.pixelStoreUnpack=new Rt(this),this.pixelStoreUnpackPremultiplyAlpha=new Lt(this),this.pixelStoreUnpackFlipY=new At(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&t.getExtension("OES_texture_half_float_linear");};qt.prototype.setDirty=function(){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.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0;},qt.prototype.createIndexBuffer=function(t,e){return new tt(this,t,e)},qt.prototype.createVertexBuffer=function(t,e,i){return new it(this,t,e,i)},qt.prototype.createRenderbuffer=function(t,e,i){var n=this.gl,o=n.createRenderbuffer();return this.bindRenderbuffer.set(o),n.renderbufferStorage(n.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),o},qt.prototype.createFramebuffer=function(t,e){return new Ot(this,t,e)},qt.prototype.clear=function(t){var e=t.color,i=t.depth,n=this.gl,o=0;e&&(o|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==i&&(o|=n.DEPTH_BUFFER_BIT,this.clearDepth.set(i),this.depthMask.set(!0)),n.clear(o);},qt.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace));},qt.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1);},qt.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1);},qt.prototype.setColorMode=function(e){t.isEqual(e.blendFunction,Nt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask);},qt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null);};var Vt=function(e){function i(i,n,o){var r=this;e.call(this),this.id=i,this.dispatcher=o,this.on("data",function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(r._sourceLoaded=!0),r._sourceLoaded&&!r._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(r.reload(),r.transform&&r.update(r.transform));}),this.on("error",function(){r._sourceErrored=!0;}),this._source=Y(i,n,o,this),this._tiles={},this._cache=new $(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._coveredTiles={},this._state=new t.SourceFeatureState;}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t);},i.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t);},i.prototype.loaded=function(){if(this._sourceErrored)return !0;if(!this._sourceLoaded)return !1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return !1}return !0},i.prototype.getSource=function(){return this._source},i.prototype.pause=function(){this._paused=!0;},i.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform);}},i.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},i.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,function(){})},i.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,function(){})},i.prototype.serialize=function(){return this._source.serialize()},i.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles)this._tiles[e].upload(t);},i.prototype.getIds=function(){return Object.keys(this._tiles).map(Number).sort(Gt)},i.prototype.getRenderableIds=function(e){var i=this,n=[];for(var o in i._tiles)i._isIdRenderable(+o,e)&&n.push(+o);return e?n.sort(function(e,n){var o=i._tiles[e].tileID,r=i._tiles[n].tileID,a=new t.Point(o.canonical.x,o.canonical.y)._rotate(i.transform.angle),s=new t.Point(r.canonical.x,r.canonical.y)._rotate(i.transform.angle);return o.overscaledZ-r.overscaledZ||s.y-a.y||s.x-a.x}):n.sort(Gt)},i.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return !!e&&this._isIdRenderable(e.tileID.key)},i.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},i.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading");},i.prototype._reloadTile=function(t,e){var i=this._tiles[t];i&&("loading"!==i.state&&(i.state=e),this._loadTile(i,this._tileLoaded.bind(this,i,t,e)));},i.prototype._tileLoaded=function(e,i,n,o){if(o)return e.state="errored",void(404!==o.status?this._source.fire(new t.ErrorEvent(o,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}));},i.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),i=0;i<e.length;i++){var n=e[i];if(t.neighboringTiles&&t.neighboringTiles[n]){var o=this.getTileByID(n);r(t,o),r(o,t);}}function r(t,e){t.needsHillshadePrepare=!0;var i=e.tileID.canonical.x-t.tileID.canonical.x,n=e.tileID.canonical.y-t.tileID.canonical.y,o=Math.pow(2,t.tileID.canonical.z),r=e.tileID.key;0===i&&0===n||Math.abs(n)>1||(Math.abs(i)>1&&(1===Math.abs(i+o)?i+=o:1===Math.abs(i-o)&&(i-=o)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,n),t.neighboringTiles&&t.neighboringTiles[r]&&(t.neighboringTiles[r].backfilled=!0)));}},i.prototype.getTile=function(t){return this.getTileByID(t.key)},i.prototype.getTileByID=function(t){return this._tiles[t]},i.prototype.getZoom=function(t){return t.zoom+t.scaleZoom(t.tileSize/this._source.tileSize)},i.prototype._retainLoadedChildren=function(t,e,i,n){for(var o in this._tiles){var r=this._tiles[o];if(!(n[o]||!r.hasData()||r.tileID.overscaledZ<=e||r.tileID.overscaledZ>i)){for(var a=r.tileID;r&&r.tileID.overscaledZ>e+1;){var s=r.tileID.scaledTo(r.tileID.overscaledZ-1);(r=this._tiles[s.key])&&r.hasData()&&(a=s);}for(var l=a;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[a.key]=a;break}}}},i.prototype.findLoadedParent=function(t,e){for(var i=t.overscaledZ-1;i>=e;i--){var n=t.scaledTo(i);if(!n)return;var o=String(n.key),r=this._tiles[o];if(r&&r.hasData())return r;if(this._cache.has(n))return this._cache.get(n)}},i.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),i=Math.floor(5*e),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(n);},i.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,i=Math.round(e);if(this._prevLng=t,i){var n={};for(var o in this._tiles){var r=this._tiles[o];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+i),n[r.tileID.key]=r;}for(var a in this._tiles=n,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l);}}},i.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var o;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?o=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)}):(o=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(o=o.filter(function(t){return n._source.hasTile(t)}))):o=[];var r=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(e)),a=Math.max(r-i.maxOverzooming,this._source.minzoom),s=Math.max(r+i.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(o,r);if(Wt(this._source.type)){for(var c={},h={},u=0,p=Object.keys(l);u<p.length;u+=1){var d=p[u],f=l[d],_=n._tiles[d];if(_&&!(_.fadeEndTime&&_.fadeEndTime<=t.browser.now())){var m=n.findLoadedParent(f,a);m&&(n._addTile(m.tileID),c[m.tileID.key]=m.tileID),h[d]=f;}}for(var g in this._retainLoadedChildren(h,r,s,l),c)l[g]||(n._coveredTiles[g]=!0,l[g]=c[g]);}for(var v in l)n._tiles[v].clearFadeHold();for(var y=0,x=t.keysDifference(this._tiles,l);y<x.length;y+=1){var b=x[y],w=n._tiles[b];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(n.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||n._removeTile(b);}}},i.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t);},i.prototype._updateRetainedTiles=function(t,e){for(var n={},o={},r=Math.max(e-i.maxOverzooming,this._source.minzoom),a=Math.max(e+i.maxUnderzooming,this._source.minzoom),s={},l=0,c=t;l<c.length;l+=1){var h=c[l],u=this._addTile(h);n[h.key]=h,u.hasData()||e<this._source.maxzoom&&(s[h.key]=h);}this._retainLoadedChildren(s,e,a,n);for(var p=0,d=t;p<d.length;p+=1){var f=d[p],_=this._tiles[f.key];if(!_.hasData()){if(e+1>this._source.maxzoom){var m=f.children(this._source.maxzoom)[0],g=this.getTile(m);if(g&&g.hasData()){n[m.key]=m;continue}}else{var v=f.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var y=_.wasRequested(),x=f.overscaledZ-1;x>=r;--x){var b=f.scaledTo(x);if(o[b.key])break;if(o[b.key]=!0,!(_=this.getTile(b))&&y&&(_=this._addTile(b)),_&&(n[b.key]=b,y=_.wasRequested(),_.hasData()))break}}}return n},i.prototype._addTile=function(e){var i=this._tiles[e.key];if(i)return i;(i=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));var n=Boolean(i);return n||(i=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))),i?(i.uses++,this._tiles[e.key]=i,n||this._source.fire(new t.Event("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null},i.prototype._setTileReloadTimer=function(t,e){var i=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout(function(){i._reloadTile(t,"expired"),delete i._timers[t];},n));},i.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))));},i.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset();},i.prototype.tilesIn=function(e,i){for(var n=[],o=this.getIds(),r=1/0,a=1/0,s=-1/0,l=-1/0,c=e[0].zoom,h=0;h<e.length;h++){var u=e[h];r=Math.min(r,u.column),a=Math.min(a,u.row),s=Math.max(s,u.column),l=Math.max(l,u.row);}for(var p=0;p<o.length;p++){var d=this._tiles[o[p]];if(!d.holdingForFade()){var f=d.tileID,_=Math.pow(2,this.transform.zoom-d.tileID.overscaledZ),m=i*d.queryPadding*t.EXTENT/d.tileSize/_,g=[jt(f,new t.Coordinate(r,a,c)),jt(f,new t.Coordinate(s,l,c))];if(g[0].x-m<t.EXTENT&&g[0].y-m<t.EXTENT&&g[1].x+m>=0&&g[1].y+m>=0){for(var v=[],y=0;y<e.length;y++)v.push(jt(f,e[y]));n.push({tile:d,tileID:f,queryGeometry:[v],scale:_});}}}return n},i.prototype.getVisibleCoordinates=function(t){for(var e=this,i=this.getRenderableIds(t).map(function(t){return e._tiles[t].tileID}),n=0,o=i;n<o.length;n+=1){var r=o[n];r.posMatrix=e.transform.calculatePosMatrix(r.toUnwrapped());}return i},i.prototype.hasTransition=function(){if(this._source.hasTransition())return !0;if(Wt(this._source.type))for(var e in this._tiles){var i=this._tiles[e];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=t.browser.now())return !0}return !1},i.prototype.setFeatureState=function(t,e,i){t=t||"_geojsonTileLayer",this._state.updateState(t,e,i);},i.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},i}(t.Evented);function jt(e,i){var n=i.zoomTo(e.canonical.z);return new t.Point((n.column-(e.canonical.x+e.wrap*Math.pow(2,e.canonical.z)))*t.EXTENT,(n.row-e.canonical.y)*t.EXTENT)}function Gt(t,e){return t%32-e%32||e-t}function Wt(t){return "raster"===t||"image"===t||"video"===t}function Xt(){return new t.window.Worker(Vn.workerUrl)}Vt.maxOverzooming=10,Vt.maxUnderzooming=3;var Ht,Kt=function(){this.active={};};function Yt(e,i){var n={};for(var o in e)"ref"!==o&&(n[o]=e[o]);return t.refProperties.forEach(function(t){t in i&&(n[t]=i[t]);}),n}function Jt(t){t=t.slice();for(var e=Object.create(null),i=0;i<t.length;i++)e[t[i].id]=t[i];for(var n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=Yt(t[n],e[t[n].ref]));return t}Kt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Kt.workerCount;)this.workers.push(new Xt);return this.active[t]=!0,this.workers.slice()},Kt.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach(function(t){t.terminate();}),this.workers=null);},Kt.workerCount=Math.max(Math.floor(t.browser.hardwareConcurrency/2),1);var Qt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function $t(t,e,i){i.push({command:Qt.addSource,args:[t,e[t]]});}function te(t,e,i){e.push({command:Qt.removeSource,args:[t]}),i[t]=!0;}function ee(t,e,i,n){te(t,i,n),$t(t,e,i);}function ie(e,i,n){var o;for(o in e[n])if(e[n].hasOwnProperty(o)&&"data"!==o&&!t.isEqual(e[n][o],i[n][o]))return !1;for(o in i[n])if(i[n].hasOwnProperty(o)&&"data"!==o&&!t.isEqual(e[n][o],i[n][o]))return !1;return !0}function ne(e,i,n,o,r,a){var s;for(s in e=e||{},i=i||{},e)e.hasOwnProperty(s)&&(t.isEqual(e[s],i[s])||n.push({command:a,args:[o,s,i[s],r]}));for(s in i)i.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.isEqual(e[s],i[s])||n.push({command:a,args:[o,s,i[s],r]}));}function oe(t){return t.id}function re(t,e){return t[e.id]=e,t}function ae(e,i){if(!e)return [{command:Qt.setStyle,args:[i]}];var n=[];try{if(!t.isEqual(e.version,i.version))return [{command:Qt.setStyle,args:[i]}];t.isEqual(e.center,i.center)||n.push({command:Qt.setCenter,args:[i.center]}),t.isEqual(e.zoom,i.zoom)||n.push({command:Qt.setZoom,args:[i.zoom]}),t.isEqual(e.bearing,i.bearing)||n.push({command:Qt.setBearing,args:[i.bearing]}),t.isEqual(e.pitch,i.pitch)||n.push({command:Qt.setPitch,args:[i.pitch]}),t.isEqual(e.sprite,i.sprite)||n.push({command:Qt.setSprite,args:[i.sprite]}),t.isEqual(e.glyphs,i.glyphs)||n.push({command:Qt.setGlyphs,args:[i.glyphs]}),t.isEqual(e.transition,i.transition)||n.push({command:Qt.setTransition,args:[i.transition]}),t.isEqual(e.light,i.light)||n.push({command:Qt.setLight,args:[i.light]});var o={},r=[];!function(e,i,n,o){var r;for(r in e=e||{},i=i||{},e)e.hasOwnProperty(r)&&(i.hasOwnProperty(r)||te(r,n,o));for(r in i)i.hasOwnProperty(r)&&(e.hasOwnProperty(r)?t.isEqual(e[r],i[r])||("geojson"===e[r].type&&"geojson"===i[r].type&&ie(e,i,r)?n.push({command:Qt.setGeoJSONSourceData,args:[r,i[r].data]}):ee(r,i,n,o)):$t(r,i,n));}(e.sources,i.sources,r,o);var a=[];e.layers&&e.layers.forEach(function(t){o[t.source]?n.push({command:Qt.removeLayer,args:[t.id]}):a.push(t);}),n=n.concat(r),function(e,i,n){e=e||[],i=i||[];var o,r,a,s,l,c,h,u=e.map(oe),p=i.map(oe),d=e.reduce(re,{}),f=i.reduce(re,{}),_=u.slice(),m=Object.create(null);for(o=0,r=0;o<u.length;o++)a=u[o],f.hasOwnProperty(a)?r++:(n.push({command:Qt.removeLayer,args:[a]}),_.splice(_.indexOf(a,r),1));for(o=0,r=0;o<p.length;o++)a=p[p.length-1-o],_[_.length-1-o]!==a&&(d.hasOwnProperty(a)?(n.push({command:Qt.removeLayer,args:[a]}),_.splice(_.lastIndexOf(a,_.length-r),1)):r++,c=_[_.length-o],n.push({command:Qt.addLayer,args:[f[a],c]}),_.splice(_.length-o,0,a),m[a]=!0);for(o=0;o<p.length;o++)if(s=d[a=p[o]],l=f[a],!m[a]&&!t.isEqual(s,l))if(t.isEqual(s.source,l.source)&&t.isEqual(s["source-layer"],l["source-layer"])&&t.isEqual(s.type,l.type)){for(h in ne(s.layout,l.layout,n,a,null,Qt.setLayoutProperty),ne(s.paint,l.paint,n,a,null,Qt.setPaintProperty),t.isEqual(s.filter,l.filter)||n.push({command:Qt.setFilter,args:[a,l.filter]}),t.isEqual(s.minzoom,l.minzoom)&&t.isEqual(s.maxzoom,l.maxzoom)||n.push({command:Qt.setLayerZoomRange,args:[a,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(h)&&"layout"!==h&&"paint"!==h&&"filter"!==h&&"metadata"!==h&&"minzoom"!==h&&"maxzoom"!==h&&(0===h.indexOf("paint.")?ne(s[h],l[h],n,a,h.slice(6),Qt.setPaintProperty):t.isEqual(s[h],l[h])||n.push({command:Qt.setLayerProperty,args:[a,h,l[h]]}));for(h in l)l.hasOwnProperty(h)&&!s.hasOwnProperty(h)&&"layout"!==h&&"paint"!==h&&"filter"!==h&&"metadata"!==h&&"minzoom"!==h&&"maxzoom"!==h&&(0===h.indexOf("paint.")?ne(s[h],l[h],n,a,h.slice(6),Qt.setPaintProperty):t.isEqual(s[h],l[h])||n.push({command:Qt.setLayerProperty,args:[a,h,l[h]]}));}else n.push({command:Qt.removeLayer,args:[a]}),c=_[_.lastIndexOf(a)+1],n.push({command:Qt.addLayer,args:[l,c]});}(a,i.layers,n);}catch(t){console.warn("Unable to compute style diff:",t),n=[{command:Qt.setStyle,args:[i]}];}return n}var se=function(t,e,i){var n=this.boxCells=[],o=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(var r=0;r<this.xCellCount*this.yCellCount;r++)n.push([]),o.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0;};se.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},se.prototype.insert=function(t,e,i,n,o){this._forEachCell(e,i,n,o,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(o);},se.prototype.insertCircle=function(t,e,i,n){this._forEachCell(e-n,i-n,e+n,i+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(n);},se.prototype._insertBoxCell=function(t,e,i,n,o,r){this.boxCells[o].push(r);},se.prototype._insertCircleCell=function(t,e,i,n,o,r){this.circleCells[o].push(r);},se.prototype._query=function(t,e,i,n,o,r){if(i<0||t>this.width||n<0||e>this.height)return !o&&[];var a=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=n){if(o)return !0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var c=this.circles[3*l],h=this.circles[3*l+1],u=this.circles[3*l+2];a.push({key:this.circleKeys[l],x1:c-u,y1:h-u,x2:c+u,y2:h+u});}return r?a.filter(r):a}var p={hitTest:o,seenUids:{box:{},circle:{}}};return this._forEachCell(t,e,i,n,this._queryCell,a,p,r),o?a.length>0:a},se.prototype._queryCircle=function(t,e,i,n,o){var r=t-i,a=t+i,s=e-i,l=e+i;if(a<0||r>this.width||l<0||s>this.height)return !n&&[];var c=[],h={hitTest:n,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}};return this._forEachCell(r,s,a,l,this._queryCellCircle,c,h,o),n?c.length>0:c},se.prototype.query=function(t,e,i,n,o){return this._query(t,e,i,n,!1,o)},se.prototype.hitTest=function(t,e,i,n,o){return this._query(t,e,i,n,!0,o)},se.prototype.hitTestCircle=function(t,e,i,n){return this._queryCircle(t,e,i,!0,n)},se.prototype._queryCell=function(t,e,i,n,o,r,a,s){var l=a.seenUids,c=this.boxCells[o];if(null!==c)for(var h=this.bboxes,u=0,p=c;u<p.length;u+=1){var d=p[u];if(!l.box[d]){l.box[d]=!0;var f=4*d;if(t<=h[f+2]&&e<=h[f+3]&&i>=h[f+0]&&n>=h[f+1]&&(!s||s(this.boxKeys[d]))){if(a.hitTest)return r.push(!0),!0;r.push({key:this.boxKeys[d],x1:h[f],y1:h[f+1],x2:h[f+2],y2:h[f+3]});}}}var _=this.circleCells[o];if(null!==_)for(var m=this.circles,g=0,v=_;g<v.length;g+=1){var y=v[g];if(!l.circle[y]){l.circle[y]=!0;var x=3*y;if(this._circleAndRectCollide(m[x],m[x+1],m[x+2],t,e,i,n)&&(!s||s(this.circleKeys[y]))){if(a.hitTest)return r.push(!0),!0;var b=m[x],w=m[x+1],E=m[x+2];r.push({key:this.circleKeys[y],x1:b-E,y1:w-E,x2:b+E,y2:w+E});}}}},se.prototype._queryCellCircle=function(t,e,i,n,o,r,a,s){var l=a.circle,c=a.seenUids,h=this.boxCells[o];if(null!==h)for(var u=this.bboxes,p=0,d=h;p<d.length;p+=1){var f=d[p];if(!c.box[f]){c.box[f]=!0;var _=4*f;if(this._circleAndRectCollide(l.x,l.y,l.radius,u[_+0],u[_+1],u[_+2],u[_+3])&&(!s||s(this.boxKeys[f])))return r.push(!0),!0}}var m=this.circleCells[o];if(null!==m)for(var g=this.circles,v=0,y=m;v<y.length;v+=1){var x=y[v];if(!c.circle[x]){c.circle[x]=!0;var b=3*x;if(this._circlesCollide(g[b],g[b+1],g[b+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[x])))return r.push(!0),!0}}},se.prototype._forEachCell=function(t,e,i,n,o,r,a,s){for(var l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),h=this._convertToXCellCoord(i),u=this._convertToYCellCoord(n),p=l;p<=h;p++)for(var d=c;d<=u;d++){var f=this.xCellCount*d+p;if(o.call(this,t,e,i,n,f,r,a,s))return}},se.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},se.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},se.prototype._circlesCollide=function(t,e,i,n,o,r){var a=n-t,s=o-e,l=i+r;return l*l>a*a+s*s},se.prototype._circleAndRectCollide=function(t,e,i,n,o,r,a){var s=(r-n)/2,l=Math.abs(t-(n+s));if(l>s+i)return !1;var c=(a-o)/2,h=Math.abs(e-(o+c));if(h>c+i)return !1;if(l<=s||h<=c)return !0;var u=l-s,p=h-c;return u*u+p*p<=i*i};var le=t.properties.layout;function ce(e,i,n,o,r){var a=t.identity(new Float32Array(16));return i?(t.identity(a),t.scale(a,a,[1/r,1/r,1]),n||t.rotateZ(a,a,o.angle)):(t.scale(a,a,[o.width/2,-o.height/2,1]),t.translate(a,a,[1,-1,0]),t.multiply(a,a,e)),a}function he(e,i,n,o,r){var a=t.identity(new Float32Array(16));return i?(t.multiply(a,a,e),t.scale(a,a,[r,r,1]),n||t.rotateZ(a,a,-o.angle)):(t.scale(a,a,[1,-1,1]),t.translate(a,a,[-1,-1,0]),t.scale(a,a,[2/o.width,2/o.height,1])),a}function ue(e,i){var n=[e.x,e.y,0,1];be(n,n,i);var o=n[3];return {point:new t.Point(n[0]/o,n[1]/o),signedDistanceFromCamera:o}}function pe(t,e){var i=t[0]/t[3],n=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&n>=-e[1]&&n<=e[1]}function de(e,i,n,o,r,a,s,l){var c=o?e.textSizeData:e.iconSizeData,h=t.evaluateSizeForZoom(c,n.transform.zoom,le.properties[o?"text-size":"icon-size"]),u=[256/n.width*2+1,256/n.height*2+1],p=o?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var d=e.lineVertexArray,f=o?e.text.placedSymbolArray:e.icon.placedSymbolArray,_=n.transform.width/n.transform.height,m=!1,g=0;g<f.length;g++){var v=f.get(g);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!m)xe(v.numGlyphs,p);else{m=!1;var y=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(y,y,i),pe(y,u)){var x=.5+y[3]/n.transform.cameraToCenterDistance*.5,b=t.evaluateSizeForFeature(c,h,v),w=s?b*x:b/x,E=new t.Point(v.anchorX,v.anchorY),T=ue(E,r).point,S={},C=me(v,w,!1,l,i,r,a,e.glyphOffsetArray,d,p,T,E,S,_);m=C.useVertical,(C.notEnoughRoom||m||C.needsFlipping&&me(v,w,!0,l,i,r,a,e.glyphOffsetArray,d,p,T,E,S,_).notEnoughRoom)&&xe(v.numGlyphs,p);}else xe(v.numGlyphs,p);}}o?e.text.dynamicLayoutVertexBuffer.updateData(p):e.icon.dynamicLayoutVertexBuffer.updateData(p);}function fe(t,e,i,n,o,r,a,s,l,c,h,u){var p=s.glyphStartIndex+s.numGlyphs,d=s.lineStartIndex,f=s.lineStartIndex+s.lineLength,_=e.getoffsetX(s.glyphStartIndex),m=e.getoffsetX(p-1),g=ve(t*_,i,n,o,r,a,s.segment,d,f,l,c,h,u);if(!g)return null;var v=ve(t*m,i,n,o,r,a,s.segment,d,f,l,c,h,u);return v?{first:g,last:v}:null}function _e(e,i,n,o){if(e===t.WritingMode.horizontal&&Math.abs(n.y-i.y)>Math.abs(n.x-i.x)*o)return {useVertical:!0};return (e===t.WritingMode.vertical?i.y<n.y:i.x>n.x)?{needsFlipping:!0}:null}function me(e,i,n,o,r,a,s,l,c,h,u,p,d,f){var _,m=i/24,g=e.lineOffsetX*i,v=e.lineOffsetY*i;if(e.numGlyphs>1){var y=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=fe(m,l,g,v,n,u,p,e,c,a,d,!1);if(!w)return {notEnoughRoom:!0};var E=ue(w.first.point,s).point,T=ue(w.last.point,s).point;if(o&&!n){var S=_e(e.writingMode,E,T,f);if(S)return S}_=[w.first];for(var C=e.glyphStartIndex+1;C<y-1;C++)_.push(ve(m*l.getoffsetX(C),g,v,n,u,p,e.segment,x,b,c,a,d,!1));_.push(w.last);}else{if(o&&!n){var I=ue(p,r).point,z=e.lineStartIndex+e.segment+1,P=new t.Point(c.getx(z),c.gety(z)),D=ue(P,r),R=D.signedDistanceFromCamera>0?D.point:ge(p,P,I,1,r),L=_e(e.writingMode,I,R,f);if(L)return L}var A=ve(m*l.getoffsetX(e.glyphStartIndex),g,v,n,u,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,a,d,!1);if(!A)return {notEnoughRoom:!0};_=[A];}for(var M=0,k=_;M<k.length;M+=1){var B=k[M];t.addDynamicAttributes(h,B.point,B.angle);}return {}}function ge(t,e,i,n,o){var r=ue(t.add(t.sub(e)._unit()),o).point,a=i.sub(r);return i.add(a._mult(n/a.mag()))}function ve(e,i,n,o,r,a,s,l,c,h,u,p,d){var f=o?e-i:e+i,_=f>0?1:-1,m=0;o&&(_*=-1,m=Math.PI),_<0&&(m+=Math.PI);for(var g=_>0?l+s:l+s+1,v=g,y=r,x=r,b=0,w=0,E=Math.abs(f);b+w<=E;){if((g+=_)<l||g>=c)return null;if(x=y,void 0===(y=p[g])){var T=new t.Point(h.getx(g),h.gety(g)),S=ue(T,u);if(S.signedDistanceFromCamera>0)y=p[g]=S.point;else{var C=g-_;y=ge(0===b?a:new t.Point(h.getx(C),h.gety(C)),T,x,E-b+1,u);}}b+=w,w=x.dist(y);}var I=(E-b)/w,z=y.sub(x),P=z.mult(I)._add(x);return P._add(z._unit()._perp()._mult(n*_)),{point:P,angle:m+Math.atan2(y.y-x.y,y.x-x.x),tileDistance:d?{prevTileDistance:g-_===v?0:h.gettileUnitDistanceFromAnchor(g-_),lastSegmentViewportDistance:E-b}:null}}var ye=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function xe(t,e){for(var i=0;i<t;i++){var n=e.length;e.resize(n+4),e.float32.set(ye,3*n);}}function be(t,e,i){var n=e[0],o=e[1];return t[0]=i[0]*n+i[4]*o+i[12],t[1]=i[1]*n+i[5]*o+i[13],t[3]=i[3]*n+i[7]*o+i[15],t}var we=function(t,e,i){void 0===e&&(e=new se(t.width+200,t.height+200,25)),void 0===i&&(i=new se(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=i,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200;};function Ee(t,e,i){t[e+4]=i?1:0;}function Te(e,i,n){return i*(t.EXTENT/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}we.prototype.placeCollisionBox=function(t,e,i,n,o){var r=this.projectAndGetPerspectiveRatio(n,t.anchorPointX,t.anchorPointY),a=i*r.perspectiveRatio,s=t.x1*a+r.point.x,l=t.y1*a+r.point.y,c=t.x2*a+r.point.x,h=t.y2*a+r.point.y;return !this.isInsideGrid(s,l,c,h)||!e&&this.grid.hitTest(s,l,c,h,o)?{box:[],offscreen:!1}:{box:[s,l,c,h],offscreen:this.isOffscreen(s,l,c,h)}},we.prototype.approximateTileDistance=function(t,e,i,n,o){var r=o?1:n/this.pitchfactor,a=t.lastSegmentViewportDistance*i;return t.prevTileDistance+a+(r-1)*a*Math.abs(Math.sin(e))},we.prototype.placeCollisionCircles=function(e,i,n,o,r,a,s,l,c,h,u,p,d){var f=[],_=this.projectAnchor(c,r.anchorX,r.anchorY),m=l/24,g=r.lineOffsetX*l,v=r.lineOffsetY*l,y=new t.Point(r.anchorX,r.anchorY),x=fe(m,s,g,v,!1,ue(y,h).point,y,r,a,h,{},!0),b=!1,w=!1,E=!0,T=_.perspectiveRatio*o,S=1/(o*n),C=0,I=0;x&&(C=this.approximateTileDistance(x.first.tileDistance,x.first.angle,S,_.cameraDistance,p),I=this.approximateTileDistance(x.last.tileDistance,x.last.angle,S,_.cameraDistance,p));for(var z=0;z<e.length;z+=5){var P=e[z],D=e[z+1],R=e[z+2],L=e[z+3];if(!x||L<-C||L>I)Ee(e,z,!1);else{var A=this.projectPoint(c,P,D),M=R*T;if(f.length>0){var k=A.x-f[f.length-4],B=A.y-f[f.length-3];if(M*M*2>k*k+B*B)if(z+8<e.length){var O=e[z+8];if(O>-C&&O<I){Ee(e,z,!1);continue}}}var F=z/5;f.push(A.x,A.y,M,F),Ee(e,z,!0);var U=A.x-M,N=A.y-M,Z=A.x+M,q=A.y+M;if(E=E&&this.isOffscreen(U,N,Z,q),w=w||this.isInsideGrid(U,N,Z,q),!i&&this.grid.hitTestCircle(A.x,A.y,M,d)){if(!u)return {circles:[],offscreen:!1};b=!0;}}}return {circles:b||!w?[]:f,offscreen:E}},we.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return {};for(var i=[],n=1/0,o=1/0,r=-1/0,a=-1/0,s=0,l=e;s<l.length;s+=1){var c=l[s],h=new t.Point(c.x+100,c.y+100);n=Math.min(n,h.x),o=Math.min(o,h.y),r=Math.max(r,h.x),a=Math.max(a,h.y),i.push(h);}for(var u={},p={},d=0,f=this.grid.query(n,o,r,a).concat(this.ignoredGrid.query(n,o,r,a));d<f.length;d+=1){var _=f[d],m=_.key;if(void 0===u[m.bucketInstanceId]&&(u[m.bucketInstanceId]={}),!u[m.bucketInstanceId][m.featureIndex]){var g=[new t.Point(_.x1,_.y1),new t.Point(_.x2,_.y1),new t.Point(_.x2,_.y2),new t.Point(_.x1,_.y2)];t.polygonIntersectsPolygon(i,g)&&(u[m.bucketInstanceId][m.featureIndex]=!0,void 0===p[m.bucketInstanceId]&&(p[m.bucketInstanceId]=[]),p[m.bucketInstanceId].push(m.featureIndex));}}return p},we.prototype.insertCollisionBox=function(t,e,i,n,o){var r={bucketInstanceId:i,featureIndex:n,collisionGroupID:o};(e?this.ignoredGrid:this.grid).insert(r,t[0],t[1],t[2],t[3]);},we.prototype.insertCollisionCircles=function(t,e,i,n,o){for(var r=e?this.ignoredGrid:this.grid,a={bucketInstanceId:i,featureIndex:n,collisionGroupID:o},s=0;s<t.length;s+=4)r.insertCircle(a,t[s],t[s+1],t[s+2]);},we.prototype.projectAnchor=function(t,e,i){var n=[e,i,0,1];return be(n,n,t),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/n[3]*.5,cameraDistance:n[3]}},we.prototype.projectPoint=function(e,i,n){var o=[i,n,0,1];return be(o,o,e),new t.Point((o[0]/o[3]+1)/2*this.transform.width+100,(-o[1]/o[3]+1)/2*this.transform.height+100)},we.prototype.projectAndGetPerspectiveRatio=function(e,i,n){var o=[i,n,0,1];return be(o,o,e),{point:new t.Point((o[0]/o[3]+1)/2*this.transform.width+100,(-o[1]/o[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/o[3]*.5}},we.prototype.isOffscreen=function(t,e,i,n){return i<100||t>=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},we.prototype.isInsideGrid=function(t,e,i,n){return i>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary};var Se=function(t,e,i,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&i?1:0,this.placed=i;};Se.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var Ce=function(t,e,i,n,o){this.text=new Se(t?t.text:null,e,i,o),this.icon=new Se(t?t.icon:null,e,n,o);};Ce.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Ie=function(t,e,i){this.text=t,this.icon=e,this.skipFade=i;},ze=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={};};ze.prototype.get=function(t){if(this.crossSourceCollisions)return {ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}};}return this.collisionGroups[t]};var Pe=function(t,e,i){this.transform=t.clone(),this.collisionIndex=new we(this.transform),this.placements={},this.opacities={},this.stale=!1,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new ze(i);};function De(t,e,i){t.emplaceBack(e?1:0,i?1:0),t.emplaceBack(e?1:0,i?1:0),t.emplaceBack(e?1:0,i?1:0),t.emplaceBack(e?1:0,i?1:0);}Pe.prototype.placeLayerTile=function(e,i,n,o){var r=i.getBucket(e),a=i.latestFeatureIndex;if(r&&a&&e.id===r.layerIds[0]){var s=i.collisionBoxArray,l=r.layers[0].layout,c=Math.pow(2,this.transform.zoom-i.tileID.overscaledZ),h=i.tileSize/t.EXTENT,u=this.transform.calculatePosMatrix(i.tileID.toUnwrapped()),p=ce(u,"map"===l.get("text-pitch-alignment"),"map"===l.get("text-rotation-alignment"),this.transform,Te(i,1,this.transform.zoom)),d=ce(u,"map"===l.get("icon-pitch-alignment"),"map"===l.get("icon-rotation-alignment"),this.transform,Te(i,1,this.transform.zoom));this.retainedQueryData[r.bucketInstanceId]=new function(t,e,i,n,o){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=n,this.tileID=o;}(r.bucketInstanceId,a,r.sourceLayerIndex,r.index,i.tileID),this.placeLayerBucket(r,u,p,d,c,h,n,i.holdingForFade(),o,s);}},Pe.prototype.placeLayerBucket=function(e,i,n,o,r,a,s,l,c,h){var u=e.layers[0].layout,p=t.evaluateSizeForZoom(e.textSizeData,this.transform.zoom,t.properties.layout.properties["text-size"]),d=u.get("text-optional"),f=u.get("icon-optional"),_=u.get("text-allow-overlap"),m=u.get("icon-allow-overlap"),g=_&&(m||!e.hasIconData()||f),v=m&&(_||!e.hasTextData()||d),y=this.collisionGroups.get(e.sourceID);!e.collisionArrays&&h&&e.deserializeCollisionBoxes(h);for(var x=0;x<e.symbolInstances.length;x++){var b=e.symbolInstances.get(x);if(!c[b.crossTileID]){if(l){this.placements[b.crossTileID]=new Ie(!1,!1,!1);continue}var w=!1,E=!1,T=!0,S=null,C=null,I=null,z=0,P=0,D=e.collisionArrays[x];D.textFeatureIndex&&(z=D.textFeatureIndex),D.textBox&&(w=(S=this.collisionIndex.placeCollisionBox(D.textBox,u.get("text-allow-overlap"),a,i,y.predicate)).box.length>0,T=T&&S.offscreen);var R=D.textCircles;if(R){var L=e.text.placedSymbolArray.get(b.horizontalPlacedTextSymbolIndex),A=t.evaluateSizeForFeature(e.textSizeData,p,L);C=this.collisionIndex.placeCollisionCircles(R,u.get("text-allow-overlap"),r,a,L,e.lineVertexArray,e.glyphOffsetArray,A,i,n,s,"map"===u.get("text-pitch-alignment"),y.predicate),w=u.get("text-allow-overlap")||C.circles.length>0,T=T&&C.offscreen;}D.iconFeatureIndex&&(P=D.iconFeatureIndex),D.iconBox&&(E=(I=this.collisionIndex.placeCollisionBox(D.iconBox,u.get("icon-allow-overlap"),a,i,y.predicate)).box.length>0,T=T&&I.offscreen);var M=d||0===b.numGlyphVertices&&0===b.numVerticalGlyphVertices,k=f||0===b.numIconVertices;M||k?k?M||(E=E&&w):w=E&&w:E=w=E&&w,w&&S&&this.collisionIndex.insertCollisionBox(S.box,u.get("text-ignore-placement"),e.bucketInstanceId,z,y.ID),E&&I&&this.collisionIndex.insertCollisionBox(I.box,u.get("icon-ignore-placement"),e.bucketInstanceId,P,y.ID),w&&C&&this.collisionIndex.insertCollisionCircles(C.circles,u.get("text-ignore-placement"),e.bucketInstanceId,z,y.ID),this.placements[b.crossTileID]=new Ie(w||g,E||v,T||e.justReloaded),c[b.crossTileID]=!0;}}e.justReloaded=!1;},Pe.prototype.commit=function(t,e){this.commitTime=e;var i=!1,n=t&&0!==this.fadeDuration?(this.commitTime-t.commitTime)/this.fadeDuration:1,o=t?t.opacities:{};for(var r in this.placements){var a=this.placements[r],s=o[r];s?(this.opacities[r]=new Ce(s,n,a.text,a.icon),i=i||a.text!==s.text.placed||a.icon!==s.icon.placed):(this.opacities[r]=new Ce(null,n,a.text,a.icon,a.skipFade),i=i||a.text||a.icon);}for(var l in o){var c=o[l];if(!this.opacities[l]){var h=new Ce(c,n,!1,!1);h.isHidden()||(this.opacities[l]=h,i=i||c.text.placed||c.icon.placed);}}i?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e);},Pe.prototype.updateLayerOpacities=function(t,e){for(var i={},n=0,o=e;n<o.length;n+=1){var r=o[n],a=r.getBucket(t);a&&r.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,i,r.collisionBoxArray);}},Pe.prototype.updateBucketOpacities=function(t,e,i){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasCollisionBoxData()&&t.collisionBox.collisionVertexArray.clear(),t.hasCollisionCircleData()&&t.collisionCircle.collisionVertexArray.clear();var n=t.layers[0].layout,o=new Ce(null,0,!1,!1,!0),r=n.get("text-allow-overlap"),a=n.get("icon-allow-overlap"),s=new Ce(null,0,r&&(a||!t.hasIconData()||n.get("icon-optional")),a&&(r||!t.hasTextData()||n.get("text-optional")),!0);!t.collisionArrays&&i&&(t.hasCollisionBoxData()||t.hasCollisionCircleData())&&t.deserializeCollisionBoxes(i);for(var l=0;l<t.symbolInstances.length;l++){var c=t.symbolInstances.get(l),h=e[c.crossTileID],u=this.opacities[c.crossTileID];h?u=o:u||(u=s,this.opacities[c.crossTileID]=u),e[c.crossTileID]=!0;var p=c.numGlyphVertices>0||c.numVerticalGlyphVertices>0,d=c.numIconVertices>0;if(p){for(var f=Fe(u.text),_=(c.numGlyphVertices+c.numVerticalGlyphVertices)/4,m=0;m<_;m++)t.text.opacityVertexArray.emplaceBack(f);t.text.placedSymbolArray.get(c.horizontalPlacedTextSymbolIndex).hidden=u.text.isHidden(),c.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(c.verticalPlacedTextSymbolIndex).hidden=u.text.isHidden());}if(d){for(var g=Fe(u.icon),v=0;v<c.numIconVertices/4;v++)t.icon.opacityVertexArray.emplaceBack(g);t.icon.placedSymbolArray.get(l).hidden=u.icon.isHidden();}if(t.hasCollisionBoxData()||t.hasCollisionCircleData()){var y=t.collisionArrays[l];if(y){y.textBox&&De(t.collisionBox.collisionVertexArray,u.text.placed,!1),y.iconBox&&De(t.collisionBox.collisionVertexArray,u.icon.placed,!1);var x=y.textCircles;if(x&&t.hasCollisionCircleData())for(var b=0;b<x.length;b+=5){var w=h||0===x[b+4];De(t.collisionCircle.collisionVertexArray,u.text.placed,w);}}}}t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasCollisionBoxData()&&t.collisionBox.collisionVertexBuffer&&t.collisionBox.collisionVertexBuffer.updateData(t.collisionBox.collisionVertexArray),t.hasCollisionCircleData()&&t.collisionCircle.collisionVertexBuffer&&t.collisionCircle.collisionVertexBuffer.updateData(t.collisionCircle.collisionVertexArray);},Pe.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration},Pe.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},Pe.prototype.stillRecent=function(t){return "undefined"!==this.commitTime&&this.commitTime+this.fadeDuration>t},Pe.prototype.setStale=function(){this.stale=!0;};var Re=Math.pow(2,25),Le=Math.pow(2,24),Ae=Math.pow(2,17),Me=Math.pow(2,16),ke=Math.pow(2,9),Be=Math.pow(2,8),Oe=Math.pow(2,1);function Fe(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*Re+e*Le+i*Ae+e*Me+i*ke+e*Be+i*Oe+e}var Ue=function(){this._currentTileIndex=0,this._seenCrossTileIDs={};};Ue.prototype.continuePlacement=function(t,e,i,n,o){for(;this._currentTileIndex<t.length;){var r=t[this._currentTileIndex];if(e.placeLayerTile(n,r,i,this._seenCrossTileIDs),this._currentTileIndex++,o())return !0}};var Ne=function(t,e,i,n,o,r){this.placement=new Pe(t,o,r),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=n,this._done=!1;};Ne.prototype.isDone=function(){return this._done},Ne.prototype.continuePlacement=function(e,i,n){for(var o=this,r=t.browser.now(),a=function(){var e=t.browser.now()-r;return !o._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=i[e[o._currentPlacementIndex]],l=o.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(o._inProgressLayer||(o._inProgressLayer=new Ue),o._inProgressLayer.continuePlacement(n[s.source],o.placement,o._showCollisionBoxes,s,a))return;delete o._inProgressLayer;}o._currentPlacementIndex--;}this._done=!0;},Ne.prototype.commit=function(t,e){return this.placement.commit(t,e),this.placement};var Ze=512/t.EXTENT/2,qe=function(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var n=0;n<e.length;n++){var o=e.get(n),r=o.key;this.indexedSymbolInstances[r]||(this.indexedSymbolInstances[r]=[]),this.indexedSymbolInstances[r].push({crossTileID:o.crossTileID,coord:this.getScaledCoordinates(o,t)});}};qe.prototype.getScaledCoordinates=function(e,i){var n=i.canonical.z-this.tileID.canonical.z,o=Ze/Math.pow(2,n);return {x:Math.floor((i.canonical.x*t.EXTENT+e.anchorX)*o),y:Math.floor((i.canonical.y*t.EXTENT+e.anchorY)*o)}},qe.prototype.findMatches=function(t,e,i){for(var n=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),o=0;o<t.length;o++){var r=t.get(o);if(!r.crossTileID){var a=this.indexedSymbolInstances[r.key];if(a)for(var s=this.getScaledCoordinates(r,e),l=0,c=a;l<c.length;l+=1){var h=c[l];if(Math.abs(h.coord.x-s.x)<=n&&Math.abs(h.coord.y-s.y)<=n&&!i[h.crossTileID]){i[h.crossTileID]=!0,r.crossTileID=h.crossTileID;break}}}}};var Ve=function(){this.maxCrossTileID=0;};Ve.prototype.generate=function(){return ++this.maxCrossTileID};var je=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0;};je.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var i in this.indexes){var n=this.indexes[i],o={};for(var r in n){var a=n[r];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),o[a.tileID.key]=a;}this.indexes[i]=o;}this.lng=t;},je.prototype.addBucket=function(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return !1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key]);}for(var n=0;n<e.symbolInstances.length;n++){e.symbolInstances.get(n).crossTileID=0;}this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var o=this.usedCrossTileIDs[t.overscaledZ];for(var r in this.indexes){var a=this.indexes[r];if(Number(r)>t.overscaledZ)for(var s in a){var l=a[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,o);}else{var c=a[t.scaledTo(Number(r)).key];c&&c.findMatches(e.symbolInstances,t,o);}}for(var h=0;h<e.symbolInstances.length;h++){var u=e.symbolInstances.get(h);u.crossTileID||(u.crossTileID=i.generate(),o[u.crossTileID]=!0);}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new qe(t,e.symbolInstances,e.bucketInstanceId),!0},je.prototype.removeBucketCrossTileIDs=function(t,e){for(var i in e.indexedSymbolInstances)for(var n=0,o=e.indexedSymbolInstances[i];n<o.length;n+=1){var r=o[n];delete this.usedCrossTileIDs[t][r.crossTileID];}},je.prototype.removeStaleBuckets=function(t){var e=!1;for(var i in this.indexes){var n=this.indexes[i];for(var o in n)t[n[o].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,n[o]),delete n[o],e=!0);}return e};var Ge=function(){this.layerIndexes={},this.crossTileIDs=new Ve,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={};};Ge.prototype.addLayer=function(t,e,i){var n=this.layerIndexes[t.id];void 0===n&&(n=this.layerIndexes[t.id]=new je);var o=!1,r={};n.handleWrapJump(i);for(var a=0,s=e;a<s.length;a+=1){var l=s[a],c=l.getBucket(t);c&&t.id===c.layerIds[0]&&(c.bucketInstanceId||(c.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(l.tileID,c,this.crossTileIDs)&&(o=!0),r[c.bucketInstanceId]=!0);}return n.removeStaleBuckets(r)&&(o=!0),o},Ge.prototype.pruneUnusedLayers=function(t){var e={};for(var i in t.forEach(function(t){e[t]=!0;}),this.layerIndexes)e[i]||delete this.layerIndexes[i];};var We=function(e,i){return t.emitValidationErrors(e,i&&i.filter(function(t){return "source.canvas"!==t.identifier}))},Xe=t.pick(Qt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),He=t.pick(Qt,["setCenter","setZoom","setBearing","setPitch"]),Ke=function(e){function i(n,o){var r=this;void 0===o&&(o={}),e.call(this),this.map=n,this.dispatcher=new O((Ht||(Ht=new Kt),Ht),this),this.imageManager=new C,this.glyphManager=new L(n._transformRequest,o.localIdeographFontFamily),this.lineAtlas=new B(256,512),this.crossTileSymbolIndex=new Ge,this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._resetUpdates();var a=this;this._rtlTextPluginCallback=i.registerForPluginAvailability(function(t){for(var e in a.dispatcher.broadcast("loadRTLTextPlugin",t.pluginURL,t.completionCallback),a.sourceCaches)a.sourceCaches[e].reload();}),this.on("data",function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=r.sourceCaches[t.sourceId];if(e){var i=e.getSource();if(i&&i.vectorLayerIds)for(var n in r._layers){var o=r._layers[n];o.source===i.id&&r._validateLayer(o);}}}});}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.loadURL=function(e,i){var n=this;void 0===i&&(i={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var o="boolean"==typeof i.validate?i.validate:!f(e);e=function(t,e){if(!f(t))return t;var i=b(t);return i.path="/styles/v1"+i.path,d(i,e)}(e,i.accessToken);var r=this.map._transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(r,function(e,i){n._request=null,e?n.fire(new t.ErrorEvent(e)):i&&n._load(i,o);});},i.prototype.loadJSON=function(e,i){var n=this;void 0===i&&(i={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame(function(){n._request=null,n._load(e,!1!==i.validate);});},i.prototype._load=function(e,i){var n=this;if(!i||!We(this,t.validateStyle(e))){for(var o in this._loaded=!0,this.stylesheet=e,e.sources)n.addSource(o,e.sources[o],{validate:!1});e.sprite?this._spriteRequest=function(e,i,n){var o,r,a,s=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(i(g(e,s,".json"),t.ResourceType.SpriteJSON),function(t,e){l=null,a||(a=t,o=e,h());}),c=t.getImage(i(g(e,s,".png"),t.ResourceType.SpriteImage),function(t,e){c=null,a||(a=t,r=e,h());});function h(){if(a)n(a);else if(o&&r){var e=t.browser.getImageData(r),i={};for(var s in o){var l=o[s],c=l.width,h=l.height,u=l.x,p=l.y,d=l.sdf,f=l.pixelRatio,_=new t.RGBAImage({width:c,height:h});t.RGBAImage.copy(e,_,{x:u,y:p},{x:0,y:0},{width:c,height:h}),i[s]={data:_,pixelRatio:f,sdf:d};}n(null,i);}}return {cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null);}}}(e.sprite,this.map._transformRequest,function(e,i){if(n._spriteRequest=null,e)n.fire(new t.ErrorEvent(e));else if(i)for(var o in i)n.imageManager.addImage(o,i[o]);n.imageManager.setLoaded(!0),n.fire(new t.Event("data",{dataType:"style"}));}):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var r=Jt(this.stylesheet.layers);this._order=r.map(function(t){return t.id}),this._layers={};for(var a=0,s=r;a<s.length;a+=1){var l=s[a];(l=t.createStyleLayer(l)).setEventedParent(n,{layer:{id:l.id}}),n._layers[l.id]=l;}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new k(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"));}},i.prototype._validateLayer=function(e){var i=this.sourceCaches[e.source];if(i){var n=e.sourceLayer;if(n){var o=i.getSource();("geojson"===o.type||o.vectorLayerIds&&-1===o.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+o.id+'" as specified by style layer "'+e.id+'"')));}}},i.prototype.loaded=function(){if(!this._loaded)return !1;if(Object.keys(this._updatedSources).length)return !1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return !1;return !!this.imageManager.isLoaded()},i.prototype._serializeLayers=function(t){for(var e=[],i=0,n=t;i<n.length;i+=1){var o=n[i],r=this._layers[o];"custom"!==r.type&&e.push(r.serialize());}return e},i.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return !0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return !0;for(var e in this._layers)if(this._layers[e].hasTransition())return !0;return !1},i.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},i.prototype.update=function(e){if(this._loaded){if(this._changed){var i=Object.keys(this._updatedLayers),n=Object.keys(this._removedLayers);for(var o in(i.length||n.length)&&this._updateWorkerLayers(i,n),this._updatedSources){var r=this._updatedSources[o];"reload"===r?this._reloadSource(o):"clear"===r&&this._clearSource(o);}for(var a in this._updatedPaintProps)this._layers[a].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates(),this.fire(new t.Event("data",{dataType:"style"}));}for(var s in this.sourceCaches)this.sourceCaches[s].used=!1;for(var l=0,c=this._order;l<c.length;l+=1){var h=c[l],u=this._layers[h];u.recalculate(e),!u.isHidden(e.zoom)&&u.source&&(this.sourceCaches[u.source].used=!0);}this.light.recalculate(e),this.z=e.zoom;}},i.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e});},i.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={};},i.prototype.setState=function(e){var i=this;if(this._checkLoaded(),We(this,t.validateStyle(e)))return !1;(e=t.clone(e)).layers=Jt(e.layers);var n=ae(this.serialize(),e).filter(function(t){return !(t.command in He)});if(0===n.length)return !1;var o=n.filter(function(t){return !(t.command in Xe)});if(o.length>0)throw new Error("Unimplemented: "+o.map(function(t){return t.command}).join(", ")+".");return n.forEach(function(t){"setTransition"!==t.command&&i[t.command].apply(i,t.args);}),this.stylesheet=e,!0},i.prototype.addImage=function(e,i){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,i),this.fire(new t.Event("data",{dataType:"style"}));},i.prototype.getImage=function(t){return this.imageManager.getImage(t)},i.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this.fire(new t.Event("data",{dataType:"style"}));},i.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},i.prototype.addSource=function(e,i,n){var o=this;if(this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!i.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(i).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(i.type)>=0)||!this._validate(t.validateStyle.source,"sources."+e,i,null,n)){this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);var r=this.sourceCaches[e]=new Vt(e,i,this.dispatcher);r.style=this,r.setEventedParent(this,function(){return {isSourceLoaded:o.loaded(),source:r.serialize(),sourceId:e}}),r.onAdd(this.map),this._changed=!0;}},i.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var i in this._layers)if(this._layers[i].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+i+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0;},i.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0;},i.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},i.prototype.addLayer=function(e,i,n){this._checkLoaded();var o=e.id;if(this.getLayer(o))this.fire(new t.ErrorEvent(new Error('Layer with id "'+o+'" already exists on this map')));else{var r;if("custom"===e.type){if(We(this,t.validateCustomStyleLayer(e)))return;r=t.createStyleLayer(e);}else{if("object"==typeof e.source&&(this.addSource(o,e.source),e=t.clone(e),e=t.extend(e,{source:o})),this._validate(t.validateStyle.layer,"layers."+o,e,{arrayIndex:-1},n))return;r=t.createStyleLayer(e),this._validateLayer(r),r.setEventedParent(this,{layer:{id:o}});}var a=i?this._order.indexOf(i):this._order.length;if(i&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.')));else{if(this._order.splice(a,0,o),this._layerOrderChanged=!0,this._layers[o]=r,this._removedLayers[o]&&r.source&&"custom"!==r.type){var s=this._removedLayers[o];delete this._removedLayers[o],s.type!==r.type?this._updatedSources[r.source]="clear":(this._updatedSources[r.source]="reload",this.sourceCaches[r.source].pause());}this._updateLayer(r),r.onAdd&&r.onAdd(this.map);}}},i.prototype.moveLayer=function(e,i){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==i){var n=this._order.indexOf(e);this._order.splice(n,1);var o=i?this._order.indexOf(i):this._order.length;i&&-1===o?this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.'))):(this._order.splice(o,0,e),this._layerOrderChanged=!0);}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")));},i.prototype.removeLayer=function(e){this._checkLoaded();var i=this._layers[e];if(i){i.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=i,delete this._layers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],i.onRemove&&i.onRemove(this.map);}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")));},i.prototype.getLayer=function(t){return this._layers[t]},i.prototype.setLayerZoomRange=function(e,i,n){this._checkLoaded();var o=this.getLayer(e);o?o.minzoom===i&&o.maxzoom===n||(null!=i&&(o.minzoom=i),null!=n&&(o.maxzoom=n),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")));},i.prototype.setFilter=function(e,i){this._checkLoaded();var n=this.getLayer(e);if(n){if(!t.isEqual(n.filter,i))return null===i||void 0===i?(n.filter=void 0,void this._updateLayer(n)):void(this._validate(t.validateStyle.filter,"layers."+n.id+".filter",i)||(n.filter=t.clone(i),this._updateLayer(n)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")));},i.prototype.getFilter=function(e){return t.clone(this.getLayer(e).filter)},i.prototype.setLayoutProperty=function(e,i,n){this._checkLoaded();var o=this.getLayer(e);o?t.isEqual(o.getLayoutProperty(i),n)||(o.setLayoutProperty(i,n),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")));},i.prototype.getLayoutProperty=function(t,e){return this.getLayer(t).getLayoutProperty(e)},i.prototype.setPaintProperty=function(e,i,n){this._checkLoaded();var o=this.getLayer(e);o?t.isEqual(o.getPaintProperty(i),n)||(o.setPaintProperty(i,n)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")));},i.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},i.prototype.setFeatureState=function(e,i){this._checkLoaded();var n=e.source,o=e.sourceLayer,r=this.sourceCaches[n],a=parseInt(e.id,10);void 0!==r?"vector"!==r.getSource().type||o?isNaN(a)||a<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative."))):r.setFeatureState(o,a,i):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types."))):this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")));},i.prototype.getFeatureState=function(e){this._checkLoaded();var i=e.source,n=e.sourceLayer,o=this.sourceCaches[i],r=parseInt(e.id,10);if(void 0!==o)if("vector"!==o.getSource().type||n){if(!(isNaN(r)||r<0))return o.getFeatureState(n,r);this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative.")));}else this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")));},i.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},i.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,function(t){return t.serialize()}),layers:this._serializeLayers(this._order)},function(t){return void 0!==t})},i.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0;},i.prototype._flattenRenderedFeatures=function(t){for(var e=[],i=this._order.length-1;i>=0;i--)for(var n=this._order[i],o=0,r=t;o<r.length;o+=1){var a=r[o][n];if(a)for(var s=0,l=a;s<l.length;s+=1){var c=l[s];e.push(c);}}return e},i.prototype.queryRenderedFeatures=function(e,i,n){i&&i.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",i.filter);var o={};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var r=0,a=i.layers;r<a.length;r+=1){var s=a[r],l=this._layers[s];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];o[l.source]=!0;}}var c=[],h=e.map(function(t){return n.pointCoordinate(t)});for(var u in this.sourceCaches)i.layers&&!o[u]||c.push(J(this.sourceCaches[u],this._layers,h,i,n));return this.placement&&c.push(function(t,e,i,n,o,r){for(var a={},s=o.queryRenderedSymbols(i),l=[],c=0,h=Object.keys(s).map(Number);c<h.length;c+=1){var u=h[c];l.push(r[u]);}l.sort(Q);for(var p=function(){var e=f[d],i=e.featureIndex.lookupSymbolFeatures(s[e.bucketInstanceId],e.bucketIndex,e.sourceLayerIndex,n.filter,n.layers,t);for(var o in i){var r=a[o]=a[o]||[],l=i[o];l.sort(function(t,i){var n=e.featureSortOrder;if(n){var o=n.indexOf(t.featureIndex);return n.indexOf(i.featureIndex)-o}return i.featureIndex-t.featureIndex});for(var c=0,h=l;c<h.length;c+=1){var u=h[c];r.push(u.feature);}}},d=0,f=l;d<f.length;d+=1)p();var _=function(i){a[i].forEach(function(n){var o=t[i],r=e[o.source].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;});};for(var m in a)_(m);return a}(this._layers,this.sourceCaches,e,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenRenderedFeatures(c)},i.prototype.querySourceFeatures=function(e,i){i&&i.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",i.filter);var n=this.sourceCaches[e];return n?function(t,e){for(var i=t.getRenderableIds().map(function(e){return t.getTileByID(e)}),n=[],o={},r=0;r<i.length;r++){var a=i[r],s=a.tileID.canonical.key;o[s]||(o[s]=!0,a.querySourceFeatures(n,e));}return n}(n,i):[]},i.prototype.addSourceType=function(t,e,n){return i.getSourceType(t)?n(new Error('A source type called "'+t+'" already exists.')):(i.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},n):n(null,null))},i.prototype.getLight=function(){return this.light.getLight()},i.prototype.setLight=function(e){this._checkLoaded();var i=this.light.getLight(),n=!1;for(var o in e)if(!t.isEqual(e[o],i[o])){n=!0;break}if(n){var r={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e),this.light.updateTransitions(r);}},i.prototype._validate=function(e,i,n,o,r){return (!r||!1!==r.validate)&&We(this,e.call(t.validateStyle,t.extend({key:i,style:this.serialize(),value:n,styleSpec:t.styleSpec},o)))},i.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginAvailable",this._rtlTextPluginCallback),this.sourceCaches)this.sourceCaches[e].clearTiles();this.dispatcher.remove();},i.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles();},i.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload();},i.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t);},i.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t);},i.prototype._updatePlacement=function(e,i,n,o){for(var r=!1,a=!1,s={},l=0,c=this._order;l<c.length;l+=1){var h=c[l],u=this._layers[h];if("symbol"===u.type){if(!s[u.source]){var p=this.sourceCaches[u.source];s[u.source]=p.getRenderableIds(!0).map(function(t){return p.getTileByID(t)}).sort(function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)});}var d=this.crossTileSymbolIndex.addLayer(u,s[u.source],e.center.lng);r=r||d;}}this.crossTileSymbolIndex.pruneUnusedLayers(this._order);var f=this._layerOrderChanged;if((f||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now()))&&(this.pauseablePlacement=new Ne(e,this._order,f,i,n,o),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(this.placement,t.browser.now()),a=!0),r&&this.pauseablePlacement.placement.setStale()),a||r)for(var _=0,m=this._order;_<m.length;_+=1){var g=m[_],v=this._layers[g];"symbol"===v.type&&this.placement.updateLayerOpacities(v,s[v.source]);}return !this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},i.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles();},i.prototype.getImages=function(t,e,i){this.imageManager.getImages(e.icons,i);},i.prototype.getGlyphs=function(t,e,i){this.glyphManager.getGlyphs(e.stacks,i);},i}(t.Evented);Ke.getSourceType=function(t){return K[t]},Ke.setSourceType=function(t,e){K[t]=e;},Ke.registerForPluginAvailability=t.registerForPluginAvailability;var Ye=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),Je={prelude:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif\n\n// Unpack a pair of values that have been packed into a single float.\n// The packed values are assumed to be 8-bit unsigned integers, and are\n// packed like so:\n// packedValue = floor(input[0]) * 256 + input[1],\nvec2 unpack_float(const float packedValue) {\n int packedIntValue = int(packedValue);\n int v0 = packedIntValue / 256;\n return vec2(v0, packedIntValue - v0 * 256);\n}\n\nvec2 unpack_opacity(const float packedOpacity) {\n int intOpacity = int(packedOpacity) / 2;\n return vec2(float(intOpacity) / 127.0, mod(packedOpacity, 2.0));\n}\n\n// To minimize the number of attributes needed, we encode a 4-component\n// color into a pair of floats (i.e. a vec2) as follows:\n// [ floor(color.r * 255) * 256 + color.g * 255,\n// floor(color.b * 255) * 256 + color.g * 255 ]\nvec4 decode_color(const vec2 encodedColor) {\n return vec4(\n unpack_float(encodedColor[0]) / 255.0,\n unpack_float(encodedColor[1]) / 255.0\n );\n}\n\n// Unpack a pair of paint values and interpolate between them.\nfloat unpack_mix_vec2(const vec2 packedValue, const float t) {\n return mix(packedValue[0], packedValue[1], t);\n}\n\n// Unpack a pair of paint values and interpolate between them.\nvec4 unpack_mix_color(const vec4 packedColors, const float t) {\n vec4 minColor = decode_color(vec2(packedColors[0], packedColors[1]));\n vec4 maxColor = decode_color(vec2(packedColors[2], packedColors[3]));\n return mix(minColor, maxColor, t);\n}\n\n// The offset depends on how many pixels are between the world origin and the edge of the tile:\n// vec2 offset = mod(pixel_coord, size)\n//\n// At high zoom levels there are a ton of pixels between the world origin and the edge of the tile.\n// The glsl spec only guarantees 16 bits of precision for highp floats. We need more than that.\n//\n// The pixel_coord is passed in as two 16 bit values:\n// pixel_coord_upper = floor(pixel_coord / 2^16)\n// pixel_coord_lower = mod(pixel_coord, 2^16)\n//\n// The offset is calculated in a series of steps that should preserve this precision:\nvec2 get_pattern_pos(const vec2 pixel_coord_upper, const vec2 pixel_coord_lower,\n const vec2 pattern_size, const float tile_units_to_pixels, const vec2 pos) {\n\n vec2 offset = mod(mod(mod(pixel_coord_upper, pattern_size) * 256.0, pattern_size) * 256.0 + pixel_coord_lower, pattern_size);\n return (tile_units_to_pixels * pos + offset) / pattern_size;\n}\n"},background:{fragmentSource:"uniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main() {\n gl_FragColor = u_color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},backgroundPattern:{fragmentSource:"uniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform vec2 u_texsize;\nuniform float u_mix;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a / u_texsize, u_pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b / u_texsize, u_pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n 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);\n 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);\n}\n"},circle:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec3 v_data;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize highp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n vec2 extrude = v_data.xy;\n float extrude_length = length(extrude);\n\n lowp float antialiasblur = v_data.z;\n float antialiased_blur = -max(blur, antialiasblur);\n\n float opacity_t = smoothstep(0.0, antialiased_blur, extrude_length - 1.0);\n\n float color_t = stroke_width < 0.01 ? 0.0 : smoothstep(\n antialiased_blur,\n 0.0,\n extrude_length - radius / (radius + stroke_width)\n );\n\n gl_FragColor = opacity_t * mix(color * opacity, stroke_color * stroke_opacity, color_t);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform bool u_scale_with_map;\nuniform bool u_pitch_with_map;\nuniform vec2 u_extrude_scale;\nuniform highp float u_camera_to_center_distance;\n\nattribute vec2 a_pos;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\n\nvarying vec3 v_data;\n\nvoid main(void) {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize mediump float radius\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize highp vec4 stroke_color\n #pragma mapbox: initialize mediump float stroke_width\n #pragma mapbox: initialize lowp float stroke_opacity\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n vec2 extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n vec2 circle_center = floor(a_pos * 0.5);\n if (u_pitch_with_map) {\n vec2 corner_position = circle_center;\n if (u_scale_with_map) {\n corner_position += extrude * (radius + stroke_width) * u_extrude_scale;\n } else {\n // Pitching the circle with the map effectively scales it with the map\n // To counteract the effect for pitch-scale: viewport, we rescale the\n // whole circle based on the pitch scaling effect at its central point\n vec4 projected_center = u_matrix * vec4(circle_center, 0, 1);\n corner_position += extrude * (radius + stroke_width) * u_extrude_scale * (projected_center.w / u_camera_to_center_distance);\n }\n\n gl_Position = u_matrix * vec4(corner_position, 0, 1);\n } else {\n gl_Position = u_matrix * vec4(circle_center, 0, 1);\n\n if (u_scale_with_map) {\n gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * u_camera_to_center_distance;\n } else {\n gl_Position.xy += extrude * (radius + stroke_width) * u_extrude_scale * gl_Position.w;\n }\n }\n\n // This is a minimum blur distance that serves as a faux-antialiasing for\n // the circle. since blur is a ratio of the circle's size and the intent is\n // to keep the blur at roughly 1px, the two are inversely related.\n lowp float antialiasblur = 1.0 / DEVICE_PIXEL_RATIO / (radius + stroke_width);\n\n v_data = vec3(extrude.x, extrude.y, antialiasblur);\n}\n"},clippingMask:{fragmentSource:"void main() {\n gl_FragColor = vec4(1.0);\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},heatmap:{fragmentSource:"#pragma mapbox: define highp float weight\n\nuniform highp float u_intensity;\nvarying vec2 v_extrude;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main() {\n #pragma mapbox: initialize highp float weight\n\n // Kernel density estimation with a Gaussian kernel of size 5x5\n float d = -0.5 * 3.0 * 3.0 * dot(v_extrude, v_extrude);\n float val = weight * u_intensity * GAUSS_COEF * exp(d);\n\n gl_FragColor = vec4(val, 1.0, 1.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\n\nuniform mat4 u_matrix;\nuniform float u_extrude_scale;\nuniform float u_opacity;\nuniform float u_intensity;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_extrude;\n\n// Effective \"0\" in the kernel density texture to adjust the kernel size to;\n// this empirically chosen number minimizes artifacts on overlapping kernels\n// for typical heatmap cases (assuming clustered source)\nconst highp float ZERO = 1.0 / 255.0 / 16.0;\n\n// Gaussian kernel coefficient: 1 / sqrt(2 * PI)\n#define GAUSS_COEF 0.3989422804014327\n\nvoid main(void) {\n #pragma mapbox: initialize highp float weight\n #pragma mapbox: initialize mediump float radius\n\n // unencode the extrusion vector that we snuck into the a_pos vector\n vec2 unscaled_extrude = vec2(mod(a_pos, 2.0) * 2.0 - 1.0);\n\n // This 'extrude' comes in ranging from [-1, -1], to [1, 1]. We'll use\n // it to produce the vertices of a square mesh framing the point feature\n // we're adding to the kernel density texture. We'll also pass it as\n // a varying, so that the fragment shader can determine the distance of\n // each fragment from the point feature.\n // Before we do so, we need to scale it up sufficiently so that the\n // kernel falls effectively to zero at the edge of the mesh.\n // That is, we want to know S such that\n // weight * u_intensity * GAUSS_COEF * exp(-0.5 * 3.0^2 * S^2) == ZERO\n // Which solves to:\n // S = sqrt(-2.0 * log(ZERO / (weight * u_intensity * GAUSS_COEF))) / 3.0\n float S = sqrt(-2.0 * log(ZERO / weight / u_intensity / GAUSS_COEF)) / 3.0;\n\n // Pass the varying in units of radius\n v_extrude = S * unscaled_extrude;\n\n // Scale by radius and the zoom-based scale factor to produce actual\n // mesh position\n vec2 extrude = v_extrude * radius * u_extrude_scale;\n\n // multiply a_pos by 0.5, since we had it * 2 in order to sneak\n // in extrusion data\n vec4 pos = vec4(floor(a_pos * 0.5) + extrude, 0, 1);\n\n gl_Position = u_matrix * pos;\n}\n"},heatmapTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform sampler2D u_color_ramp;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n float t = texture2D(u_image, v_pos).r;\n vec4 color = texture2D(u_color_ramp, vec2(t, 0.5));\n gl_FragColor = color * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n"},collisionBox:{fragmentSource:"\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n\n float alpha = 0.5;\n\n // Red = collision, hide label\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n gl_FragColor *= .1;\n }\n}",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = clamp(\n 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance),\n 0.0, // Prevents oversized near-field boxes in pitched/overzoomed tiles\n 4.0);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n gl_Position.xy += a_extrude * u_extrude_scale * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n}\n"},collisionCircle:{fragmentSource:"uniform float u_overscale_factor;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n float alpha = 0.5;\n\n // Red = collision, hide label\n vec4 color = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n\n // Blue = no collision, label is showing\n if (v_placed > 0.5) {\n color = vec4(0.0, 0.0, 1.0, 0.5) * alpha;\n }\n\n if (v_notUsed > 0.5) {\n // This box not used, fade it out\n color *= .2;\n }\n\n float extrude_scale_length = length(v_extrude_scale);\n float extrude_length = length(v_extrude) * extrude_scale_length;\n float stroke_width = 15.0 * extrude_scale_length / u_overscale_factor;\n float radius = v_radius * extrude_scale_length;\n\n float distance_to_edge = abs(extrude_length - radius);\n float opacity_t = smoothstep(-stroke_width, 0.0, -distance_to_edge);\n\n gl_FragColor = opacity_t * color;\n}\n",vertexSource:"attribute vec2 a_pos;\nattribute vec2 a_anchor_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_placed;\n\nuniform mat4 u_matrix;\nuniform vec2 u_extrude_scale;\nuniform float u_camera_to_center_distance;\n\nvarying float v_placed;\nvarying float v_notUsed;\nvarying float v_radius;\n\nvarying vec2 v_extrude;\nvarying vec2 v_extrude_scale;\n\nvoid main() {\n vec4 projectedPoint = u_matrix * vec4(a_anchor_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n highp float collision_perspective_ratio = clamp(\n 0.5 + 0.5 * (u_camera_to_center_distance / camera_to_anchor_distance),\n 0.0, // Prevents oversized near-field circles in pitched/overzoomed tiles\n 4.0);\n\n gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n\n highp float padding_factor = 1.2; // Pad the vertices slightly to make room for anti-alias blur\n gl_Position.xy += a_extrude * u_extrude_scale * padding_factor * gl_Position.w * collision_perspective_ratio;\n\n v_placed = a_placed.x;\n v_notUsed = a_placed.y;\n v_radius = abs(a_extrude.y); // We don't pitch the circles, so both units of the extrusion vector are equal in magnitude to the radius\n\n v_extrude = a_extrude * padding_factor;\n v_extrude_scale = u_extrude_scale * u_camera_to_center_distance * collision_perspective_ratio;\n}\n"},debug:{fragmentSource:"uniform highp vec4 u_color;\n\nvoid main() {\n gl_FragColor = u_color;\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fill:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_FragColor = color * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n}\n"},fillOutline:{fragmentSource:"#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"attribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillOutlinePattern:{fragmentSource:"\nuniform vec2 u_texsize;\nuniform sampler2D u_image;\nuniform float u_fade;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n vec2 pattern_tl_a = pattern_from.xy;\n vec2 pattern_br_a = pattern_from.zw;\n vec2 pattern_tl_b = pattern_to.xy;\n vec2 pattern_br_b = pattern_to.zw;\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = 1.0 - smoothstep(0.0, 1.0, dist);\n\n\n gl_FragColor = mix(color1, color2, u_fade) * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform vec4 u_scale;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n vec2 pattern_tl_a = pattern_from.xy;\n vec2 pattern_br_a = pattern_from.zw;\n vec2 pattern_tl_b = pattern_to.xy;\n vec2 pattern_br_b = pattern_to.zw;\n\n float pixelRatio = u_scale.x;\n float tileRatio = u_scale.y;\n float fromScale = u_scale.z;\n float toScale = u_scale.w;\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio);\n vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileRatio, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileRatio, a_pos);\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},fillPattern:{fragmentSource:"uniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n vec2 pattern_tl_a = pattern_from.xy;\n vec2 pattern_br_a = pattern_from.zw;\n vec2 pattern_tl_b = pattern_to.xy;\n vec2 pattern_br_b = pattern_to.zw;\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_fade) * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform vec4 u_scale;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n vec2 pattern_tl_a = pattern_from.xy;\n vec2 pattern_br_a = pattern_from.zw;\n vec2 pattern_tl_b = pattern_to.xy;\n vec2 pattern_br_b = pattern_to.zw;\n\n float pixelRatio = u_scale.x;\n float tileZoomRatio = u_scale.y;\n float fromScale = u_scale.z;\n float toScale = u_scale.w;\n\n vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio);\n vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio);\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileZoomRatio, a_pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileZoomRatio, a_pos);\n}\n"},fillExtrusion:{fragmentSource:"varying vec4 v_color;\n\nvoid main() {\n gl_FragColor = v_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\nuniform float u_vertical_gradient;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec4 v_color;\n\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n\n#pragma mapbox: define highp vec4 color\n\nvoid main() {\n #pragma mapbox: initialize highp float base\n #pragma mapbox: initialize highp float height\n #pragma mapbox: initialize highp vec4 color\n\n vec3 normal = a_normal_ed.xyz;\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n\n gl_Position = u_matrix * vec4(a_pos, t > 0.0 ? height : base, 1);\n\n // Relative luminance (how dark/bright is the surface color?)\n float colorvalue = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;\n\n v_color = vec4(0.0, 0.0, 0.0, 1.0);\n\n // Add slight ambient lighting so no extrusions are totally black\n vec4 ambientlight = vec4(0.03, 0.03, 0.03, 1.0);\n color += ambientlight;\n\n // Calculate cos(theta), where theta is the angle between surface normal and diffuse light ray\n float directional = clamp(dot(normal / 16384.0, u_lightpos), 0.0, 1.0);\n\n // Adjust directional so that\n // the range of values for highlight/shading is narrower\n // with lower light intensity\n // and with lighter/brighter surface colors\n directional = mix((1.0 - u_lightintensity), max((1.0 - colorvalue + u_lightintensity), 1.0), directional);\n\n // Add gradient along z axis of side surfaces\n if (normal.y != 0.0) {\n // This avoids another branching statement, but multiplies by a constant of 0.84 if no vertical gradient,\n // and otherwise calculates the gradient based on base + height\n directional *= (\n (1.0 - u_vertical_gradient) +\n (u_vertical_gradient * clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0)));\n }\n\n // Assign final color based on surface + ambient light color, diffuse light directional, and light color\n // with lower bounds adjusted to hue of light\n // so that shading is tinted with the complementary (opposite) color to the light color\n v_color.r += clamp(color.r * directional * u_lightcolor.r, mix(0.0, 0.3, 1.0 - u_lightcolor.r), 1.0);\n v_color.g += clamp(color.g * directional * u_lightcolor.g, mix(0.0, 0.3, 1.0 - u_lightcolor.g), 1.0);\n v_color.b += clamp(color.b * directional * u_lightcolor.b, mix(0.0, 0.3, 1.0 - u_lightcolor.b), 1.0);\n}\n"},fillExtrusionPattern:{fragmentSource:"uniform vec2 u_texsize;\nuniform float u_fade;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n vec2 pattern_tl_a = pattern_from.xy;\n vec2 pattern_br_a = pattern_from.zw;\n vec2 pattern_tl_b = pattern_to.xy;\n vec2 pattern_br_b = pattern_to.zw;\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n vec4 mixedColor = mix(color1, color2, u_fade);\n\n gl_FragColor = mixedColor * v_lighting;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_height_factor;\nuniform vec4 u_scale;\nuniform float u_vertical_gradient;\n\nuniform vec3 u_lightcolor;\nuniform lowp vec3 u_lightpos;\nuniform lowp float u_lightintensity;\n\nattribute vec2 a_pos;\nattribute vec4 a_normal_ed;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec4 v_lighting;\n\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n #pragma mapbox: initialize lowp float base\n #pragma mapbox: initialize lowp float height\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n vec2 pattern_tl_a = pattern_from.xy;\n vec2 pattern_br_a = pattern_from.zw;\n vec2 pattern_tl_b = pattern_to.xy;\n vec2 pattern_br_b = pattern_to.zw;\n\n float pixelRatio = u_scale.x;\n float tileRatio = u_scale.y;\n float fromScale = u_scale.z;\n float toScale = u_scale.w;\n\n vec3 normal = a_normal_ed.xyz;\n float edgedistance = a_normal_ed.w;\n\n vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio);\n vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio);\n\n base = max(0.0, base);\n height = max(0.0, height);\n\n float t = mod(normal.x, 2.0);\n float z = t > 0.0 ? height : base;\n\n gl_Position = u_matrix * vec4(a_pos, z, 1);\n\n vec2 pos = normal.x == 1.0 && normal.y == 0.0 && normal.z == 16384.0\n ? a_pos // extrusion top\n : vec2(edgedistance, z * u_height_factor); // extrusion side\n\n v_pos_a = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, fromScale * display_size_a, tileRatio, pos);\n v_pos_b = get_pattern_pos(u_pixel_coord_upper, u_pixel_coord_lower, toScale * display_size_b, tileRatio, pos);\n\n v_lighting = vec4(0.0, 0.0, 0.0, 1.0);\n float directional = clamp(dot(normal / 16383.0, u_lightpos), 0.0, 1.0);\n directional = mix((1.0 - u_lightintensity), max((0.5 + u_lightintensity), 1.0), directional);\n\n if (normal.y != 0.0) {\n // This avoids another branching statement, but multiplies by a constant of 0.84 if no vertical gradient,\n // and otherwise calculates the gradient based on base + height\n directional *= (\n (1.0 - u_vertical_gradient) +\n (u_vertical_gradient * clamp((t + base) * pow(height / 150.0, 0.5), mix(0.7, 0.98, 1.0 - u_lightintensity), 1.0)));\n }\n\n v_lighting.rgb += clamp(directional * u_lightcolor, mix(vec3(0.0), vec3(0.3), 1.0 - u_lightcolor), vec3(1.0));\n}\n"},extrusionTexture:{fragmentSource:"uniform sampler2D u_image;\nuniform float u_opacity;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_FragColor = texture2D(u_image, v_pos) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(0.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_world;\nattribute vec2 a_pos;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos * u_world, 0, 1);\n\n v_pos.x = a_pos.x;\n v_pos.y = 1.0 - a_pos.y;\n}\n"},hillshadePrepare:{fragmentSource:"#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D u_image;\nvarying vec2 v_pos;\nuniform vec2 u_dimension;\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nfloat getElevation(vec2 coord, float bias) {\n // Convert encoded elevation value to meters\n vec4 data = texture2D(u_image, coord) * 255.0;\n return (data.r + data.g * 256.0 + data.b * 256.0 * 256.0) / 4.0;\n}\n\nvoid main() {\n vec2 epsilon = 1.0 / u_dimension;\n\n // queried pixels:\n // +-----------+\n // | | | |\n // | a | b | c |\n // | | | |\n // +-----------+\n // | | | |\n // | d | e | f |\n // | | | |\n // +-----------+\n // | | | |\n // | g | h | i |\n // | | | |\n // +-----------+\n\n float a = getElevation(v_pos + vec2(-epsilon.x, -epsilon.y), 0.0);\n float b = getElevation(v_pos + vec2(0, -epsilon.y), 0.0);\n float c = getElevation(v_pos + vec2(epsilon.x, -epsilon.y), 0.0);\n float d = getElevation(v_pos + vec2(-epsilon.x, 0), 0.0);\n float e = getElevation(v_pos, 0.0);\n float f = getElevation(v_pos + vec2(epsilon.x, 0), 0.0);\n float g = getElevation(v_pos + vec2(-epsilon.x, epsilon.y), 0.0);\n float h = getElevation(v_pos + vec2(0, epsilon.y), 0.0);\n float i = getElevation(v_pos + vec2(epsilon.x, epsilon.y), 0.0);\n\n // here we divide the x and y slopes by 8 * pixel size\n // where pixel size (aka meters/pixel) is:\n // circumference of the world / (pixels per tile * number of tiles)\n // which is equivalent to: 8 * 40075016.6855785 / (512 * pow(2, u_zoom))\n // which can be reduced to: pow(2, 19.25619978527 - u_zoom)\n // we want to vertically exaggerate the hillshading though, because otherwise\n // it is barely noticeable at low zooms. to do this, we multiply this by some\n // scale factor pow(2, (u_zoom - u_maxzoom) * a) where a is an arbitrary value\n // Here we use a=0.3 which works out to the expression below. see \n // nickidlugash's awesome breakdown for more info\n // https://github.com/mapbox/mapbox-gl-js/pull/5286#discussion_r148419556\n float exaggeration = u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\n\n vec2 deriv = vec2(\n (c + f + f + i) - (a + d + d + g),\n (g + h + h + i) - (a + b + b + c)\n ) / pow(2.0, (u_zoom - u_maxzoom) * exaggeration + 19.2562 - u_zoom);\n\n gl_FragColor = clamp(vec4(\n deriv.x / 2.0 + 0.5,\n deriv.y / 2.0 + 0.5,\n 1.0,\n 1.0), 0.0, 1.0);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (a_texture_pos / 8192.0) / 2.0 + 0.25;\n}\n"},hillshade:{fragmentSource:"uniform sampler2D u_image;\nvarying vec2 v_pos;\n\nuniform vec2 u_latrange;\nuniform vec2 u_light;\nuniform vec4 u_shadow;\nuniform vec4 u_highlight;\nuniform vec4 u_accent;\n\n#define PI 3.141592653589793\n\nvoid main() {\n vec4 pixel = texture2D(u_image, v_pos);\n\n vec2 deriv = ((pixel.rg * 2.0) - 1.0);\n\n // We divide the slope by a scale factor based on the cosin of the pixel's approximate latitude\n // to account for mercator projection distortion. see #4807 for details\n float scaleFactor = cos(radians((u_latrange[0] - u_latrange[1]) * (1.0 - v_pos.y) + u_latrange[1]));\n // We also multiply the slope by an arbitrary z-factor of 1.25\n float slope = atan(1.25 * length(deriv) / scaleFactor);\n float aspect = deriv.x != 0.0 ? atan(deriv.y, -deriv.x) : PI / 2.0 * (deriv.y > 0.0 ? 1.0 : -1.0);\n\n float intensity = u_light.x;\n // We add PI to make this property match the global light object, which adds PI/2 to the light's azimuthal\n // position property to account for 0deg corresponding to north/the top of the viewport in the style spec\n // and the original shader was written to accept (-illuminationDirection - 90) as the azimuthal.\n float azimuth = u_light.y + PI;\n\n // We scale the slope exponentially based on intensity, using a calculation similar to\n // the exponential interpolation function in the style spec:\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/expression/definitions/interpolate.js#L217-L228\n // so that higher intensity values create more opaque hillshading.\n float base = 1.875 - intensity * 1.75;\n float maxValue = 0.5 * PI;\n float scaledSlope = intensity != 0.5 ? ((pow(base, slope) - 1.0) / (pow(base, maxValue) - 1.0)) * maxValue : slope;\n\n // The accent color is calculated with the cosine of the slope while the shade color is calculated with the sine\n // so that the accent color's rate of change eases in while the shade color's eases out.\n float accent = cos(scaledSlope);\n // We multiply both the accent and shade color by a clamped intensity value\n // so that intensities >= 0.5 do not additionally affect the color values\n // while intensity values < 0.5 make the overall color more transparent.\n vec4 accent_color = (1.0 - accent) * u_accent * clamp(intensity * 2.0, 0.0, 1.0);\n float shade = abs(mod((aspect + azimuth) / PI + 0.5, 2.0) - 1.0);\n vec4 shade_color = mix(u_shadow, u_highlight, shade) * sin(scaledSlope) * clamp(intensity * 2.0, 0.0, 1.0);\n gl_FragColor = accent_color * (1.0 - shade_color.a) + shade_color;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = a_texture_pos / 8192.0;\n}\n"},line:{fragmentSource:"#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\nvarying highp float v_linesofar;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n v_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},lineGradient:{fragmentSource:"\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nuniform sampler2D u_image;\n\nvarying vec2 v_width2;\nvarying vec2 v_normal;\nvarying float v_gamma_scale;\nvarying highp float v_lineprogress;\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n // For gradient lines, v_lineprogress is the ratio along the entire line,\n // scaled to [0, 2^15), and the gradient ramp is stored in a texture.\n vec4 color = texture2D(u_image, vec2(v_lineprogress, 0.5));\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"\n// the attribute conveying progress along a line is scaled to [0, 2^15)\n#define MAX_LINE_DISTANCE 32767.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_gamma_scale;\nvarying highp float v_lineprogress;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n\n v_lineprogress = (floor(a_data.z / 4.0) + a_data.w * 64.0) * 2.0 / MAX_LINE_DISTANCE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_width2 = vec2(outset, inset);\n}\n"},linePattern:{fragmentSource:"uniform vec2 u_texsize;\nuniform float u_fade;\nuniform mediump vec4 u_scale;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n\n vec2 pattern_tl_a = pattern_from.xy;\n vec2 pattern_br_a = pattern_from.zw;\n vec2 pattern_tl_b = pattern_to.xy;\n vec2 pattern_br_b = pattern_to.zw;\n\n float pixelRatio = u_scale.x;\n float tileZoomRatio = u_scale.y;\n float fromScale = u_scale.z;\n float toScale = u_scale.w;\n\n vec2 display_size_a = vec2((pattern_br_a.x - pattern_tl_a.x) / pixelRatio, (pattern_br_a.y - pattern_tl_a.y) / pixelRatio);\n vec2 display_size_b = vec2((pattern_br_b.x - pattern_tl_b.x) / pixelRatio, (pattern_br_b.y - pattern_tl_b.y) / pixelRatio);\n\n vec2 pattern_size_a = vec2(display_size_a.x * fromScale / tileZoomRatio, display_size_a.y);\n vec2 pattern_size_b = vec2(display_size_b.x * toScale / tileZoomRatio, display_size_b.y);\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / pattern_size_b.x, 1.0);\n\n // v_normal.y is 0 at the midpoint of the line, -1 at the lower edge, 1 at the upper edge\n // we clamp the line width outset to be between 0 and half the pattern height plus padding (2.0)\n // to ensure we don't sample outside the designated symbol on the sprite sheet.\n // 0.5 is added to shift the component to be bounded between 0 and 1 for interpolation of\n // the texture coordinate\n float y_a = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (pattern_size_a.y + 2.0) / 2.0) / pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * clamp(v_width2.s, 0.0, (pattern_size_b.y + 2.0) / 2.0) / pattern_size_b.y);\n vec2 pos_a = mix(pattern_tl_a / u_texsize, pattern_br_a / u_texsize, vec2(x_a, y_a));\n vec2 pos_b = mix(pattern_tl_b / u_texsize, pattern_br_b / u_texsize, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n gl_FragColor = color * alpha * opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform vec2 u_gl_units_to_pixels;\nuniform mediump float u_ratio;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n\nvoid main() {\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize mediump vec4 pattern_from\n #pragma mapbox: initialize mediump vec4 pattern_to\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n // float tileRatio = u_scale.y;\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_linesofar = a_linesofar;\n v_width2 = vec2(outset, inset);\n}\n"},lineSDF:{fragmentSource:"\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_width2.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_width2.t) or when fading out\n // (v_width2.s)\n float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * v_gamma_scale;\n float alpha = clamp(min(dist - (v_width2.t - blur2), v_width2.s - dist) / blur2, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma / floorwidth, 0.5 + u_sdfgamma / floorwidth, sdfdist);\n\n gl_FragColor = color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\n// the distance over which the line edge fades out.\n// Retina devices need a smaller distance to avoid aliasing.\n#define ANTIALIASING 1.0 / DEVICE_PIXEL_RATIO / 2.0\n\nattribute vec4 a_pos_normal;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform vec2 u_gl_units_to_pixels;\n\nvarying vec2 v_normal;\nvarying vec2 v_width2;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 color\n #pragma mapbox: initialize lowp float blur\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize mediump float gapwidth\n #pragma mapbox: initialize lowp float offset\n #pragma mapbox: initialize mediump float width\n #pragma mapbox: initialize lowp float floorwidth\n\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n vec2 pos = a_pos_normal.xy;\n\n // x is 1 if it's a round cap, 0 otherwise\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = a_pos_normal.zw;\n v_normal = normal;\n\n // these transformations used to be applied in the JS and native code bases.\n // moved them into the shader for clarity and simplicity.\n gapwidth = gapwidth / 2.0;\n float halfwidth = width / 2.0;\n offset = -1.0 * offset;\n\n float inset = gapwidth + (gapwidth > 0.0 ? ANTIALIASING : 0.0);\n float outset = gapwidth + halfwidth * (gapwidth > 0.0 ? 2.0 : 1.0) + (halfwidth == 0.0 ? 0.0 : ANTIALIASING);\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist =outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset2 = offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n vec4 projected_extrude = u_matrix * vec4(dist / u_ratio, 0.0, 0.0);\n gl_Position = u_matrix * vec4(pos + offset2 / u_ratio, 0.0, 1.0) + projected_extrude;\n\n // calculate how much the perspective view squishes or stretches the extrude\n float extrude_length_without_perspective = length(dist);\n float extrude_length_with_perspective = length(projected_extrude.xy / gl_Position.w * u_gl_units_to_pixels);\n v_gamma_scale = extrude_length_without_perspective / extrude_length_with_perspective;\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x / floorwidth, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x / floorwidth, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n v_width2 = vec2(outset, inset);\n}\n"},raster:{fragmentSource:"uniform float u_fade_t;\nuniform float u_opacity;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n if (color0.a > 0.0) {\n color0.rgb = color0.rgb / color0.a;\n }\n if (color1.a > 0.0) {\n color1.rgb = color1.rgb / color1.a;\n }\n vec4 color = mix(color0, color1, u_fade_t);\n color.a *= u_opacity;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb) * color.a, color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"uniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n // We are using Int16 for texture position coordinates to give us enough precision for\n // fractional coordinates. We use 8192 to scale the texture coordinates in the buffer\n // as an arbitrarily high number to preserve adequate precision when rendering.\n // This is also the same value as the EXTENT we are using for our tile buffer pos coordinates,\n // so math for modifying either is consistent.\n v_pos0 = (((a_texture_pos / 8192.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},symbolIcon:{fragmentSource:"uniform sampler2D u_texture;\n\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n lowp float alpha = opacity * v_fade_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\nuniform highp float u_camera_to_center_distance;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform float u_fade_change;\n\n#pragma mapbox: define lowp float opacity\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying float v_fade_opacity;\n\nvoid main() {\n #pragma mapbox: initialize lowp float opacity\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n\n float size;\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 256.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 256.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // See comments in symbol_sdf.vertex\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = clamp(\n 0.5 + 0.5 * distance_ratio,\n 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n 4.0);\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // See comments in symbol_sdf.vertex\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0);\n\n v_tex = a_tex / u_texsize;\n vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n v_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n}\n"},symbolSDF:{fragmentSource:"#define SDF_PX 8.0\n#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO\n\nuniform bool u_is_halo;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform sampler2D u_texture;\nuniform highp float u_gamma_scale;\nuniform bool u_is_text;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 tex = v_data0.xy;\n float gamma_scale = v_data1.x;\n float size = v_data1.y;\n float fade_opacity = v_data1[2];\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n lowp vec4 color = fill_color;\n highp float gamma = EDGE_GAMMA / (fontScale * u_gamma_scale);\n lowp float buff = (256.0 - 64.0) / 256.0;\n if (u_is_halo) {\n color = halo_color;\n gamma = (halo_blur * 1.19 / SDF_PX + EDGE_GAMMA) / (fontScale * u_gamma_scale);\n buff = (6.0 - halo_width / fontScale) / SDF_PX;\n }\n\n lowp float dist = texture2D(u_texture, tex).a;\n highp float gamma_scaled = gamma * gamma_scale;\n highp float alpha = smoothstep(buff - gamma_scaled, buff + gamma_scaled, dist);\n\n gl_FragColor = color * (alpha * opacity * fade_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"const float PI = 3.141592653589793;\n\nattribute vec4 a_pos_offset;\nattribute vec4 a_data;\nattribute vec3 a_projected_pos;\nattribute float a_fade_opacity;\n\n// contents of a_size vary based on the type of property value\n// used for {text,icon}-size.\n// For constants, a_size is disabled.\n// For source functions, we bind only one value per vertex: the value of {text,icon}-size evaluated for the current feature.\n// For composite functions:\n// [ text-size(lowerZoomStop, feature),\n// text-size(upperZoomStop, feature) ]\nuniform bool u_is_size_zoom_constant;\nuniform bool u_is_size_feature_constant;\nuniform highp float u_size_t; // used to interpolate between zoom stops when size is a composite function\nuniform highp float u_size; // used when size is both zoom and feature constant\n\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n\nuniform mat4 u_matrix;\nuniform mat4 u_label_plane_matrix;\nuniform mat4 u_gl_coord_matrix;\n\nuniform bool u_is_text;\nuniform bool u_pitch_with_map;\nuniform highp float u_pitch;\nuniform bool u_rotate_symbol;\nuniform highp float u_aspect_ratio;\nuniform highp float u_camera_to_center_distance;\nuniform float u_fade_change;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_data0;\nvarying vec3 v_data1;\n\nvoid main() {\n #pragma mapbox: initialize highp vec4 fill_color\n #pragma mapbox: initialize highp vec4 halo_color\n #pragma mapbox: initialize lowp float opacity\n #pragma mapbox: initialize lowp float halo_width\n #pragma mapbox: initialize lowp float halo_blur\n\n vec2 a_pos = a_pos_offset.xy;\n vec2 a_offset = a_pos_offset.zw;\n\n vec2 a_tex = a_data.xy;\n vec2 a_size = a_data.zw;\n\n highp float segment_angle = -a_projected_pos[2];\n float size;\n\n if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = mix(a_size[0], a_size[1], u_size_t) / 256.0;\n } else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\n size = a_size[0] / 256.0;\n } else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\n size = u_size;\n } else {\n size = u_size;\n }\n\n vec4 projectedPoint = u_matrix * vec4(a_pos, 0, 1);\n highp float camera_to_anchor_distance = projectedPoint.w;\n // If the label is pitched with the map, layout is done in pitched space,\n // which makes labels in the distance smaller relative to viewport space.\n // We counteract part of that effect by multiplying by the perspective ratio.\n // If the label isn't pitched with the map, we do layout in viewport space,\n // which makes labels in the distance larger relative to the features around\n // them. We counteract part of that effect by dividing by the perspective ratio.\n highp float distance_ratio = u_pitch_with_map ?\n camera_to_anchor_distance / u_camera_to_center_distance :\n u_camera_to_center_distance / camera_to_anchor_distance;\n highp float perspective_ratio = clamp(\n 0.5 + 0.5 * distance_ratio,\n 0.0, // Prevents oversized near-field symbols in pitched/overzoomed tiles\n 4.0);\n\n size *= perspective_ratio;\n\n float fontScale = u_is_text ? size / 24.0 : size;\n\n highp float symbol_rotation = 0.0;\n if (u_rotate_symbol) {\n // Point labels with 'rotation-alignment: map' are horizontal with respect to tile units\n // To figure out that angle in projected space, we draw a short horizontal line in tile\n // space, project it, and measure its angle in projected space.\n vec4 offsetProjectedPoint = u_matrix * vec4(a_pos + vec2(1, 0), 0, 1);\n\n vec2 a = projectedPoint.xy / projectedPoint.w;\n vec2 b = offsetProjectedPoint.xy / offsetProjectedPoint.w;\n\n symbol_rotation = atan((b.y - a.y) / u_aspect_ratio, b.x - a.x);\n }\n\n highp float angle_sin = sin(segment_angle + symbol_rotation);\n highp float angle_cos = cos(segment_angle + symbol_rotation);\n mat2 rotation_matrix = mat2(angle_cos, -1.0 * angle_sin, angle_sin, angle_cos);\n\n vec4 projected_pos = u_label_plane_matrix * vec4(a_projected_pos.xy, 0.0, 1.0);\n gl_Position = u_gl_coord_matrix * vec4(projected_pos.xy / projected_pos.w + rotation_matrix * (a_offset / 32.0 * fontScale), 0.0, 1.0);\n float gamma_scale = gl_Position.w;\n\n vec2 tex = a_tex / u_texsize;\n vec2 fade_opacity = unpack_opacity(a_fade_opacity);\n float fade_change = fade_opacity[1] > 0.5 ? u_fade_change : -u_fade_change;\n float interpolated_fade_opacity = max(0.0, min(1.0, fade_opacity[0] + fade_change));\n\n v_data0 = vec2(tex.x, tex.y);\n v_data1 = vec3(gamma_scale, size, interpolated_fade_opacity);\n}\n"}},Qe=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,$e=function(t){var e=Je[t],i={};e.fragmentSource=e.fragmentSource.replace(Qe,function(t,e,n,o,r){return i[r]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nvarying "+n+" "+o+" "+r+";\n#else\nuniform "+n+" "+o+" u_"+r+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+r+"\n "+n+" "+o+" "+r+" = u_"+r+";\n#endif\n"}),e.vertexSource=e.vertexSource.replace(Qe,function(t,e,n,o,r){var a="float"===o?"vec2":"vec4",s=r.match(/color/)?"color":a;return i[r]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nuniform lowp float a_"+r+"_t;\nattribute "+n+" "+a+" a_"+r+";\nvarying "+n+" "+o+" "+r+";\n#else\nuniform "+n+" "+o+" u_"+r+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+r+" = a_"+r+";\n#else\n "+n+" "+o+" "+r+" = u_"+r+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+r+" = unpack_mix_"+s+"(a_"+r+", a_"+r+"_t);\n#else\n "+n+" "+o+" "+r+" = u_"+r+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nuniform lowp float a_"+r+"_t;\nattribute "+n+" "+a+" a_"+r+";\n#else\nuniform "+n+" "+o+" u_"+r+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+n+" "+o+" "+r+" = a_"+r+";\n#else\n "+n+" "+o+" "+r+" = u_"+r+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+n+" "+o+" "+r+" = unpack_mix_"+s+"(a_"+r+", a_"+r+"_t);\n#else\n "+n+" "+o+" "+r+" = u_"+r+";\n#endif\n"});};for(var ti in Je)$e(ti);var ei=Je,ii=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null;};ii.prototype.bind=function(t,e,i,n,o,r,a,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,c=0;!l&&c<n.length;c++)this.boundPaintVertexBuffers[c]!==n[c]&&(l=!0);var h=!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==i||l||this.boundIndexBuffer!==o||this.boundVertexOffset!==r||this.boundDynamicVertexBuffer!==a||this.boundDynamicVertexBuffer2!==s;!t.extVertexArrayObject||h?this.freshBind(e,i,n,o,r,a,s):(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),o&&o.dynamicDraw&&o.bind(),s&&s.bind());},ii.prototype.freshBind=function(t,e,i,n,o,r,a){var s,l=t.numAttributes,c=this.context,h=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=n,this.boundVertexOffset=o,this.boundDynamicVertexBuffer=r,this.boundDynamicVertexBuffer2=a;else{s=c.currentNumAttributes||0;for(var u=l;u<s;u++)h.disableVertexAttribArray(u);}e.enableAttributes(h,t);for(var p=0,d=i;p<d.length;p+=1){d[p].enableAttributes(h,t);}r&&r.enableAttributes(h,t),a&&a.enableAttributes(h,t),e.bind(),e.setVertexAttribPointers(h,t,o);for(var f=0,_=i;f<_.length;f+=1){var m=_[f];m.bind(),m.setVertexAttribPointers(h,t,o);}r&&(r.bind(),r.setVertexAttribPointers(h,t,o)),n&&n.bind(),a&&(a.bind(),a.setVertexAttribPointers(h,t,o)),c.currentNumAttributes=l;},ii.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null);};var ni=function(e,i,n,o,r){var a=e.gl;this.program=a.createProgram();var s=n.defines().concat("#define DEVICE_PIXEL_RATIO "+t.browser.devicePixelRatio.toFixed(1));r&&s.push("#define OVERDRAW_INSPECTOR;");var l=s.concat(ei.prelude.fragmentSource,i.fragmentSource).join("\n"),c=s.concat(ei.prelude.vertexSource,i.vertexSource).join("\n"),h=a.createShader(a.FRAGMENT_SHADER);a.shaderSource(h,l),a.compileShader(h),a.attachShader(this.program,h);var u=a.createShader(a.VERTEX_SHADER);a.shaderSource(u,c),a.compileShader(u),a.attachShader(this.program,u);for(var p=n.layoutAttributes||[],d=0;d<p.length;d++)a.bindAttribLocation(this.program,d,p[d].name);a.linkProgram(this.program),this.numAttributes=a.getProgramParameter(this.program,a.ACTIVE_ATTRIBUTES),this.attributes={};for(var f={},_=0;_<this.numAttributes;_++){var m=a.getActiveAttrib(this.program,_);m&&(this.attributes[m.name]=a.getAttribLocation(this.program,m.name));}for(var g=a.getProgramParameter(this.program,a.ACTIVE_UNIFORMS),v=0;v<g;v++){var y=a.getActiveUniform(this.program,v);y&&(f[y.name]=a.getUniformLocation(this.program,y.name));}this.fixedUniforms=o(e,f),this.binderUniforms=n.getUniforms(e,f);};function oi(e,i,n){var o=1/Te(n,1,i.transform.tileZoom),r=Math.pow(2,n.tileID.overscaledZ),a=n.tileSize*Math.pow(2,i.transform.tileZoom)/r,s=a*(n.tileID.canonical.x+n.tileID.wrap*r),l=a*n.tileID.canonical.y;return {u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[t.browser.devicePixelRatio,o,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[s>>16,l>>16],u_pixel_coord_lower:[65535&s,65535&l]}}ni.prototype.draw=function(t,e,i,n,o,r,a,s,l,c,h,u,p,d,f,_){var m,g=t.gl;for(var v in t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(n),t.setColorMode(o),t.setCullFace(r),this.fixedUniforms)this.fixedUniforms[v].set(a[v]);d&&d.setUniforms(t,this.binderUniforms,u,{zoom:p});for(var y=(m={},m[g.LINES]=2,m[g.TRIANGLES]=3,m[g.LINE_STRIP]=1,m)[e],x=0,b=h.get();x<b.length;x+=1){var w=b[x],E=w.vaos||(w.vaos={});(E[s]||(E[s]=new ii)).bind(t,this,l,d?d.getPaintVertexBuffers():[],c,w.vertexOffset,f,_),g.drawElements(e,w.primitiveLength*y,g.UNSIGNED_SHORT,w.primitiveOffset*y*2);}};var ri=function(e,i,n){var o=i.style.light,r=o.properties.get("position"),a=[r.x,r.y,r.z],s=t.create$2();"viewport"===o.properties.get("anchor")&&t.fromRotation(s,-i.transform.angle),t.transformMat3(a,a,s);var l=o.properties.get("color");return {u_matrix:e,u_lightpos:a,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[l.r,l.g,l.b],u_vertical_gradient:+n}},ai=function(e,i,n,o,r,a){return t.extend(ri(e,i,n),oi(r,i,a),{u_height_factor:-Math.pow(2,o.overscaledZ)/a.tileSize/8})},si=function(e,i,n){var o=t.create();t.ortho(o,0,e.width,e.height,0,0,1);var r=e.context.gl;return {u_matrix:o,u_world:[r.drawingBufferWidth,r.drawingBufferHeight],u_image:n,u_opacity:i}},li=function(t){return {u_matrix:t}},ci=function(e,i,n,o){return t.extend(li(e),oi(n,i,o))},hi=function(t,e){return {u_matrix:t,u_world:e}},ui=function(e,i,n,o,r){return t.extend(ci(e,i,n,o),{u_world:r})},pi=function(t,e,i,n){var o,r,a=t.transform;if("map"===n.paint.get("circle-pitch-alignment")){var s=Te(i,1,a.zoom);o=!0,r=[s,s];}else o=!1,r=a.pixelsToGLUnits;return {u_camera_to_center_distance:a.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,i,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+o,u_extrude_scale:r}},di=function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,i.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,i.u_overscale_factor)}},fi=function(t,e,i){var n=Te(i,1,e.zoom),o=Math.pow(2,e.zoom-i.tileID.overscaledZ),r=i.tileID.overscaleFactor();return {u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*o),e.pixelsToGLUnits[1]/(n*o)],u_overscale_factor:r}},_i=function(t,e){return {u_matrix:t,u_color:e}},mi=function(t){return {u_matrix:t}},gi=function(t,e,i,n){return {u_matrix:t,u_extrude_scale:Te(e,1,i),u_intensity:n}},vi=function(e,i,n,o){var r=t.create();t.ortho(r,0,e.width,e.height,0,0,1);var a=e.context.gl;return {u_matrix:r,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:n,u_color_ramp:o,u_opacity:i.paint.get("heatmap-opacity")}},yi=function(e,i,n){var o=n.paint.get("hillshade-shadow-color"),r=n.paint.get("hillshade-highlight-color"),a=n.paint.get("hillshade-accent-color"),s=n.paint.get("hillshade-illumination-direction")*(Math.PI/180);return "viewport"===n.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle),{u_matrix:e.transform.calculatePosMatrix(i.tileID.toUnwrapped(),!0),u_image:0,u_latrange:function(e,i){var n=i.toCoordinate(),o=new t.Coordinate(n.column,n.row+1,n.zoom);return [e.transform.coordinateLocation(n).lat,e.transform.coordinateLocation(o).lat]}(e,i.tileID),u_light:[n.paint.get("hillshade-exaggeration"),s],u_shadow:o,u_highlight:r,u_accent:a}},xi=function(e,i){var n=e.dem.dim,o=t.create();return t.ortho(o,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(o,o,[0,-t.EXTENT,0]),{u_matrix:o,u_image:1,u_dimension:[2*n,2*n],u_zoom:e.tileID.overscaledZ,u_maxzoom:i}};var bi=function(t,e,i){var n=t.transform;return {u_matrix:Ci(t,e,i),u_ratio:1/Te(e,1,n.zoom),u_gl_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},wi=function(e,i,n){return t.extend(bi(e,i,n),{u_image:0})},Ei=function(e,i,n,o){var r=e.transform,a=Si(i,r);return {u_matrix:Ci(e,i,n),u_texsize:i.imageAtlasTexture.size,u_ratio:1/Te(i,1,r.zoom),u_image:0,u_scale:[t.browser.devicePixelRatio,a,o.fromScale,o.toScale],u_fade:o.t,u_gl_units_to_pixels:[1/r.pixelsToGLUnits[0],1/r.pixelsToGLUnits[1]]}},Ti=function(e,i,n,o,r){var a=e.transform,s=e.lineAtlas,l=Si(i,a),c="round"===n.layout.get("line-cap"),h=s.getDash(o.from,c),u=s.getDash(o.to,c),p=h.width*r.fromScale,d=u.width*r.toScale;return t.extend(bi(e,i,n),{u_patternscale_a:[l/p,-h.height/2],u_patternscale_b:[l/d,-u.height/2],u_sdfgamma:s.width/(256*Math.min(p,d)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:h.y,u_tex_y_b:u.y,u_mix:r.t})};function Si(t,e){return 1/Te(t,1,e.tileZoom)}function Ci(t,e,i){return t.translatePosMatrix(e.tileID.posMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}var Ii=function(t,e,i,n,o){return {u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*o.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:o.paint.get("raster-brightness-min"),u_brightness_high:o.paint.get("raster-brightness-max"),u_saturation_factor:(a=o.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(r=o.paint.get("raster-contrast"),r>0?1/(1-r):1+r),u_spin_weights:function(t){t*=Math.PI/180;var e=Math.sin(t),i=Math.cos(t);return [(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}(o.paint.get("raster-hue-rotate"))};var r,a;};var zi=function(t,e,i,n,o,r,a,s,l,c){var h=o.transform;return {u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:h.cameraToCenterDistance,u_pitch:h.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:h.width/h.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:r,u_label_plane_matrix:a,u_gl_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},Pi=function(e,i,n,o,r,a,s,l,c,h,u){var p=r.transform;return t.extend(zi(e,i,n,o,r,a,s,l,c,h),{u_gamma_scale:o?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_is_halo:+u})},Di=function(t,e,i){return {u_matrix:t,u_opacity:e,u_color:i}},Ri=function(e,i,n,o,r,a){return t.extend(function(t,e,i,n){var o=i.imageManager.getPattern(t.from),r=i.imageManager.getPattern(t.to),a=i.imageManager.getPixelSize(),s=a.width,l=a.height,c=Math.pow(2,n.tileID.overscaledZ),h=n.tileSize*Math.pow(2,i.transform.tileZoom)/c,u=h*(n.tileID.canonical.x+n.tileID.wrap*c),p=h*n.tileID.canonical.y;return {u_image:0,u_pattern_tl_a:o.tl,u_pattern_br_a:o.br,u_pattern_tl_b:r.tl,u_pattern_br_b:r.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:o.displaySize,u_pattern_size_b:r.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/Te(n,1,i.transform.tileZoom),u_pixel_coord_upper:[u>>16,p>>16],u_pixel_coord_lower:[65535&u,65535&p]}}(o,a,n,r),{u_matrix:e,u_opacity:i})},Li={fillExtrusion:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient)}},fillExtrusionPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,i.u_height_factor),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},extrusionTexture:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_opacity:new t.Uniform1f(e,i.u_opacity)}},fill:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},fillPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},fillOutline:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world)}},fillOutlinePattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},circle:function(e,i){return {u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,i.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},collisionBox:di,collisionCircle:di,debug:function(e,i){return {u_color:new t.UniformColor(e,i.u_color),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},clippingMask:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmap:function(e,i){return {u_extrude_scale:new t.Uniform1f(e,i.u_extrude_scale),u_intensity:new t.Uniform1f(e,i.u_intensity),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmapTexture:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_color_ramp:new t.Uniform1i(e,i.u_color_ramp),u_opacity:new t.Uniform1f(e,i.u_opacity)}},hillshade:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_latrange:new t.Uniform2f(e,i.u_latrange),u_light:new t.Uniform2f(e,i.u_light),u_shadow:new t.UniformColor(e,i.u_shadow),u_highlight:new t.UniformColor(e,i.u_highlight),u_accent:new t.UniformColor(e,i.u_accent)}},hillshadePrepare:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_dimension:new t.Uniform2f(e,i.u_dimension),u_zoom:new t.Uniform1f(e,i.u_zoom),u_maxzoom:new t.Uniform1f(e,i.u_maxzoom)}},line:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_gl_units_to_pixels:new t.Uniform2f(e,i.u_gl_units_to_pixels)}},lineGradient:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_gl_units_to_pixels:new t.Uniform2f(e,i.u_gl_units_to_pixels),u_image:new t.Uniform1i(e,i.u_image)}},linePattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_texsize:new t.Uniform2f(e,i.u_texsize),u_ratio:new t.Uniform1f(e,i.u_ratio),u_image:new t.Uniform1i(e,i.u_image),u_gl_units_to_pixels:new t.Uniform2f(e,i.u_gl_units_to_pixels),u_scale:new t.Uniform4f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},lineSDF:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_gl_units_to_pixels:new t.Uniform2f(e,i.u_gl_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,i.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,i.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,i.u_sdfgamma),u_image:new t.Uniform1i(e,i.u_image),u_tex_y_a:new t.Uniform1f(e,i.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,i.u_tex_y_b),u_mix:new t.Uniform1f(e,i.u_mix)}},raster:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_tl_parent:new t.Uniform2f(e,i.u_tl_parent),u_scale_parent:new t.Uniform1f(e,i.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,i.u_buffer_scale),u_fade_t:new t.Uniform1f(e,i.u_fade_t),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image0:new t.Uniform1i(e,i.u_image0),u_image1:new t.Uniform1i(e,i.u_image1),u_brightness_low:new t.Uniform1f(e,i.u_brightness_low),u_brightness_high:new t.Uniform1f(e,i.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,i.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,i.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,i.u_spin_weights)}},symbolIcon:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_gl_coord_matrix:new t.UniformMatrix4f(e,i.u_gl_coord_matrix),u_is_text:new t.Uniform1f(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture)}},symbolSDF:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_gl_coord_matrix:new t.UniformMatrix4f(e,i.u_gl_coord_matrix),u_is_text:new t.Uniform1f(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_is_halo:new t.Uniform1f(e,i.u_is_halo)}},background:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_color:new t.UniformColor(e,i.u_color)}},backgroundPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image:new t.Uniform1i(e,i.u_image),u_pattern_tl_a:new t.Uniform2f(e,i.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,i.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,i.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,i.u_pattern_br_b),u_texsize:new t.Uniform2f(e,i.u_texsize),u_mix:new t.Uniform1f(e,i.u_mix),u_pattern_size_a:new t.Uniform2f(e,i.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,i.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,i.u_scale_a),u_scale_b:new t.Uniform1f(e,i.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,i.u_tile_units_to_pixels)}}};function Ai(e,i){for(var n=e.sort(function(t,e){return t.tileID.isLessThan(e.tileID)?-1:e.tileID.isLessThan(t.tileID)?1:0}),o=0;o<n.length;o++){var r={},a=n[o],s=n.slice(o+1);Mi(a.tileID.wrapped(),a.tileID,s,new t.OverscaledTileID(0,a.tileID.wrap+1,0,0,0),r),a.setMask(r,i);}}function Mi(e,i,n,o,r){for(var a=0;a<n.length;a++){var s=n[a];if(o.isLessThan(s.tileID))break;if(i.key===s.tileID.key)return;if(s.tileID.isChildOf(i)){for(var l=i.children(1/0),c=0;c<l.length;c++){Mi(e,l[c],n.slice(a),o,r);}return}}var h=i.overscaledZ-e.overscaledZ,u=new t.CanonicalTileID(h,i.canonical.x-(e.canonical.x<<h),i.canonical.y-(e.canonical.y<<h));r[u.key]=r[u.key]||u;}function ki(t,e,i,n,o){for(var r=t.context,a=r.gl,s=o?t.useProgram("collisionCircle"):t.useProgram("collisionBox"),l=0;l<n.length;l++){var c=n[l],h=e.getTile(c),u=h.getBucket(i);if(u){var p=o?u.collisionCircle:u.collisionBox;p&&s.draw(r,o?a.TRIANGLES:a.LINES,Ft.disabled,Ut.disabled,t.colorModeForRenderPass(),Zt.disabled,fi(c.posMatrix,t.transform,h),i.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,null,t.transform.zoom,null,null,p.collisionVertexBuffer);}}}var Bi=t.identity(new Float32Array(16)),Oi=t.properties.layout;function Fi(e,i,n,o,r,a,s,l,c,h,u,p){for(var d,f,_=e.context,m=_.gl,g=e.transform,v="map"===l,y="map"===c,x=v&&"point"!==n.layout.get("symbol-placement"),b=v&&!y&&!x,w=y?e.depthModeForSublayer(0,Ft.ReadOnly):Ft.disabled,E=0,T=o;E<T.length;E+=1){var S=T[E],C=i.getTile(S),I=C.getBucket(n);if(I){var z=r?I.text:I.icon;if(z&&z.segments.get().length){var P=z.programConfigurations.get(n.id),D=r||I.sdfIcons,R=r?I.textSizeData:I.iconSizeData;d||(d=e.useProgram(D?"symbolSDF":"symbolIcon",P),f=t.evaluateSizeForZoom(R,g.zoom,Oi.properties[r?"text-size":"icon-size"])),_.activeTexture.set(m.TEXTURE0);var L=void 0;if(r)C.glyphAtlasTexture.bind(m.LINEAR,m.CLAMP_TO_EDGE),L=C.glyphAtlasTexture.size;else{var A=1!==n.layout.get("icon-size").constantOr(0)||I.iconsNeedLinear,M=y||0!==g.pitch;C.imageAtlasTexture.bind(D||e.options.rotating||e.options.zooming||A||M?m.LINEAR:m.NEAREST,m.CLAMP_TO_EDGE),L=C.imageAtlasTexture.size;}var k=Te(C,1,e.transform.zoom),B=ce(S.posMatrix,y,v,e.transform,k),O=he(S.posMatrix,y,v,e.transform,k);x&&de(I,S.posMatrix,e,r,B,O,y,h);var F=e.translatePosMatrix(S.posMatrix,C,a,s),U=x?Bi:B,N=e.translatePosMatrix(O,C,a,s,!0),Z=void 0;if(D){var q=0!==n.paint.get(r?"text-halo-width":"icon-halo-width").constantOr(1);Z=Pi(R.functionType,f,b,y,e,F,U,N,r,L,!0),q&&Ui(z,n,e,d,w,u,p,Z),Z.u_is_halo=0;}else Z=zi(R.functionType,f,b,y,e,F,U,N,r,L);Ui(z,n,e,d,w,u,p,Z);}}}}function Ui(t,e,i,n,o,r,a,s){var l=i.context,c=l.gl;n.draw(l,c.TRIANGLES,o,r,a,Zt.disabled,s,e.id,t.layoutVertexBuffer,t.indexBuffer,t.segments,e.paint,i.transform.zoom,t.programConfigurations.get(e.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer);}function Ni(t,e,i,n,o,r,a){var s,l,c,h,u,p=t.context.gl,d=i.paint.get("fill-pattern"),f=d&&d.constantOr(1),_=i.getCrossfadeParameters();a?(l=f&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=p.LINES):(l=f?"fillPattern":"fill",s=p.TRIANGLES);for(var m=0,g=n;m<g.length;m+=1){var v=g[m],y=e.getTile(v);if(!f||y.patternsLoaded()){var x=y.getBucket(i);if(x){var b=x.programConfigurations.get(i.id),w=t.useProgram(l,b);f&&(t.context.activeTexture.set(p.TEXTURE0),y.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),b.updatePatternPaintBuffers(_));var E=d.constantOr(null);if(E&&y.imageAtlas){var T=y.imageAtlas.patternPositions[E.to],S=y.imageAtlas.patternPositions[E.from];T&&S&&b.setConstantPatternPositions(T,S);}var C=t.translatePosMatrix(v.posMatrix,y,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"));if(a){h=x.indexBuffer2,u=x.segments2;var I=[p.drawingBufferWidth,p.drawingBufferHeight];c="fillOutlinePattern"===l&&f?ui(C,t,_,y,I):hi(C,I);}else h=x.indexBuffer,u=x.segments,c=f?ci(C,t,_,y):li(C);w.draw(t.context,s,o,t.stencilModeForClipping(v),r,Zt.disabled,c,i.id,x.layoutVertexBuffer,h,u,i.paint,t.transform.zoom,b);}}}}function Zi(e,i){var n=e.context,o=n.gl,r=i.viewportFrame;if(e.depthRboNeedsClear&&e.setupOffscreenDepthRenderbuffer(),!r){var a=new t.Texture(n,{width:e.width,height:e.height,data:null},o.RGBA);a.bind(o.LINEAR,o.CLAMP_TO_EDGE),(r=i.viewportFrame=n.createFramebuffer(e.width,e.height)).colorAttachment.set(a.texture);}n.bindFramebuffer.set(r.framebuffer),r.depthAttachment.set(e.depthRbo),e.depthRboNeedsClear&&(n.clear({depth:1}),e.depthRboNeedsClear=!1),n.clear({color:t.Color.transparent}),n.setStencilMode(Ut.disabled),n.setDepthMode(new Ft(o.LEQUAL,Ft.ReadWrite,[0,1])),n.setColorMode(e.colorModeForRenderPass());}function qi(t,e,i){var n=e.viewportFrame;if(n){var o=t.context,r=o.gl;o.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,n.colorAttachment.get()),t.useProgram("extrusionTexture").draw(o,r.TRIANGLES,Ft.disabled,Ut.disabled,t.colorModeForRenderPass(),Zt.disabled,si(t,i,0),e.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,e.paint,t.transform.zoom);}}function Vi(t,e,i,n,o,r){var a=t.context,s=a.gl,l=e.fbo;if(l){var c=t.useProgram("hillshade");a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get());var h=yi(t,e,i);e.maskedBoundsBuffer&&e.maskedIndexBuffer&&e.segments?c.draw(a,s.TRIANGLES,n,o,r,Zt.disabled,h,i.id,e.maskedBoundsBuffer,e.maskedIndexBuffer,e.segments):c.draw(a,s.TRIANGLES,n,o,r,Zt.disabled,h,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments);}}function ji(e,i,n,o,r,a,s){var l=e.context,c=l.gl;if(i.dem&&i.dem.data){var h=i.dem.dim,u=i.dem.getPixels();if(l.activeTexture.set(c.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||e.getTileTexture(i.tileSize),i.demTexture){var p=i.demTexture;p.update(u,{premultiply:!1}),p.bind(c.NEAREST,c.CLAMP_TO_EDGE);}else i.demTexture=new t.Texture(l,u,c.RGBA,{premultiply:!1}),i.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);l.activeTexture.set(c.TEXTURE0);var d=i.fbo;if(!d){var f=new t.Texture(l,{width:h,height:h,data:null},c.RGBA);f.bind(c.LINEAR,c.CLAMP_TO_EDGE),(d=i.fbo=l.createFramebuffer(h,h)).colorAttachment.set(f.texture);}l.bindFramebuffer.set(d.framebuffer),l.viewport.set([0,0,h,h]),e.useProgram("hillshadePrepare").draw(l,c.TRIANGLES,r,a,s,Zt.disabled,xi(i,o),n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),i.needsHillshadePrepare=!1;}}function Gi(e,i,n,o,r){var a=o.paint.get("raster-fade-duration");if(a>0){var s=t.browser.now(),l=(s-e.timeAdded)/a,c=i?(s-i.timeAdded)/a:-1,h=n.getSource(),u=r.coveringZoomLevel({tileSize:h.tileSize,roundZoom:h.roundZoom}),p=!i||Math.abs(i.tileID.overscaledZ-u)>Math.abs(e.tileID.overscaledZ-u),d=p&&e.refreshedUponExpiration?1:t.clamp(p?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),i?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return {opacity:1,mix:0}}function Wi(e,i,n){var o=e.context,r=o.gl,a=n.posMatrix,s=e.useProgram("debug"),l=Ft.disabled,c=Ut.disabled,h=e.colorModeForRenderPass(),u="$debug";s.draw(o,r.LINE_STRIP,l,c,h,Zt.disabled,_i(a,t.Color.red),u,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);for(var p=function(t,e,i,n){n=n||1;var o,r,a,s,l,c,h,u,p=[];for(o=0,r=t.length;o<r;o++)if(l=Xi[t[o]]){for(u=null,a=0,s=l[1].length;a<s;a+=2)-1===l[1][a]&&-1===l[1][a+1]?u=null:(c=e+l[1][a]*n,h=i-l[1][a+1]*n,u&&p.push(u.x,u.y,c,h),u={x:c,y:h});e+=l[0]*n;}return p}(n.toString(),50,200,5),d=new t.StructArrayLayout2i4,f=new t.StructArrayLayout2ui4,_=0;_<p.length;_+=2)d.emplaceBack(p[_],p[_+1]),f.emplaceBack(_,_+1);for(var m=o.createVertexBuffer(d,Ye.members),g=o.createIndexBuffer(f),v=t.SegmentVector.simpleSegment(0,0,d.length/2,d.length/2),y=i.getTile(n).tileSize,x=t.EXTENT/(Math.pow(2,e.transform.zoom-n.overscaledZ)*y),b=[[-1,-1],[-1,1],[1,-1],[1,1]],w=0;w<b.length;w++){var E=b[w];s.draw(o,r.LINES,l,c,h,Zt.disabled,_i(t.translate([],a,[x*E[0],x*E[1],0]),t.Color.white),u,m,g,v);}s.draw(o,r.LINES,l,c,h,Zt.disabled,_i(a,t.Color.black),u,m,g,v);}var Xi={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};var Hi={symbol:function(t,e,i,n){if("translucent"===t.renderPass){var o=Ut.disabled,r=t.colorModeForRenderPass();0!==i.paint.get("icon-opacity").constantOr(1)&&Fi(t,e,i,n,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),o,r),0!==i.paint.get("text-opacity").constantOr(1)&&Fi(t,e,i,n,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),o,r),e.map.showCollisionBoxes&&function(t,e,i,n){ki(t,e,i,n,!1),ki(t,e,i,n,!0);}(t,e,i,n);}},circle:function(t,e,i,n){if("translucent"===t.renderPass){var o=i.paint.get("circle-opacity"),r=i.paint.get("circle-stroke-width"),a=i.paint.get("circle-stroke-opacity");if(0!==o.constantOr(1)||0!==r.constantOr(1)&&0!==a.constantOr(1))for(var s=t.context,l=s.gl,c=t.depthModeForSublayer(0,Ft.ReadOnly),h=Ut.disabled,u=t.colorModeForRenderPass(),p=0;p<n.length;p++){var d=n[p],f=e.getTile(d),_=f.getBucket(i);if(_){var m=_.programConfigurations.get(i.id);t.useProgram("circle",m).draw(s,l.TRIANGLES,c,h,u,Zt.disabled,pi(t,d,f,i),i.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,i.paint,t.transform.zoom,m);}}}},heatmap:function(e,i,n,o){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var r=e.context,a=r.gl,s=e.depthModeForSublayer(0,Ft.ReadOnly),l=Ut.disabled,c=new Nt([a.ONE,a.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,i){var n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var o=i.heatmapFbo;if(o)n.bindTexture(n.TEXTURE_2D,o.colorAttachment.get()),t.bindFramebuffer.set(o.framebuffer);else{var r=n.createTexture();n.bindTexture(n.TEXTURE_2D,r),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),o=i.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4),function t(e,i,n,o){var r=e.gl;r.texImage2D(r.TEXTURE_2D,0,r.RGBA,i.width/4,i.height/4,0,r.RGBA,e.extTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:r.UNSIGNED_BYTE,null),o.colorAttachment.set(n),e.extTextureHalfFloat&&r.checkFramebufferStatus(r.FRAMEBUFFER)!==r.FRAMEBUFFER_COMPLETE&&(e.extTextureHalfFloat=null,o.colorAttachment.setDirty(),t(e,i,n,o));}(t,e,r,o);}}(r,e,n),r.clear({color:t.Color.transparent});for(var h=0;h<o.length;h++){var u=o[h];if(!i.hasRenderableParent(u)){var p=i.getTile(u),d=p.getBucket(n);if(d){var f=d.programConfigurations.get(n.id),_=e.useProgram("heatmap",f),m=e.transform.zoom;_.draw(r,a.TRIANGLES,s,l,c,Zt.disabled,gi(u.posMatrix,p,m,n.paint.get("heatmap-intensity")),n.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,n.paint,e.transform.zoom,f);}}}r.viewport.set([0,0,e.width,e.height]);}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,i){var n=e.context,o=n.gl,r=i.heatmapFbo;if(r){n.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,r.colorAttachment.get()),n.activeTexture.set(o.TEXTURE1);var a=i.colorRampTexture;a||(a=i.colorRampTexture=new t.Texture(n,i.colorRamp,o.RGBA)),a.bind(o.LINEAR,o.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,o.TRIANGLES,Ft.disabled,Ut.disabled,e.colorModeForRenderPass(),Zt.disabled,vi(e,i,0,1),i.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,i.paint,e.transform.zoom);}}(e,n));},line:function(e,i,n,o){if("translucent"===e.renderPass){var r=n.paint.get("line-opacity"),a=n.paint.get("line-width");if(0!==r.constantOr(1)&&0!==a.constantOr(1)){var s=e.depthModeForSublayer(0,Ft.ReadOnly),l=e.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),h=n.paint.get("line-pattern"),u=h.constantOr(1),p=n.paint.get("line-gradient"),d=n.getCrossfadeParameters(),f=c?"lineSDF":u?"linePattern":p?"lineGradient":"line",_=e.context,m=_.gl,g=!0;if(p){_.activeTexture.set(m.TEXTURE0);var v=n.gradientTexture;if(!n.gradient)return;v||(v=n.gradientTexture=new t.Texture(_,n.gradient,m.RGBA)),v.bind(m.LINEAR,m.CLAMP_TO_EDGE);}for(var y=0,x=o;y<x.length;y+=1){var b=x[y],w=i.getTile(b);if(!u||w.patternsLoaded()){var E=w.getBucket(n);if(E){var T=E.programConfigurations.get(n.id),S=e.context.program.get(),C=e.useProgram(f,T),I=g||C.program!==S,z=h.constantOr(null);if(z&&w.imageAtlas){var P=w.imageAtlas.patternPositions[z.to],D=w.imageAtlas.patternPositions[z.from];P&&D&&T.setConstantPatternPositions(P,D);}var R=c?Ti(e,w,n,c,d):u?Ei(e,w,n,d):p?wi(e,w,n):bi(e,w,n);c&&(I||e.lineAtlas.dirty)?(_.activeTexture.set(m.TEXTURE0),e.lineAtlas.bind(_)):u&&(_.activeTexture.set(m.TEXTURE0),w.imageAtlasTexture.bind(m.LINEAR,m.CLAMP_TO_EDGE),T.updatePatternPaintBuffers(d)),C.draw(_,m.TRIANGLES,s,e.stencilModeForClipping(b),l,Zt.disabled,R,n.id,E.layoutVertexBuffer,E.indexBuffer,E.segments,n.paint,e.transform.zoom,T),g=!1;}}}}}},fill:function(e,i,n,o){var r=n.paint.get("fill-color"),a=n.paint.get("fill-opacity");if(0!==a.constantOr(1)){var s=e.colorModeForRenderPass(),l=n.paint.get("fill-pattern").constantOr(1)||1!==r.constantOr(t.Color.transparent).a||1!==a.constantOr(0)?"translucent":"opaque";e.renderPass===l&&Ni(e,i,n,o,e.depthModeForSublayer(1,"opaque"===e.renderPass?Ft.ReadWrite:Ft.ReadOnly),s,!1),"translucent"===e.renderPass&&n.paint.get("fill-antialias")&&Ni(e,i,n,o,e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Ft.ReadOnly),s,!0);}},"fill-extrusion":function(t,e,i,n){0!==i.paint.get("fill-extrusion-opacity")&&("offscreen"===t.renderPass?(Zi(t,i),function(t,e,i,n,o,r,a){for(var s=t.context,l=s.gl,c=i.paint.get("fill-extrusion-pattern"),h=c.constantOr(1),u=i.getCrossfadeParameters(),p=0,d=n;p<d.length;p+=1){var f=d[p],_=e.getTile(f),m=_.getBucket(i);if(m){var g=m.programConfigurations.get(i.id),v=t.useProgram(h?"fillExtrusionPattern":"fillExtrusion",g);h&&(t.context.activeTexture.set(l.TEXTURE0),_.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),g.updatePatternPaintBuffers(u));var y=c.constantOr(null);if(y&&_.imageAtlas){var x=_.imageAtlas.patternPositions[y.to],b=_.imageAtlas.patternPositions[y.from];x&&b&&g.setConstantPatternPositions(x,b);}var w=t.translatePosMatrix(f.posMatrix,_,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),E=i.paint.get("fill-extrusion-vertical-gradient"),T=h?ai(w,t,E,f,u,_):ri(w,t,E);v.draw(s,s.gl.TRIANGLES,o,r,a,Zt.backCCW,T,i.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,i.paint,t.transform.zoom,g);}}}(t,e,i,n,new Ft(t.context.gl.LEQUAL,Ft.ReadWrite,[0,1]),Ut.disabled,t.colorModeForRenderPass())):"translucent"===t.renderPass&&qi(t,i,i.paint.get("fill-extrusion-opacity")));},hillshade:function(t,e,i,n){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var o=t.context,r=e.getSource().maxzoom,a=t.depthModeForSublayer(0,Ft.ReadOnly),s=Ut.disabled,l=t.colorModeForRenderPass(),c=0,h=n;c<h.length;c+=1){var u=h[c],p=e.getTile(u);p.needsHillshadePrepare&&"offscreen"===t.renderPass?ji(t,p,i,r,a,s,l):"translucent"===t.renderPass&&Vi(t,p,i,a,s,l);}o.viewport.set([0,0,t.width,t.height]);}},raster:function(t,e,i,n){if("translucent"===t.renderPass&&0!==i.paint.get("raster-opacity"))for(var o=t.context,r=o.gl,a=e.getSource(),s=t.useProgram("raster"),l=Ut.disabled,c=t.colorModeForRenderPass(),h=n.length&&n[0].overscaledZ,u=0,p=n;u<p.length;u+=1){var d=p[u],f=t.depthModeForSublayer(d.overscaledZ-h,1===i.paint.get("raster-opacity")?Ft.ReadWrite:Ft.ReadOnly,r.LESS),_=e.getTile(d),m=t.transform.calculatePosMatrix(d.toUnwrapped(),!0);_.registerFadeDuration(i.paint.get("raster-fade-duration"));var g=e.findLoadedParent(d,0),v=Gi(_,g,e,i,t.transform),y=void 0,x=void 0,b="nearest"===i.paint.get("raster-resampling")?r.NEAREST:r.LINEAR;o.activeTexture.set(r.TEXTURE0),_.texture.bind(b,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_NEAREST),o.activeTexture.set(r.TEXTURE1),g?(g.texture.bind(b,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_NEAREST),y=Math.pow(2,g.tileID.overscaledZ-_.tileID.overscaledZ),x=[_.tileID.canonical.x*y%1,_.tileID.canonical.y*y%1]):_.texture.bind(b,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_NEAREST);var w=Ii(m,x||[0,0],y||1,v,i);a instanceof W?s.draw(o,r.TRIANGLES,f,l,c,Zt.disabled,w,i.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):_.maskedBoundsBuffer&&_.maskedIndexBuffer&&_.segments?s.draw(o,r.TRIANGLES,f,l,c,Zt.disabled,w,i.id,_.maskedBoundsBuffer,_.maskedIndexBuffer,_.segments,i.paint,t.transform.zoom):s.draw(o,r.TRIANGLES,f,l,c,Zt.disabled,w,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments);}},background:function(t,e,i){var n=i.paint.get("background-color"),o=i.paint.get("background-opacity");if(0!==o){var r=t.context,a=r.gl,s=t.transform,l=s.tileSize,c=i.paint.get("background-pattern");if(!t.isPatternMissing(c)){var h=c||1!==n.a||1!==o?"translucent":"opaque";if(t.renderPass===h){var u=Ut.disabled,p=t.depthModeForSublayer(0,"opaque"===h?Ft.ReadWrite:Ft.ReadOnly),d=t.colorModeForRenderPass(),f=t.useProgram(c?"backgroundPattern":"background"),_=s.coveringTiles({tileSize:l});c&&(r.activeTexture.set(a.TEXTURE0),t.imageManager.bind(t.context));for(var m=i.getCrossfadeParameters(),g=0,v=_;g<v.length;g+=1){var y=v[g],x=t.transform.calculatePosMatrix(y.toUnwrapped()),b=c?Ri(x,o,t,c,{tileID:y,tileSize:l},m):Di(x,o,n);f.draw(r,a.TRIANGLES,p,u,d,Zt.disabled,b,i.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments);}}}}},debug:function(t,e,i){for(var n=0;n<i.length;n++)Wi(t,e,i[n]);},custom:function(t,e,i){var n=t.context,o=i.implementation;if("offscreen"===t.renderPass){var r=o.prerender;r&&(t.setCustomLayerDefaults(),r.call(o,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState()),"3d"===o.renderingMode&&(t.setCustomLayerDefaults(),Zi(t,i),o.render(n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState());}else"translucent"===t.renderPass&&("3d"===o.renderingMode?qi(t,i,1):(t.setCustomLayerDefaults(),n.setStencilMode(Ut.disabled),n.setDepthMode(Ft.disabled),o.render(n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)));}},Ki=function(e,i){this.context=new qt(e),this.transform=i,this._tileTextures={},this.setup(),this.numSublayers=Vt.maxUnderzooming+Vt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.depthRboNeedsClear=!0,this.emptyProgramConfiguration=new t.ProgramConfiguration,this.crossTileSymbolIndex=new Ge;};function Yi(t,e){if(t.row>e.row){var i=t;t=e,e=i;}return {x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function Ji(t,e,i,n,o){var r=Math.max(i,Math.floor(e.y0)),a=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s;}for(var l=t.dx/t.dy,c=e.dx/e.dy,h=t.dx>0,u=e.dx<0,p=r;p<a;p++){var d=l*Math.max(0,Math.min(t.dy,p+h-t.y0))+t.x0,f=c*Math.max(0,Math.min(e.dy,p+u-e.y0))+e.x0;o(Math.floor(f),Math.ceil(d),p);}}function Qi(t,e,i,n,o,r){var a,s=Yi(t,e),l=Yi(e,i),c=Yi(i,t);s.dy>l.dy&&(a=s,s=l,l=a),s.dy>c.dy&&(a=s,s=c,c=a),l.dy>c.dy&&(a=l,l=c,c=a),s.dy&&Ji(c,s,n,o,r),l.dy&&Ji(c,l,n,o,r);}Ki.prototype.resize=function(e,i){var n=this.context.gl;if(this.width=e*t.browser.devicePixelRatio,this.height=i*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var o=0,r=this.style._order;o<r.length;o+=1){var a=r[o];this.style._layers[a].resize();}this.depthRbo&&(n.deleteRenderbuffer(this.depthRbo),this.depthRbo=null);},Ki.prototype.setup=function(){var e=this.context,i=new t.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(t.EXTENT,0),i.emplaceBack(0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(i,Ye.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(n,Ye.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var o=new t.StructArrayLayout4i8;o.emplaceBack(0,0,0,0),o.emplaceBack(t.EXTENT,0,t.EXTENT,0),o.emplaceBack(0,t.EXTENT,0,t.EXTENT),o.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(o,t.rasterBoundsAttributes.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(1,0),r.emplaceBack(0,1),r.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(r,Ye.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var a=new t.StructArrayLayout1ui2;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(a);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);var l=this.context.gl;this.stencilClearMode=new Ut({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO);},Ki.prototype.clearStencil=function(){var e=this.context,i=e.gl,n=t.create();t.ortho(n,0,this.width,this.height,0,0,1),t.scale(n,n,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,i.TRIANGLES,Ft.disabled,this.stencilClearMode,Nt.disabled,Zt.disabled,mi(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments);},Ki.prototype._renderTileClippingMasks=function(t){var e=this.context,i=e.gl;e.setColorMode(Nt.disabled),e.setDepthMode(Ft.disabled);var n=this.useProgram("clippingMask"),o=1;this._tileClippingMaskIDs={};for(var r=0,a=t;r<a.length;r+=1){var s=a[r],l=this._tileClippingMaskIDs[s.key]=o++;n.draw(e,i.TRIANGLES,Ft.disabled,new Ut({func:i.ALWAYS,mask:0},l,255,i.KEEP,i.KEEP,i.REPLACE),Nt.disabled,Zt.disabled,mi(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments);}},Ki.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Ut({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},Ki.prototype.colorModeForRenderPass=function(){var e=this.context.gl;if(this._showOverdrawInspector){return new Nt([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0])}return "opaque"===this.renderPass?Nt.unblended:Nt.alphaBlended},Ki.prototype.depthModeForSublayer=function(t,e,i){var n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon,o=n-1+this.depthRange;return new Ft(i||this.context.gl.LEQUAL,e,[o,n])},Ki.prototype.render=function(e,i){this.style=e,this.options=i,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now());var n=this.style._order,o=this.style.sourceCaches;for(var r in o){var a=o[r];a.used&&a.prepare(this.context);}var s,l={},c={},h={};for(var u in o){var p=o[u];l[u]=p.getVisibleCoordinates(),c[u]=l[u].slice().reverse(),h[u]=p.getVisibleCoordinates(!0).reverse();}for(var d in o){var f=o[d],_=f.getSource();if("raster"===_.type||"raster-dem"===_.type){for(var m=[],g=0,v=l[d];g<v.length;g+=1){var y=v[g];m.push(f.getTile(y));}Ai(m,this.context);}}this.renderPass="offscreen",this.depthRboNeedsClear=!0;for(var x=0,b=n;x<b.length;x+=1){var w=b[x],E=this.style._layers[w];if(E.hasOffscreenPass()&&!E.isHidden(this.transform.zoom)){var T=c[E.source];("custom"===E.type||T.length)&&this.renderLayer(this,o[E.source],E,T);}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRange=(e._order.length+2)*this.numSublayers*this.depthEpsilon,this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){var S=this.style._layers[n[this.currentLayer]],C=o[S.source],I=l[S.source];S.source!==s&&C&&(this.clearStencil(),C.getSource().isTileClipped&&this._renderTileClippingMasks(I)),this.renderLayer(this,C,S,I),s=S.source;}for(this.renderPass="translucent",this.currentLayer=0,s=null;this.currentLayer<n.length;this.currentLayer++){var z=this.style._layers[n[this.currentLayer]],P=o[z.source],D=("symbol"===z.type?h:c)[z.source];z.source!==s&&P&&(this.clearStencil(),P.getSource().isTileClipped&&this._renderTileClippingMasks(l[z.source])),this.renderLayer(this,P,z,D),s=z.source;}if(this.options.showTileBoundaries)for(var R in o){Hi.debug(this,o[R],l[R]);break}this.setCustomLayerDefaults();},Ki.prototype.setupOffscreenDepthRenderbuffer=function(){var t=this.context;this.depthRbo||(this.depthRbo=t.createRenderbuffer(t.gl.DEPTH_COMPONENT16,this.width,this.height));},Ki.prototype.renderLayer=function(t,e,i,n){i.isHidden(this.transform.zoom)||("background"===i.type||"custom"===i.type||n.length)&&(this.id=i.id,Hi[i.type](t,e,i,n));},Ki.prototype.translatePosMatrix=function(e,i,n,o,r){if(!n[0]&&!n[1])return e;var a=r?"map"===o?this.transform.angle:0:"viewport"===o?-this.transform.angle:0;if(a){var s=Math.sin(a),l=Math.cos(a);n=[n[0]*l-n[1]*s,n[0]*s+n[1]*l];}var c=[r?n[0]:Te(i,n[0],this.transform.zoom),r?n[1]:Te(i,n[1],this.transform.zoom),0],h=new Float32Array(16);return t.translate(h,e,c),h},Ki.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t];},Ki.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},Ki.prototype.isPatternMissing=function(t){if(!t)return !1;var e=this.imageManager.getPattern(t.from),i=this.imageManager.getPattern(t.to);return !e||!i},Ki.prototype.useProgram=function(t,e){void 0===e&&(e=this.emptyProgramConfiguration),this.cache=this.cache||{};var i=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new ni(this.context,ei[t],e,Li[t],this._showOverdrawInspector)),this.cache[i]},Ki.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault();},Ki.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD);};var $i=function(t,e,i){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===i||i,this._minZoom=t||0,this._maxZoom=e||22,this.setMaxBounds(),this.width=0,this.height=0,this._center=new U(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={};},tn={minZoom:{configurable:!0},maxZoom:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},x:{configurable:!0},y:{configurable:!0},point:{configurable:!0}};$i.prototype.clone=function(){var t=new $i(this._minZoom,this._maxZoom,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._calcMatrices(),t},tn.minZoom.get=function(){return this._minZoom},tn.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t));},tn.maxZoom.get=function(){return this._maxZoom},tn.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t));},tn.renderWorldCopies.get=function(){return this._renderWorldCopies},tn.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t;},tn.worldSize.get=function(){return this.tileSize*this.scale},tn.centerPoint.get=function(){return this.size._div(2)},tn.size.get=function(){return new t.Point(this.width,this.height)},tn.bearing.get=function(){return -this.angle/Math.PI*180},tn.bearing.set=function(e){var i=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=t.create$4(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle));},tn.pitch.get=function(){return this._pitch/Math.PI*180},tn.pitch.set=function(e){var i=t.clamp(e,0,60)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices());},tn.fov.get=function(){return this._fov/Math.PI*180},tn.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices());},tn.zoom.get=function(){return this._zoom},tn.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices());},tn.center.get=function(){return this._center},tn.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices());},$i.prototype.coveringZoomLevel=function(t){return (t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},$i.prototype.getVisibleUnwrappedCoordinates=function(e){var i=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0),0),o=this.pointCoordinate(new t.Point(this.width,0),0),r=this.pointCoordinate(new t.Point(this.width,this.height),0),a=this.pointCoordinate(new t.Point(0,this.height),0),s=Math.floor(Math.min(n.column,o.column,r.column,a.column)),l=Math.floor(Math.max(n.column,o.column,r.column,a.column)),c=s-1;c<=l+1;c++)0!==c&&i.push(new t.UnwrappedTileID(c,e));return i},$i.prototype.coveringTiles=function(e){var i=this.coveringZoomLevel(e),n=i;if(void 0!==e.minzoom&&i<e.minzoom)return [];void 0!==e.maxzoom&&i>e.maxzoom&&(i=e.maxzoom);var o=this.pointCoordinate(this.centerPoint,i),r=new t.Point(o.column-.5,o.row-.5);return function(e,i,n,o){void 0===o&&(o=!0);var r=1<<e,a={};function s(i,s,l){var c,h,u,p;if(l>=0&&l<=r)for(c=i;c<s;c++)h=Math.floor(c/r),u=(c%r+r)%r,0!==h&&!0!==o||(p=new t.OverscaledTileID(n,h,e,u,l),a[p.key]=p);}return Qi(i[0],i[1],i[2],0,r,s),Qi(i[2],i[3],i[0],0,r,s),Object.keys(a).map(function(t){return a[t]})}(i,[this.pointCoordinate(new t.Point(0,0),i),this.pointCoordinate(new t.Point(this.width,0),i),this.pointCoordinate(new t.Point(this.width,this.height),i),this.pointCoordinate(new t.Point(0,this.height),i)],e.reparseOverscaled?n:i,this._renderWorldCopies).sort(function(t,e){return r.dist(t.canonical)-r.dist(e.canonical)})},$i.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices();},tn.unmodified.get=function(){return this._unmodified},$i.prototype.zoomScale=function(t){return Math.pow(2,t)},$i.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},$i.prototype.project=function(e){return new t.Point(this.lngX(e.lng),this.latY(e.lat))},$i.prototype.unproject=function(t){return new U(this.xLng(t.x),this.yLat(t.y))},tn.x.get=function(){return this.lngX(this.center.lng)},tn.y.get=function(){return this.latY(this.center.lat)},tn.point.get=function(){return new t.Point(this.x,this.y)},$i.prototype.lngX=function(t){return (180+t)*this.worldSize/360},$i.prototype.latY=function(e){return e=t.clamp(e,-this.maxValidLatitude,this.maxValidLatitude),(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))*this.worldSize/360},$i.prototype.xLng=function(t){return 360*t/this.worldSize-180},$i.prototype.yLat=function(t){var e=180-360*t/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90},$i.prototype.setLocationAtPoint=function(t,e){var i=this.pointCoordinate(e)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(t)._sub(i)),this._renderWorldCopies&&(this.center=this.center.wrap());},$i.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},$i.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},$i.prototype.locationCoordinate=function(e){return new t.Coordinate(this.lngX(e.lng)/this.tileSize,this.latY(e.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)},$i.prototype.coordinateLocation=function(t){var e=t.zoomTo(this.zoom);return new U(this.xLng(e.column*this.tileSize),this.yLat(e.row*this.tileSize))},$i.prototype.pointCoordinate=function(e,i){void 0===i&&(i=this.tileZoom);var n=[e.x,e.y,0,1],o=[e.x,e.y,1,1];t.transformMat4(n,n,this.pixelMatrixInverse),t.transformMat4(o,o,this.pixelMatrixInverse);var r=n[3],a=o[3],s=n[0]/r,l=o[0]/a,c=n[1]/r,h=o[1]/a,u=n[2]/r,p=o[2]/a,d=u===p?0:(0-u)/(p-u);return new t.Coordinate(t.number(s,l,d)/this.tileSize,t.number(c,h,d)/this.tileSize,this.zoom)._zoomTo(i)},$i.prototype.coordinatePoint=function(e){var i=e.zoomTo(this.zoom),n=[i.column*this.tileSize,i.row*this.tileSize,0,1];return t.transformMat4(n,n,this.pixelMatrix),new t.Point(n[0]/n[3],n[1]/n[3])},$i.prototype.getBounds=function(){return (new N).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},$i.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new N([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},$i.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude]);},$i.prototype.calculatePosMatrix=function(e,i){void 0===i&&(i=!1);var n=e.key,o=i?this._alignedPosMatrixCache:this._posMatrixCache;if(o[n])return o[n];var r=e.canonical,a=this.worldSize/this.zoomScale(r.z),s=r.x+Math.pow(2,r.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*a,r.y*a,0]),t.scale(l,l,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(l,i?this.alignedProjMatrix:this.projMatrix,l),o[n]=new Float32Array(l),o[n]},$i.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},$i.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,i,n,o,r=-90,a=90,s=-180,l=180,c=this.size,h=this._unmodified;if(this.latRange){var u=this.latRange;r=this.latY(u[1]),e=(a=this.latY(u[0]))-r<c.y?c.y/(a-r):0;}if(this.lngRange){var p=this.lngRange;s=this.lngX(p[0]),i=(l=this.lngX(p[1]))-s<c.x?c.x/(l-s):0;}var d=Math.max(i||0,e||0);if(d)return this.center=this.unproject(new t.Point(i?(l+s)/2:this.x,e?(a+r)/2:this.y)),this.zoom+=this.scaleZoom(d),this._unmodified=h,void(this._constraining=!1);if(this.latRange){var f=this.y,_=c.y/2;f-_<r&&(o=r+_),f+_>a&&(o=a-_);}if(this.lngRange){var m=this.x,g=c.x/2;m-g<s&&(n=s+g),m+g>l&&(n=l-g);}void 0===n&&void 0===o||(this.center=this.unproject(new t.Point(void 0!==n?n:this.x,void 0!==o?o:this.y))),this._unmodified=h,this._constraining=!1;}},$i.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=this._fov/2,i=Math.PI/2+this._pitch,n=Math.sin(e)*this.cameraToCenterDistance/Math.sin(Math.PI-i-e),o=this.x,r=this.y,a=1.01*(Math.cos(Math.PI/2-this._pitch)*n+this.cameraToCenterDistance),s=new Float64Array(16);t.perspective(s,this._fov,this.width/this.height,1,a),t.scale(s,s,[1,-1,1]),t.translate(s,s,[0,0,-this.cameraToCenterDistance]),t.rotateX(s,s,this._pitch),t.rotateZ(s,s,this.angle),t.translate(s,s,[-o,-r,0]),this.mercatorMatrix=t.scale([],s,[this.worldSize,this.worldSize,this.worldSize]);var l=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));t.scale(s,s,[1,1,l,1]),this.projMatrix=s;var c=this.width%2/2,h=this.height%2/2,u=Math.cos(this.angle),p=Math.sin(this.angle),d=o-Math.round(o)+u*c+p*h,f=r-Math.round(r)+u*h+p*c,_=new Float64Array(s);if(t.translate(_,_,[d>.5?d-1:d,f>.5?f-1:f,0]),this.alignedProjMatrix=_,s=t.create(),t.scale(s,s,[this.width/2,-this.height/2,1]),t.translate(s,s,[1,-1,0]),this.pixelMatrix=t.multiply(new Float64Array(16),s,this.projMatrix),!(s=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=s,this._posMatrixCache={},this._alignedPosMatrixCache={};}},$i.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)).zoomTo(this.zoom),i=[e.column*this.tileSize,e.row*this.tileSize,0,1];return t.transformMat4(i,i,this.pixelMatrix)[3]/this.cameraToCenterDistance},Object.defineProperties($i.prototype,tn);var en=function(){var e,i,n,o,r;t.bindAll(["_onHashChange","_updateHash"],this),this._updateHash=(e=this._updateHashUnthrottled.bind(this),i=300,n=!1,o=0,r=function(){o=0,n&&(e(),o=setTimeout(r,i),n=!1);},function(){return n=!0,o||r(),o});};en.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},en.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},en.prototype.getHashString=function(t){var e=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,n=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,n),r=Math.round(e.lng*o)/o,a=Math.round(e.lat*o)/o,s=this._map.getBearing(),l=this._map.getPitch(),c="";return c+=t?"#/"+r+"/"+a+"/"+i:"#"+i+"/"+a+"/"+r,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+="/"+Math.round(l)),c},en.prototype._onHashChange=function(){var e=t.window.location.hash.replace("#","").split("/");return e.length>=3&&(this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:+(e[3]||0),pitch:+(e[4]||0)}),!0)},en.prototype._updateHashUnthrottled=function(){var e=this.getHashString();t.window.history.replaceState(t.window.history.state,"",e);};var nn=function(e){function n(n,o,r,a){void 0===a&&(a={});var s=i.mousePos(o.getCanvasContainer(),r),l=o.unproject(s);e.call(this,n,t.extend({point:s,lngLat:l,originalEvent:r},a)),this._defaultPrevented=!1,this.target=o;}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var o={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0;},o.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,o),n}(t.Event),on=function(e){function n(n,o,r){var a=i.touchPos(o.getCanvasContainer(),r),s=a.map(function(t){return o.unproject(t)}),l=a.reduce(function(t,e,i,n){return t.add(e.div(n.length))},new t.Point(0,0)),c=o.unproject(l);e.call(this,n,{points:a,point:l,lngLats:s,lngLat:c,originalEvent:r}),this._defaultPrevented=!1;}e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n;var o={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0;},o.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,o),n}(t.Event),rn=function(t){function e(e,i,n){t.call(this,e,{originalEvent:n}),this._defaultPrevented=!1;}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0;},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,i),e}(t.Event),an=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this);};an.prototype.isEnabled=function(){return !!this._enabled},an.prototype.isActive=function(){return !!this._active},an.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around);},an.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},an.prototype.onWheel=function(e){if(this.isEnabled()){var i=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),o=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==i&&i%4.000244140625==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":o>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(o*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),e.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=e,this._delta-=i,this.isActive()||this._start(e)),e.preventDefault();}},an.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t);},an.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this._map.fire(new t.Event("movestart",{originalEvent:e})),this._map.fire(new t.Event("zoomstart",{originalEvent:e})),this._finishTimeout&&clearTimeout(this._finishTimeout);var n=i.mousePos(this._el,e);this._around=U.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame));}},an.prototype._onScrollFrame=function(){var e=this;if(this._frameId=null,this.isActive()){var i=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?1/450:.01,o=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==o&&(o=1/o);var r="number"==typeof this._targetZoom?i.zoomScale(this._targetZoom):i.scale;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom(r*o))),"wheel"===this._type&&(this._startZoom=i.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0;}var a="number"==typeof this._targetZoom?this._targetZoom:i.zoom,s=this._startZoom,l=this._easing,c=!1;if("wheel"===this._type&&s&&l){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),u=l(h);i.zoom=t.number(s,a,u),h<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):c=!0;}else i.zoom=a,c=!0;i.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new t.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new t.Event("zoom",{originalEvent:this._lastWheelEvent})),c&&(this._active=!1,this._finishTimeout=setTimeout(function(){e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom;},200));}},an.prototype._smoothOutEasing=function(e){var i=t.ease;if(this._prevEase){var n=this._prevEase,o=(t.browser.now()-n.start)/n.duration,r=n.easing(o+.01)-n.easing(o),a=.27/Math.sqrt(r*r+1e-4)*.01,s=Math.sqrt(.0729-a*a);i=t.bezier(a,s,.25,1);}return this._prevEase={start:t.browser.now(),duration:e,easing:i},i};var sn=function(e,i){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=i.clickTolerance||1,t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this);};sn.prototype.isEnabled=function(){return !!this._enabled},sn.prototype.isActive=function(){return !!this._active},sn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0);},sn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},sn.prototype.onMouseDown=function(e){this.isEnabled()&&e.shiftKey&&0===e.button&&(t.window.document.addEventListener("mousemove",this._onMouseMove,!1),t.window.document.addEventListener("keydown",this._onKeyDown,!1),t.window.document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=this._lastPos=i.mousePos(this._el,e),this._active=!0);},sn.prototype._onMouseMove=function(t){var e=i.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)<this._clickTolerance)){var n=this._startPos;this._lastPos=e,this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var o=Math.min(n.x,e.x),r=Math.max(n.x,e.x),a=Math.min(n.y,e.y),s=Math.max(n.y,e.y);i.setTransform(this._box,"translate("+o+"px,"+a+"px)"),this._box.style.width=r-o+"px",this._box.style.height=s-a+"px";}},sn.prototype._onMouseUp=function(e){if(0===e.button){var n=this._startPos,o=i.mousePos(this._el,e);this._finish(),i.suppressClick(),n.x===o.x&&n.y===o.y?this._fireEvent("boxzoomcancel",e):this._map.fitScreenCoordinates(n,o,this._map.getBearing(),{linear:!0}).fire(new t.Event("boxzoomend",{originalEvent:e}));}},sn.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t));},sn.prototype._finish=function(){this._active=!1,t.window.document.removeEventListener("mousemove",this._onMouseMove,!1),t.window.document.removeEventListener("keydown",this._onKeyDown,!1),t.window.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(i.remove(this._box),this._box=null),i.enableDrag(),delete this._startPos,delete this._lastPos;},sn.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,{originalEvent:i}))};var ln=t.bezier(0,0,.25,1),cn=function(e,i){this._map=e,this._el=i.element||e.getCanvasContainer(),this._state="disabled",this._button=i.button||"right",this._bearingSnap=i.bearingSnap||0,this._pitchWithRotate=!1!==i.pitchWithRotate,t.bindAll(["onMouseDown","_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this);};cn.prototype.isEnabled=function(){return "disabled"!==this._state},cn.prototype.isActive=function(){return "active"===this._state},cn.prototype.enable=function(){this.isEnabled()||(this._state="enabled");},cn.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled";}},cn.prototype.onMouseDown=function(e){if("enabled"===this._state){if("right"===this._button){if(this._eventButton=i.mouseButton(e),this._eventButton!==(e.ctrlKey?0:2))return}else{if(e.ctrlKey||0!==i.mouseButton(e))return;this._eventButton=0;}i.disableDrag(),t.window.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("mouseup",this._onMouseUp),t.window.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[t.browser.now(),this._map.getBearing()]],this._startPos=this._lastPos=i.mousePos(this._el,e),this._center=this._map.transform.centerPoint,e.preventDefault();}},cn.prototype._onMouseMove=function(t){var e=i.mousePos(this._el,t);this._lastPos.equals(e)||(this._lastMoveEvent=t,this._lastPos=e,"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)));},cn.prototype._onDragFrame=function(){this._frameId=null;var e=this._lastMoveEvent;if(e){var i=this._map.transform,n=this._startPos,o=this._lastPos,r=.8*(n.x-o.x),a=-.5*(n.y-o.y),s=i.bearing-r,l=i.pitch-a,c=this._inertia,h=c[c.length-1];this._drainInertiaBuffer(),c.push([t.browser.now(),this._map._normalizeBearing(s,h[1])]),i.bearing=s,this._pitchWithRotate&&(this._fireEvent("pitch",e),i.pitch=l),this._fireEvent("rotate",e),this._fireEvent("move",e),delete this._lastMoveEvent,this._startPos=this._lastPos;}},cn.prototype._onMouseUp=function(t){if(i.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",i.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind();}},cn.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind();}},cn.prototype._unbind=function(){t.window.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("mouseup",this._onMouseUp),t.window.removeEventListener("blur",this._onBlur),i.enableDrag();},cn.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._lastPos;},cn.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var i=this._map,n=i.getBearing(),o=this._inertia,r=function(){Math.abs(n)<e._bearingSnap?i.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t),e._pitchWithRotate&&e._fireEvent("pitchend",t);};if(o.length<2)r();else{var a=o[0],s=o[o.length-1],l=o[o.length-2],c=i._normalizeBearing(n,l[1]),h=s[1]-a[1],u=h<0?-1:1,p=(s[0]-a[0])/1e3;if(0!==h&&0!==p){var d=Math.abs(h*(.25/p));d>180&&(d=180);var f=d/180;c+=u*d*(f/2),Math.abs(i._normalizeBearing(c,0))<this._bearingSnap&&(c=i._normalizeBearing(0,c)),i.rotateTo(c,{duration:1e3*f,easing:ln,noMoveStart:!0},{originalEvent:t});}else r();}},cn.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,i?{originalEvent:i}:{}))},cn.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,i=t.browser.now();e.length>0&&i-e[0][0]>160;)e.shift();};var hn=t.bezier(0,0,.3,1),un=function(e,i){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",this._clickTolerance=i.clickTolerance||1,t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this);};un.prototype.isEnabled=function(){return "disabled"!==this._state},un.prototype.isActive=function(){return "active"===this._state},un.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled");},un.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled";}},un.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==i.mouseButton(e)||(i.addEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),i.addEventListener(t.window.document,"mouseup",this._onMouseUp),this._start(e)));},un.prototype.onTouchStart=function(e){"enabled"===this._state&&(e.touches.length>1||(i.addEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),i.addEventListener(t.window.document,"touchend",this._onTouchEnd),this._start(e)));},un.prototype._start=function(e){t.window.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._lastPos=i.mousePos(this._el,e),this._inertia=[[t.browser.now(),this._startPos]];},un.prototype._onMove=function(e){e.preventDefault();var n=i.mousePos(this._el,e);this._lastPos.equals(n)||"pending"===this._state&&n.dist(this._mouseDownPos)<this._clickTolerance||(this._lastMoveEvent=e,this._lastPos=n,this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),this._lastPos]),"pending"===this._state&&(this._state="active",this._fireEvent("dragstart",e),this._fireEvent("movestart",e)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)));},un.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._startPos),this._lastPos),this._fireEvent("drag",t),this._fireEvent("move",t),this._startPos=this._lastPos,delete this._lastMoveEvent;}},un.prototype._onMouseUp=function(t){if(0===i.mouseButton(t))switch(this._state){case"active":this._state="enabled",i.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind();}},un.prototype._onTouchEnd=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind();}},un.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("dragend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind();}},un.prototype._unbind=function(){i.removeEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),i.removeEventListener(t.window.document,"touchend",this._onTouchEnd),i.removeEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),i.removeEventListener(t.window.document,"mouseup",this._onMouseUp),i.removeEventListener(t.window,"blur",this._onBlur);},un.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._mouseDownPos,delete this._lastPos;},un.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var i=e[e.length-1],n=e[0],o=i[1].sub(n[1]),r=(i[0]-n[0])/1e3;if(0===r||i[1].equals(n[1]))this._fireEvent("moveend",t);else{var a=o.mult(.3/r),s=a.mag();s>1400&&(s=1400,a._unit()._mult(s));var l=s/750,c=a.mult(-l/2);this._map.panBy(c,{duration:1e3*l,easing:hn,noMoveStart:!0},{originalEvent:t});}}},un.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,i?{originalEvent:i}:{}))},un.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,i=t.browser.now();e.length>0&&i-e[0][0]>160;)e.shift();};var pn=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this);};function dn(t){return t*(2-t)}pn.prototype.isEnabled=function(){return !!this._enabled},pn.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0);},pn.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1);},pn.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,i=0,n=0,o=0,r=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),r=-1);break;case 40:t.shiftKey?n=-1:(r=1,t.preventDefault());break;default:return}var a=this._map,s=a.getZoom(),l={duration:300,delayEndEvents:500,easing:dn,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:a.getBearing()+15*i,pitch:a.getPitch()+10*n,offset:[100*-o,100*-r],center:a.getCenter()};a.easeTo(l,{originalEvent:t});}};var fn=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this);};fn.prototype.isEnabled=function(){return !!this._enabled},fn.prototype.isActive=function(){return !!this._active},fn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0);},fn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},fn.prototype.onTouchStart=function(t){var e=this;this.isEnabled()&&(t.points.length>1||(this._tapped?(clearTimeout(this._tapped),this._tapped=null,this._zoom(t)):this._tapped=setTimeout(function(){e._tapped=null;},300)));},fn.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t));},fn.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t);},fn.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd);};var _n=t.bezier(0,0,.15,1),mn=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this);};mn.prototype.isEnabled=function(){return !!this._enabled},mn.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around);},mn.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1);},mn.prototype.disableRotation=function(){this._rotationDisabled=!0;},mn.prototype.enableRotation=function(){this._rotationDisabled=!1;},mn.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var n=i.mousePos(this._el,e.touches[0]),o=i.mousePos(this._el,e.touches[1]),r=n.add(o).div(2);this._startVec=n.sub(o),this._startAround=this._map.transform.pointLocation(r),this._gestureIntent=void 0,this._inertia=[],i.addEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),i.addEventListener(t.window.document,"touchend",this._onEnd);}},mn.prototype._getTouchEventData=function(t){var e=i.mousePos(this._el,t.touches[0]),n=i.mousePos(this._el,t.touches[1]),o=e.sub(n);return {vec:o,center:e.add(n).div(2),scale:o.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI}},mn.prototype._onMove=function(e){if(2===e.touches.length){var i=this._getTouchEventData(e),n=i.vec,o=i.scale,r=i.bearing;if(!this._gestureIntent){var a=Math.abs(1-o)>.15;Math.abs(r)>10?this._gestureIntent="rotate":a&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new t.Event(this._gestureIntent+"start",{originalEvent:e})),this._map.fire(new t.Event("movestart",{originalEvent:e})),this._startVec=n);}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault();}},mn.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var i=this._map.transform;this._startScale||(this._startScale=i.scale,this._startBearing=i.bearing);var n=this._getTouchEventData(this._lastTouchEvent),o=n.center,r=n.bearing,a=n.scale,s=i.pointLocation(o),l=i.locationPoint(s);"rotate"===e&&(i.bearing=this._startBearing+r),i.zoom=i.scaleZoom(this._startScale*a),i.setLocationAtPoint(this._startAround,l),this._map.fire(new t.Event(e,{originalEvent:this._lastTouchEvent})),this._map.fire(new t.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),a,o]);}},mn.prototype._onEnd=function(e){i.removeEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),i.removeEventListener(t.window.document,"touchend",this._onEnd);var n=this._gestureIntent,o=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,n){this._map.fire(new t.Event(n+"end",{originalEvent:e})),this._drainInertiaBuffer();var r=this._inertia,a=this._map;if(r.length<2)a.snapToNorth({},{originalEvent:e});else{var s=r[r.length-1],l=r[0],c=a.transform.scaleZoom(o*s[1]),h=a.transform.scaleZoom(o*l[1]),u=c-h,p=(s[0]-l[0])/1e3,d=s[2];if(0!==p&&c!==h){var f=.15*u/p;Math.abs(f)>2.5&&(f=f>0?2.5:-2.5);var _=1e3*Math.abs(f/(12*.15)),m=c+f*_/2e3;m<0&&(m=0),a.easeTo({zoom:m,duration:_,easing:_n,around:this._aroundCenter?a.getCenter():a.unproject(d),noMoveStart:!0},{originalEvent:e});}else a.snapToNorth({},{originalEvent:e});}}},mn.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,i=t.browser.now();e.length>2&&i-e[0][0]>160;)e.shift();};var gn={scrollZoom:an,boxZoom:sn,dragRotate:cn,dragPan:un,keyboard:pn,doubleClickZoom:fn,touchZoomRotate:mn};var vn=function(e){function i(i,n){e.call(this),this._moving=!1,this._zooming=!1,this.transform=i,this._bearingSnap=n.bearingSnap,t.bindAll(["_renderFrameCallback"],this);}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.getCenter=function(){return this.transform.center},i.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},i.prototype.panBy=function(e,i,n){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},i),n)},i.prototype.panTo=function(e,i,n){return this.easeTo(t.extend({center:e},i),n)},i.prototype.getZoom=function(){return this.transform.zoom},i.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},i.prototype.zoomTo=function(e,i,n){return this.easeTo(t.extend({zoom:e},i),n)},i.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},i.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},i.prototype.getBearing=function(){return this.transform.bearing},i.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},i.prototype.rotateTo=function(e,i,n){return this.easeTo(t.extend({bearing:e},i),n)},i.prototype.resetNorth=function(e,i){return this.rotateTo(0,t.extend({duration:1e3},e),i),this},i.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},i.prototype.getPitch=function(){return this.transform.pitch},i.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},i.prototype.cameraForBounds=function(t,e){return t=N.convert(t),this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),0,e)},i.prototype._cameraForBoxAndBearing=function(e,i,n,o){if("number"==typeof(o=t.extend({padding:{top:0,bottom:0,right:0,left:0},offset:[0,0],maxZoom:this.transform.maxZoom},o)).padding){var r=o.padding;o.padding={top:r,bottom:r,right:r,left:r};}if(t.isEqual(Object.keys(o.padding).sort(function(t,e){return t<e?-1:t>e?1:0}),["bottom","left","right","top"])){var a=[(o.padding.left-o.padding.right)/2,(o.padding.top-o.padding.bottom)/2],s=Math.min(o.padding.right,o.padding.left),l=Math.min(o.padding.top,o.padding.bottom);o.offset=[o.offset[0]+a[0],o.offset[1]+a[1]];var c=this.transform,h=c.project(U.convert(e)),u=c.project(U.convert(i)),p=h.rotate(-n*Math.PI/180),d=u.rotate(-n*Math.PI/180),f=new t.Point(Math.max(p.x,d.x),Math.max(p.y,d.y)),_=new t.Point(Math.min(p.x,d.x),Math.min(p.y,d.y)),m=t.Point.convert(o.offset),g=f.sub(_),v=(c.width-2*s-2*Math.abs(m.x))/g.x,y=(c.height-2*l-2*Math.abs(m.y))/g.y;if(!(y<0||v<0))return o.center=c.unproject(h.add(u).div(2)),o.zoom=Math.min(c.scaleZoom(c.scale*Math.min(v,y)),o.maxZoom),o.bearing=n,o;t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");}else t.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'");},i.prototype.fitBounds=function(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)},i.prototype.fitScreenCoordinates=function(e,i,n,o,r){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(i)),n,o),o,r)},i.prototype._fitInternal=function(e,i,n){return e?(i=t.extend(e,i)).linear?this.easeTo(i,n):this.flyTo(i,n):this},i.prototype.jumpTo=function(e,i){this.stop();var n=this.transform,o=!1,r=!1,a=!1;return "zoom"in e&&n.zoom!==+e.zoom&&(o=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=U.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(r=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(a=!0,n.pitch=+e.pitch),this.fire(new t.Event("movestart",i)).fire(new t.Event("move",i)),o&&this.fire(new t.Event("zoomstart",i)).fire(new t.Event("zoom",i)).fire(new t.Event("zoomend",i)),r&&this.fire(new t.Event("rotatestart",i)).fire(new t.Event("rotate",i)).fire(new t.Event("rotateend",i)),a&&this.fire(new t.Event("pitchstart",i)).fire(new t.Event("pitch",i)).fire(new t.Event("pitchend",i)),this.fire(new t.Event("moveend",i))},i.prototype.easeTo=function(e,i){var n=this;this.stop(),!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate&&(e.duration=0);var o=this.transform,r=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l="zoom"in e?+e.zoom:r,c="bearing"in e?this._normalizeBearing(e.bearing,a):a,h="pitch"in e?+e.pitch:s,u=o.centerPoint.add(t.Point.convert(e.offset)),p=o.pointLocation(u),d=U.convert(e.center||p);this._normalizeCenter(d);var f,_,m=o.project(p),g=o.project(d).sub(m),v=o.zoomScale(l-r);return e.around&&(f=U.convert(e.around),_=o.locationPoint(f)),this._zooming=l!==r,this._rotating=a!==c,this._pitching=h!==s,this._prepareEase(i,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease(function(e){if(n._zooming&&(o.zoom=t.number(r,l,e)),n._rotating&&(o.bearing=t.number(a,c,e)),n._pitching&&(o.pitch=t.number(s,h,e)),f)o.setLocationAtPoint(f,_);else{var p=o.zoomScale(o.zoom-r),d=l>r?Math.min(2,v):Math.max(.5,v),y=Math.pow(d,1-e),x=o.unproject(m.add(g.mult(e*y)).mult(p));o.setLocationAtPoint(o.renderWorldCopies?x.wrap():x,u);}n._fireMoveEvents(i);},function(){e.delayEndEvents?n._easeEndTimeoutID=setTimeout(function(){return n._afterEase(i)},e.delayEndEvents):n._afterEase(i);},e),this},i.prototype._prepareEase=function(e,i){this._moving=!0,i||this.fire(new t.Event("movestart",e)),this._zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&this.fire(new t.Event("pitchstart",e));},i.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e));},i.prototype._afterEase=function(e){var i=this._zooming,n=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,i&&this.fire(new t.Event("zoomend",e)),n&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e));},i.prototype.flyTo=function(e,i){var n=this;this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,r=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):r,c="bearing"in e?this._normalizeBearing(e.bearing,a):a,h="pitch"in e?+e.pitch:s,u=o.zoomScale(l-r),p=o.centerPoint.add(t.Point.convert(e.offset)),d=o.pointLocation(p),f=U.convert(e.center||d);this._normalizeCenter(f);var _=o.project(d),m=o.project(f).sub(_),g=e.curve,v=Math.max(o.width,o.height),y=v/u,x=m.mag();if("minZoom"in e){var b=t.clamp(Math.min(e.minZoom,r,l),o.minZoom,o.maxZoom),w=v/o.zoomScale(b-r);g=Math.sqrt(w/x*2);}var E=g*g;function T(t){var e=(y*y-v*v+(t?-1:1)*E*E*x*x)/(2*(t?y:v)*E*x);return Math.log(Math.sqrt(e*e+1)-e)}function S(t){return (Math.exp(t)-Math.exp(-t))/2}function C(t){return (Math.exp(t)+Math.exp(-t))/2}var I=T(0),z=function(t){return C(I)/C(I+g*t)},P=function(t){return v*((C(I)*(S(e=I+g*t)/C(e))-S(I))/E)/x;var e;},D=(T(1)-I)/g;if(Math.abs(x)<1e-6||!isFinite(D)){if(Math.abs(v-y)<1e-6)return this.easeTo(e,i);var R=y<v?-1:1;D=Math.abs(Math.log(y/v))/g,P=function(){return 0},z=function(t){return Math.exp(R*g*t)};}if("duration"in e)e.duration=+e.duration;else{var L="screenSpeed"in e?+e.screenSpeed/g:+e.speed;e.duration=1e3*D/L;}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=a!==c,this._pitching=h!==s,this._prepareEase(i,!1),this._ease(function(e){var u=e*D,d=1/z(u);o.zoom=1===e?l:r+o.scaleZoom(d),n._rotating&&(o.bearing=t.number(a,c,e)),n._pitching&&(o.pitch=t.number(s,h,e));var g=1===e?f:o.unproject(_.add(m.mult(P(u))).mult(d));o.setLocationAtPoint(o.renderWorldCopies?g.wrap():g,p),n._fireMoveEvents(i);},function(){return n._afterEase(i)},e),this},i.prototype.isEasing=function(){return !!this._easeFrameId},i.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this);}return this},i.prototype._ease=function(e,i,n){!1===n.animate||0===n.duration?(e(1),i()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback));},i.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop();},i.prototype._normalizeBearing=function(e,i){e=t.wrap(e,-180,180);var n=Math.abs(e-i);return Math.abs(e-360-i)<n&&(e-=360),Math.abs(e+360-i)<n&&(e+=360),e},i.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var i=t.lng-e.center.lng;t.lng+=i>180?-360:i<-180?360:0;}},i}(t.Evented),yn=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this);};yn.prototype.getDefaultPosition=function(){return "bottom-right"},yn.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},yn.prototype.onRemove=function(){i.remove(this._container),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0;},yn.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var e=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:u.ACCESS_TOKEN}];if(t){var i=e.reduce(function(t,i,n){return i.value&&(t+=i.key+"="+i.value+(n<e.length-1?"&":"")),t},"?");t.href="https://www.mapbox.com/feedback/"+i+(this._map._hash?this._map._hash.getHashString(!0):"");}},yn.prototype._updateData=function(t){t&&"metadata"===t.sourceDataType&&(this._updateAttributions(),this._updateEditLink());},yn.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id;}var i=this._map.style.sourceCaches;for(var n in i){var o=i[n].getSource();o.attribution&&t.indexOf(o.attribution)<0&&t.push(o.attribution);}t.sort(function(t,e){return t.length-e.length}),(t=t.filter(function(e,i){for(var n=i+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return !1;return !0})).length?(this._container.innerHTML=t.join(" | "),this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null;}},yn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact");};var xn=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this);};xn.prototype.onAdd=function(t){this._map=t,this._container=i.create("div","mapboxgl-ctrl");var e=i.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.href="https://www.mapbox.com/",e.setAttribute("aria-label","Mapbox logo"),e.setAttribute("rel","noopener"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},xn.prototype.onRemove=function(){i.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact);},xn.prototype.getDefaultPosition=function(){return "bottom-left"},xn.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none");},xn.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t){if(t[e].getSource().mapbox_logo)return !0}return !1}},xn.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact");}};var bn=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1;};bn.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},bn.prototype.remove=function(t){for(var e=this._currentlyRunning,i=0,n=e?this._queue.concat(e):this._queue;i<n.length;i+=1){var o=n[i];if(o.id===t)return void(o.cancelled=!0)}},bn.prototype.run=function(){var t=this._currentlyRunning=this._queue;this._queue=[];for(var e=0,i=t;e<i.length;e+=1){var n=i[e];if(!n.cancelled&&(n.callback(),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1;},bn.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[];};var wn=t.window.HTMLImageElement,En=t.window.HTMLElement,Tn={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:22,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,clickTolerance:3,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},Sn=function(n){function o(e){var o=this;if(null!=(e=t.extend({},Tn,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than minZoom");var r=new $i(e.minZoom,e.maxZoom,e.renderWorldCopies);n.call(this,r,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new bn,this._controls=[];var a=e.transformRequest;if(this._transformRequest=a?function(t,e){return a(t,e)||{url:t}}:function(t){return {url:t}},"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof En))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container;}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return o._update(!1)}),this.on("zoom",function(){return o._update(!0)}),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var n=t.getCanvasContainer(),o=null,r=!1,a=null;for(var s in gn)t[s]=new gn[s](t,e),e.interactive&&e[s]&&t[s].enable(e[s]);i.addEventListener(n,"mouseout",function(e){t.fire(new nn("mouseout",t,e));}),i.addEventListener(n,"mousedown",function(o){r=!0,a=i.mousePos(n,o);var s=new nn("mousedown",t,o);t.fire(s),s.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(o),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(o),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(o));}),i.addEventListener(n,"mouseup",function(e){var i=t.dragRotate.isActive();o&&!i&&t.fire(new nn("contextmenu",t,o)),o=null,r=!1,t.fire(new nn("mouseup",t,e));}),i.addEventListener(n,"mousemove",function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var i=e.target;i&&i!==n;)i=i.parentNode;i===n&&t.fire(new nn("mousemove",t,e));}}),i.addEventListener(n,"mouseover",function(e){for(var i=e.target;i&&i!==n;)i=i.parentNode;i===n&&t.fire(new nn("mouseover",t,e));}),i.addEventListener(n,"touchstart",function(i){var n=new on("touchstart",t,i);t.fire(n),n.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(i),t.touchZoomRotate.onStart(i),t.doubleClickZoom.onTouchStart(n));},{passive:!1}),i.addEventListener(n,"touchmove",function(e){t.fire(new on("touchmove",t,e));},{passive:!1}),i.addEventListener(n,"touchend",function(e){t.fire(new on("touchend",t,e));}),i.addEventListener(n,"touchcancel",function(e){t.fire(new on("touchcancel",t,e));}),i.addEventListener(n,"click",function(o){var r=i.mousePos(n,o);(r.equals(a)||r.dist(a)<e.clickTolerance)&&t.fire(new nn("click",t,o));}),i.addEventListener(n,"dblclick",function(e){var i=new nn("dblclick",t,e);t.fire(i),i.defaultPrevented||t.doubleClickZoom.onDblClick(i);}),i.addEventListener(n,"contextmenu",function(e){var i=t.dragRotate.isActive();r||i?r&&(o=e):t.fire(new nn("contextmenu",t,e)),e.preventDefault();}),i.addEventListener(n,"wheel",function(i){e.interactive&&t.stop();var n=new rn("wheel",t,i);t.fire(n),n.defaultPrevented||t.scrollZoom.onWheel(i);},{passive:!1});}(this,e),this._hash=e.hash&&(new en).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),this.resize(),e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new yn({customAttribution:e.customAttribution})),this.addControl(new xn,e.logoPosition),this.on("style.load",function(){o.transform.unmodified&&o.jumpTo(o.style.stylesheet);}),this.on("data",function(e){o._update("style"===e.dataType),o.fire(new t.Event(e.dataType+"data",e));}),this.on("dataloading",function(e){o.fire(new t.Event(e.dataType+"dataloading",e));});}n&&(o.__proto__=n),o.prototype=Object.create(n&&n.prototype),o.prototype.constructor=o;var r={showTileBoundaries:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0}};return o.prototype.addControl=function(e,i){if(void 0===i&&e.getDefaultPosition&&(i=e.getDefaultPosition()),void 0===i&&(i="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var o=this._controlPositions[i];return -1!==i.indexOf("bottom")?o.insertBefore(n,o.firstChild):o.appendChild(n),this},o.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var i=this._controls.indexOf(e);return i>-1&&this._controls.splice(i,1),e.onRemove(this),this},o.prototype.resize=function(e){var i=this._containerDimensions(),n=i[0],o=i[1];return this._resizeCanvas(n,o),this.transform.resize(n,o),this.painter.resize(n,o),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)).fire(new t.Event("resize",e)).fire(new t.Event("moveend",e)),this},o.prototype.getBounds=function(){return this.transform.getBounds()},o.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},o.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(N.convert(t)),this._update()},o.prototype.setMinZoom=function(t){if((t=null===t||void 0===t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between 0 and the current maxZoom, inclusive")},o.prototype.getMinZoom=function(){return this.transform.minZoom},o.prototype.setMaxZoom=function(t){if((t=null===t||void 0===t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},o.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},o.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},o.prototype.getMaxZoom=function(){return this.transform.maxZoom},o.prototype.project=function(t){return this.transform.locationPoint(U.convert(t))},o.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},o.prototype.isMoving=function(){return this._moving||this.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},o.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isActive()},o.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},o.prototype.on=function(t,e,i){var o,r=this;if(void 0===i)return n.prototype.on.call(this,t,e);var a=function(){if("mouseenter"===t||"mouseover"===t){var n=!1;return {layer:e,listener:i,delegates:{mousemove:function(o){var a=r.getLayer(e)?r.queryRenderedFeatures(o.point,{layers:[e]}):[];a.length?n||(n=!0,i.call(r,new nn(t,r,o.originalEvent,{features:a}))):n=!1;},mouseout:function(){n=!1;}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return {layer:e,listener:i,delegates:{mousemove:function(n){(r.getLayer(e)?r.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,i.call(r,new nn(t,r,n.originalEvent)));},mouseout:function(e){a&&(a=!1,i.call(r,new nn(t,r,e.originalEvent)));}}}}return {layer:e,listener:i,delegates:(o={},o[t]=function(t){var n=r.getLayer(e)?r.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,i.call(r,t),delete t.features);},o)}}();for(var s in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(a),a.delegates)r.on(s,a.delegates[s]);return this},o.prototype.off=function(t,e,i){if(void 0===i)return n.prototype.off.call(this,t,e);if(this._delegatedListeners&&this._delegatedListeners[t])for(var o=this._delegatedListeners[t],r=0;r<o.length;r++){var a=o[r];if(a.layer===e&&a.listener===i){for(var s in a.delegates)this.off(s,a.delegates[s]);return o.splice(r,1),this}}return this},o.prototype.queryRenderedFeatures=function(e,i){if(!this.style)return [];var n;if(void 0!==i||void 0===e||e instanceof t.Point||Array.isArray(e)||(i=e,e=void 0),i=i||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])n=[t.Point.convert(e)];else{var o=t.Point.convert(e[0]),r=t.Point.convert(e[1]);n=[o,new t.Point(r.x,o.y),r,new t.Point(o.x,r.y),o];}return this.style.queryRenderedFeatures(n,i,this.transform)},o.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},o.prototype.setStyle=function(e,i){if((!i||!1!==i.diff&&!i.localIdeographFontFamily)&&this.style&&e&&"object"==typeof e)try{return this.style.setState(e)&&this._update(!0),this}catch(e){t.warnOnce("Unable to perform style diff: "+(e.message||e.error||e)+". Rebuilding the style from scratch.");}return this.style&&(this.style.setEventedParent(null),this.style._remove()),e?(this.style=new Ke(this,i||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e):this.style.loadJSON(e),this):(delete this.style,this)},o.prototype.getStyle=function(){if(this.style)return this.style.serialize()},o.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},o.prototype.addSource=function(t,e){return this.style.addSource(t,e),this._update(!0)},o.prototype.isSourceLoaded=function(e){var i=this.style&&this.style.sourceCaches[e];if(void 0!==i)return i.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")));},o.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var i=t[e]._tiles;for(var n in i){var o=i[n];if("loaded"!==o.state&&"errored"!==o.state)return !1}}return !0},o.prototype.addSourceType=function(t,e,i){return this.style.addSourceType(t,e,i)},o.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},o.prototype.getSource=function(t){return this.style.getSource(t)},o.prototype.addImage=function(e,i,n){void 0===n&&(n={});var o=n.pixelRatio;void 0===o&&(o=1);var r=n.sdf;if(void 0===r&&(r=!1),i instanceof wn){var a=t.browser.getImageData(i),s=a.width,l=a.height,c=a.data;this.style.addImage(e,{data:new t.RGBAImage({width:s,height:l},c),pixelRatio:o,sdf:r});}else{if(void 0===i.width||void 0===i.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var h=i.width,u=i.height,p=i.data;this.style.addImage(e,{data:new t.RGBAImage({width:h,height:u},new Uint8Array(p)),pixelRatio:o,sdf:r});}},o.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},o.prototype.removeImage=function(t){this.style.removeImage(t);},o.prototype.loadImage=function(e,i){t.getImage(this._transformRequest(e,t.ResourceType.Image),i);},o.prototype.listImages=function(){return this.style.listImages()},o.prototype.addLayer=function(t,e){return this.style.addLayer(t,e),this._update(!0)},o.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},o.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},o.prototype.getLayer=function(t){return this.style.getLayer(t)},o.prototype.setFilter=function(t,e){return this.style.setFilter(t,e),this._update(!0)},o.prototype.setLayerZoomRange=function(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)},o.prototype.getFilter=function(t){return this.style.getFilter(t)},o.prototype.setPaintProperty=function(t,e,i){return this.style.setPaintProperty(t,e,i),this._update(!0)},o.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},o.prototype.setLayoutProperty=function(t,e,i){return this.style.setLayoutProperty(t,e,i),this._update(!0)},o.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},o.prototype.setLight=function(t){return this.style.setLight(t),this._update(!0)},o.prototype.getLight=function(){return this.style.getLight()},o.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},o.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},o.prototype.getContainer=function(){return this._container},o.prototype.getCanvasContainer=function(){return this._canvasContainer},o.prototype.getCanvas=function(){return this._canvas},o.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},o.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.");},o.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=i.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=i.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=i.create("canvas","mapboxgl-canvas",e),this._canvas.style.position="absolute",this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map");var n=this._containerDimensions();this._resizeCanvas(n[0],n[1]);var o=this._controlContainer=i.create("div","mapboxgl-control-container",t),r=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){r[t]=i.create("div","mapboxgl-ctrl-"+t,o);});},o.prototype._resizeCanvas=function(e,i){var n=t.window.devicePixelRatio||1;this._canvas.width=n*e,this._canvas.height=n*i,this._canvas.style.width=e+"px",this._canvas.style.height=i+"px";},o.prototype._setupPainter=function(){var i=t.extend({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer},e.webGLContextAttributes),n=this._canvas.getContext("webgl",i)||this._canvas.getContext("experimental-webgl",i);n?this.painter=new Ki(n,this.transform):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")));},o.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}));},o.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}));},o.prototype.loaded=function(){return !this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},o.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},o.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},o.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t);},o.prototype._render=function(){this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run();var e=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var i=this.transform.zoom,n=t.browser.now();this.style.zoomHistory.update(i,n);var o=new t.EvaluationParameters(i,{now:n,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),r=o.crossFadingFactor();1===r&&r===this._crossFadingFactor||(e=!0,this._crossFadingFactor=r),this.style.update(o);}return this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),fadeDuration:this._fadeDuration}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||e)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),(this._sourcesDirty||this._repaint||this._styleDirty||this._placementDirty)&&this.triggerRepaint(),this},o.prototype.remove=function(){this._hash&&this._hash.remove(),this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));for(var e=0,i=this._controls;e<i.length;e+=1){i[e].onRemove(this);}this._controls=[];var n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext(),Cn(this._canvasContainer),Cn(this._controlContainer),Cn(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this.fire(new t.Event("remove"));},o.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame(function(){e._frame=null,e._render();}));},o.prototype._onWindowOnline=function(){this._update();},o.prototype._onWindowResize=function(){this._trackResize&&this.resize()._update();},r.showTileBoundaries.get=function(){return !!this._showTileBoundaries},r.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update());},r.showCollisionBoxes.get=function(){return !!this._showCollisionBoxes},r.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update());},r.showOverdrawInspector.get=function(){return !!this._showOverdrawInspector},r.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update());},r.repaint.get=function(){return !!this._repaint},r.repaint.set=function(t){this._repaint=t,this._update();},r.vertices.get=function(){return !!this._vertices},r.vertices.set=function(t){this._vertices=t,this._update();},Object.defineProperties(o.prototype,r),o}(vn);function Cn(t){t.parentNode&&t.parentNode.removeChild(t);}var In={showCompass:!0,showZoom:!0},zn=function(e){var n=this;this.options=t.extend({},In,e),this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this.options.showZoom&&(this._zoomInButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-in","Zoom In",function(){return n._map.zoomIn()}),this._zoomOutButton=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-zoom-out","Zoom Out",function(){return n._map.zoomOut()})),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-icon mapboxgl-ctrl-compass","Reset North",function(){return n._map.resetNorth()}),this._compassArrow=i.create("span","mapboxgl-ctrl-compass-arrow",this._compass));};function Pn(t,e,i){if(t=new U(t.lng,t.lat),e){var n=new U(t.lng-360,t.lat),o=new U(t.lng+360,t.lat),r=i.locationPoint(t).distSqr(e);i.locationPoint(n).distSqr(e)<r?t=n:i.locationPoint(o).distSqr(e)<r&&(t=o);}for(;Math.abs(t.lng-i.center.lng)>180;){var a=i.locationPoint(t);if(a.x>=0&&a.y>=0&&a.x<=i.width&&a.y<=i.height)break;t.lng>i.center.lng?t.lng-=360:t.lng+=360;}return t}zn.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t;},zn.prototype.onAdd=function(t){return this._map=t,this.options.showCompass&&(this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new cn(t,{button:"left",element:this._compass}),i.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),this._handler.enable()),this._container},zn.prototype.onRemove=function(){i.remove(this._container),this.options.showCompass&&(this._map.off("rotate",this._rotateCompassArrow),i.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),this._handler.disable(),delete this._handler),delete this._map;},zn.prototype._createButton=function(t,e,n){var o=i.create("button",t,this._container);return o.type="button",o.setAttribute("aria-label",e),o.addEventListener("click",n),o};var Dn={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 Rn(t,e,i){var n=t.classList;for(var o in Dn)n.remove("mapboxgl-"+i+"-anchor-"+o);n.add("mapboxgl-"+i+"-anchor-"+e);}var Ln,An=function(e){function n(n){if(e.call(this),(arguments[0]instanceof t.window.HTMLElement||2===arguments.length)&&(n=t.extend({element:n},arguments[1])),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._draggable=n&&n.draggable||!1,this._state="inactive",n&&n.element)this._element=n.element,this._offset=t.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=i.create("div");var o=i.createNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"height","41px"),o.setAttributeNS(null,"width","27px"),o.setAttributeNS(null,"viewBox","0 0 27 41");var r=i.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");var a=i.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"fill-rule","nonzero");var s=i.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"transform","translate(3.0, 29.0)"),s.setAttributeNS(null,"fill","#000000");for(var l=0,c=[{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"}];l<c.length;l+=1){var h=c[l],u=i.createNS("http://www.w3.org/2000/svg","ellipse");u.setAttributeNS(null,"opacity","0.04"),u.setAttributeNS(null,"cx","10.5"),u.setAttributeNS(null,"cy","5.80029008"),u.setAttributeNS(null,"rx",h.rx),u.setAttributeNS(null,"ry",h.ry),s.appendChild(u);}var p=i.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"fill",this._color);var d=i.createNS("http://www.w3.org/2000/svg","path");d.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"),p.appendChild(d);var f=i.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"opacity","0.25"),f.setAttributeNS(null,"fill","#000000");var _=i.createNS("http://www.w3.org/2000/svg","path");_.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"),f.appendChild(_);var m=i.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(6.0, 7.0)"),m.setAttributeNS(null,"fill","#FFFFFF");var g=i.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(8.0, 8.0)");var v=i.createNS("http://www.w3.org/2000/svg","circle");v.setAttributeNS(null,"fill","#000000"),v.setAttributeNS(null,"opacity","0.25"),v.setAttributeNS(null,"cx","5.5"),v.setAttributeNS(null,"cy","5.5"),v.setAttributeNS(null,"r","5.4999962");var y=i.createNS("http://www.w3.org/2000/svg","circle");y.setAttributeNS(null,"fill","#FFFFFF"),y.setAttributeNS(null,"cx","5.5"),y.setAttributeNS(null,"cy","5.5"),y.setAttributeNS(null,"r","5.4999962"),g.appendChild(v),g.appendChild(y),a.appendChild(s),a.appendChild(p),a.appendChild(f),a.appendChild(m),a.appendChild(g),o.appendChild(a),this._element.appendChild(o),this._offset=t.Point.convert(n&&n.offset||[0,-14]);}this._element.classList.add("mapboxgl-marker"),this._popup=null;}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},n.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),delete this._map),i.remove(this._element),this._popup&&this._popup.remove(),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(t){return this._lngLat=U.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},n.prototype.getElement=function(){return this._element},n.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset;}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat);}return this},n.prototype._onMapClick=function(t){var e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup();},n.prototype.getPopup=function(){return this._popup},n.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},n.prototype._update=function(t){this._map&&(this._map.transform.renderWorldCopies&&(this._lngLat=Pn(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset),t&&"moveend"!==t.type||(this._pos=this._pos.round()),i.setTransform(this._element,Dn[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px)"),Rn(this._element,this._anchor,"marker"));},n.prototype.getOffset=function(){return this._offset},n.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},n.prototype._onMove=function(e){this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"));},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive";},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),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));},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n}(t.Evented),Mn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0};var kn=function(e){function n(i){e.call(this),this.options=t.extend({},Mn,i),t.bindAll(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker"],this);}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Ln?n(Ln):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then(function(t){Ln="denied"!==t.state,n(Ln);}):(Ln=!!t.window.navigator.geolocation,n(Ln)),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),i.remove(this._container),this._map=void 0;},n.prototype._onSuccess=function(e){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("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish();},n.prototype._updateCamera=function(t){var e=new U(t.coords.longitude,t.coords.latitude),i=t.coords.accuracy;this._map.fitBounds(e.toBounds(i),this.options.fitBoundsOptions,{geolocateSource:!0});},n.prototype._updateMarker=function(t){t?this._userLocationDotMarker.setLngLat([t.coords.longitude,t.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove();},n.prototype._onError=function(e){if(this.options.trackUserLocation)if(1===e.code)this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),void 0!==this._geolocationWatchID&&this._clearWatch();else switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish();},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0;},n.prototype._setupUI=function(e){var n=this;!1!==e?(this._container.addEventListener("contextmenu",function(t){return t.preventDefault()}),this._geolocateButton=i.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.setAttribute("aria-label","Geolocate"),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=i.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new An(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(e){e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")));})):t.warnOnce("Geolocation support is not available, the GeolocateControl will not be visible.");},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("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.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"));}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions));}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return !0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null);},n}(t.Evented),Bn={maxWidth:100,unit:"metric"},On=function(e){this.options=t.extend({},Bn,e),t.bindAll(["_onMove","setUnit"],this);};function Fn(t,e,i){var n,o,r,a,s,l,c=i&&i.maxWidth||100,h=t._container.clientHeight/2,u=(n=t.unproject([0,h]),o=t.unproject([c,h]),r=Math.PI/180,a=n.lat*r,s=o.lat*r,l=Math.sin(a)*Math.sin(s)+Math.cos(a)*Math.cos(s)*Math.cos((o.lng-n.lng)*r),6371e3*Math.acos(Math.min(l,1)));if(i&&"imperial"===i.unit){var p=3.2808*u;if(p>5280)Un(e,c,p/5280,"mi");else Un(e,c,p,"ft");}else if(i&&"nautical"===i.unit){Un(e,c,u/1852,"nm");}else Un(e,c,u,"m");}function Un(t,e,i,n){var o,r,a,s=(o=i,(r=Math.pow(10,(""+Math.floor(o)).length-1))*(a=(a=o/r)>=10?10:a>=5?5:a>=3?3:a>=2?2:1)),l=s/i;"m"===n&&s>=1e3&&(s/=1e3,n="km"),t.style.width=e*l+"px",t.innerHTML=s+n;}On.prototype.getDefaultPosition=function(){return "bottom-left"},On.prototype._onMove=function(){Fn(this._map,this._container,this.options);},On.prototype.onAdd=function(t){return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},On.prototype.onRemove=function(){i.remove(this._container),this._map.off("move",this._onMove),this._map=void 0;},On.prototype.setUnit=function(t){this.options.unit=t,Fn(this._map,this._container,this.options);};var Nn=function(){this._fullscreen=!1,t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange"),this._className="mapboxgl-ctrl";};Nn.prototype.onAdd=function(e){return this._map=e,this._mapContainer=this._map.getContainer(),this._container=i.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._container.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._container},Nn.prototype.onRemove=function(){i.remove(this._container),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon);},Nn.prototype._checkFullscreenSupport=function(){return !!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Nn.prototype._setupUI=function(){var e=this._fullscreenButton=i.create("button",this._className+"-icon "+this._className+"-fullscreen",this._container);e.setAttribute("aria-label","Toggle fullscreen"),e.type="button",this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon);},Nn.prototype._isFullscreen=function(){return this._fullscreen},Nn.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._mapContainer!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"));},Nn.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._mapContainer.requestFullscreen?this._mapContainer.requestFullscreen():this._mapContainer.mozRequestFullScreen?this._mapContainer.mozRequestFullScreen():this._mapContainer.msRequestFullscreen?this._mapContainer.msRequestFullscreen():this._mapContainer.webkitRequestFullscreen&&this._mapContainer.webkitRequestFullscreen();};var Zn={closeButton:!0,closeOnClick:!0,className:""},qn=function(e){function n(i){e.call(this),this.options=t.extend(Object.create(Zn),i),t.bindAll(["_update","_onClickClose"],this);}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this._map=e,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return !!this._map},n.prototype.remove=function(){return this._content&&i.remove(this._content),this._container&&(i.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(t){return this._lngLat=U.convert(t),this._pos=null,this._update(),this},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var i,n=t.window.document.createDocumentFragment(),o=t.window.document.createElement("body");for(o.innerHTML=e;i=o.firstChild;)n.appendChild(i);return this.setDOMContent(n)},n.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},n.prototype._createContent=function(){this._content&&i.remove(this._content),this._content=i.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=i.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClickClose));},n.prototype._update=function(){var e=this;if(this._map&&this._lngLat&&this._content){this._container||(this._container=i.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=i.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(t){return e._container.classList.add(t)})),this._map.transform.renderWorldCopies&&(this._lngLat=Pn(this._lngLat,this._pos,this._map.transform));var n=this._pos=this._map.project(this._lngLat),o=this.options.anchor,r=function e(i){if(i){if("number"==typeof i){var n=Math.round(Math.sqrt(.5*Math.pow(i,2)));return {center:new t.Point(0,0),top:new t.Point(0,i),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-i),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(i,0),right:new t.Point(-i,0)}}if(i instanceof t.Point||Array.isArray(i)){var o=t.Point.convert(i);return {center:o,top:o,"top-left":o,"top-right":o,bottom:o,"bottom-left":o,"bottom-right":o,left:o,right:o}}return {center:t.Point.convert(i.center||[0,0]),top:t.Point.convert(i.top||[0,0]),"top-left":t.Point.convert(i["top-left"]||[0,0]),"top-right":t.Point.convert(i["top-right"]||[0,0]),bottom:t.Point.convert(i.bottom||[0,0]),"bottom-left":t.Point.convert(i["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(i["bottom-right"]||[0,0]),left:t.Point.convert(i.left||[0,0]),right:t.Point.convert(i.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var a,s=this._container.offsetWidth,l=this._container.offsetHeight;a=n.y+r.bottom.y<l?["top"]:n.y>this._map.transform.height-l?["bottom"]:[],n.x<s/2?a.push("left"):n.x>this._map.transform.width-s/2&&a.push("right"),o=0===a.length?"bottom":a.join("-");}var c=n.add(r[o]).round();i.setTransform(this._container,Dn[o]+" translate("+c.x+"px,"+c.y+"px)"),Rn(this._container,o,"popup");}},n.prototype._onClickClose=function(){this.remove();},n}(t.Evented);var Vn={version:"0.50.0",supported:e,setRTLTextPlugin:t.setRTLTextPlugin,Map:Sn,NavigationControl:zn,GeolocateControl:kn,AttributionControl:yn,ScaleControl:On,FullscreenControl:Nn,Popup:qn,Marker:An,Style:Ke,LngLat:U,LngLatBounds:N,Point:t.Point,Evented:t.Evented,config:u,get accessToken(){return u.ACCESS_TOKEN},set accessToken(t){u.ACCESS_TOKEN=t;},get workerCount(){return Kt.workerCount},set workerCount(t){Kt.workerCount=t;},workerUrl:""};return Vn});
+
+//
+
+return mapboxgl;
+
+})));
+//# sourceMappingURL=mapbox-gl.js.map
diff --git a/ui/component/or-map/package.json b/ui/component/or-map/package.json
index 404b00e44..8639fe28a 100644
--- a/ui/component/or-map/package.json
+++ b/ui/component/or-map/package.json
@@ -11,11 +11,11 @@
"author": "OpenRemote",
"license": "AGPL-3.0-or-later",
"dependencies": {
- "@polymer/polymer": "^3.2.0",
"@openremote/core": "^1.0.0",
- "@types/mapbox-gl": "^0.51.1",
+ "@polymer/polymer": "^3.2.0",
+ "@types/mapbox-gl": "^0.54.2",
"lit-element": "^2.1.0",
- "mapbox-gl": "^0.52.0-beta.1",
+ "mapbox-gl": "1.2.1",
"mapbox.js": "^3.2.0"
},
"devDependencies": {
diff --git a/yarn.lock b/yarn.lock
index dbe7b972e..c3b098d12 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -658,6 +658,16 @@
dependencies:
wgs84 "0.0.0"
+"@mapbox/geojson-rewind@^0.4.0":
+ version "0.4.0"
+ resolved "https://registry.yarnpkg.com/@mapbox/geojson-rewind/-/geojson-rewind-0.4.0.tgz#0d3632d4c1b4a928cf10a06ade387e1c8a8c181b"
+ integrity sha512-b+1uPWBERW4Pet/969BNu61ZPDyH2ilIxBjJDFzxyS9TyszF9UrTQyYIl/G38clux3rtpAGGFSGTCSF/qR6UjA==
+ dependencies:
+ "@mapbox/geojson-area" "0.2.2"
+ concat-stream "~1.6.0"
+ minimist "1.2.0"
+ sharkdown "^0.1.0"
+
"@mapbox/geojson-types@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz#9aecf642cb00eab1080a57c4f949a65b4a5846d6"
@@ -1052,10 +1062,10 @@
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.123.tgz#39be5d211478c8dd3bdae98ee75bb7efe4abfe4d"
integrity sha512-pQvPkc4Nltyx7G1Ww45OjVqUsJP4UsZm+GWJpigXgkikZqJgRm4c48g027o6tdgubWHwFRF15iFd+Y4Pmqv6+Q==
-"@types/mapbox-gl@^0.51.1":
- version "0.51.4"
- resolved "https://registry.yarnpkg.com/@types/mapbox-gl/-/mapbox-gl-0.51.4.tgz#74ae72af6ea8fcead9a85b44d408e8bc97f91bb5"
- integrity sha512-+MqOB1O81rBKPE0mobvgfMs7FugtNnZY42y4sOHj/ljyoIiidyAQ+N27Jd5eTZ8arLAMzbxmDJ0s5oukAgZroQ==
+"@types/mapbox-gl@^0.54.2":
+ version "0.54.2"
+ resolved "https://registry.yarnpkg.com/@types/mapbox-gl/-/mapbox-gl-0.54.2.tgz#989bfc70c7f58455e12757c5ebc5ba887eebaaee"
+ integrity sha512-F46GW9xeGSS1WQhWMPqiHF33zmHpL6ek+lLw/kQbMay4ZQ+fhK3uWDBF7AG0SYRoSmMBIYth03FR4GMpBy9Tyw==
dependencies:
"@types/geojson" "*"
@@ -2546,7 +2556,7 @@ duplexify@^3.4.2, duplexify@^3.6.0:
readable-stream "^2.0.0"
stream-shift "^1.0.0"
-earcut@^2.1.3:
+earcut@^2.1.3, earcut@^2.1.5:
version "2.1.5"
resolved "https://registry.yarnpkg.com/earcut/-/earcut-2.1.5.tgz#829280a9a3a0f5fee0529f0a47c3e4eff09b21e4"
integrity sha512-QFWC7ywTVLtvRAJTVp8ugsuuGQ5mVqNmJ1cRYeLrSHgP3nycr2RHTJob9OtM0v8ujuoKN0NY1a93J/omeTL1PA==
@@ -2685,10 +2695,10 @@ eslint-scope@^4.0.0:
esrecurse "^4.1.0"
estraverse "^4.1.1"
-esm@^3.0.84:
- version "3.2.20"
- resolved "https://registry.yarnpkg.com/esm/-/esm-3.2.20.tgz#44f125117863427cdece7223baa411fc739c1939"
- integrity sha512-NA92qDA8C/qGX/xMinDGa3+cSPs4wQoFxskRrSnDo/9UloifhONFm4sl4G+JsyCqM007z2K+BfQlH5rMta4K1Q==
+esm@~3.0.84:
+ version "3.0.84"
+ resolved "https://registry.yarnpkg.com/esm/-/esm-3.0.84.tgz#bb108989f4673b32d4f62406869c28eed3815a63"
+ integrity sha512-SzSGoZc17S7P+12R9cg21Bdb7eybX25RnIeRZ80xZs+VZ3kdQKzqTp2k4hZJjR7p9l0186TTXSgrxzlMDBktlw==
esprima@^3.1.3:
version "3.1.3"
@@ -3135,6 +3145,11 @@ gl-matrix@^2.6.1:
resolved "https://registry.yarnpkg.com/gl-matrix/-/gl-matrix-2.8.1.tgz#1c7873448eac61d2cd25803a074e837bd42581a3"
integrity sha512-0YCjVpE3pS5XWlN3J4X7AiAx65+nqAI54LndtVFnQZB6G/FVLkZH8y8V6R3cIoOQR4pUdfwQGd1iwyoXHJ4Qfw==
+gl-matrix@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/gl-matrix/-/gl-matrix-3.1.0.tgz#f5b2de17d8fed95a79e5025b10cded0ab9ccbed0"
+ integrity sha512-526NA+3EA+ztAQi0IZpSWiM0fyQXIp7IbRvfJ4wS/TjjQD0uv0fVybXwwqqSOlq33UckivI0yMDlVtboWm3k7A==
+
glob-parent@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae"
@@ -3232,7 +3247,7 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2:
resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725"
integrity sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=
-grid-index@^1.0.0:
+grid-index@^1.0.0, grid-index@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/grid-index/-/grid-index-1.1.0.tgz#97f8221edec1026c8377b86446a7c71e79522ea7"
integrity sha512-HZRwumpOGUrHyxO5bqKZL0B0GlUpwtCAzZ42sgxUPniu33R1LSFH5yrIcBCHjkctCAh3mtWKcKd9J4vDDdeVHA==
@@ -4166,11 +4181,12 @@ map-visit@^1.0.0:
dependencies:
object-visit "^1.0.0"
-mapbox-gl@^0.50.0:
- version "0.50.0"
- resolved "https://registry.yarnpkg.com/mapbox-gl/-/mapbox-gl-0.50.0.tgz#49f44149f02fdd25ab64a2ec4efc7a11a5c96f55"
- integrity sha512-rr/fP1mlsQBtAE3JaYenSFM5tYRzYaSU1j7KsrPtICSHMzAUMrsl1TlnC5JpMbcZu6nu8R2GFTJ8hYsoBsX9Bg==
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/mapbox-gl/-/mapbox-gl-1.2.1.tgz#a91acb48e5ee57d40a09fa6b4c297e92690c5909"
+ integrity sha512-CO7uhTYtcreDokGr3W2LifIdCtHz0TO/BqnRtO5rQ4Rvm8P7ndUM5ZWwZvJJmNnlkMpVwNKSESsKYX32GXHXoQ==
dependencies:
+ "@mapbox/geojson-rewind" "^0.4.0"
"@mapbox/geojson-types" "^1.0.2"
"@mapbox/jsonlint-lines-primitives" "^2.0.2"
"@mapbox/mapbox-gl-supported" "^1.4.0"
@@ -4179,27 +4195,26 @@ mapbox-gl@^0.50.0:
"@mapbox/unitbezier" "^0.0.0"
"@mapbox/vector-tile" "^1.3.1"
"@mapbox/whoots-js" "^3.1.0"
- brfs "^1.4.4"
csscolorparser "~1.0.2"
- earcut "^2.1.3"
- geojson-rewind "^0.3.0"
- geojson-vt "^3.2.0"
- gl-matrix "^2.6.1"
- grid-index "^1.0.0"
+ earcut "^2.1.5"
+ esm "~3.0.84"
+ geojson-vt "^3.2.1"
+ gl-matrix "^3.0.0"
+ grid-index "^1.1.0"
minimist "0.0.8"
murmurhash-js "^1.0.0"
pbf "^3.0.5"
potpack "^1.0.1"
- quickselect "^1.0.0"
+ quickselect "^2.0.0"
rw "^1.3.3"
- supercluster "^4.1.1"
- tinyqueue "^1.1.0"
- vt-pbf "^3.0.1"
+ supercluster "^6.0.1"
+ tinyqueue "^2.0.0"
+ vt-pbf "^3.1.1"
-mapbox-gl@^0.52.0-beta.1:
- version "0.52.0"
- resolved "https://registry.yarnpkg.com/mapbox-gl/-/mapbox-gl-0.52.0.tgz#a43b61caa339ae28e43c87ecfbe9ce4032795859"
- integrity sha512-jiZMGI7LjBNiSwYpFA3drzbZXrgEGERGJRpNS95t5BLZoc8Z+ggOOI1Fz2X+zLlh1j32iNDtf4j6En+caWwYiQ==
+mapbox-gl@^0.50.0:
+ version "0.50.0"
+ resolved "https://registry.yarnpkg.com/mapbox-gl/-/mapbox-gl-0.50.0.tgz#49f44149f02fdd25ab64a2ec4efc7a11a5c96f55"
+ integrity sha512-rr/fP1mlsQBtAE3JaYenSFM5tYRzYaSU1j7KsrPtICSHMzAUMrsl1TlnC5JpMbcZu6nu8R2GFTJ8hYsoBsX9Bg==
dependencies:
"@mapbox/geojson-types" "^1.0.2"
"@mapbox/jsonlint-lines-primitives" "^2.0.2"
@@ -4209,11 +4224,11 @@ mapbox-gl@^0.52.0-beta.1:
"@mapbox/unitbezier" "^0.0.0"
"@mapbox/vector-tile" "^1.3.1"
"@mapbox/whoots-js" "^3.1.0"
+ brfs "^1.4.4"
csscolorparser "~1.0.2"
earcut "^2.1.3"
- esm "^3.0.84"
geojson-rewind "^0.3.0"
- geojson-vt "^3.2.1"
+ geojson-vt "^3.2.0"
gl-matrix "^2.6.1"
grid-index "^1.0.0"
minimist "0.0.8"
@@ -4222,7 +4237,7 @@ mapbox-gl@^0.52.0-beta.1:
potpack "^1.0.1"
quickselect "^1.0.0"
rw "^1.3.3"
- supercluster "^5.0.0"
+ supercluster "^4.1.1"
tinyqueue "^1.1.0"
vt-pbf "^3.0.1"
@@ -5279,6 +5294,11 @@ quickselect@^1.0.0:
resolved "https://registry.yarnpkg.com/quickselect/-/quickselect-1.1.1.tgz#852e412ce418f237ad5b660d70cffac647ae94c2"
integrity sha512-qN0Gqdw4c4KGPsBOQafj6yj/PA6c/L63f6CaZ/DCF/xF4Esu3jVmKLUDYxghFx8Kb/O7y9tI7x2RjTSXwdK1iQ==
+quickselect@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/quickselect/-/quickselect-2.0.0.tgz#f19680a486a5eefb581303e023e98faaf25dd018"
+ integrity sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==
+
quote-stream@^1.0.1, quote-stream@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/quote-stream/-/quote-stream-1.0.2.tgz#84963f8c9c26b942e153feeb53aae74652b7e0b2"
@@ -6134,10 +6154,10 @@ supercluster@^4.1.1:
dependencies:
kdbush "^2.0.1"
-supercluster@^5.0.0:
- version "5.0.0"
- resolved "https://registry.yarnpkg.com/supercluster/-/supercluster-5.0.0.tgz#2a5a9b1ffbd0d6180dea10039d78b5d95fdb8f27"
- integrity sha512-9eeD5Q3908+tqdz+wYHHzi5mLKgnqtpO5mrjUfqr67UmGuOwBtVoQ9pJJrfcVHwMwC0wEBvfNRF9PgFOZgsOpw==
+supercluster@^6.0.1:
+ version "6.0.2"
+ resolved "https://registry.yarnpkg.com/supercluster/-/supercluster-6.0.2.tgz#aa2eaae185ef97872f388c683ec29f6991721ee3"
+ integrity sha512-aa0v2HURjBTOpbcknilcfxGDuArM8khklKSmZ/T8ZXL0BuRwb5aRw95lz+2bmWpFvCXDX/+FzqHxmg0TIaJErw==
dependencies:
kdbush "^3.0.0"
@@ -6248,6 +6268,11 @@ tinyqueue@^1.1.0:
resolved "https://registry.yarnpkg.com/tinyqueue/-/tinyqueue-1.2.3.tgz#b6a61de23060584da29f82362e45df1ec7353f3d"
integrity sha512-Qz9RgWuO9l8lT+Y9xvbzhPT2efIUIFd69N7eF7tJ9lnQl0iLj1M7peK7IoUGZL9DJHw9XftqLreccfxcQgYLxA==
+tinyqueue@^2.0.0:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/tinyqueue/-/tinyqueue-2.0.3.tgz#64d8492ebf39e7801d7bd34062e29b45b2035f08"
+ integrity sha512-ppJZNDuKGgxzkHihX8v9v9G5f+18gzaTfrukGrq6ueg0lmH4nqVnA2IPG0AEH3jKEk2GRJCUhDoqpoiw3PHLBA==
+
to-arraybuffer@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43"
@@ -6566,7 +6591,7 @@ [email protected]:
dependencies:
indexof "0.0.1"
-vt-pbf@^3.0.1:
+vt-pbf@^3.0.1, vt-pbf@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/vt-pbf/-/vt-pbf-3.1.1.tgz#b0f627e39a10ce91d943b898ed2363d21899fb82"
integrity sha512-pHjWdrIoxurpmTcbfBWXaPwSmtPAHS105253P1qyEfSTV2HJddqjM+kIHquaT/L6lVJIk9ltTGc0IxR/G47hYA==