/* Mapbox GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/mapbox/mapbox-gl-js/blob/v0.51.0/LICENSE.txt * Copyright (c) 2016, Mapbox * Copyright© 2000 - 2018 SuperMap Software Co. Ltd */ (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)(n=1))return n;for(;ra?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=a;function a(t,e){this.x=t,this.y=e;}function o(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return !1;for(var r=0;r0;)e[r]=arguments[r+1];for(var n=0,i=e;n>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function d(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)}function m(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e));});}function v(t,e){return -1!==t.indexOf(e,t.length-e.length)}function g(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function x(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 b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?g(t,b):t}var _={};function w(t){_[t]||("undefined"!=typeof console&&console.warn(t),_[t]=!0);}function A(t,e,r){return (r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function k(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r=1||a<-1||n.getDate()!==i.getDate();}else e=!0;if(!e)return this.processRequests();this.postEvent(r,{"enabled.telemetry":!1},function(e){e||(t.eventData.lastSuccess=r,t.eventData.accessToken=P.ACCESS_TOKEN);});}},e}(q)),G=N.postTurnstileEvent.bind(N),Z=new R,X=Z.postMapLoadEvent.bind(Z),K={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(K);var H=function(t){function e(e,r,n){401===r&&L(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens"),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),J="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope?function(){return self.worker&&self.worker.referrer}:function(){var t=self.location.origin;if(t&&"null"!==t&&"file://"!==t)return t+self.location.pathname};var Y=self.fetch&&self.Request&&self.AbortController?function(t,e){var r=new self.AbortController,n=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:J(),signal:r.signal});return "json"===t.type&&n.headers.set("Accept","application/json"),self.fetch(n).then(function(r){r.ok?r[t.type||"text"]().then(function(t){e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires"));}).catch(function(t){return e(new Error(t.message))}):e(new H(r.statusText,r.status,t.url));}).catch(function(t){e(new Error(t.message));}),{cancel:function(){return r.abort()}}}:function(t,e){var r=new self.XMLHttpRequest;for(var n in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(n,t.headers[n]);return "json"===t.type&&r.setRequestHeader("Accept","application/json"),r.withCredentials="include"===t.credentials,r.onerror=function(){e(new Error(r.statusText));},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===t.type)try{n=JSON.parse(r.response);}catch(t){return e(t)}e(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"));}else e(new H(r.statusText,r.status,t.url));},r.send(t.body),{cancel:function(){return r.abort()}}},$=function(t,e){return Y(c(t,{type:"arrayBuffer"}),e)},W=function(t,e){return Y(c(t,{method:"POST"}),e)};var Q=[],tt=0,et=function(t,e){if(tt>=P.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1};return Q.push(r),{cancel:function(){r.cancelled=!0;}}}return tt++,$(t,function(t,r,n,i){for(tt--;Q.length&&tt0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},ot.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var st={$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"},customprj:{type:"*"},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"}}},ut=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__);};function pt(t){var e=t.key,r=t.value;return r?[new ut(e,r,"constants have been deprecated as of v8")]:[]}function lt(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var n=0,i=e;n":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var zt=[dt,mt,vt,gt,xt,At,bt,kt(_t)];function It(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!It(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=zt;r255?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,Et=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n;};Et.parse=function(t){if(t){if(t instanceof Et)return t;if("string"==typeof t){var e=Bt(t);if(e)return new Et(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Et.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+")"},Et.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]},Et.black=new Et(0,0,0,1),Et.white=new Et(1,1,1,1),Et.transparent=new Et(0,0,0,0),Et.red=new Et(1,0,0,1);var Vt=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"});};Vt.prototype.compare=function(t,e){return this.collator.compare(t,e)},Vt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Pt=function(t,e,r){this.text=t,this.scale=e,this.fontStack=r;},Mt=function(t){this.sections=t;};function Ct(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 Tt(t){if(null===t)return dt;if("string"==typeof t)return vt;if("boolean"==typeof t)return gt;if("number"==typeof t)return mt;if(t instanceof Et)return xt;if(t instanceof Vt)return wt;if(t instanceof Mt)return At;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n2){var s=t[1];if("string"!=typeof s||!(s in Dt)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=Dt[s],n++;}else a=_t;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=kt(a,o);}else r=Dt[i];for(var u=[];n1)&&e.push(n);}}return e.concat(this.args.map(function(t){return t.serialize()}))};var jt=function(t){this.type=At,this.sections=t;};jt.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;n4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":Ct(e[0],e[1],e[2],e[3])))return new Et(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Ot(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=0)return !1;var r=!0;return t.eachChild(function(t){r&&!Jt(t,e)&&(r=!1);}),r}Xt.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,gt);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,gt);if(!i)return null;var a=null;return r.locale&&!(a=e.parse(r.locale,1,vt))?null:new Xt(n,i,a)},Xt.prototype.evaluate=function(t){return new Vt(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Xt.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale);},Xt.prototype.possibleOutputs=function(){return [void 0]},Xt.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 Yt=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e;};Yt.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 Yt(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)},Yt.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Yt.prototype.eachChild=function(){},Yt.prototype.possibleOutputs=function(){return [void 0]},Yt.prototype.serialize=function(){return ["var",this.name]};var $t=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new yt),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 Wt(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&&ee))throw new Ot("Input is not a number.");a=o-1;}}return Math.max(o-1,0)}$t.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)},$t.prototype._parse=function(t,e){function r(t,e,r){return "assert"===r?new Ut(e,[t]):"coerce"===r?new Rt(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 Lt)&&function t(e){if(e instanceof Yt)return t(e.boundExpression);if(e instanceof Zt&&"error"===e.name)return !1;if(e instanceof Xt)return !1;var r=e instanceof Rt||e instanceof Ut;var n=!0;e.eachChild(function(e){n=r?n&&t(e):n&&e instanceof Lt;});if(!n)return !1;return Kt(e)&&Jt(e,["zoom","heatmap-density","line-progress","is-supported-script"])}(a)){var u=new Gt;try{a=new Lt(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.")},$t.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 $t(this.registry,n,e||null,i,this.errors)},$t.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 ft(n,t));},$t.prototype.checkSubtype=function(t,e){var r=It(t,e);return r&&this.error(r),r};var Qt=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=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 Qt(a,r,i)},Qt.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[Wt(e,n)].evaluate(t)},Qt.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var ee=Object.freeze({number:te,color:function(t,e,r){return new Et(te(t.r,e.r,r),te(t.g,e.g,r),te(t.b,e.b,r),te(t.a,e.a,r))},array:function(t,e,r){return t.map(function(t,n){return te(t,e[n],r)})}}),re=.95047,ne=1,ie=1.08883,ae=4/29,oe=6/29,se=3*oe*oe,ue=oe*oe*oe,pe=Math.PI/180,le=180/Math.PI;function ce(t){return t>ue?Math.pow(t,1/3):t/se+ae}function he(t){return t>oe?t*t*t:se*(t-ae)}function fe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ye(t){return (t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function de(t){var e=ye(t.r),r=ye(t.g),n=ye(t.b),i=ce((.4124564*e+.3575761*r+.1804375*n)/re),a=ce((.2126729*e+.7151522*r+.072175*n)/ne);return {l:116*a-16,a:500*(i-a),b:200*(a-ce((.0193339*e+.119192*r+.9503041*n)/ie)),alpha:t.a}}function me(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=ne*he(e),r=re*he(r),n=ie*he(n),new Et(fe(3.2404542*r-1.5371385*e-.4985314*n),fe(-.969266*r+1.8760108*e+.041556*n),fe(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}var ve={forward:de,reverse:me,interpolate:function(t,e,r){return {l:te(t.l,e.l,r),a:te(t.a,e.a,r),b:te(t.b,e.b,r),alpha:te(t.alpha,e.alpha,r)}}},ge={forward:function(t){var e=de(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*le;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*pe,r=t.c;return me({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:te(t.c,e.c,r),l:te(t.l,e.l,r),alpha:te(t.alpha,e.alpha,r)}}},xe=Object.freeze({lab:ve,hcl:ge}),be=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;a1}))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,mt)))return null;var u=[],p=null;"interpolate-hcl"===r||"interpolate-lab"===r?p=xt:e.expectedType&&"value"!==e.expectedType.kind&&(p=e.expectedType);for(var l=0;l=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 be(p,r,n,i,u):e.error("Type "+St(p)+" is not interpolatable.")},be.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=Wt(e,n),o=e[a],s=e[a+1],u=be.interpolationFactor(this.interpolation,n,o,s),p=r[a].evaluate(t),l=r[a+1].evaluate(t);return "interpolate"===this.operator?ee[this.type.kind.toLowerCase()](p,l,u):"interpolate-hcl"===this.operator?ge.reverse(ge.interpolate(ge.forward(p),ge.forward(l),u)):ve.reverse(ve.interpolate(ve.forward(p),ve.forward(l),u))},be.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new Ot("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new Ot("Array index must be an integer, but found "+e+" instead.");return r[e]},ke.prototype.eachChild=function(t){t(this.index),t(this.input);},ke.prototype.possibleOutputs=function(){return [void 0]},ke.prototype.serialize=function(){return ["at",this.index.serialize(),this.input.serialize()]};var Se=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;};Se.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;oNumber.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,Tt(h)))return null}else r=Tt(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,_t);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 Se(r,n,y,i,a,d):null},Se.prototype.evaluate=function(t){var e=this.input.evaluate(t);return (Tt(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Se.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise);},Se.prototype.possibleOutputs=function(){return (t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()})).concat(this.otherwise.possibleOutputs());var t;},Se.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i",function(t,e,r){return e>r},function(t,e,r,n){return n.compare(e,r)>0}),Te=Ee("<=",function(t,e,r){return e<=r},function(t,e,r,n){return n.compare(e,r)<=0}),Fe=Ee(">=",function(t,e,r){return e>=r},function(t,e,r,n){return n.compare(e,r)>=0}),Le=function(t){this.type=mt,this.input=t;};Le.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 "+St(r.type)+" instead."):new Le(r):null},Le.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 Ot("Expected value to be of type string or array, but found "+St(Tt(e))+" instead.")},Le.prototype.eachChild=function(t){t(this.input);},Le.prototype.possibleOutputs=function(){return [void 0]},Le.prototype.serialize=function(){var t=["length"];return this.eachChild(function(e){t.push(e.serialize());}),t};var Oe={"==":Ve,"!=":Pe,">":Ce,"<":Me,">=":Fe,"<=":Te,array:Ut,at:ke,boolean:Ut,case:ze,coalesce:we,collator:Xt,format:jt,interpolate:be,"interpolate-hcl":be,"interpolate-lab":be,length:Le,let:Ae,literal:Lt,match:Se,number:Ut,object:Ut,step:Qt,string:Ut,"to-boolean":Rt,"to-color":Rt,"to-number":Rt,"to-string":Rt,var:Yt};function De(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=Ct(r,n,i,o);if(s)throw new Ot(s);return new Et(r/255*o,n/255*o,i/255*o,o)}function Ue(t,e){return t in e}function je(t,e){var r=e[t];return void 0===r?null:r}function qe(t){return {type:t}}function Re(t){return {result:"success",value:t}}function Ne(t){return {result:"error",value:t}}function Ge(t){return "data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Ze(t){return !!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Xe(t){return !!t.expression&&t.expression.interpolated}function Ke(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function He(t){return "object"==typeof t&&null!==t&&!Array.isArray(t)}function Je(t){return t}function Ye(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function $e(t,e,r,n,i){return Ye(typeof r===i?n[r]:void 0,t.default,e.default)}function We(t,e,r){if("number"!==Ke(r))return Ye(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=er(t.stops,r);return t.stops[i][1]}function Qe(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==Ke(r))return Ye(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=er(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=ee[e.type]||Je;if(t.colorSpace&&"rgb"!==t.colorSpace){var l=xe[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 tr(t,e,r){return "color"===e.type?r=Et.parse(r):"formatted"===e.type?r=Mt.fromString(r.toString()):Ke(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Ye(r,t.default,e.default)}function er(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&&ee&&(a=o-1);}return Math.max(o-1,0)}Zt.register(Oe,{error:[{kind:"error"},[vt],function(t,e){var r=e[0];throw new Ot(r.evaluate(t))}],typeof:[vt,[_t],function(t,e){return St(Tt(e[0].evaluate(t)))}],"to-rgba":[kt(mt,4),[xt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[xt,[mt,mt,mt],De],rgba:[xt,[mt,mt,mt,mt],De],has:{type:gt,overloads:[[[vt],function(t,e){return Ue(e[0].evaluate(t),t.properties())}],[[vt,bt],function(t,e){var r=e[0],n=e[1];return Ue(r.evaluate(t),n.evaluate(t))}]]},get:{type:_t,overloads:[[[vt],function(t,e){return je(e[0].evaluate(t),t.properties())}],[[vt,bt],function(t,e){var r=e[0],n=e[1];return je(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[_t,[vt],function(t,e){return je(e[0].evaluate(t),t.featureState||{})}],properties:[bt,[],function(t){return t.properties()}],"geometry-type":[vt,[],function(t){return t.geometryType()}],id:[_t,[],function(t){return t.id()}],zoom:[mt,[],function(t){return t.globals.zoom}],"heatmap-density":[mt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[mt,[],function(t){return t.globals.lineProgress||0}],"+":[mt,qe(mt),function(t,e){for(var r=0,n=0,i=e;n":[gt,[vt,_t],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->":[gt,[_t],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[gt,[vt,_t],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-<=":[gt,[_t],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[gt,[vt,_t],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->=":[gt,[_t],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[gt,[_t],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[gt,[],function(t){return null!==t.id()}],"filter-type-in":[gt,[kt(vt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[gt,[kt(_t)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[gt,[vt,kt(_t)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[gt,[vt,kt(_t)],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:gt,overloads:[[[gt,gt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[qe(gt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in Oe}function ir(t,e){var r=new $t(Oe,[],function(t){var e={color:xt,string:vt,number:mt,enum:vt,boolean:gt,formatted:At};if("array"===t.type)return kt(e[t.value]||_t,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?Re(new rr(n,e)):Ne(r.errors)}rr.prototype.evaluateWithoutErrorHandling=function(t,e,r){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this.expression.evaluate(this._evaluator)},rr.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)return this._defaultValue;if(this._enumValues&&!(n in this._enumValues))throw new Ot("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 ar=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Ht(e.expression);};ar.prototype.evaluateWithoutErrorHandling=function(t,e,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r)},ar.prototype.evaluate=function(t,e,r){return this._styleExpression.evaluate(t,e,r)};var or=function(t,e,r){this.kind=t,this.zoomStops=r.labels,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Ht(e.expression),r instanceof be&&(this._interpolationType=r.interpolation);};function sr(t,e){if("error"===(t=ir(t,e)).result)return t;var r=t.value.expression,n=Kt(r);if(!n&&!Ge(e))return Ne([new ft("","data expressions not supported")]);var i=Jt(r,["zoom"]);if(!i&&!Ze(e))return Ne([new ft("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof Ae)r=t(e.result);else if(e instanceof we)for(var n=0,i=e.args;nn.maximum?[new ut(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function fr(t){var e,r,n,i=t.valueSpec,a=ct(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,u=!s,p="array"===Ke(t.value.stops)&&"array"===Ke(t.value.stops[0])&&"object"===Ke(t.value.stops[0][0]),l=lr({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 ut(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat(cr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===Ke(r)&&0===r.length&&e.push(new ut(t.key,r,"array must have at least one stop"));return e},default:function(t){return Tr({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return "identity"===a&&s&&l.push(new ut(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||l.push(new ut(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Xe(t.valueSpec)&&l.push(new ut(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Ge(t.valueSpec)?l.push(new ut(t.key,t.value,"property functions not supported")):s&&!Ze(t.valueSpec)&&l.push(new ut(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!p||void 0!==t.value.property||l.push(new ut(t.key,t.value,'"property" property is required')),l;function c(t){var e=[],a=t.value,s=t.key;if("array"!==Ke(a))return [new ut(s,a,"array expected, "+Ke(a)+" found")];if(2!==a.length)return [new ut(s,a,"array length 2 expected, length "+a.length+" found")];if(p){if("object"!==Ke(a[0]))return [new ut(s,a,"object expected, "+Ke(a[0])+" found")];if(void 0===a[0].zoom)return [new ut(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return [new ut(s,a,"object stop key must have value")];if(n&&n>ct(a[0].zoom))return [new ut(s,a[0].zoom,"stop zoom values must appear in ascending order")];ct(a[0].zoom)!==n&&(n=ct(a[0].zoom),r=void 0,o={}),e=e.concat(lr({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:hr,value:h}}));}else e=e.concat(h({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return nr(ht(a[1]))?e.concat([new ut(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(Tr({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=Ke(t.value),u=ct(t.value),p=null!==t.value?t.value:n;if(e){if(s!==e)return [new ut(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 ut(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 Ge(i)&&void 0===a&&(l+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ut(t.key,p,l)]}return "categorical"!==a||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==a&&"number"===s&&void 0!==r&&u=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);ee?1:0}function br(t){if(!t)return !0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?_r(t[1],t[2],"=="):"!="===r?kr(_r(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?_r(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(br))):"all"===r?["all"].concat(t.slice(1).map(br)):"none"===r?["all"].concat(t.slice(1).map(br).map(kr)):"in"===r?wr(t[1],t.slice(2)):"!in"===r?kr(wr(t[1],t.slice(2))):"has"===r?Ar(t[1]):"!has"!==r||kr(Ar(t[1]))}function _r(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 wr(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(xr)]]:["filter-in-small",t,["literal",e]]}}function Ar(t){switch(t){case"$type":return !0;case"$id":return ["filter-has-id"];default:return ["filter-has",t]}}function kr(t){return ["!",t]}function Sr(t){return mr(ht(t.value))?yr(lt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value;var n=e.key;if("array"!==Ke(r))return [new ut(n,r,"array expected, "+Ke(r)+" found")];var i=e.styleSpec;var a;var o=[];if(r.length<1)return [new ut(n,r,"filter array must have at least 1 element")];o=o.concat(dr({key:n+"[0]",value:r[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec}));switch(ct(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===ct(r[1])&&o.push(new ut(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new ut(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(a=Ke(r[1]))&&o.push(new ut(n+"[1]",r[1],"string expected, "+a+" found"));for(var s=2;s=p[h+0]&&n>=p[h+1]?(o[c]=!0,a.push(u[c])):o[c]=!1;}}},Xr.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}},Xr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Xr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=Zr+this.cells.length+1+1,r=0,n=0;n=0)){var c=t[l];p[l]=Hr[u].shallow.indexOf(l)>=0?c:$r(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 Wr(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof Kr)return t;if(Array.isArray(t))return t.map(Wr);if("object"==typeof t){var e=t.$name||"Object",r=Hr[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=0?s:Wr(s);}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Qr=function(){this.first=!0;};Qr.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=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 en(t){for(var e=0,r=t;e=65097&&t<=65103)||(!!tn["CJK Compatibility Ideographs"](t)||(!!tn["CJK Compatibility"](t)||(!!tn["CJK Radicals Supplement"](t)||(!!tn["CJK Strokes"](t)||(!(!tn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!tn["CJK Unified Ideographs Extension A"](t)||(!!tn["CJK Unified Ideographs"](t)||(!!tn["Enclosed CJK Letters and Months"](t)||(!!tn["Hangul Compatibility Jamo"](t)||(!!tn["Hangul Jamo Extended-A"](t)||(!!tn["Hangul Jamo Extended-B"](t)||(!!tn["Hangul Jamo"](t)||(!!tn["Hangul Syllables"](t)||(!!tn.Hiragana(t)||(!!tn["Ideographic Description Characters"](t)||(!!tn.Kanbun(t)||(!!tn["Kangxi Radicals"](t)||(!!tn["Katakana Phonetic Extensions"](t)||(!(!tn.Katakana(t)||12540===t)||(!(!tn["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)||(!(!tn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!tn["Unified Canadian Aboriginal Syllabics"](t)||(!!tn["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!tn["Vertical Forms"](t)||(!!tn["Yijing Hexagram Symbols"](t)||(!!tn["Yi Syllables"](t)||!!tn["Yi Radicals"](t))))))))))))))))))))))))))))))}function an(t){return !(nn(t)||function(t){return !!(tn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||tn["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)||tn["Letterlike Symbols"](t)||tn["Number Forms"](t)||tn["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)||tn["Control Pictures"](t)&&9251!==t||tn["Optical Character Recognition"](t)||tn["Enclosed Alphanumerics"](t)||tn["Geometric Shapes"](t)||tn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||tn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||tn["CJK Symbols and Punctuation"](t)||tn.Katakana(t)||tn["Private Use Area"](t)||tn["CJK Compatibility Forms"](t)||tn["Small Form Variants"](t)||tn["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 on(t,e){return !(!e&&(t>=1424&&t<=2303||tn["Arabic Presentation Forms-A"](t)||tn["Arabic Presentation Forms-B"](t)))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||tn.Khmer(t))}var sn,un=!1,pn=null,ln=!1,cn=new ot,hn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return ln||null!=hn.applyArabicShaping}},fn=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 Qr,this.transition={});};fn.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,n=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var yn=function(t,e){this.property=t,this.value=e,this.expression=pr(void 0===e?t.specification.default:e,t.specification);};yn.prototype.isDataDriven=function(){return "source"===this.expression.kind||"composite"===this.expression.kind},yn.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var dn=function(t){this.property=t,this.value=new yn(t,void 0);};dn.prototype.transitioned=function(t,e){return new vn(this.property,this.value,e,c({},t.transition,this.transition),t.now)},dn.prototype.untransitioned=function(){return new vn(this.property,this.value,null,{},0)};var mn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues);};mn.prototype.getValue=function(t){return b(this._values[t].value.value)},mn.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new dn(this._values[t].property)),this._values[t].value=new yn(this._values[t].property,null===e?void 0:b(e));},mn.prototype.getTransition=function(t){return b(this._values[t].transition)},mn.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new dn(this._values[t].property)),this._values[t].transition=b(e)||void 0;},mn.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(e=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(i))}return r};var gn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues);};gn.prototype.possiblyEvaluate=function(t){for(var e=new _n(this._properties),r=0,n=Object.keys(this._values);rn.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(An),Sn=function(t){this.specification=t;};Sn.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 fn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new fn(Math.floor(e.zoom),e)),t.expression.evaluate(new fn(Math.floor(e.zoom+1),e)),e)}},Sn.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Sn.prototype.interpolate=function(t){return t};var zn=function(t){this.specification=t;};zn.prototype.possiblyEvaluate=function(t,e){return !!t.expression.evaluate(e)},zn.prototype.interpolate=function(){return !1};var In=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 yn(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new dn(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({});}};Jr("DataDrivenProperty",An),Jr("DataConstantProperty",wn),Jr("CrossFadedDataDrivenProperty",kn),Jr("CrossFadedProperty",Sn),Jr("ColorRampProperty",zn);var Bn=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 xn(r.layout)),r.paint)){for(var n in this._transitionablePaint=new mn(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){var n="layers."+this.id+".layout."+t;if(this._validate(Rr,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility="none"===e?e:"visible";},e.prototype.getPaintProperty=function(t){return v(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(qr,n,t,e,r))return !1}if(v(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.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,name:this.name,"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"),x(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)&&Nr(this,t.call(Ur,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:st,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 bn&&Ge(e.property.specification)&&(("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent))return !0}return !1},e}(ot),En={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Vn=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;},Pn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0);};function Mn(t,e){void 0===e&&(e=1);var r=0,n=0;return {members:t.map(function(t){var i,a=(i=t.type,En[i].BYTES_PER_ELEMENT),o=r=Cn(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:Cn(r,Math.max(n,e)),alignment:e}}function Cn(t,e){return Math.ceil(t/e)*e}Pn.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Pn.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},Pn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews());},Pn.prototype.clear=function(){this.length=0;},Pn.prototype.resize=function(t){this.reserve(t),this.length=t;},Pn.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);}},Pn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Tn=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;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=r,t},e}(Pn);Tn.prototype.bytesPerElement=4,Jr("StructArrayLayout2i4",Tn);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){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r,n)},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}(Pn);Fn.prototype.bytesPerElement=8,Jr("StructArrayLayout4i8",Fn);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,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},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}(Pn);Ln.prototype.bytesPerElement=12,Jr("StructArrayLayout2i4i12",Ln);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._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;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s)},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}(Pn);On.prototype.bytesPerElement=12,Jr("StructArrayLayout4i4ub12",On);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.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,n,i,a,o,s){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s)},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}(Pn);Dn.prototype.bytesPerElement=16,Jr("StructArrayLayout8ui16",Dn);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._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;return this.resize(u+1),this.emplace(u,t,e,r,n,i,a,o,s)},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}(Pn);Un.prototype.bytesPerElement=16,Jr("StructArrayLayout4i4ui16",Un);var jn=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;return this.resize(n+1),this.emplace(n,t,e,r)},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}(Pn);jn.prototype.bytesPerElement=12,Jr("StructArrayLayout3f12",jn);var qn=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;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint32[r+0]=e,t},e}(Pn);qn.prototype.bytesPerElement=4,Jr("StructArrayLayout1ul4",qn);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._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;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,u,p,l)},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}(Pn);Rn.prototype.bytesPerElement=24,Jr("StructArrayLayout6i1ul2ui2i24",Rn);var Nn=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;return this.resize(o+1),this.emplace(o,t,e,r,n,i,a)},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}(Pn);Nn.prototype.bytesPerElement=12,Jr("StructArrayLayout2i2i2i12",Nn);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);},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=4*t;return this.uint8[n+0]=e,this.uint8[n+1]=r,t},e}(Pn);Gn.prototype.bytesPerElement=4,Jr("StructArrayLayout2ub4",Gn);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.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;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,u,p,l,c,h,f)},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}(Pn);Zn.prototype.bytesPerElement=40,Jr("StructArrayLayout2i2ui3ul3ui2f2ub40",Zn);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),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;return this.resize(y+1),this.emplace(y,t,e,r,n,i,a,o,s,u,p,l,c,h,f)},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}(Pn);Xn.prototype.bytesPerElement=32,Jr("StructArrayLayout4i9ui1ul32",Xn);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.float32=new Float32Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.float32[r+0]=e,t},e}(Pn);Kn.prototype.bytesPerElement=4,Jr("StructArrayLayout1f4",Kn);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){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},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}(Pn);Hn.prototype.bytesPerElement=6,Jr("StructArrayLayout3i6",Hn);var Jn=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;return this.resize(n+1),this.emplace(n,t,e,r)},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}(Pn);Jn.prototype.bytesPerElement=8,Jr("StructArrayLayout1ul2ui8",Jn);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){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r)},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}(Pn);Yn.prototype.bytesPerElement=6,Jr("StructArrayLayout3ui6",Yn);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.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,t},e}(Pn);$n.prototype.bytesPerElement=4,Jr("StructArrayLayout2ui4",$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.uint16=new Uint16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){var r=1*t;return this.uint16[r+0]=e,t},e}(Pn);Wn.prototype.bytesPerElement=2,Jr("StructArrayLayout1ui2",Wn);var Qn=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;return this.resize(r+1),this.emplace(r,t,e)},e.prototype.emplace=function(t,e,r){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=r,t},e}(Pn);Qn.prototype.bytesPerElement=8,Jr("StructArrayLayout2f8",Qn);var ti=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;return this.resize(i+1),this.emplace(i,t,e,r,n)},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}(Pn);ti.prototype.bytesPerElement=16,Jr("StructArrayLayout4f16",ti);var ei=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 i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Vn);ei.prototype.size=24;var ri=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 ei(this,t)},e}(Rn);Jr("CollisionBoxArray",ri);var ni=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}(Vn);ni.prototype.size=40;var ii=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 ni(this,t)},e}(Zn);Jr("PlacedSymbolArray",ii);var ai=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}(Vn);ai.prototype.size=32;var oi=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 ai(this,t)},e}(Xn);Jr("SymbolInstanceArray",oi);var si=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}(Vn);si.prototype.size=4;var ui=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 si(this,t)},e}(Kn);Jr("GlyphOffsetArray",ui);var pi=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}(Vn);pi.prototype.size=6;var li=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 pi(this,t)},e}(Hn);Jr("SymbolLineVertexArray",li);var ci=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}(Vn);ci.prototype.size=8;var hi=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 ci(this,t)},e}(Jn);Jr("FeatureIndexArray",hi);var fi=Mn([{name:"a_pos",components:2,type:"Int16"}],4),yi=fi.members,di=(fi.size,fi.alignment,function(t){void 0===t&&(t=[]),this.segments=t;});function mi(t,e){return 256*(t=p(Math.floor(t),0,255))+(e=p(Math.floor(e),0,255))}di.prototype.prepareSegment=function(t,e,r){var n=this.segments[this.segments.length-1];return t>di.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+di.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>di.MAX_VERTEX_ARRAY_LENGTH)&&(n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},this.segments.push(n)),n},di.prototype.get=function(){return this.segments},di.prototype.destroy=function(){for(var t=0,e=this.segments;t>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},vi.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);if(o>=s)break;gi(e,o,s),gi(r,3*o,3*s),gi(r,3*o+1,3*s+1),gi(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}},vi.deserialize=function(t){var e=new vi;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},Jr("FeaturePositionMap",vi);var xi=function(t,e){this.gl=t.gl,this.location=e;},bi=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}(xi),_i=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}(xi),wi=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}(xi),Ai=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}(xi),ki=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}(xi),Si=function(t){function e(e,r){t.call(this,e,r),this.current=Et.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}(xi),zi=new Float32Array(16),Ii=function(t){function e(e,r){t.call(this,e,r),this.current=zi;}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}(xi);function Bi(t){return [mi(255*t.r,255*t.g),mi(255*t.b,255*t.a)]}var Ei=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;};Ei.prototype.defines=function(){return this.names.map(function(t){return "#define HAS_UNIFORM_u_"+t})},Ei.prototype.setConstantPatternPositions=function(){},Ei.prototype.populatePaintArray=function(){},Ei.prototype.updatePaintArray=function(){},Ei.prototype.upload=function(){},Ei.prototype.destroy=function(){},Ei.prototype.setUniforms=function(t,e,r,n){e.set(n.constantOr(this.value));},Ei.prototype.getBinding=function(t,e){return "color"===this.type?new Si(t,e):new _i(t,e)},Ei.serialize=function(t){var e=t.value,r=t.names,n=t.type;return {value:$r(e),names:r,type:n}},Ei.deserialize=function(t){var e=t.value,r=t.names,n=t.type;return new Ei(Wr(e),r,n)};var Vi=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};};Vi.prototype.defines=function(){return this.names.map(function(t){return "#define HAS_UNIFORM_u_"+t})},Vi.prototype.populatePaintArray=function(){},Vi.prototype.updatePaintArray=function(){},Vi.prototype.upload=function(){},Vi.prototype.destroy=function(){},Vi.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr;},Vi.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);},Vi.prototype.getBinding=function(t,e){return new ki(t,e)};var Pi=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;};Pi.prototype.defines=function(){return []},Pi.prototype.setConstantPatternPositions=function(){},Pi.prototype.populatePaintArray=function(t,e){var r=this.paintVertexArray,n=r.length;r.reserve(t);var i=this.expression.evaluate(new fn(0),e,{});if("color"===this.type)for(var a=Bi(i),o=n;oji.max||o.yji.max)&&w("Geometry exceeds allowed extent, reduce your vector tile buffer size");}return r}function Ri(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2);}var Ni=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 Tn,this.indexArray=new Yn,this.segments=new di,this.programConfigurations=new Fi(yi,t.layers,t.zoom);};function Gi(t,e,r){for(var n=0;n=3)for(var s=0;s1){if(Hi(t,e))return !0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function Wi(t,e){for(var r,n,i,a=!1,o=0;oe.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 Qi(t,e){for(var r=!1,n=0,i=t.length-1;ne.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 ta(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 ea(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ra(t,e,r,n,a){if(!e[0]&&!e[1])return t;var o=i.convert(e);"viewport"===r&&o._rotate(-n);for(var s=[],u=0;u=Di||p<0||p>=Di)){var l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),c=l.vertexLength;Ri(this.layoutVertexArray,u,p,-1,-1),Ri(this.layoutVertexArray,u,p,1,-1),Ri(this.layoutVertexArray,u,p,1,1),Ri(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,{});},Jr("CircleBucket",Ni,{omit:["layers"]});var na={paint:new In({"circle-radius":new An(st.paint_circle["circle-radius"]),"circle-color":new An(st.paint_circle["circle-color"]),"circle-blur":new An(st.paint_circle["circle-blur"]),"circle-opacity":new An(st.paint_circle["circle-opacity"]),"circle-translate":new wn(st.paint_circle["circle-translate"]),"circle-translate-anchor":new wn(st.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new wn(st.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new wn(st.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new An(st.paint_circle["circle-stroke-width"]),"circle-stroke-color":new An(st.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new An(st.paint_circle["circle-stroke-opacity"])})},ia=1e-6,aa="undefined"!=typeof Float32Array?Float32Array:Array;Math.PI;function oa(){var t=new aa(9);return aa!=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 sa(){var t=new aa(3);return aa!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ua(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function pa(t,e,r){var n=new aa(3);return n[0]=t,n[1]=e,n[2]=r,n}function la(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 ca(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ha(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 fa,ya=ua,da=(fa=sa(),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;o0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o),t}function ga(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 xa=function(){var t=ma();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;sia?(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 wa,Aa,ka,Sa,za,Ia,Ba=va;wa=sa(),Aa=pa(1,0,0),ka=pa(0,1,0),Sa=ba(),za=ba(),Ia=oa();!function(){var t,e=(t=new aa(2),aa!=Float32Array&&(t[0]=0,t[1]=0),t);}();var Ea=function(t){function e(e){t.call(this,e,na);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Ni(t)},e.prototype.queryRadius=function(t){var e=t;return ta("circle-radius",this,e)+ta("circle-stroke-width",this,e)+ea(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var u=ra(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 Va(t,e,r)})})}(u,s,a),h=l?p*o:p,f=0,y=n;ft.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;u80*r){n=a=t[0],i=o=t[1];for(var y=r;ya&&(a=s),u>o&&(o=u);p=0!==(p=Math.max(a-n,o-i))?1/p:0;}return Ja(h,f,r,n,i,p),f}function Ka(t,e,r,n,i){var a,o;if(i===yo(t,e,r,n)>0)for(a=e;a=e;a-=n)o=co(a,t[a],t[a+1],o);return o&&so(o,o.next)&&(ho(o),o=o.next),o}function Ha(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!so(n,n.next)&&0!==oo(n.prev,n,n.next))n=n.next;else{if(ho(n),(n=e=n.prev)===n.next)break;r=!0;}}while(r||n!==e);return e}function Ja(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=ro(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;e0||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?$a(t,n,i,a):Ya(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),ho(t),t=u.next,p=u.next;else if((t=u)===p){o?1===o?Ja(t=Wa(t,e,r),e,r,n,i,a,2):2===o&&Qa(t,e,r,n,i,a):Ja(Ha(t),e,r,n,i,a,1);break}}}function Ya(t){var e=t.prev,r=t,n=t.next;if(oo(e,r,n)>=0)return !1;for(var i=t.next.next;i!==t.prev;){if(io(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&oo(i.prev,i,i.next)>=0)return !1;i=i.next;}return !0}function $a(t,e,r,n){var i=t.prev,a=t,o=t.next;if(oo(i,a,o)>=0)return !1;for(var s=i.xa.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=ro(s,u,e,r,n),h=ro(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&&io(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&oo(f.prev,f,f.next)>=0)return !1;if(f=f.prevZ,y!==t.prev&&y!==t.next&&io(i.x,i.y,a.x,a.y,o.x,o.y,y.x,y.y)&&oo(y.prev,y,y.next)>=0)return !1;y=y.nextZ;}for(;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&io(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&oo(f.prev,f,f.next)>=0)return !1;f=f.prevZ;}for(;y&&y.z<=h;){if(y!==t.prev&&y!==t.next&&io(i.x,i.y,a.x,a.y,o.x,o.y,y.x,y.y)&&oo(y.prev,y,y.next)>=0)return !1;y=y.nextZ;}return !0}function Wa(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!so(i,a)&&uo(i,n,n.next,a)&&po(i,a)&&po(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),ho(n),ho(n.next),n=t=a),n=n.next;}while(n!==t);return n}function Qa(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&ao(o,s)){var u=lo(o,s);return o=Ha(o,o.next),u=Ha(u,u.next),Ja(o,e,r,n,i,a),void Ja(u,e,r,n,i,a)}s=s.next;}o=o.next;}while(o!==t)}function to(t,e){return t.x-e.x}function eo(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.x&&n.x>=l&&i!==n.x&&io(ar.x)&&po(n,t)&&(r=n,h=u),n=n.next;return r}(t,e)){var r=lo(e,t);Ha(r,r.next);}}function ro(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 no(t){var e=t,r=t;do{e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function ao(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&&uo(r,r.next,t,e))return !0;r=r.next;}while(r!==t);return !1}(t,e)&&po(t,e)&&po(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 oo(t,e,r){return (e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function so(t,e){return t.x===e.x&&t.y===e.y}function uo(t,e,r,n){return !!(so(t,e)&&so(r,n)||so(t,n)&&so(r,e))||oo(t,e,r)>0!=oo(t,e,n)>0&&oo(r,n,t)>0!=oo(r,n,e)>0}function po(t,e){return oo(t.prev,t,t.next)<0?oo(t,e,t.next)>=0&&oo(t,t.prev,e)>=0:oo(t,e,t.prev)<0||oo(t,t.next,e)<0}function lo(t,e){var r=new fo(t.i,t.x,t.y),n=new fo(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 co(t,e,r,n){var i=new fo(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 ho(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 fo(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 yo(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n));}return r},Ga.default=Za;var mo=go,vo=go;function go(t,e,r,n,i){!function t(e,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,u=Math.log(o),p=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*p*(o-p)/o)*(s-o/2<0?-1:1),c=Math.max(n,Math.floor(r-s*p/o+l)),h=Math.min(i,Math.floor(r+(o-s)*p/o+l));t(e,r,c,h,a);}var f=e[r],y=n,d=i;for(xo(e,n,r),a(e[i],f)>0&&xo(e,n,i);y0;)d--;}0===a(e[n],f)?xo(e,n,d):xo(e,++d,i),d<=r&&(n=d+1),r<=d&&(i=d-1);}}(t,e,r||0,n||t.length-1,i||bo);}function xo(t,e,r){var n=t[e];t[e]=t[r],t[r]=n;}function bo(t,e){return te?1:0}function _o(t,e){var r=t.length;if(r<=1)return [t];for(var n,i,a=[],o=0;o1)for(var u=0;uDi)||t.y===e.y&&(t.y<0||t.y>Di)}function To(t){return t.every(function(t){return t.x<0})||t.every(function(t){return t.x>Di})||t.every(function(t){return t.y<0})||t.every(function(t){return t.y>Di})}Mo.prototype.populate=function(t,e){this.features=[],this.hasPattern=Ao("fill-extrusion",this.layers,e);for(var r=0,n=t;r=1){var v=f[d-1];if(!Co(m,v)){l.vertexLength+4>di.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),Po(this.layoutVertexArray,m.x,m.y,g.x,g.y,0,0,y),Po(this.layoutVertexArray,m.x,m.y,g.x,g.y,0,1,y),y+=x,Po(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,0,y),Po(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>di.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray));for(var _=[],w=[],A=l.vertexLength,k=0,S=o;k>3;}if(a--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&u.push(e),e=[]),e.push(new i(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone());}}return e&&u.push(e),u},jo.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>3;}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())p&&(p=a);else if(7!==r)throw new Error("unknown command "+r)}return [o,u,s,p]},jo.prototype.toGeoJSON=function(t,e,r,n){var i,a,o=this.extent*Math.pow(2,r),s=this.extent*t,u=this.extent*e,p=this.loadGeometry(),l=jo.types[this.type];function c(t){for(var e=0;e>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 Xo(t,e,r){if(3===t){var n=new No(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n);}}Go.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 Uo(this._pbf,e,this.extent,this._keys,this._values)};var Ko={VectorTile:function(t,e){this.layers=t.readFields(Xo,{},e);},VectorTileFeature:Uo,VectorTileLayer:No},Ho=Ko.VectorTileFeature.types,Jo=63,Yo=Math.cos(Math.PI/180*37.5),$o=.5,Wo=Math.pow(2,14)/$o;function Qo(t,e,r,n,i,a,o){t.emplaceBack(e.x,e.y,n?1:0,i?1:-1,Math.round(Jo*r.x)+128,Math.round(Jo*r.y)+128,1+(0===a?0:a<0?-1:1)|(o*$o&63)<<2,o*$o>>6);}var ts=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 On,this.indexArray=new Yn,this.programConfigurations=new Fi(Do,t.layers,t.zoom),this.segments=new di;};function es(t,e){return (t/e.tileTotal*(e.end-e.start)+e.start)*(Wo-1)}ts.prototype.populate=function(t,e){this.features=[],this.hasPattern=Ao("line",this.layers,e);for(var r=0,n=t;r=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;cc){var V=d.dist(_);if(V>2*h){var P=d.sub(d.sub(_)._mult(h/V)._round());this.distance+=P.dist(_),this.addCurrentVertex(P,this.distance,A.mult(1),0,0,!1,y,u),_=P;}}var M=_&&w,C=M?r:w?g:x;if(M&&"round"===C&&(Bi&&(C="bevel"),"bevel"===C&&(B>2&&(C="flipbevel"),B100)z=k.clone().mult(-1);else{var T=A.x*k.y-A.y*k.x>0?-1:1,F=B*A.add(k).mag()/A.sub(k).mag();z._perp()._mult(F*T);}this.addCurrentVertex(d,this.distance,z,0,0,!1,y,u),this.addCurrentVertex(d,this.distance,z.mult(-1),0,0,!1,y,u);}else if("bevel"===C||"fakeround"===C){var L=A.x*k.y-A.y*k.x>0,O=-Math.sqrt(B*B-1);if(L?(v=0,m=O):(m=0,v=O),b||this.addCurrentVertex(d,this.distance,A,m,v,!1,y,u),"fakeround"===C){for(var D=Math.floor(8*(.5-(I-.5))),U=void 0,j=0;j=0;q--)U=A.mult((q+1)/(D+1))._add(k)._unit(),this.addPieSliceVertex(d,this.distance,U,L,y,u);}w&&this.addCurrentVertex(d,this.distance,k,-m,-v,!1,y,u);}else"butt"===C?(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"===C?(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"===C&&(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(E&&S2*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);}},ts.prototype.addCurrentVertex=function(t,e,r,n,i,a,o,s){var u,p=this.layoutVertexArray,l=this.indexArray;s&&(e=es(e,s)),u=r.clone(),n&&u._sub(r.perp()._mult(n)),Qo(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)),Qo(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>Wo/2&&!s&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a,o));},ts.prototype.addPieSliceVertex=function(t,e,r,n,i,a){r=r.mult(n?-1:1);var o=this.layoutVertexArray,s=this.indexArray;a&&(e=es(e,a)),Qo(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;},Jr("LineBucket",ts,{omit:["layers","features"]});var rs=new In({"line-cap":new wn(st.layout_line["line-cap"]),"line-join":new An(st.layout_line["line-join"]),"line-miter-limit":new wn(st.layout_line["line-miter-limit"]),"line-round-limit":new wn(st.layout_line["line-round-limit"])}),ns={paint:new In({"line-opacity":new An(st.paint_line["line-opacity"]),"line-color":new An(st.paint_line["line-color"]),"line-translate":new wn(st.paint_line["line-translate"]),"line-translate-anchor":new wn(st.paint_line["line-translate-anchor"]),"line-width":new An(st.paint_line["line-width"]),"line-gap-width":new An(st.paint_line["line-gap-width"]),"line-offset":new An(st.paint_line["line-offset"]),"line-blur":new An(st.paint_line["line-blur"]),"line-dasharray":new Sn(st.paint_line["line-dasharray"]),"line-pattern":new kn(st.paint_line["line-pattern"]),"line-gradient":new zn(st.paint_line["line-gradient"])}),layout:rs},is=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 fn(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}(An))(ns.paint.properties["line-width"].specification);is.useIntegerZoom=!0;var as=function(t){function e(e){t.call(this,e,ns);}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=Da(t,"lineProgress"),this.gradientTexture=null;},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=is.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e);},e.prototype.createBucket=function(t){return new ts(t)},e.prototype.queryRadius=function(t){var e=t,r=os(ta("line-width",this,e),ta("line-gap-width",this,e)),n=ta("line-offset",this,e);return r/2+Math.abs(n)+ea(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s){var u=ra(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),p=s/2*os(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 i(0,0),a=0;a0?e+2*t:t}var ss=Mn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),us=Mn([{name:"a_projected_pos",components:3,type:"Float32"}],4),ps=(Mn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Mn([{name:"a_placed",components:2,type:"Uint8"}],4)),ls=(Mn([{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"}]),Mn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),cs=Mn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);Mn([{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"}]),Mn([{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"}]),Mn([{type:"Float32",name:"offsetX"}]),Mn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function hs(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()),hn.applyArabicShaping&&(t=hn.applyArabicShaping(t)),t}(t.text,e,r);}),t}var fs={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var ys=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}(i);Jr("Anchor",ys);var ds=256;function ms(t,e){var r=e.expression;if("constant"===r.kind)return {functionType:"constant",layoutSize:r.evaluate(new fn(t+1))};if("source"===r.kind)return {functionType:"source"};for(var n=r.zoomStops,i=0;i0)&&("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 fn(this.zoom),h=0,f=t;h=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;u0;this.addCollisionDebugVertices(a,o,s,u,p?this.collisionCircle:this.collisionBox,i.anchorPoint,r,p);}},As.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t0},As.prototype.hasIconData=function(){return this.icon.segments.get().length>0},As.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},As.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},As.prototype.addIndicesForPlacedTextSymbol=function(t){for(var e=this.text.placedSymbolArray.get(t),r=e.vertexStartIndex+4*e.numGlyphs,n=e.vertexStartIndex;n1||this.icon.segments.get().length>1))){for(var e=[],r=0;r=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);}},Jr("SymbolBucket",As,{omit:["layers","collisionBoxArray","features","compareText"]}),As.MAX_GLYPHS=65535,As.addDynamicAttributes=bs;var ks=new In({"symbol-placement":new wn(st.layout_symbol["symbol-placement"]),"symbol-spacing":new wn(st.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new wn(st.layout_symbol["symbol-avoid-edges"]),"symbol-z-order":new wn(st.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new wn(st.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new wn(st.layout_symbol["icon-ignore-placement"]),"icon-optional":new wn(st.layout_symbol["icon-optional"]),"icon-rotation-alignment":new wn(st.layout_symbol["icon-rotation-alignment"]),"icon-size":new An(st.layout_symbol["icon-size"]),"icon-text-fit":new wn(st.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new wn(st.layout_symbol["icon-text-fit-padding"]),"icon-image":new An(st.layout_symbol["icon-image"]),"icon-rotate":new An(st.layout_symbol["icon-rotate"]),"icon-padding":new wn(st.layout_symbol["icon-padding"]),"icon-keep-upright":new wn(st.layout_symbol["icon-keep-upright"]),"icon-offset":new An(st.layout_symbol["icon-offset"]),"icon-anchor":new An(st.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new wn(st.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new wn(st.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new wn(st.layout_symbol["text-rotation-alignment"]),"text-field":new An(st.layout_symbol["text-field"]),"text-font":new An(st.layout_symbol["text-font"]),"text-size":new An(st.layout_symbol["text-size"]),"text-max-width":new An(st.layout_symbol["text-max-width"]),"text-line-height":new wn(st.layout_symbol["text-line-height"]),"text-letter-spacing":new An(st.layout_symbol["text-letter-spacing"]),"text-justify":new An(st.layout_symbol["text-justify"]),"text-anchor":new An(st.layout_symbol["text-anchor"]),"text-max-angle":new wn(st.layout_symbol["text-max-angle"]),"text-rotate":new An(st.layout_symbol["text-rotate"]),"text-padding":new wn(st.layout_symbol["text-padding"]),"text-keep-upright":new wn(st.layout_symbol["text-keep-upright"]),"text-transform":new An(st.layout_symbol["text-transform"]),"text-offset":new An(st.layout_symbol["text-offset"]),"text-allow-overlap":new wn(st.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new wn(st.layout_symbol["text-ignore-placement"]),"text-optional":new wn(st.layout_symbol["text-optional"])}),Ss={paint:new In({"icon-opacity":new An(st.paint_symbol["icon-opacity"]),"icon-color":new An(st.paint_symbol["icon-color"]),"icon-halo-color":new An(st.paint_symbol["icon-halo-color"]),"icon-halo-width":new An(st.paint_symbol["icon-halo-width"]),"icon-halo-blur":new An(st.paint_symbol["icon-halo-blur"]),"icon-translate":new wn(st.paint_symbol["icon-translate"]),"icon-translate-anchor":new wn(st.paint_symbol["icon-translate-anchor"]),"text-opacity":new An(st.paint_symbol["text-opacity"]),"text-color":new An(st.paint_symbol["text-color"]),"text-halo-color":new An(st.paint_symbol["text-halo-color"]),"text-halo-width":new An(st.paint_symbol["text-halo-width"]),"text-halo-blur":new An(st.paint_symbol["text-halo-blur"]),"text-translate":new wn(st.paint_symbol["text-translate"]),"text-translate-anchor":new wn(st.paint_symbol["text-translate-anchor"])}),layout:ks},zs=function(t){function e(e){t.call(this,e,Ss);}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()||nr(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 As(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return !1},e}(Bn),Is={paint:new In({"background-color":new wn(st.paint_background["background-color"]),"background-pattern":new Sn(st.paint_background["background-pattern"]),"background-opacity":new wn(st.paint_background["background-opacity"])})},Bs=function(t){function e(e){t.call(this,e,Is);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Bn),Es={paint:new In({"raster-opacity":new wn(st.paint_raster["raster-opacity"]),"raster-hue-rotate":new wn(st.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new wn(st.paint_raster["raster-brightness-min"]),"raster-brightness-max":new wn(st.paint_raster["raster-brightness-max"]),"raster-saturation":new wn(st.paint_raster["raster-saturation"]),"raster-contrast":new wn(st.paint_raster["raster-contrast"]),"raster-resampling":new wn(st.paint_raster["raster-resampling"]),"raster-fade-duration":new wn(st.paint_raster["raster-fade-duration"])})},Vs=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}(Bn);var Ps=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}(Bn),Ms={circle:Ea,heatmap:Ua,hillshade:qa,fill:Io,"fill-extrusion":Lo,line:as,symbol:zs,background:Bs,raster:Vs};function Cs(t){for(var e=0,r=0,n=0,i=t;n=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>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)},Ns=function(t,e,r,n,i,a){var o,s,u,p=8*a-i-1,l=(1<>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<0;t[r+f]=255&o,f+=y,o/=256,p-=8);t[r+f-y]|=128*d;},Gs=Zs;function Zs(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length;}Zs.Varint=0,Zs.Fixed64=1,Zs.Bytes=2,Zs.Fixed32=5;function Xs(t){return t.type===Zs.Bytes?t.readVarint()+t.pos:t.pos+1}function Ks(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Hs(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 Js(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24;}function ou(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Zs.prototype={destroy:function(){this.buf=null;},readFields:function(t,e,r){for(r=r||this.length;this.pos>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=iu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=ou(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=iu(this.buf,this.pos)+4294967296*iu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=iu(this.buf,this.pos)+4294967296*ou(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Rs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Rs(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 Ks(t,n,e);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return Ks(t,n,e);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return Ks(t,n,e);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return Ks(t,n,e);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return Ks(t,n,e);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return Ks(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(;i239?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=Xs(this);for(t=t||[];this.pos127;);else if(e===Zs.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Zs.Fixed32)this.pos+=4;else{if(e!==Zs.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;e268435455||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;a55295&&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&&Hs(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r;},writeFloat:function(t){this.realloc(4),Ns(this.buf,t,this.pos,!0,23,4),this.pos+=4;},writeDouble:function(t){this.realloc(8),Ns(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=128&&Hs(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n;},writeMessage:function(t,e,r){this.writeTag(t,Zs.Bytes),this.writeRawMessage(e,r);},writePackedVarint:function(t,e){this.writeMessage(t,Js,e);},writePackedSVarint:function(t,e){this.writeMessage(t,Ys,e);},writePackedBoolean:function(t,e){this.writeMessage(t,Qs,e);},writePackedFloat:function(t,e){this.writeMessage(t,$s,e);},writePackedDouble:function(t,e){this.writeMessage(t,Ws,e);},writePackedFixed32:function(t,e){this.writeMessage(t,tu,e);},writePackedSFixed32:function(t,e){this.writeMessage(t,eu,e);},writePackedFixed64:function(t,e){this.writeMessage(t,ru,e);},writePackedSFixed64:function(t,e){this.writeMessage(t,nu,e);},writeBytesField:function(t,e){this.writeTag(t,Zs.Bytes),this.writeBytes(e);},writeFixed32Field:function(t,e){this.writeTag(t,Zs.Fixed32),this.writeFixed32(e);},writeSFixed32Field:function(t,e){this.writeTag(t,Zs.Fixed32),this.writeSFixed32(e);},writeFixed64Field:function(t,e){this.writeTag(t,Zs.Fixed64),this.writeFixed64(e);},writeSFixed64Field:function(t,e){this.writeTag(t,Zs.Fixed64),this.writeSFixed64(e);},writeVarintField:function(t,e){this.writeTag(t,Zs.Varint),this.writeVarint(e);},writeSVarintField:function(t,e){this.writeTag(t,Zs.Varint),this.writeSVarint(e);},writeStringField:function(t,e){this.writeTag(t,Zs.Bytes),this.writeString(e);},writeFloatField:function(t,e){this.writeTag(t,Zs.Fixed32),this.writeFloat(e);},writeDoubleField:function(t,e){this.writeTag(t,Zs.Fixed64),this.writeDouble(e);},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e));}};var su=3;function uu(t,e,r){1===t&&r.readMessage(pu,e);}function pu(t,e,r){if(3===t){var n=r.readMessage(lu,{}),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 Fa({width:o+2*su,height:s+2*su},a),metrics:{width:o,height:s,left:u,top:p,advance:l}});}}function lu(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 cu=su,hu=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.callbackID=0,m(["receive"],this),this.target.addEventListener("message",this.receive,!1);};function fu(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]}hu.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:$r(e,a)},a);},hu.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:"",id:String(i),error:t?$r(t):null,data:$r(e,n)},n);};if(""===n.type)e=this.callbacks[n.id],delete this.callbacks[n.id],e&&n.error?e(Wr(n.error)):e&&e(null,Wr(n.data));else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.sourceMapId,Wr(n.data),a);else if(void 0!==n.id&&this.parent.getWorkerSource){var o=n.type.split("."),s=Wr(n.data);this.parent.getWorkerSource(n.sourceMapId,o[0],s.source)[o[1]](s,a);}else this.parent[n.type](Wr(n.data));}},hu.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1);};var yu=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]));};yu.prototype.setNorthEast=function(t){return this._ne=t instanceof du?new du(t.lng,t.lat):du.convert(t),this},yu.prototype.setSouthWest=function(t){return this._sw=t instanceof du?new du(t.lng,t.lat):du.convert(t),this},yu.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof du)e=t,r=t;else{if(!(t instanceof yu))return Array.isArray(t)?t.every(Array.isArray)?this.extend(yu.convert(t)):this.extend(du.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return n||i?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new du(e.lng,e.lat),this._ne=new du(r.lng,r.lat)),this},yu.prototype.getCenter=function(){return new du((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},yu.prototype.getSouthWest=function(){return this._sw},yu.prototype.getNorthEast=function(){return this._ne},yu.prototype.getNorthWest=function(){return new du(this.getWest(),this.getNorth())},yu.prototype.getSouthEast=function(){return new du(this.getEast(),this.getSouth())},yu.prototype.getWest=function(){return this._sw.lng},yu.prototype.getSouth=function(){return this._sw.lat},yu.prototype.getEast=function(){return this._ne.lng},yu.prototype.getNorth=function(){return this._ne.lat},yu.prototype.toArray=function(){return [this._sw.toArray(),this._ne.toArray()]},yu.prototype.toString=function(){return "LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},yu.prototype.isEmpty=function(){return !(this._sw&&this._ne)},yu.convert=function(t){return !t||t instanceof yu?t:new yu(t)};var du=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");this.lng=+t,this.lat=+e;};function mu(t){return 2*Math.PI*6378137*Math.cos(t*Math.PI/180)}function vu(t){return (180+t)/360}function gu(t){return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function xu(t,e){return t/mu(e)}function bu(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}du.prototype.wrap=function(){return new du(l(this.lng,-180,180),this.lat)},du.prototype.toArray=function(){return [this.lng,this.lat]},du.prototype.toString=function(){return "LngLat("+this.lng+", "+this.lat+")"},du.prototype.toBounds=function(t){var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new yu(new du(this.lng-r,this.lat-e),new du(this.lng+r,this.lat+e))},du.convert=function(t){if(t instanceof du)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new du(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new du(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var _u=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r;};_u.fromLngLat=function(t,e){void 0===e&&(e=0);var r=du.convert(t);return new _u(vu(r.lng),gu(r.lat),xu(e,r.lat))},_u.prototype.toLngLat=function(){return new du(360*this.x-180,bu(this.y))},_u.prototype.toAltitude=function(){return t=this.z,e=this.y,t*mu(bu(e));var t,e;};var wu=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Su(0,t,e,r);};wu.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},wu.prototype.getTileBBox=function(){var t=Math.pow(2,this.z)-this.y-1,e=fu(256*this.x,256*t,this.z),r=fu(256*(this.x+1),256*(t+1),this.z);return e[0]+","+e[1]+","+r[0]+","+r[1]},wu.prototype.url=function(t,e,r,n,i){var a=this.getTileBBox(),o=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<this.canonical.z?new ku(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ku(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},ku.prototype.isChildOf=function(t){var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},ku.prototype.children=function(t){if(this.overscaledZ>=t)return [new ku(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 ku(e,this.wrap,e,r,n),new ku(e,this.wrap,e,r+1,n),new ku(e,this.wrap,e,r,n+1),new ku(e,this.wrap,e,r+1,n+1)]},ku.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=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)},zu.prototype._unpackMapbox=function(t,e,r){return (256*t*256+256*e+r)/10-1e4},zu.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},zu.prototype.getPixels=function(){return new La({width:this.dim+2*this.border,height:this.dim+2*this.border},new Uint8Array(this.data.buffer))},zu.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=p(n,-this.border,this.dim+this.border),u=p(i,-this.border,this.dim+this.border),l=p(a,-this.border,this.dim+this.border),c=p(o,-this.border,this.dim+this.border),h=-e*this.dim,f=-r*this.dim,y=l;y=0&&u[3]>=0&&this.grid.insert(a,u[0],u[1],u[2],u[3]);}},Mu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ko.VectorTile(new Gs(this.rawTileData)).layers,this.sourceLayerCoder=new Bu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Mu.prototype.query=function(t,e,r){var n=this;this.loadVTLayers();for(var i=t.params||{},a=Di/t.tileSize/t.scale,o=gr(i.filter),s=t.queryGeometry,u=t.queryPadding*a,p=1/0,l=1/0,c=-1/0,h=-1/0,f=0;f=0)return !0;return !1}(a,u)){var p=this.sourceLayerCoder.decode(r),l=this.vtLayers[p].feature(n);if(i(new fn(this.tileID.overscaledZ),l))for(var c=0;c>u.z,l=new i(u.x*p,u.y*p),c=new i(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,Iu.members),this.maskedIndexBuffer=e.createIndexBuffer(n);}},Tu.prototype.hasData=function(){return "loaded"===this.state||"reloading"===this.state||"expired"===this.state},Tu.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Tu.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=0&&n>=t&&Ou[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r);},Lu.prototype.substring=function(t,e){var r=new Lu;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Lu.prototype.toString=function(){return this.text},Lu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce(function(e,r){return Math.max(e,t.sections[r].scale)},0)};var Ou={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Du={};function Uu(t,e,r,n){var i=Math.pow(t-e,2);return n?t=2||512===r?"@2x":"",a=E.supportsWebp?".webp":"$1";return n.path=n.path.replace(O,""+i+a),function(t){for(var e=0;e-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;so;)u-=l.shift().angleDelta;if(u>n)return !1;a++,s+=h.dist(f);}return !0}function i(e){for(var t=0,r=0;rd){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(),!h||n(t,S,f,h,r)?S:void 0}p+=y;}}function u(t,r,o,l,u,c,h,f,p){var d=a(l,c,h),g=s(l,u),m=g*h,v=0===t[0].x||t[0].x===p||0===t[0].y||t[0].y===p;return r-m=0&&b=0&&_=0&&m+p<=d){var T=new e.Anchor(b,_,S,y);T._round(),s&&!n(r,T,u,s,l)||v.push(T);}}g+=M;}h||v.length||c||(v=t(r,g/2,a,s,l,u,c,!0,f));return v}(t,v?r/2*f%r:(g/2+2*c)*h*f%r,r,d,o,m,v,!1,p)}o.prototype.replace=function(e){this._layerConfigs={},this._layers={},this.update(e,[]);},o.prototype.update=function(t,o){for(var n=this,i=0,a=t;i0&&(v=Math.max(10*l,v),this._addLineCollisionCircles(t,r,o,o.segment,y,v,n,i,a,h));}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),P=f*Math.PI/180;x._rotate(P),w._rotate(P),M._rotate(P),S._rotate(P),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(o.x,o.y,g,p,m,d,n,i,a,0,0);}this.boxEndIndex=t.length;};c.prototype._addLineCollisionCircles=function(e,t,r,o,n,i,a,s,l,u){var c=i/2,h=Math.floor(n/c)||1,f=1+.4*Math.log(u)/Math.LN2,p=Math.floor(h*f/2),d=-i/2,g=r,m=o+1,v=d,y=-n/2,x=y-n/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;Mn&&(P+=S-n),!(P=t.length)return;w=t[m].dist(t[m+1]);}var b=P-v,_=t[m],T=t[m+1].sub(_)._unit()._mult(b)._add(_)._round(),I=Math.abs(P-d)0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r);}function d(e,t){return et?1:0}function g(t,r,o){void 0===r&&(r=1),void 0===o&&(o=!1);for(var n=1/0,i=1/0,a=-1/0,s=-1/0,l=t[0],u=0;ua)&&(a=c.x),(!u||c.y>s)&&(s=c.y);}var f=a-n,p=s-i,d=Math.min(f,p),g=d/2,y=new h(null,m);if(0===d)return new e.Point(n,i);for(var x=n;xM.d||!M.d)&&(M=P,o&&console.log("found best %d after %d probes",Math.round(1e4*P.d)/1e4,S)),P.max-M.d<=r||(g=P.h/2,y.push(new v(P.p.x-g,P.p.y-g,g,t)),y.push(new v(P.p.x+g,P.p.y-g,g,t)),y.push(new v(P.p.x-g,P.p.y+g,g,t)),y.push(new v(P.p.x+g,P.p.y+g,g,t)),S+=4);}return o&&(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,o,n){this.p=new e.Point(t,r),this.h=o,this.d=function(t,r){for(var o=!1,n=1/0,i=0;it.y!=h.y>t.y&&t.x<(h.x-c.x)*(t.y-c.y)/(h.y-c.y)+c.x&&(o=!o),n=Math.min(n,e.distToSegmentSquared(t,c,h));}return (o?1:-1)*Math.sqrt(n)}(this.p,n),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,o=t[e];e>0;){var n=e-1>>1,i=t[n];if(r(o,i)>=0)break;t[e]=i,e=n;}t[e]=o;},_down:function(e){for(var t=this.data,r=this.compare,o=this.length>>1,n=t[e];e=0)break;t[e]=s,e=i;}t[e]=n;}},h.default=f;var y=e.createCommonjsModule(function(e){e.exports=function(e,t){var r,o,n,i,a,s,l,u;for(r=3&e.length,o=e.length-r,n=t,a=3432918353,s=461845907,u=0;u>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>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:n^=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 n^=e.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0};}),x=e.createCommonjsModule(function(e){e.exports=function(e,t){for(var r,o=e.length,n=t^o,i=0;o>=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),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),o-=4,++i;switch(o){case 3:n^=(255&e.charCodeAt(i+2))<<16;case 2:n^=(255&e.charCodeAt(i+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(i)))+((1540483477*(n>>>16)&65535)<<16);}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0};}),w=y,M=y,S=x;function P(t,r,o,n,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,c={};if("composite"===t.textSizeData.functionType){var h=t.textSizeData.zoomRange,f=h.min,p=h.max;c.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;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new e.EvaluationParameters(g)),u["icon-size"].possiblyEvaluate(new e.EvaluationParameters(m))];}c.layoutTextSize=u["text-size"].possiblyEvaluate(new e.EvaluationParameters(t.zoom+1)),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new e.EvaluationParameters(t.zoom+1)),c.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=e.EXTENT||l.y<0||l.y>=e.EXTENT||function(t,r,o,n,i,a,s,l,u,h,f,p,d,g,m,v,y,x,M,S,P){var b,I,k=t.addToLineVertexArray(r,o),z=0,C=0,E=0,L=w(n.horizontal?n.horizontal.text:""),A=[];if(n.horizontal){var D=a.layout.get("text-rotate").evaluate(M,{});b=new c(s,o,r,l,u,h,n.horizontal,f,p,d,t.overscaling,D),C+=T(t,r,n.horizontal,a,d,M,g,k,n.vertical?e.WritingMode.horizontal:e.WritingMode.horizontalOnly,A,S,P),n.vertical&&(E+=T(t,r,n.vertical,a,d,M,g,k,e.WritingMode.vertical,A,S,P));}var O=b?b.boxStartIndex:t.collisionBoxArray.length,N=b?b.boxEndIndex:t.collisionBoxArray.length;if(i){var R=function(t,r,o,n,i,a){var s,l,u,c,h=r.image,f=o.layout,p=r.top-1/h.pixelRatio,d=r.left-1/h.pixelRatio,g=r.bottom+1/h.pixelRatio,m=r.right+1/h.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,P=M-w,b=i.bottom*x-S,_=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*(b-y):0,C="height"===f.get("icon-text-fit")?.5*(P-v):0,E="width"===f.get("icon-text-fit")||"both"===f.get("icon-text-fit")?P:v,L="height"===f.get("icon-text-fit")||"both"===f.get("icon-text-fit")?b:y;s=new e.Point(w+C-k,S+z-_),l=new e.Point(w+C+T+E,S+z-_),u=new e.Point(w+C+T+E,S+z+I+L),c=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),c=new e.Point(d,g);var A=o.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),c._matMult(N),u._matMult(N);}return [{tl:s,tr:l,bl:c,br:u,tex:h.paddedRect,writingMode:void 0,glyphOffset:[0,0]}]}(0,i,a,0,n.horizontal,M),F=a.layout.get("icon-rotate").evaluate(M,{});I=new c(s,o,r,l,u,h,i,m,v,!1,t.overscaling,F),z=4*R.length;var B=t.iconSizeData,j=null;"source"===B.functionType?(j=[e.SIZE_PACK_FACTOR*a.layout.get("icon-size").evaluate(M,{})])[0]>_&&e.warnOnce(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'):"composite"===B.functionType&&((j=[e.SIZE_PACK_FACTOR*P.compositeIconSizes[0].evaluate(M,{}),e.SIZE_PACK_FACTOR*P.compositeIconSizes[1].evaluate(M,{})])[0]>_||j[1]>_)&&e.warnOnce(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'),t.addSymbols(t.icon,R,j,x,y,M,!1,r,k.lineStartIndex,k.lineLength);}var Z=I?I.boxStartIndex:t.collisionBoxArray.length,X=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,Z,X,l,C,E,z,0);}(t,l,s,o,n,t.layers[0],t.collisionBoxArray,r.index,r.sourceLayerIndex,t.index,y,P,z,d,M,b,C,m,r,i,a);};if("line"===E)for(var D=0,O=function(t,r,o,n,i){for(var a=[],s=0;s=n&&f.x>=n||(h.x>=n?h=new e.Point(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round():f.x>=n&&(f=new e.Point(n,h.y+(f.y-h.y)*((n-h.x)/(f.x-h.x)))._round()),h.y>=i&&f.y>=i||(h.y>=i?h=new e.Point(h.x+(f.x-h.x)*((i-h.y)/(f.y-h.y)),i)._round():f.y>=i&&(f=new e.Point(h.x+(f.x-h.x)*((i-h.y)/(f.y-h.y)),i)._round()),u&&h.equals(u[u.length-1])||(u=[h],a.push(u)),u.push(f)))));}return a}(r.geometry,0,0,e.EXTENT,e.EXTENT);D1){var G=l(Y,k,o.vertical||o.horizontal,n,24,x);G&&A(Y,G);}}else if("Polygon"===r.type)for(var J=0,V=e.classifyRings(r.geometry,0);J_&&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]>_||g[1]>_)&&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),c.push(t.text.placedSymbolArray.length-1),4*p.length}function I(e,t,r,o){var n=e.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(o.dist(i[a])=_.maxzoom))if("none"!==_.visibility)C(b,i.zoom),(f[_.id]=_.createBucket({index:s.bucketLayerIDs.length,layers:b,zoom:i.zoom,pixelRatio:i.pixelRatio,overscaling:i.overscaling,collisionBoxArray:i.collisionBoxArray,sourceLayerIndex:v,sourceID:i.source})).populate(y,p),s.bucketLayerIDs.push(b.map(function(e){return e.id}));}}}var T=e.mapObject(p.glyphDependencies,function(e){return Object.keys(e).map(Number)});Object.keys(T).length?o.send("getGlyphs",{uid:this.uid,stacks:T},function(e,t){l||(l=e,u=t,E.call(i));}):u={};var I=Object.keys(p.iconDependencies);I.length?o.send("getImages",{icons:I},function(e,t){l||(l=e,c=t,E.call(i));}):c={};var z=Object.keys(p.patternDependencies);function E(){if(l)return n(l);if(u&&c&&h){var t=new k(u),r=new e.ImageAtlas(c,h);for(var o in f){var i=f[o];i instanceof e.SymbolBucket?(C(i.layers,this.zoom),P(i,u,t.positions,c,r.iconPositions,this.showCollisionBoxes)):i.hasPattern&&(i instanceof e.LineBucket||i instanceof e.FillBucket||i instanceof e.FillExtrusionBucket)&&(C(i.layers,this.zoom),i.addFeatures(p,r.patternPositions));}this.status="done",n(null,{buckets:e.values(f).filter(function(e){return !e.isEmpty()}),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?u:null,iconMap:this.returnDependencies?c:null,glyphPositions:this.returnDependencies?t.positions:null});}}z.length?o.send("getImages",{icons:z},function(e,t){l||(l=e,h=t,E.call(i));}):h={},E.call(this);};var E="undefined"!=typeof performance,L={getEntriesByName:function(e){return !!(E&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(e)},mark:function(e){return !!(E&&performance&&performance.mark)&&performance.mark(e)},measure:function(e,t,r){return !!(E&&performance&&performance.measure)&&performance.measure(e,t,r)},clearMarks:function(e){return !!(E&&performance&&performance.clearMarks)&&performance.clearMarks(e)},clearMeasures:function(e){return !!(E&&performance&&performance.clearMeasures)&&performance.clearMeasures(e)}},A=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},L.mark(this._marks.start);};function D(t,r){var o=e.getArrayBuffer(t.request,function(t,o,n,i){t?r(t):o&&r(null,{vectorTile:new e.mvt.VectorTile(new e.Protobuf(o)),rawData:o,cacheControl:n,expires:i});});return function(){o.cancel(),r();}}A.prototype.finish=function(){L.mark(this._marks.end);var e=L.getEntriesByName(this._marks.measure);return 0===e.length&&(L.measure(this._marks.measure,this._marks.start,this._marks.end),e=L.getEntriesByName(this._marks.measure),L.clearMarks(this._marks.start),L.clearMarks(this._marks.end),L.clearMeasures(this._marks.measure)),e},L.Performance=A;var O=function(e,t,r){this.actor=e,this.layerIndex=t,this.loadVectorData=r||D,this.loading={},this.loaded={};};O.prototype.loadTile=function(t,r){var o=this,n=t.uid;this.loading||(this.loading={});var i=!!(t&&t.request&&t.request.collectResourceTiming)&&new L.Performance(t.request),a=this.loading[n]=new z(t);a.abort=this.loadVectorData(t,function(t,s){if(delete o.loading[n],t||!s)return a.status="done",o.loaded[n]=a,r(t);var l=s.rawData,u={};s.expires&&(u.expires=s.expires),s.cacheControl&&(u.cacheControl=s.cacheControl);var c={};if(i){var h=i.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)));}a.vectorTile=s.vectorTile,a.parse(s.vectorTile,o.layerIndex,o.actor,function(t,o){if(t||!o)return r(t);r(null,e.extend({rawTileData:l.slice(0)},o,u,c));}),o.loaded=o.loaded||{},o.loaded[n]=a;});},O.prototype.reloadTile=function(e,t){var r=this.loaded,o=e.uid,n=this;if(r&&r[o]){var i=r[o];i.showCollisionBoxes=e.showCollisionBoxes;var a=function(e,r){var o=i.reloadCallback;o&&(delete i.reloadCallback,i.parse(i.vectorTile,n.layerIndex,n.actor,o)),t(e,r);};"parsing"===i.status?i.reloadCallback=a:"done"===i.status&&(i.vectorTile?i.parse(i.vectorTile,this.layerIndex,this.actor,a):a());}},O.prototype.abortTile=function(e,t){var r=this.loading,o=e.uid;r&&r[o]&&r[o].abort&&(r[o].abort(),delete r[o]),t();},O.prototype.removeTile=function(e,t){var r=this.loaded,o=e.uid;r&&r[o]&&delete r[o],t();};var N=function(){this.loaded={};};N.prototype.loadTile=function(t,r){var o=t.uid,n=t.encoding,i=t.rawImageData,a=new e.DEMData(o,i,n);this.loaded=this.loaded||{},this.loaded[o]=a,r(null,a);},N.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r];};var R={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function F(e){var t=0;if(e&&e.length>0){t+=Math.abs(B(e[0]));for(var r=1;r2){for(a=0;a=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,o=this._feature.geometry;r>31}function ue(e,t){for(var r=e.loadGeometry(),o=e.type,n=0,i=0,a=r.length,s=0;sn;){if(i-n>600){var s=i-n+1,l=o-n+1,u=Math.log(s),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1),f=Math.max(n,Math.floor(o-l*c/s+h)),p=Math.min(i,Math.floor(o+(s-l)*c/s+h));e(t,r,o,f,p,a);}var d=r[2*o+a],g=n,m=i;for(fe(t,r,n,o),r[2*i+a]>d&&fe(t,r,n,i);gd;)m--;}r[2*n+a]===d?fe(t,r,n,m):fe(t,r,++m,i),m<=o&&(n=m+1),o<=m&&(i=m-1);}}(e,t,a,o,n,i%2),he(e,t,r,o,a-1,i+1),he(e,t,r,a+1,n,i+1);}}function fe(e,t,r,o){pe(e,r,o),pe(t,2*r,2*o),pe(t,2*r+1,2*o+1);}function pe(e,t,r){var o=e[t];e[t]=e[r],e[r]=o;}function de(e,t,r,o){var n=e-r,i=t-o;return n*n+i*i}function ge(e,t,r,o,n){return new me(e,t,r,o,n)}function me(e,t,r,o,n){t=t||ve,r=r||ye,n=n||Array,this.nodeSize=o||64,this.points=e,this.ids=new n(e.length),this.coords=new n(2*e.length);for(var i=0;i1?1:n),zoom:1/0,index:t,parentId:-1}}function Se(e){return {type:"Feature",id:e.id,properties:Pe(e),geometry:{type:"Point",coordinates:[(o=e.x,360*(o-.5)),"object"==typeof customConvertPoint?customConvertPoint.toY(e.y):(t=e.y,r=(180-360*t)*Math.PI/180,360*Math.atan(Math.exp(r))/Math.PI-90)]}};var t,r,o;}function Pe(e){var t=e.numPoints,r=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return _e(_e({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function be(e){return e/360+.5}function _e(e,t){for(var r in t)e[r]=t[r];return e}function Te(e){return e.x}function Ie(e){return e.y}function ke(e,t,r,o,n,i){var a=n-r,s=i-o;if(0!==a||0!==s){var l=((e-r)*a+(t-o)*s)/(a*a+s*s);l>1?(r=n,o=i):l>0&&(r+=a*l,o+=s*l);}return (a=e-r)*a+(s=t-o)*s}function ze(e,t,r,o){var n={id:void 0===e?null:e,type:t,geometry:r,tags:o,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)Ce(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var o=0;o1?1:n)),t.push(0);}function Ae(e,t,r,o){for(var n,i,a=0,s=0;s0&&(a+=o?(n*c-u*i)/2:Math.sqrt(Math.pow(u-n,2)+Math.pow(c-i,2))),n=u,i=c;}var h=t.length-3;t[2]=1,function e(t,r,o,n){for(var i,a=n,s=o-r>>1,l=o-r,u=t[r],c=t[r+1],h=t[o],f=t[o+1],p=r+3;pa)i=p,a=d;else if(d===a){var g=Math.abs(p-s);gn&&(i-r>3&&e(t,r,i,n),t[i+2]=a,o-i>3&&e(t,i,o,n));}(t,0,h,r),t[h+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size;}function De(e,t,r,o){for(var n=0;n=(r/=t)&&a=o)return null;for(var l=[],u=0;u=r&&d=o)){var g=[];if("Point"===f||"MultiPoint"===f)Ne(h,g,r,o,n);else if("LineString"===f)Re(h,g,r,o,n,!1,s.lineMetrics);else if("MultiLineString"===f)Be(h,g,r,o,n,!1);else if("Polygon"===f)Be(h,g,r,o,n,!0);else if("MultiPolygon"===f)for(var m=0;m=r&&a<=o&&(t.push(e[i]),t.push(e[i+1]),t.push(e[i+2]));}}function Re(e,t,r,o,n,i,a){for(var s,l,u=Fe(e),c=0===n?Ze:Xe,h=e.start,f=0;fr&&(l=c(u,p,d,m,v,r),a&&(u.start=h+s*l)):y>o?x=r&&(l=c(u,p,d,m,v,r),w=!0),x>o&&y<=o&&(l=c(u,p,d,m,v,o),w=!0),!i&&w&&(a&&(u.end=h+s*l),t.push(u),u=Fe(e)),a&&(h+=s);}var M=e.length-3;p=e[M],d=e[M+1],g=e[M+2],(y=0===n?p:d)>=r&&y<=o&&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 Fe(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function Be(e,t,r,o,n,i){for(var a=0;aa.maxX&&(a.maxX=c),h>a.maxY&&(a.maxY=h);}return a}function qe(e,t,r,o){var n=t.geometry,i=t.type,a=[];if("Point"===i||"MultiPoint"===i)for(var s=0;s0&&t.size<(n?a:o))r.numPoints+=t.length/3;else{for(var s=[],l=0;la)&&(r.numSimplified++,s.push(t[l]),s.push(t[l+1])),r.numPoints++;n&&function(e,t){for(var r=0,o=0,n=e.length,i=n-2;o0===t)for(o=0,n=e.length;o24)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 o=function(e,t){if(t.customprj&&"undefined"==typeof customConvertPoint)try{importScripts(t.customprj);}catch(e){console.log(e);}var r=[];if("FeatureCollection"===e.type)for(var o=0;o=r&&s<=n&&l>=o&&l<=i&&c.push(e[d]);else{var g=Math.floor((p+f)/2);s=t[2*g],l=t[2*g+1],s>=r&&s<=n&&l>=o&&l<=i&&c.push(e[g]);var m=(h+1)%2;(0===h?r<=s:o<=l)&&(u.push(p),u.push(g-1),u.push(m)),(0===h?n>=s:i>=l)&&(u.push(g+1),u.push(f),u.push(m));}}return c}(this.ids,this.coords,e,t,r,o,this.nodeSize)},within:function(e,t,r){return function(e,t,r,o,n,i){for(var a=[0,e.length-1,0],s=[],l=n*n;a.length;){var u=a.pop(),c=a.pop(),h=a.pop();if(c-h<=i)for(var f=h;f<=c;f++)de(t[2*f],t[2*f+1],r,o)<=l&&s.push(e[f]);else{var p=Math.floor((h+c)/2),d=t[2*p],g=t[2*p+1];de(d,g,r,o)<=l&&s.push(e[p]);var m=(u+1)%2;(0===u?r-n<=d:o-n<=g)&&(a.push(h),a.push(p-1),a.push(m)),(0===u?r+n>=d:o+n>=g)&&(a.push(p+1),a.push(c),a.push(m));}}return s}(this.ids,this.coords,e,t,r,this.nodeSize)}},xe.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 o=[],n=0;n=this.options.minZoom;i--){var a=+Date.now();o=this._cluster(o,i),this.trees[i]=ge(o,Te,Ie,this.options.nodeSize,Float32Array),t&&console.log("z%d: %d clusters in %dms",i,o.length,+Date.now()-a);}return t&&console.timeEnd("total time"),this},getClusters:function(e,t){var r=((e[0]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,e[1])),n=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,n=180;else if(r>n){var a=this.getClusters([r,o,180,i],t),s=this.getClusters([-180,o,n,i],t);return a.concat(s)}for(var l=this.trees[this._limitZoom(t)],u=l.range(be(r),customConvertPoint.toY(i),be(n),customConvertPoint.toY(o)),c=[],h=0;h>5,r=e%32,o="No cluster with the specified id.",n=this.trees[r];if(!n)throw new Error(o);var i=n.points[t];if(!i)throw new Error(o);for(var a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=n.within(i.x,i.y,a),l=[],u=0;u1&&console.time("creation"),f=this.tiles[h]=We(e,t,r,o,l),this.tileCoords.push({z:t,x:r,y:o}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,o,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,n){if(t===l.maxZoom||t===n)continue;var d=1<1&&console.time("clipping");var g,m,v,y,x,w,M=.5*l.buffer/l.extent,S=.5-M,P=.5+M,b=1+M;g=m=v=y=null,x=Oe(e,c,r-M,r+P,0,f.minX,f.maxX,l),w=Oe(e,c,r+S,r+b,0,f.minX,f.maxX,l),e=null,x&&(g=Oe(x,c,o-M,o+P,1,f.minY,f.maxY,l),m=Oe(x,c,o+S,o+b,1,f.minY,f.maxY,l),x=null),w&&(v=Oe(w,c,o-M,o+P,1,f.minY,f.maxY,l),y=Oe(w,c,o+S,o+b,1,f.minY,f.maxY,l),w=null),u>1&&console.timeEnd("clipping"),s.push(g||[],t+1,2*r,2*o),s.push(m||[],t+1,2*r,2*o+1),s.push(v||[],t+1,2*r+1,2*o),s.push(y||[],t+1,2*r+1,2*o+1);}}},Ue.prototype.getTile=function(e,t,r){var o=this.options,n=o.extent,i=o.debug;if(e<0||e>24)return null;var a=1<1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,u=e,c=t,h=r;!l&&u>0;)u--,c=Math.floor(c/2),h=Math.floor(h/2),l=this.tiles[He(u,c,h)];return l&&l.source?(i>1&&console.log("found parent tile z%d-%d-%d",u,c,h),i>1&&console.time("drilling down"),this.splitTile(l.source,u,c,h,e,t,r),i>1&&console.timeEnd("drilling down"),this.tiles[s]?Je(this.tiles[s],n):null):null};var $e=function(t){function r(e,r,o){t.call(this,e,r,Qe),o&&(this.loadGeoJSON=o);}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 o=!!(r&&r.request&&r.request.collectResourceTiming)&&new L.Performance(r.request);this.loadGeoJSON(r,function(n,i){if(n||!i)return t(n);if("object"!=typeof i)return t(new Error("Input data is not a valid GeoJSON object."));X(i,!0);try{if(r.superclusterOptions.customprj)try{importScripts(r.superclusterOptions.customprj);}catch(e){console.log(r);}e._geoJSONIndex=r.cluster?(a=r.superclusterOptions,new xe(a)).load(i.features):function(e,t){return new Ue(e,t)}(i,r.geojsonVtOptions);}catch(n){return t(n)}e.loaded={};var a,s={};if(o){var l=o.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 o=this.loaded,n=e.uid;return o&&o[n]?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}(O),et=function(t){var r=this;this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.workerSourceTypes={vector:O,geojson:$e},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 et.prototype.setReferrer=function(e,t){this.referrer=t;},et.prototype.setLayers=function(e,t,r){this.getLayerIndex(e).replace(t),r();},et.prototype.updateLayers=function(e,t,r){this.getLayerIndex(e).update(t.layers,t.removedIds),r();},et.prototype.loadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).loadTile(t,r);},et.prototype.loadDEMTile=function(e,t,r){this.getDEMWorkerSource(e,t.source).loadTile(t,r);},et.prototype.reloadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).reloadTile(t,r);},et.prototype.abortTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).abortTile(t,r);},et.prototype.removeTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).removeTile(t,r);},et.prototype.removeDEMTile=function(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t);},et.prototype.removeSource=function(e,t,r){if(this.workerSources[e]&&this.workerSources[e][t.type]&&this.workerSources[e][t.type][t.source]){var o=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==o.removeSource?o.removeSource(t,r):r();}},et.prototype.loadWorkerSource=function(e,t,r){try{this.self.importScripts(t.url),r();}catch(e){r(e.toString());}},et.prototype.loadRTLTextPlugin=function(t,r,o){try{e.plugin.isLoaded()||(this.self.importScripts(r),o(e.plugin.isLoaded()?null:new Error("RTL Text Plugin failed to import scripts from "+r)));}catch(e){o(e.toString());}},et.prototype.getLayerIndex=function(e){var t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new o),t},et.prototype.getWorkerSource=function(e,t,r){var o=this;if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){var n={send:function(t,r,n){o.actor.send(t,r,n,e);}};this.workerSources[e][t][r]=new this.workerSourceTypes[t](n,this.getLayerIndex(e));}return this.workerSources[e][t][r]},et.prototype.getDEMWorkerSource=function(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new N),this.demWorkerSources[e][t]},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new et(self)),et}); 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"}),r=URL.createObjectURL(i);try{e=new Worker(r),t=!0;}catch(e){t=!1;}e&&e.terminate();return URL.revokeObjectURL(r),t}()&&"Uint8ClampedArray"in window&&ArrayBuffer.isView&&function(t){void 0===i[t]&&(i[t]=function(t){var i=document.createElement("canvas"),r=Object.create(e.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,i.probablySupportsContext?i.probablySupportsContext("webgl",r)||i.probablySupportsContext("experimental-webgl",r):i.supportsContext?i.supportsContext("webgl",r)||i.supportsContext("experimental-webgl",r):i.getContext("webgl",r)||i.getContext("experimental-webgl",r)}(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,r){var o=t.window.document.createElement(e);return i&&(o.className=i),r&&r.appendChild(o),o},createNS:function(e,i){return t.window.document.createElementNS(e,i)}},r=t.window.document?t.window.document.documentElement.style:null;function o(t){if(!r)return null;for(var e=0;e1?"@2x":"",l=t.getJSON(i(t.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),function(t,e){l=null,a||(a=t,o=e,u());}),c=t.getImage(i(t.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),function(t,e){c=null,a||(a=t,n=e,u());});function u(){if(a)r(a);else if(o&&n){var e=t.browser.getImageData(n),i={};for(var s in o){var l=o[s],c=l.width,u=l.height,h=l.x,p=l.y,d=l.sdf,_=l.pixelRatio,f=new t.RGBAImage({width:c,height:u});t.RGBAImage.copy(e,f,{x:h,y:p},{x:0,y:0},{width:c,height:u}),i[s]={data:f,pixelRatio:_,sdf:d};}r(null,i);}}return {cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null);}}}i.suppressClick=function(){t.window.addEventListener("click",u,!0),t.window.setTimeout(function(){t.window.removeEventListener("click",u,!0);},0);},i.mousePos=function(e,i){var r=e.getBoundingClientRect();return i=i.touches?i.touches[0]:i,new t.Point(i.clientX-r.left-e.clientLeft,i.clientY-r.top-e.clientTop)},i.touchPos=function(e,i){for(var r=e.getBoundingClientRect(),o=[],n="touchend"===i.type?i.changedTouches:i.touches,a=0;a=0?0:e.button},i.remove=function(t){t.parentNode&&t.parentNode.removeChild(t);};var p=function(){this.images={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0;};p.prototype.isLoaded=function(){return this.loaded},p.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,i=this.requestors;e=0?1.2:1));}function m(t,e,i,r,o,n,a){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else{var l=n.requests[s];l||(l=n.requests[s]=[],v.loadGlyphRange(i,s,r.url,r.requestTransform,function(t,e){if(e)for(var i in e)n.glyphs[+i]=e[+i];for(var r=0,o=l;rthis.height)return t.warnOnce("LineAtlas out of space"),null;for(var n=0,a=0;a=r&&e.x=o&&e.y0&&(l[new t.OverscaledTileID(e.overscaledZ,n,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+10&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",r));}});},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 r={dataType:"source",sourceDataType:"content"};i._collectResourceTiming&&i._resourceTiming&&i._resourceTiming.length>0&&(r.resourceTiming=i._resourceTiming,i._resourceTiming=[]),i.fire(new t.Event("data",r));}}),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,r){return this.dispatcher.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},r,this.workerID),this},i.prototype._updateWorkerData=function(e){var i=this,r=t.extend({},this.workerOptions),o=this._data;"string"==typeof o?(r.request=this.map._transformRequest(t.browser.resolveURL(o),t.ResourceType.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(o),this.workerID=this.dispatcher.send(this.type+".loadData",r,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:r.source},null,i.workerID),e(t));},this.workerID);},i.prototype.loadTile=function(e,i){var r=this,o=void 0===e.workerID?"loadTile":"reloadTile",n={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,n,function(t,n){return e.unloadVectorData(),e.aborted?i(null):t?i(t):(e.loadVectorData(n,r.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),L=function(e){function i(t,i,r,o){e.call(this),this.id=t,this.dispatcher=r,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 r=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,n){o?r.fire(new t.ErrorEvent(o)):n&&(r.image=n,e&&(r.coordinates=e),i&&i(),r._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){var i=this;this.coordinates=e;var r=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var i=1/0,r=1/0,o=-1/0,n=-1/0,a=0,s=e;athis.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a);}return this},O.prototype.has=function(t){return t.wrapped().key in this.data},O.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},O.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},O.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},O.prototype.remove=function(t,e){if(!this.has(t))return this;var i=t.wrapped().key,r=void 0===e?0:this.data[i].indexOf(e),o=this.data[i][r];return this.data[i].splice(r,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},O.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 F=function(t,e,i){this.context=t;var r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer;};F.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer);},F.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer);},F.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer);};var U={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},N=function(t,e,i,r){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,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;};N.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer);},N.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer);},N.prototype.enableAttributes=function(t,e){for(var i=0;i1||(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,r),t.neighboringTiles&&t.neighboringTiles[n]&&(t.neighboringTiles[n].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,r){for(var o in this._tiles){var n=this._tiles[o];if(!(r[o]||!n.hasData()||n.tileID.overscaledZ<=e||n.tileID.overscaledZ>i)){for(var a=n.tileID;n&&n.tileID.overscaledZ>e+1;){var s=n.tileID.scaledTo(n.tileID.overscaledZ-1);(n=this._tiles[s.key])&&n.hasData()&&(a=s);}for(var l=a;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){r[a.key]=a;break}}}},i.prototype.findLoadedParent=function(t,e){for(var i=t.overscaledZ-1;i>=e;i--){var r=t.scaledTo(i);if(!r)return;var o=String(r.key),n=this._tiles[o];if(n&&n.hasData())return n;if(this._cache.has(r))return this._cache.get(r)}},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),r="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(r);},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 r={};for(var o in this._tiles){var n=this._tiles[o];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+i),r[n.tileID.key]=n;}for(var a in this._tiles=r,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 r=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 r._source.hasTile(t)}))):o=[];var n=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(e)),a=Math.max(n-i.maxOverzooming,this._source.minzoom),s=Math.max(n+i.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(o,n);if(Lt(this._source.type)){for(var c={},u={},h=0,p=Object.keys(l);hthis._source.maxzoom){var m=_.children(this._source.maxzoom)[0],g=this.getTile(m);if(g&&g.hasData()){r[m.key]=m;continue}}else{var v=_.children(this._source.maxzoom);if(r[v[0].key]&&r[v[1].key]&&r[v[2].key]&&r[v[3].key])continue}for(var y=f.wasRequested(),x=_.overscaledZ-1;x>=n;--x){var b=_.scaledTo(x);if(o[b.key])break;if(o[b.key]=!0,!(f=this.getTile(b))&&y&&(f=this._addTile(b)),f&&(r[b.key]=b,y=f.wasRequested(),f.hasData()))break}}}return r},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 r=Boolean(i);return r||(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,r||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 r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout(function(){i._reloadTile(t,"expired"),delete i._timers[t];},r));},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 r=[],o=this.getIds(),n=1/0,a=1/0,s=-1/0,l=-1/0,c=0;c=0&&m[1].y+f>=0){for(var g=[],v=0;v=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 Pt(t,e){return t%32-e%32||e-t}function Lt(t){return "raster"===t||"image"===t||"video"===t}function Rt(){return new t.window.Worker($r.workerUrl)}zt.maxOverzooming=10,zt.maxUnderzooming=3;var Dt=function(){this.active={};};Dt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.lengththis.width||r<0||e>this.height)return !o&&[];var a=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=r){if(o)return !0;for(var s=0;s0:a},Wt.prototype._queryCircle=function(t,e,i,r,o){var n=t-i,a=t+i,s=e-i,l=e+i;if(a<0||n>this.width||l<0||s>this.height)return !r&&[];var c=[],u={hitTest:r,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}};return this._forEachCell(n,s,a,l,this._queryCellCircle,c,u,o),r?c.length>0:c},Wt.prototype.query=function(t,e,i,r,o){return this._query(t,e,i,r,!1,o)},Wt.prototype.hitTest=function(t,e,i,r,o){return this._query(t,e,i,r,!0,o)},Wt.prototype.hitTestCircle=function(t,e,i,r){return this._queryCircle(t,e,i,!0,r)},Wt.prototype._queryCell=function(t,e,i,r,o,n,a,s){var l=a.seenUids,c=this.boxCells[o];if(null!==c)for(var u=this.bboxes,h=0,p=c;h=u[_+0]&&r>=u[_+1]&&(!s||s(this.boxKeys[d]))){if(a.hitTest)return n.push(!0),!0;n.push({key:this.boxKeys[d],x1:u[_],y1:u[_+1],x2:u[_+2],y2:u[_+3]});}}}var f=this.circleCells[o];if(null!==f)for(var m=this.circles,g=0,v=f;ga*a+s*s},Wt.prototype._circleAndRectCollide=function(t,e,i,r,o,n,a){var s=(n-r)/2,l=Math.abs(t-(r+s));if(l>s+i)return !1;var c=(a-o)/2,u=Math.abs(e-(o+c));if(u>c+i)return !1;if(l<=s||u<=c)return !0;var h=l-s,p=u-c;return h*h+p*p<=i*i};var Xt=t.properties.layout;function Ht(e,i,r,o,n){var a=t.identity(new Float32Array(16));return i?(t.identity(a),t.scale(a,a,[1/n,1/n,1]),r||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 Kt(e,i,r,o,n){var a=t.identity(new Float32Array(16));return i?(t.multiply(a,a,e),t.scale(a,a,[n,n,1]),r||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 Yt(e,i){var r=[e.x,e.y,0,1];ae(r,r,i);var o=r[3];return {point:new t.Point(r[0]/o,r[1]/o),signedDistanceFromCamera:o}}function Jt(t,e){var i=t[0]/t[3],r=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&r>=-e[1]&&r<=e[1]}function Qt(e,i,r,o,n,a,s,l){var c=o?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,r.transform.zoom,Xt.properties[o?"text-size":"icon-size"]),h=[256/r.width*2+1,256/r.height*2+1],p=o?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var d=e.lineVertexArray,_=o?e.text.placedSymbolArray:e.icon.placedSymbolArray,f=r.transform.width/r.transform.height,m=!1,g=0;g<_.length;g++){var v=_.get(g);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!m)ne(v.numGlyphs,p);else{m=!1;var y=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(y,y,i),Jt(y,h)){var x=.5+y[3]/r.transform.cameraToCenterDistance*.5,b=t.evaluateSizeForFeature(c,u,v),w=s?b*x:b/x,E=new t.Point(v.anchorX,v.anchorY),T=Yt(E,n).point,I={},C=ee(v,w,!1,l,i,n,a,e.glyphOffsetArray,d,p,T,E,I,f);m=C.useVertical,(C.notEnoughRoom||m||C.needsFlipping&&ee(v,w,!0,l,i,n,a,e.glyphOffsetArray,d,p,T,E,I,f).notEnoughRoom)&&ne(v.numGlyphs,p);}else ne(v.numGlyphs,p);}}o?e.text.dynamicLayoutVertexBuffer.updateData(p):e.icon.dynamicLayoutVertexBuffer.updateData(p);}function $t(t,e,i,r,o,n,a,s,l,c,u,h){var p=s.glyphStartIndex+s.numGlyphs,d=s.lineStartIndex,_=s.lineStartIndex+s.lineLength,f=e.getoffsetX(s.glyphStartIndex),m=e.getoffsetX(p-1),g=re(t*f,i,r,o,n,a,s.segment,d,_,l,c,u,h);if(!g)return null;var v=re(t*m,i,r,o,n,a,s.segment,d,_,l,c,u,h);return v?{first:g,last:v}:null}function te(e,i,r,o){if(e===t.WritingMode.horizontal&&Math.abs(r.y-i.y)>Math.abs(r.x-i.x)*o)return {useVertical:!0};return (e===t.WritingMode.vertical?i.yr.x)?{needsFlipping:!0}:null}function ee(e,i,r,o,n,a,s,l,c,u,h,p,d,_){var f,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=$t(m,l,g,v,r,h,p,e,c,a,d,!1);if(!w)return {notEnoughRoom:!0};var E=Yt(w.first.point,s).point,T=Yt(w.last.point,s).point;if(o&&!r){var I=te(e.writingMode,E,T,_);if(I)return I}f=[w.first];for(var C=e.glyphStartIndex+1;C0?L.point:ie(p,P,S,1,n),D=te(e.writingMode,S,R,_);if(D)return D}var M=re(m*l.getoffsetX(e.glyphStartIndex),g,v,r,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,a,d,!1);if(!M)return {notEnoughRoom:!0};f=[M];}for(var A=0,k=f;A0?1:-1,m=0;o&&(f*=-1,m=Math.PI),f<0&&(m+=Math.PI);for(var g=f>0?l+s:l+s+1,v=g,y=n,x=n,b=0,w=0,E=Math.abs(_);b+w<=E;){if((g+=f)=c)return null;if(x=y,void 0===(y=p[g])){var T=new t.Point(u.getx(g),u.gety(g)),I=Yt(T,h);if(I.signedDistanceFromCamera>0)y=p[g]=I.point;else{var C=g-f;y=ie(0===b?a:new t.Point(u.getx(C),u.gety(C)),T,x,E-b+1,h);}}b+=w,w=x.dist(y);}var S=(E-b)/w,z=y.sub(x),P=z.mult(S)._add(x);return P._add(z._unit()._perp()._mult(r*f)),{point:P,angle:m+Math.atan2(y.y-x.y,y.x-x.x),tileDistance:d?{prevTileDistance:g-f===v?0:u.gettileUnitDistanceFromAnchor(g-f),lastSegmentViewportDistance:E-b}:null}}var oe=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ne(t,e){for(var i=0;iS)le(e,z,!1);else{var M=this.projectPoint(c,P,L),A=R*T;if(_.length>0){var k=M.x-_[_.length-4],B=M.y-_[_.length-3];if(A*A*2>k*k+B*B)if(z+8-C&&O=this.screenRightBoundary||r<100||e>this.screenBottomBoundary},se.prototype.isInsideGrid=function(t,e,i,r){return i>=0&&t=0&&e0,T=T&&I.offscreen);var R=L.textCircles;if(R){var D=e.text.placedSymbolArray.get(b.horizontalPlacedTextSymbolIndex),M=t.evaluateSizeForFeature(e.textSizeData,p,D);C=this.collisionIndex.placeCollisionCircles(R,h.get("text-allow-overlap"),n,a,D,e.lineVertexArray,e.glyphOffsetArray,M,i,r,s,"map"===h.get("text-pitch-alignment"),y.predicate),w=h.get("text-allow-overlap")||C.circles.length>0,T=T&&C.offscreen;}L.iconFeatureIndex&&(P=L.iconFeatureIndex),L.iconBox&&(E=(S=this.collisionIndex.placeCollisionBox(L.iconBox,h.get("icon-allow-overlap"),a,i,y.predicate)).box.length>0,T=T&&S.offscreen);var A=d||0===b.numGlyphVertices&&0===b.numVerticalGlyphVertices,k=_||0===b.numIconVertices;A||k?k?A||(E=E&&w):w=E&&w:E=w=E&&w,w&&I&&this.collisionIndex.insertCollisionBox(I.box,h.get("text-ignore-placement"),e.bucketInstanceId,z,y.ID),E&&S&&this.collisionIndex.insertCollisionBox(S.box,h.get("icon-ignore-placement"),e.bucketInstanceId,P,y.ID),w&&C&&this.collisionIndex.insertCollisionCircles(C.circles,h.get("text-ignore-placement"),e.bucketInstanceId,z,y.ID),this.placements[b.crossTileID]=new pe(w||g,E||v,T||e.justReloaded),c[b.crossTileID]=!0;}}e.justReloaded=!1;},fe.prototype.commit=function(t,e){this.commitTime=e;var i=!1,r=t&&0!==this.fadeDuration?(this.commitTime-t.commitTime)/this.fadeDuration:1,o=t?t.opacities:{};for(var n in this.placements){var a=this.placements[n],s=o[n];s?(this.opacities[n]=new he(s,r,a.text,a.icon),i=i||a.text!==s.text.placed||a.icon!==s.icon.placed):(this.opacities[n]=new he(null,r,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 u=new he(c,r,!1,!1);u.isHidden()||(this.opacities[l]=u,i=i||c.text.placed||c.icon.placed);}}i?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e);},fe.prototype.updateLayerOpacities=function(t,e){for(var i={},r=0,o=e;r0||c.numVerticalGlyphVertices>0,d=c.numIconVertices>0;if(p){for(var _=Ie(h.text),f=(c.numGlyphVertices+c.numVerticalGlyphVertices)/4,m=0;m=0&&(t.text.placedSymbolArray.get(c.verticalPlacedTextSymbolIndex).hidden=h.text.isHidden());}if(d){for(var g=Ie(h.icon),v=0;vt},fe.prototype.setStale=function(){this.stale=!0;};var ve=Math.pow(2,25),ye=Math.pow(2,24),xe=Math.pow(2,17),be=Math.pow(2,16),we=Math.pow(2,9),Ee=Math.pow(2,8),Te=Math.pow(2,1);function Ie(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*ve+e*ye+i*xe+e*be+i*we+e*Ee+i*Te+e}var Ce=function(){this._currentTileIndex=0,this._seenCrossTileIDs={};};Ce.prototype.continuePlacement=function(t,e,i,r,o){for(;this._currentTileIndex2};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 Ce),o._inProgressLayer.continuePlacement(r[s.source],o.placement,o._showCollisionBoxes,s,a))return;delete o._inProgressLayer;}o._currentPlacementIndex--;}this._done=!0;},Se.prototype.commit=function(t,e){return this.placement.commit(t,e),this.placement};var ze=512/t.EXTENT/2,Pe=function(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var r=0;rt.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(n)).key];c&&c.findMatches(e.symbolInstances,t,o);}}for(var u=0;u0)throw new Error("Unimplemented: "+o.map(function(t){return t.command}).join(", ")+".");return r.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,r){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,r)){this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);var n=this.sourceCaches[e]=new zt(e,i,this.dispatcher);n.style=this,n.setEventedParent(this,function(){return {isSourceLoaded:o.loaded(),source:n.serialize(),sourceId:e}}),n.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 r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.clearTiles(),r.onRemove&&r.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,r){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 n;if("custom"===e.type){if(Me(this,t.validateCustomStyleLayer(e)))return;n=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},r))return;n=t.createStyleLayer(e),this._validateLayer(n),n.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]=n,this._removedLayers[o]&&n.source&&"custom"!==n.type){var s=this._removedLayers[o];delete this._removedLayers[o],s.type!==n.type?this._updatedSources[n.source]="clear":(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause());}this._updateLayer(n),n.onAdd&&n.onAdd(this.map);}}},i.prototype.moveLayer=function(e,i){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==i){var r=this._order.indexOf(e);this._order.splice(r,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 r=this._order.indexOf(e);this._order.splice(r,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,r){this._checkLoaded();var o=this.getLayer(e);o?o.minzoom===i&&o.maxzoom===r||(null!=i&&(o.minzoom=i),null!=r&&(o.maxzoom=r),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 r=this.getLayer(e);if(r){if(!t.isEqual(r.filter,i))return null==i?(r.filter=void 0,void this._updateLayer(r)):void(this._validate(t.validateStyle.filter,"layers."+r.id+".filter",i)||(r.filter=t.clone(i),this._updateLayer(r)))}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,r){this._checkLoaded();var o=this.getLayer(e);o?t.isEqual(o.getLayoutProperty(i),r)||(o.setLayoutProperty(i,r),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(e,i){var r=this.getLayer(e);if(r)return r.getLayoutProperty(i);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")));},i.prototype.setPaintProperty=function(e,i,r){this._checkLoaded();var o=this.getLayer(e);o?t.isEqual(o.getPaintProperty(i),r)||(o.setPaintProperty(i,r)&&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 r=e.source,o=e.sourceLayer,n=this.sourceCaches[r],a=parseInt(e.id,10);void 0!==n?"vector"!==n.getSource().type||o?isNaN(a)||a<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative."))):n.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 '"+r+"' does not exist in the map's style.")));},i.prototype.getFeatureState=function(e){this._checkLoaded();var i=e.source,r=e.sourceLayer,o=this.sourceCaches[i],n=parseInt(e.id,10);if(void 0!==o)if("vector"!==o.getSource().type||r){if(!(isNaN(n)||n<0))return o.getFeatureState(r,n);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 r=this._order[i],o=0,n=t;o 0.5) {\r\ngl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;\r\n}\r\nif (v_notUsed > 0.5) {gl_FragColor*=.1;\r\n}\r\n}","attribute vec2 a_pos;\r\nattribute vec2 a_anchor_pos;\r\nattribute vec2 a_extrude;\r\nattribute vec2 a_placed;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_extrude_scale;\r\nuniform float u_camera_to_center_distance;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvoid main() {\r\nvec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;\r\nhighp float collision_perspective_ratio=clamp(\r\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);\r\ngl_Position=u_matrix*vec4(a_pos,0.0,1.0);\r\ngl_Position.xy+=a_extrude*u_extrude_scale*gl_Position.w*collision_perspective_ratio;\r\nv_placed=a_placed.x;\r\nv_notUsed=a_placed.y;\r\n}"),We=ui("uniform float u_overscale_factor;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvarying float v_radius;\r\nvarying vec2 v_extrude;\r\nvarying vec2 v_extrude_scale;\r\nvoid main() {\r\nfloat alpha=0.5;vec4 color=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {\r\ncolor=vec4(0.0,0.0,1.0,0.5)*alpha;\r\n}\r\nif (v_notUsed > 0.5) {color*=.2;\r\n}\r\nfloat extrude_scale_length=length(v_extrude_scale);\r\nfloat extrude_length=length(v_extrude)*extrude_scale_length;\r\nfloat stroke_width=15.0*extrude_scale_length/u_overscale_factor;\r\nfloat radius=v_radius*extrude_scale_length;\r\nfloat distance_to_edge=abs(extrude_length-radius);\r\nfloat opacity_t=smoothstep(-stroke_width,0.0,-distance_to_edge);\r\ngl_FragColor=opacity_t*color;\r\n}","attribute vec2 a_pos;\r\nattribute vec2 a_anchor_pos;\r\nattribute vec2 a_extrude;\r\nattribute vec2 a_placed;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_extrude_scale;\r\nuniform float u_camera_to_center_distance;\r\nvarying float v_placed;\r\nvarying float v_notUsed;\r\nvarying float v_radius;\r\nvarying vec2 v_extrude;\r\nvarying vec2 v_extrude_scale;\r\nvoid main() {\r\nvec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;\r\nhighp float collision_perspective_ratio=clamp(\r\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);\r\ngl_Position=u_matrix*vec4(a_pos,0.0,1.0);\r\nhighp float padding_factor=1.2;gl_Position.xy+=a_extrude*u_extrude_scale*padding_factor*gl_Position.w*collision_perspective_ratio;\r\nv_placed=a_placed.x;\r\nv_notUsed=a_placed.y;\r\nv_radius=abs(a_extrude.y);v_extrude=a_extrude*padding_factor;\r\nv_extrude_scale=u_extrude_scale*u_camera_to_center_distance*collision_perspective_ratio;\r\n}"),Xe=ui("uniform highp vec4 u_color;\r\nvoid main() {\r\ngl_FragColor=u_color;\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),He=ui("#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_FragColor=color*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\n}"),Ke=ui("#pragma mapbox: define highp vec4 outline_color\r\n#pragma mapbox: define lowp float opacity\r\nvarying vec2 v_pos;\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 outline_color\r\n#pragma mapbox: initialize lowp float opacity\r\nfloat dist=length(v_pos-gl_FragCoord.xy);\r\nfloat alpha=1.0-smoothstep(0.0,1.0,dist);\r\ngl_FragColor=outline_color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","attribute vec2 a_pos;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define highp vec4 outline_color\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 outline_color\r\n#pragma mapbox: initialize lowp float opacity\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\r\n}"),Ye=ui("uniform vec2 u_texsize;\r\nuniform sampler2D u_image;\r\nuniform float u_fade;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);\r\nfloat alpha=1.0-smoothstep(0.0,1.0,dist);\r\ngl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform vec4 u_scale;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec2 v_pos;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat pixelRatio=u_scale.x;\r\nfloat tileRatio=u_scale.y;\r\nfloat fromScale=u_scale.z;\r\nfloat toScale=u_scale.w;\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nvec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);\r\nvec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);\r\nv_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\r\n}"),Je=ui("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\ngl_FragColor=mix(color1,color2,u_fade)*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform vec4 u_scale;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat pixelRatio=u_scale.x;\r\nfloat tileZoomRatio=u_scale.y;\r\nfloat fromScale=u_scale.z;\r\nfloat toScale=u_scale.w;\r\nvec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);\r\nvec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);\r\n}"),Qe=ui("varying vec4 v_color;\r\nvoid main() {\r\ngl_FragColor=v_color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nuniform float u_vertical_gradient;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec4 v_color;\r\n#pragma mapbox: define highp float base\r\n#pragma mapbox: define highp float height\r\n#pragma mapbox: define highp vec4 color\r\nvoid main() {\r\n#pragma mapbox: initialize highp float base\r\n#pragma mapbox: initialize highp float height\r\n#pragma mapbox: initialize highp vec4 color\r\nvec3 normal=a_normal_ed.xyz;\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=mod(normal.x,2.0);\r\ngl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;\r\nv_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);\r\ncolor+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=(\r\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)));\r\n}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);\r\nv_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);\r\nv_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);\r\n}"),$e=ui("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\n#pragma mapbox: define lowp float base\r\n#pragma mapbox: define lowp float height\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float base\r\n#pragma mapbox: initialize lowp float height\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nvec2 imagecoord=mod(v_pos_a,1.0);\r\nvec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);\r\nvec4 color1=texture2D(u_image,pos);\r\nvec2 imagecoord_b=mod(v_pos_b,1.0);\r\nvec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);\r\nvec4 color2=texture2D(u_image,pos2);\r\nvec4 mixedColor=mix(color1,color2,u_fade);\r\ngl_FragColor=mixedColor*v_lighting;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_pixel_coord_upper;\r\nuniform vec2 u_pixel_coord_lower;\r\nuniform float u_height_factor;\r\nuniform vec4 u_scale;\r\nuniform float u_vertical_gradient;\r\nuniform vec3 u_lightcolor;\r\nuniform lowp vec3 u_lightpos;\r\nuniform lowp float u_lightintensity;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;\r\n#pragma mapbox: define lowp float base\r\n#pragma mapbox: define lowp float height\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float base\r\n#pragma mapbox: initialize lowp float height\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat pixelRatio=u_scale.x;\r\nfloat tileRatio=u_scale.y;\r\nfloat fromScale=u_scale.z;\r\nfloat toScale=u_scale.w;\r\nvec3 normal=a_normal_ed.xyz;\r\nfloat edgedistance=a_normal_ed.w;\r\nvec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);\r\nvec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);\r\nbase=max(0.0,base);\r\nheight=max(0.0,height);\r\nfloat t=mod(normal.x,2.0);\r\nfloat z=t > 0.0 ? height : base;\r\ngl_Position=u_matrix*vec4(a_pos,z,1);\r\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\r\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);\r\nv_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);\r\nv_lighting=vec4(0.0,0.0,0.0,1.0);\r\nfloat directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);\r\ndirectional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);\r\nif (normal.y !=0.0) {directional*=(\r\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)));\r\n}\r\nv_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\r\n}"),ti=ui("uniform sampler2D u_image;\r\nuniform float u_opacity;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_FragColor=texture2D(u_image,v_pos)*u_opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(0.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_world;\r\nattribute vec2 a_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos*u_world,0,1);\r\nv_pos.x=a_pos.x;\r\nv_pos.y=1.0-a_pos.y;\r\n}"),ei=ui("#ifdef GL_ES\r\nprecision highp float;\r\n#endif\r\nuniform sampler2D u_image;\r\nvarying vec2 v_pos;\r\nuniform vec2 u_dimension;\r\nuniform float u_zoom;\r\nuniform float u_maxzoom;\r\nfloat getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;\r\nreturn (data.r+data.g*256.0+data.b*256.0*256.0)/4.0;\r\n}\r\nvoid main() {\r\nvec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);\r\nfloat b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);\r\nfloat c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);\r\nfloat d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);\r\nfloat e=getElevation(v_pos,0.0);\r\nfloat f=getElevation(v_pos+vec2(epsilon.x,0),0.0);\r\nfloat g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);\r\nfloat h=getElevation(v_pos+vec2(0,epsilon.y),0.0);\r\nfloat i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;\r\nvec2 deriv=vec2(\r\n(c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c)\r\n)/ pow(2.0,(u_zoom-u_maxzoom)*exaggeration+19.2562-u_zoom);\r\ngl_FragColor=clamp(vec4(\r\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=(a_texture_pos/8192.0)/2.0+0.25;\r\n}"),ii=ui("uniform sampler2D u_image;\r\nvarying vec2 v_pos;\r\nuniform vec2 u_latrange;\r\nuniform vec2 u_light;\r\nuniform vec4 u_shadow;\r\nuniform vec4 u_highlight;\r\nuniform vec4 u_accent;\r\n#define PI 3.141592653589793\r\nvoid main() {\r\nvec4 pixel=texture2D(u_image,v_pos);\r\nvec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);\r\nfloat aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);\r\nfloat intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;\r\nfloat maxValue=0.5*PI;\r\nfloat scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);\r\nfloat shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);\r\nvec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);\r\ngl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);\r\nv_pos=a_texture_pos/8192.0;\r\n}"),ri=ui("#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/DEVICE_PIXEL_RATIO)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define ANTIALIASING 1.0/DEVICE_PIXEL_RATIO/2.0\n#define scale 0.015873016\r\nattribute vec4 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform vec2 u_gl_units_to_pixels;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_linesofar;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nv_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;\r\nvec2 pos=a_pos_normal.xy;mediump vec2 normal=a_pos_normal.zw;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_gl_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),oi=ui("#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nuniform sampler2D u_image;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_lineprogress;\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/DEVICE_PIXEL_RATIO)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,vec2(v_lineprogress,0.5));\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define ANTIALIASING 1.0/DEVICE_PIXEL_RATIO/2.0\n#define scale 0.015873016\r\nattribute vec4 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform vec2 u_gl_units_to_pixels;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying highp float v_lineprogress;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nv_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;\r\nvec2 pos=a_pos_normal.xy;mediump vec2 normal=a_pos_normal.zw;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_gl_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),ni=ui("uniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform mediump vec4 u_scale;\r\nuniform sampler2D u_image;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\nvoid main() {\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\nvec2 pattern_tl_a=pattern_from.xy;\r\nvec2 pattern_br_a=pattern_from.zw;\r\nvec2 pattern_tl_b=pattern_to.xy;\r\nvec2 pattern_br_b=pattern_to.zw;\r\nfloat pixelRatio=u_scale.x;\r\nfloat tileZoomRatio=u_scale.y;\r\nfloat fromScale=u_scale.z;\r\nfloat toScale=u_scale.w;\r\nvec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);\r\nvec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);\r\nvec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);\r\nvec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/DEVICE_PIXEL_RATIO)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat x_a=mod(v_linesofar/pattern_size_a.x,1.0);\r\nfloat x_b=mod(v_linesofar/pattern_size_b.x,1.0);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);\r\nfloat 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);\r\nvec2 pos_a=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,vec2(x_a,y_a));\r\nvec2 pos_b=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,vec2(x_b,y_b));\r\nvec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);\r\ngl_FragColor=color*alpha*opacity;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\n#define ANTIALIASING 1.0/DEVICE_PIXEL_RATIO/2.0\r\nattribute vec4 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_gl_units_to_pixels;\r\nuniform mediump float u_ratio;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_linesofar;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp vec4 pattern_from\r\n#pragma mapbox: define lowp vec4 pattern_to\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize mediump vec4 pattern_from\r\n#pragma mapbox: initialize mediump vec4 pattern_to\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nfloat a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=a_pos_normal.xy;mediump vec2 normal=a_pos_normal.zw;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_gl_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_linesofar=a_linesofar;\r\nv_width2=vec2(outset,inset);\r\n}"),ai=ui("uniform sampler2D u_image;\r\nuniform float u_sdfgamma;\r\nuniform float u_mix;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/DEVICE_PIXEL_RATIO)*v_gamma_scale;\r\nfloat alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\r\nfloat sdfdist_a=texture2D(u_image,v_tex_a).a;\r\nfloat sdfdist_b=texture2D(u_image,v_tex_b).a;\r\nfloat sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);\r\nalpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);\r\ngl_FragColor=color*(alpha*opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\n#define ANTIALIASING 1.0/DEVICE_PIXEL_RATIO/2.0\r\nattribute vec4 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform vec2 u_patternscale_a;\r\nuniform float u_tex_y_a;\r\nuniform vec2 u_patternscale_b;\r\nuniform float u_tex_y_b;\r\nuniform vec2 u_gl_units_to_pixels;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_tex_a;\r\nvarying vec2 v_tex_b;\r\nvarying float v_gamma_scale;\r\n#pragma mapbox: define highp vec4 color\r\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define mediump float gapwidth\r\n#pragma mapbox: define lowp float offset\r\n#pragma mapbox: define mediump float width\r\n#pragma mapbox: define lowp float floorwidth\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 color\r\n#pragma mapbox: initialize lowp float blur\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize mediump float gapwidth\r\n#pragma mapbox: initialize lowp float offset\r\n#pragma mapbox: initialize mediump float width\r\n#pragma mapbox: initialize lowp float floorwidth\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.0;\r\nfloat a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;\r\nvec2 pos=a_pos_normal.xy;mediump vec2 normal=a_pos_normal.zw;\r\nv_normal=normal;gapwidth=gapwidth/2.0;\r\nfloat halfwidth=width/2.0;\r\noffset=-1.0*offset;\r\nfloat inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);\r\nfloat outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;\r\nmediump float t=1.0-abs(u);\r\nmediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);\r\nvec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);\r\ngl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);\r\nfloat extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_gl_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);\r\nv_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);\r\nv_width2=vec2(outset,inset);\r\n}"),si=ui("uniform float u_fade_t;\r\nuniform float u_opacity;\r\nuniform sampler2D u_image0;\r\nuniform sampler2D u_image1;\r\nvarying vec2 v_pos0;\r\nvarying vec2 v_pos1;\r\nuniform float u_brightness_low;\r\nuniform float u_brightness_high;\r\nuniform float u_saturation_factor;\r\nuniform float u_contrast_factor;\r\nuniform vec3 u_spin_weights;\r\nvoid main() {vec4 color0=texture2D(u_image0,v_pos0);\r\nvec4 color1=texture2D(u_image1,v_pos1);\r\nif (color0.a > 0.0) {\r\ncolor0.rgb=color0.rgb/color0.a;\r\n}\r\nif (color1.a > 0.0) {\r\ncolor1.rgb=color1.rgb/color1.a;\r\n}\r\nvec4 color=mix(color0,color1,u_fade_t);\r\ncolor.a*=u_opacity;\r\nvec3 rgb=color.rgb;rgb=vec3(\r\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;\r\nrgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);\r\nvec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);\r\ngl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","uniform mat4 u_matrix;\r\nuniform vec2 u_tl_parent;\r\nuniform float u_scale_parent;\r\nuniform float u_buffer_scale;\r\nattribute vec2 a_pos;\r\nattribute vec2 a_texture_pos;\r\nvarying vec2 v_pos0;\r\nvarying vec2 v_pos1;\r\nvoid main() {\r\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;\r\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\r\n}"),li=ui("uniform sampler2D u_texture;\r\n#pragma mapbox: define lowp float opacity\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\nlowp float alpha=opacity*v_fade_opacity;\r\ngl_FragColor=texture2D(u_texture,v_tex)*alpha;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;\r\nuniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform float u_fade_change;\r\n#pragma mapbox: define lowp float opacity\r\nuniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_gl_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size[0],a_size[1],u_size_t)/256.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size[0]/256.0;\r\n} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\r\nsize=u_size;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_gl_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);\r\nv_tex=a_tex/u_texsize;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nv_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\n}"),ci=ui("#define SDF_PX 8.0\r\n#define EDGE_GAMMA 0.105/DEVICE_PIXEL_RATIO\r\nuniform bool u_is_halo;\r\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nuniform sampler2D u_texture;\r\nuniform highp float u_gamma_scale;\r\nuniform bool u_is_text;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nvec2 tex=v_data0.xy;\r\nfloat gamma_scale=v_data1.x;\r\nfloat size=v_data1.y;\r\nfloat fade_opacity=v_data1[2];\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nlowp vec4 color=fill_color;\r\nhighp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);\r\nlowp float buff=(256.0-64.0)/256.0;\r\nif (u_is_halo) {\r\ncolor=halo_color;\r\ngamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);\r\nbuff=(6.0-halo_width/fontScale)/SDF_PX;\r\n}\r\nlowp float dist=texture2D(u_texture,tex).a;\r\nhighp float gamma_scaled=gamma*gamma_scale;\r\nhighp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);\r\ngl_FragColor=color*(alpha*opacity*fade_opacity);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","const float PI=3.141592653589793;\r\nattribute vec4 a_pos_offset;\r\nattribute vec4 a_data;\r\nattribute vec3 a_projected_pos;\r\nattribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;\r\nuniform bool u_is_size_feature_constant;\r\nuniform highp float u_size_t;uniform highp float u_size;\n#pragma mapbox: define highp vec4 fill_color\r\n#pragma mapbox: define highp vec4 halo_color\r\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define lowp float halo_width\r\n#pragma mapbox: define lowp float halo_blur\r\nuniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_gl_coord_matrix;\r\nuniform bool u_is_text;\r\nuniform bool u_pitch_with_map;\r\nuniform highp float u_pitch;\r\nuniform bool u_rotate_symbol;\r\nuniform highp float u_aspect_ratio;\r\nuniform highp float u_camera_to_center_distance;\r\nuniform float u_fade_change;\r\nuniform vec2 u_texsize;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\r\nvoid main() {\r\n#pragma mapbox: initialize highp vec4 fill_color\r\n#pragma mapbox: initialize highp vec4 halo_color\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize lowp float halo_width\r\n#pragma mapbox: initialize lowp float halo_blur\r\nvec2 a_pos=a_pos_offset.xy;\r\nvec2 a_offset=a_pos_offset.zw;\r\nvec2 a_tex=a_data.xy;\r\nvec2 a_size=a_data.zw;\r\nhighp float segment_angle=-a_projected_pos[2];\r\nfloat size;\r\nif (!u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=mix(a_size[0],a_size[1],u_size_t)/256.0;\r\n} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {\r\nsize=a_size[0]/256.0;\r\n} else if (!u_is_size_zoom_constant && u_is_size_feature_constant) {\r\nsize=u_size;\r\n} else {\r\nsize=u_size;\r\n}\r\nvec4 projectedPoint=u_matrix*vec4(a_pos,0,1);\r\nhighp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\r\ncamera_to_anchor_distance/u_camera_to_center_distance :\r\nu_camera_to_center_distance/camera_to_anchor_distance;\r\nhighp float perspective_ratio=clamp(\r\n0.5+0.5*distance_ratio,0.0,4.0);\r\nsize*=perspective_ratio;\r\nfloat fontScale=u_is_text ? size/24.0 : size;\r\nhighp float symbol_rotation=0.0;\r\nif (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);\r\nvec2 a=projectedPoint.xy/projectedPoint.w;\r\nvec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;\r\nsymbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);\r\n}\r\nhighp float angle_sin=sin(segment_angle+symbol_rotation);\r\nhighp float angle_cos=cos(segment_angle+symbol_rotation);\r\nmat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);\r\nvec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);\r\ngl_Position=u_gl_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);\r\nfloat gamma_scale=gl_Position.w;\r\nvec2 tex=a_tex/u_texsize;\r\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);\r\nfloat fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;\r\nfloat interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));\r\nv_data0=vec2(tex.x,tex.y);\r\nv_data1=vec3(gamma_scale,size,interpolated_fade_opacity);\r\n}");function ui(t,e){var i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r={};return {fragmentSource:t=t.replace(i,function(t,e,i,o,n){return r[n]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nvarying "+i+" "+o+" "+n+";\n#else\nuniform "+i+" "+o+" u_"+n+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+n+"\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n"}),vertexSource:e=e.replace(i,function(t,e,i,o,n){var a="float"===o?"vec2":"vec4",s=n.match(/color/)?"color":a;return r[n]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float a_"+n+"_t;\nattribute "+i+" "+a+" a_"+n+";\nvarying "+i+" "+o+" "+n+";\n#else\nuniform "+i+" "+o+" u_"+n+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = a_"+n+";\n#else\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = unpack_mix_"+s+"(a_"+n+", a_"+n+"_t);\n#else\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float a_"+n+"_t;\nattribute "+i+" "+a+" a_"+n+";\n#else\nuniform "+i+" "+o+" u_"+n+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+i+" "+o+" "+n+" = a_"+n+";\n#else\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+i+" "+o+" "+n+" = unpack_mix_"+s+"(a_"+n+", a_"+n+"_t);\n#else\n "+i+" "+o+" "+n+" = u_"+n+";\n#endif\n"})}}var hi=Object.freeze({prelude:Fe,background:Ue,backgroundPattern:Ne,circle:je,clippingMask:Ze,heatmap:Ve,heatmapTexture:Ge,collisionBox:qe,collisionCircle:We,debug:Xe,fill:He,fillOutline:Ke,fillOutlinePattern:Ye,fillPattern:Je,fillExtrusion:Qe,fillExtrusionPattern:$e,extrusionTexture:ti,hillshadePrepare:ei,hillshade:ii,line:ri,lineGradient:oi,linePattern:ni,lineSDF:ai,raster:si,symbolIcon:li,symbolSDF:ci}),pi=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null;};pi.prototype.bind=function(t,e,i,r,o,n,a,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==r.length,c=0;!l&&c>16,l>>16],u_pixel_coord_lower:[65535&s,65535&l]}}di.prototype.draw=function(t,e,i,r,o,n,a,s,l,c,u,h,p,d,_,f){var m,g=t.gl;for(var v in t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(o),t.setCullFace(n),this.fixedUniforms)this.fixedUniforms[v].set(a[v]);d&&d.setUniforms(t,this.binderUniforms,h,{zoom:p});for(var y=(m={},m[g.LINES]=2,m[g.TRIANGLES]=3,m[g.LINE_STRIP]=1,m)[e],x=0,b=u.get();x0?1-1/(1.001-a):-a),u_contrast_factor:(n=o.paint.get("raster-contrast"),n>0?1/(1-n):1+n),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 n,a;};var Fi=function(t,e,i,r,o,n,a,s,l,c){var u=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:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:u.width/u.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:n,u_label_plane_matrix:a,u_gl_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+r,u_texsize:c,u_texture:0}},Ui=function(e,i,r,o,n,a,s,l,c,u,h){var p=n.transform;return t.extend(Fi(e,i,r,o,n,a,s,l,c,u),{u_gamma_scale:o?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_is_halo:+h})},Ni=function(t,e,i){return {u_matrix:t,u_opacity:e,u_color:i}},ji=function(e,i,r,o,n,a){return t.extend(function(t,e,i,r){var o=i.imageManager.getPattern(t.from),n=i.imageManager.getPattern(t.to),a=i.imageManager.getPixelSize(),s=a.width,l=a.height,c=Math.pow(2,r.tileID.overscaledZ),u=r.tileSize*Math.pow(2,i.transform.tileZoom)/c,h=u*(r.tileID.canonical.x+r.tileID.wrap*c),p=u*r.tileID.canonical.y;return {u_image:0,u_pattern_tl_a:o.tl,u_pattern_br_a:o.br,u_pattern_tl_b:n.tl,u_pattern_br_b:n.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:o.displaySize,u_pattern_size_b:n.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/ce(r,1,i.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(o,a,r,n),{u_matrix:e,u_opacity:i})},Zi={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:Ei,collisionCircle:Ei,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 Vi(e,i){for(var r=e.sort(function(t,e){return t.tileID.isLessThan(e.tileID)?-1:e.tileID.isLessThan(t.tileID)?1:0}),o=0;o0){var s=t.browser.now(),l=(s-e.timeAdded)/a,c=i?(s-i.timeAdded)/a:-1,u=r.getSource(),h=n.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),p=!i||Math.abs(i.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),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 ir(e,i,r){var o=e.context,n=o.gl,a=r.posMatrix,s=e.useProgram("debug"),l=Et.disabled,c=Tt.disabled,u=e.colorModeForRenderPass(),h="$debug";s.draw(o,n.LINE_STRIP,l,c,u,Ct.disabled,Ii(a,t.Color.red),h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);for(var p=function(t,e,i,r){r=r||1;var o,n,a,s,l,c,u,h,p=[];for(o=0,n=t.length;o":[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 or={symbol:function(t,e,i,r){if("translucent"===t.renderPass){var o=Tt.disabled,n=t.colorModeForRenderPass();0!==i.paint.get("icon-opacity").constantOr(1)&&Hi(t,e,i,r,!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,n),0!==i.paint.get("text-opacity").constantOr(1)&&Hi(t,e,i,r,!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,n),e.map.showCollisionBoxes&&function(t,e,i,r){qi(t,e,i,r,!1),qi(t,e,i,r,!0);}(t,e,i,r);}},circle:function(t,e,i,r){if("translucent"===t.renderPass){var o=i.paint.get("circle-opacity"),n=i.paint.get("circle-stroke-width"),a=i.paint.get("circle-stroke-opacity");if(0!==o.constantOr(1)||0!==n.constantOr(1)&&0!==a.constantOr(1))for(var s=t.context,l=s.gl,c=t.depthModeForSublayer(0,Et.ReadOnly),u=Tt.disabled,h=t.colorModeForRenderPass(),p=0;pe.y){var i=t;t=e,e=i;}return {x0:t.x,y0:t.y,x1:e.x,y1:e.y,dx:e.x-t.x,dy:e.y-t.y}}function sr(t,e,i,r,o){var n=Math.max(i,Math.floor(e.y0)),a=Math.min(r,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,h=e.dx<0,p=n;pl.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&&sr(c,s,r,o,n),l.dy&&sr(c,l,r,o,n);}nr.prototype.resize=function(e,i){var r=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,n=this.style._order;o=0;this.currentLayer--){var I=this.style._layers[r[this.currentLayer]],C=o[I.source],S=l[I.source];I.source!==s&&C&&(this.clearStencil(),C.getSource().isTileClipped&&this._renderTileClippingMasks(S)),this.renderLayer(this,C,I,S),s=I.source;}for(this.renderPass="translucent",this.currentLayer=0,s=null;this.currentLayer0?e.pop():null},nr.prototype.isPatternMissing=function(t){if(!t)return !1;var e=this.imageManager.getPattern(t.from),i=this.imageManager.getPattern(t.to);return !e||!i},nr.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 di(this.context,hi[t],e,Zi[t],this._showOverdrawInspector)),this.cache[i]},nr.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();},nr.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 cr=function(e,i,r){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===r||r,this._minZoom=e||0,this._maxZoom=i||22,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={},this._alignedPosMatrixCache={};},ur={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},point:{configurable:!0}};cr.prototype.clone=function(){var t=new cr(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},ur.minZoom.get=function(){return this._minZoom},ur.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t));},ur.maxZoom.get=function(){return this._maxZoom},ur.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t));},ur.renderWorldCopies.get=function(){return this._renderWorldCopies},ur.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t;},ur.worldSize.get=function(){return this.tileSize*this.scale},ur.centerPoint.get=function(){return this.size._div(2)},ur.size.get=function(){return new t.Point(this.width,this.height)},ur.bearing.get=function(){return -this.angle/Math.PI*180},ur.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));},ur.pitch.get=function(){return this._pitch/Math.PI*180},ur.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());},ur.fov.get=function(){return this._fov/Math.PI*180},ur.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());},ur.zoom.get=function(){return this._zoom},ur.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());},ur.center.get=function(){return this._center},ur.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices());},cr.prototype.coveringZoomLevel=function(t){return (t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},cr.prototype.getVisibleUnwrappedCoordinates=function(e){var i=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new t.Point(0,0)),o=this.pointCoordinate(new t.Point(this.width,0)),n=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(r.x,o.x,n.x,a.x)),l=Math.floor(Math.max(r.x,o.x,n.x,a.x)),c=s-1;c<=l+1;c++)0!==c&&i.push(new t.UnwrappedTileID(c,e));return i},cr.prototype.coveringTiles=function(e){var i=this.coveringZoomLevel(e),r=i;if(void 0!==e.minzoom&&ie.maxzoom&&(i=e.maxzoom);var o=t.MercatorCoordinate.fromLngLat(this.center),n=Math.pow(2,i),a=new t.Point(n*o.x-.5,n*o.y-.5);return function(e,i,r,o){void 0===o&&(o=!0);var n=1<=0&&l<=n)for(c=i;ca&&(o=a-m);}if(this.lngRange){var g=d.x,v=c.x/2;g-vl&&(r=l-v);}void 0===r&&void 0===o||(this.center=this.unproject(new t.Point(void 0!==r?r:d.x,void 0!==o?o:d.y))),this._unmodified=u,this._constraining=!1;}},cr.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,r=Math.sin(e)*this.cameraToCenterDistance/Math.sin(Math.PI-i-e),o=this.point,n=o.x,a=o.y,s=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),l=new Float64Array(16);t.perspective(l,this._fov,this.width/this.height,1,s),t.scale(l,l,[1,-1,1]),t.translate(l,l,[0,0,-this.cameraToCenterDistance]),t.rotateX(l,l,this._pitch),t.rotateZ(l,l,this.angle),t.translate(l,l,[-n,-a,0]),this.mercatorMatrix=t.scale([],l,[this.worldSize,this.worldSize,this.worldSize]);var c=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));"m"===this.units&&(c=this.worldSize/(this.latRange[1]-this.latRange[0])),t.scale(l,l,[1,1,c,1]),this.projMatrix=l;var u=this.width%2/2,h=this.height%2/2,p=Math.cos(this.angle),d=Math.sin(this.angle),_=n-Math.round(n)+p*u+d*h,f=a-Math.round(a)+p*h+d*u,m=new Float64Array(l);if(t.translate(m,m,[_>.5?_-1:_,f>.5?f-1:f,0]),this.alignedProjMatrix=m,l=t.create(),t.scale(l,l,[this.width/2,-this.height/2,1]),t.translate(l,l,[1,-1,0]),this.pixelMatrix=t.multiply(new Float64Array(16),l,this.projMatrix),!(l=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={};}},cr.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),i=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(i,i,this.pixelMatrix)[3]/this.cameraToCenterDistance},Object.defineProperties(cr.prototype,ur);var hr=function(){var e,i,r,o,n;t.bindAll(["_onHashChange","_updateHash"],this),this._updateHash=(e=this._updateHashUnthrottled.bind(this),i=300,r=!1,o=0,n=function(){o=0,r&&(e(),o=setTimeout(n,i),r=!1);},function(){return r=!0,o||n(),o});};hr.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},hr.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},hr.prototype.getHashString=function(t){var e=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,r=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,r),n=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?"#/"+n+"/"+a+"/"+i:"#"+i+"/"+a+"/"+n,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+="/"+Math.round(l)),c},hr.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)},hr.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e);}catch(t){}};var pr=function(e){function r(r,o,n,a){void 0===a&&(a={});var s=i.mousePos(o.getCanvasContainer(),n),l=o.unproject(s);e.call(this,r,t.extend({point:s,lngLat:l,originalEvent:n},a)),this._defaultPrevented=!1,this.target=o;}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var o={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0;},o.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,o),r}(t.Event),dr=function(e){function r(r,o,n){var a=i.touchPos(o.getCanvasContainer(),n),s=a.map(function(t){return o.unproject(t)}),l=a.reduce(function(t,e,i,r){return t.add(e.div(r.length))},new t.Point(0,0)),c=o.unproject(l);e.call(this,r,{points:a,point:l,lngLats:s,lngLat:c,originalEvent:n}),this._defaultPrevented=!1;}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var o={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0;},o.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,o),r}(t.Event),_r=function(t){function e(e,i,r){t.call(this,e,{originalEvent:r}),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),fr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this);};fr.prototype.isEnabled=function(){return !!this._enabled},fr.prototype.isActive=function(){return !!this._active},fr.prototype.isZooming=function(){return !!this._zooming},fr.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around);},fr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},fr.prototype.onWheel=function(e){if(this.isEnabled()){var i=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,r=t.browser.now(),o=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,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();}},fr.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t);},fr.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this._zooming=!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 r=i.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame));}},fr.prototype._onScrollFrame=function(){var e=this;if(this._frameId=null,this.isActive()){var i=this._map.transform;if(0!==this._delta){var r="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?1/450:.01,o=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==o&&(o=1/o);var n="number"==typeof this._targetZoom?i.zoomScale(this._targetZoom):i.scale;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom(n*o))),this._map.isIntScrollZoom&&(this._targetZoom=this._delta>0?Math.ceil(this._targetZoom):Math.floor(this._targetZoom)),"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 u=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),h=l(u);i.zoom=t.number(s,a,h),u<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._zooming=!1,e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom;},200));}},fr.prototype._smoothOutEasing=function(e){var i=t.ease;if(this._prevEase){var r=this._prevEase,o=(t.browser.now()-r.start)/r.duration,n=r.easing(o+.01)-r.easing(o),a=.27/Math.sqrt(n*n+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 mr=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);};mr.prototype.isEnabled=function(){return !!this._enabled},mr.prototype.isActive=function(){return !!this._active},mr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0);},mr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},mr.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);},mr.prototype._onMouseMove=function(t){var e=i.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)180&&(d=180);var _=d/180;c+=h*d*(_/2),Math.abs(i._normalizeBearing(c,0))0&&i-e[0][0]>160;)e.shift();};var yr=t.bezier(0,0,.3,1),xr=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);};xr.prototype.isEnabled=function(){return "disabled"!==this._state},xr.prototype.isActive=function(){return "active"===this._state},xr.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled");},xr.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";}},xr.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)));},xr.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)));},xr.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]];},xr.prototype._onMove=function(e){e.preventDefault();var r=i.mousePos(this._el,e);this._lastPos.equals(r)||"pending"===this._state&&r.dist(this._mouseDownPos)1400&&(s=1400,a._unit()._mult(s));var l=s/750,c=a.mult(-l/2);this._map.panBy(c,{duration:1e3*l,easing:yr,noMoveStart:!0},{originalEvent:t});}}},xr.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,i?{originalEvent:i}:{}))},xr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,i=t.browser.now();e.length>0&&i-e[0][0]>160;)e.shift();};var br=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this);};function wr(t){return t*(2-t)}br.prototype.isEnabled=function(){return !!this._enabled},br.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0);},br.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1);},br.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,i=0,r=0,o=0,n=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?r=1:(t.preventDefault(),n=-1);break;case 40:t.shiftKey?r=-1:(n=1,t.preventDefault());break;default:return}var a=this._map,s=a.getZoom(),l={duration:300,delayEndEvents:500,easing:wr,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:a.getBearing()+15*i,pitch:a.getPitch()+10*r,offset:[100*-o,100*-n],center:a.getCenter()};a.easeTo(l,{originalEvent:t});}};var Er=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this);};Er.prototype.isEnabled=function(){return !!this._enabled},Er.prototype.isActive=function(){return !!this._active},Er.prototype.enable=function(){this.isEnabled()||(this._enabled=!0);},Er.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},Er.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)));},Er.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t));},Er.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);},Er.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd);};var Tr=t.bezier(0,0,.15,1),Ir=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this);};Ir.prototype.isEnabled=function(){return !!this._enabled},Ir.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around);},Ir.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1);},Ir.prototype.disableRotation=function(){this._rotationDisabled=!0;},Ir.prototype.enableRotation=function(){this._rotationDisabled=!1;},Ir.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var r=i.mousePos(this._el,e.touches[0]),o=i.mousePos(this._el,e.touches[1]),n=r.add(o).div(2);this._startVec=r.sub(o),this._startAround=this._map.transform.pointLocation(n),this._gestureIntent=void 0,this._inertia=[],i.addEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),i.addEventListener(t.window.document,"touchend",this._onEnd);}},Ir.prototype._getTouchEventData=function(t){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),o=e.sub(r);return {vec:o,center:e.add(r).div(2),scale:o.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI}},Ir.prototype._onMove=function(e){if(2===e.touches.length){var i=this._getTouchEventData(e),r=i.vec,o=i.scale,n=i.bearing;if(!this._gestureIntent){var a=Math.abs(1-o)>.15;Math.abs(n)>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=r);}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault();}},Ir.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 r=this._getTouchEventData(this._lastTouchEvent),o=r.center,n=r.bearing,a=r.scale,s=i.pointLocation(o),l=i.locationPoint(s);"rotate"===e&&(i.bearing=this._startBearing+n),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]);}},Ir.prototype._onEnd=function(e){i.removeEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),i.removeEventListener(t.window.document,"touchend",this._onEnd);var r=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,r){this._map.fire(new t.Event(r+"end",{originalEvent:e})),this._drainInertiaBuffer();var n=this._inertia,a=this._map;if(n.length<2)a.snapToNorth({},{originalEvent:e});else{var s=n[n.length-1],l=n[0],c=a.transform.scaleZoom(o*s[1]),u=a.transform.scaleZoom(o*l[1]),h=c-u,p=(s[0]-l[0])/1e3,d=s[2];if(0!==p&&c!==u){var _=.15*h/p;Math.abs(_)>2.5&&(_=_>0?2.5:-2.5);var f=1e3*Math.abs(_/(12*.15)),m=c+_*f/2e3;m<0&&(m=0),a.easeTo({zoom:m,duration:f,easing:Tr,around:this._aroundCenter?a.getCenter():a.unproject(d),noMoveStart:!0},{originalEvent:e});}else a.snapToNorth({},{originalEvent:e});}}},Ir.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,i=t.browser.now();e.length>2&&i-e[0][0]>160;)e.shift();};var Cr={scrollZoom:fr,boxZoom:mr,dragRotate:vr,dragPan:xr,keyboard:br,doubleClickZoom:Er,touchZoomRotate:Ir};var Sr=function(e){function i(i,r){e.call(this),this._moving=!1,this._zooming=!1,this.transform=i,this._bearingSnap=r.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,r){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},i),r)},i.prototype.panTo=function(e,i,r){return this.easeTo(t.extend({center:e},i),r)},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,r){return this.easeTo(t.extend({zoom:e},i),r)},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,r){return this.easeTo(t.extend({bearing:e},i),r)},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())e?1:0}),["bottom","left","right","top"])){var a=this.transform,s=a.project(t.LngLat.convert(e)),l=a.project(t.LngLat.convert(i)),c=s.rotate(-r*Math.PI/180),u=l.rotate(-r*Math.PI/180),h=new t.Point(Math.max(c.x,u.x),Math.max(c.y,u.y)),p=new t.Point(Math.min(c.x,u.x),Math.min(c.y,u.y)),d=h.sub(p),_=(a.width-o.padding.left-o.padding.right)/d.x,f=(a.height-o.padding.top-o.padding.bottom)/d.y;if(!(f<0||_<0)){var m=Math.min(a.scaleZoom(a.scale*Math.min(_,f)),o.maxZoom);this.isIntScrollZoom&&(m=Math.floor(m));var g=t.Point.convert(o.offset),v=(o.padding.left-o.padding.right)/2,y=(o.padding.top-o.padding.bottom)/2,x=new t.Point(g.x+v,g.y+y).mult(a.scale/a.zoomScale(m));return {center:a.unproject(s.add(l).div(2).sub(x)),zoom:m,bearing:r}}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,r,o,n){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(i)),r,o),o,n)},i.prototype._fitInternal=function(e,i,r){return e?(i=t.extend(e,i)).linear?this.easeTo(i,r):this.flyTo(i,r):this},i.prototype.jumpTo=function(e,i){this.stop();var r=this.transform,o=!1,n=!1,a=!1;return "zoom"in e&&r.zoom!==+e.zoom&&(o=!0,r.zoom=+e.zoom),void 0!==e.center&&(r.center=t.LngLat.convert(e.center)),"bearing"in e&&r.bearing!==+e.bearing&&(n=!0,r.bearing=+e.bearing),"pitch"in e&&r.pitch!==+e.pitch&&(a=!0,r.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)),n&&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 r=this;this.stop(),!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate&&(e.duration=0);var o=this.transform,n=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l="zoom"in e?+e.zoom:n,c="bearing"in e?this._normalizeBearing(e.bearing,a):a,u="pitch"in e?+e.pitch:s,h=o.centerPoint.add(t.Point.convert(e.offset)),p=o.pointLocation(h),d=t.LngLat.convert(e.center||p);this._normalizeCenter(d);var _,f,m=o.project(p),g=o.project(d).sub(m),v=o.zoomScale(l-n);return e.around&&(_=t.LngLat.convert(e.around),f=o.locationPoint(_)),this._zooming=l!==n,this._rotating=a!==c,this._pitching=u!==s,this._prepareEase(i,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease(function(e){if(r._zooming&&(o.zoom=t.number(n,l,e)),r._rotating&&(o.bearing=t.number(a,c,e)),r._pitching&&(o.pitch=t.number(s,u,e)),_)o.setLocationAtPoint(_,f);else{var p=o.zoomScale(o.zoom-n),d=l>n?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,h);}r._fireMoveEvents(i);},function(){e.delayEndEvents?r._easeEndTimeoutID=setTimeout(function(){return r._afterEase(i)},e.delayEndEvents):r._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,r=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)),r&&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 r=this;this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,n=this.getZoom(),a=this.getBearing(),s=this.getPitch(),l="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):n,c="bearing"in e?this._normalizeBearing(e.bearing,a):a,u="pitch"in e?+e.pitch:s,h=o.zoomScale(l-n),p=o.centerPoint.add(t.Point.convert(e.offset)),d=o.pointLocation(p),_=t.LngLat.convert(e.center||d);this._normalizeCenter(_);var f=o.project(d),m=o.project(_).sub(f),g=e.curve,v=Math.max(o.width,o.height),y=v/h,x=m.mag();if("minZoom"in e){var b=t.clamp(Math.min(e.minZoom,n,l),o.minZoom,o.maxZoom),w=v/o.zoomScale(b-n);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 I(t){return (Math.exp(t)-Math.exp(-t))/2}function C(t){return (Math.exp(t)+Math.exp(-t))/2}var S=T(0),z=function(t){return C(S)/C(S+g*t)},P=function(t){return v*((C(S)*(I(e=S+g*t)/C(e))-I(S))/E)/x;var e;},L=(T(1)-S)/g;if(Math.abs(x)<1e-6||!isFinite(L)){if(Math.abs(v-y)<1e-6)return this.easeTo(e,i);var R=ye.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=a!==c,this._pitching=u!==s,this._prepareEase(i,!1),this._ease(function(e){var h=e*L,d=1/z(h);o.zoom=1===e?l:n+o.scaleZoom(d),r._rotating&&(o.bearing=t.number(a,c,e)),r._pitching&&(o.pitch=t.number(s,u,e));var g=1===e?_:o.unproject(f.add(m.mult(P(h))).mult(d));o.setLocationAtPoint(o.renderWorldCopies?g.wrap():g,p),r._fireMoveEvents(i);},function(){return r._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,r){!1===r.animate||0===r.duration?(e(1),i()):(this._easeStart=t.browser.now(),this._easeOptions=r,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 r=Math.abs(e-i);return Math.abs(e-360-i)180?-360:i<-180?360:0;}},i}(t.Evented),zr=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this);};zr.prototype.getDefaultPosition=function(){return "bottom-right"},zr.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("styledata",this._updateData),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},zr.prototype.onRemove=function(){i.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0;},zr.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:t.config.ACCESS_TOKEN}];if(e){var r=i.reduce(function(t,e,r){return e.value&&(t+=e.key+"="+e.value+(r"+t+"

"})):"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 r in i){var o=i[r];if(o.used){var n=o.getSource();n.attribution&&t.indexOf(n.attribution)<0&&t.push(n.attribution);}}t.sort(function(t,e){return t.length-e.length}),(t=t.filter(function(e,i){for(var r=i+1;r=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;}},zr.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact");};var Pr=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this);};Pr.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},Pr.prototype.onRemove=function(){i.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact);},Pr.prototype.getDefaultPosition=function(){return "bottom-left"},Pr.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none");},Pr.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}},Pr.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 Lr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1;};Lr.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Lr.prototype.remove=function(t){for(var e=this._currentlyRunning,i=0,r=e?this._queue.concat(e):this._queue;ie.maxZoom)throw new Error("maxZoom must be greater than minZoom");var n=new cr(e.minZoom,e.maxZoom,e.renderWorldCopies);r.call(this,n,e),this.transform=n,this.crs=this.initCRS(e.crs),this.setCRS(this.crs),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 Lr,this._controls=[],this._mapId=t.uniqueId();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 Mr))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container;}if(this.isIntScrollZoom=e.isIntScrollZoom,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 r=t.getCanvasContainer(),o=null,n=!1,a=null;for(var s in Cr)t[s]=new Cr[s](t,e),e.interactive&&e[s]&&t[s].enable(e[s]);i.addEventListener(r,"mouseout",function(e){t.fire(new pr("mouseout",t,e));}),i.addEventListener(r,"mousedown",function(o){n=!0,a=i.mousePos(r,o);var s=new pr("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(r,"mouseup",function(e){var i=t.dragRotate.isActive();o&&!i&&t.fire(new pr("contextmenu",t,o)),o=null,n=!1,t.fire(new pr("mouseup",t,e));}),i.addEventListener(r,"mousemove",function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var i=e.target;i&&i!==r;)i=i.parentNode;i===r&&t.fire(new pr("mousemove",t,e));}}),i.addEventListener(r,"mouseover",function(e){for(var i=e.target;i&&i!==r;)i=i.parentNode;i===r&&t.fire(new pr("mouseover",t,e));}),i.addEventListener(r,"touchstart",function(i){var r=new dr("touchstart",t,i);t.fire(r),r.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(i),t.touchZoomRotate.onStart(i),t.doubleClickZoom.onTouchStart(r));},{passive:!1}),i.addEventListener(r,"touchmove",function(e){t.fire(new dr("touchmove",t,e));},{passive:!1}),i.addEventListener(r,"touchend",function(e){t.fire(new dr("touchend",t,e));}),i.addEventListener(r,"touchcancel",function(e){t.fire(new dr("touchcancel",t,e));}),i.addEventListener(r,"click",function(o){var n=i.mousePos(r,o);(n.equals(a)||n.dist(a)-1&&this._controls.splice(i,1),e.onRemove(this),this},o.prototype.resize=function(e){var i=this._containerDimensions(),r=i[0],o=i[1];return this._resizeCanvas(r,o),this.transform.resize(r,o),this.painter.resize(r,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(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},o.prototype.setMinZoom=function(t){if((t=null==t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=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(e){return this.transform.locationPoint(t.LngLat.convert(e))},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.isZooming()},o.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},o.prototype.on=function(t,e,i){var o,n=this;if(void 0===i)return r.prototype.on.call(this,t,e);var a=function(){if("mouseenter"===t||"mouseover"===t){var r=!1;return {layer:e,listener:i,delegates:{mousemove:function(o){var a=n.getLayer(e)?n.queryRenderedFeatures(o.point,{layers:[e]}):[];a.length?r||(r=!0,i.call(n,new pr(t,n,o.originalEvent,{features:a}))):r=!1;},mouseout:function(){r=!1;}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return {layer:e,listener:i,delegates:{mousemove:function(r){(n.getLayer(e)?n.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,i.call(n,new pr(t,n,r.originalEvent)));},mouseout:function(e){a&&(a=!1,i.call(n,new pr(t,n,e.originalEvent)));}}}}return {layer:e,listener:i,delegates:(o={},o[t]=function(t){var r=n.getLayer(e)?n.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,i.call(n,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)n.on(s,a.delegates[s]);return this},o.prototype.off=function(t,e,i){if(void 0===i)return r.prototype.off.call(this,t,e);if(this._delegatedListeners&&this._delegatedListeners[t])for(var o=this._delegatedListeners[t],n=0;n=i&&t.x=n&&t.y180;){var s=r.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=r.width&&s.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360;}return e}Fr.prototype._rotateCompassArrow=function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t;},Fr.prototype.onAdd=function(t){return this._map=t,this.options.showCompass&&(this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new vr(t,{button:"left",element:this._compass}),i.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),this._handler.enable()),this._container},Fr.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;},Fr.prototype._createButton=function(t,e,r){var o=i.create("button",t,this._container);return o.type="button",o.title=e,o.setAttribute("aria-label",e),o.addEventListener("click",r),o};var Nr={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 jr(t,e,i){var r=t.classList;for(var o in Nr)r.remove("mapboxgl-"+i+"-anchor-"+o);r.add("mapboxgl-"+i+"-anchor-"+e);}var Zr,Vr=function(e){function r(r,o){if(e.call(this),(r instanceof t.window.HTMLElement||o)&&(r=t.extend({element:r},o)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._draggable=r&&r.draggable||!1,this._state="inactive",r&&r.element)this._element=r.element,this._offset=t.Point.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=i.create("div");var n=i.createNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS(null,"height","41px"),n.setAttributeNS(null,"width","27px"),n.setAttributeNS(null,"viewBox","0 0 27 41");var a=i.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");var s=i.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var l=i.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var c=0,u=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];c5280)Kr(e,c,p/5280,"mi");else Kr(e,c,p,"ft");}else if(i&&"nautical"===i.unit){Kr(e,c,h/1852,"nm");}else Kr(e,c,h,"m");}function Kr(t,e,i,r){var o,n,a,s=(o=i,n=Math.pow(10,(""+Math.floor(o)).length-1),a=(a=o/n)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a),n*a),l=s/i;"m"===r&&s>=1e3&&(s/=1e3,r="km"),t.style.width=e*l+"px",t.innerHTML=s+r;}Xr.prototype.getDefaultPosition=function(){return "bottom-left"},Xr.prototype._onMove=function(){Hr(this._map,this._container,this.options);},Xr.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},Xr.prototype.onRemove=function(){i.remove(this._container),this._map.off("move",this._onMove),this._map=void 0;},Xr.prototype.setUnit=function(t){this.options.unit=t,Hr(this._map,this._container,this.options);};var Yr=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";};Yr.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},Yr.prototype.onRemove=function(){i.remove(this._container),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon);},Yr.prototype._checkFullscreenSupport=function(){return !!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Yr.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);},Yr.prototype._isFullscreen=function(){return this._fullscreen},Yr.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"));},Yr.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 Jr={closeButton:!0,closeOnClick:!0,className:"",showArrow:!0,contentClass:null},Qr=function(e){function r(i){e.call(this),this.options=t.extend(Object.create(Jr),i),t.bindAll(["_update","_onClickClose"],this);}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.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},r.prototype.isOpen=function(){return !!this._map},r.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},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._update(),this},r.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},r.prototype.setHTML=function(e){var i,r=t.window.document.createDocumentFragment(),o=t.window.document.createElement("body");for(o.innerHTML=e;i=o.firstChild;)r.appendChild(i);return this.setDOMContent(r)},r.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},r.prototype._createContent=function(){this._content&&i.remove(this._content);var t=this.options.contentClass?" "+this.options.contentClass:"";this._content=i.create("div","mapboxgl-popup-content"+t,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="×",this._closeButton.addEventListener("click",this._onClickClose));},r.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=Ur(this._lngLat,this._pos,this._map.transform));var r=this._pos=this._map.project(this._lngLat),o=this.options.anchor,n=function e(i){if(i){if("number"==typeof i){var r=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(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-i),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),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=r.y+n.bottom.ythis._map.transform.height-l?["bottom"]:[],r.xthis._map.transform.width-s/2&&a.push("right"),o=0===a.length?"bottom":a.join("-");}var c=r.add(n[o]).round();i.setTransform(this._container,Nr[o]+" translate("+c.x+"px,"+c.y+"px)"),jr(this._container,o,"popup");}},r.prototype._onClickClose=function(){this.remove();},r}(t.Evented);var $r={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,Map:kr,NavigationControl:Fr,GeolocateControl:qr,AttributionControl:zr,ScaleControl:Xr,FullscreenControl:Yr,Popup:Qr,Marker:Vr,Style:Be,LngLat:t.LngLat,CRS:Rr,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e;},get workerCount(){return Dt.workerCount},set workerCount(t){Dt.workerCount=t;},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e;},workerUrl:""};return $r}); // if (window) { window.mapboxgl =mapboxgl; } return mapboxgl; }))); //# sourceMappingURL=mapbox-gl.js.map