/* Mapbox GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/mapbox/mapbox-gl-js/blob/v1.3.2/LICENSE.txt */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = global || self, 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;r=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function u(t,e,n,i){var a=new r(t,e,n,i);return function(t){return a.solve(t)}}a.prototype={clone:function(){return new a(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),a=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(t){return t instanceof a?t:Array.isArray(t)?new a(t[0],t[1]):t};var l=u(.25,.1,.25,1);function p(t,e,r){return Math.min(r,Math.max(e,t))}function c(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}function h(t,e,r){if(!t.length)return r(null,[]);var n=t.length,i=new Array(t.length),a=null;t.forEach(function(t,o){e(t,function(t,e){t&&(a=t),i[o]=e,0==--n&&r(a,i);});});}function f(t){var e=[];for(var r in t)e.push(t[r]);return e}function y(t,e){var r=[];for(var n in t)n in e||r.push(n);return r}function d(t){for(var e=[],r=arguments.length-1;r-- >0;)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 b(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 _(t,e){t.forEach(function(t){e[t]&&(e[t]=e[t].bind(e));});}function w(t,e){return -1!==t.indexOf(e,t.length-e.length)}function A(t,e,r){var n={};for(var i in t)n[i]=e.call(r||this,t[i],i,t);return n}function S(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 k(t){return Array.isArray(t)?t.map(k):"object"==typeof t&&t?A(t,k):t}function z(t,e){for(var r=0;r=0)return !0;return !1}var I={};function E(t){I[t]||("undefined"!=typeof console&&console.warn(t),I[t]=!0);}function M(t,e,r){return (r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function C(t){for(var e=0,r=0,n=t.length,i=n-1,a=void 0,o=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\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}function T(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return !1}}function V(t){return self.btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode(Number("0x"+e))}))}function F(t){return decodeURIComponent(self.atob(t).split("").map(function(t){return "%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var O,L,D,R,j=Object.freeze({easeCubicInOut:s,bezier:u,ease:l,clamp:p,wrap:c,asyncAll:h,values:f,keysDifference:y,extend:d,pick:m,uniqueId:g,uuid:x,validateUuid:b,bindAll:_,endsWith:w,mapObject:A,filterObject:S,deepEqual:o,clone:k,arraysIntersect:z,warnOnce:E,isCounterClockwise:M,calculateSignedArea:C,isClosedPolygon:function(t){if(t.length<4)return !1;var e=t[0],r=t[t.length-1];return !(Math.abs(e.x-r.x)>0||Math.abs(e.y-r.y)>0)&&Math.abs(C(t))>.01},sphericalToCartesian:P,parseCacheControl:B,storageAvailable:T,b64EncodeUnicode:V,b64DecodeUnicode:F}),U=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),q=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,N=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,X={now:U,frame:function(t){var e=q(t);return {cancel:function(){return N(e)}}},getImageData:function(t){var e=self.document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(0,0,t.width,t.height)},resolveURL:function(t){return O||(O=self.document.createElement("a")),O.href=t,O.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return !!self.matchMedia&&(null==L&&(L=self.matchMedia("(prefers-reduced-motion: reduce)")),L.matches)}},Z={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},G={supported:!1,testSupport:function(t){if(K||!R)return;Y?J(t):D=t;}},K=!1,Y=!1;function J(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,R),t.isContextLost())return;G.supported=!0;}catch(t){}t.deleteTexture(e),K=!0;}self.document&&((R=self.document.createElement("img")).onload=function(){D&&J(D),D=null,Y=!0;},R.onerror=function(){K=!0,D=null;},R.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var H="01";var $=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken();};function W(t){return 0===t.indexOf("mapbox:")}$.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return {token:["1",H,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt;},$.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},$.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},$.prototype.normalizeStyleURL=function(t,e){if(!W(t))return t;var r=rt(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},$.prototype.normalizeGlyphsURL=function(t,e){if(!W(t))return t;var r=rt(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},$.prototype.normalizeSourceURL=function(t,e){if(!W(t))return t;var r=rt(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},$.prototype.normalizeSpriteURL=function(t,e,r,n){var i=rt(t);return W(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+r,this._makeAPIURL(i,this._customAccessToken||n)):nt(i)+e+r},$.prototype.normalizeTileURL=function(t,e,r){if(this._isSkuTokenExpired()&&this._createSkuToken(),!e||!W(e))return t;var n=rt(t),i=X.devicePixelRatio>=2||512===r?"@2x":"",a=G.supported?".webp":"$1";return n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+i+a),n.path=n.path.replace(/^.+\/v4\//,"/"),n.path="/v4"+n.path,Z.REQUIRE_ACCESS_TOKEN&&(Z.ACCESS_TOKEN||this._customAccessToken)&&this._skuToken&&n.params.push("sku="+this._skuToken),this._makeAPIURL(n,this._customAccessToken)},$.prototype.canonicalizeTileURL=function(t){var e=rt(t);if(!e.path.match(/(^\/v4\/)/)||!e.path.match(/\.[\w]+$/))return t;var r="mapbox://tiles/";r+=e.path.replace("/v4/","");var n=e.params.filter(function(t){return !t.match(/^access_token=/)});return n.length&&(r+="?"+n.join("&")),r},$.prototype.canonicalizeTileset=function(t,e){if(!W(e))return t.tiles||[];for(var r=[],n=0,i=t.tiles;n=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData));}catch(t){E("Unable to write to LocalStorage");}},at.prototype.processRequests=function(t){},at.prototype.postEvent=function(t,e,r,n){var i=this;if(Z.EVENTS_URL){var a=rt(Z.EVENTS_URL);a.params.push("access_token="+(n||Z.ACCESS_TOKEN||""));var o={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.3.2",skuId:H,userId:this.anonId},s=e?d(o,e):o,u={url:nt(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=It(u,function(t){i.pendingRequest=null,r(t),i.saveEventData(),i.processRequests(n);});}},at.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e);};var ot,st=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken="";}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,n){this.skuToken=r,(Z.EVENTS_URL&&n||Z.ACCESS_TOKEN&&Array.isArray(t)&&t.some(function(t){return W(t)||tt(t)}))&&this.queueRequest({id:e,timestamp:Date.now()},n);},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),b(this.anonId)||(this.anonId=x()),this.postEvent(i,{skuToken:this.skuToken},function(t){t||n&&(e.success[n]=!0);},t));}},e}(at),ut=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e;}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){Z.EVENTS_URL&&Z.ACCESS_TOKEN&&Array.isArray(t)&&t.some(function(t){return W(t)||tt(t)})&&this.queueRequest(Date.now(),e);},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=it(Z.ACCESS_TOKEN),n=r?r.u:Z.ACCESS_TOKEN,i=n!==this.eventData.tokenU;b(this.anonId)||(this.anonId=x(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),u=(a-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||o.getDate()!==s.getDate();}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=n);},t);}},e}(at)),lt=ut.postTurnstileEvent.bind(ut),pt=new st,ct=pt.postMapLoadEvent.bind(pt),ht="mapbox-tiles",ft=500,yt=50,dt=42e4;function mt(t,e,r){if(self.caches){var n={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach(function(t,e){return n.headers.set(e,t)});var i=B(e.headers.get("Cache-Control")||"");if(!i["no-store"])i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r2?r.slice(1).join("?"):t;return decodeURI(n)}function gt(t,e){if(!self.caches)return e(null);var r=vt(t.url);self.caches.open(ht).then(function(t){t.match(r).then(function(n){var i=function(t){if(!t)return !1;var e=new Date(t.headers.get("Expires")),r=B(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(n);t.delete(r),i&&t.put(r,n.clone()),e(null,n,i);}).catch(e);}).catch(e);}var xt=1/0;var bt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(bt);var _t=function(t){function e(e,r,n){401===r&&tt(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=r,this.url=n,this.name=this.constructor.name,this.message=e;}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error);function wt(){return "undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}var At=wt()?function(){return self.worker&&self.worker.referrer}:function(){return ("blob:"===self.location.protocol?self.parent:self).location.href};function St(t,e){var r,n=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:At(),signal:n.signal}),a=!1,o=!1,s=(r=i.url).indexOf("sku=")>0&&tt(r)||!tt(r);"json"===t.type&&i.headers.set("Accept","application/json");var u=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&E(r),n&&a)return l(n);var u=Date.now();self.fetch(i).then(function(r){if(r.ok){var n=s?r.clone():null;return l(r,n,u)}return e(new _t(r.statusText,r.status,t.url))}).catch(function(t){20!==t.code&&e(new Error(t.message));});}},l=function(r,n,s){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then(function(t){o||(n&&s&&mt(i,n,s),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")));}).catch(function(t){return e(new Error(t.message))});};return s?gt(i,u):u(null,null),{cancel:function(){o=!0,a||n.abort();}}}var kt=function(t,e){if(r=t.url,!(/^file:/.test(r)||/^file:/.test(At())&&!/^\w+:/.test(r))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return St(t,e);if(wt()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e)}var r;return 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.responseType="text",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 _t(r.statusText,r.status,t.url));},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},zt=function(t,e){return kt(d(t,{type:"arrayBuffer"}),e)},It=function(t,e){return kt(d(t,{method:"POST"}),e)};var Et,Mt,Ct="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Et=[],Mt=0;var Pt=function(t,e,r){if(void 0===r&&(r=!1),Mt>=Z.MAX_PARALLEL_IMAGE_REQUESTS){var n={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0;}};return Et.push(n),n}Mt++;var i=!1,a=function(){if(!i)for(i=!0,Mt--;Et.length&&Mt0||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 Lt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},"*":{type:"*"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!1,type:"array",value:"string"},video:{required:!1,type:"*"},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:{},sprite:{},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_sprite","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_sprite:{"sprite-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sprite-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"sprite-miter-limit":{type:"number",default:2,requires:[{"sprite-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"sprite-round-limit":{type:"number",default:1.05,requires:[{"sprite-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-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],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:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"},{"!":"text-variable-anchor"}],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:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum: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"},"number-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:"Feature data"},accumulated:{group:"Feature data"},"+":{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_sprite","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"},"fill-water":{type:"enum",transition:!1,values:{water:{},none:{}},default:"none","property-type":"data-constant"}},"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"},"fill-extrusion-intensity":{type:"number",default:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-bottom-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-pattern-repeat":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"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"},"line-height":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_sprite:{"sprite-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"sprite-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"sprite-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"sprite-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["sprite-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sprite-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"sprite-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"sprite-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"sprite-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"sprite-speed-factor":{type:"number",default:1,minimum:0,transition:!0,units:"pixels"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-height":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},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"}},"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"}}},Dt=function(t,e,r,n){this.message=(t?t+": ":"")+r,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__);};function Rt(t){var e=t.key,r=t.value;return r?[new Dt(e,r,"constants have been deprecated as of v8")]:[]}function jt(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 ne=[Gt,Kt,Yt,Jt,Ht,te,$t,ee(Wt)];function ie(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!ie(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=ne;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("("),l=i.indexOf(")");if(-1!==u&&l+1===i.length){var p=i.substr(0,u),c=i.substr(u+1,l-(u+1)).split(","),h=1;switch(p){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,oe=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n;};oe.parse=function(t){if(t){if(t instanceof oe)return t;if("string"==typeof t){var e=ae(t);if(e)return new oe(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},oe.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+")"},oe.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]},oe.black=new oe(0,0,0,1),oe.white=new oe(1,1,1,1),oe.transparent=new oe(0,0,0,0),oe.red=new oe(1,0,0,1);var se=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"});};se.prototype.compare=function(t,e){return this.collator.compare(t,e)},se.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ue=function(t,e,r,n){this.text=t,this.scale=e,this.fontStack=r,this.textColor=n;},le=function(t){this.sections=t;};function pe(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 ce(t){if(null===t)return Gt;if("string"==typeof t)return Yt;if("boolean"==typeof t)return Jt;if("number"==typeof t)return Kt;if(t instanceof oe)return Ht;if(t instanceof se)return Qt;if(t instanceof le)return te;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 de)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=de[s],n++;}else a=Wt;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=ee(a,o);}else r=de[i];for(var u=[];n1)&&e.push(n);}}return e.concat(this.args.map(function(t){return t.serialize()}))};var ve=function(t){this.type=te,this.sections=t;};ve.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.":pe(e[0],e[1],e[2],e[3])))return new oe(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ye(r||"Could not parse color from value '"+("string"==typeof e?e:String(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&&!ze(t,e)&&(r=!1);}),r}Ae.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,Jt);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Jt);if(!i)return null;var a=null;return r.locale&&!(a=e.parse(r.locale,1,Yt))?null:new Ae(n,i,a)},Ae.prototype.evaluate=function(t){return new se(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Ae.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale);},Ae.prototype.possibleOutputs=function(){return [void 0]},Ae.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 Ie=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e;};Ie.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 Ie(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)},Ie.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Ie.prototype.eachChild=function(){},Ie.prototype.possibleOutputs=function(){return [void 0]},Ie.prototype.serialize=function(){return ["var",this.name]};var Ee=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new Zt),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 Me(t,e){for(var r,n,i=t.length-1,a=0,o=i,s=0;a<=o;)if(r=t[s=Math.floor((a+o)/2)],n=t[s+1],r<=e){if(s===i||ee))throw new ye("Input is not a number.");o=s-1;}return 0}Ee.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)},Ee.prototype._parse=function(t,e){function r(t,e,r){return "assert"===r?new me(e,[t]):"coerce"===r?new xe(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');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 fe)&&function t(e){if(e instanceof Ie)return t(e.boundExpression);if(e instanceof we&&"error"===e.name)return !1;if(e instanceof Ae)return !1;var r=e instanceof xe||e instanceof me;var n=!0;e.eachChild(function(e){n=r?n&&t(e):n&&e instanceof fe;});if(!n)return !1;return Se(e)&&ze(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var u=new _e;try{a=new fe(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.")},Ee.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 Ee(this.registry,n,e||null,i,this.errors)},Ee.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 Xt(n,t));},Ee.prototype.checkSubtype=function(t,e){var r=ie(t,e);return r&&this.error(r),r};var Ce=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n=o)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var p=e.parse(s,l,i);if(!p)return null;i=i||p.type,n.push([o,p]);}return new Ce(i,r,n)},Ce.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[Me(e,n)].evaluate(t)},Ce.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 Be=Object.freeze({number:Pe,color:function(t,e,r){return new oe(Pe(t.r,e.r,r),Pe(t.g,e.g,r),Pe(t.b,e.b,r),Pe(t.a,e.a,r))},array:function(t,e,r){return t.map(function(t,n){return Pe(t,e[n],r)})}}),Te=.95047,Ve=1,Fe=1.08883,Oe=4/29,Le=6/29,De=3*Le*Le,Re=Le*Le*Le,je=Math.PI/180,Ue=180/Math.PI;function qe(t){return t>Re?Math.pow(t,1/3):t/De+Oe}function Ne(t){return t>Le?t*t*t:De*(t-Oe)}function Xe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ze(t){return (t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ge(t){var e=Ze(t.r),r=Ze(t.g),n=Ze(t.b),i=qe((.4124564*e+.3575761*r+.1804375*n)/Te),a=qe((.2126729*e+.7151522*r+.072175*n)/Ve);return {l:116*a-16,a:500*(i-a),b:200*(a-qe((.0193339*e+.119192*r+.9503041*n)/Fe)),alpha:t.a}}function Ke(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=Ve*Ne(e),r=Te*Ne(r),n=Fe*Ne(n),new oe(Xe(3.2404542*r-1.5371385*e-.4985314*n),Xe(-.969266*r+1.8760108*e+.041556*n),Xe(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function Ye(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var Je={forward:Ge,reverse:Ke,interpolate:function(t,e,r){return {l:Pe(t.l,e.l,r),a:Pe(t.a,e.a,r),b:Pe(t.b,e.b,r),alpha:Pe(t.alpha,e.alpha,r)}}},He={forward:function(t){var e=Ge(t),r=e.l,n=e.a,i=e.b,a=Math.atan2(i,n)*Ue;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*je,r=t.c;return Ke({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return {h:Ye(t.h,e.h,r),c:Pe(t.c,e.c,r),l:Pe(t.l,e.l,r),alpha:Pe(t.alpha,e.alpha,r)}}},$e=Object.freeze({lab:Je,hcl:He}),We=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,Kt)))return null;var u=[],l=null;"interpolate-hcl"===r||"interpolate-lab"===r?l=Ht:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var p=0;p=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,l);if(!d)return null;l=l||d.type,u.push([c,d]);}return "number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new We(l,r,n,i,u):e.error("Type "+re(l)+" is not interpolatable.")},We.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=Me(e,n),o=e[a],s=e[a+1],u=We.interpolationFactor(this.interpolation,n,o,s),l=r[a].evaluate(t),p=r[a+1].evaluate(t);return "interpolate"===this.operator?Be[this.type.kind.toLowerCase()](l,p,u):"interpolate-hcl"===this.operator?He.reverse(He.interpolate(He.forward(l),He.forward(p),u)):Je.reverse(Je.interpolate(Je.forward(l),Je.forward(p),u))},We.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new ye("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new ye("Array index must be an integer, but found "+e+" instead.");return r[e]},rr.prototype.eachChild=function(t){t(this.index),t(this.input);},rr.prototype.possibleOutputs=function(){return [void 0]},rr.prototype.serialize=function(){return ["at",this.index.serialize(),this.input.serialize()]};var nr=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;};nr.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 l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,ce(h)))return null}else r=ce(h);if(void 0!==i[String(h)])return l.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,Wt);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 nr(r,n,y,i,a,d):null},nr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return (ce(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},nr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise);},nr.prototype.possibleOutputs=function(){var t;return (t=[]).concat.apply(t,this.outputs.map(function(t){return t.possibleOutputs()})).concat(this.otherwise.possibleOutputs())},nr.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}),hr=sr("<=",function(t,e,r){return e<=r},function(t,e,r,n){return n.compare(e,r)<=0}),fr=sr(">=",function(t,e,r){return e>=r},function(t,e,r,n){return n.compare(e,r)>=0}),yr=function(t,e,r,n,i){this.type=Yt,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i;};yr.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Kt);if(!r)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=e.parse(n.locale,1,Yt)))return null;var a=null;if(n.currency&&!(a=e.parse(n.currency,1,Yt)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=e.parse(n["min-fraction-digits"],1,Kt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Kt))?null:new yr(r,i,a,o,s)},yr.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},yr.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits);},yr.prototype.possibleOutputs=function(){return [void 0]},yr.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var dr=function(t){this.type=Kt,this.input=t;};dr.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 "+re(r.type)+" instead."):new dr(r):null},dr.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 ye("Expected value to be of type string or array, but found "+re(ce(e))+" instead.")},dr.prototype.eachChild=function(t){t(this.input);},dr.prototype.possibleOutputs=function(){return [void 0]},dr.prototype.serialize=function(){var t=["length"];return this.eachChild(function(e){t.push(e.serialize());}),t};var mr={"==":ur,"!=":lr,">":cr,"<":pr,">=":fr,"<=":hr,array:me,at:rr,boolean:me,case:ir,coalesce:tr,collator:Ae,format:ve,interpolate:We,"interpolate-hcl":We,"interpolate-lab":We,length:dr,let:er,literal:fe,match:nr,number:me,"number-format":yr,object:me,step:Ce,string:me,"to-boolean":xe,"to-color":xe,"to-number":xe,"to-string":xe,var:Ie};function vr(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=pe(r,n,i,o);if(s)throw new ye(s);return new oe(r/255*o,n/255*o,i/255*o,o)}function gr(t,e){return t in e}function xr(t,e){var r=e[t];return void 0===r?null:r}function br(t){return {type:t}}function _r(t){return {result:"success",value:t}}function wr(t){return {result:"error",value:t}}function Ar(t){return "data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Sr(t){return !!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function kr(t){return !!t.expression&&t.expression.interpolated}function zr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Ir(t){return "object"==typeof t&&null!==t&&!Array.isArray(t)}function Er(t){return t}function Mr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function Cr(t,e,r,n,i){return Mr(typeof r===i?n[r]:void 0,t.default,e.default)}function Pr(t,e,r){if("number"!==zr(r))return Mr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var i=Me(t.stops.map(function(t){return t[0]}),r);return t.stops[i][1]}function Br(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==zr(r))return Mr(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var a=Me(t.stops.map(function(t){return t[0]}),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],l=Be[e.type]||Er;if(t.colorSpace&&"rgb"!==t.colorSpace){var p=$e[t.colorSpace];l=function(t,e){return p.reverse(p.interpolate(p.forward(t),p.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 l(r,n,o)}}:l(s,u,o)}function Tr(t,e,r){return "color"===e.type?r=oe.parse(r):"formatted"===e.type?r=le.fromString(r.toString()):zr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Mr(r,t.default,e.default)}we.register(mr,{error:[{kind:"error"},[Yt],function(t,e){var r=e[0];throw new ye(r.evaluate(t))}],typeof:[Yt,[Wt],function(t,e){return re(ce(e[0].evaluate(t)))}],"to-rgba":[ee(Kt,4),[Ht],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Ht,[Kt,Kt,Kt],vr],rgba:[Ht,[Kt,Kt,Kt,Kt],vr],has:{type:Jt,overloads:[[[Yt],function(t,e){return gr(e[0].evaluate(t),t.properties())}],[[Yt,$t],function(t,e){var r=e[0],n=e[1];return gr(r.evaluate(t),n.evaluate(t))}]]},get:{type:Wt,overloads:[[[Yt],function(t,e){return xr(e[0].evaluate(t),t.properties())}],[[Yt,$t],function(t,e){var r=e[0],n=e[1];return xr(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[Wt,[Yt],function(t,e){return xr(e[0].evaluate(t),t.featureState||{})}],properties:[$t,[],function(t){return t.properties()}],"geometry-type":[Yt,[],function(t){return t.geometryType()}],id:[Wt,[],function(t){return t.id()}],zoom:[Kt,[],function(t){return t.globals.zoom}],"heatmap-density":[Kt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Kt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Wt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Kt,br(Kt),function(t,e){for(var r=0,n=0,i=e;n":[Jt,[Yt,Wt],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->":[Jt,[Wt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Jt,[Yt,Wt],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-<=":[Jt,[Wt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Jt,[Yt,Wt],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->=":[Jt,[Wt],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Jt,[Wt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Jt,[],function(t){return null!==t.id()}],"filter-type-in":[Jt,[ee(Yt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Jt,[ee(Wt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Jt,[Yt,ee(Wt)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Jt,[Yt,ee(Wt)],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:Jt,overloads:[[[Jt,Jt],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[br(Jt),function(t,e){for(var r=0,n=e;r0&&"string"==typeof t[0]&&t[0]in mr}function Or(t,e){var r=new Ee(mr,[],e?function(t){var e={color:Ht,string:Yt,number:Kt,enum:Yt,boolean:Jt,formatted:te};if("array"===t.type)return ee(e[t.value]||Wt,t.length);return e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?_r(new Vr(n,e)):wr(r.errors)}Vr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.formattedSection=n,this.expression.evaluate(this._evaluator)},Vr.prototype.evaluate=function(t,e,r,n){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.formattedSection=n||null;try{var i=this.expression.evaluate(this._evaluator);if(null==i)return this._defaultValue;if(this._enumValues&&!(i in this._enumValues))throw new ye("Expected value to be one of "+Object.keys(this._enumValues).map(function(t){return JSON.stringify(t)}).join(", ")+", but found "+JSON.stringify(i)+" instead.");return i}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Lr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!ke(e.expression);};Lr.prototype.evaluateWithoutErrorHandling=function(t,e,r,n){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n)},Lr.prototype.evaluate=function(t,e,r,n){return this._styleExpression.evaluate(t,e,r,n)};var Dr=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!ke(e.expression),this.interpolationType=n;};function Rr(t,e){if("error"===(t=Or(t,e)).result)return t;var r=t.value.expression,n=Se(r);if(!n&&!Ar(e))return wr([new Xt("","data expressions not supported")]);var i=ze(r,["zoom"]);if(!i&&!Sr(e))return wr([new Xt("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof er)r=t(e.result);else if(e instanceof tr)for(var n=0,i=e.args;nn.maximum?[new Dt(e,r,r+" is greater than the maximum value "+n.maximum)]:[]}function Xr(t){var e,r,n,i=t.valueSpec,a=qt(t.value.type),o={},s="categorical"!==a&&void 0===t.value.property,u=!s,l="array"===zr(t.value.stops)&&"array"===zr(t.value.stops[0])&&"object"===zr(t.value.stops[0][0]),p=Ur({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 Dt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat(qr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:c})),"array"===zr(r)&&0===r.length&&e.push(new Dt(t.key,r,"array must have at least one stop"));return e},default:function(t){return hn({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return "identity"===a&&s&&p.push(new Dt(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||p.push(new Dt(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!kr(t.valueSpec)&&p.push(new Dt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Ar(t.valueSpec)?p.push(new Dt(t.key,t.value,"property functions not supported")):s&&!Sr(t.valueSpec)&&p.push(new Dt(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!l||void 0!==t.value.property||p.push(new Dt(t.key,t.value,'"property" property is required')),p;function c(t){var e=[],a=t.value,s=t.key;if("array"!==zr(a))return [new Dt(s,a,"array expected, "+zr(a)+" found")];if(2!==a.length)return [new Dt(s,a,"array length 2 expected, length "+a.length+" found")];if(l){if("object"!==zr(a[0]))return [new Dt(s,a,"object expected, "+zr(a[0])+" found")];if(void 0===a[0].zoom)return [new Dt(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return [new Dt(s,a,"object stop key must have value")];if(n&&n>qt(a[0].zoom))return [new Dt(s,a[0].zoom,"stop zoom values must appear in ascending order")];qt(a[0].zoom)!==n&&(n=qt(a[0].zoom),r=void 0,o={}),e=e.concat(Ur({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Nr,value:h}}));}else e=e.concat(h({key:s+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return Fr(Nt(a[1]))?e.concat([new Dt(s+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(hn({key:s+"[1]",value:a[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function h(t,n){var s=zr(t.value),u=qt(t.value),l=null!==t.value?t.value:n;if(e){if(s!==e)return [new Dt(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return [new Dt(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var p="number expected, "+s+" found";return Ar(i)&&void 0===a&&(p+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Dt(t.key,l,p)]}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 $r(t){if(!t)return !0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Wr(t[1],t[2],"=="):"!="===r?en(Wr(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Wr(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map($r))):"all"===r?["all"].concat(t.slice(1).map($r)):"none"===r?["all"].concat(t.slice(1).map($r).map(en)):"in"===r?Qr(t[1],t.slice(2)):"!in"===r?en(Qr(t[1],t.slice(2))):"has"===r?tn(t[1]):"!has"!==r||en(tn(t[1]))}function Wr(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 Qr(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(Hr)]]:["filter-in-small",t,["literal",e]]}}function tn(t){switch(t){case"$type":return !0;case"$id":return ["filter-has-id"];default:return ["filter-has",t]}}function en(t){return ["!",t]}function rn(t){return Kr(Nt(t.value))?Zr(jt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value;var n=e.key;if("array"!==zr(r))return [new Dt(n,r,"array expected, "+zr(r)+" found")];var i=e.styleSpec;var a;var o=[];if(r.length<1)return [new Dt(n,r,"filter array must have at least 1 element")];o=o.concat(Gr({key:n+"[0]",value:r[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec}));switch(qt(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===qt(r[1])&&o.push(new Dt(n,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&o.push(new Dt(n,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(a=zr(r[1]))&&o.push(new Dt(n+"[1]",r[1],"string expected, "+a+" found"));for(var s=2;s=p[f+0]&&n>=p[f+1])?(o[h]=!0,a.push(l[h])):o[h]=!1;}}},Sn.prototype._forEachCell=function(t,e,r,n,i,a,o,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),p=this._convertToCellCoord(r),c=this._convertToCellCoord(n),h=u;h<=p;h++)for(var f=l;f<=c;f++){var y=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&i.call(this,t,e,r,n,y,a,o,s))return}},Sn.prototype._convertFromCellCoord=function(t){return (t-this.padding)/this.scale},Sn.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Sn.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=An+this.cells.length+1+1,r=0,n=0;n=0)){var c=t[p];l[p]=zn[u].shallow.indexOf(p)>=0?c:Mn(c,e);}t instanceof Error&&(l.message=t.message);}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return "Object"!==u&&(l.$name=u),l}throw new Error("can't serialize object of type "+typeof t)}function Cn(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 kn)return t;if(Array.isArray(t))return t.map(Cn);if("object"==typeof t){var e=t.$name||"Object",r=zn[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:Cn(s);}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Pn=function(){this.first=!0;};Pn.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 Tn(t){for(var e=0,r=t;e=65097&&t<=65103)||(!!Bn["CJK Compatibility Ideographs"](t)||(!!Bn["CJK Compatibility"](t)||(!!Bn["CJK Radicals Supplement"](t)||(!!Bn["CJK Strokes"](t)||(!(!Bn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||(!!Bn["CJK Unified Ideographs Extension A"](t)||(!!Bn["CJK Unified Ideographs"](t)||(!!Bn["Enclosed CJK Letters and Months"](t)||(!!Bn["Hangul Compatibility Jamo"](t)||(!!Bn["Hangul Jamo Extended-A"](t)||(!!Bn["Hangul Jamo Extended-B"](t)||(!!Bn["Hangul Jamo"](t)||(!!Bn["Hangul Syllables"](t)||(!!Bn.Hiragana(t)||(!!Bn["Ideographic Description Characters"](t)||(!!Bn.Kanbun(t)||(!!Bn["Kangxi Radicals"](t)||(!!Bn["Katakana Phonetic Extensions"](t)||(!(!Bn.Katakana(t)||12540===t)||(!(!Bn["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)||(!(!Bn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(!!Bn["Unified Canadian Aboriginal Syllabics"](t)||(!!Bn["Unified Canadian Aboriginal Syllabics Extended"](t)||(!!Bn["Vertical Forms"](t)||(!!Bn["Yijing Hexagram Symbols"](t)||(!!Bn["Yi Syllables"](t)||!!Bn["Yi Radicals"](t))))))))))))))))))))))))))))))}function On(t){return !(Fn(t)||function(t){return !(!Bn["Latin-1 Supplement"](t)||167!==t&&169!==t&&174!==t&&177!==t&&188!==t&&189!==t&&190!==t&&215!==t&&247!==t)||(!(!Bn["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)||(!!Bn["Letterlike Symbols"](t)||(!!Bn["Number Forms"](t)||(!(!Bn["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))||(!(!Bn["Control Pictures"](t)||9251===t)||(!!Bn["Optical Character Recognition"](t)||(!!Bn["Enclosed Alphanumerics"](t)||(!!Bn["Geometric Shapes"](t)||(!(!Bn["Miscellaneous Symbols"](t)||t>=9754&&t<=9759)||(!(!Bn["Miscellaneous Symbols and Arrows"](t)||!(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243))||(!!Bn["CJK Symbols and Punctuation"](t)||(!!Bn.Katakana(t)||(!!Bn["Private Use Area"](t)||(!!Bn["CJK Compatibility Forms"](t)||(!!Bn["Small Form Variants"](t)||(!!Bn["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 Ln(t,e){return !(!e&&(t>=1424&&t<=2303||Bn["Arabic Presentation Forms-A"](t)||Bn["Arabic Presentation Forms-B"](t)))&&!(t>=2304&&t<=3583||t>=3840&&t<=4255||Bn.Khmer(t))}var Dn,Rn=!1,jn=null,Un=!1,qn=new Ot,Nn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Un||null!=Nn.applyArabicShaping}},Xn=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 Pn,this.transition={});};Xn.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 Zn=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Ir(t))return new jr(t,e);if(Fr(t)){var r=Rr(t,e);if("error"===r.result)throw new Error(r.value.map(function(t){return t.key+": "+t.message}).join(", "));return r.value}var n=t;return "string"==typeof t&&"color"===e.type&&(n=oe.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification);};Zn.prototype.isDataDriven=function(){return "source"===this.expression.kind||"composite"===this.expression.kind},Zn.prototype.possiblyEvaluate=function(t){return this.property.possiblyEvaluate(this,t)};var Gn=function(t){this.property=t,this.value=new Zn(t,void 0);};Gn.prototype.transitioned=function(t,e){return new Yn(this.property,this.value,e,d({},t.transition,this.transition),t.now)},Gn.prototype.untransitioned=function(){return new Yn(this.property,this.value,null,{},0)};var Kn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues);};Kn.prototype.getValue=function(t){return k(this._values[t].value.value)},Kn.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Gn(this._values[t].property)),this._values[t].value=new Zn(this._values[t].property,null===e?void 0:k(e));},Kn.prototype.getTransition=function(t){return k(this._values[t].transition)},Kn.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Gn(this._values[t].property)),this._values[t].transition=k(e)||void 0;},Kn.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(en.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(ti),ri=function(t){this.specification=t;};ri.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 Xn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Xn(Math.floor(e.zoom),e)),t.expression.evaluate(new Xn(Math.floor(e.zoom+1),e)),e)}},ri.prototype._calculate=function(t,e,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},ri.prototype.interpolate=function(t){return t};var ni=function(t){this.specification=t;};ni.prototype.possiblyEvaluate=function(t,e){return !!t.expression.evaluate(e)},ni.prototype.interpolate=function(){return !1};var ii=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var r=t[e];r.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new Zn(r,void 0),i=this.defaultTransitionablePropertyValues[e]=new Gn(r);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({});}};In("DataDrivenProperty",ti),In("DataConstantProperty",Qn),In("CrossFadedDataDrivenProperty",ei),In("CrossFadedProperty",ri),In("ColorRampProperty",ni);var ai=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,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 Hn(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Kn(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(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".layout."+t;if(this._validate(bn,n,t,e,r))return}"visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e;},e.prototype.getPaintProperty=function(t){return w(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e){var n="layers."+this.id+".paint."+t;if(this._validate(xn,n,t,e,r))return !1}if(w(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"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var u=this._transitionablePaint._values[t].value;return u.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(t,s,u)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return !1},e.prototype.isHidden=function(t){return !!(this.minzoom&&tthis.maxzoom)||"none"===this.visibility)},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint);},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t)),this.paint=this._transitioningPaint.possiblyEvaluate(t);},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),S(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 void 0===i&&(i={}),(!i||!1!==i.validate)&&_n(this,t.call(vn,{key:e,layerType:this.type,objectKey:r,value:n,styleSpec:Lt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return !1},e.prototype.isTileClipped=function(){return !1},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 $n&&Ar(e.property.specification)&&(("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent))return !0}return !1},e}(Ot),oi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},si=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;},ui=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0);};function li(t,e){void 0===e&&(e=1);var r=0,n=0;return {members:t.map(function(t){var i,a=(i=t.type,oi[i].BYTES_PER_ELEMENT),o=r=pi(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:pi(r,Math.max(n,e)),alignment:e}}function pi(t,e){return Math.ceil(t/e)*e}ui.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},ui.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},ui.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews());},ui.prototype.clear=function(){this.length=0;},ui.prototype.resize=function(t){this.reserve(t),this.length=t;},ui.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);}},ui.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var ci=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}(ui);ci.prototype.bytesPerElement=4,In("StructArrayLayout2i4",ci);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._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}(ui);hi.prototype.bytesPerElement=8,In("StructArrayLayout4i8",hi);var fi=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}(ui);fi.prototype.bytesPerElement=12,In("StructArrayLayout2i4i12",fi);var yi=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=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=r,this.uint8[u+4]=n,this.uint8[u+5]=i,this.uint8[u+6]=a,this.uint8[u+7]=o,t},e}(ui);yi.prototype.bytesPerElement=8,In("StructArrayLayout2i4ub8",yi);var di=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,u,l,p,c,h){var f=this.length;this.resize(f+1);var y=10*f,d=20*f;return this.int16[y+0]=t,this.int16[y+1]=e,this.int16[y+2]=r,this.int16[y+3]=n,this.uint8[d+8]=i,this.uint8[d+9]=a,this.uint8[d+10]=o,this.uint8[d+11]=s,this.uint8[d+12]=u,this.uint8[d+13]=l,this.uint8[d+14]=p,this.uint16[y+8]=c,this.uint16[y+9]=h,f},e}(ui);di.prototype.bytesPerElement=20,In("StructArrayLayout4i4ub20",di);var mi=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 l=8*t;return this.uint16[l+0]=e,this.uint16[l+1]=r,this.uint16[l+2]=n,this.uint16[l+3]=i,this.uint16[l+4]=a,this.uint16[l+5]=o,this.uint16[l+6]=s,this.uint16[l+7]=u,t},e}(ui);mi.prototype.bytesPerElement=16,In("StructArrayLayout8ui16",mi);var vi=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 l=8*t;return this.int16[l+0]=e,this.int16[l+1]=r,this.int16[l+2]=n,this.int16[l+3]=i,this.uint16[l+4]=a,this.uint16[l+5]=o,this.uint16[l+6]=s,this.uint16[l+7]=u,t},e}(ui);vi.prototype.bytesPerElement=16,In("StructArrayLayout4i4ui16",vi);var gi=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}(ui);gi.prototype.bytesPerElement=12,In("StructArrayLayout3f12",gi);var xi=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}(ui);xi.prototype.bytesPerElement=4,In("StructArrayLayout1ul4",xi);var bi=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,l,p){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,n,i,a,o,s,u,l,p)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p,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]=l,this.int16[h+10]=p,this.int16[h+11]=c,t},e}(ui);bi.prototype.bytesPerElement=24,In("StructArrayLayout6i1ul2ui2i24",bi);var _i=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}(ui);_i.prototype.bytesPerElement=12,In("StructArrayLayout2i2i2i12",_i);var wi=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=12*t,o=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,t},e}(ui);wi.prototype.bytesPerElement=12,In("StructArrayLayout2ub2f12",wi);var Ai=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,l,p,c,h,f,y,d){var m=this.length;return this.resize(m+1),this.emplace(m,t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m){var v=22*t,g=11*t,x=44*t;return this.int16[v+0]=e,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[g+2]=a,this.uint32[g+3]=o,this.uint32[g+4]=s,this.uint16[v+10]=u,this.uint16[v+11]=l,this.uint16[v+12]=p,this.float32[g+7]=c,this.float32[g+8]=h,this.uint8[x+36]=f,this.uint8[x+37]=y,this.uint8[x+38]=d,this.uint32[g+10]=m,t},e}(ui);Ai.prototype.bytesPerElement=44,In("StructArrayLayout2i2ui3ul3ui2f3ub1ul44",Ai);var Si=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,l,p,c,h,f,y,d,m,v,g,x){var b=this.length;return this.resize(b+1),this.emplace(b,t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m,v,g,x)},e.prototype.emplace=function(t,e,r,n,i,a,o,s,u,l,p,c,h,f,y,d,m,v,g,x,b){var _=24*t,w=12*t;return this.int16[_+0]=e,this.int16[_+1]=r,this.int16[_+2]=n,this.int16[_+3]=i,this.int16[_+4]=a,this.int16[_+5]=o,this.uint16[_+6]=s,this.uint16[_+7]=u,this.uint16[_+8]=l,this.uint16[_+9]=p,this.uint16[_+10]=c,this.uint16[_+11]=h,this.uint16[_+12]=f,this.uint16[_+13]=y,this.uint16[_+14]=d,this.uint16[_+15]=m,this.uint16[_+16]=v,this.uint32[w+9]=g,this.float32[w+10]=x,this.float32[w+11]=b,t},e}(ui);Si.prototype.bytesPerElement=48,In("StructArrayLayout6i11ui1ul2f48",Si);var ki=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}(ui);ki.prototype.bytesPerElement=4,In("StructArrayLayout1f4",ki);var zi=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}(ui);zi.prototype.bytesPerElement=6,In("StructArrayLayout3i6",zi);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._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}(ui);Ii.prototype.bytesPerElement=8,In("StructArrayLayout1ul2ui8",Ii);var Ei=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}(ui);Ei.prototype.bytesPerElement=6,In("StructArrayLayout3ui6",Ei);var Mi=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}(ui);Mi.prototype.bytesPerElement=4,In("StructArrayLayout2ui4",Mi);var Ci=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}(ui);Ci.prototype.bytesPerElement=2,In("StructArrayLayout1ui2",Ci);var Pi=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}(ui);Pi.prototype.bytesPerElement=8,In("StructArrayLayout2f8",Pi);var Bi=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}(ui);Bi.prototype.bytesPerElement=16,In("StructArrayLayout4f16",Bi);var Ti=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}(si);Ti.prototype.size=24;var Vi=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 Ti(this,t)},e}(bi);In("CollisionBoxArray",Vi);var Fi=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},placedOrientation:{configurable:!0},hidden:{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.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.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t;},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t;},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t;},Object.defineProperties(e.prototype,r),e}(si);Fi.prototype.size=44;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 Fi(this,t)},e}(Ai);In("PlacedSymbolArray",Oi);var Li=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},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},radialTextOffset:{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.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.rightJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+2]=t;},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.centerJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+3]=t;},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.leftJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+4]=t;},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.verticalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+5]=t;},r.key.get=function(){return this._structArray.uint16[this._pos2+6]},r.key.set=function(t){this._structArray.uint16[this._pos2+6]=t;},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+7]},r.textBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+7]=t;},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t;},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.verticalTextBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t;},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+10]=t;},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.iconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+11]=t;},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+12]=t;},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.featureIndex.set=function(t){this._structArray.uint16[this._pos2+13]=t;},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+14]},r.numHorizontalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+14]=t;},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+15]},r.numVerticalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+15]=t;},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+16]},r.numIconVertices.set=function(t){this._structArray.uint16[this._pos2+16]=t;},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+9]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+9]=t;},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+10]},r.textBoxScale.set=function(t){this._structArray.float32[this._pos4+10]=t;},r.radialTextOffset.get=function(){return this._structArray.float32[this._pos4+11]},r.radialTextOffset.set=function(t){this._structArray.float32[this._pos4+11]=t;},Object.defineProperties(e.prototype,r),e}(si);Li.prototype.size=48;var Di=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 Li(this,t)},e}(Si);In("SymbolInstanceArray",Di);var Ri=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}(si);Ri.prototype.size=4;var ji=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 Ri(this,t)},e}(ki);In("GlyphOffsetArray",ji);var Ui=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}(si);Ui.prototype.size=6;var qi=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 Ui(this,t)},e}(zi);In("SymbolLineVertexArray",qi);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={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}(si);Ni.prototype.size=8;var Xi=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}(Ii);In("FeatureIndexArray",Xi);var Zi=li([{name:"a_pos",components:2,type:"Int16"}],4).members,Gi=function(t){void 0===t&&(t=[]),this.segments=t;};function Ki(t,e){return 256*(t=p(Math.floor(t),0,255))+(e=p(Math.floor(e),0,255))}Gi.prototype.prepareSegment=function(t,e,r,n){var i=this.segments[this.segments.length-1];return t>Gi.MAX_VERTEX_ARRAY_LENGTH&&E("Max vertices per segment is "+Gi.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Gi.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Gi.prototype.get=function(){return this.segments},Gi.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},Yi.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;Ji(e,o,s),Ji(r,3*o,3*s),Ji(r,3*o+1,3*s+1),Ji(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}},Yi.deserialize=function(t){var e=new Yi;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},In("FeaturePositionMap",Yi);var Hi=function(t,e){this.gl=t.gl,this.location=e;},$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.uniform1i(this.location,t));},e}(Hi),Wi=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}(Hi),Qi=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}(Hi),ta=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}(Hi),ea=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}(Hi),ra=function(t){function e(e,r){t.call(this,e,r),this.current=oe.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}(Hi),na=new Float32Array(16),ia=function(t){function e(e,r){t.call(this,e,r),this.current=na;}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}(Hi);function aa(t){return [Ki(255*t.r,255*t.g),Ki(255*t.b,255*t.a)]}var oa=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;};oa.prototype.defines=function(){return this.names.map(function(t){return "#define HAS_UNIFORM_u_"+t})},oa.prototype.setConstantPatternPositions=function(){},oa.prototype.populatePaintArray=function(){},oa.prototype.updatePaintArray=function(){},oa.prototype.upload=function(){},oa.prototype.destroy=function(){},oa.prototype.setUniforms=function(t,e,r,n){e.set(n.constantOr(this.value));},oa.prototype.getBinding=function(t,e){return "color"===this.type?new ra(t,e):new Wi(t,e)},oa.serialize=function(t){var e=t.value,r=t.names,n=t.type;return {value:Mn(e),names:r,type:n}},oa.deserialize=function(t){var e=t.value,r=t.names,n=t.type;return new oa(Cn(e),r,n)};var sa=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};};sa.prototype.defines=function(){return this.names.map(function(t){return "#define HAS_UNIFORM_u_"+t})},sa.prototype.populatePaintArray=function(){},sa.prototype.updatePaintArray=function(){},sa.prototype.upload=function(){},sa.prototype.destroy=function(){},sa.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr;},sa.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);},sa.prototype.getBinding=function(t,e){return new ea(t,e)};var ua=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;};ua.prototype.defines=function(){return []},ua.prototype.setConstantPatternPositions=function(){},ua.prototype.populatePaintArray=function(t,e,r,n){var i=this.paintVertexArray,a=i.length;i.reserve(t);var o=this.expression.evaluate(new Xn(0),e,{},n);if("color"===this.type)for(var s=aa(o),u=a;uva.max||o.yva.max)&&(E("Geometry exceeds allowed extent, reduce your vector tile buffer size"),o.x=p(o.x,va.min,va.max),o.y=p(o.y,va.min,va.max));}return r}function xa(t,e,r,n,i){t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2);}var ba=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 ci,this.indexArray=new Ei,this.segments=new Gi,this.programConfigurations=new ha(Zi,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id});};function _a(t,e){for(var r=0;r=3)for(var a=0;a1){if(za(t,e))return !0;for(var n=0;n1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function Ca(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 Pa(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 Ba(t,e,r){var n=r[0],i=r[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return !1;var a=M(t,e,r[0]);return a!==M(t,e,r[1])||a!==M(t,e,r[2])||a!==M(t,e,r[3])}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 Va(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Fa(t,e,r,n,a){if(!e[0]&&!e[1])return t;var o=i.convert(e)._mult(a);"viewport"===r&&o._rotate(-n);for(var s=[],u=0;u=da||l<0||l>=da)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),c=p.vertexLength;xa(this.layoutVertexArray,u,l,-1,-1),xa(this.layoutVertexArray,u,l,1,-1),xa(this.layoutVertexArray,u,l,1,1),xa(this.layoutVertexArray,u,l,-1,1),this.indexArray.emplaceBack(c,c+1,c+2),this.indexArray.emplaceBack(c,c+3,c+2),p.vertexLength+=4,p.primitiveLength+=2;}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{});},In("CircleBucket",ba,{omit:["layers"]});var Oa=new ii({"circle-sort-key":new ti(Lt.layout_circle["circle-sort-key"])}),La={paint:new ii({"circle-radius":new ti(Lt.paint_circle["circle-radius"]),"circle-color":new ti(Lt.paint_circle["circle-color"]),"circle-blur":new ti(Lt.paint_circle["circle-blur"]),"circle-opacity":new ti(Lt.paint_circle["circle-opacity"]),"circle-translate":new Qn(Lt.paint_circle["circle-translate"]),"circle-translate-anchor":new Qn(Lt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Qn(Lt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Qn(Lt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ti(Lt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ti(Lt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ti(Lt.paint_circle["circle-stroke-opacity"])}),layout:Oa},Da="undefined"!=typeof Float32Array?Float32Array:Array;Math.PI;var Ra,ja;Ra=new Da(3),Da!=Float32Array&&(Ra[0]=0,Ra[1]=0,Ra[2]=0),ja=Ra;function Ua(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}!function(){var t=function(){var t=new Da(4);return Da!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}();}();var qa=function(t){function e(e){t.call(this,e,La);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new ba(t)},e.prototype.queryRadius=function(t){var e=t;return Ta("circle-radius",this,e)+Ta("circle-stroke-width",this,e)+Va(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,i,a,o,s){for(var u=Fa(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),l=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),p="map"===this.paint.get("circle-pitch-alignment"),c=p?u:function(t,e){return t.map(function(t){return Na(t,e)})}(u,s),h=p?l*o:l,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);l=0!==(l=Math.max(a-n,o-i))?1/l:0;}return so(h,f,r,n,i,l),f}function ao(t,e,r,n,i){var a,o;if(i===Io(t,e,r,n)>0)for(a=e;a=e;a-=n)o=So(a,t[a],t[a+1],o);return o&&bo(o,o.next)&&(ko(o),o=o.next),o}function oo(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!bo(n,n.next)&&0!==xo(n.prev,n,n.next))n=n.next;else{if(ko(n),(n=e=n.prev)===n.next)break;r=!0;}}while(r||n!==e);return e}function so(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=yo(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,l=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,l*=2;}while(o>1)}(i);}(t,n,i,a);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,a?lo(t,n,i,a):uo(t))e.push(s.i/r),e.push(t.i/r),e.push(u.i/r),ko(t),t=u.next,l=u.next;else if((t=u)===l){o?1===o?so(t=po(t,e,r),e,r,n,i,a,2):2===o&&co(t,e,r,n,i,a):so(oo(t),e,r,n,i,a,1);break}}}function uo(t){var e=t.prev,r=t,n=t.next;if(xo(e,r,n)>=0)return !1;for(var i=t.next.next;i!==t.prev;){if(vo(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&xo(i.prev,i,i.next)>=0)return !1;i=i.next;}return !0}function lo(t,e,r,n){var i=t.prev,a=t,o=t.next;if(xo(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,p=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,c=yo(s,u,e,r,n),h=yo(l,p,e,r,n),f=t.prevZ,y=t.nextZ;f&&f.z>=c&&y&&y.z<=h;){if(f!==t.prev&&f!==t.next&&vo(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&xo(f.prev,f,f.next)>=0)return !1;if(f=f.prevZ,y!==t.prev&&y!==t.next&&vo(i.x,i.y,a.x,a.y,o.x,o.y,y.x,y.y)&&xo(y.prev,y,y.next)>=0)return !1;y=y.nextZ;}for(;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&vo(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&xo(f.prev,f,f.next)>=0)return !1;f=f.prevZ;}for(;y&&y.z<=h;){if(y!==t.prev&&y!==t.next&&vo(i.x,i.y,a.x,a.y,o.x,o.y,y.x,y.y)&&xo(y.prev,y,y.next)>=0)return !1;y=y.nextZ;}return !0}function po(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!bo(i,a)&&_o(i,n,n.next,a)&&wo(i,a)&&wo(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),ko(n),ko(n.next),n=t=a),n=n.next;}while(n!==t);return n}function co(t,e,r,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&go(o,s)){var u=Ao(o,s);return o=oo(o,o.next),u=oo(u,u.next),so(o,e,r,n,i,a),void so(u,e,r,n,i,a)}s=s.next;}o=o.next;}while(o!==t)}function ho(t,e){return t.x-e.x}function fo(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>=p&&i!==n.x&&vo(ar.x)&&wo(n,t)&&(r=n,h=u),n=n.next;return r}(t,e)){var r=Ao(e,t);oo(r,r.next);}}function yo(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 mo(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 go(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&&_o(r,r.next,t,e))return !0;r=r.next;}while(r!==t);return !1}(t,e)&&wo(t,e)&&wo(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 xo(t,e,r){return (e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function bo(t,e){return t.x===e.x&&t.y===e.y}function _o(t,e,r,n){return !!(bo(t,e)&&bo(r,n)||bo(t,n)&&bo(r,e))||xo(t,e,r)>0!=xo(t,e,n)>0&&xo(r,n,t)>0!=xo(r,n,e)>0}function wo(t,e){return xo(t.prev,t,t.next)<0?xo(t,e,t.next)>=0&&xo(t,t.prev,e)>=0:xo(t,e,t.prev)<0||xo(t,t.next,e)<0}function Ao(t,e){var r=new zo(t.i,t.x,t.y),n=new zo(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 So(t,e,r,n){var i=new zo(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 ko(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 zo(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 Io(t,e,r,n){for(var i=0,a=e,o=r-n;an;){if(i-n>600){var o=i-n+1,s=r-n+1,u=Math.log(o),l=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*l*(o-l)/o)*(s-o/2<0?-1:1),c=Math.max(n,Math.floor(r-s*l/o+p)),h=Math.min(i,Math.floor(r+(o-s)*l/o+p));t(e,r,c,h,a);}var f=e[r],y=n,d=i;for(Mo(e,n,r),a(e[i],f)>0&&Mo(e,n,i);y0;)d--;}0===a(e[n],f)?Mo(e,n,d):Mo(e,++d,i),d<=r&&(n=d+1),r<=d&&(i=d-1);}}(t,e,r||0,n||t.length-1,i||Co);}function Mo(t,e,r){var n=t[e];t[e]=t[r],t[r]=n;}function Co(t,e){return te?1:0}function Po(t,e){var r=t.length;if(r<=1)return [t];for(var n,i,a=[],o=0;o1)for(var u=0;u0&&(n+=t[i-1].length,r.holes.push(n));}return r},ro.default=no;var Fo=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.patternFeatures=[],this.layoutVertexArray=new ci,this.indexArray=new Ei,this.indexArray2=new Mi,this.programConfigurations=new ha(eo,t.layers,t.zoom),this.segments=new Gi,this.segments2=new Gi,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id});};Fo.prototype.populate=function(t,e){this.hasPattern=To("fill",this.layers,e);for(var r=this.layers[0].layout.get("fill-sort-key"),n=[],i=0,a=t;i>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},Uo.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,l=-1/0;t.pos>3;}if(n--,1===r||2===r)(i+=t.readSVarint())s&&(s=i),(a+=t.readSVarint())l&&(l=a);else if(7!==r)throw new Error("unknown command "+r)}return [o,u,s,l]},Uo.prototype.toGeoJSON=function(t,e,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=Uo.types[this.type];function p(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 Ko(t,e,r){if(3===t){var n=new Xo(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n);}}Zo.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 jo(this._pbf,e,this.extent,this._keys,this._values)};var Yo=jo,Jo={VectorTile:function(t,e){this.layers=t.readFields(Ko,{},e);},VectorTileFeature:Yo,VectorTileLayer:Xo},Ho=Jo.VectorTileFeature.types,$o=Math.pow(2,13);function Wo(t,e,r,n,i,a,o,s){t.emplaceBack(e,r,2*Math.floor(n*$o)+o,i*$o*2,a*$o*2,Math.round(s));}var Qo=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 fi,this.indexArray=new Ei,this.programConfigurations=new ha(Ro,t.layers,t.zoom),this.segments=new Gi,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id});};function ts(t,e){return t.x===e.x&&(t.x<0||t.x>da)||t.y===e.y&&(t.y<0||t.y>da)}function es(t){return t.every(function(t){return t.x<0})||t.every(function(t){return t.x>da})||t.every(function(t){return t.y<0})||t.every(function(t){return t.y>da})}Qo.prototype.populate=function(t,e){this.features=[],this.hasPattern=To("fill-extrusion",this.layers,e);for(var r=0,n=t;r=1){var v=f[d-1];if(!ts(m,v)){p.vertexLength+4>Gi.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var g=m.sub(v)._perp()._unit(),x=v.dist(m);y+x>32768&&(y=0),Wo(this.layoutVertexArray,m.x,m.y,g.x,g.y,0,0,y),Wo(this.layoutVertexArray,m.x,m.y,g.x,g.y,0,1,y),y+=x,Wo(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,0,y),Wo(this.layoutVertexArray,v.x,v.y,g.x,g.y,0,1,y);var b=p.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),p.vertexLength+=4,p.primitiveLength+=2;}}}}if(p.vertexLength+s>Gi.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray)),"Polygon"===Ho[t.type]){for(var _=[],w=[],A=p.vertexLength,S=0,k=o;S=2&&t[p-1].equals(t[p-2]);)p--;for(var c=0;c0;if(k&&x>c){var I=h.dist(d);if(I>2*f){var E=h.sub(h.sub(d)._mult(f/I)._round());this.updateDistance(d,E),this.addCurrentVertex(E,v,0,0,y),d=E;}}var M=d&&m,C=M?r:l?"butt":n;if(M&&"round"===C&&(Ai&&(C="bevel"),"bevel"===C&&(A>2&&(C="flipbevel"),A100)b=g.mult(-1);else{var P=A*v.add(g).mag()/v.sub(g).mag();b._perp()._mult(P*(z?-1:1));}this.addCurrentVertex(h,b,0,0,y),this.addCurrentVertex(h,b.mult(-1),0,0,y);}else if("bevel"===C||"fakeround"===C){var B=-Math.sqrt(A*A-1),T=z?B:0,V=z?0:B;if(d&&this.addCurrentVertex(h,v,T,V,y),"fakeround"===C)for(var F=Math.round(180*S/Math.PI/20),O=1;O2*f){var q=h.add(m.sub(h)._mult(f/U)._round());this.updateDistance(h,q),this.addCurrentVertex(q,g,0,0,y),h=q;}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,o,s);}},ps.prototype.addCurrentVertex=function(t,e,r,n,i,a){void 0===a&&(a=!1);var o=e.x+e.y*r,s=e.y-e.x*r,u=-e.x+e.y*n,l=-e.y-e.x*n;this.addHalfVertex(t,o,s,a,!1,r,i),this.addHalfVertex(t,u,l,a,!0,-n,i),this.distance>ls/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,n,i,a));},ps.prototype.addHalfVertex=function(t,e,r,n,i,a,o){var s=t.x,u=t.y,l=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(u<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&l)<<2,l>>6);var p=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,p),o.primitiveLength++),i?this.e2=p:this.e1=p;},ps.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(ls-1):this.distance;},In("LineBucket",ps,{omit:["layers","patternFeatures"]});var cs=new ii({"line-cap":new Qn(Lt.layout_line["line-cap"]),"line-join":new ti(Lt.layout_line["line-join"]),"line-miter-limit":new Qn(Lt.layout_line["line-miter-limit"]),"line-round-limit":new Qn(Lt.layout_line["line-round-limit"]),"line-sort-key":new ti(Lt.layout_line["line-sort-key"])}),hs={paint:new ii({"line-opacity":new ti(Lt.paint_line["line-opacity"]),"line-color":new ti(Lt.paint_line["line-color"]),"line-translate":new Qn(Lt.paint_line["line-translate"]),"line-translate-anchor":new Qn(Lt.paint_line["line-translate-anchor"]),"line-width":new ti(Lt.paint_line["line-width"]),"line-gap-width":new ti(Lt.paint_line["line-gap-width"]),"line-offset":new ti(Lt.paint_line["line-offset"]),"line-blur":new ti(Lt.paint_line["line-blur"]),"line-dasharray":new ri(Lt.paint_line["line-dasharray"]),"line-pattern":new ei(Lt.paint_line["line-pattern"]),"line-gradient":new ni(Lt.paint_line["line-gradient"]),"line-height":new ti(Lt.paint_line["line-height"])}),layout:cs},fs=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 Xn(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=d({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(ti))(hs.paint.properties["line-width"].specification);fs.useIntegerZoom=!0;var ys=function(t){function e(e){t.call(this,e,hs);}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=$a(t,"lineProgress"),this.gradientTexture=null;},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["line-floorwidth"]=fs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e);},e.prototype.createBucket=function(t){return new ps(t)},e.prototype.queryRadius=function(t){var e=t,r=ds(Ta("line-width",this,e),Ta("line-gap-width",this,e)),n=Ta("line-offset",this,e);return r/2+Math.abs(n)+Va(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s,u){var l=Fa(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),p=s/2*ds(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),c=this.paint.get("line-offset").evaluate(e,r);c&&(n=function(t,e){for(var r=[],n=new i(0,0),a=0;a0?e+2*t:t}var ms=li([{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_extra_m",components:3,type:"Uint8"},{name:"a_i_p_e",components:2,type:"Uint16"}],4).members,vs=Jo.VectorTileFeature.types,gs=63,xs=Math.cos(Math.PI/180*37.5),bs=.5,_s=Math.pow(2,14)/bs,ws=0,As=0,Ss=1,ks=0;function zs(t,e,r,n,i,a,o){t.emplaceBack(e.x,e.y,n?1:0,i?1:-1,Math.round(gs*r.x)+128,Math.round(gs*r.y)+128,1+(0===a?0:a<0?-1:1)|(o*bs&63)<<2,o*bs>>6,255&ws,parseInt(As),parseInt(Ss),parseInt(0===e.z?0:e.z-500<6?6:e.z-500+6),parseInt(ks));}var Is=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 di,this.indexArray=new Ei,this.programConfigurations=new ha(ms,t.layers,t.zoom),this.segments=new Gi,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id});};function Es(t,e){return (t/e.tileTotal*(e.end-e.start)+e.start)*(_s-1)}Is.prototype.populate=function(t,e){this.features=[];for(var r=0,n=t;rh){var P=m.dist(w);if(P>2*f){var B=m.sub(m.sub(w)._mult(f/P)._round());this.distance+=B.dist(w),this.addCurrentVertex(B,this.distance,S.mult(1),0,0,!1,d,l),w=B;}}var T=w&&A,V=T?r:A?x:b;if(T&&"round"===V&&(Ma&&(V="bevel"),"bevel"===V&&(M>2&&(V="flipbevel"),M100)I=k.clone().mult(-1);else{var F=S.x*k.y-S.y*k.x>0?-1:1,O=M*S.add(k).mag()/S.sub(k).mag();I._perp()._mult(O*F);}this.addCurrentVertex(m,this.distance,I,0,0,!1,d,l),this.addCurrentVertex(m,this.distance,I.mult(-1),0,0,!1,d,l);}else if("bevel"===V||"fakeround"===V){var L=S.x*k.y-S.y*k.x>0,D=-Math.sqrt(M*M-1);if(L?(g=0,v=D):(v=0,g=D),_||this.addCurrentVertex(m,this.distance,S,v,g,!1,d,l),"fakeround"===V){for(var R=Math.floor(8*(.5-(E-.5))),j=void 0,U=0;U=0;q--)j=S.mult((q+1)/(R+1))._add(k)._unit(),this.addPieSliceVertex(m,this.distance,j,L,d,l);}A&&this.addCurrentVertex(m,this.distance,k,-v,-g,!1,d,l);}else"butt"===V?(_||this.addCurrentVertex(m,this.distance,S,0,0,!1,d,l),A&&this.addCurrentVertex(m,this.distance,k,0,0,!1,d,l)):"square"===V?(_||(this.addCurrentVertex(m,this.distance,S,1,1,!1,d,l),this.e1=this.e2=-1),A&&this.addCurrentVertex(m,this.distance,k,-1,-1,!1,d,l)):"round"===V&&(_||(this.addCurrentVertex(m,this.distance,S,0,0,!1,d,l),this.addCurrentVertex(m,this.distance,S,1,1,!0,d,l),this.e1=this.e2=-1),A&&(this.addCurrentVertex(m,this.distance,k,-1,-1,!0,d,l),this.addCurrentVertex(m,this.distance,k,0,0,!1,d,l)));if(C&&z2*f){var X=m.add(A.sub(m)._mult(f/N)._round());this.distance+=X.dist(m),this.addCurrentVertex(X,this.distance,k.mult(1),0,0,!1,d,l),m=X;}}_=!1;}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,u);}},Is.prototype.addCurrentVertex=function(t,e,r,n,i,a,o,s){var u,l=this.layoutVertexArray,p=this.indexArray;s&&(e=Es(e,s)),u=r.clone(),n&&u._sub(r.perp()._mult(n)),zs(l,t,u,a,!1,n,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(p.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)),zs(l,t,u,a,!0,-i,e),this.e3=o.vertexLength++,this.e1>=0&&this.e2>=0&&(p.emplaceBack(this.e1,this.e2,this.e3),o.primitiveLength++),this.e1=this.e2,this.e2=this.e3,e>_s/2&&!s&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a,o));},Is.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)),zs(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;},In("SpriteBucket",Is,{omit:["layers","features"]});var Ms=new ii({"sprite-cap":new Qn(Lt.layout_sprite["sprite-cap"]),"sprite-join":new ti(Lt.layout_sprite["sprite-join"]),"sprite-miter-limit":new Qn(Lt.layout_sprite["sprite-miter-limit"]),"sprite-round-limit":new Qn(Lt.layout_sprite["sprite-round-limit"])}),Cs={paint:new ii({"sprite-opacity":new ti(Lt.paint_sprite["sprite-opacity"]),"sprite-color":new ti(Lt.paint_sprite["sprite-color"]),"sprite-translate":new Qn(Lt.paint_sprite["sprite-translate"]),"sprite-translate-anchor":new Qn(Lt.paint_sprite["sprite-translate-anchor"]),"sprite-width":new ti(Lt.paint_sprite["sprite-width"]),"sprite-gap-width":new ti(Lt.paint_sprite["sprite-gap-width"]),"sprite-offset":new ti(Lt.paint_sprite["sprite-offset"]),"sprite-blur":new ti(Lt.paint_sprite["sprite-blur"]),"sprite-speed-factor":new Qn(Lt.paint_sprite["sprite-speed-factor"])}),layout:Ms},Ps=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 Xn(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=d({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,n,i)},e}(ti))(Cs.paint.properties["sprite-width"].specification);Ps.useIntegerZoom=!0;var Bs=function(t){function e(e){t.call(this,e,Cs);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"sprite-gradient"===t&&this._updateGradient();},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["sprite-gradient"].value.expression;this.gradient=$a(t,"lineProgress"),this.gradientTexture=null;},e.prototype.recalculate=function(e){t.prototype.recalculate.call(this,e),this.paint._values["sprite-floorwidth"]=Ps.possiblyEvaluate(this._transitioningPaint._values["sprite-width"].value,e);},e.prototype.createBucket=function(t){return new Is(t)},e.prototype.queryRadius=function(t){var e=t,r=Ts(Ta("sprite-width",this,e),Ta("sprite-gap-width",this,e)),n=Ta("sprite-offset",this,e);return r/2+Math.abs(n)+Va(this.paint.get("sprite-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,n,a,o,s){var u=Fa(t,this.paint.get("sprite-translate"),this.paint.get("sprite-translate-anchor"),o.angle,s),l=s/2*Ts(this.paint.get("sprite-width").evaluate(e,r),this.paint.get("sprite-gap-width").evaluate(e,r)),p=this.paint.get("sprite-offset").evaluate(e,r);return p&&(n=function(t,e){for(var r=[],n=new i(0,0),a=0;a0?e+2*t:t}var Vs=li([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),Fs=li([{name:"a_projected_pos",components:3,type:"Float32"}],4),Os=(li([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),li([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Ls=(li([{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"}]),li([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Ds=li([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);li([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"}]),li([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"radialTextOffset"}]),li([{type:"Float32",name:"offsetX"}]),li([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);function Rs(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()),Nn.applyArabicShaping&&(t=Nn.applyArabicShaping(t)),t}(t.text,e,r);}),t}var js={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Us=24,qs={horizontal:1,vertical:2,horizontalOnly:3},Ns=function(){this.text="",this.sectionIndex=[],this.sections=[];};function Xs(t,e,r,n,i,a,o,s,u,l,p){var c,h=Ns.fromFeature(t,r);l===qs.vertical&&h.verticalizePunctuation();var f=Nn.processBidirectionalText,y=Nn.processStyledBidirectionalText;if(f&&1===h.sections.length){c=[];for(var d=0,m=f(h.toString(),Hs(h,s,n,e));d=0&&n>=t&&Zs[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r);},Ns.prototype.substring=function(t,e){var r=new Ns;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Ns.prototype.toString=function(){return this.text},Ns.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce(function(e,r){return Math.max(e,t.sections[r].scale)},0)};var Zs={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Gs={};function Ks(t,e,r,n){var i=Math.pow(t-e,2);return n?t=0,u=0,l=0;l0)&&("constant"!==i.value.kind||i.value.value.length>0),u="constant"!==o.value.kind||o.value.value&&o.value.value.length>0,l=n.get("symbol-sort-key");if(this.features=[],s||u){for(var p=e.iconDependencies,c=e.glyphDependencies,h=new Xn(this.zoom),f=0,y=t;f=0;for(var z=0,I=x.sections;z=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,l?this.collisionCircle:this.collisionBox,i.anchorPoint,r,l);}},cu.prototype.generateCollisionDebugBuffers=function(){for(var t=0;t0},cu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},cu.prototype.hasCollisionBoxData=function(){return this.collisionBox.segments.get().length>0},cu.prototype.hasCollisionCircleData=function(){return this.collisionCircle.segments.get().length>0},cu.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)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(t)===r&&e.addIndicesForPlacedTextSymbol(t);}),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedTextSymbol(a.verticalPlacedTextSymbolIndex);var o=this.icon.placedSymbolArray.get(i);if(o.numGlyphs){var s=o.vertexStartIndex;this.icon.indexArray.emplaceBack(s,s+1,s+2),this.icon.indexArray.emplaceBack(s+1,s+2,s+3);}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray);}},In("SymbolBucket",cu,{omit:["layers","collisionBoxArray","features","compareText"]}),cu.MAX_GLYPHS=65535,cu.addDynamicAttributes=uu;var hu=new ii({"symbol-placement":new Qn(Lt.layout_symbol["symbol-placement"]),"symbol-spacing":new Qn(Lt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Qn(Lt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ti(Lt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Qn(Lt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Qn(Lt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Qn(Lt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Qn(Lt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Qn(Lt.layout_symbol["icon-rotation-alignment"]),"icon-size":new ti(Lt.layout_symbol["icon-size"]),"icon-text-fit":new Qn(Lt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Qn(Lt.layout_symbol["icon-text-fit-padding"]),"icon-image":new ti(Lt.layout_symbol["icon-image"]),"icon-rotate":new ti(Lt.layout_symbol["icon-rotate"]),"icon-padding":new Qn(Lt.layout_symbol["icon-padding"]),"icon-keep-upright":new Qn(Lt.layout_symbol["icon-keep-upright"]),"icon-offset":new ti(Lt.layout_symbol["icon-offset"]),"icon-anchor":new ti(Lt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Qn(Lt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Qn(Lt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Qn(Lt.layout_symbol["text-rotation-alignment"]),"text-field":new ti(Lt.layout_symbol["text-field"]),"text-font":new ti(Lt.layout_symbol["text-font"]),"text-size":new ti(Lt.layout_symbol["text-size"]),"text-max-width":new ti(Lt.layout_symbol["text-max-width"]),"text-line-height":new Qn(Lt.layout_symbol["text-line-height"]),"text-letter-spacing":new ti(Lt.layout_symbol["text-letter-spacing"]),"text-justify":new ti(Lt.layout_symbol["text-justify"]),"text-radial-offset":new ti(Lt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Qn(Lt.layout_symbol["text-variable-anchor"]),"text-anchor":new ti(Lt.layout_symbol["text-anchor"]),"text-max-angle":new Qn(Lt.layout_symbol["text-max-angle"]),"text-writing-mode":new Qn(Lt.layout_symbol["text-writing-mode"]),"text-rotate":new ti(Lt.layout_symbol["text-rotate"]),"text-padding":new Qn(Lt.layout_symbol["text-padding"]),"text-keep-upright":new Qn(Lt.layout_symbol["text-keep-upright"]),"text-transform":new ti(Lt.layout_symbol["text-transform"]),"text-offset":new ti(Lt.layout_symbol["text-offset"]),"text-allow-overlap":new Qn(Lt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Qn(Lt.layout_symbol["text-ignore-placement"]),"text-optional":new Qn(Lt.layout_symbol["text-optional"])}),fu={paint:new ii({"icon-opacity":new ti(Lt.paint_symbol["icon-opacity"]),"icon-color":new ti(Lt.paint_symbol["icon-color"]),"icon-halo-color":new ti(Lt.paint_symbol["icon-halo-color"]),"icon-halo-width":new ti(Lt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ti(Lt.paint_symbol["icon-halo-blur"]),"icon-translate":new Qn(Lt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Qn(Lt.paint_symbol["icon-translate-anchor"]),"text-opacity":new ti(Lt.paint_symbol["text-opacity"]),"text-color":new ti(Lt.paint_symbol["text-color"],{runtimeType:Ht,getOverride:function(t){return t.textColor},hasOverride:function(t){return !!t.textColor}}),"text-halo-color":new ti(Lt.paint_symbol["text-halo-color"]),"text-halo-width":new ti(Lt.paint_symbol["text-halo-width"]),"text-halo-blur":new ti(Lt.paint_symbol["text-halo-blur"]),"text-translate":new Qn(Lt.paint_symbol["text-translate"]),"text-translate-anchor":new Qn(Lt.paint_symbol["text-translate-anchor"]),"symbol-height":new ti(Lt.paint_symbol["symbol-height"])}),layout:hu},yu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Gt,this.defaultValue=t;};yu.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},yu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression);},yu.prototype.possibleOutputs=function(){return [void 0]},yu.prototype.serialize=function(){return null},In("FormatSectionOverride",yu,{omit:["defaultValue"]});var du=function(t){function e(e){t.call(this,e,fu);}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e){if(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")),"point"===this.layout.get("symbol-placement")){var r=this.layout.get("text-writing-mode");if(r){for(var n=[],i=0,a=r;i=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,p=-7,c=r?i-1:0,h=r?-1:1,f=t[e+c];for(c+=h,a=f&(1<<-p)-1,f>>=-p,p+=s;p>0;a=256*a+t[e+c],c+=h,p-=8);for(o=a&(1<<-p)-1,a>>=-p,p+=n;p>0;o=256*o+t[e+c],c+=h,p-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=l;}return (f?-1:1)*o*Math.pow(2,a-n)},Bu=function(t,e,r,n,i,a){var o,s,u,l=8*a-i-1,p=(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=p):(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>=p?(s=0,o=p):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,l-=8);t[r+f-y]|=128*d;},Tu=Vu;function Vu(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length;}Vu.Varint=0,Vu.Fixed64=1,Vu.Bytes=2,Vu.Fixed32=5;function Fu(t){return t.type===Vu.Bytes?t.readVarint()+t.pos:t.pos+1}function Ou(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Lu(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(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 Du(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24;}function Ju(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Vu.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=Ku(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ju(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Ku(this.buf,this.pos)+4294967296*Ku(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Ku(this.buf,this.pos)+4294967296*Ju(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Pu(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Pu(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 Ou(t,n,e);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return Ou(t,n,e);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return Ou(t,n,e);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return Ou(t,n,e);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return Ou(t,n,e);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return Ou(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+p>r)break;1===p?u<128&&(l=u):2===p?128==(192&(a=t[i+1]))&&(l=(31&u)<<6|63&a)<=127&&(l=null):3===p?(a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&((l=(15&u)<<12|(63&a)<<6|63&o)<=2047||l>=55296&&l<=57343)&&(l=null)):4===p&&(a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((l=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,p=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=p;}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){if(this.type!==Vu.Bytes)return t.push(this.readVarint(e));var r=Fu(this);for(t=t||[];this.pos127;);else if(e===Vu.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Vu.Fixed32)this.pos+=4;else{if(e!==Vu.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&&Lu(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r;},writeFloat:function(t){this.realloc(4),Bu(this.buf,t,this.pos,!0,23,4),this.pos+=4;},writeDouble:function(t){this.realloc(8),Bu(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&&Lu(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n;},writeMessage:function(t,e,r){this.writeTag(t,Vu.Bytes),this.writeRawMessage(e,r);},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Du,e);},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Ru,e);},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,qu,e);},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,ju,e);},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Uu,e);},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Nu,e);},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Xu,e);},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Zu,e);},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Gu,e);},writeBytesField:function(t,e){this.writeTag(t,Vu.Bytes),this.writeBytes(e);},writeFixed32Field:function(t,e){this.writeTag(t,Vu.Fixed32),this.writeFixed32(e);},writeSFixed32Field:function(t,e){this.writeTag(t,Vu.Fixed32),this.writeSFixed32(e);},writeFixed64Field:function(t,e){this.writeTag(t,Vu.Fixed64),this.writeFixed64(e);},writeSFixed64Field:function(t,e){this.writeTag(t,Vu.Fixed64),this.writeSFixed64(e);},writeVarintField:function(t,e){this.writeTag(t,Vu.Varint),this.writeVarint(e);},writeSVarintField:function(t,e){this.writeTag(t,Vu.Varint),this.writeSVarint(e);},writeStringField:function(t,e){this.writeTag(t,Vu.Bytes),this.writeString(e);},writeFloatField:function(t,e){this.writeTag(t,Vu.Fixed32),this.writeFloat(e);},writeDoubleField:function(t,e){this.writeTag(t,Vu.Fixed64),this.writeDouble(e);},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e));}};var Hu=3;function $u(t,e,r){1===t&&r.readMessage(Wu,e);}function Wu(t,e,r){if(3===t){var n=r.readMessage(Qu,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,u=n.left,l=n.top,p=n.advance;e.push({id:i,bitmap:new Ya({width:o+2*Hu,height:s+2*Hu},a),metrics:{width:o,height:s,left:u,top:l,advance:p}});}}function Qu(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 tl=Hu,el=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback();});};el.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){t._triggered=!1,t._callback();},0));};var rl=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},_(["receive","process"],this),this.invoker=new el(this.process),this.target.addEventListener("message",this.receive,!1);};rl.prototype.send=function(t,e,r,n){var i=this,a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);var o=[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:n,sourceMapId:this.mapId,data:Mn(e,o)},o),{cancel:function(){r&&delete i.callbacks[a],i.target.postMessage({id:a,type:"",targetMapId:n,sourceMapId:i.mapId});}}},rl.prototype.receive=function(t){var e=t.data,r=e.id;if(r&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n();}else this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger();},rl.prototype.process=function(){var t=this;if(this.taskQueue.length){var e=this.taskQueue.shift(),r=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),r)if(""===r.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(r.error?n(Cn(r.error)):n(null,Cn(r.data)));}else{var i=!1,a=r.hasCallback?function(r,n){i=!0,delete t.cancelCallbacks[e];var a=[];t.target.postMessage({id:e,type:"",sourceMapId:t.mapId,error:r?Mn(r):null,data:Mn(n,a)},a);}:function(t){i=!0;},o=null,s=Cn(r.data);if(this.parent[r.type])o=this.parent[r.type](r.sourceMapId,s,a);else if(this.parent.getWorkerSource){var u=r.type.split(".");o=this.parent.getWorkerSource(r.sourceMapId,u[0],s.source)[u[1]](s,a);}else a(new Error("Could not find function "+r.type));!i&&o&&o.cancel&&(this.cancelCallbacks[e]=o.cancel);}}},rl.prototype.remove=function(){this.target.removeEventListener("message",this.receive,!1);};var nl=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]));};nl.prototype.setNorthEast=function(t){return this._ne=t instanceof il?new il(t.lng,t.lat):il.convert(t),this},nl.prototype.setSouthWest=function(t){return this._sw=t instanceof il?new il(t.lng,t.lat):il.convert(t),this},nl.prototype.extend=function(t){var e,r,n=this._sw,i=this._ne;if(t instanceof il)e=t,r=t;else{if(!(t instanceof nl))return Array.isArray(t)?t.every(Array.isArray)?this.extend(nl.convert(t)):this.extend(il.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 il(e.lng,e.lat),this._ne=new il(r.lng,r.lat)),this},nl.prototype.getCenter=function(){return new il((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},nl.prototype.getSouthWest=function(){return this._sw},nl.prototype.getNorthEast=function(){return this._ne},nl.prototype.getNorthWest=function(){return new il(this.getWest(),this.getNorth())},nl.prototype.getSouthEast=function(){return new il(this.getEast(),this.getSouth())},nl.prototype.getWest=function(){return this._sw.lng},nl.prototype.getSouth=function(){return this._sw.lat},nl.prototype.getEast=function(){return this._ne.lng},nl.prototype.getNorth=function(){return this._ne.lat},nl.prototype.toArray=function(){return [this._sw.toArray(),this._ne.toArray()]},nl.prototype.toString=function(){return "LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},nl.prototype.isEmpty=function(){return !(this._sw&&this._ne)},nl.convert=function(t){return !t||t instanceof nl?t:new nl(t)};var il=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");this.lng=+t,this.lat=+e;};function al(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]}il.prototype.wrap=function(t){var e=t.getExtent();return new il(c(this.lng,e[0],e[2]),this.lat)},il.prototype.toArray=function(){return [this.lng,this.lat]},il.prototype.toString=function(){return "LngLat("+this.lng+", "+this.lat+")"},il.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,r=e/Math.cos(Math.PI/180*this.lat);return new nl(new il(this.lng-r,this.lat-e),new il(this.lng+r,this.lat+e))},il.convert=function(t){if(t instanceof il)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new il(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new il(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 ol={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},sl={};sl[ol.DEGREES]=2*Math.PI*6370997/360,sl[ol.FEET]=.3048,sl[ol.METERS]=1,sl[ol.USFEET]=1200/3937;var ul=2*Math.PI*6378137;function ll(t){return ul*Math.cos(t*Math.PI/180)}function pl(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var cl={maxExtent:360,minX:-180,minY:-85,maxX:180,maxY:85,circumferenceAtLatitude:ll,mercatorXfromLng:function(t){return (180+t)/360},mercatorYfromLat:function(t){return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360},mercatorZfromAltitude:function(t,e){return t/ll(e)},lngFromMercatorX:function(t){return 360*t-180},latFromMercatorY:pl,altitudeFromMercatorZ:function(t,e){return t*ll(pl(e))},mercatorScale:function(t){return 1/Math.cos(t*Math.PI/180)},getTileBBox:function(t,e,r){var n=al(256*t,256*(e=Math.pow(2,r)-e-1),r),i=al(256*(t+1),256*(e+1),r);return n[0]+","+n[1]+","+i[0]+","+i[1]}},hl=function(t){this.projection=t;var e=t.getMaxExtent(),r=t.getExtent(),n=r[0],i=r[1],a=r[2],o=r[3];this.maxExtent=e,this.minX=n,this.minY=i,this.maxX=a,this.maxY=o,this.units=t.getUnits();};function fl(t,e,r){return t[0]<=e&&e<=t[2]&&t[1]<=r&&r<=t[3]}function yl(){return [1/0,1/0,-1/0,-1/0]}function dl(t,e,r,n,i){return i?(i[0]=t,i[1]=e,i[2]=r,i[3]=n,i):[t,e,r,n]}function ml(t){return dl(1/0,1/0,-1/0,-1/0,t)}function vl(t,e){return t[0]===e[0]&&t[2]===e[2]&&t[1]===e[1]&&t[3]===e[3]}function gl(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1]);}function xl(t,e){for(var r=0,n=e.length;re[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Bl(t){return t[2]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t},extendCoordinate:gl,extendCoordinates:xl,extendFlatCoordinates:bl,extendRings:_l,extendXY:wl,forEachCorner:function(t,e){var r;return (r=e(Sl(t)))?r:(r=e(kl(t)))?r:(r=e(Ml(t)))?r:(r=e(El(t)))||!1},getArea:Al,getBottomLeft:Sl,getBottomRight:kl,getCenter:function(t){return [(t[0]+t[2])/2,(t[1]+t[3])/2]},getEnlargedArea:function(t,e){var r=Math.min(t[0],e[0]),n=Math.min(t[1],e[1]);return (Math.max(t[2],e[2])-r)*(Math.max(t[3],e[3])-n)},getForViewAndSize:function(t,e,r,n,i){var a=e*n[0]/2,o=e*n[1]/2,s=Math.cos(r),u=Math.sin(r),l=a*s,p=a*u,c=o*s,h=o*u,f=t[0],y=t[1],d=f-l+h,m=f-l-h,v=f+l-h,g=f+l+h,x=y-p-c,b=y-p+c,_=y+p+c,w=y+p-c;return dl(Math.min(d,m,v,g),Math.min(x,b,_,w),Math.max(d,m,v,g),Math.max(x,b,_,w),i)},getHeight:zl,getIntersectionArea:function(t,e){return Al(Il(t,e))},getIntersection:Il,getMargin:function(t){return Cl(t)+zl(t)},getSize:function(t){return [t[2]-t[0],t[3]-t[1]]},getTopLeft:El,getTopRight:Ml,getWidth:Cl,intersects:Pl,isEmpty:Bl,returnOrUpdate:function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t},scaleFromCenter:function(t,e){var r=(t[2]-t[0])/2*(e-1),n=(t[3]-t[1])/2*(e-1);t[0]-=r,t[2]+=r,t[1]-=n,t[3]+=n;},applyTransform:function(t,e,r){var n=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];return e(n,n,2),function(t,e,r){return dl(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}([n[0],n[2],n[4],n[6]],[n[1],n[3],n[5],n[7]],r)}});function Vl(t,e){void 0===e&&(e={});var r=e.valueProcessors;void 0===r&&(r=[]);var n=e.keyProcessors;void 0===n&&(n=[]);var i=e.ignores;void 0===i&&(i=[]);var a,o,s=(a=t,{"[object Boolean]":"boolean","[object number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"}[Object.prototype.toString.call(a)]);if("array"===s)o=[];else{if("object"!==s)return t;o={};}if("array"===s)for(var u=0;u=0;r--){if(e(t[r],r,t))return r}return -1}(this.resolutions_,function(t){return null!=t}):null},Fl.prototype.getTransform=function(){return "EPSG:mapbox"===this.code_||"EPSG:mapbox"===this.originCode?cl:(this.transform_||(this.transform_=new hl(this)),this.transform_)},Fl.prototype.getCode=function(){return this.code_},Fl.prototype.getUnits=function(){return this.units_},Fl.prototype.getExtent=function(){return [].concat(this.extent_)},Fl.prototype.getResolutions=function(){return this.resolutions_?[].concat(this.resolutions_):null},Fl.prototype.getTileSize=function(){return this.tileSize_},Fl.prototype.getValidlatRange=function(){return [].concat(this.validlatRange_)},Fl.prototype.getMaxExtent=function(){return this.maxExtent_||(this.maxExtent_=Math.max(zl(this.extent_),Cl(this.extent_))),this.maxExtent_},Fl.prototype.setResolutions=function(t){this.resolutions_=[].concat(t);},Fl.prototype.setTileSize=function(t){this.tileSize_=t;},Fl.prototype.setValidlatRange=function(t){this.validlatRange_=[].concat(t);},Fl.prototype.clone=function(){var t=new Fl({code:this.code_,units:this.units_,extent:this.extent_,resolutions:this.resolutions_,tileSize:this.tileSize_,validlatRange:this.validlatRange_});return t.originCode=this.originCode,t},Fl.prototype.getZoomResolution=function(t){if(this.resolutions_){var e=this.resolutions_[Math.floor(t)],r=this.resolutions_[Math.ceil(t)];return e?r?e+(t-Math.floor(t))*(r-e):this.resolutions_[this.maxZoom]:this.resolutions_[this.minZoom]}return this.getMaxExtent()/(this.tileSize_*Math.pow(2,t))},Fl.prototype.zoomScale=function(t){return this.resolutions_?this.getMaxExtent()/this.getZoomResolution(t)/this.tileSize_:Math.pow(2,t)},Fl.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Object.defineProperties(Fl.prototype,Ol),In("Projection",Fl,{omit:["maxExtent_","transform_"]});var Ll=2*Math.PI*6378137,Dl=function(t,e,r,n){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r,this.projection=n;};Dl.fromLngLat=function(t,e,r){void 0===e&&(e=0);var n=il.convert(t);return new Dl(r.getTransform().mercatorXfromLng(n.lng),r.getTransform().mercatorYfromLat(n.lat),r.getTransform().mercatorZfromAltitude(e,n.lat),r)},Dl.prototype.toLngLat=function(){return new il(this.projection.getTransform().lngFromMercatorX(this.x),this.projection.getTransform().latFromMercatorY(this.y))},Dl.prototype.toAltitude=function(){return this.projection.getTransform().altitudeFromMercatorZ(this.z,this.y)},Dl.prototype.meterInMercatorCoordinateUnits=function(){return 1/Ll*this.projection.getTransform().mercatorScale(this.projection.getTransform().latFromMercatorY(this.y))};var Rl=function(t,e,r){this.z=t,this.x=e,this.y=r,this.key=ql(0,t,e,r);};Rl.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Rl.prototype.url=function(t,e,r){var n,i,a;void 0===r&&(r="xyz"),"string"==typeof r?n=r:(n=r.scheme||"xyz",i=r.rasterType,a=r.zoomOffset);var o=this.x,s=this.y,u=this.z,l=e.getTransform().getTileBBox(o,s,u),p=function(t,e,r){for(var n,i="",a=t;a>0;a--)i+=(e&(n=1<this.canonical.z?new Ul(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Ul(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Ul.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return !1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ>e&&t.canonical.y===this.canonical.y>>e},Ul.prototype.children=function(t){if(this.overscaledZ>=t)return [new Ul(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 Ul(e,this.wrap,e,r,n),new Ul(e,this.wrap,e,r+1,n),new Ul(e,this.wrap,e,r,n+1),new Ul(e,this.wrap,e,r+1,n+1)]},Ul.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return (e+1)*this.stride+(t+1)},Nl.prototype._unpackMapbox=function(t,e,r){return (256*t*256+256*e+r)/10-1e4},Nl.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},Nl.prototype.getPixels=function(){return new Ja({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Nl.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=-e*this.dim,u=-r*this.dim,l=a;l=0)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][r]=null);else if(void 0!==e&&e>=0){if(this.stateChanges[t]&&this.stateChanges[t][n])for(r in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][r]=null;else this.deletedStates[t][n]=null;}else this.deletedStates[t]=null;}},ap.prototype.getState=function(t,e){var r=String(e),n=this.state[t]||{},i=this.stateChanges[t]||{},a=d({},n[r],i[r]);if(null===this.deletedStates[t])return {};if(this.deletedStates[t]){var o=this.deletedStates[t][e];if(null===o)return {};for(var s in o)delete a[s];}return a},ap.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e);},ap.prototype.coalesceChanges=function(t,e){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var i={};for(var a in this.stateChanges[n])this.state[n][a]||(this.state[n][a]={}),d(this.state[n][a],this.stateChanges[n][a]),i[a]=this.state[n][a];r[n]=i;}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(null===this.deletedStates[o])for(var u in this.state[o])s[u]={},this.state[o][u]={};else for(var l in this.deletedStates[o]){if(null===this.deletedStates[o][l])this.state[o][l]={};else for(var p=0,c=Object.keys(this.deletedStates[o][l]);p=0&&p[3]>=0&&s.insert(o,p[0],p[1],p[2],p[3]);}},op.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Jo.VectorTile(new Tu(this.rawTileData)).layers,this.sourceLayerCoder=new Zl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},op.prototype.query=function(t,e,r){var n=this;this.loadVTLayers();for(var a=t.params||{},o=da/t.tileSize/t.scale,s=Jr(a.filter),u=t.queryGeometry,l=t.queryPadding*o,p=sp(u),c=this.grid.query(p.minX-l,p.minY-l,p.maxX+l,p.maxY+l),h=sp(t.cameraQueryGeometry),f=this.grid3D.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l,function(e,r,n,a){return function(t,e,r,n,a){for(var o=0,s=t;o=u.x&&a>=u.y)return !0}var l=[new i(e,r),new i(e,a),new i(n,a),new i(n,r)];if(t.length>2)for(var p=0,c=l;p>u.z,p=new i(u.x*l,u.y*l),c=new i(p.x+l,p.y+l),h=this.segments.prepareSegment(4,r,n);r.emplaceBack(p.x,p.y,p.x,p.y),r.emplaceBack(c.x,p.y,c.x,p.y),r.emplaceBack(p.x,c.y,p.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,Xl.members),this.maskedIndexBuffer=e.createIndexBuffer(n);}},lp.prototype.hasData=function(){return "loaded"===this.state||"reloading"===this.state||"expired"===this.state},lp.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},lp.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var r=B(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-r/2;){if(--o<0)return !1;s-=t[o].dist(a),a=t[o];}s+=t[o].dist(t[o+1]),o++;for(var u=[],l=0;sn;)l-=u.shift().angleDelta;if(l>i)return !1;o++,s+=c.dist(h);}return !0}function cp(t){for(var e=0,r=0;rl){var y=(l-u)/f,d=Pe(c.x,h.x,y),m=Pe(c.y,h.y,y),v=new Qs(d,m,h.angleTo(c),p);return v._round(),!o||pp(t,v,s,o,e)?v:void 0}u+=f;}}function dp(t,e,r,n,i,a,o,s,u){var l=hp(n,a,o),p=fp(n,i),c=p*o,h=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-c=0&&_=0&&w=0&&f+p<=c){var A=new Qs(_,w,x,d);A._round(),i&&!pp(e,A,o,i,a)||y.push(A);}}h+=g;}u||y.length||s||(y=t(e,h/2,n,i,a,o,s,!0,l));return y}(t,h?e/2*s%e:(p/2+2*a)*o*s%e,e,l,r,c,h,!1,u)}var mp=function(t,e,r,n,a,o,s,u,l,p,c,h){var f=s.top*u-l,y=s.bottom*u+l,d=s.left*u-l,m=s.right*u+l;if(this.boxStartIndex=t.length,p){var v=y-f,g=m-d;v>0&&(v=Math.max(10*u,v),this._addLineCollisionCircles(t,e,r,r.segment,g,v,n,a,o,c));}else{if(h){var x=new i(d,f),b=new i(m,f),_=new i(d,y),w=new i(m,y),A=h*Math.PI/180;x._rotate(A),b._rotate(A),_._rotate(A),w._rotate(A),d=Math.min(x.x,b.x,_.x,w.x),m=Math.max(x.x,b.x,_.x,w.x),f=Math.min(x.y,b.y,_.y,w.y),y=Math.max(x.y,b.y,_.y,w.y);}t.emplaceBack(r.x,r.y,d,f,m,y,n,a,o,0,0);}this.boxEndIndex=t.length;};mp.prototype._addLineCollisionCircles=function(t,e,r,n,i,a,o,s,u,l){var p=a/2,c=Math.floor(i/p)||1,h=1+.4*Math.log(l)/Math.LN2,f=Math.floor(c*h/2),y=-a/2,d=r,m=n+1,v=y,g=-i/2,x=g-i/4;do{if(--m<0){if(v>g)return;m=0;break}v-=e[m].dist(d),d=e[m];}while(v>x);for(var b=e[m].dist(e[m+1]),_=-f;_i&&(A+=w-i),!(A=e.length)return;b=e[m].dist(e[m+1]);}var S=A-v,k=e[m],z=e[m+1].sub(k)._unit()._mult(S)._add(k)._round(),I=Math.abs(A-y)0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r);};function gp(t,e){return te?1:0}function xp(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var n=1/0,a=1/0,o=-1/0,s=-1/0,u=t[0],l=0;lo)&&(o=p.x),(!l||p.y>s)&&(s=p.y);}var c=o-n,h=s-a,f=Math.min(c,h),y=f/2,d=new vp([],bp);if(0===f)return new i(n,a);for(var m=n;mg.d||!g.d)&&(g=b,r&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,x)),b.max-g.d<=e||(y=b.h/2,d.push(new _p(b.p.x-y,b.p.y-y,y,t)),d.push(new _p(b.p.x+y,b.p.y-y,y,t)),d.push(new _p(b.p.x-y,b.p.y+y,y,t)),d.push(new _p(b.p.x+y,b.p.y+y,y,t)),x+=4);}return r&&(console.log("num probes: "+x),console.log("best distance: "+g.d)),g.p}function bp(t,e){return e.max-t.max}function _p(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){for(var r=!1,n=1/0,i=0;it.y!=p.y>t.y&&t.x<(p.x-l.x)*(t.y-l.y)/(p.y-l.y)+l.x&&(r=!r),n=Math.min(n,Ma(t,l,p));}return (r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2;}vp.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1);},vp.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},vp.prototype.peek=function(){return this.data[0]},vp.prototype._up=function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,a=e[i];if(r(n,a)>=0)break;e[t]=a,t=i;}e[t]=n;},vp.prototype._down=function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=o,t=a;}e[t]=i;};var wp=e(function(t){t.exports=function(t,e){var r,n,i,a,o,s,u,l;for(r=3&t.length,n=t.length-r,i=e,o=3432918353,s=461845907,l=0;l>>16)*o&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*o+(((u>>>16)*o&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295;}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};}),Ap=e(function(t){t.exports=function(t,e){for(var r,n=t.length,i=e^n,a=0;n>=4;)r=1540483477*(65535&(r=255&t.charCodeAt(a)|(255&t.charCodeAt(++a))<<8|(255&t.charCodeAt(++a))<<16|(255&t.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&t.charCodeAt(a+2))<<16;case 2:i^=(255&t.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16);}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};}),Sp=wp,kp=wp,zp=Ap;Sp.murmur3=kp,Sp.murmur2=zp;var Ip=7;function Ep(t,e){var r=0,n=0,i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=i-Ip;break;case"bottom-right":case"bottom-left":n=-i+Ip;break;case"bottom":n=-e+Ip;break;case"top":n=e-Ip;}switch(t){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=e;break;case"right":r=-e;}return [r,n]}function Mp(t){switch(t){case"right":case"top-right":case"bottom-right":return "right";case"left":case"top-left":case"bottom-left":return "left"}return "center"}var Cp=65535;function Pp(t,e,r,n,a,o,s,u,l,p,c,h,f){var y=function(t,e,r,n,a,o,s,u){for(var l=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,p=e.positionedGlyphs,c=[],h=0;hCp&&E(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'):"composite"===d.kind&&((m=[tu*f.compositeTextSizes[0].evaluate(o,{}),tu*f.compositeTextSizes[1].evaluate(o,{})])[0]>Cp||m[1]>Cp)&&E(t.layerIds[0]+': Value for "text-size" is >= 256. Reduce your "text-size".'),t.addSymbols(t.text,y,m,s,a,o,l,e,u.lineStartIndex,u.lineLength);for(var v=0,g=p;v=0;o--)if(n.dist(a[o])yt&&(t.getActor().send("enforceCacheSizeLimit",ft),xt=0);},t.clamp=p,t.clearTileCache=function(t){var e=self.caches.delete(ht);t&&e.catch(t).then(function(){return t()});},t.clone=function(t){var e=new Da(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=k,t.config=Z,t.create=function(){var t=new Da(16);return Da!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new Da(9);return Da!=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},t.create$2=function(){var t=new Da(4);return Da!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Or,t.createLayout=li,t.createStyleLayer=function(t){return "custom"===t.type?new bu(t):new _u[t.type](t)},t.deepCopy=Vl,t.deepEqual=o,t.ease=l,t.emitValidationErrors=_n,t.endsWith=w,t.enforceCacheSizeLimit=function(t){self.caches&&self.caches.open(ht).then(function(e){e.keys().then(function(r){for(var n=0;n=da||l.y<0||l.y>=da||function(t,e,r,n,a,o,s,u,l,p,c,h,f,y,d,m,v,g,x,b,_){var w,A,S,k=t.addToLineVertexArray(e,r),z=0,I=0,M=0,C={},P=Sp(""),B=(o.layout.get("text-radial-offset").evaluate(x,{})||0)*Us;if(t.allowVerticalPlacement&&n.vertical){var T=o.layout.get("text-rotate").evaluate(x,{})+90,V=n.vertical;S=new mp(s,r,e,u,l,p,V,c,h,f,t.overscaling,T);}for(var F in n.horizontal){var O=n.horizontal[F];if(!w){P=Sp(O.text);var L=o.layout.get("text-rotate").evaluate(x,{});w=new mp(s,r,e,u,l,p,O,c,h,f,t.overscaling,L);}var D=1===O.lineCount;if(I+=Pp(t,e,O,o,f,x,y,k,n.vertical?qs.horizontal:qs.horizontalOnly,D?Object.keys(n.horizontal):[F],C,b,_),D)break}n.vertical&&(M+=Pp(t,e,n.vertical,o,f,x,y,k,qs.vertical,["vertical"],C,b,_));var R=w?w.boxStartIndex:t.collisionBoxArray.length,j=w?w.boxEndIndex:t.collisionBoxArray.length,U=S?S.boxStartIndex:t.collisionBoxArray.length,q=S?S.boxEndIndex:t.collisionBoxArray.length;if(a){var N=function(t,e,r,n,a,o){var s,u,l,p,c=e.image,h=r.layout,f=e.top-1/c.pixelRatio,y=e.left-1/c.pixelRatio,d=e.bottom+1/c.pixelRatio,m=e.right+1/c.pixelRatio;if("none"!==h.get("icon-text-fit")&&a){var v=m-y,g=d-f,x=h.get("text-size").evaluate(o,{})/24,b=a.left*x,_=a.right*x,w=a.top*x,A=_-b,S=a.bottom*x-w,k=h.get("icon-text-fit-padding")[0],z=h.get("icon-text-fit-padding")[1],I=h.get("icon-text-fit-padding")[2],E=h.get("icon-text-fit-padding")[3],M="width"===h.get("icon-text-fit")?.5*(S-g):0,C="height"===h.get("icon-text-fit")?.5*(A-v):0,P="width"===h.get("icon-text-fit")||"both"===h.get("icon-text-fit")?A:v,B="height"===h.get("icon-text-fit")||"both"===h.get("icon-text-fit")?S:g;s=new i(b+C-E,w+M-k),u=new i(b+C+z+P,w+M-k),l=new i(b+C+z+P,w+M+I+B),p=new i(b+C-E,w+M+I+B);}else s=new i(y,f),u=new i(m,f),l=new i(m,d),p=new i(y,d);var T=r.layout.get("icon-rotate").evaluate(o,{})*Math.PI/180;if(T){var V=Math.sin(T),F=Math.cos(T),O=[F,-V,V,F];s._matMult(O),u._matMult(O),p._matMult(O),l._matMult(O);}return [{tl:s,tr:u,bl:p,br:l,tex:c.paddedRect,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0}]}(0,a,o,0,Bp(n.horizontal),x),X=o.layout.get("icon-rotate").evaluate(x,{});A=new mp(s,r,e,u,l,p,a,d,m,!1,t.overscaling,X),z=4*N.length;var Z=t.iconSizeData,G=null;"source"===Z.kind?(G=[tu*o.layout.get("icon-size").evaluate(x,{})])[0]>Cp&&E(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'):"composite"===Z.kind&&((G=[tu*_.compositeIconSizes[0].evaluate(x,{}),tu*_.compositeIconSizes[1].evaluate(x,{})])[0]>Cp||G[1]>Cp)&&E(t.layerIds[0]+': Value for "icon-size" is >= 256. Reduce your "icon-size".'),t.addSymbols(t.icon,N,G,g,v,x,!1,e,k.lineStartIndex,k.lineLength);}var K=A?A.boxStartIndex:t.collisionBoxArray.length,Y=A?A.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=cu.MAX_GLYPHS&&E("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907");t.symbolInstances.emplaceBack(e.x,e.y,C.right>=0?C.right:-1,C.center>=0?C.center:-1,C.left>=0?C.left:-1,C.vertical||-1,P,R,j,U,q,K,Y,u,I,M,z,0,c,B);}(t,l,u,r,n,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,d,x,w,s,v,b,A,h,e,a,o);};if("line"===S)for(var I=0,M=function(t,e,r,n,a){for(var o=[],s=0;s=n&&h.x>=n||(c.x>=n?c=new i(n,c.y+(h.y-c.y)*((n-c.x)/(h.x-c.x)))._round():h.x>=n&&(h=new i(n,c.y+(h.y-c.y)*((n-c.x)/(h.x-c.x)))._round()),c.y>=a&&h.y>=a||(c.y>=a?c=new i(c.x+(h.x-c.x)*((a-c.y)/(h.y-c.y)),a)._round():h.y>=a&&(h=new i(c.x+(h.x-c.x)*((a-c.y)/(h.y-c.y)),a)._round()),l&&c.equals(l[l.length-1])||(l=[c],o.push(l)),l.push(h)))));}return o}(e.geometry,0,0,da,da);I1){var R=yp(D,_,r.vertical||f,n,24,m);R&&z(D,R);}}else if("Polygon"===e.type)for(var j=0,U=Po(e.geometry,0);j=T.maxzoom)&&"none"!==T.visibility)){s(_,this.zoom);var P=d[T.id]=T.createBucket({index:u.bucketLayerIDs.length,layers:_,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source});P.tileSize=this.originTileSize,P.populate(w,m),u.bucketLayerIDs.push(_.map(function(e){return e.id}));}}}}var L=e.mapObject(m.glyphDependencies,function(e){return Object.keys(e).map(Number)});Object.keys(L).length?o.send("getGlyphs",{uid:this.uid,stacks:L},function(e,t){c||(c=e,h=t,C.call(a));}):h={};var I=Object.keys(m.iconDependencies);I.length?o.send("getImages",{icons:I},function(e,t){c||(c=e,p=t,C.call(a));}):p={};var j=Object.keys(m.patternDependencies);function C(){if(c)return n(c);if(h&&p&&f){var t=new i(h),r=new e.ImageAtlas(p,f);for(var o in d){var a=d[o];a instanceof e.SymbolBucket?(s(a.layers,this.zoom),e.performSymbolLayout(a,h,t.positions,p,r.iconPositions,this.showCollisionBoxes)):a.hasPattern&&(a instanceof e.LineBucket||a instanceof e.FillBucket||a instanceof e.FillExtrusionBucket)&&(s(a.layers,this.zoom),a.addFeatures(m,r.patternPositions));}this.status="done",n(null,{buckets:e.values(d).filter(function(e){return !e.isEmpty()}),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?t.positions:null});}}j.length?o.send("getImages",{icons:j},function(e,t){c||(c=e,f=t,C.call(a));}):f={},C.call(this);};var a="undefined"!=typeof performance,l={getEntriesByName:function(e){return !!(a&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(e)},mark:function(e){return !!(a&&performance&&performance.mark)&&performance.mark(e)},measure:function(e,t,r){return !!(a&&performance&&performance.measure)&&performance.measure(e,t,r)},clearMarks:function(e){return !!(a&&performance&&performance.clearMarks)&&performance.clearMarks(e)},clearMeasures:function(e){return !!(a&&performance&&performance.clearMeasures)&&performance.clearMeasures(e)}},u=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},l.mark(this._marks.start);};function c(t,r){var o=e.getArrayBuffer(t.request,function(t,o,i,n){t?r(t):o&&r(null,{vectorTile:new e.vectorTile.VectorTile(new e.pbf(o)),rawData:o,cacheControl:i,expires:n});});return function(){o.cancel(),r();}}u.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=u;var h=function(e,t,r,o){this.actor=e,this.projection=t,this.layerIndex=r,this.loadVectorData=o||c,this.loading={},this.loaded={};};h.prototype.loadTile=function(t,r){var o=this,i=t.uid;this.loading||(this.loading={});var s=!!(t&&t.request&&t.request.collectResourceTiming)&&new l.Performance(t.request),a=this.loading[i]=new n(t);a.abort=this.loadVectorData(t,function(t,n){if(delete o.loading[i],t||!n)return a.status="done",o.loaded[i]=a,r(t);var l=n.rawData,u={};n.expires&&(u.expires=n.expires),n.cacheControl&&(u.cacheControl=n.cacheControl);var c={};if(s){var h=s.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)));}a.vectorTile=n.vectorTile,a.parse(n.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[i]=a;});},h.prototype.reloadTile=function(e,t){var r=this.loaded,o=e.uid,i=this;if(r&&r[o]){var n=r[o];n.showCollisionBoxes=e.showCollisionBoxes;var s=function(e,r){var o=n.reloadCallback;o&&(delete n.reloadCallback,n.parse(n.vectorTile,i.layerIndex,i.actor,o)),t(e,r);};"parsing"===n.status?n.reloadCallback=s:"done"===n.status&&(n.vectorTile?n.parse(n.vectorTile,this.layerIndex,this.actor,s):s());}},h.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();},h.prototype.removeTile=function(e,t){var r=this.loaded,o=e.uid;r&&r[o]&&delete r[o],t();};var p=function(){this.loaded={};};p.prototype.loadTile=function(t,r){var o=t.uid,i=t.encoding,n=t.rawImageData,s=new e.DEMData(o,n,i);this.loaded=this.loaded||{},this.loaded[o]=s,r(null,s);},p.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r];};var f={RADIUS:6378137,FLATTENING:1/298.257223563,POLAR_RADIUS:6356752.3142};function d(e){var t=0;if(e&&e.length>0){t+=Math.abs(m(e[0]));for(var r=1;r2){for(s=0;s=0}(e)===t?e:e.reverse()}var M=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));};M.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,o=this._feature.geometry;r>31}function Y(e,t){for(var r=e.loadGeometry(),o=e.type,i=0,n=0,s=r.length,a=0;a>1;!function e(t,r,o,i,n,s){for(;n>i;){if(n-i>600){var a=n-i+1,l=o-i+1,u=Math.log(a),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(a-c)/a)*(l-a/2<0?-1:1),p=Math.max(i,Math.floor(o-l*c/a+h)),f=Math.min(n,Math.floor(o+(a-l)*c/a+h));e(t,r,o,p,f,s);}var d=r[2*o+s],m=i,g=n;for(B(t,r,i,o),r[2*n+s]>d&&B(t,r,i,n);md;)g--;}r[2*i+s]===d?B(t,r,i,g):B(t,r,++g,n),g<=o&&(i=g+1),o<=g&&(n=g-1);}}(e,t,s,o,i,n%2),A(e,t,r,o,s-1,n+1),A(e,t,r,s+1,i,n+1);}}function B(e,t,r,o){Z(e,r,o),Z(t,2*r,2*o),Z(t,2*r+1,2*o+1);}function Z(e,t,r){var o=e[t];e[t]=e[r],e[r]=o;}function J(e,t,r,o){var i=e-r,n=t-o;return i*i+n*n}L.fromVectorTileJs=I,L.fromGeojsonVt=j,L.GeoJSONWrapper=C;var G=function(e){return e[0]},V=function(e){return e[1]},W=function(e,t,r,o,i){void 0===t&&(t=G),void 0===r&&(r=V),void 0===o&&(o=64),void 0===i&&(i=Float64Array),this.nodeSize=o,this.points=e;for(var n=e.length<65536?Uint16Array:Uint32Array,s=this.ids=new n(e.length),a=this.coords=new i(2*e.length),l=0;l=r&&a<=i&&l>=o&&l<=n&&c.push(e[d]);else{var m=Math.floor((f+p)/2);a=t[2*m],l=t[2*m+1],a>=r&&a<=i&&l>=o&&l<=n&&c.push(e[m]);var g=(h+1)%2;(0===h?r<=a:o<=l)&&(u.push(f),u.push(m-1),u.push(g)),(0===h?i>=a:n>=l)&&(u.push(m+1),u.push(p),u.push(g));}}return c}(this.ids,this.coords,e,t,r,o,this.nodeSize)},W.prototype.within=function(e,t,r){return function(e,t,r,o,i,n){for(var s=[0,e.length-1,0],a=[],l=i*i;s.length;){var u=s.pop(),c=s.pop(),h=s.pop();if(c-h<=n)for(var p=h;p<=c;p++)J(t[2*p],t[2*p+1],r,o)<=l&&a.push(e[p]);else{var f=Math.floor((h+c)/2),d=t[2*f],m=t[2*f+1];J(d,m,r,o)<=l&&a.push(e[f]);var g=(u+1)%2;(0===u?r-i<=d:o-i<=m)&&(s.push(h),s.push(f-1),s.push(g)),(0===u?r+i>=d:o+i>=m)&&(s.push(f+1),s.push(c),s.push(g));}}return a}(this.ids,this.coords,e,t,r,this.nodeSize)};var R={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,map:function(e){return e}},q=function(e,t){this.projection=t,this.converter=function(e){return {projection:e,lngX:function(e){return this.projection.getTransform().mercatorXfromLng(e)},latY:function(e){var t=this.projection.getTransform().mercatorYfromLat(e);return t<0?0:t>1?1:t},xLng:function(e){return this.projection.getTransform().lngFromMercatorX(e)},yLat:function(e){return this.projection.getTransform().latFromMercatorY(e)},createPointCluster:function(e,t){var r=e.geometry.coordinates,o=r[0],i=r[1];return {x:this.lngX(o),y:this.latY(i),zoom:1/0,index:t,parentId:-1}},getClusterJSON:function(e){return {type:"Feature",id:e.id,properties:Q(e),geometry:{type:"Point",coordinates:[this.xLng(e.x),this.yLat(e.y)]}}}}}(t),this.options=U(Object.create(R),e),this.projection.maxZoom&&(this.options.maxZoom=Math.min(this.options.maxZoom,this.projection.maxZoom-1)),this.trees=new Array(this.options.maxZoom+1);};function U(e,t){for(var r in t)e[r]=t[r];return e}function $(e){return e.x}function H(e){return e.y}function K(e,t,r,o,i){return {x:e,y:t,zoom:1/0,id:r,parentId:-1,numPoints:o,properties:i}}function Q(e){var t=e.numPoints,r=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return U(U({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function ee(e,t,r,o,i,n){var s=i-r,a=n-o;if(0!==s||0!==a){var l=((e-r)*s+(t-o)*a)/(s*s+a*a);l>1?(r=i,o=n):l>0&&(r+=s*l,o+=a*l);}return (s=e-r)*s+(a=t-o)*a}function te(e,t,r,o){var i={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)re(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var o=0;o1?1:t}}}(r),i=[];if("FeatureCollection"===e.type)for(var n=0;n0&&(s+=o?(i*u-l*n)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(u-n,2))),i=l,n=u;}var c=t.length-3;t[2]=1,function e(t,r,o,i){for(var n,s=i,a=o-r>>1,l=o-r,u=t[r],c=t[r+1],h=t[o],p=t[o+1],f=r+3;fs)n=f,s=d;else if(d===s){var m=Math.abs(f-a);mi&&(n-r>3&&e(t,r,n,i),t[n+2]=s,o-n>3&&e(t,n,o,i));}(t,0,c,r),t[c+2]=1,t.size=Math.abs(s),t.start=0,t.end=t.size;}function ae(e,t,r,o){for(var i=0;i=(r/=t)&&s=o)return null;for(var l=[],u=0;u=r&&d=o)){var m=[];if("Point"===p||"MultiPoint"===p)ue(h,m,r,o,i);else if("LineString"===p)ce(h,m,r,o,i,!1,a.lineMetrics);else if("MultiLineString"===p)pe(h,m,r,o,i,!1);else if("Polygon"===p)pe(h,m,r,o,i,!0);else if("MultiPolygon"===p)for(var g=0;g=r&&s<=o&&(t.push(e[n]),t.push(e[n+1]),t.push(e[n+2]));}}function ce(e,t,r,o,i,n,s){for(var a,l,u=he(e),c=0===i?de:me,h=e.start,p=0;pr&&(l=c(u,f,d,g,v,r),s&&(u.start=h+a*l)):y>o?x=r&&(l=c(u,f,d,g,v,r),w=!0),x>o&&y<=o&&(l=c(u,f,d,g,v,o),w=!0),!n&&w&&(s&&(u.end=h+a*l),t.push(u),u=he(e)),s&&(h+=a);}var S=e.length-3;f=e[S],d=e[S+1],m=e[S+2],(y=0===i?f:d)>=r&&y<=o&&fe(u,f,d,m),S=u.length-3,n&&S>=3&&(u[S]!==u[0]||u[S+1]!==u[1])&&fe(u,u[0],u[1],u[2]),u.length&&t.push(u);}function he(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function pe(e,t,r,o,i,n){for(var s=0;sa.maxX&&(a.maxX=h),p>a.maxY&&(a.maxY=p);}return a}function Se(e,t,r,o){var i=t.geometry,n=t.type,s=[];if("Point"===n||"MultiPoint"===n)for(var a=0;a0&&t.size<(i?s:o))r.numPoints+=t.length/3;else{for(var a=[],l=0;ls)&&(r.numSimplified++,a.push(t[l]),a.push(t[l+1])),r.numPoints++;i&&function(e,t){for(var r=0,o=0,i=e.length,n=i-2;o0===t)for(o=0,i=e.length;o=o;u--){var c=+Date.now();a=this._cluster(a,u),this.trees[u]=new W(a,$,H,n,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,a.length,+Date.now()-c);}return r&&console.timeEnd("total time"),this},q.prototype.getChildren=function(e){var t=e>>5,r=e%32,o="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(o);var n=i.points[t];if(!n)throw new Error(o);for(var s=this.options.radius/(this.options.extent*this.projection.zoomScale(r-1)),a=[],l=0,u=i.within(n.x,n.y,s);l1?this._map(u,!0):null,g=(l<<5)+(t+1),v=0,y=h;v=Math.pow(2,e)?t(e,r):s};t.rack=function(e,r,o){var i=function(i){var s=0;do{if(s++>10){if(!o)throw new Error("too many ID collisions, use more bits");e+=o;}var a=t(e,r);}while(Object.hasOwnProperty.call(n,a));return n[a]=i,a},n=i.hats={};return i.get=function(e){return i.hats[e]},i.set=function(e,t){return i.hats[e]=t,i},i.bits=e||128,i.base=r||16,i};});function be(e,t,r){this.projection=r;var o=(t=this.options=function(e,t){for(var r in t)e[r]=t[r];return e}(Object.create(this.options),t)).debug;if(o&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");"Feature"===e.type?e={type:"FeatureCollection",features:[e]}:"FeatureCollection"!==e.type&&(e={type:"FeatureCollection",features:[{geometry:e}]}),e.features=e.features.map(function(e){e.properties||(e.properties={});var t=JSON.stringify(e);return e.properties._metadataId=ke(),e.properties._metadata=t,e});var i=oe(e,t,r);this.tiles={},this.tileCoords=[],o&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(i=function(e,t){var r=t.buffer/t.extent,o=e,i=le(e,1,-1-r,r,0,-1,2,t),n=le(e,1,1-r,2+r,0,-1,2,t);return (i||n)&&(o=le(e,1,-r,1+r,0,-1,2,t)||[],i&&(o=ge(i,1).concat(o)),n&&(o=o.concat(ge(n,-1)))),o}(i,t)).length&&(this.projection.maxZoom?this.splitTile2(i,0,0,0):this.splitTile(i,0,0,0)),o&&(i.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)));}function _e(e,t,r){return 32*((1<1&&console.time("creation"),p=this.tiles[h]=we(e,t,r,o,l,this.projection),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,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var f="z"+t;this.stats[f]=(this.stats[f]||0)+1,this.total++;}if(p.source=e,i){if(t===l.maxZoom||t===i)continue;var d=1<1&&console.time("clipping");var m,g,v,y,x,w,S=.5*l.buffer/l.extent,M=.5-S,k=.5+S,b=1+S;m=g=v=y=null,x=le(e,c,r-S,r+k,0,p.minX,p.maxX,l),w=le(e,c,r+M,r+b,0,p.minX,p.maxX,l),e=null,x&&(m=le(x,c,o-S,o+k,1,p.minY,p.maxY,l),g=le(x,c,o+M,o+b,1,p.minY,p.maxY,l),x=null),w&&(v=le(w,c,o-S,o+k,1,p.minY,p.maxY,l),y=le(w,c,o+M,o+b,1,p.minY,p.maxY,l),w=null),u>1&&console.timeEnd("clipping"),a.push(m||[],t+1,2*r,2*o),a.push(g||[],t+1,2*r,2*o+1),a.push(v||[],t+1,2*r+1,2*o),a.push(y||[],t+1,2*r+1,2*o+1);}}},be.prototype.splitTile2=function(e,t,r,o){var i=this.options,n=this.projection.zoomScale(t),s=_e(t,r,o),a=(this.tiles[s],this.tiles[_e(0,0,0)]);if(a){var l,u=.5*i.buffer/i.extent,c=1+u,h=le(e,n,r-u,r+c,0,a.minX,a.maxX,i);h&&(l=le(h,n,o-u,o+c,1,a.minY,a.maxY,i)),l&&(this.tiles[s]=we(l,t,r,o,i,this.projection));}else(a=this.tiles[_e(0,0,0)]=we(e,0,0,0,i,this.projection)).source=e;},be.prototype.getTile=function(e,t,r){var o=this.options,i=o.extent,n=o.debug;if(e<0||e>24)return null;var s=this.projection.zoomScale(e),a=_e(e,t=(t%s+s)%s,r);if(this.tiles[a])return ye(this.tiles[a],i,this.projection);n>1&&console.log("drilling down to z%d-%d-%d",e,t,r);var l,u=e,c=t,h=r;if(this.projection.maxZoom)return (l=this.tiles[_e(0,0,0)])&&l.source?(this.splitTile2(l.source,e,t,r),this.tiles[a]?ye(this.tiles[a],i,this.projection):null):null;for(;!l&&u>0;)u--,c=Math.floor(c/2),h=Math.floor(h/2),l=this.tiles[_e(u,c,h)];return l&&l.source?(n>1&&console.log("found parent tile z%d-%d-%d",u,c,h),n>1&&console.time("drilling down"),this.splitTile(l.source,u,c,h,e,t,r),n>1&&console.timeEnd("drilling down"),this.tiles[a]?ye(this.tiles[a],i,this.projection):null):null};var Pe=function(t){function r(e,r,o,i){t.call(this,e,r,o,Te),i&&(this.loadGeoJSON=i);}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 t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,o=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(o&&o.request&&o.request.collectResourceTiming)&&new l.Performance(o.request);this.loadGeoJSON(o,function(n,s){if(n||!s)return r(n);if("object"!=typeof s)return r(new Error("Input data given to '"+o.source+"' is not a valid GeoJSON object."));y(s,!0);try{t._geoJSONIndex=o.cluster?new q(function(t){var r=t.superclusterOptions,o=t.clusterProperties;if(!o||!r)return r;for(var i={},n={},s={accumulated:null,zoom:0},a={properties:null},l=Object.keys(o),u=0,c=l;u1?"@2x":"",l=t.getJSON(r.transformRequest(r.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),function(t,e){l=null,a||(a=t,o=e,u());}),c=t.getImage(r.transformRequest(r.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),function(t,e){c=null,a||(a=t,n=e,u());});function u(){if(a)i(a);else if(o&&n){var e=t.browser.getImageData(n),r={};for(var s in o){var l=o[s],c=l.width,u=l.height,h=l.x,p=l.y,d=l.sdf,f=l.pixelRatio,_=new t.RGBAImage({width:c,height:u});t.RGBAImage.copy(e,_,{x:h,y:p},{x:0,y:0},{width:c,height:u}),r[s]={data:_,pixelRatio:f,sdf:d};}i(null,r);}}return {cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null);}}}function p(t){var e=t.userImage;if(e&&e.render&&e.render())return t.data.replace(new Uint8Array(e.data.buffer)),!0;return !1}r.suppressClick=function(){t.window.addEventListener("click",u,!0),t.window.setTimeout(function(){t.window.removeEventListener("click",u,!0);},0);},r.mousePos=function(e,r){var i=e.getBoundingClientRect(),o=t.window.TouchEvent&&r instanceof t.window.TouchEvent?r.touches[0]:r;return new t.Point(o.clientX-i.left-e.clientLeft,o.clientY-i.top-e.clientTop)},r.touchPos=function(e,r){for(var i=e.getBoundingClientRect(),o=[],n="touchend"===r.type?r.changedTouches:r.touches,a=0;a=0?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t);};var d=function(e){function r(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0;}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,r=this.requestors;e=0?1.2:1));}function v(t,e,r,i,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]=[],x.loadGlyphRange(r,s,i.url,i.requestManager,function(t,e){if(e)for(var r in e)i._doesCharSupportLocalGlyph(+r)||(n.glyphs[+r]=e[+r]);for(var o=0,a=l;othis.height)return t.warnOnce("LineAtlas out of space"),null;for(var n=0,a=0;a=r&&t.x=i&&t.y=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},e.radiansToLength=u,e.lengthToRadians=h,e.lengthToDegrees=function(t,e){return p(h(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=p,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return u(h(t,e),r)},e.convertArea=function(t,r,i){if(void 0===r&&(r="meters"),void 0===i&&(i="kilometers"),!(t>=0))throw new Error("area must be a positive number");var o=e.areaFactors[r];if(!o)throw new Error("invalid original units");var n=e.areaFactors[i];if(!n)throw new Error("invalid final units");return t/o*n},e.isNumber=d,e.isObject=function(t){return !!t&&t.constructor===Object},e.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(t){if(!d(t))throw new Error("bbox must only contain numbers")});},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},e.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},e.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},e.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},e.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},e.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},e.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},e.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")};}),M=t.unwrapExports(C),L=(C.earthRadius,C.factors,C.unitsFactors,C.areaFactors,C.feature,C.geometry,C.point,C.points,C.polygon,C.polygons,C.lineString,C.lineStrings,C.featureCollection,C.multiLineString,C.multiPoint,C.multiPolygon,C.geometryCollection,C.round,C.radiansToLength,C.lengthToRadians,C.lengthToDegrees,C.bearingToAzimuth,C.radiansToDegrees,C.degreesToRadians,C.convertLength,C.convertArea,C.isNumber,C.isObject,C.validateBBox,C.validateId,C.radians2degrees,C.degrees2radians,C.distanceToDegrees,C.distanceToRadians,C.radiansToDistance,C.bearingToAngle,C.convertDistance,t.createCommonjsModule(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getCoord=function(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")},e.getCoords=function(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")},e.containsNumber=function t(e){if(e.length>1&&C.isNumber(e[0])&&C.isNumber(e[1]))return !0;if(Array.isArray(e[0])&&e[0].length)return t(e[0]);throw new Error("coordinates must only contain numbers")},e.geojsonType=function(t,e,r){if(!e||!r)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.type)},e.featureOf=function(t,e,r){if(!t)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.geometry.type)},e.collectionOf=function(t,e,r){if(!t)throw new Error("No featureCollection passed");if(!r)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+r+", FeatureCollection required");for(var i=0,o=t.features;it[1]!=c>t[1]&&t[0]<(l-a)*(t[1]-s)/(c-s)+a&&(i=!i);}return i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,i){if(void 0===i&&(i={}),!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var o=L.getCoord(t),n=L.getGeom(e),a=n.type,s=e.bbox,l=n.coordinates;if(s&&!1===function(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}(o,s))return !1;"Polygon"===a&&(l=[l]);for(var c=!1,u=0;ul||p>c||d>u)return s=r,l=i,c=p,u=d,void(n=0);var f=C.lineString([s,r],t.properties);if(!1===e(f,i,o,d,n))return !1;n++,s=r;})&&void 0}}});}function l(t,e){if(!t)throw new Error("geojson is required");a(t,function(t,r,i){if(null!==t.geometry){var o=t.geometry.type,n=t.geometry.coordinates;switch(o){case"LineString":if(!1===e(t,r,i,0,0))return !1;break;case"Polygon":for(var a=0;al?a:l,s>c?s:c]),r.push(u),i}),r})(r,t.properties).forEach(function(t){t.id=e.length,e.push(t);});});}}(t,e);}),C.featureCollection(e)};});t.unwrapExports(A);var D=t.createCommonjsModule(function(t,e){t.exports=function(){function t(t,e,r){var i=t[e];t[e]=t[r],t[r]=i;}function e(t,e){return te?1:0}return function(r,i,o,n,a){!function e(r,i,o,n,a){for(;n>o;){if(n-o>600){var s=n-o+1,l=i-o+1,c=Math.log(s),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1),p=Math.max(o,Math.floor(i-l*u/s+h)),d=Math.min(n,Math.floor(i+(s-l)*u/s+h));e(r,i,p,d,a);}var f=r[i],_=o,m=n;for(t(r,o,i),a(r[n],f)>0&&t(r,o,n);_0;)m--;}0===a(r[o],f)?t(r,o,m):t(r,++m,n),m<=i&&(o=m+1),i<=m&&(n=m-1);}}(r,i,o||0,n||r.length-1,a||e);}}();}),k=F,B=F;function F(t,e){if(!(this instanceof F))return new F(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear();}function O(t,e,r){if(!r)return e.indexOf(t);for(var i=0;i=t.minX&&e.maxY>=t.minY}function H(t){return {children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Y(t,e,r,i,o){for(var n,a=[e,r];a.length;)(r=a.pop())-(e=a.pop())<=i||(n=e+Math.ceil((r-e)/i/2)*i,D(t,n,e,r,o),a.push(e,n,n,r));}F.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],i=this.toBBox;if(!W(t,e))return r;for(var o,n,a,s,l=[];e;){for(o=0,n=e.children.length;o=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e);},_split:function(t,e){var r=t[e],i=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,i);var n=this._chooseSplitIndex(r,o,i),a=H(r.children.splice(n,r.children.length-n));a.height=r.height,a.leaf=r.leaf,U(r,this.toBBox),U(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a);},_splitRoot:function(t,e){this.data=H([t,e]),this.data.height=t.height+1,this.data.leaf=!1,U(this.data,this.toBBox);},_chooseSplitIndex:function(t,e,r){var i,o,n,a,s,l,c,u,h,p,d,f,_,m;for(l=c=1/0,i=e;i<=r-e;i++)o=N(t,0,i,this.toBBox),n=N(t,i,r,this.toBBox),h=o,p=n,d=void 0,f=void 0,_=void 0,m=void 0,d=Math.max(h.minX,p.minX),f=Math.max(h.minY,p.minY),_=Math.min(h.maxX,p.maxX),m=Math.min(h.maxY,p.maxY),a=Math.max(0,_-d)*Math.max(0,m-f),s=q(o)+q(n),a=e;o--)n=t.children[o],j(l,t.leaf?a(n):n),c+=V(l);return c},_adjustParentBBoxes:function(t,e,r){for(var i=r;i>=0;i--)j(e[i],t);},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():U(t[r],this.toBBox);},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};");}},k.default=B;var K=t.createCommonjsModule(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=[1/0,1/0,-1/0,-1/0];return R.coordEach(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2] line1 must only contain 2 coordinates");if(2!==i.length)throw new Error(" line2 must only contain 2 coordinates");var o=r[0][0],n=r[0][1],a=r[1][0],s=r[1][1],l=i[0][0],c=i[0][1],u=i[1][0],h=i[1][1],p=(h-c)*(a-o)-(u-l)*(s-n),d=(u-l)*(n-c)-(h-c)*(o-l),f=(a-o)*(n-c)-(s-n)*(o-l);if(0===p)return null;var _=d/p,m=f/p;if(_>=0&&_<=1&&m>=0&&m<=1){var g=o+_*(a-o),v=n+_*(s-n);return C.point([g,v])}return null}e.default=function(t,e){var r={},a=[];if("LineString"===t.type&&(t=C.feature(t)),"LineString"===e.type&&(e=C.feature(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var s=n(t,e);return s&&a.push(s),C.featureCollection(a)}var l=o.default();return l.load(i.default(e)),R.featureEach(i.default(t),function(t){R.featureEach(l.search(t),function(e){var i=n(t,e);if(i){var o=L.getCoords(i).join(",");r[o]||(r[o]=!0,a.push(i));}});}),C.featureCollection(a)};});t.unwrapExports(it);var ot=t.createCommonjsModule(function(t,e){function r(t,e){void 0===e&&(e={});var r=L.getGeom(t);r.type;return o(r.coordinates,e.properties?e.properties:"Feature"===t.type?t.properties:{})}function i(t,e){void 0===e&&(e={});var r=L.getGeom(t),i=(r.type,r.coordinates),n=e.properties?e.properties:"Feature"===t.type?t.properties:{},a=[];return i.forEach(function(t){a.push(o(t,n));}),C.featureCollection(a)}function o(t,e){return t.length>1?C.multiLineString(t,e):C.lineString(t[0],e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){void 0===e&&(e={});var o=L.getGeom(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),o.type){case"Polygon":return r(o,e);case"MultiPolygon":return i(o,e);default:throw new Error("invalid poly")}},e.polygonToLine=r,e.multiPolygonToLine=i,e.coordsToLine=o;});t.unwrapExports(ot);ot.polygonToLine,ot.multiPolygonToLine,ot.coordsToLine;var nt=t.createCommonjsModule(function(t,e){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(z),o=r(it),n=r(ot);function a(t,e){for(var r=0;r0}function l(t,e,r){var i=r[0]-t[0],o=r[1]-t[1],n=e[0]-t[0],a=e[1]-t[1];return 0==i*a-o*n&&(Math.abs(n)>=Math.abs(a)?n>0?t[0]<=r[0]&&r[0]<=e[0]:e[0]<=r[0]&&r[0]<=t[0]:a>0?t[1]<=r[1]&&r[1]<=e[1]:e[1]<=r[1]&&r[1]<=t[1])}e.default=function(t,e){var r=!0;return R.flattenEach(t,function(t){R.flattenEach(e,function(e){if(!1===r)return !1;r=function(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return r=t.coordinates,l=e.coordinates,!(r[0]===l[0]&&r[1]===l[1]);case"LineString":return !a(e,t);case"Polygon":return !i.default(t,e)}break;case"LineString":switch(e.type){case"Point":return !a(t,e);case"LineString":return !function(t,e){if(o.default(t,e).features.length>0)return !0;return !1}(t,e);case"Polygon":return !s(e,t)}break;case"Polygon":switch(e.type){case"Point":return !i.default(e,t);case"LineString":return !s(t,e);case"Polygon":return !function(t,e){for(var r=0,a=t.coordinates[0];r0)return !0;return !1}(e,t)}}var r,l;return !1}(t.geometry,e.geometry);});}),r};}),at=t.unwrapExports(nt);var st=function(t,e){this.projection=e,this.feature=this.validateFeature(t);},lt={Feature:{configurable:!0}};lt.Feature.get=function(){return t.deepCopy(this.feature)},st.prototype.validateFeature=function(t){if(t&&t.geometry)return M.feature(t.geometry);throw new Error("please input polygon feature !")},st.prototype.contains=function(t){var e=function(t,e){var r=e.zoomScale(t.z),i=e.getTransform().lngFromMercatorX(t.x/r),o=e.getTransform().lngFromMercatorX((t.x+1)/r),n=e.getTransform().latFromMercatorY(t.y/r),a=e.getTransform().latFromMercatorY((t.y+1)/r);return M.polygon([[[i,n],[o,n],[o,a],[i,a],[i,n]]])}(t,this.projection);return !at(e,this.feature)},Object.defineProperties(st.prototype,lt);var ct=function(e){function r(r,i,o,n){e.call(this),this.id=r,this.dispatcher=o,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=i.defaultTileSize,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(i,["url","scheme","tileSize","boundary","skipEmptyTile"])),this._options=t.extend({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,this.setEventedParent(n);}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.setBoundary(this.boundary),this._tileJSONRequest=P(this._options,this.map._requestManager,function(r,i){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new I(i.bounds,e.map.projection,e.minzoom,e.maxzoom)),t.postTurnstileEvent(i.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(i.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})));});},r.prototype.loaded=function(){return this._loaded},r.prototype.hasTile=function(t){return (!this.tileBounds||this.tileBounds.contains(t.canonical))&&(!this.featureBounds||this.featureBounds.contains(t.canonical))},r.prototype.onAdd=function(t){this.map=t,this.load();},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.loadTile=function(e,r){var i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.map.projection,this.scheme),this.url,null),o={request:this.map._requestManager.transformRequest(i,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),originTileSize:this.tileSize,type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};function n(i,o){return delete e.request,e.aborted?r(null):i&&!this.skipEmptyTile?r(i):i&&404!==i.status?r(i):(o&&o.resourceTiming&&(e.resourceTiming=o.resourceTiming),this.map._refreshExpiredTiles&&o&&e.setExpiryData(o),e.loadVectorData(o,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}o.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=r:e.request=e.actor.send("reloadTile",o,n.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",o,n.bind(this)));},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0);},r.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0);},r.prototype.hasTransition=function(){return !1},r.prototype.setBoundary=function(t){t?(this.boundary=t,this.featureBounds=new st(t,this.map.projection)):(delete this.boundary,delete this.featureBounds);},r}(t.Evented),ut=function(e){function r(r,i,o,n){e.call(this),this.id=r,this.dispatcher=o,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=i.defaultTileSize,this.rasterType="xyz",this.zoomOffset=0,this.noFadingParent=!1,this._loaded=!1,this._options=t.extend({type:"raster"},i),t.extend(this,t.pick(i,["url","scheme","tileSize","rasterType","zoomOffset","boundary","noFadingParent"]));}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.setBoundary(this.boundary),this._tileJSONRequest=P(this._options,this.map._requestManager,function(r,i){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new I(i.bounds,e.map.projection,e.minzoom,e.maxzoom)),t.postTurnstileEvent(i.tiles),t.postMapLoadEvent(i.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})));});},r.prototype.loaded=function(){return this._loaded},r.prototype.onAdd=function(t){this.map=t,this.load();},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null);},r.prototype.serialize=function(){return t.extend({},this._options)},r.prototype.hasTile=function(t){return (!this.tileBounds||this.tileBounds.contains(t.canonical))&&(!this.featureBounds||this.featureBounds.contains(t.canonical))},r.prototype.loadTile=function(e,r){var i=this,o=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.map.projection,{scheme:this.scheme,rasterType:this.rasterType,zoomOffset:this.zoomOffset}),this.url,this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(o,t.ResourceType.Tile),function(o,n){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(o)e.state="errored",r(o);else if(n){i.map._refreshExpiredTiles&&e.setExpiryData(n),delete n.cacheControl,delete n.expires;var a=i.map.painter.context,s=a.gl;e.texture=i.map.painter.getTileTexture(n.width),e.texture?e.texture.update(n,{useMipmap:!0}):(e.texture=new t.Texture(a,n,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(i.dispatcher),r(null);}},this.noFadingParent);},r.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e();},r.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e();},r.prototype.hasTransition=function(){return !1},r.prototype.setBoundary=function(t){t?(this.boundary=t,this.featureBounds=new st(t,this.map.projection)):(delete this.boundary,delete this.featureBounds);},r}(t.Evented),ht=function(e){function r(r,i,o,n){e.call(this,r,i,o,n),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox";}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.serialize=function(){return {type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},r.prototype.loadTile=function(e,r){var i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.map.projection,this.scheme),this.url,this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(i,t.ResourceType.Tile),function(i,o){if(delete e.request,e.aborted)e.state="unloaded",r(null);else if(i)e.state="errored",r(i);else if(o){this.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var n=t.browser.getImageData(o),a={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:n,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",a,function(t,i){t&&(e.state="errored",r(t));i&&(e.dem=i,e.needsHillshadePrepare=!0,e.state="loaded",r(null));}.bind(this)));}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID);},r.prototype._getNeighboringTiles=function(e){var r=e.canonical,i=Math.pow(2,r.z),o=(r.x-1+i)%i,n=0===r.x?e.wrap-1:e.wrap,a=(r.x+1+i)%i,s=r.x+1===i?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,n,r.z,o,r.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y).key]={backfilled:!1},r.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,n,r.z,o,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+10&&(i.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",i));}});},r.prototype.onAdd=function(t){this.map=t,this.load();},r.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(e){if(e)r.fire(new t.ErrorEvent(e));else{var i={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(i.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",i));}}),this},r.prototype.addData=function(e){var r,i=dt(this._data);i.features?((r=i.features).push.apply(r,e),this.setData(i)):this.fire(new t.ErrorEvent(new Error("this source is not a GeoJson data source!")));},r.prototype.removeData=function(e){var r=dt(this._data);if(r.features){if(Array.isArray(e)){var i=pt(e);r.features=r.features.filter(function(t){return !i(t)});}else"number"==typeof e&&r.features.splice(e,1);this.setData(r);}else this.fire(new t.ErrorEvent(new Error("this source is not a GeoJson data source!")));},r.prototype.editData=function(e,r){var i=dt(this._data);if(i.features){if(Array.isArray(e)){var o=pt(e);i.features=i.features.map(function(t){return o(t)?r:t});}else"number"==typeof e&&i.features.splice(e,1,r);this.setData(i);}else this.fire(new t.ErrorEvent(new Error("this source is not a GeoJson data source!")));},r.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},r.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},r.prototype.getClusterLeaves=function(t,e,r,i){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},i),this},r.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var i=t.extend({},this.workerOptions),o=this._data;"string"==typeof o?(i.request=this.map._requestManager.transformRequest(t.browser.resolveURL(o),t.ResourceType.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(o),this.actor.send(this.type+".loadData",i,function(t,o){r._removed||o&&o.abandoned||(r._loaded=!0,o&&o.resourceTiming&&o.resourceTiming[r.id]&&(r._resourceTiming=o.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:i.source},null),e(t));});},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(e,r){var i=this,o=e.actor?"reloadTile":"loadTile";e.actor=this.actor;var n={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,originTileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes};e.request=this.actor.send(o,n,function(t,n){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(n,i.map.painter,"reloadTile"===o),r(null))});},r.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0;},r.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id});},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id});},r.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return !1},r}(t.Evented),_t=function(e){function r(t,r,i,o){e.call(this),this.id=t,this.dispatcher=i,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=r.defaultTileSize,this.tiles={},this._loaded=!1,this.setEventedParent(o),this.options=r;}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(e,r){var i=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),function(o,n){i._loaded=!0,o?i.fire(new t.ErrorEvent(o)):n&&(i.image=n,e&&(i.coordinates=e),r&&r(),i._finishLoading());});},r.prototype.loaded=function(){return this._loaded},r.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},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})));},r.prototype.onAdd=function(t){this.map=t,this.load();},r.prototype.setCoordinates=function(e){var r=this;this.coordinates=e;var i=e.map(function(e){return t.MercatorCoordinate.fromLngLat(e,0,r.map.projection)});this.tileID=function(e,r){for(var i=1/0,o=1/0,n=-1/0,a=-1/0,s=0,l=e;sr.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e;}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)));},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,r=e.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture);}}},r.prototype.serialize=function(){return {type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(_t),gt=function(e){function r(r,i,o,n){e.call(this,r,i,o,n),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some(function(t){return !Array.isArray(t)||2!==t.length||t.some(function(t){return "number"!=typeof t})})||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate;}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint();},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1);},this._finishLoading());},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play();},r.prototype.onRemove=function(){this.pause();},r.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,i=r.gl;for(var o in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,t.rasterBoundsAttributes.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(r,this.canvas,i.RGBA,{premultiply:!0}),this.tiles){var n=this.tiles[o];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture);}}},r.prototype.serialize=function(){return {type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a);}return this},Tt.prototype.has=function(t){return t.wrapped().key in this.data},Tt.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},Tt.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},Tt.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},Tt.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key,i=void 0===e?0:this.data[r].indexOf(e),o=this.data[r][i];return this.data[r].splice(i,1),o.timeout&&clearTimeout(o.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(o.value),this.order.splice(this.order.indexOf(r),1),this},Tt.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 St=function(t,e,r){this.context=t;var i=t.gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer;};St.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer);},St.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer);},St.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer);};var Pt={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},It=function(t,e,r,i){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=i,this.context=t;var o=t.gl;this.buffer=o.createBuffer(),t.bindVertexBuffer.set(this.buffer),o.bufferData(o.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer;};It.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer);},It.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer);},It.prototype.enableAttributes=function(t,e){for(var r=0;r1||(Math.abs(r)>1&&(1===Math.abs(r+o)?r+=o:1===Math.abs(r-o)&&(r-=o)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,i),t.neighboringTiles&&t.neighboringTiles[n]&&(t.neighboringTiles[n].backfilled=!0)));}},r.prototype.getTile=function(t){return this.getTileByID(t.key)},r.prototype.getTileByID=function(t){return this._tiles[t]},r.prototype.getZoom=function(t){return t.zoom+t.scaleZoom(t.tileSize/this._source.tileSize)},r.prototype._retainLoadedChildren=function(t,e,r,i){for(var o in this._tiles){var n=this._tiles[o];if(!(i[o]||!n.hasData()||n.tileID.overscaledZ<=e||n.tileID.overscaledZ>r)){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]){i[a.key]=a;break}}}},r.prototype.findLoadedParent=function(t,e){for(var r=t.overscaledZ-1;r>=e;r--){var i=t.scaledTo(r);if(!i)return;var o=String(i.key),n=this._tiles[o];if(n&&n.hasData())return n;if(this._cache.has(i))return this._cache.get(i)}},r.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),r=Math.floor(5*e),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(i);},r.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/this.map.projection.getMaxExtent(),r=Math.round(e);if(this._prevLng=t,r){var i={};for(var o in this._tiles){var n=this._tiles[o];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+r),i[n.tileID.key]=n;}for(var a in this._tiles=i,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);}}},r.prototype.update=function(e){var i=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 i._source.hasTile(t)}))):o=[];var n=(this._source.roundZoom?Math.round:Math.floor)(this.getZoom(e)),a=Math.max(n-r.maxOverzooming,this._source.minzoom),s=Math.max(n+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(o,n);if(ge(this._source.type)){for(var c={},u={},h=0,p=Object.keys(l);hthis._source.maxzoom){var m=f.children(this._source.maxzoom)[0],g=this.getTile(m);if(g&&g.hasData()){i[m.key]=m;continue}}else{var v=f.children(this._source.maxzoom);if(i[v[0].key]&&i[v[1].key]&&i[v[2].key]&&i[v[3].key])continue}for(var y=_.wasRequested(),x=f.overscaledZ-1;x>=n;--x){var b=f.scaledTo(x);if(o[b.key])break;if(o[b.key]=!0,!(_=this.getTile(b))&&y&&(_=this._addTile(b)),_&&(i[b.key]=b,y=_.wasRequested(),_.hasData()))break}}}return i},r.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));var i=Boolean(r);return i||(r=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,i||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout(function(){r._reloadTile(t,"expired"),delete r._timers[t];},i));},r.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()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))));},r.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset();},r.prototype.tilesIn=function(e,r,i){var o=this,n=[],a=this.transform;if(!a)return n;for(var s=i?a.getCameraQueryGeometry(e):e,l=e.map(function(t){return a.pointCoordinate(t)}),c=s.map(function(t){return a.pointCoordinate(t)}),u=this.getIds(),h=1/0,p=1/0,d=-1/0,f=-1/0,_=0,m=c;_=0&&g[1].y+m>=0){var v=l.map(function(t){return s.getTilePoint(t)}),y=c.map(function(t){return s.getTilePoint(t)});n.push({tile:i,tileID:s,queryGeometry:v,cameraQueryGeometry:y,scale:_});}}},y=0;y=t.browser.now())return !0}return !1},r.prototype.setFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.updateState(t,e,r);},r.prototype.removeFeatureState=function(t,e,r){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,r);},r.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,e)},r}(t.Evented);function me(t,e){return t%32-e%32||e-t}function ge(t){return "raster"===t||"image"===t||"video"===t}function ve(){return new t.window.Worker(Dn.workerUrl)}_e.maxOverzooming=10,_e.maxUnderzooming=3;var ye=function(){this.active={};};ye.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length=-e[0]&&r<=e[0]&&i>=-e[1]&&i<=e[1]}function Oe(e,r,i,o,n,a,s,l){var c=o?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,i.transform.zoom),h=[256/i.width*2+1,256/i.height*2+1],p=o?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var d=e.lineVertexArray,f=o?e.text.placedSymbolArray:e.icon.placedSymbolArray,_=i.transform.width/i.transform.height,m=!1,g=0;gMath.abs(i.x-r.x)*o)return {useVertical:!0};return (e===t.WritingMode.vertical?r.yi.x)?{needsFlipping:!0}:null}function je(e,r,i,o,n,a,s,l,c,u,h,p,d,f){var _,m=r/24,g=e.lineOffsetX*m,v=e.lineOffsetY*m;if(e.numGlyphs>1){var y=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,w=Ue(m,l,g,v,i,h,p,e,c,a,d,!1);if(!w)return {notEnoughRoom:!0};var E=Be(w.first.point,s).point,T=Be(w.last.point,s).point;if(o&&!i){var S=Ne(e.writingMode,E,T,f);if(S)return S}_=[w.first];for(var P=e.glyphStartIndex+1;P0?L.point:Ze(p,M,I,1,n),R=Ne(e.writingMode,I,z,f);if(R)return R}var A=Ge(m*l.getoffsetX(e.glyphStartIndex),g,v,i,h,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,a,d,!1);if(!A)return {notEnoughRoom:!0};_=[A];}for(var D=0,k=_;D0?1:-1,m=0;o&&(_*=-1,m=Math.PI),_<0&&(m+=Math.PI);for(var g=_>0?l+s:l+s+1,v=g,y=n,x=n,b=0,w=0,E=Math.abs(f);b+w<=E;){if((g+=_)=c)return null;if(x=y,void 0===(y=p[g])){var T=new t.Point(u.getx(g),u.gety(g)),S=Be(T,h);if(S.signedDistanceFromCamera>0)y=p[g]=S.point;else{var P=g-_;y=Ze(0===b?a:new t.Point(u.getx(P),u.gety(P)),T,x,E-b+1,h);}}b+=w,w=x.dist(y);}var I=(E-b)/w,C=y.sub(x),M=C.mult(I)._add(x);return M._add(C._unit()._perp()._mult(i*_)),{point:M,angle:m+Math.atan2(y.y-x.y,y.x-x.x),tileDistance:d?{prevTileDistance:g-_===v?0:u.gettileUnitDistanceFromAnchor(g-_),lastSegmentViewportDistance:E-b}:null}}Ae.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Ae.prototype.insert=function(t,e,r,i,o){this._forEachCell(e,r,i,o,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(o);},Ae.prototype.insertCircle=function(t,e,r,i){this._forEachCell(e-i,r-i,e+i,r+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(i);},Ae.prototype._insertBoxCell=function(t,e,r,i,o,n){this.boxCells[o].push(n);},Ae.prototype._insertCircleCell=function(t,e,r,i,o,n){this.circleCells[o].push(n);},Ae.prototype._query=function(t,e,r,i,o,n){if(r<0||t>this.width||i<0||e>this.height)return !o&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=i){if(o)return !0;for(var s=0;s0:a},Ae.prototype._queryCircle=function(t,e,r,i,o){var n=t-r,a=t+r,s=e-r,l=e+r;if(a<0||n>this.width||l<0||s>this.height)return !i&&[];var c=[],u={hitTest:i,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(n,s,a,l,this._queryCellCircle,c,u,o),i?c.length>0:c},Ae.prototype.query=function(t,e,r,i,o){return this._query(t,e,r,i,!1,o)},Ae.prototype.hitTest=function(t,e,r,i,o){return this._query(t,e,r,i,!0,o)},Ae.prototype.hitTestCircle=function(t,e,r,i){return this._queryCircle(t,e,r,!0,i)},Ae.prototype._queryCell=function(t,e,r,i,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[f+0]&&i>=u[f+1]&&(!s||s(this.boxKeys[d]))){if(a.hitTest)return n.push(!0),!0;n.push({key:this.boxKeys[d],x1:u[f],y1:u[f+1],x2:u[f+2],y2:u[f+3]});}}}var _=this.circleCells[o];if(null!==_)for(var m=this.circles,g=0,v=_;ga*a+s*s},Ae.prototype._circleAndRectCollide=function(t,e,r,i,o,n,a){var s=(n-i)/2,l=Math.abs(t-(i+s));if(l>s+r)return !1;var c=(a-o)/2,u=Math.abs(e-(o+c));if(u>c+r)return !1;if(l<=s||u<=c)return !0;var h=l-s,p=u-c;return h*h+p*p<=r*r};var qe=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ve(t,e){for(var r=0;rI)He(e,C,!1);else{var A=this.projectPoint(c,M,L),D=z*T;if(f.length>0){var k=A.x-f[f.length-4],B=A.y-f[f.length-3];if(D*D*2>k*k+B*B)if(C+8-P&&F=this.screenRightBoundary||i<100||e>this.screenBottomBoundary},We.prototype.isInsideGrid=function(t,e,r,i){return r>=0&&t=0&&e0)return this.prevPlacement&&this.prevPlacement.variableOffsets[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID].text&&(m=this.prevPlacement.variableOffsets[d.crossTileID].anchor),this.variableOffsets[d.crossTileID]={radialOffset:n,width:i,height:o,anchor:e,textBoxScale:a,prevAnchor:m},this.markUsedJustification(f,e,d,_),f.allowVerticalPlacement&&(this.markUsedOrientation(f,_,d),this.placedOrientations[d.crossTileID]=_),v},rr.prototype.placeLayerBucket=function(e,r,i,o,n,a,s,l,c,u){var h=this,p=e.layers[0].layout,d=t.evaluateSizeForZoom(e.textSizeData,this.transform.zoom),f=p.get("text-optional"),_=p.get("icon-optional"),m=p.get("text-allow-overlap"),g=p.get("icon-allow-overlap"),v=m&&(g||!e.hasIconData()||_),y=g&&(m||!e.hasTextData()||f),x=this.collisionGroups.get(e.sourceID),b="map"===p.get("text-rotation-alignment"),w="map"===p.get("text-pitch-alignment"),E="viewport-y"===p.get("symbol-z-order");!e.collisionArrays&&u&&e.deserializeCollisionBoxes(u);var T=function(o,u){if(!c[o.crossTileID])if(l)h.placements[o.crossTileID]=new Qe(!1,!1,!1);else{var g,E=!1,T=!1,S=!0,P={box:null,offscreen:null},I={box:null,offscreen:null},C=null,M=null,L=0,z=0,R=0;u.textFeatureIndex&&(L=u.textFeatureIndex),u.verticalTextFeatureIndex&&(z=u.verticalTextFeatureIndex);var A=u.textBox;if(A){var D=function(r){var i=t.WritingMode.horizontal;if(e.allowVerticalPlacement&&!r&&h.prevPlacement){var n=h.prevPlacement.placedOrientations[o.crossTileID];n&&(h.placedOrientations[o.crossTileID]=n,i=n,h.markUsedOrientation(e,i,o));}return i},k=function(r,i){if(e.allowVerticalPlacement&&o.numVerticalGlyphVertices>0&&u.verticalTextBox)for(var n=0,a=e.writingModes;n0&&(B=B.filter(function(t){return t!==F.anchor})).unshift(F.anchor);}var O=function(t,i){for(var n=t.x2-t.x1,s=t.y2-t.y1,l=o.textBoxScale,c={box:[],offscreen:!1},u=m?2*B.length:B.length,p=0;p=B.length;if((c=h.attemptAnchorPlacement(d,t,n,s,o.radialTextOffset,l,b,w,a,r,x,f,o,e,i))&&c.box&&c.box.length){E=!0;break}}return c};k(function(){return O(A,t.WritingMode.horizontal)},function(){var r=u.verticalTextBox,i=P&&P.box&&P.box.length;return e.allowVerticalPlacement&&!i&&o.numVerticalGlyphVertices>0&&r?O(r,t.WritingMode.vertical):{box:null,offscreen:null}}),P&&(E=P.box,S=P.offscreen);var U=D(P&&P.box);if(!E&&h.prevPlacement){var N=h.prevPlacement.variableOffsets[o.crossTileID];N&&(h.variableOffsets[o.crossTileID]=N,h.markUsedJustification(e,N.anchor,o,U));}}else{var j=function(t,i){var n=h.collisionIndex.placeCollisionBox(t,p.get("text-allow-overlap"),a,r,x.predicate);return n&&n.box&&n.box.length&&(h.markUsedOrientation(e,i,o),h.placedOrientations[o.crossTileID]=i),n};k(function(){return j(A,t.WritingMode.horizontal)},function(){var r=u.verticalTextBox;return e.allowVerticalPlacement&&o.numVerticalGlyphVertices>0&&r?j(r,t.WritingMode.vertical):{box:null,offscreen:null}}),D(P&&P.box&&P.box.length);}}E=(g=P)&&g.box&&g.box.length>0,S=g&&g.offscreen;var Z=u.textCircles;if(Z){var G=e.text.placedSymbolArray.get(o.centerJustifiedTextSymbolIndex),q=t.evaluateSizeForFeature(e.textSizeData,d,G);C=h.collisionIndex.placeCollisionCircles(Z,p.get("text-allow-overlap"),n,a,G,e.lineVertexArray,e.glyphOffsetArray,q,r,i,s,w,x.predicate),E=p.get("text-allow-overlap")||C.circles.length>0,S=S&&C.offscreen;}u.iconFeatureIndex&&(R=u.iconFeatureIndex),u.iconBox&&(T=(M=h.collisionIndex.placeCollisionBox(u.iconBox,p.get("icon-allow-overlap"),a,r,x.predicate)).box.length>0,S=S&&M.offscreen);var V=f||0===o.numHorizontalGlyphVertices&&0===o.numVerticalGlyphVertices,X=_||0===o.numIconVertices;V||X?X?V||(T=T&&E):E=T&&E:T=E=T&&E,E&&g&&g.box&&(I&&I.box&&z?h.collisionIndex.insertCollisionBox(g.box,p.get("text-ignore-placement"),e.bucketInstanceId,z,x.ID):h.collisionIndex.insertCollisionBox(g.box,p.get("text-ignore-placement"),e.bucketInstanceId,L,x.ID)),T&&M&&h.collisionIndex.insertCollisionBox(M.box,p.get("icon-ignore-placement"),e.bucketInstanceId,R,x.ID),E&&C&&h.collisionIndex.insertCollisionCircles(C.circles,p.get("text-ignore-placement"),e.bucketInstanceId,L,x.ID),h.placements[o.crossTileID]=new Qe(E||v,T||y,S||e.justReloaded),c[o.crossTileID]=!0;}};if(E)for(var S=e.getSortedSymbolIndexes(this.transform.angle),P=S.length-1;P>=0;--P){var I=S[P];T(e.symbolInstances.get(I),e.collisionArrays[I]);}else for(var C=0;C=0&&(e.text.placedSymbolArray.get(c).crossTileID=n>=0&&c!==n?0:i.crossTileID);}},rr.prototype.markUsedOrientation=function(e,r,i){for(var o=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,n=r===t.WritingMode.vertical?r:0,a=0,s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];a0||_>0,x=d.numIconVertices>0;if(y){for(var b=hr(v.text),w=(f+_)/4,E=0;E=0&&(e.text.placedSymbolArray.get(t).hidden=T||I);}),d.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(d.verticalPlacedTextSymbolIndex).hidden=T||P);var C=this.variableOffsets[d.crossTileID];C&&this.markUsedJustification(e,C.anchor,d,S);var M=this.placedOrientations[d.crossTileID];M&&(this.markUsedJustification(e,"left",d,M),this.markUsedOrientation(e,M,d));}if(x){for(var L=hr(v.icon),z=0;zt},rr.prototype.setStale=function(){this.stale=!0;};var or=Math.pow(2,25),nr=Math.pow(2,24),ar=Math.pow(2,17),sr=Math.pow(2,16),lr=Math.pow(2,9),cr=Math.pow(2,8),ur=Math.pow(2,1);function hr(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,r=Math.floor(127*t.opacity);return r*or+e*nr+r*ar+e*sr+r*lr+e*cr+r*ur+e}var pr=function(){this._currentTileIndex=0,this._seenCrossTileIDs={};};pr.prototype.continuePlacement=function(t,e,r,i,o){for(;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=r[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new pr),this._inProgressLayer.continuePlacement(i[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer;}this._currentPlacementIndex--;}this._done=!0;},dr.prototype.commit=function(t){return this.placement.commit(t),this.placement};var fr=function(t,e,r,i,o){this.projection=t,this.tileSize=e,this.tileID=r,this.indexedSymbolInstances={},this.bucketInstanceId=o;for(var n=0;nt.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 i.forEach(function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args);}),this.stylesheet=e,!0},r.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this.fire(new t.Event("data",{dataType:"style"}));},r.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e);},r.prototype.getImage=function(t){return this.imageManager.getImage(t)},r.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"}));},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(e,r,i){var o=this;if(void 0===i&&(i={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but the only the following properties were given: "+Object.keys(r).join(", ")+".");delete r.defaultTileSize;if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0)||!this._validate(t.validateStyle.source,"sources."+e,r,null,i)){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0),r.defaultTileSize=t.window.GEOGLOBE_TILESIZE||this.map.projection.getTileSize();var n=this.sourceCaches[e]=new _e(e,r,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;}},r.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var i=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],i.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),i.setEventedParent(null),i.clearTiles(),i.onRemove&&i.onRemove(this.map),this._changed=!0;},r.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0;},r.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},r.prototype.addLayer=function(e,r,i){void 0===i&&(i={}),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(yr(this,t.validateCustomStyleLayer(e)))return;n=t.createStyleLayer(e);}else{if("object"==typeof e.source&&(this.addSource(o,e.source),e=t.clone$1(e),e=t.extend(e,{source:o})),this._validate(t.validateStyle.layer,"layers."+o,e,{arrayIndex:-1},i))return;n=t.createStyleLayer(e),this._validateLayer(n),n.setEventedParent(this,{layer:{id:o}});}var a=r?this._order.indexOf(r):this._order.length;if(r&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" 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);}}},r.prototype.moveLayer=function(e,r){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==r){var i=this._order.indexOf(e);this._order.splice(i,1);var o=r?this._order.indexOf(r):this._order.length;r&&-1===o?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" 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.")));},r.prototype.removeLayer=function(e){this._checkLoaded();var r=this._layers[e];if(r){r.setEventedParent(null);var i=this._order.indexOf(e);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.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.")));},r.prototype.getLayer=function(t){return this._layers[t]},r.prototype.setLayerZoomRange=function(e,r,i){this._checkLoaded();var o=this.getLayer(e);o?o.minzoom===r&&o.maxzoom===i||(null!=r&&(o.minzoom=r),null!=i&&(o.maxzoom=i),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.")));},r.prototype.setFilter=function(e,r,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);if(o){if(!t.deepEqual(o.filter,r))return null==r?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(t.validateStyle.filter,"layers."+o.id+".filter",r,null,i)||(o.filter=t.clone$1(r),this._updateLayer(o)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")));},r.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},r.prototype.setLayoutProperty=function(e,r,i,o){void 0===o&&(o={}),this._checkLoaded();var n=this.getLayer(e);n?t.deepEqual(n.getLayoutProperty(r),i)||(n.setLayoutProperty(r,i,o),this._updateLayer(n)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")));},r.prototype.getLayoutProperty=function(e,r){var i=this.getLayer(e);if(i)return i.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")));},r.prototype.setPaintProperty=function(e,r,i,o){void 0===o&&(o={}),this._checkLoaded();var n=this.getLayer(e);n?t.deepEqual(n.getPaintProperty(r),i)||(n.setPaintProperty(r,i,o)&&this._updateLayer(n),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.")));},r.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},r.prototype.setFeatureState=function(e,r){this._checkLoaded();var i=e.source,o=e.sourceLayer,n=this.sourceCaches[i],a=parseInt(e.id,10);if(void 0!==n){var s=n.getSource().type;"geojson"===s&&o?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==s||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,r):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.")));},r.prototype.removeFeatureState=function(e,r){this._checkLoaded();var i=e.source,o=this.sourceCaches[i];if(void 0!==o){var n=o.getSource().type,a="vector"===n?e.sourceLayer:void 0,s=parseInt(e.id,10);"vector"!==n||a?void 0!==e.id&&isNaN(s)||s<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be non-negative."))):r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):o.removeFeatureState(a,s,r):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.")));},r.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,i=e.sourceLayer,o=this.sourceCaches[r],n=parseInt(e.id,10);if(void 0!==o)if("vector"!==o.getSource().type||i){if(!(isNaN(n)||n<0))return o.getFeatureState(i,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 '"+r+"' does not exist in the map's style.")));},r.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.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})},r.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;},r.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return "fill-extrusion"===e._layers[t].type},i={},o=[],n=this._order.length-1;n>=0;n--){var a=this._order[n];if(r(a)){i[a]=n;for(var s=0,l=t;s=0;f--){var _=this._order[f];if(r(_))for(var m=o.length-1;m>=0;m--){var g=o[m].feature;if(i[g.layer.id] 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\nattribute vec2 a_shift;\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+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;\r\nv_placed=a_placed.x;\r\nv_notUsed=a_placed.y;\r\n}"),Rr=Jr("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}"),Ar=Jr("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}"),Dr=Jr("#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}"),kr=Jr("varying 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\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}"),Br=Jr("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}"),Fr=Jr("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}"),Or=Jr("/*\nvarying 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}\r*/\nvarying vec3 v_point_y;\r\nvarying vec4 v_top_color;\r\nvarying vec4 v_bottom_color;\r\nvoid main() {\r\ngl_FragColor=vec4(1.0);\r\nfloat z=v_point_y.x;\r\nfloat b=v_point_y.y;\r\nfloat h=v_point_y.z;\r\nfloat percent=clamp((z-b)/(h-b),0.0,1.0);\r\ngl_FragColor=mix(v_bottom_color,v_top_color,percent);\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","/*\nuniform 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\nuniform lowp float u_opacity;\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\nv_color*=u_opacity;\r\n}\r*/\nuniform 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\nuniform lowp float u_opacity;uniform int u_type;\r\nattribute vec2 a_pos;\r\nattribute vec4 a_normal_ed;\r\nvarying vec3 v_point_y;\r\nvarying vec4 v_top_color;\r\nvarying vec4 v_bottom_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\n#pragma mapbox: define lowp float intensity\r\n#pragma mapbox: define highp vec4 bottom_color\nvec4 append_lighting(const vec4 p_color) {\r\n#pragma mapbox: initialize highp float base\r\n#pragma mapbox: initialize highp float height\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);vec4 color=p_color;float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,0.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}vec4 r_color=vec4(0.0);r_color.rgb=clamp(color.rgb*directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));r_color.a=color.a;r_color*=u_opacity;\r\nreturn r_color;\r\n}\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\n#pragma mapbox: initialize lowp float intensity\r\n#pragma mapbox: initialize highp vec4 bottom_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);v_point_y=vec3(t > 0.0 ? height : base,base,height);v_top_color=color;\r\nv_bottom_color=color;if(u_type==1) {if (intensity > 0.0) {\r\nv_top_color*=abs(intensity);\r\n}if (intensity < 0.0) {\r\nv_bottom_color*=abs(intensity);\r\n}}else if(u_type==2) {\r\nv_bottom_color=bottom_color;\r\n}v_top_color=append_lighting(v_top_color);\r\nv_bottom_color=append_lighting(v_bottom_color);\r\n}"),Ur=Jr("/*\nuniform 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}\r*/\nuniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform sampler2D u_image;uniform int u_type;\r\nvarying vec2 v_pos_a;\r\nvarying vec2 v_pos_b;\r\nvarying vec4 v_lighting;varying vec3 v_point_y;\r\nvarying vec4 v_normal_ed;\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\n#pragma mapbox: define lowp float intensity\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\n#pragma mapbox: initialize lowp float intensity\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;if (u_type==1) {float edgedistance=v_normal_ed.w;\r\nif (edgedistance > 0.0) {\r\nfloat z=v_point_y.x;\r\nfloat b=v_point_y.y;\r\nfloat h=v_point_y.z;\r\nfloat y=clamp((z-b)/(h-b),0.0,1.0);gl_FragColor=texture2D(u_image,vec2(0.5,1.0-y));if (intensity > 0.0) {\r\ngl_FragColor*=mix(1.0,abs(intensity),y);\r\n}\r\nif (intensity < 0.0) {\r\ngl_FragColor*=mix(abs(intensity),1.0,y);\r\n}\r\n} else {gl_FragColor=texture2D(u_image,vec2(0.5,1.0));\r\n}\r\n}\r\ngl_FragColor*=v_lighting;\r\n#ifdef OVERDRAW_INSPECTOR\r\ngl_FragColor=vec4(1.0);\r\n#endif\r\n}","/*\nuniform 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 lowp float u_opacity;\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\nv_lighting*=u_opacity;\r\n}\r*/\nuniform 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 lowp float u_opacity;\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;varying vec3 v_point_y;\r\nvarying vec4 v_normal_ed;\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);v_point_y=vec3(t > 0.0 ? height : base,base,height);\r\nv_normal_ed=a_normal_ed;\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\nv_lighting*=u_opacity;\r\n}"),Nr=Jr("#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\nuniform vec2 u_dimension;\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\nhighp vec2 epsilon=1.0/u_dimension;\r\nfloat scale=(u_dimension.x-2.0)/u_dimension.x;\r\nv_pos=(a_texture_pos/8192.0)*scale+epsilon;\r\n}"),jr=Jr("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}"),Zr=Jr("uniform lowp float u_device_pixel_ratio;\r\nvarying vec2 v_width2;\r\nvarying vec2 v_normal;\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\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/u_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 scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform vec2 u_units_to_pixels;\r\nuniform lowp float u_device_pixel_ratio;\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\n#pragma mapbox: define highp float height\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 highp float height\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\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=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\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,height,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_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),Gr=Jr("uniform lowp float u_device_pixel_ratio;\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\n#pragma mapbox: define lowp float blur\r\n#pragma mapbox: define lowp float opacity\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/u_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 scale 0.015873016\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_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\n#pragma mapbox: define highp float height\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\n#pragma mapbox: initialize highp float height\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\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=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\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,height,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_units_to_pixels);\r\nv_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\r\nv_width2=vec2(outset,inset);\r\n}"),qr=Jr("uniform lowp float u_device_pixel_ratio;\r\nuniform 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/u_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\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform vec2 u_units_to_pixels;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_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\n#pragma mapbox: define highp float height\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\n#pragma mapbox: initialize highp float height\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\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=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\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,height,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_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}"),Vr=Jr("uniform lowp float u_device_pixel_ratio;\r\nuniform 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/u_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\r\nattribute vec2 a_pos_normal;\r\nattribute vec4 a_data;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform lowp float u_device_pixel_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_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\n#pragma mapbox: define highp float height\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\n#pragma mapbox: initialize highp float height\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;\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=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;\r\nnormal.y=normal.y*2.0-1.0;\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,height,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_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}"),Xr=Jr("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}"),Wr=Jr("uniform sampler2D u_texture;\r\nvarying vec2 v_tex;\r\nvarying float v_fade_opacity;\r\n#pragma mapbox: define lowp float 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\nuniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_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\n#pragma mapbox: define lowp float opacity\r\n#pragma mapbox: define highp float height\r\nvoid main() {\r\n#pragma mapbox: initialize lowp float opacity\r\n#pragma mapbox: initialize highp float height\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_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),height,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}"),Hr=Jr("#define SDF_PX 8.0\r\nuniform bool u_is_halo;\r\nuniform sampler2D u_texture;\r\nuniform highp float u_gamma_scale;\r\nuniform lowp float u_device_pixel_ratio;\r\nuniform bool u_is_text;\r\nvarying vec2 v_data0;\r\nvarying vec3 v_data1;\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\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\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;\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;uniform mat4 u_matrix;\r\nuniform mat4 u_label_plane_matrix;\r\nuniform mat4 u_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\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\n#pragma mapbox: define highp float height\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\n#pragma mapbox: initialize highp float height\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_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),height,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}"),Yr=Jr("#define TAU 6.28318530718\r\n#define MAX_ITER 5\r\n#define INTENSITY 0.004\r\n#define SCALE 1000.0\r\nuniform lowp float u_time;\r\nvoid main() {\r\nvec2 uv=gl_FragCoord.xy/SCALE;\r\nvec2 p=mod(uv*TAU,TAU)-250.0;\r\nvec2 i=vec2(p);\r\nfloat c=1.0;\r\nfor (int n=0; n < MAX_ITER; n++) {\r\nfloat t=0.5*u_time*(1.0-(3.5/float(n+1)));\r\ni=p+vec2(cos(t-i.x)+sin(t+i.y),sin(t-i.y)+cos(t+i.x));\r\nc+=1.0/length(vec2(p.x/(sin(i.x+t)/INTENSITY),p.y/(cos(i.y+t)/INTENSITY)));\r\n}\r\nc=1.17-pow(c/float(MAX_ITER),1.4);\r\ngl_FragColor=vec4(clamp(vec3(pow(abs(c),8.0))+vec3(0.0,0.35,0.5),0.0,1.0),1.0);\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}"),Kr=Jr("#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\nvarying float v_opacity;\r\nvarying float v_discard;\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\nif(v_discard<0.0) {\r\ndiscard;\r\n}\r\nfloat opacity_m=v_opacity;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\ngl_FragColor=color*(alpha*opacity)*opacity_m;\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\nattribute vec3 a_extra_m;\r\nuniform mat4 u_matrix;\r\nuniform mediump float u_ratio;\r\nuniform vec2 u_gl_units_to_pixels;\r\nuniform vec4 u_speed_mat;\r\nvarying vec2 v_normal;\r\nvarying vec2 v_width2;\r\nvarying float v_gamma_scale;\r\nvarying float v_opacity;\r\nvarying float v_discard;\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\nvec3 f_extra_m=vec3(a_extra_m[0]*3.0/255.0,a_extra_m[1],a_extra_m[2]);\r\nfloat status=f_extra_m[2];\r\nfloat link_seq=f_extra_m[1];\r\nv_opacity=f_extra_m[0];\r\nfloat speed1=u_speed_mat[0];\r\nfloat speed2=u_speed_mat[1];\r\nfloat speed3=u_speed_mat[2];\r\nfloat speed4=u_speed_mat[3];\r\nif(status==1.0){\r\nif(link_seq!=speed1){\r\nv_discard=-100.0;\r\n}else{\r\nv_discard=100.0;\r\n}\r\n}else if(status==2.0) {\r\nif(link_seq!=speed2){\r\nv_discard=-100.0;\r\n}else{\r\nv_discard=100.0;\r\n}\r\n}else if(status==3.0) {\r\nif(link_seq!=speed3){\r\nv_discard=-100.0;\r\n}else{\r\nv_discard=100.0;\r\n}\r\n}else if(status==4.0) {\r\nif(link_seq!=speed4){\r\nv_discard=-100.0;\r\n}else{\r\nv_discard=100.0;\r\n}\r\n}\r\nvec2 a_extrude=a_data.xy-128.0;\r\nfloat a_direction=mod(a_data.z,4.0)-1.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)+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}");function Jr(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i={};return {fragmentSource:t=t.replace(r,function(t,e,r,o,n){return i[n]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nvarying "+r+" "+o+" "+n+";\n#else\nuniform "+r+" "+o+" u_"+n+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+n+"\n "+r+" "+o+" "+n+" = u_"+n+";\n#endif\n"}),vertexSource:e=e.replace(r,function(t,e,r,o,n){var a="float"===o?"vec2":"vec4",s=n.match(/color/)?"color":a;return i[n]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+r+" "+a+" a_"+n+";\nvarying "+r+" "+o+" "+n+";\n#else\nuniform "+r+" "+o+" u_"+n+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = a_"+n+";\n#else\n "+r+" "+o+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = unpack_mix_"+s+"(a_"+n+", u_"+n+"_t);\n#else\n "+r+" "+o+" "+n+" = u_"+n+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+r+" "+a+" a_"+n+";\n#else\nuniform "+r+" "+o+" u_"+n+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+r+" "+o+" "+n+" = a_"+n+";\n#else\n "+r+" "+o+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+r+" "+o+" "+n+" = unpack_mix_"+s+"(a_"+n+", u_"+n+"_t);\n#else\n "+r+" "+o+" "+n+" = u_"+n+";\n#endif\n"})}}var Qr=Object.freeze({prelude:Tr,background:Sr,backgroundPattern:Pr,circle:Ir,clippingMask:Cr,heatmap:Mr,heatmapTexture:Lr,collisionBox:zr,collisionCircle:Rr,debug:Ar,fill:Dr,fillOutline:kr,fillOutlinePattern:Br,fillPattern:Fr,fillExtrusion:Or,fillExtrusionPattern:Ur,hillshadePrepare:Nr,hillshade:jr,line:Zr,lineGradient:Gr,linePattern:qr,lineSDF:Vr,raster:Xr,symbolIcon:Wr,symbolSDF:Hr,fillWater:Yr,sprite:Kr}),$r=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null;};$r.prototype.bind=function(t,e,r,i,o,n,a,s){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==i.length,c=0;!l&&c>16,l>>16],u_pixel_coord_lower:[65535&s,65535&l]}}ti.prototype.draw=function(t,e,r,i,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(r),t.setStencilMode(i),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:Pi(o.paint.get("raster-hue-rotate"))};var n,a;};function Pi(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return [(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}var Ii=function(t,e,r,i,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:+r,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_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+i,u_texsize:c,u_texture:0}},Ci=function(e,r,i,o,n,a,s,l,c,u,h){var p=n.transform;return t.extend(Ii(e,r,i,o,n,a,s,l,c,u),{u_gamma_scale:o?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Mi=function(t,e,r){return {u_matrix:t,u_opacity:e,u_color:r}},Li=function(e,r,i,o,n,a){return t.extend(function(t,e,r,i){var o=r.imageManager.getPattern(t.from),n=r.imageManager.getPattern(t.to),a=r.imageManager.getPixelSize(),s=a.width,l=a.height,c=Math.pow(2,i.tileID.overscaledZ),u=i.tileSize*Math.pow(2,r.transform.tileZoom)/c,h=u*(i.tileID.canonical.x+i.tileID.wrap*c),p=u*i.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/Ye(i,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(o,a,i,n),{u_matrix:e,u_opacity:r})},zi=function(t,e,r,i){var o=t.transform;return {u_matrix:Ri(t,e,r),u_ratio:1/Ye(e,1,o.zoom),u_gl_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]],u_speed_mat:i}};function Ri(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("sprite-translate"),r.paint.get("sprite-translate-anchor"))}var Ai={fillExtrusion:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity),u_type:new t.Uniform1i(e,r.u_type)}},fillExtrusionPattern:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity),u_type:new t.Uniform1i(e,r.u_type)}},fill:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillWater:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_time:new t.Uniform1f(e,r.u_time)}},circle:function(e,r){return {u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:ui,collisionCircle:ui,debug:function(e,r){return {u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},clippingMask:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return {u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_maxzoom:new t.Uniform1f(e,r.u_maxzoom)}},line:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image)}},linePattern:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform4f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return {u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1f(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return {u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1f(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1f(e,r.u_is_halo)}},background:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}},sprite:function(e,r){return {u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_gl_units_to_pixels:new t.Uniform2f(e,r.u_gl_units_to_pixels),u_speed_mat:new t.Uniform4f(e,r.u_speed_mat)}}};function Di(e,r){for(var i=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=r?(s-r.timeAdded)/a:-1,u=i.getSource(),h=n.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),p=!r||Math.abs(r.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),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return {opacity:1,mix:0}}function Yi(e,r,i){var o=e.context,n=o.gl,a=i.posMatrix,s=e.useProgram("debug"),l=ue.disabled,c=he.disabled,u=e.colorModeForRenderPass(),h="$debug";s.draw(o,n.LINE_STRIP,l,c,u,de.disabled,pi(a,t.Color.red),h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);for(var p=r.getTileByID(i.key).latestRawTileData,d=p&&p.byteLength||0,f=Math.floor(d/1024),_=r.getTile(i).tileSize,m=e.projection.getTileSize()/Math.min(_,e.projection.getTileSize()),g=function(t,e,r,i){i=i||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 Ji={symbol:function(t,e,r,i,o){if("translucent"===t.renderPass){var n=he.disabled,a=t.colorModeForRenderPass();0!==r.paint.get("icon-opacity").constantOr(1)&&ji(t,e,r,i,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),n,a,o),0!==r.paint.get("text-opacity").constantOr(1)&&ji(t,e,r,i,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),n,a,o),e.map.showCollisionBoxes&&function(t,e,r,i){Bi(t,e,r,i,!1),Bi(t,e,r,i,!0);}(t,e,r,i);}},circle:function(e,r,i,o){if("translucent"===e.renderPass){var n=i.paint.get("circle-opacity"),a=i.paint.get("circle-stroke-width"),s=i.paint.get("circle-stroke-opacity"),l=void 0!==i.layout.get("circle-sort-key").constantOr(1);if(0!==n.constantOr(1)||0!==a.constantOr(1)&&0!==s.constantOr(1)){for(var c=e.context,u=c.gl,h=e.depthModeForSublayer(0,ue.ReadOnly),p=he.disabled,d=e.colorModeForRenderPass(),f=[],_=0;_e.y){var r=t;t=e,e=r;}return {x0:t.x,y0:t.y,x1:e.x,y1:e.y,dx:e.x-t.x,dy:e.y-t.y}}function to(t,e,r,i,o){var n=Math.max(r,Math.floor(e.y0)),a=Math.min(i,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&&to(c,s,i,o,n),l.dy&&to(c,l,i,o,n);}Qi.prototype.resize=function(e,r){var i=this.context.gl;if(this.width=e*t.browser.devicePixelRatio,this.height=r*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var o=0,n=this.style._order;o256&&this.clearStencil(),r.setColorMode(pe.disabled),r.setDepthMode(ue.disabled);var o=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var n=0,a=e;n256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new he({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},Qi.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new he({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},Qi.prototype.colorModeForRenderPass=function(){var e=this.context.gl;if(this._showOverdrawInspector){return new pe([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0])}return "opaque"===this.renderPass?pe.unblended:pe.alphaBlended},Qi.prototype.depthModeForSublayer=function(t,e,r){if(!this.opaquePassEnabledForLayer())return ue.disabled;var i=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new ue(r||this.context.gl.LEQUAL,e,[i,i])},Qi.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer=0;this.currentLayer--){var P=this.style._layers[i[this.currentLayer]],I=o[P.source],C=s[P.source];this._renderTileClippingMasks(P,C),this.renderLayer(this,I,P,C);}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},Qi.prototype.isPatternMissing=function(t){if(!t)return !1;var e=this.imageManager.getPattern(t.from),r=this.imageManager.getPattern(t.to);return !e||!r},Qi.prototype.useProgram=function(t,e){void 0===e&&(e=this.emptyProgramConfiguration),this.cache=this.cache||{};var r=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new ti(this.context,Qr[t],e,Ai[t],this._showOverdrawInspector)),this.cache[r]},Qi.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();},Qi.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 ro=function(e,r,i,o){this.projection=e,this.tileSize=e.getTileSize();var n=this.projection.getValidlatRange(),a=n[0],s=n[1];this.minValidLatitude=a,this.maxValidLatitude=s,this._renderWorldCopies=void 0===o||o,this._minZoom=r||0,this._maxZoom=i||22,this.projection.minZoom&&(this._minZoom=this.projection.minZoom),this.projection.maxZoom&&(this._maxZoom=this.projection.maxZoom),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={};},io={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}};ro.prototype.clone=function(){var t=new ro(this.projection,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},io.minZoom.get=function(){return this._minZoom},io.minZoom.set=function(t){if(this._minZoom!==t){if(this.projection.minZoom&&tthis.projection.maxZoom)return this._maxZoom=this.projection.maxZoom,void(this.zoom=Math.min(this.zoom,this._maxZoom));this._maxZoom=t,this.zoom=Math.min(this.zoom,t);}},io.renderWorldCopies.get=function(){return this._renderWorldCopies},io.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t;},io.worldSize.get=function(){return this.tileSize*this.scale},io.centerPoint.get=function(){return this.size._div(2)},io.size.get=function(){return new t.Point(this.width,this.height)},io.bearing.get=function(){return -this.angle/Math.PI*180},io.bearing.set=function(e){var r=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle));},io.pitch.get=function(){return this._pitch/Math.PI*180},io.pitch.set=function(e){var r=t.clamp(e,0,60)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices());},io.fov.get=function(){return this._fov/Math.PI*180},io.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());},io.zoom.get=function(){return this._zoom},io.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());},io.center.get=function(){return this._center},io.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices());},ro.prototype.coveringZoomLevel=function(t){return (t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},ro.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var i=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(i.x,o.x,n.x,a.x)),l=Math.floor(Math.max(i.x,o.x,n.x,a.x)),c=s-1;c<=l+1;c++)0!==c&&r.push(new t.UnwrappedTileID(c,e));return r},ro.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),i=r;if(void 0!==e.minzoom&&re.maxzoom&&(r=e.maxzoom);var o=t.MercatorCoordinate.fromLngLat(this.center,0,this.projection),n=Math.round(this.zoomScale(r)),a=new t.Point(n*o.x-.5,n*o.y-.5);return function(e,r,i,o,n){void 0===n&&(n=!0);var a=e,s={};function l(e,i,l){var c,u,h,p;if(l>=0&&l<=a)for(c=e;cc&&(o=c-g);}if(this.lngRange){var v=f.x,y=u.x/2;v-yl&&(i=l-y);}void 0===i&&void 0===o||(this.center=this.unproject(new t.Point(void 0!==i?i:f.x,void 0!==o?o:f.y))),this._unmodified=h,this._constraining=!1;}},ro.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=this._fov/2,r=Math.PI/2+this._pitch,i=Math.sin(e)*this.cameraToCenterDistance/Math.sin(Math.PI-r-e),o=this.point,n=o.x,a=o.y,s=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),l=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,l,s),t.scale(c,c,[1,-1,1]),t.translate(c,c,[0,0,-this.cameraToCenterDistance]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle),t.translate(c,c,[-n,-a,0]),this.mercatorMatrix=t.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),t.scale(c,c,[1,1,this.projection.getTransform().mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c;var u=this.width%2/2,h=this.height%2/2,p=Math.cos(this.angle),d=Math.sin(this.angle),f=n-Math.round(n)+p*u+d*h,_=a-Math.round(a)+p*h+d*u,m=new Float64Array(c);if(t.translate(m,m,[f>.5?f-1:f,_>.5?_-1:_,0]),this.alignedProjMatrix=m,c=t.create(),t.scale(c,c,[this.width/2,-this.height/2,1]),t.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=t.create(),t.scale(c,c,[1,-1,1]),t.translate(c,c,[-1,-1,0]),t.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={};}},ro.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},ro.prototype.getCameraPoint=function(){var e=this._pitch,r=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,r))},ro.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return [e[0],r];for(var i=r.x,o=r.y,n=r.x,a=r.y,s=0,l=e;s=3&&(this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:+(e[3]||0),pitch:+(e[4]||0)}),!0)},oo.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e);}catch(t){}};var no=function(e){function i(i,o,n,a){void 0===a&&(a={});var s=r.mousePos(o.getCanvasContainer(),n),l=o.unproject(s);e.call(this,i,t.extend({point:s,lngLat:l,originalEvent:n},a)),this._defaultPrevented=!1,this.target=o;}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var o={defaultPrevented:{configurable:!0}};return i.prototype.preventDefault=function(){this._defaultPrevented=!0;},o.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(i.prototype,o),i}(t.Event),ao=function(e){function i(i,o,n){var a=r.touchPos(o.getCanvasContainer(),n),s=a.map(function(t){return o.unproject(t)}),l=a.reduce(function(t,e,r,i){return t.add(e.div(i.length))},new t.Point(0,0)),c=o.unproject(l);e.call(this,i,{points:a,point:l,lngLats:s,lngLat:c,originalEvent:n}),this._defaultPrevented=!1;}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var o={defaultPrevented:{configurable:!0}};return i.prototype.preventDefault=function(){this._defaultPrevented=!0;},o.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(i.prototype,o),i}(t.Event),so=function(t){function e(e,r,i){t.call(this,e,{originalEvent:i}),this._defaultPrevented=!1;}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0;},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event),lo=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this);};lo.prototype.setZoomRate=function(t){this._defaultZoomRate=t;},lo.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t;},lo.prototype.isEnabled=function(){return !!this._enabled},lo.prototype.isActive=function(){return !!this._active},lo.prototype.isZooming=function(){return !!this._zooming},lo.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around);},lo.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},lo.prototype.onWheel=function(e){if(this.isEnabled()){var r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,i=t.browser.now(),o=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":o>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(o*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this.isActive()||this._start(e)),e.preventDefault();}},lo.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t);},lo.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this.isZooming()||(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 i=r.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(i)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame));}},lo.prototype._onScrollFrame=function(){var e=this;if(this._frameId=null,this.isActive()){var r=this._map.transform;if(0!==this._delta){var i="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,o=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==o&&(o=1/o);var n="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(n*o))),this._map._intScrollZoom&&(this._delta>0?this._targetZoom=Math.ceil(r.zoom+1):this._delta<0&&(this._targetZoom=Math.floor(r.zoom-1))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0;}var a="number"==typeof this._targetZoom?this._targetZoom:r.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);r.zoom=t.number(s,a,h),u<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):c=!0;}else r.zoom=a,c=!0;r.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));}},lo.prototype._smoothOutEasing=function(e){var r=t.ease;if(this._prevEase){var i=this._prevEase,o=(t.browser.now()-i.start)/i.duration,n=i.easing(o+.01)-i.easing(o),a=.27/Math.sqrt(n*n+1e-4)*.01,s=Math.sqrt(.0729-a*a);r=t.bezier(a,s,.25,1);}return this._prevEase={start:t.browser.now(),duration:e,easing:r},r};var co=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=r.clickTolerance||1,t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this);};co.prototype.isEnabled=function(){return !!this._enabled},co.prototype.isActive=function(){return !!this._active},co.prototype.enable=function(){this.isEnabled()||(this._enabled=!0);},co.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},co.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),r.disableDrag(),this._startPos=this._lastPos=r.mousePos(this._el,e),this._active=!0);},co.prototype._onMouseMove=function(t){var e=r.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)180&&(d=180);var f=d/180;c+=h*d*(f/2),Math.abs(r._normalizeBearing(c,0))0&&r-e[0][0]>160;)e.shift();};var po=t.bezier(0,0,.3,1),fo=function(e,r){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",this._clickTolerance=r.clickTolerance||1,t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this);};fo.prototype.isEnabled=function(){return "disabled"!==this._state},fo.prototype.isActive=function(){return "active"===this._state},fo.prototype.enable=function(){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled");},fo.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";}},fo.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==r.mouseButton(e)||(r.addEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),r.addEventListener(t.window.document,"mouseup",this._onMouseUp),this._start(e)));},fo.prototype.onTouchStart=function(e){"enabled"===this._state&&(e.touches.length>1||(r.addEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),r.addEventListener(t.window.document,"touchend",this._onTouchEnd),this._start(e)));},fo.prototype._start=function(e){t.window.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._prevPos=this._lastPos=r.mousePos(this._el,e),this._inertia=[[t.browser.now(),this._startPos]];},fo.prototype._onMove=function(e){e.preventDefault();var i=r.mousePos(this._el,e);this._lastPos.equals(i)||"pending"===this._state&&i.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:po,noMoveStart:!0},{originalEvent:t});}}},fo.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},fo.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.browser.now();e.length>0&&r-e[0][0]>160;)e.shift();};var _o=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this);};function mo(t){return t*(2-t)}_o.prototype.isEnabled=function(){return !!this._enabled},_o.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0);},_o.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1);},_o.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,r=0,i=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?r=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),n=-1);break;case 40:t.shiftKey?i=-1:(n=1,t.preventDefault());break;default:return}var a=this._map,s=a.getZoom(),l={duration:300,delayEndEvents:500,easing:mo,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:a.getBearing()+15*r,pitch:a.getPitch()+10*i,offset:[100*-o,100*-n],center:a.getCenter()};a.easeTo(l,{originalEvent:t});}};var go=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this);};go.prototype.isEnabled=function(){return !!this._enabled},go.prototype.isActive=function(){return !!this._active},go.prototype.enable=function(){this.isEnabled()||(this._enabled=!0);},go.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},go.prototype.onTouchStart=function(t){var e=this;if(this.isEnabled()&&!(t.points.length>1))if(this._tapped){var r=t.points[0],i=this._tappedPoint;if(i&&i.dist(r)<=30){t.originalEvent.preventDefault();var o=function(){e._tapped&&e._zoom(t),e._map.off("touchcancel",n),e._resetTapped();},n=function(){e._map.off("touchend",o),e._resetTapped();};this._map.once("touchend",o),this._map.once("touchcancel",n);}else this._resetTapped();}else this._tappedPoint=t.points[0],this._tapped=setTimeout(function(){e._tapped=null,e._tappedPoint=null;},300);},go.prototype._resetTapped=function(){clearTimeout(this._tapped),this._tapped=null,this._tappedPoint=null;},go.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t));},go.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);},go.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd);};var vo=t.bezier(0,0,.15,1),yo=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this);};yo.prototype.isEnabled=function(){return !!this._enabled},yo.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around);},yo.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1);},yo.prototype.disableRotation=function(){this._rotationDisabled=!0;},yo.prototype.enableRotation=function(){this._rotationDisabled=!1;},yo.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var i=r.mousePos(this._el,e.touches[0]),o=r.mousePos(this._el,e.touches[1]),n=i.add(o).div(2);this._startVec=i.sub(o),this._startAround=this._map.transform.pointLocation(n),this._gestureIntent=void 0,this._inertia=[],r.addEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),r.addEventListener(t.window.document,"touchend",this._onEnd);}},yo.prototype._getTouchEventData=function(t){var e=r.mousePos(this._el,t.touches[0]),i=r.mousePos(this._el,t.touches[1]),o=e.sub(i);return {vec:o,center:e.add(i).div(2),scale:o.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*o.angleWith(this._startVec)/Math.PI}},yo.prototype._onMove=function(e){if(2===e.touches.length){var r=this._getTouchEventData(e),i=r.vec,o=r.scale,n=r.bearing;if(!this._gestureIntent){var a=this._rotationDisabled&&1!==o||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=i);}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault();}},yo.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var r=this._map.transform;this._startScale||(this._startScale=r.scale,this._startBearing=r.bearing);var i=this._getTouchEventData(this._lastTouchEvent),o=i.center,n=i.bearing,a=i.scale,s=r.pointLocation(o),l=r.locationPoint(s);"rotate"===e&&(r.bearing=this._startBearing+n),r.zoom=r.scaleZoom(this._startScale*a),r.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]);}},yo.prototype._onEnd=function(e){r.removeEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),r.removeEventListener(t.window.document,"touchend",this._onEnd);var i=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,i){this._map.fire(new t.Event(i+"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 f=.15*h/p;Math.abs(f)>2.5&&(f=f>0?2.5:-2.5);var _=1e3*Math.abs(f/(12*.15)),m=c+f*_/2e3;m<0&&(m=0),a.easeTo({zoom:m,duration:_,easing:vo,around:this._aroundCenter?a.getCenter():a.unproject(d),noMoveStart:!0},{originalEvent:e});}else a.snapToNorth({},{originalEvent:e});}}},yo.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,r=t.browser.now();e.length>2&&r-e[0][0]>160;)e.shift();};var xo={scrollZoom:lo,boxZoom:co,dragRotate:ho,dragPan:fo,keyboard:_o,doubleClickZoom:go,touchZoomRotate:yo};var bo=function(e){function r(r,i){e.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=i.bearingSnap,t.bindAll(["_renderFrameCallback"],this);}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},r.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},r.prototype.panBy=function(e,r,i){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),i)},r.prototype.panTo=function(e,r,i){return this.easeTo(t.extend({center:e},r),i)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},r.prototype.zoomTo=function(e,r,i){return this.easeTo(t.extend({zoom:e},r),i)},r.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},r.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},r.prototype.rotateTo=function(e,r,i){return this.easeTo(t.extend({bearing:e},r),i)},r.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},r.prototype.resetNorthPitch=function(e,r){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),r),this},r.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(r)),c=s.rotate(-i*Math.PI/180),u=l.rotate(-i*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),f=(a.width-o.padding.left-o.padding.right)/d.x,_=(a.height-o.padding.top-o.padding.bottom)/d.y;if(!(_<0||f<0)){var m=Math.min(a.scaleZoom(a.scale*Math.min(f,_)),o.maxZoom),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:i}}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'");},r.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},r.prototype.fitScreenCoordinates=function(e,r,i,o,n){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(r)),i,o),o,n)},r.prototype._fitInternal=function(e,r,i){return e?(r=t.extend(e,r)).linear?this.easeTo(r,i):this.flyTo(r,i):this},r.prototype.jumpTo=function(e,r){this.stop();var i=this.transform,o=!1,n=!1,a=!1;return "zoom"in e&&i.zoom!==+e.zoom&&(o=!0,i.zoom=+e.zoom),void 0!==e.center&&(i.center=t.LngLat.convert(e.center)),"bearing"in e&&i.bearing!==+e.bearing&&(n=!0,i.bearing=+e.bearing),"pitch"in e&&i.pitch!==+e.pitch&&(a=!0,i.pitch=+e.pitch),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),o&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),n&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),a&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},r.prototype.easeTo=function(e,r){var i=this;this.stop(),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||t.browser.prefersReducedMotion)&&(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)/o.zoomScale(n);return e.around&&(f=t.LngLat.convert(e.around),_=o.locationPoint(f)),this._zooming=l!==n,this._rotating=a!==c,this._pitching=u!==s,this._prepareEase(r,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease(function(e){if(i._zooming&&(o.zoom=t.number(n,l,e)),i._rotating&&(o.bearing=t.number(a,c,e)),i._pitching&&(o.pitch=t.number(s,u,e)),f)o.setLocationAtPoint(f,_);else{var p=o.zoomScale(o.zoom)/o.zoomScale(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(i.transform.projection):x,h);}i._fireMoveEvents(r);},function(){e.delayEndEvents?i._easeEndTimeoutID=setTimeout(function(){return i._afterEase(r)},e.delayEndEvents):i._afterEase(r);},e),this},r.prototype._prepareEase=function(e,r){this._moving=!0,r||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));},r.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));},r.prototype._afterEase=function(e){var r=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,r&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e));},r.prototype.flyTo=function(e,r){var i=this;if(t.browser.prefersReducedMotion){var o=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(o,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var n=this.transform,a=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c="zoom"in e?t.clamp(+e.zoom,n.minZoom,n.maxZoom):a,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,p=n.zoomScale(c)/n.zoomScale(a),d=n.centerPoint.add(t.Point.convert(e.offset)),f=n.pointLocation(d),_=t.LngLat.convert(e.center||f);this._normalizeCenter(_);var m=n.project(f),g=n.project(_).sub(m),v=e.curve,y=Math.max(n.width,n.height),x=y/p,b=g.mag();if("minZoom"in e){var w=t.clamp(Math.min(e.minZoom,a,c),n.minZoom,n.maxZoom),E=y/(n.zoomScale(w)/n.zoomScale(a));v=Math.sqrt(E/b*2);}var T=v*v;function S(t){var e=(x*x-y*y+(t?-1:1)*T*T*b*b)/(2*(t?x:y)*T*b);return Math.log(Math.sqrt(e*e+1)-e)}function P(t){return (Math.exp(t)-Math.exp(-t))/2}function I(t){return (Math.exp(t)+Math.exp(-t))/2}var C=S(0),M=function(t){return I(C)/I(C+v*t)},L=function(t){return y*((I(C)*(P(e=C+v*t)/I(e))-P(C))/T)/b;var e;},z=(S(1)-C)/v;if(Math.abs(b)<1e-6||!isFinite(z)){if(Math.abs(y-x)<1e-6)return this.easeTo(e,r);var R=xe.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=h!==l,this._prepareEase(r,!1),this._ease(function(e){var o=e*z,p=1/M(o);n.zoom=1===e?c:a+n.scaleZoom(p),i._rotating&&(n.bearing=t.number(s,u,e)),i._pitching&&(n.pitch=t.number(l,h,e));var f=1===e?_:n.unproject(m.add(g.mult(L(o))).mult(p));n.setLocationAtPoint(n.renderWorldCopies?f.wrap(i.transform.projection):f,d),i._fireMoveEvents(r);},function(){return i._afterEase(r)},e),this},r.prototype.isEasing=function(){return !!this._easeFrameId},r.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},r.prototype._ease=function(e,r,i){!1===i.animate||0===i.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=i,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback));},r.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();},r.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var i=Math.abs(e-r);return Math.abs(e-360-r)r?-e:o<-r?e:0;}},r}(t.Evented),wo=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this);};wo.prototype.getDefaultPosition=function(){return "bottom-right"},wo.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),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},wo.prototype.onRemove=function(){r.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;},wo.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var i=r.reduce(function(t,e,i){return e.value&&(t+=e.key+"="+e.value+(i=0)return !1;return !0})).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null);}},wo.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact");};var Eo=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this);};Eo.prototype.onAdd=function(t){this._map=t,this._container=r.create("div","mapboxgl-ctrl");var e=r.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label","Mapbox logo"),e.setAttribute("rel","noopener nofollow"),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},Eo.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact);},Eo.prototype.getDefaultPosition=function(){return "bottom-left"},Eo.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none");},Eo.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}},Eo.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 To=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1;};To.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},To.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,i=e?this._queue.concat(e):this._queue;re.maxZoom)throw new Error("maxZoom must be greater than minZoom");var a=new ro(n,e.minZoom,e.maxZoom,e.renderWorldCopies);if(i.call(this,a,e),this.projection=n,this._intScrollZoom=e.intScrollZoom,!0===this._intScrollZoom&&(e.zoom=Math.round(e.zoom||0)),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,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 To,this._controls=[],this._mapId=t.uniqueId(),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),this._skipLevelOfZooming=e.skipLevelOfZooming,"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 Po))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container;}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.triggerRepaint=t.rateLimit(this.triggerRepaint,e.renderInterval,this),this._skipLevelOfZooming?(this.on("moveend",function(){return o._update(!1)}),this.on("zoomend",function(){return o._update(!0)})):(this.on("move",function(){return o._update(!1)}),this.on("moveend",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 i=t.getCanvasContainer(),o=null,n=!1,a=null;for(var s in xo)t[s]=new xo[s](t,e),e.interactive&&e[s]&&t[s].enable(e[s]);r.addEventListener(i,"mouseout",function(e){t.fire(new no("mouseout",t,e));}),r.addEventListener(i,"mousedown",function(o){n=!0,a=r.mousePos(i,o);var s=new no("mousedown",t,o);if(t.fire(s),s.defaultPrevented)return;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);}),r.addEventListener(i,"mouseup",function(e){var r=t.dragRotate.isActive();o&&!r&&t.fire(new no("contextmenu",t,o));o=null,n=!1,t.fire(new no("mouseup",t,e));}),r.addEventListener(i,"mousemove",function(e){if(t.dragPan.isActive())return;if(t.dragRotate.isActive())return;var r=e.target;for(;r&&r!==i;)r=r.parentNode;if(r!==i)return;t.fire(new no("mousemove",t,e));}),r.addEventListener(i,"mouseover",function(e){var r=e.target;for(;r&&r!==i;)r=r.parentNode;if(r!==i)return;t.fire(new no("mouseover",t,e));}),r.addEventListener(i,"touchstart",function(r){var i=new ao("touchstart",t,r);if(t.fire(i),i.defaultPrevented)return;e.interactive&&t.stop();t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(r);t.touchZoomRotate.onStart(r),t.doubleClickZoom.onTouchStart(i);},{passive:!1}),r.addEventListener(i,"touchmove",function(e){t.fire(new ao("touchmove",t,e));},{passive:!1}),r.addEventListener(i,"touchend",function(e){t.fire(new ao("touchend",t,e));}),r.addEventListener(i,"touchcancel",function(e){t.fire(new ao("touchcancel",t,e));}),r.addEventListener(i,"click",function(o){var n=r.mousePos(i,o);(!a||n.equals(a)||n.dist(a)-1&&this._controls.splice(r,1),e.onRemove(this),this},o.prototype.resize=function(e){var r=this._containerDimensions(),i=r[0],o=r[1];return this._resizeCanvas(i,o),this.transform.resize(i,o),this.painter.resize(i,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.setVisibleBoundary=function(t,e){return this.style.setVisibleBoundary(t,e),this._update(!0)},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,r){var o=this;if(void 0===r)return i.prototype.on.call(this,t,e);var n=function(){var i;if("mouseenter"===t||"mouseover"===t){var n=!1;return {layer:e,listener:r,delegates:{mousemove:function(i){var a=o.getLayer(e)?o.queryRenderedFeatures(i.point,{layers:[e]}):[];a.length?n||(n=!0,r.call(o,new no(t,o,i.originalEvent,{features:a}))):n=!1;},mouseout:function(){n=!1;}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return {layer:e,listener:r,delegates:{mousemove:function(i){(o.getLayer(e)?o.queryRenderedFeatures(i.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(o,new no(t,o,i.originalEvent)));},mouseout:function(e){a&&(a=!1,r.call(o,new no(t,o,e.originalEvent)));}}}}return {layer:e,listener:r,delegates:(i={},i[t]=function(t){var i=o.getLayer(e)?o.queryRenderedFeatures(t.point,{layers:[e]}):[];i.length&&(t.features=i,r.call(o,t),delete t.features);},i)}}();for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(n),n.delegates)this.on(a,n.delegates[a]);return this},o.prototype.off=function(t,e,r){if(void 0===r)return i.prototype.off.call(this,t,e);if(this._delegatedListeners&&this._delegatedListeners[t])for(var o=this._delegatedListeners[t],n=0;no/2;){var l=i.locationPoint(e);if(l.x>=0&&l.y>=0&&l.x<=i.width&&l.y<=i.height)break;e.lng>i.center.lng?e.lng-=o:e.lng+=o;}return e}zo.prototype._updateZoomButtons=function(){var t=this._map.getZoom();t===this._map.getMaxZoom()?this._zoomInButton.classList.add("mapboxgl-ctrl-icon-disabled"):this._zoomInButton.classList.remove("mapboxgl-ctrl-icon-disabled"),t===this._map.getMinZoom()?this._zoomOutButton.classList.add("mapboxgl-ctrl-icon-disabled"):this._zoomOutButton.classList.remove("mapboxgl-ctrl-icon-disabled");},zo.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t;},zo.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new ho(t,{button:"left",element:this._compass}),r.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),r.addEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.enable()),this._container},zo.prototype.onRemove=function(){r.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),r.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),r.removeEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.disable(),delete this._handler),delete this._map;},zo.prototype._createButton=function(t,e,i){var o=r.create("button",t,this._container);return o.type="button",o.title=e,o.setAttribute("aria-label",e),o.addEventListener("click",i),o};var Ao={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 Do(t,e,r){var i=t.classList;for(var o in Ao)i.remove("mapboxgl-"+r+"-anchor-"+o);i.add("mapboxgl-"+r+"-anchor-"+e);}var ko,Bo=function(e){function i(i,o){if(e.call(this),(i instanceof t.window.HTMLElement||o)&&(i=t.extend({element:i},o)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick"],this),this._anchor=i&&i.anchor||"center",this._color=i&&i.color||"#3FB1CE",this._draggable=i&&i.draggable||!1,this._state="inactive",i&&i.element)this._element=i.element,this._offset=t.Point.convert(i&&i.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div");var n=r.createNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height","41px"),n.setAttributeNS(null,"width","27px"),n.setAttributeNS(null,"viewBox","0 0 27 41");var a=r.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=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var l=r.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)Zo(e,c,p/5280,"mi");else Zo(e,c,p,"ft");}else if(r&&"nautical"===r.unit){Zo(e,c,h/1852,"nm");}else Zo(e,c,h,"m");}function Zo(t,e,r,i){var o,n,a,s=(o=r,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/r;"m"===i&&s>=1e3&&(s/=1e3,i="km"),t.style.width=e*l+"px",t.innerHTML=s+i;}No.prototype.getDefaultPosition=function(){return "bottom-left"},No.prototype._onMove=function(){jo(this._map,this._container,this.options);},No.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},No.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0;},No.prototype.setUnit=function(t){this.options.unit=t,jo(this._map,this._container,this.options);};var Go=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),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";};Go.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div",this._className+" mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Go.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon);},Go.prototype._checkFullscreenSupport=function(){return !!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Go.prototype._setupUI=function(){(this._fullscreenButton=r.create("button",this._className+"-icon "+this._className+"-fullscreen",this._controlContainer)).type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon);},Go.prototype._updateTitle=function(){var t=this._isFullscreen()?"退出全屏":"进入全屏";this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t;},Go.prototype._isFullscreen=function(){return this._fullscreen},Go.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle(this._className+"-shrink"),this._fullscreenButton.classList.toggle(this._className+"-fullscreen"),this._updateTitle());},Go.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._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen();};var qo={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"auto",showArrow:!0,contentClass:""},Vo=function(e){function i(r){e.call(this),this.options=t.extend(Object.create(qo),r),t.bindAll(["_update","_onClickClose","remove"],this);}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.addTo=function(e){var r=this;return this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",function(t){r._update(t.point);}),this._map.on("mouseup",function(t){r._update(t.point);}),this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},i.prototype.isOpen=function(){return !!this._map},i.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),this._map.off("remove",this.remove),this._map.off("mousemove"),delete this._map),this.fire(new t.Event("close")),this},i.prototype.getLngLat=function(){return this._lngLat},i.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove"),this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},i.prototype.trackPointer=function(){var t=this;return this._trackPointer=!0,this._pos=null,this._map&&(this._map.off("move",this._update),this._map.on("mousemove",function(e){t._update(e.point);}),this._map.on("drag",function(e){t._update(e.point);}),this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},i.prototype.getElement=function(){return this._container},i.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},i.prototype.setHTML=function(e){var r,i=t.window.document.createDocumentFragment(),o=t.window.document.createElement("body");for(o.innerHTML=e;r=o.firstChild;)i.appendChild(r);return this.setDOMContent(i)},i.prototype.getMaxWidth=function(){return this._container.style.maxWidth},i.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},i.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},i.prototype._createContent=function(){this._content&&r.remove(this._content);var t=this.options.contentClass?" mapboxgl-popup-content-"+this.options.contentClass:"";this._content=r.create("div","mapboxgl-popup-content"+t,this._container),this.options.closeButton&&(this._closeButton=r.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));},i.prototype._update=function(e){var i=this,o=this._lngLat||this._trackPointer;if(this._map&&o&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this.options.showArrow&&(this._tip=r.create("div","mapboxgl-popup-tip",this._container)),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(t){return i._container.classList.add(t)})),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ro(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var n=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,s=function e(r){if(r){if("number"==typeof r){var i=Math.round(Math.sqrt(.5*Math.pow(r,2)));return {center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(i,i),"top-right":new t.Point(-i,i),bottom:new t.Point(0,-r),"bottom-left":new t.Point(i,-i),"bottom-right":new t.Point(-i,-i),left:new t.Point(r,0),right:new t.Point(-r,0)}}if(r instanceof t.Point||Array.isArray(r)){var o=t.Point.convert(r);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(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!a){var l,c=this._container.offsetWidth,u=this._container.offsetHeight;l=n.y+s.bottom.ythis._map.transform.height-u?["bottom"]:[],n.xthis._map.transform.width-c/2&&l.push("right"),a=0===l.length?"bottom":l.join("-");}var h=n.add(s[a]).round();r.setTransform(this._container,Ao[a]+" translate("+h.x+"px,"+h.y+"px)"),Do(this._container,a,"popup");}},i.prototype._onClickClose=function(){this.remove();},i}(t.Evented);function Xo(e,r,i,o,n){if(!(!o||n||Jo(e,o)&&Ko(e,o)===r))throw new Error("beforeId must be the id of a layer within the same group");o||n||(o=Yo(e,Wo(e,r)-1));var a=t.extend({},i,{metadata:t.extend({},i.metadata||{},{group:r})});e.addLayer(a,o);}function Wo(t,e){return Yo(t,Ho(t,e))}function Ho(t,e){for(var r=t.getStyle().layers,i=0;i=t){i=tn.scalePoint(t/a,o,n);break}t-=a,o=n,r++,this.rotateOptions.push({point:[].concat(o),bearing:tn.calcBearing(o,this.PATH[r])});}this.preIndex=r-1,this.currentPoint=i;};var rn=function(t,e){if(!t||t.length<=1)throw new Error("flyroute: 无效的飞行轨迹!");if(e){var r=e[0],i=e[1];if(!r||!i||r>=i)throw new Error("无效的zoomRange!")}this._units="degrees",this._status=0,this._control=new en([].concat(t),0,e);},on={Speed:{configurable:!0},Percent:{configurable:!0},PathLine:{configurable:!0}};on.Speed.get=function(){return Math.round(this._control.getSpeed()/(1/t.METERS_PER_UNIT[this._units]))},on.Speed.set=function(e){e=Math.max(0,e),this._control.setSpeed(Math.round(e)*(1/t.METERS_PER_UNIT[this._units]));},on.Percent.get=function(){return this._control.getPercent()},on.Percent.set=function(t){this._control.setPercent(t);},on.PathLine.get=function(){return this._control.getPassLine()},rn.prototype.addTo=function(t){return this._map||(this._map=t,this._units=t.units||t.projection.getUnits(),this.Speed=1),this},rn.prototype.remove=function(){this.stop(),delete this.update,delete this._control,delete this._units,delete this._map;},rn.prototype.play=function(){return this._status=1,this._update(),this},rn.prototype.replay=function(){this.stop(),this._control.setPercent(0),this.play();},rn.prototype.stop=function(){return this._status=0,this._frameId&&(this._map._cancelRenderFrame(this._frameId),delete this._frameId),this},rn.prototype._update=function(){var e=this;this._frameId||(this._frameId=this._map._requestRenderFrame(function(){if(delete e._frameId,0!==e._status){var r=e._map.transform,i=e._control;i.getPercent()<100?(i.calcNextPoint(),e._frame(function(e,i){var o=i.point,n=i.bearing;0===e&&(r.center=t.LngLat.convert(o)),r.bearing=n;},function(){var o={center:i.getCurrentPoint(),bearing:+i.getBearing(),zoom:+i.getZoom()};isFinite(o.zoom)&&(r.zoom=o.zoom),isFinite(o.bearing)&&(r.bearing=o.bearing),o.center&&(r.center=t.LngLat.convert(o.center)),e.update&&e.update(o.center,e),e._update();})):e.stop();}}));},rn.prototype._frame=function(e,r){var i=this._map,o=this._control.rotateOptions||[];if(o.length){var n=function(){var a=o.shift(),s=a.point,l=a.bearing;if(l){var c=i.getBearing();l=i._normalizeBearing(l,c);var u=Math.floor(Math.abs(l-c)),h=0,p=function(){var a=h/u;i._requestRenderFrame(function(){e(a,{point:s,bearing:t.number(c,l,a)}),a>=1?0===o.length?r():n():(h++,p());});};p();}else r(1);};n();}else r(1);},Object.defineProperties(rn.prototype,on);var nn=function(e){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),t.bindAll(["_onMouseDown","_onMouseMove","_onMouseUp","_onKeyDown"],this);};nn.prototype.isEnabled=function(){return !!this._enabled},nn.prototype.isActive=function(){return !!this._active},nn.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0);},nn.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1);},nn.prototype._onMouseDown=function(e){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),r.disableDrag(),this._startPos=r.mousePos(this._el,e),this._active=!0);},nn.prototype._onMouseMove=function(t){var e=this._startPos,i=r.mousePos(this._el,t);this._box||(this._box=r.create("div","mapboxgl-boxhandler",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxstart",t));var o=Math.min(e.x,i.x),n=Math.max(e.x,i.x),a=Math.min(e.y,i.y),s=Math.max(e.y,i.y);r.setTransform(this._box,"translate("+o+"px,"+a+"px)"),this._box.style.width=n-o+"px",this._box.style.height=s-a+"px";},nn.prototype._onMouseUp=function(e){var i=this;if(0===e.button){var o=this._startPos,n=r.mousePos(this._el,e),a=(new t.LngLatBounds).extend(this._map.unproject(o)).extend(this._map.unproject(n)),s=[t.Point.convert(o),t.Point.convert(n)],l=[s[0],new t.Point(s[1].x,s[0].y),s[1],new t.Point(s[0].x,s[1].y)].map(function(t){return i._map.unproject(t)});this._finish(),o.x===n.x&&o.y===n.y||this._map.fire("boxend",{originalEvent:e,boxBounds:a,boxLnglats:l,startPos:o,endPos:n});}},nn.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxcancel",t));},nn.prototype._finish=function(){this._active=!1,t.window.document.removeEventListener("mousemove",this._onMouseMove,!1),t.window.document.removeEventListener("keydown",this._onKeyDown,!1),t.window.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),r.enableDrag();},nn.prototype._fireEvent=function(t,e){return this._map.fire(t,{originalEvent:e})};var an=function(e){function r(r){var i=r.mapCRS,o=r.units||"degrees";if(delete r.projection,i)if("object"!=typeof i)r.projection=t.get(i);else{var n=i.topTileExtent,a=i.resolutions,s=i.tileSize,l=i.units,c=i.validlatRange;r.projection=new t.Projection({code:"mapcrs",units:l||o,extent:n||[-180,-90,180,90],resolutions:a,validlatRange:c,tileSize:s||t.window.GEOGLOBE_TILESIZE||512});}if(r.projection){var u=r.projection;i={units:u.getUnits(),topTileExtent:u.getExtent(),resolutions:u.getResolutions(),tileSize:u.getTileSize()},o=u.getUnits();}e.call(this,r),this._mapCRS=i,this.units=o;}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var i={_tileExtent:{configurable:!0}};return i._tileExtent.get=function(){return "EPSG:mapbox"===this.projection.getCode()||"EPSG:mapbox"===this.projection.originCode?[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]:this.projection.getExtent()},Object.defineProperties(r.prototype,i),r}(Co);var sn=function(t,e){this.gl=t,this.set(e);};sn.prototype.set=function(t){var e=this.gl;this.destroy(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),this.buffer=e.createBuffer(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.buffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW),this.length=t.length;},sn.prototype.bind=function(){var t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.buffer);},sn.prototype.updateData=function(t){if(t.length===this.length){var e=this.gl;this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t);}},sn.prototype.destroy=function(){var t=this.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer);};var ln={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},cn=function(t,e,r){this.gl=t,this.attributes=r.members,this.itemSize=r.size,this.set(e);};cn.prototype.set=function(t){var e=this.gl;this.destroy(),e.bindBuffer(e.ARRAY_BUFFER,null),this.buffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this.buffer),e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW),this.length=t.length;},cn.prototype.bind=function(){var t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,this.buffer);},cn.prototype.updateData=function(t){if(t.length===this.length){var e=this.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t);}},cn.prototype.enableAttributes=function(t){for(var e=this.gl,r=0;r65535?Uint32Array:Uint16Array)(3*o),c=0;c65535?Uint32Array:Uint16Array)(e*r*6),f=0;f<=e;f++)for(var _=0;_<=r;_++){var m=_/r,g=f/e,v=_+f*(r+1),y=2*v,x=3*v,b=s*m,w=a*g,E=Math.sin(b),T=Math.cos(b),S=Math.sin(w),P=T*S,I=Math.cos(w),C=E*S,M=n(P,I,C,m,g);u[x+0]=M*P,u[x+1]=M*I,u[x+2]=M*C,h[x+0]=P,h[x+1]=I,h[x+2]=C,p[y+0]=m,p[y+1]=1-g;}for(var L=r+1,z=0;z